orion-super-agent-dev 0.1.31 → 0.1.32

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/out/main.js CHANGED
@@ -10029,7 +10029,7 @@ var require_react_reconciler_development = __commonJS({
10029
10029
  var HostPortal = 4;
10030
10030
  var HostComponent = 5;
10031
10031
  var HostText = 6;
10032
- var Fragment14 = 7;
10032
+ var Fragment15 = 7;
10033
10033
  var Mode = 8;
10034
10034
  var ContextConsumer = 9;
10035
10035
  var ContextProvider = 10;
@@ -10169,7 +10169,7 @@ var require_react_reconciler_development = __commonJS({
10169
10169
  return "DehydratedFragment";
10170
10170
  case ForwardRef:
10171
10171
  return getWrappedName$1(type, type.render, "ForwardRef");
10172
- case Fragment14:
10172
+ case Fragment15:
10173
10173
  return "Fragment";
10174
10174
  case HostComponent:
10175
10175
  return type;
@@ -13303,7 +13303,7 @@ var require_react_reconciler_development = __commonJS({
13303
13303
  }
13304
13304
  }
13305
13305
  function updateFragment2(returnFiber, current3, fragment, lanes, key) {
13306
- if (current3 === null || current3.tag !== Fragment14) {
13306
+ if (current3 === null || current3.tag !== Fragment15) {
13307
13307
  var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
13308
13308
  created.return = returnFiber;
13309
13309
  return created;
@@ -13706,7 +13706,7 @@ var require_react_reconciler_development = __commonJS({
13706
13706
  if (child.key === key) {
13707
13707
  var elementType = element.type;
13708
13708
  if (elementType === REACT_FRAGMENT_TYPE) {
13709
- if (child.tag === Fragment14) {
13709
+ if (child.tag === Fragment15) {
13710
13710
  deleteRemainingChildren(returnFiber, child.sibling);
13711
13711
  var existing = useFiber(child, element.props.children);
13712
13712
  existing.return = returnFiber;
@@ -19197,7 +19197,7 @@ var require_react_reconciler_development = __commonJS({
19197
19197
  var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
19198
19198
  return updateForwardRef(current3, workInProgress2, type, _resolvedProps2, renderLanes2);
19199
19199
  }
19200
- case Fragment14:
19200
+ case Fragment15:
19201
19201
  return updateFragment(current3, workInProgress2, renderLanes2);
19202
19202
  case Mode:
19203
19203
  return updateMode(current3, workInProgress2, renderLanes2);
@@ -19634,7 +19634,7 @@ var require_react_reconciler_development = __commonJS({
19634
19634
  case SimpleMemoComponent:
19635
19635
  case FunctionComponent:
19636
19636
  case ForwardRef:
19637
- case Fragment14:
19637
+ case Fragment15:
19638
19638
  case Mode:
19639
19639
  case Profiler:
19640
19640
  case ContextConsumer:
@@ -24402,7 +24402,7 @@ var require_react_reconciler_development = __commonJS({
24402
24402
  return fiber;
24403
24403
  }
24404
24404
  function createFiberFromFragment(elements, mode, lanes, key) {
24405
- var fiber = createFiber(Fragment14, elements, key, mode);
24405
+ var fiber = createFiber(Fragment15, elements, key, mode);
24406
24406
  fiber.lanes = lanes;
24407
24407
  return fiber;
24408
24408
  }
@@ -38004,7 +38004,8 @@ var require_customProviders = __commonJS({
38004
38004
  exports2.setCustomProviderRoutingModels = setCustomProviderRoutingModels;
38005
38005
  exports2.removeCustomProvider = removeCustomProvider3;
38006
38006
  exports2.resolveApiKey = resolveApiKey2;
38007
- exports2.probeModels = probeModels3;
38007
+ exports2.probedModelFromRow = probedModelFromRow;
38008
+ exports2.probeModels = probeModels;
38008
38009
  exports2.configureEndpointRouting = configureEndpointRouting;
38009
38010
  exports2.endpointRoutingFor = endpointRoutingFor2;
38010
38011
  exports2.refreshEndpointRouting = refreshEndpointRouting2;
@@ -38067,6 +38068,8 @@ var require_customProviders = __commonJS({
38067
38068
  normalizeNumber(config, "topP", 0, 1);
38068
38069
  normalizeNumber(config, "topK", 1, 1e3);
38069
38070
  normalizeNumber(config, "repetitionPenalty", 0.5, 3);
38071
+ if (typeof config.promptCache !== "boolean")
38072
+ delete config.promptCache;
38070
38073
  return config;
38071
38074
  }
38072
38075
  function normalizeNumber(config, key, min, max) {
@@ -38314,6 +38317,8 @@ var require_customProviders = __commonJS({
38314
38317
  // OpenRouter, Together
38315
38318
  ["max_model_len"],
38316
38319
  // vLLM
38320
+ ["max_context_length"],
38321
+ // LM Studio (/api/v0/models)
38317
38322
  ["context_window"],
38318
38323
  ["top_provider", "context_length"]
38319
38324
  ];
@@ -38343,7 +38348,7 @@ var require_customProviders = __commonJS({
38343
38348
  }
38344
38349
  return void 0;
38345
38350
  }
38346
- function toProbedModel(raw) {
38351
+ function probedModelFromRow(raw) {
38347
38352
  if (typeof raw !== "object" || raw === null || Array.isArray(raw))
38348
38353
  return null;
38349
38354
  const row = raw;
@@ -38362,7 +38367,7 @@ var require_customProviders = __commonJS({
38362
38367
  model.reasoning = reasoning;
38363
38368
  return model;
38364
38369
  }
38365
- async function probeModels3(baseUrl, apiKey, fetchImpl = http_js_1.httpFetch) {
38370
+ async function probeModels(baseUrl, apiKey, fetchImpl = http_js_1.httpFetch) {
38366
38371
  try {
38367
38372
  const url = `${baseUrl.replace(/\/+$/, "")}/models`;
38368
38373
  const headers = {};
@@ -38375,7 +38380,7 @@ var require_customProviders = __commonJS({
38375
38380
  const rows = Array.isArray(parsed?.data) ? parsed.data : Array.isArray(parsed) ? parsed : null;
38376
38381
  if (rows === null)
38377
38382
  return null;
38378
- return rows.map(toProbedModel).filter((model) => model !== null);
38383
+ return rows.map(probedModelFromRow).filter((model) => model !== null);
38379
38384
  } catch {
38380
38385
  return null;
38381
38386
  }
@@ -38534,7 +38539,8 @@ var require_customProviders = __commonJS({
38534
38539
  ...knob("temperature"),
38535
38540
  ...knob("topP"),
38536
38541
  ...knob("topK"),
38537
- ...knob("repetitionPenalty")
38542
+ ...knob("repetitionPenalty"),
38543
+ ...typeof declared.promptCache === "boolean" ? { promptCache: declared.promptCache } : {}
38538
38544
  };
38539
38545
  }
38540
38546
  }
@@ -40321,6 +40327,483 @@ var require_duetExecutorGate = __commonJS({
40321
40327
  }
40322
40328
  });
40323
40329
 
40330
+ // ../packages/orion-client-core/dist/endpointDiscovery.js
40331
+ var require_endpointDiscovery = __commonJS({
40332
+ "../packages/orion-client-core/dist/endpointDiscovery.js"(exports2) {
40333
+ "use strict";
40334
+ Object.defineProperty(exports2, "__esModule", { value: true });
40335
+ exports2.LADDER_RUNG_TIMEOUT_MS = void 0;
40336
+ exports2.normalizeEndpointBaseUrl = normalizeEndpointBaseUrl3;
40337
+ exports2.listingLadder = listingLadder;
40338
+ exports2.readListing = readListing;
40339
+ exports2.discoverEndpointModels = discoverEndpointModels2;
40340
+ exports2.chatLadder = chatLadder;
40341
+ exports2.verifyEndpointChat = verifyEndpointChat2;
40342
+ exports2.endpointFailureText = endpointFailureText3;
40343
+ var customProviders_1 = require_customProviders();
40344
+ var http_js_1 = require_http();
40345
+ var loopback_js_1 = require_loopback();
40346
+ var networkFailure_js_1 = require_networkFailure();
40347
+ var DETAIL_MAX = 160;
40348
+ function excerpt(text) {
40349
+ const flat = text.replace(/\s+/g, " ").trim();
40350
+ return flat.length > DETAIL_MAX ? `${flat.slice(0, DETAIL_MAX - 1)}\u2026` : flat;
40351
+ }
40352
+ function serverMessage(bodyText) {
40353
+ try {
40354
+ const parsed = JSON.parse(bodyText);
40355
+ if (typeof parsed === "object" && parsed !== null) {
40356
+ const body2 = parsed;
40357
+ const error = body2.error;
40358
+ if (typeof error === "string")
40359
+ return excerpt(error);
40360
+ if (typeof error === "object" && error !== null) {
40361
+ const message = error.message;
40362
+ if (typeof message === "string")
40363
+ return excerpt(message);
40364
+ }
40365
+ for (const key of ["detail", "message"]) {
40366
+ const value = body2[key];
40367
+ if (typeof value === "string")
40368
+ return excerpt(value);
40369
+ }
40370
+ }
40371
+ } catch {
40372
+ }
40373
+ return excerpt(bodyText);
40374
+ }
40375
+ function failureFromError(error, phase) {
40376
+ const name2 = error instanceof Error ? error.name : "";
40377
+ if (name2 === "TimeoutError" || name2 === "AbortError") {
40378
+ return { kind: "timeout", phase };
40379
+ }
40380
+ const failure = (0, networkFailure_js_1.describeNetworkFailure)(error);
40381
+ if (failure.kind === "tls-untrusted" || failure.kind === "proxy-auth") {
40382
+ return { kind: failure.kind, phase, detail: failure.code ?? failure.kind, message: (0, networkFailure_js_1.networkFailureText)(error) };
40383
+ }
40384
+ const cause = error?.cause;
40385
+ const said = cause instanceof Error ? cause.message : error instanceof Error ? error.message : String(error);
40386
+ return { kind: "unreachable", phase, detail: failure.code ?? excerpt(said) };
40387
+ }
40388
+ var ROUTE_SUFFIXES = [
40389
+ "/chat/completions",
40390
+ "/completions",
40391
+ "/messages",
40392
+ "/models",
40393
+ "/embeddings",
40394
+ "/responses"
40395
+ ];
40396
+ function stripTrailingSlashes(path14) {
40397
+ return path14.replace(/\/+$/, "");
40398
+ }
40399
+ function normalizeEndpointBaseUrl3(raw) {
40400
+ const trimmed = raw.trim();
40401
+ let url;
40402
+ try {
40403
+ url = new URL(trimmed);
40404
+ } catch {
40405
+ return { baseUrl: trimmed };
40406
+ }
40407
+ if (url.protocol !== "http:" && url.protocol !== "https:")
40408
+ return { baseUrl: trimmed };
40409
+ let path14 = stripTrailingSlashes(url.pathname);
40410
+ const removed = [];
40411
+ const lower = path14.toLowerCase();
40412
+ for (const suffix of ROUTE_SUFFIXES) {
40413
+ if (lower.endsWith(suffix)) {
40414
+ path14 = stripTrailingSlashes(path14.slice(0, path14.length - suffix.length));
40415
+ removed.push(suffix);
40416
+ break;
40417
+ }
40418
+ }
40419
+ if (url.search !== "")
40420
+ removed.push("the query string");
40421
+ const result = { baseUrl: `${url.origin}${path14}` };
40422
+ if (removed.length > 0) {
40423
+ result.note = `Removed ${removed.join(" and ")} \u2014 the base URL is the part before it.`;
40424
+ }
40425
+ if (url.protocol === "http:" && !(0, loopback_js_1.isLoopbackHost)(url.hostname)) {
40426
+ result.warning = "This address is unencrypted (http). If the server redirects to https, use the https address instead.";
40427
+ }
40428
+ return result;
40429
+ }
40430
+ exports2.LADDER_RUNG_TIMEOUT_MS = 5e3;
40431
+ var MAX_LADDER_RUNGS = 6;
40432
+ function baseParts(baseUrl) {
40433
+ let url;
40434
+ try {
40435
+ url = new URL(baseUrl);
40436
+ } catch {
40437
+ return null;
40438
+ }
40439
+ if (url.protocol !== "http:" && url.protocol !== "https:")
40440
+ return null;
40441
+ return { origin: url.origin, path: stripTrailingSlashes(url.pathname) };
40442
+ }
40443
+ function listingLadder(baseUrl) {
40444
+ const parts2 = baseParts(baseUrl);
40445
+ if (parts2 === null)
40446
+ return [];
40447
+ const { origin, path: path14 } = parts2;
40448
+ const rungs = [{ url: `${origin}${path14}/models`, shape: "openai" }];
40449
+ if (/\/serving-endpoints$/i.test(path14)) {
40450
+ rungs.push({ url: `${origin}/api/2.0/serving-endpoints`, shape: "databricks" });
40451
+ }
40452
+ if (/\/v1$/i.test(path14)) {
40453
+ rungs.push({ url: `${origin}${path14.slice(0, -3)}/models`, shape: "openai" });
40454
+ } else {
40455
+ rungs.push({ url: `${origin}${path14}/v1/models`, shape: "openai" });
40456
+ }
40457
+ rungs.push({ url: `${origin}/api/v1/models`, shape: "openai" });
40458
+ rungs.push({ url: `${origin}/api/v0/models`, shape: "lmstudio" });
40459
+ rungs.push({ url: `${origin}/api/tags`, shape: "ollama" });
40460
+ const seen = /* @__PURE__ */ new Set();
40461
+ const unique = [];
40462
+ for (const rung of rungs) {
40463
+ if (seen.has(rung.url))
40464
+ continue;
40465
+ seen.add(rung.url);
40466
+ unique.push(rung);
40467
+ }
40468
+ return unique.slice(0, MAX_LADDER_RUNGS);
40469
+ }
40470
+ function openAiRows(body2) {
40471
+ if (Array.isArray(body2))
40472
+ return body2;
40473
+ const data = body2?.data;
40474
+ return Array.isArray(data) ? data : null;
40475
+ }
40476
+ function rowsOf(body2, key) {
40477
+ if (typeof body2 !== "object" || body2 === null || Array.isArray(body2))
40478
+ return null;
40479
+ const rows = body2[key];
40480
+ return Array.isArray(rows) ? rows : null;
40481
+ }
40482
+ function stringField(row, key) {
40483
+ if (typeof row !== "object" || row === null)
40484
+ return void 0;
40485
+ const value = row[key];
40486
+ return typeof value === "string" && value.trim() !== "" ? value : void 0;
40487
+ }
40488
+ function readListing(body2, shape) {
40489
+ switch (shape) {
40490
+ case "openai": {
40491
+ const rows = openAiRows(body2);
40492
+ return rows === null ? null : rows.map(customProviders_1.probedModelFromRow).filter(isModel);
40493
+ }
40494
+ case "lmstudio": {
40495
+ const rows = openAiRows(body2);
40496
+ return rows === null ? null : rows.filter((row) => stringField(row, "type") !== "embeddings").map(customProviders_1.probedModelFromRow).filter(isModel);
40497
+ }
40498
+ case "ollama": {
40499
+ const rows = rowsOf(body2, "models");
40500
+ return rows === null ? null : rows.map((row) => stringField(row, "name") ?? stringField(row, "model")).filter((id) => id !== void 0).map((id) => ({ id }));
40501
+ }
40502
+ case "databricks": {
40503
+ const rows = rowsOf(body2, "endpoints");
40504
+ return rows === null ? null : rows.filter((row) => {
40505
+ const task = stringField(row, "task");
40506
+ if (task !== void 0 && !/chat|completions/i.test(task))
40507
+ return false;
40508
+ const state = row.state;
40509
+ const ready = state?.ready;
40510
+ return typeof ready !== "string" || ready.toUpperCase() === "READY";
40511
+ }).map((row) => stringField(row, "name")).filter((id) => id !== void 0).map((id) => ({ id }));
40512
+ }
40513
+ }
40514
+ }
40515
+ function isModel(model) {
40516
+ return model !== null;
40517
+ }
40518
+ function authHeaders(apiKey) {
40519
+ return apiKey !== void 0 && apiKey !== "" ? { Authorization: `Bearer ${apiKey}` } : {};
40520
+ }
40521
+ function isRedirect(response) {
40522
+ return response.type === "opaqueredirect" || response.status >= 300 && response.status < 400;
40523
+ }
40524
+ var MAX_REDIRECT_HOPS = 2;
40525
+ function redirectTarget(requested, location) {
40526
+ if (location === null)
40527
+ return { kind: "elsewhere" };
40528
+ let from;
40529
+ let to;
40530
+ try {
40531
+ from = new URL(requested);
40532
+ to = new URL(location, requested);
40533
+ } catch {
40534
+ return { kind: "elsewhere" };
40535
+ }
40536
+ if (to.origin === from.origin)
40537
+ return { kind: "same-origin", url: to.href };
40538
+ if (from.protocol === "http:" && to.protocol === "https:" && to.hostname === from.hostname) {
40539
+ return { kind: "https-twin", twin: to };
40540
+ }
40541
+ return { kind: "elsewhere" };
40542
+ }
40543
+ function httpsBase(baseUrl, twin) {
40544
+ const parts2 = baseParts(baseUrl);
40545
+ return `${twin.origin}${parts2?.path ?? ""}`;
40546
+ }
40547
+ async function askRung(rung, apiKey, timeoutMs, fetchImpl) {
40548
+ let url = rung.url;
40549
+ for (let hop = 0; ; hop += 1) {
40550
+ let response;
40551
+ try {
40552
+ response = await fetchImpl(url, {
40553
+ headers: authHeaders(apiKey),
40554
+ redirect: "manual",
40555
+ signal: AbortSignal.timeout(timeoutMs)
40556
+ });
40557
+ } catch (error) {
40558
+ return { kind: "stop", failure: failureFromError(error, "listing") };
40559
+ }
40560
+ const status = response.status;
40561
+ if (isRedirect(response)) {
40562
+ const target = redirectTarget(url, response.headers?.get("location") ?? null);
40563
+ if (target.kind === "same-origin" && hop < MAX_REDIRECT_HOPS) {
40564
+ url = target.url;
40565
+ continue;
40566
+ }
40567
+ return target.kind === "https-twin" ? { kind: "https", twin: target.twin } : { kind: "next", failure: { kind: "no-listing", phase: "listing", status, detail: "redirected" } };
40568
+ }
40569
+ if (status === 401 || status === 403) {
40570
+ return { kind: "stop", failure: { kind: "unauthorized", phase: "listing", status } };
40571
+ }
40572
+ if (status === 429) {
40573
+ return { kind: "stop", failure: { kind: "unknown", phase: "listing", status, detail: "rate limited" } };
40574
+ }
40575
+ if (!response.ok) {
40576
+ return { kind: "next", failure: { kind: "no-listing", phase: "listing", status } };
40577
+ }
40578
+ let body2;
40579
+ try {
40580
+ body2 = await response.json();
40581
+ } catch {
40582
+ return {
40583
+ kind: "next",
40584
+ failure: { kind: "no-listing", phase: "listing", status, detail: "answered, but not with JSON" }
40585
+ };
40586
+ }
40587
+ const models = readListing(body2, rung.shape);
40588
+ if (models === null) {
40589
+ return {
40590
+ kind: "next",
40591
+ failure: { kind: "no-listing", phase: "listing", status, detail: "answered, but not with a model list" }
40592
+ };
40593
+ }
40594
+ return { kind: "models", models, url };
40595
+ }
40596
+ }
40597
+ async function discoverEndpointModels2(baseUrl, apiKey, options = {}) {
40598
+ return discover(baseUrl, apiKey, options, true);
40599
+ }
40600
+ async function discover(baseUrl, apiKey, options, mayUpgrade) {
40601
+ const parts2 = baseParts(baseUrl.trim());
40602
+ if (parts2 === null) {
40603
+ return { ok: false, failure: { kind: "unknown", phase: "listing", detail: "not a valid http(s) address" } };
40604
+ }
40605
+ const base = `${parts2.origin}${parts2.path}`;
40606
+ const ladder = listingLadder(base);
40607
+ const preferred = options.preferredRoute;
40608
+ const rungs = preferred !== void 0 && preferred.url.startsWith(`${parts2.origin}/`) ? [preferred, ...ladder.filter((rung) => rung.url !== preferred.url)] : ladder;
40609
+ const fetchImpl = options.fetchImpl ?? http_js_1.httpFetch;
40610
+ const firstTimeout = options.firstTimeoutMs ?? customProviders_1.PROBE_TIMEOUT_MS;
40611
+ const rungTimeout = options.rungTimeoutMs ?? exports2.LADDER_RUNG_TIMEOUT_MS;
40612
+ let first;
40613
+ let tried = 0;
40614
+ for (const rung of rungs) {
40615
+ tried += 1;
40616
+ const outcome = await askRung(rung, apiKey, tried === 1 ? firstTimeout : rungTimeout, fetchImpl);
40617
+ switch (outcome.kind) {
40618
+ case "models":
40619
+ return { ok: true, baseUrl: base, models: outcome.models, route: { url: outcome.url, shape: rung.shape } };
40620
+ case "next":
40621
+ first ??= outcome.failure;
40622
+ continue;
40623
+ case "stop":
40624
+ return { ok: false, failure: { ...outcome.failure, tried } };
40625
+ case "https": {
40626
+ const twin = httpsBase(base, outcome.twin);
40627
+ if (mayUpgrade) {
40628
+ const upgraded = await discover(twin, apiKey, { ...options, preferredRoute: void 0 }, false);
40629
+ if (upgraded.ok)
40630
+ return upgraded;
40631
+ }
40632
+ return {
40633
+ ok: false,
40634
+ failure: { kind: "redirected-to-https", phase: "listing", httpsUrl: twin, tried }
40635
+ };
40636
+ }
40637
+ }
40638
+ }
40639
+ return { ok: false, failure: { ...first ?? { kind: "no-listing", phase: "listing" }, tried } };
40640
+ }
40641
+ var VERIFY_PROMPT = "Reply with exactly: ok";
40642
+ var MESSAGES_VERSION = "2023-06-01";
40643
+ function chatLadder(baseUrl, wire) {
40644
+ const parts2 = baseParts(baseUrl);
40645
+ if (parts2 === null)
40646
+ return [];
40647
+ const { origin, path: path14 } = parts2;
40648
+ const bases = /\/v1$/i.test(path14) ? [`${origin}${path14}`, `${origin}${path14.slice(0, -3)}`] : [`${origin}${path14}`, `${origin}${path14}/v1`];
40649
+ const routesFor = (which) => bases.map((base) => ({
40650
+ baseUrl: base,
40651
+ wire: which,
40652
+ url: which === "anthropic" ? `${base}/messages` : `${base}/chat/completions`
40653
+ }));
40654
+ const other = wire === "anthropic" ? "openai" : "anthropic";
40655
+ return [...routesFor(wire), ...routesFor(other)];
40656
+ }
40657
+ function chatRequest(route, apiKey, model, outputKey) {
40658
+ const messages = [{ role: "user", content: VERIFY_PROMPT }];
40659
+ if (route.wire === "anthropic") {
40660
+ return {
40661
+ headers: {
40662
+ "content-type": "application/json",
40663
+ "anthropic-version": MESSAGES_VERSION,
40664
+ ...apiKey !== void 0 && apiKey !== "" ? { "x-api-key": apiKey } : {}
40665
+ },
40666
+ body: JSON.stringify({ model, max_tokens: 1, messages })
40667
+ };
40668
+ }
40669
+ return {
40670
+ headers: { "content-type": "application/json", ...authHeaders(apiKey) },
40671
+ body: JSON.stringify({ model, messages, [outputKey]: 1, stream: false })
40672
+ };
40673
+ }
40674
+ function isJsonObject(text) {
40675
+ try {
40676
+ const parsed = JSON.parse(text);
40677
+ return typeof parsed === "object" && parsed !== null;
40678
+ } catch {
40679
+ return false;
40680
+ }
40681
+ }
40682
+ function wantsCompletionTokens(message) {
40683
+ return /max_tokens/i.test(message) && /max_completion_tokens/i.test(message);
40684
+ }
40685
+ async function askChat(route, input, timeoutMs, fetchImpl, outputKey = "max_tokens") {
40686
+ const request = chatRequest(route, input.apiKey, input.model, outputKey);
40687
+ let url = route.url;
40688
+ for (let hop = 0; ; hop += 1) {
40689
+ let response;
40690
+ try {
40691
+ response = await fetchImpl(url, {
40692
+ method: "POST",
40693
+ headers: request.headers,
40694
+ body: request.body,
40695
+ redirect: "manual",
40696
+ signal: AbortSignal.timeout(timeoutMs)
40697
+ });
40698
+ } catch (error) {
40699
+ return { kind: "stop", failure: failureFromError(error, "chat") };
40700
+ }
40701
+ const status = response.status;
40702
+ if (isRedirect(response)) {
40703
+ const target = redirectTarget(url, response.headers?.get("location") ?? null);
40704
+ if (target.kind === "same-origin" && hop < MAX_REDIRECT_HOPS) {
40705
+ url = target.url;
40706
+ continue;
40707
+ }
40708
+ return target.kind === "https-twin" ? { kind: "https", twin: target.twin } : { kind: "next", status };
40709
+ }
40710
+ if (response.ok) {
40711
+ const body2 = await response.text().catch(() => "");
40712
+ return isJsonObject(body2) ? { kind: "ok" } : { kind: "next", status };
40713
+ }
40714
+ if (status === 401 || status === 403) {
40715
+ return { kind: "stop", failure: { kind: "unauthorized", phase: "chat", status } };
40716
+ }
40717
+ if (status === 404 || status === 405 || status === 501)
40718
+ return { kind: "next", status };
40719
+ const detail = serverMessage(await response.text().catch(() => ""));
40720
+ if (status === 400 || status === 422) {
40721
+ if (route.wire === "openai" && outputKey === "max_tokens" && wantsCompletionTokens(detail)) {
40722
+ return askChat(route, input, timeoutMs, fetchImpl, "max_completion_tokens");
40723
+ }
40724
+ return { kind: "stop", failure: { kind: "rejected", phase: "chat", status, detail } };
40725
+ }
40726
+ return { kind: "stop", failure: { kind: "unknown", phase: "chat", status, detail } };
40727
+ }
40728
+ }
40729
+ async function verifyEndpointChat2(input, options = {}) {
40730
+ return verify(input, options, true);
40731
+ }
40732
+ async function verify(input, options, mayUpgrade) {
40733
+ const parts2 = baseParts(input.baseUrl.trim());
40734
+ if (parts2 === null) {
40735
+ return { ok: false, failure: { kind: "unknown", phase: "chat", detail: "not a valid http(s) address" } };
40736
+ }
40737
+ if (input.model.trim() === "") {
40738
+ return { ok: false, failure: { kind: "rejected", phase: "chat", detail: "no model id to verify with" } };
40739
+ }
40740
+ const base = `${parts2.origin}${parts2.path}`;
40741
+ const routes = chatLadder(base, input.wire);
40742
+ const fetchImpl = options.fetchImpl ?? http_js_1.httpFetch;
40743
+ const timeoutMs = options.timeoutMs ?? customProviders_1.PROBE_TIMEOUT_MS;
40744
+ let first;
40745
+ let tried = 0;
40746
+ for (const route of routes) {
40747
+ tried += 1;
40748
+ const outcome = await askChat(route, { ...input, baseUrl: base }, timeoutMs, fetchImpl);
40749
+ switch (outcome.kind) {
40750
+ case "ok":
40751
+ return {
40752
+ ok: true,
40753
+ baseUrl: route.baseUrl,
40754
+ wire: route.wire,
40755
+ route: route.url,
40756
+ normalized: route.baseUrl !== base || route.wire !== input.wire
40757
+ };
40758
+ case "next":
40759
+ first ??= outcome.status;
40760
+ continue;
40761
+ case "stop":
40762
+ return { ok: false, failure: { ...outcome.failure, tried } };
40763
+ case "https": {
40764
+ const twin = httpsBase(base, outcome.twin);
40765
+ if (mayUpgrade) {
40766
+ const upgraded = await verify({ ...input, baseUrl: twin }, options, false);
40767
+ if (upgraded.ok)
40768
+ return { ...upgraded, normalized: true };
40769
+ }
40770
+ return { ok: false, failure: { kind: "redirected-to-https", phase: "chat", httpsUrl: twin, tried } };
40771
+ }
40772
+ }
40773
+ }
40774
+ return {
40775
+ ok: false,
40776
+ failure: { kind: "no-listing", phase: "chat", ...first !== void 0 ? { status: first } : {}, tried }
40777
+ };
40778
+ }
40779
+ function quoted(detail) {
40780
+ return detail === void 0 || detail === "" ? "" : `: ${detail.replace(/\.+$/, "")}`;
40781
+ }
40782
+ function endpointFailureText3(failure) {
40783
+ const status = failure.status !== void 0 ? ` (HTTP ${failure.status})` : "";
40784
+ switch (failure.kind) {
40785
+ case "unauthorized":
40786
+ return `The endpoint refused the key${status}. Check the key \u2014 leave it empty only for a server that needs none.`;
40787
+ case "no-listing":
40788
+ return failure.phase === "chat" ? `Nothing at this address answered a chat request${status}. Check the base URL \u2014 it should end where the server's routes begin, usually \u2026/v1.` : `The endpoint answered, but nothing at this address lists models${status}. Check the base URL \u2014 it should end where the server's routes begin, usually \u2026/v1 \u2014 or add the endpoint with model ids typed by hand.`;
40789
+ case "rejected":
40790
+ return `The endpoint rejected the request${status}${quoted(failure.detail)}. Check the model id.`;
40791
+ case "redirected-to-https":
40792
+ return `The endpoint redirects to https, and a key can't follow that redirect. Use ${failure.httpsUrl ?? "the https address"} instead.`;
40793
+ case "tls-untrusted":
40794
+ case "proxy-auth":
40795
+ return failure.message ?? failure.detail ?? "The connection failed.";
40796
+ case "unreachable":
40797
+ return `Nothing answered at this address. Check that the server is running and that the host and port are right.${failure.detail ? ` (${failure.detail})` : ""}`;
40798
+ case "timeout":
40799
+ return "The endpoint did not answer in time. Check that the server is running and reachable from this computer.";
40800
+ case "unknown":
40801
+ return `The endpoint answered in a way Orion could not use${status}${quoted(failure.detail)}.`;
40802
+ }
40803
+ }
40804
+ }
40805
+ });
40806
+
40324
40807
  // ../packages/orion-client-core/dist/runs/common.js
40325
40808
  var require_common = __commonJS({
40326
40809
  "../packages/orion-client-core/dist/runs/common.js"(exports2) {
@@ -40442,6 +40925,7 @@ var require_customProviderModels = __commonJS({
40442
40925
  var os9 = __importStar(__require("node:os"));
40443
40926
  var path14 = __importStar(__require("node:path"));
40444
40927
  var customProviders_1 = require_customProviders();
40928
+ var endpointDiscovery_1 = require_endpointDiscovery();
40445
40929
  var common_1 = require_common();
40446
40930
  exports2.CATALOG_SCHEMA_VERSION = 1;
40447
40931
  exports2.CATALOG_TTL_MS = 9e5;
@@ -40500,25 +40984,38 @@ var require_customProviderModels = __commonJS({
40500
40984
  function depsWith(deps2) {
40501
40985
  return {
40502
40986
  now: deps2.now ?? (() => Date.now()),
40503
- probe: deps2.probe ?? customProviders_1.probeModels,
40987
+ probe: deps2.probe,
40988
+ discover: deps2.discover ?? endpointDiscovery_1.discoverEndpointModels,
40504
40989
  readRecord: deps2.readRecord ?? readRecordFromDisk,
40505
40990
  writeRecord: deps2.writeRecord ?? writeRecordToDisk
40506
40991
  };
40507
40992
  }
40508
- async function probeAndStore(entry, d2) {
40993
+ async function probeAndStore(entry, previous, d2) {
40509
40994
  const key = normalizeBaseUrl(entry.baseUrl);
40510
40995
  const existing = inFlight2.get(key);
40511
40996
  if (existing !== void 0)
40512
40997
  return existing;
40513
40998
  const run3 = (async () => {
40514
- const models = await d2.probe(entry.baseUrl, await (0, customProviders_1.resolveApiKey)(entry));
40999
+ const apiKey = await (0, customProviders_1.resolveApiKey)(entry);
41000
+ let models;
41001
+ let route;
41002
+ if (d2.probe !== void 0) {
41003
+ models = await d2.probe(entry.baseUrl, apiKey);
41004
+ } else {
41005
+ const found = await d2.discover(entry.baseUrl, apiKey, {
41006
+ ...previous?.learned !== void 0 ? { preferredRoute: previous.learned.route } : {}
41007
+ });
41008
+ models = found.ok ? found.models : null;
41009
+ route = found.ok ? found.route : void 0;
41010
+ }
40515
41011
  if (models === null || models.length === 0)
40516
41012
  return models;
40517
41013
  const record = {
40518
41014
  version: exports2.CATALOG_SCHEMA_VERSION,
40519
41015
  baseUrl: entry.baseUrl,
40520
41016
  fetchedAt: d2.now(),
40521
- models
41017
+ models,
41018
+ ...route !== void 0 ? { learned: { route } } : {}
40522
41019
  };
40523
41020
  memory.set(key, record);
40524
41021
  await d2.writeRecord(record);
@@ -40542,10 +41039,10 @@ var require_customProviderModels = __commonJS({
40542
41039
  if (record !== null && fresh && options.force !== true)
40543
41040
  return record.models;
40544
41041
  if (record !== null) {
40545
- void probeAndStore(entry, d2).catch(() => void 0);
41042
+ void probeAndStore(entry, record, d2).catch(() => void 0);
40546
41043
  return record.models;
40547
41044
  }
40548
- return await probeAndStore(entry, d2) ?? [];
41045
+ return await probeAndStore(entry, null, d2) ?? [];
40549
41046
  }
40550
41047
  function findProbedModel(models, id) {
40551
41048
  return models.find((model) => model.id === id);
@@ -40597,6 +41094,8 @@ var require_customProviderModels = __commonJS({
40597
41094
  view.maxOutputTokens = resolved.maxOutputTokens;
40598
41095
  if (resolved.reasoning !== void 0)
40599
41096
  view.reasoning = resolved.reasoning;
41097
+ if (typeof declared?.temperature === "number")
41098
+ view.temperature = declared.temperature;
40600
41099
  if (declared?.contextWindow !== void 0 || declared?.maxOutputTokens !== void 0) {
40601
41100
  view.source = "user";
40602
41101
  } else if (view.contextWindow !== void 0 || view.maxOutputTokens !== void 0) {
@@ -40630,6 +41129,57 @@ var require_customProviderModels = __commonJS({
40630
41129
  }
40631
41130
  });
40632
41131
 
41132
+ // ../packages/orion-client-core/dist/endpointForm.js
41133
+ var require_endpointForm = __commonJS({
41134
+ "../packages/orion-client-core/dist/endpointForm.js"(exports2) {
41135
+ "use strict";
41136
+ Object.defineProperty(exports2, "__esModule", { value: true });
41137
+ exports2.parseWindowInput = parseWindowInput2;
41138
+ exports2.parseTemperatureInput = parseTemperatureInput2;
41139
+ exports2.withModelKnob = withModelKnob2;
41140
+ exports2.parseModelIds = parseModelIds2;
41141
+ function parseWindowInput2(raw) {
41142
+ const trimmed = raw.trim();
41143
+ if (trimmed === "")
41144
+ return void 0;
41145
+ const parsed = Number(trimmed);
41146
+ return Number.isFinite(parsed) && parsed >= 1 ? Math.floor(parsed) : null;
41147
+ }
41148
+ function parseTemperatureInput2(raw) {
41149
+ const trimmed = raw.trim();
41150
+ if (trimmed === "")
41151
+ return void 0;
41152
+ const parsed = Number(trimmed);
41153
+ return Number.isFinite(parsed) && parsed >= 0 && parsed <= 2 ? parsed : null;
41154
+ }
41155
+ function withModelKnob2(config, id, key, value) {
41156
+ const next = { ...config };
41157
+ const entry = { ...next[id] ?? {} };
41158
+ if (value === void 0)
41159
+ delete entry[key];
41160
+ else
41161
+ entry[key] = value;
41162
+ if (Object.keys(entry).length)
41163
+ next[id] = entry;
41164
+ else
41165
+ delete next[id];
41166
+ return next;
41167
+ }
41168
+ function parseModelIds2(raw) {
41169
+ const seen = /* @__PURE__ */ new Set();
41170
+ const ids = [];
41171
+ for (const piece of raw.split(/[\s,]+/)) {
41172
+ const id = piece.trim();
41173
+ if (id === "" || seen.has(id))
41174
+ continue;
41175
+ seen.add(id);
41176
+ ids.push(id);
41177
+ }
41178
+ return ids;
41179
+ }
41180
+ }
41181
+ });
41182
+
40633
41183
  // ../packages/orion-client-core/dist/duetExecutorCatalog.js
40634
41184
  var require_duetExecutorCatalog = __commonJS({
40635
41185
  "../packages/orion-client-core/dist/duetExecutorCatalog.js"(exports2) {
@@ -47528,6 +48078,7 @@ var require_proxyAuth = __commonJS({
47528
48078
  const log = options.log ?? (() => {
47529
48079
  });
47530
48080
  const configuredHeader = usableConfiguredHeader(options.preemptiveHeader, log);
48081
+ let answered = null;
47531
48082
  let kerberosLoad;
47532
48083
  const loadKerberos2 = () => {
47533
48084
  if (kerberosLoad !== void 0)
@@ -47682,8 +48233,11 @@ var require_proxyAuth = __commonJS({
47682
48233
  if (challenge === void 0)
47683
48234
  continue;
47684
48235
  const outcome = scheme === "NTLM" ? await answerNtlm(proxy2, challenge, state) : scheme === "Basic" ? await answerBasic(proxy2, challenge, state) : await answerNegotiate(proxy2, challenge, state);
47685
- if (outcome !== null)
48236
+ if (outcome !== null) {
48237
+ if (outcome.kind === "answer")
48238
+ answered = { proxy: (0, proxyCredentials_js_1.proxyIdentity)(proxy2), scheme: outcome.scheme };
47686
48239
  return outcome;
48240
+ }
47687
48241
  }
47688
48242
  const schemes = (0, proxyChallenge_js_1.challengeSchemes)(challenges);
47689
48243
  const reason = state.reasons[0] ?? (schemes.length === 0 ? "the proxy asked for credentials without saying how to provide them" : `Orion cannot authenticate with ${schemes.join(" or ")}`);
@@ -47693,6 +48247,9 @@ var require_proxyAuth = __commonJS({
47693
48247
  async kerberosAvailability() {
47694
48248
  const { module: module3, reason } = await loadKerberos2();
47695
48249
  return module3 === null ? { available: false, ...reason ? { reason } : {} } : { available: true };
48250
+ },
48251
+ lastAnswered() {
48252
+ return answered;
47696
48253
  }
47697
48254
  };
47698
48255
  }
@@ -49758,6 +50315,7 @@ var require_installNetworkTransport = __commonJS({
49758
50315
  exports2.installNetworkTransport = installNetworkTransport2;
49759
50316
  exports2.installRuntimeManagedTransport = installRuntimeManagedTransport;
49760
50317
  exports2.currentNetworkStatus = currentNetworkStatus3;
50318
+ exports2.currentProxyAuthentication = currentProxyAuthentication;
49761
50319
  exports2.disposeNetworkTransport = disposeNetworkTransport;
49762
50320
  exports2.resetNetworkTransportForTests = resetNetworkTransportForTests;
49763
50321
  exports2.networkStatusLine = networkStatusLine3;
@@ -49842,7 +50400,8 @@ var require_installNetworkTransport = __commonJS({
49842
50400
  resolver,
49843
50401
  settings,
49844
50402
  routes,
49845
- relay
50403
+ relay,
50404
+ auth
49846
50405
  };
49847
50406
  if (trust.refresh !== void 0) {
49848
50407
  void trust.refresh.then((fresh) => {
@@ -49981,6 +50540,9 @@ var require_installNetworkTransport = __commonJS({
49981
50540
  function currentNetworkStatus3() {
49982
50541
  return installed?.status ?? null;
49983
50542
  }
50543
+ function currentProxyAuthentication() {
50544
+ return installed?.auth.lastAnswered() ?? null;
50545
+ }
49984
50546
  function disposeNetworkTransport() {
49985
50547
  generation += 1;
49986
50548
  (0, http_js_1.currentHttpTransport)().dispose?.();
@@ -53452,72 +54014,142 @@ var require_probe = __commonJS({
53452
54014
  "use strict";
53453
54015
  Object.defineProperty(exports2, "__esModule", { value: true });
53454
54016
  exports2.NETWORK_PROBE_TIMEOUT_MS = void 0;
54017
+ exports2.healthProbeUrl = healthProbeUrl;
53455
54018
  exports2.probeNetwork = probeNetwork2;
53456
54019
  exports2.formatProbeReport = formatProbeReport2;
53457
54020
  var networkFailure_js_1 = require_networkFailure();
53458
54021
  var http_js_1 = require_http();
53459
54022
  var installNetworkTransport_js_1 = require_installNetworkTransport();
53460
54023
  exports2.NETWORK_PROBE_TIMEOUT_MS = 15e3;
54024
+ function healthProbeUrl(base) {
54025
+ try {
54026
+ const url = new URL(base);
54027
+ const path14 = url.pathname.replace(/\/+$/, "");
54028
+ url.pathname = path14.endsWith("/health") ? path14 : `${path14}/health`;
54029
+ url.search = "";
54030
+ url.hash = "";
54031
+ return url.href;
54032
+ } catch {
54033
+ return base;
54034
+ }
54035
+ }
53461
54036
  async function probeNetwork2(options) {
53462
54037
  const now2 = options.now ?? Date.now;
53463
54038
  const request = options.fetchImpl ?? http_js_1.httpFetch;
54039
+ const url = healthProbeUrl(options.url);
53464
54040
  const started = now2();
53465
54041
  const network = (options.status ?? installNetworkTransport_js_1.currentNetworkStatus)();
54042
+ const answered = () => (options.proxyAuth ?? installNetworkTransport_js_1.currentProxyAuthentication)() ?? void 0;
53466
54043
  try {
53467
- const response = await request(options.url, {
54044
+ const response = await request(url, {
53468
54045
  signal: AbortSignal.timeout(options.timeoutMs ?? exports2.NETWORK_PROBE_TIMEOUT_MS)
53469
54046
  });
53470
54047
  await response.text().catch(() => "");
53471
- return { url: options.url, reached: true, status: response.status, elapsedMs: now2() - started, network };
54048
+ const proxyAuth = answered();
54049
+ return {
54050
+ url,
54051
+ reached: true,
54052
+ status: response.status,
54053
+ elapsedMs: now2() - started,
54054
+ network,
54055
+ ...proxyAuth !== void 0 ? { proxyAuth } : {}
54056
+ };
53472
54057
  } catch (error) {
53473
54058
  const failure = (0, networkFailure_js_1.describeNetworkFailure)(error);
54059
+ const proxyAuth = answered();
53474
54060
  return {
53475
- url: options.url,
54061
+ url,
53476
54062
  reached: false,
53477
54063
  elapsedMs: now2() - started,
53478
54064
  problem: (0, networkFailure_js_1.networkFailureText)(error),
53479
54065
  kind: failure.kind,
53480
- network
54066
+ network,
54067
+ ...proxyAuth !== void 0 ? { proxyAuth } : {}
53481
54068
  };
53482
54069
  }
53483
54070
  }
54071
+ function serviceName(url) {
54072
+ try {
54073
+ return new URL(url).host;
54074
+ } catch {
54075
+ return url;
54076
+ }
54077
+ }
54078
+ function shortReason(report) {
54079
+ switch (report.kind) {
54080
+ case "proxy-auth":
54081
+ return "your network's proxy would not let this connection through";
54082
+ case "tls-untrusted":
54083
+ return "a certificate on this network could not be verified";
54084
+ case "unreachable":
54085
+ return "the service did not answer";
54086
+ default:
54087
+ return "the request could not be completed";
54088
+ }
54089
+ }
54090
+ function proxied(network) {
54091
+ return network.proxy !== null || network.pacUrl !== null && network.pacUrl !== void 0;
54092
+ }
53484
54093
  function routeLines(network) {
53485
54094
  const lines = [];
53486
- if (network.pacUrl !== null && network.pacUrl !== void 0) {
53487
- lines.push(`Routing: decided per address by the script at ${network.pacUrl}`);
54095
+ const scripted = network.pacUrl !== null && network.pacUrl !== void 0;
54096
+ if (scripted) {
54097
+ lines.push(`Routing: decided per address by the script at ${network.pacUrl}.`);
53488
54098
  } else if (network.proxy !== null) {
53489
54099
  const where = network.source === "settings" ? "from your settings" : network.source === "env" ? "from your environment" : "as this computer is configured";
53490
- lines.push(`Routing: through ${network.proxy}, ${where}`);
54100
+ lines.push(`Routing: through ${network.proxy}, ${where}.`);
53491
54101
  } else {
53492
- lines.push("Routing: direct \u2014 no proxy in force");
54102
+ lines.push("Routing: direct \u2014 no proxy in force.");
53493
54103
  }
53494
- for (const route of network.routes ?? [])
53495
- lines.push(` route: ${route}`);
54104
+ const distinct = [...new Set(network.routes ?? [])];
54105
+ if (scripted || distinct.length > 1)
54106
+ for (const route of distinct)
54107
+ lines.push(` route: ${route}`);
53496
54108
  return lines;
53497
54109
  }
54110
+ function certificateLine(network) {
54111
+ const own = network.systemCertificates > 0 ? `${network.systemCertificates} from this computer` : "the bundled ones";
54112
+ const extra = network.extraCertificates > 0 ? ` and ${network.extraCertificates} from your bundle` : "";
54113
+ return `Certificates: ${own}${extra}.`;
54114
+ }
54115
+ function authenticationLine(report, network) {
54116
+ if (!proxied(network))
54117
+ return null;
54118
+ const record = report.proxyAuth;
54119
+ if (record !== void 0) {
54120
+ return /^(negotiate|kerberos)$/i.test(record.scheme) ? "Single sign-on: this proxy asked for it, and your Kerberos ticket answered." : `Proxy sign-in: this proxy asked for ${record.scheme}, and the username and password Orion holds answered.`;
54121
+ }
54122
+ if (network.kerberos === void 0)
54123
+ return null;
54124
+ if (!network.kerberos.available) {
54125
+ return `Single sign-on: unavailable${network.kerberos.reason ? ` \u2014 ${network.kerberos.reason}` : ""}.`;
54126
+ }
54127
+ return report.kind === "proxy-auth" ? null : "Single sign-on: ready, if this proxy asks for it.";
54128
+ }
53498
54129
  function formatProbeReport2(report) {
53499
54130
  const lines = [];
53500
54131
  if (report.reached) {
53501
- lines.push(`Reached ${report.url} in ${report.elapsedMs} ms (answered ${report.status}).`);
54132
+ lines.push(`\u2713 Connected \u2014 reached ${serviceName(report.url)} in ${report.elapsedMs} ms.`);
54133
+ if (report.status !== void 0 && report.status >= 500) {
54134
+ lines.push(`Your network is fine; the service itself answered ${report.status}.`);
54135
+ }
53502
54136
  } else {
53503
- lines.push(`Could not reach ${report.url}.`);
54137
+ lines.push(`\u2717 Not connected \u2014 ${shortReason(report)}.`);
53504
54138
  if (report.problem !== void 0)
53505
54139
  lines.push(report.problem);
53506
54140
  }
53507
54141
  const network = report.network;
53508
54142
  if (network === null) {
53509
- lines.push("No proxy is in play here, so requests go direct through the editor's own transport.");
54143
+ lines.push("Routing: direct \u2014 the editor's own transport carries requests.");
53510
54144
  return lines;
53511
54145
  }
53512
54146
  lines.push(...routeLines(network));
53513
- const trusted = network.systemCertificates > 0 ? `Trusting ${network.systemCertificates} certificate${network.systemCertificates === 1 ? "" : "s"} from this computer` : "Trusting the bundled certificates";
53514
- lines.push(`${trusted}${network.extraCertificates > 0 ? ` and ${network.extraCertificates} from your bundle` : ""}.`);
53515
- if (network.kerberos !== void 0) {
53516
- lines.push(network.kerberos.available ? "Single sign-on: available for a proxy that asks for it." : `Single sign-on: unavailable${network.kerberos.reason ? ` \u2014 ${network.kerberos.reason}` : ""}.`);
53517
- }
53518
- if (network.relay) {
53519
- lines.push(`Programs Orion starts reach the network through ${network.relay}.`);
53520
- }
54147
+ lines.push(certificateLine(network));
54148
+ const authentication = authenticationLine(report, network);
54149
+ if (authentication !== null)
54150
+ lines.push(authentication);
54151
+ if (network.relay)
54152
+ lines.push(`Programs Orion starts: through ${network.relay}.`);
53521
54153
  return lines;
53522
54154
  }
53523
54155
  }
@@ -76884,6 +77516,8 @@ var require_dist = __commonJS({
76884
77516
  __exportStar(require_duetPlanners(), exports2);
76885
77517
  __exportStar(require_repoIdentity(), exports2);
76886
77518
  __exportStar(require_customProviderModels(), exports2);
77519
+ __exportStar(require_endpointDiscovery(), exports2);
77520
+ __exportStar(require_endpointForm(), exports2);
76887
77521
  __exportStar(require_duetExecutorCatalog(), exports2);
76888
77522
  __exportStar(require_duetRoutingSignals(), exports2);
76889
77523
  __exportStar(require_duetRoutingLog(), exports2);
@@ -93626,8 +94260,8 @@ var Box2 = Box_default;
93626
94260
  var ScrollBox2 = ScrollBox_default;
93627
94261
 
93628
94262
  // src/main.tsx
93629
- var import_client_core48 = __toESM(require_dist(), 1);
93630
94263
  var import_client_core49 = __toESM(require_dist(), 1);
94264
+ var import_client_core50 = __toESM(require_dist(), 1);
93631
94265
  import { fileURLToPath as fileURLToPath3 } from "url";
93632
94266
  import * as os8 from "os";
93633
94267
  import { randomUUID as randomUUID3 } from "crypto";
@@ -93680,7 +94314,7 @@ async function importOfferNote(firstRun, home, workspaceRoot) {
93680
94314
  }
93681
94315
 
93682
94316
  // src/main.tsx
93683
- var import_client_core50 = __toESM(require_dist(), 1);
94317
+ var import_client_core51 = __toESM(require_dist(), 1);
93684
94318
 
93685
94319
  // src/update/selfUpdate.ts
93686
94320
  var import_client_core3 = __toESM(require_dist(), 1);
@@ -97924,7 +98558,8 @@ ${(0, import_client_core20.duetRoutingSummaryLine)(await (0, import_client_core2
97924
98558
  return;
97925
98559
  }
97926
98560
  if (sub === "add") {
97927
- const [name2, baseUrl] = rest;
98561
+ const [name2, rawBaseUrl] = rest;
98562
+ const baseUrl = rawBaseUrl === void 0 ? void 0 : (0, import_client_core9.normalizeEndpointBaseUrl)(rawBaseUrl).baseUrl;
97928
98563
  if (!name2 || !baseUrl) {
97929
98564
  return ctx.print("Usage: /endpoint add <name> <baseUrl> [--key <k>] [--wire openai|anthropic] [--models a,b,c] [--tier user|project|local]", "warning");
97930
98565
  }
@@ -97951,9 +98586,16 @@ ${(0, import_client_core20.duetRoutingSummaryLine)(await (0, import_client_core2
97951
98586
  } catch (e) {
97952
98587
  return ctx.print(`Could not save: ${e instanceof Error ? e.message : String(e)}`, "error");
97953
98588
  }
97954
- const probed = await (0, import_client_core19.probeModels)(baseUrl, apiKey);
97955
- const note = probed === null ? `Saved '${name2}', but the endpoint did not answer /models (check the URL, key, and that the server is running).` : `Saved '${name2}' \u2014 reachable, ${probed.length} model${probed.length === 1 ? "" : "s"}.`;
97956
- ctx.print(note, probed === null ? "warning" : "success");
98589
+ const found = await (0, import_client_core9.discoverEndpointModels)(baseUrl, apiKey);
98590
+ if (!found.ok) {
98591
+ ctx.print(`Saved '${name2}'. ${(0, import_client_core9.endpointFailureText)(found.failure)}`, "warning");
98592
+ return;
98593
+ }
98594
+ if (found.baseUrl !== baseUrl) await (0, import_client_core19.saveCustomProvider)({ ...entry, baseUrl: found.baseUrl }, tier, opts);
98595
+ ctx.print(
98596
+ `Saved '${name2}' \u2014 reachable, ${found.models.length} model${found.models.length === 1 ? "" : "s"}.`,
98597
+ "success"
98598
+ );
97957
98599
  return;
97958
98600
  }
97959
98601
  if (sub === "remove") {
@@ -99352,11 +99994,10 @@ Install "${arg}"?`,
99352
99994
  if (url === void 0) return ctx.print("No service address is configured to test.", "error");
99353
99995
  ctx.print(`Testing the connection to ${url}\u2026`);
99354
99996
  const report = await testNetwork(url);
99355
- for (const line of (0, import_client_core.formatProbeReport)(report)) ctx.print(line);
99356
- return ctx.print(
99357
- report.reached ? "Connection works." : "Connection failed.",
99358
- report.reached ? "success" : "error"
99359
- );
99997
+ const [verdict, ...detail] = (0, import_client_core.formatProbeReport)(report);
99998
+ ctx.print(verdict, report.reached ? "success" : "error");
99999
+ for (const line of detail) ctx.print(line);
100000
+ return;
99360
100001
  }
99361
100002
  if (ctx.openNetwork) {
99362
100003
  ctx.openNetwork();
@@ -117551,7 +118192,7 @@ function OrionRing() {
117551
118192
 
117552
118193
  // src/services/version.ts
117553
118194
  function tuiVersion() {
117554
- return "0.1.31".length > 0 ? "0.1.31" : null;
118195
+ return "0.1.32".length > 0 ? "0.1.32" : null;
117555
118196
  }
117556
118197
 
117557
118198
  // src/components/layout/WelcomeCard.tsx
@@ -120432,6 +121073,7 @@ function PermissionPrompt({
120432
121073
 
120433
121074
  // src/components/dialogs/EndpointsPanel.tsx
120434
121075
  var import_react38 = __toESM(require_react(), 1);
121076
+ var import_client_core35 = __toESM(require_dist(), 1);
120435
121077
 
120436
121078
  // src/components/design-system/FormRow.tsx
120437
121079
  var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1);
@@ -120457,13 +121099,16 @@ function maskedKeyState(e) {
120457
121099
  if (e.apiKeyHelper) return "key via helper";
120458
121100
  return "no key";
120459
121101
  }
121102
+ function describeTemperature(override) {
121103
+ return override?.temperature !== void 0 ? ` \xB7 temp ${override.temperature}` : "";
121104
+ }
120460
121105
  function describeWindow(model, override) {
120461
121106
  const declared = override?.contextWindow;
120462
- if (declared !== void 0) return ` \xB7 ${declared.toLocaleString()} ctx (yours)`;
121107
+ if (declared !== void 0) return ` \xB7 ${declared.toLocaleString()} ctx (yours)${describeTemperature(override)}`;
120463
121108
  if (model.contextWindow !== void 0) {
120464
- return ` \xB7 ${model.contextWindow.toLocaleString()} ctx (from endpoint)`;
121109
+ return ` \xB7 ${model.contextWindow.toLocaleString()} ctx (from endpoint)${describeTemperature(override)}`;
120465
121110
  }
120466
- return "";
121111
+ return describeTemperature(override);
120467
121112
  }
120468
121113
  function validName(name2) {
120469
121114
  return /^[A-Za-z0-9_-]+$/.test(name2.trim());
@@ -120494,6 +121139,9 @@ function EndpointsPanel({
120494
121139
  const [savedConfig, setSavedConfig] = (0, import_react38.useState)({});
120495
121140
  const [fetching, setFetching] = (0, import_react38.useState)(false);
120496
121141
  const [note, setNote] = (0, import_react38.useState)(null);
121142
+ const [manualIds, setManualIds] = (0, import_react38.useState)("");
121143
+ const [manualOffered, setManualOffered] = (0, import_react38.useState)(false);
121144
+ const [httpWarning, setHttpWarning] = (0, import_react38.useState)(null);
120497
121145
  const slots = [
120498
121146
  ...deps2.entries.map((_2, index) => ({ kind: "entry", index })),
120499
121147
  { kind: "field", field: "name" },
@@ -120501,6 +121149,7 @@ function EndpointsPanel({
120501
121149
  { kind: "field", field: "wire" },
120502
121150
  { kind: "field", field: "key" },
120503
121151
  { kind: "action", action: "fetch" },
121152
+ ...manualOffered ? [{ kind: "field", field: "ids" }, { kind: "action", action: "verify" }] : [],
120504
121153
  { kind: "action", action: "save" }
120505
121154
  ];
120506
121155
  const [at, setAt] = (0, import_react38.useState)(deps2.entries.length);
@@ -120519,6 +121168,9 @@ function EndpointsPanel({
120519
121168
  setEditing(null);
120520
121169
  setNote(null);
120521
121170
  setVerifiedFor(null);
121171
+ setManualIds("");
121172
+ setManualOffered(false);
121173
+ setHttpWarning(null);
120522
121174
  };
120523
121175
  const startEdit = (entry) => {
120524
121176
  setName(entry.name);
@@ -120535,31 +121187,74 @@ function EndpointsPanel({
120535
121187
  setAt(deps2.entries.length);
120536
121188
  };
120537
121189
  const startFetch = () => {
120538
- if (!validUrl(url)) {
121190
+ const normalized = (0, import_client_core35.normalizeEndpointBaseUrl)(url);
121191
+ if (!validUrl(normalized.baseUrl)) {
120539
121192
  setNote({ text: "Enter a full base URL first, e.g. https://openrouter.ai/api/v1", error: true });
120540
121193
  return;
120541
121194
  }
121195
+ if (normalized.baseUrl !== url.trim()) setUrl(normalized.baseUrl);
120542
121196
  setFetching(true);
120543
121197
  setNote(null);
120544
- const probedFingerprint = fingerprint;
120545
- void deps2.probe(url.trim(), key.trim() || void 0).then((models) => {
121198
+ setManualOffered(false);
121199
+ void deps2.probe(normalized.baseUrl, key.trim() || void 0).then((found) => {
120546
121200
  setFetching(false);
120547
- if (models === null) {
121201
+ if (!found.ok) {
120548
121202
  setDiscovered(null);
120549
- setNote({
120550
- text: "The endpoint did not answer /models \u2014 check the URL, key, and that the server is running.",
120551
- error: true
120552
- });
121203
+ setNote({ text: (0, import_client_core35.endpointFailureText)(found.failure), error: true });
121204
+ setManualOffered(found.failure.kind === "no-listing" || found.failure.kind === "unknown");
120553
121205
  return;
120554
121206
  }
120555
- setVerifiedFor(probedFingerprint);
120556
- setDiscovered(models);
121207
+ if (found.baseUrl !== normalized.baseUrl) setUrl(found.baseUrl);
121208
+ setVerifiedFor(`${found.baseUrl}\0${key}`);
121209
+ setDiscovered(found.models);
120557
121210
  setSelected(/* @__PURE__ */ new Set());
120558
- if (models.length === 0) {
121211
+ if (found.models.length === 0) {
120559
121212
  setNote({ text: "Reachable, but the endpoint lists no models. Add keeps live discovery.", error: false });
120560
121213
  return;
120561
121214
  }
120562
- setOverlay({ kind: "pick-models", discovered: models });
121215
+ setHttpWarning(normalized.warning !== void 0 && found.baseUrl.startsWith("http:") ? normalized.warning : null);
121216
+ setOverlay({ kind: "pick-models", discovered: found.models });
121217
+ });
121218
+ };
121219
+ const verifyAndAdd = () => {
121220
+ if (!validName(name2)) {
121221
+ setNote({ text: "Name: letters, digits, - and _ only.", error: true });
121222
+ return;
121223
+ }
121224
+ const base = (0, import_client_core35.normalizeEndpointBaseUrl)(url).baseUrl;
121225
+ if (!validUrl(base)) {
121226
+ setNote({ text: "Enter a full base URL, e.g. https://openrouter.ai/api/v1", error: true });
121227
+ return;
121228
+ }
121229
+ const ids = (0, import_client_core35.parseModelIds)(manualIds);
121230
+ if (ids.length === 0) {
121231
+ setNote({ text: "Type at least one model id \u2014 Orion verifies the first one.", error: true });
121232
+ return;
121233
+ }
121234
+ const entryName = name2.trim();
121235
+ const apiKey = key.trim();
121236
+ setOverlay({ kind: "busy", note: `Verifying ${ids[0]} with a tiny chat request\u2026` });
121237
+ void deps2.verify({ baseUrl: base, ...apiKey ? { apiKey } : {}, wire, model: ids[0] }).then(async (verified2) => {
121238
+ if (!verified2.ok) {
121239
+ setOverlay(null);
121240
+ setNote({ text: (0, import_client_core35.endpointFailureText)(verified2.failure), error: true });
121241
+ return;
121242
+ }
121243
+ await deps2.add({
121244
+ name: entryName,
121245
+ baseUrl: verified2.baseUrl,
121246
+ wire: verified2.wire,
121247
+ ...apiKey ? { apiKey } : {},
121248
+ models: ids
121249
+ });
121250
+ resetForm();
121251
+ setOverlay(null);
121252
+ setAt(deps2.entries.length + 1);
121253
+ const wireLabel = verified2.wire === "anthropic" ? "Messages wire" : "OpenAI-compatible";
121254
+ setNote({
121255
+ text: `'${entryName}' added \u2014 verified with ${ids[0]}.` + (verified2.normalized ? ` Saved as ${verified2.baseUrl} (${wireLabel}), the address that answered.` : ""),
121256
+ error: false
121257
+ });
120563
121258
  });
120564
121259
  };
120565
121260
  const save = () => {
@@ -120609,13 +121304,14 @@ function EndpointsPanel({
120609
121304
  }
120610
121305
  if (slot.kind === "action") {
120611
121306
  if (slot.action === "fetch") return fetching ? void 0 : startFetch();
121307
+ if (slot.action === "verify") return verifyAndAdd();
120612
121308
  return save();
120613
121309
  }
120614
121310
  return setAt(Math.min(at + 1, slots.length - 1));
120615
121311
  }
120616
121312
  if (slot.kind === "field" && slot.field !== "wire") {
120617
- const setters = { name: setName, url: setUrl, key: setKey };
120618
- const values = { name: name2, url, key };
121313
+ const setters = { name: setName, url: setUrl, key: setKey, ids: setManualIds };
121314
+ const values = { name: name2, url, key, ids: manualIds };
120619
121315
  const set = setters[slot.field];
120620
121316
  const value = values[slot.field];
120621
121317
  if (keyInfo.backspace || keyInfo.delete) return set(value.slice(0, -1));
@@ -120634,7 +121330,7 @@ function EndpointsPanel({
120634
121330
  },
120635
121331
  {
120636
121332
  value: "__advanced",
120637
- label: "Set per-model limits\u2026 (context window)"
121333
+ label: "Set per-model limits\u2026 (context window, temperature)"
120638
121334
  },
120639
121335
  ...list.map((model) => ({
120640
121336
  value: model.id,
@@ -120653,10 +121349,8 @@ function EndpointsPanel({
120653
121349
  return;
120654
121350
  }
120655
121351
  if (value === null || value === "__done") {
120656
- setNote({
120657
- text: selected.size ? `${selected.size} of ${list.length} pinned \u2014 Add endpoint saves them.` : `${list.length} models found \u2014 Add endpoint keeps all (discovered live).`,
120658
- error: false
120659
- });
121352
+ const summary = selected.size ? `${selected.size} of ${list.length} pinned \u2014 Add endpoint saves them.` : `${list.length} models found \u2014 Add endpoint keeps all (discovered live).`;
121353
+ setNote({ text: httpWarning === null ? summary : `${summary} ${httpWarning}`, error: false });
120660
121354
  setOverlay(null);
120661
121355
  return;
120662
121356
  }
@@ -120688,19 +121382,70 @@ function EndpointsPanel({
120688
121382
  setOverlay({ kind: "pick-models", discovered: list });
120689
121383
  return;
120690
121384
  }
120691
- setConfigDraft(
120692
- modelConfig[value]?.contextWindow === void 0 ? "" : String(modelConfig[value].contextWindow)
120693
- );
120694
- setOverlay({ kind: "edit-model-config", id: value });
121385
+ setOverlay({ kind: "model-config-actions", discovered: list, id: value });
120695
121386
  }
120696
121387
  },
120697
121388
  "pick-model-config"
120698
121389
  );
120699
121390
  }
121391
+ if (overlay?.kind === "model-config-actions") {
121392
+ const { discovered: list, id } = overlay;
121393
+ const mine = modelConfig[id];
121394
+ const windowNote = mine?.contextWindow !== void 0 ? `${mine.contextWindow.toLocaleString()} (yours)` : "from endpoint";
121395
+ const tempNote = mine?.temperature !== void 0 ? String(mine.temperature) : "server default";
121396
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
121397
+ SelectList,
121398
+ {
121399
+ title: `${id} \xB7 context window ${windowNote} \xB7 temperature ${tempNote}`,
121400
+ options: [
121401
+ { value: "window", label: "Set context window\u2026" },
121402
+ { value: "temperature", label: "Set temperature\u2026" },
121403
+ { value: "back", label: "Back" }
121404
+ ],
121405
+ onSelect: (value) => {
121406
+ if (value === "window") {
121407
+ setConfigDraft(mine?.contextWindow === void 0 ? "" : String(mine.contextWindow));
121408
+ return setOverlay({ kind: "edit-model-config", id });
121409
+ }
121410
+ if (value === "temperature") {
121411
+ setConfigDraft(mine?.temperature === void 0 ? "" : String(mine.temperature));
121412
+ return setOverlay({ kind: "edit-model-temperature", id });
121413
+ }
121414
+ setOverlay({ kind: "pick-model-config", discovered: list });
121415
+ }
121416
+ },
121417
+ `model-config-actions-${id}`
121418
+ );
121419
+ }
121420
+ if (overlay?.kind === "edit-model-temperature") {
121421
+ const id = overlay.id;
121422
+ const back = () => setOverlay({ kind: "model-config-actions", discovered: discovered ?? [], id });
121423
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
121424
+ LineEditor,
121425
+ {
121426
+ label: `Temperature for ${id}`,
121427
+ value: configDraft,
121428
+ hint: "0 to 2 \u2014 empty uses the server's default \xB7 enter save \xB7 esc back",
121429
+ onChange: setConfigDraft,
121430
+ onSubmit: () => {
121431
+ const parsed = (0, import_client_core35.parseTemperatureInput)(configDraft);
121432
+ if (parsed === null) {
121433
+ setNote({ text: `'${configDraft.trim()}' is not a temperature (0 to 2).`, error: true });
121434
+ back();
121435
+ return;
121436
+ }
121437
+ setModelConfig((0, import_client_core35.withModelKnob)(modelConfig, id, "temperature", parsed));
121438
+ back();
121439
+ },
121440
+ onCancel: back
121441
+ },
121442
+ `edit-model-temperature-${id}`
121443
+ );
121444
+ }
120700
121445
  if (overlay?.kind === "edit-model-config") {
120701
121446
  const id = overlay.id;
120702
121447
  const probed = discovered?.find((model) => model.id === id);
120703
- const back = () => setOverlay({ kind: "pick-model-config", discovered: discovered ?? [] });
121448
+ const back = () => setOverlay({ kind: "model-config-actions", discovered: discovered ?? [], id });
120704
121449
  return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
120705
121450
  LineEditor,
120706
121451
  {
@@ -120709,20 +121454,13 @@ function EndpointsPanel({
120709
121454
  hint: probed?.contextWindow !== void 0 ? `endpoint reports ${probed.contextWindow.toLocaleString()} \u2014 empty uses it \xB7 enter save \xB7 esc back` : "the endpoint did not report one \u2014 empty leaves Orion's own estimate \xB7 enter save \xB7 esc back",
120710
121455
  onChange: setConfigDraft,
120711
121456
  onSubmit: () => {
120712
- const trimmed = configDraft.trim();
120713
- const next = { ...modelConfig };
120714
- if (trimmed === "") {
120715
- delete next[id];
120716
- } else {
120717
- const parsed = Number(trimmed);
120718
- if (!Number.isFinite(parsed) || parsed < 1) {
120719
- setNote({ text: `'${trimmed}' is not a token count.`, error: true });
120720
- back();
120721
- return;
120722
- }
120723
- next[id] = { ...next[id], contextWindow: Math.floor(parsed) };
121457
+ const parsed = (0, import_client_core35.parseWindowInput)(configDraft);
121458
+ if (parsed === null) {
121459
+ setNote({ text: `'${configDraft.trim()}' is not a token count.`, error: true });
121460
+ back();
121461
+ return;
120724
121462
  }
120725
- setModelConfig(next);
121463
+ setModelConfig((0, import_client_core35.withModelKnob)(modelConfig, id, "contextWindow", parsed));
120726
121464
  back();
120727
121465
  },
120728
121466
  onCancel: back
@@ -120744,12 +121482,14 @@ function EndpointsPanel({
120744
121482
  );
120745
121483
  }
120746
121484
  const describe = (model) => {
120747
- const mine = savedConfig[model.id]?.contextWindow;
120748
- if (mine !== void 0) return ` \xB7 ${mine.toLocaleString()} ctx (yours)`;
121485
+ const mine = savedConfig[model.id];
121486
+ if (mine?.contextWindow !== void 0) {
121487
+ return ` \xB7 ${mine.contextWindow.toLocaleString()} ctx (yours)${describeTemperature(mine)}`;
121488
+ }
120749
121489
  if (model.source === "endpoint" && model.contextWindow !== void 0) {
120750
- return ` \xB7 ${model.contextWindow.toLocaleString()} ctx (from endpoint)`;
121490
+ return ` \xB7 ${model.contextWindow.toLocaleString()} ctx (from endpoint)${describeTemperature(mine)}`;
120751
121491
  }
120752
- return "";
121492
+ return describeTemperature(mine);
120753
121493
  };
120754
121494
  return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
120755
121495
  SelectList,
@@ -120788,16 +121528,18 @@ function EndpointsPanel({
120788
121528
  if (overlay?.kind === "saved-model-actions") {
120789
121529
  const { entry, models, id } = overlay;
120790
121530
  const pinned = savedPins.has(id);
120791
- const mine = savedConfig[id]?.contextWindow;
121531
+ const mine = savedConfig[id];
120792
121532
  const reported = models.find((m2) => m2.id === id);
120793
- const windowNote = mine !== void 0 ? `${mine.toLocaleString()} (yours)` : reported?.source === "endpoint" && reported.contextWindow !== void 0 ? `${reported.contextWindow.toLocaleString()} (from endpoint)` : "not set";
121533
+ const windowNote = mine?.contextWindow !== void 0 ? `${mine.contextWindow.toLocaleString()} (yours)` : reported?.source === "endpoint" && reported.contextWindow !== void 0 ? `${reported.contextWindow.toLocaleString()} (from endpoint)` : "not set";
121534
+ const tempNote = mine?.temperature !== void 0 ? String(mine.temperature) : "server default";
120794
121535
  return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
120795
121536
  SelectList,
120796
121537
  {
120797
- title: `${id} \xB7 context window ${windowNote}`,
121538
+ title: `${id} \xB7 context window ${windowNote} \xB7 temperature ${tempNote}`,
120798
121539
  options: [
120799
121540
  { value: "pin", label: pinned ? "Unpin \u2014 stop offering it in the picker" : "Pin \u2014 offer only pinned models" },
120800
121541
  { value: "limit", label: "Set context window\u2026" },
121542
+ { value: "temperature", label: "Set temperature\u2026" },
120801
121543
  { value: "back", label: "Back" }
120802
121544
  ],
120803
121545
  onSelect: (value) => {
@@ -120807,8 +121549,11 @@ function EndpointsPanel({
120807
121549
  else next.add(id);
120808
121550
  setSavedPins(next);
120809
121551
  } else if (value === "limit") {
120810
- setConfigDraft(mine === void 0 ? "" : String(mine));
121552
+ setConfigDraft(mine?.contextWindow === void 0 ? "" : String(mine.contextWindow));
120811
121553
  return setOverlay({ kind: "edit-saved-config", entry, models, id });
121554
+ } else if (value === "temperature") {
121555
+ setConfigDraft(mine?.temperature === void 0 ? "" : String(mine.temperature));
121556
+ return setOverlay({ kind: "edit-saved-temperature", entry, models, id });
120812
121557
  }
120813
121558
  setOverlay({ kind: "saved-models", entry, models });
120814
121559
  }
@@ -120816,10 +121561,35 @@ function EndpointsPanel({
120816
121561
  `saved-model-actions-${id}`
120817
121562
  );
120818
121563
  }
121564
+ if (overlay?.kind === "edit-saved-temperature") {
121565
+ const { entry, models, id } = overlay;
121566
+ const back = () => setOverlay({ kind: "saved-model-actions", entry, models, id });
121567
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
121568
+ LineEditor,
121569
+ {
121570
+ label: `Temperature for ${id}`,
121571
+ value: configDraft,
121572
+ hint: "0 to 2 \u2014 empty uses the server's default \xB7 enter save \xB7 esc back",
121573
+ onChange: setConfigDraft,
121574
+ onSubmit: () => {
121575
+ const parsed = (0, import_client_core35.parseTemperatureInput)(configDraft);
121576
+ if (parsed === null) {
121577
+ setNote({ text: `'${configDraft.trim()}' is not a temperature (0 to 2).`, error: true });
121578
+ back();
121579
+ return;
121580
+ }
121581
+ setSavedConfig((0, import_client_core35.withModelKnob)(savedConfig, id, "temperature", parsed));
121582
+ back();
121583
+ },
121584
+ onCancel: back
121585
+ },
121586
+ `edit-saved-temperature-${id}`
121587
+ );
121588
+ }
120819
121589
  if (overlay?.kind === "edit-saved-config") {
120820
121590
  const { entry, models, id } = overlay;
120821
121591
  const reported = models.find((m2) => m2.id === id);
120822
- const back = () => setOverlay({ kind: "saved-models", entry, models });
121592
+ const back = () => setOverlay({ kind: "saved-model-actions", entry, models, id });
120823
121593
  return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
120824
121594
  LineEditor,
120825
121595
  {
@@ -120828,19 +121598,13 @@ function EndpointsPanel({
120828
121598
  hint: reported?.source === "endpoint" && reported.contextWindow !== void 0 ? `endpoint reports ${reported.contextWindow.toLocaleString()} \u2014 empty uses it \xB7 enter save \xB7 esc back` : "the endpoint did not report one \u2014 empty leaves Orion's own estimate \xB7 enter save \xB7 esc back",
120829
121599
  onChange: setConfigDraft,
120830
121600
  onSubmit: () => {
120831
- const trimmed = configDraft.trim();
120832
- const next = { ...savedConfig };
120833
- if (trimmed === "") delete next[id];
120834
- else {
120835
- const parsed = Number(trimmed);
120836
- if (!Number.isFinite(parsed) || parsed < 1) {
120837
- setNote({ text: `'${trimmed}' is not a token count.`, error: true });
120838
- back();
120839
- return;
120840
- }
120841
- next[id] = { ...next[id], contextWindow: Math.floor(parsed) };
121601
+ const parsed = (0, import_client_core35.parseWindowInput)(configDraft);
121602
+ if (parsed === null) {
121603
+ setNote({ text: `'${configDraft.trim()}' is not a token count.`, error: true });
121604
+ back();
121605
+ return;
120842
121606
  }
120843
- setSavedConfig(next);
121607
+ setSavedConfig((0, import_client_core35.withModelKnob)(savedConfig, id, "contextWindow", parsed));
120844
121608
  back();
120845
121609
  },
120846
121610
  onCancel: back
@@ -120917,10 +121681,10 @@ function EndpointsPanel({
120917
121681
  setOverlay({ kind: "pick-model", entry, models: entry.models });
120918
121682
  return;
120919
121683
  }
120920
- setOverlay({ kind: "busy", note: `Fetching ${entry.baseUrl}/models\u2026` });
120921
- void deps2.probe(entry.baseUrl, entry.apiKey).then((models) => {
120922
- if (models?.length) {
120923
- setOverlay({ kind: "pick-model", entry, models: models.map((m2) => m2.id) });
121684
+ setOverlay({ kind: "busy", note: `Fetching ${entry.name}'s models\u2026` });
121685
+ void deps2.probe(entry.baseUrl, entry.apiKey).then((found) => {
121686
+ if (found.ok && found.models.length) {
121687
+ setOverlay({ kind: "pick-model", entry, models: found.models.map((m2) => m2.id) });
120924
121688
  } else setOverlay({ kind: "entry-actions", entry });
120925
121689
  });
120926
121690
  return;
@@ -120956,7 +121720,7 @@ function EndpointsPanel({
120956
121720
  ] }),
120957
121721
  deps2.entries.map((e, index) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Box2, { children: [
120958
121722
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ThemedText, { colorKey: focusEntry === index ? "listSelection" : void 0, bold: focusEntry === index, children: `${focusEntry === index ? "\u276F" : " "} ${e.name} ` }),
120959
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ThemedText, { dim: true, children: `${e.baseUrl} \xB7 ${e.wire} \xB7 ${maskedKeyState(e)} \xB7 ${e.models?.length ? `${e.models.length} pinned model${e.models.length === 1 ? "" : "s"}` : "models via /models"}` })
121723
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ThemedText, { dim: true, children: `${e.baseUrl} \xB7 ${e.wire} \xB7 ${maskedKeyState(e)} \xB7 ${e.models?.length ? `${e.models.length} pinned model${e.models.length === 1 ? "" : "s"}` : "models discovered live"}` })
120960
121724
  ] }, e.name))
120961
121725
  ] }),
120962
121726
  /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
@@ -120964,7 +121728,7 @@ function EndpointsPanel({
120964
121728
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ThemedText, { dim: true, children: "1. Name it and paste the base URL including its version path." }),
120965
121729
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ThemedText, { dim: true, children: "2. Wire: almost everything is OpenAI-compatible (Ollama, LM Studio, vLLM, OpenRouter\u2026)." }),
120966
121730
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ThemedText, { dim: true, children: "3. Paste the API key if the server needs one (local servers usually don't)." }),
120967
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ThemedText, { dim: true, children: "4. Fetch models verifies the endpoint answers and lists what it offers (Add stays locked until it succeeds); optionally pin a subset." }),
121731
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ThemedText, { dim: true, children: "4. Fetch models verifies the endpoint answers and lists what it offers (Add unlocks once it does); optionally pin a subset. No model list (Databricks, some gateways)? Verify and add: type the ids you know and Orion checks the first with a tiny chat request." }),
120968
121732
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ThemedText, { dim: true, children: "5. Add endpoint \u2014 then pick its models from the model picker." })
120969
121733
  ] }),
120970
121734
  /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
@@ -120978,6 +121742,10 @@ function EndpointsPanel({
120978
121742
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ThemedText, { colorKey: focusAction === "fetch" ? "listSelection" : void 0, bold: focusAction === "fetch", children: `${focusAction === "fetch" ? "\u276F" : " "} ${fetching ? "Fetching\u2026" : "Fetch models"}` }),
120979
121743
  discovered?.length ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ThemedText, { dim: true, children: ` ${selected.size ? `${selected.size} of ${discovered.length} pinned` : `${discovered.length} found`}` }) : null
120980
121744
  ] }),
121745
+ manualOffered ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
121746
+ fieldRow("ids", "Model ids", manualIds, "comma-separated \u2014 nothing lists models at this address"),
121747
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Box2, { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ThemedText, { colorKey: focusAction === "verify" ? "listSelection" : void 0, bold: focusAction === "verify", children: `${focusAction === "verify" ? "\u276F" : " "} Verify and add (checks the first id with a tiny chat request)` }) })
121748
+ ] }) : null,
120981
121749
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Box2, { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
120982
121750
  ThemedText,
120983
121751
  {
@@ -121033,7 +121801,7 @@ function NetworkPanel({
121033
121801
  deps2.test().then(
121034
121802
  (result) => {
121035
121803
  setReport((0, import_client_core.formatProbeReport)(result));
121036
- setNote({ text: result.reached ? "Connection works." : "Connection failed.", error: !result.reached });
121804
+ setNote(null);
121037
121805
  },
121038
121806
  (error) => {
121039
121807
  setNote({
@@ -121257,7 +122025,7 @@ function ProxyCredentialsPrompt({
121257
122025
 
121258
122026
  // src/components/dialogs/PermissionRulesPanel.tsx
121259
122027
  var import_react41 = __toESM(require_react(), 1);
121260
- var import_client_core35 = __toESM(require_dist(), 1);
122028
+ var import_client_core36 = __toESM(require_dist(), 1);
121261
122029
  var import_client_ui_core19 = __toESM(require_dist2(), 1);
121262
122030
  var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1);
121263
122031
  function PermissionRulesPanel({
@@ -121272,7 +122040,7 @@ function PermissionRulesPanel({
121272
122040
  if (stage.kind === "add-rule") {
121273
122041
  if (key.escape) return setStage({ kind: "list" });
121274
122042
  if (key.return) {
121275
- if ((0, import_client_core35.validateRule)(stage.draft).ok) setStage({ kind: "add-behavior", rule: stage.draft });
122043
+ if ((0, import_client_core36.validateRule)(stage.draft).ok) setStage({ kind: "add-behavior", rule: stage.draft });
121276
122044
  return;
121277
122045
  }
121278
122046
  if (key.backspace || key.delete)
@@ -121284,7 +122052,7 @@ function PermissionRulesPanel({
121284
122052
  if (input.toLowerCase() === "a") setStage({ kind: "add-rule", draft: "" });
121285
122053
  });
121286
122054
  if (stage.kind === "add-rule") {
121287
- const verdict = (0, import_client_core35.validateRule)(stage.draft);
122055
+ const verdict = (0, import_client_core36.validateRule)(stage.draft);
121288
122056
  return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
121289
122057
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ThemedText, { bold: true, children: "Add a permission rule" }),
121290
122058
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ThemedText, { colorKey: "toolArgs", children: `[ ${stage.draft}\u2588 ]` }),
@@ -121410,7 +122178,7 @@ function PlanApprovalPrompt({
121410
122178
 
121411
122179
  // src/components/dialogs/WorkPlanApprovalPrompt.tsx
121412
122180
  var import_react43 = __toESM(require_react(), 1);
121413
- var import_client_core36 = __toESM(require_dist(), 1);
122181
+ var import_client_core37 = __toESM(require_dist(), 1);
121414
122182
  var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1);
121415
122183
  function WorkPlanApprovalPrompt({
121416
122184
  pending,
@@ -121431,11 +122199,11 @@ function WorkPlanApprovalPrompt({
121431
122199
  if (c3 === "y") onRespond(requestId, true);
121432
122200
  else if (c3 === "n" || key.escape) onRespond(requestId, false);
121433
122201
  });
121434
- const worktreeCandidates = (0, import_client_core36.planWorktreeCount)(plan);
122202
+ const worktreeCandidates = (0, import_client_core37.planWorktreeCount)(plan);
121435
122203
  return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
121436
122204
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Box2, { flexDirection: "row", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ThemedText, { colorKey: "planMode", bold: true, children: "Work graph \u2014 run this plan in the background?" }) }),
121437
122205
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Box2, { marginLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ThemedText, { dim: true, children: plan.goal }) }),
121438
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Box2, { flexDirection: "column", marginTop: 1, marginLeft: 2, children: (0, import_client_core36.planFlowLines)(plan).map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ThemedText, { colorKey: "planMode", children: line }, index)) }),
122206
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Box2, { flexDirection: "column", marginTop: 1, marginLeft: 2, children: (0, import_client_core37.planFlowLines)(plan).map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ThemedText, { colorKey: "planMode", children: line }, index)) }),
121439
122207
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Box2, { marginTop: 1, flexDirection: "column", children: plan.phases.map((phase) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(PhaseRow, { phase }, phase.id)) }),
121440
122208
  worktreeCandidates > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Box2, { marginLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ThemedText, { dim: true, children: `${worktreeCandidates} isolated worktree${worktreeCandidates === 1 ? "" : "s"} will be created; changed ones are kept for review.` }) }),
121441
122209
  /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Box2, { marginTop: 1, flexDirection: "row", children: [
@@ -121451,8 +122219,8 @@ function PhaseRow({ phase }) {
121451
122219
  const heading = phase.title && phase.title !== phase.id ? `${phase.id} \u2014 ${phase.title}` : phase.id;
121452
122220
  return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Box2, { flexDirection: "column", marginLeft: 2, marginTop: 1, children: [
121453
122221
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ThemedText, { bold: true, children: heading }),
121454
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Box2, { marginLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ThemedText, { dim: true, children: (0, import_client_core36.phaseTraits)(phase).join(" \xB7 ") }) }),
121455
- phase.gate && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Box2, { marginLeft: 2, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ThemedText, { colorKey: "planMode", children: `gate: ${phase.gate.cmd}${(0, import_client_core36.gateRetrySuffix)(phase.gate)}` }) })
122222
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Box2, { marginLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ThemedText, { dim: true, children: (0, import_client_core37.phaseTraits)(phase).join(" \xB7 ") }) }),
122223
+ phase.gate && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Box2, { marginLeft: 2, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ThemedText, { colorKey: "planMode", children: `gate: ${phase.gate.cmd}${(0, import_client_core37.gateRetrySuffix)(phase.gate)}` }) })
121456
122224
  ] });
121457
122225
  }
121458
122226
 
@@ -121627,7 +122395,7 @@ function HooksBrowser({
121627
122395
 
121628
122396
  // src/components/dialogs/PluginManager.tsx
121629
122397
  var import_react45 = __toESM(require_react(), 1);
121630
- var import_client_core37 = __toESM(require_dist(), 1);
122398
+ var import_client_core38 = __toESM(require_dist(), 1);
121631
122399
  var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1);
121632
122400
  function pluginId(p) {
121633
122401
  return p.id ?? p.name ?? "";
@@ -121702,7 +122470,7 @@ function PluginManager({
121702
122470
  {
121703
122471
  dialog: {
121704
122472
  kind: "confirm",
121705
- title: `${import_client_core37.PLUGIN_TRUST_NOTICE}
122473
+ title: `${import_client_core38.PLUGIN_TRUST_NOTICE}
121706
122474
 
121707
122475
  Install "${view.id}" from "${view.catalog}" (${scope} scope)?`,
121708
122476
  options: [],
@@ -122026,7 +122794,7 @@ function ModalFrame({ children }) {
122026
122794
  }
122027
122795
 
122028
122796
  // src/components/dialogs/UsageMetricsPanel.tsx
122029
- var import_client_core38 = __toESM(require_dist(), 1);
122797
+ var import_client_core39 = __toESM(require_dist(), 1);
122030
122798
  var import_jsx_runtime72 = __toESM(require_jsx_runtime(), 1);
122031
122799
  function compactInt(value) {
122032
122800
  if (value >= 1e6) return `${(value / 1e6).toFixed(1)}m`;
@@ -122041,7 +122809,7 @@ function tokenLine(s) {
122041
122809
  `out ${compactInt(t.output_tokens ?? 0)}`,
122042
122810
  `visible ${compactInt(t.visible_output_tokens ?? 0)}`,
122043
122811
  `reason ${compactInt(t.reasoning_tokens ?? 0)}`,
122044
- `cache ${compactInt((0, import_client_core38.cacheHitTokens)(t))}`,
122812
+ `cache ${compactInt((0, import_client_core39.cacheHitTokens)(t))}`,
122045
122813
  // `read`/`write`, not `hit`: this is the cache READ share. A write-heavy turn reads 0% while
122046
122814
  // still paying the 1.25x-2x write premium, so both rates are shown.
122047
122815
  `read ${Math.round(s.cacheHitPercent)}%`,
@@ -122050,7 +122818,7 @@ function tokenLine(s) {
122050
122818
  ].join(" \xB7 ");
122051
122819
  }
122052
122820
  function topRows(group, limit = 4) {
122053
- return Object.entries(group).sort((a, b2) => (0, import_client_core38.meteredTokens)(b2[1].tokens) - (0, import_client_core38.meteredTokens)(a[1].tokens) || b2[1].calls - a[1].calls).slice(0, limit);
122821
+ return Object.entries(group).sort((a, b2) => (0, import_client_core39.meteredTokens)(b2[1].tokens) - (0, import_client_core39.meteredTokens)(a[1].tokens) || b2[1].calls - a[1].calls).slice(0, limit);
122054
122822
  }
122055
122823
  function topContextRows(group, limit = 5) {
122056
122824
  return Object.entries(group).filter(([, value]) => value > 0).sort((a, b2) => b2[1] - a[1]).slice(0, limit);
@@ -122136,11 +122904,11 @@ function BreakdownRows({
122136
122904
  }) {
122137
122905
  const rows = topRows(group);
122138
122906
  if (rows.length === 0) return null;
122139
- const max = Math.max(...rows.map(([, item]) => (0, import_client_core38.meteredTokens)(item.tokens)), 1);
122907
+ const max = Math.max(...rows.map(([, item]) => (0, import_client_core39.meteredTokens)(item.tokens)), 1);
122140
122908
  return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
122141
122909
  /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ThemedText, { bold: true, children: title }),
122142
122910
  rows.map(([key, item], index) => {
122143
- const tokens = (0, import_client_core38.meteredTokens)(item.tokens);
122911
+ const tokens = (0, import_client_core39.meteredTokens)(item.tokens);
122144
122912
  return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(BarRow, { label: key, value: tokens, max, tone: index, children: [
122145
122913
  item.calls,
122146
122914
  " calls \xB7 in ",
@@ -122273,10 +123041,10 @@ function RecentTurns({ rows }) {
122273
123041
  function DailyRows({ summary }) {
122274
123042
  const rows = summary.daily.slice(-5);
122275
123043
  if (rows.length === 0) return null;
122276
- const max = Math.max(...rows.map((day) => (0, import_client_core38.meteredTokens)(day.tokens)), 1);
123044
+ const max = Math.max(...rows.map((day) => (0, import_client_core39.meteredTokens)(day.tokens)), 1);
122277
123045
  return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
122278
123046
  /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ThemedText, { bold: true, children: "Daily history" }),
122279
- rows.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(BarRow, { label: day.date, value: (0, import_client_core38.meteredTokens)(day.tokens), max, tone: index, children: [
123047
+ rows.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(BarRow, { label: day.date, value: (0, import_client_core39.meteredTokens)(day.tokens), max, tone: index, children: [
122280
123048
  day.calls,
122281
123049
  " calls \xB7 in ",
122282
123050
  compactInt(day.tokens.input_tokens ?? 0),
@@ -122426,7 +123194,7 @@ function PendingAttachments({ items: all }) {
122426
123194
  }
122427
123195
 
122428
123196
  // src/components/layout/ReplFooter.tsx
122429
- var import_client_core39 = __toESM(require_dist(), 1);
123197
+ var import_client_core40 = __toESM(require_dist(), 1);
122430
123198
  var import_jsx_runtime76 = __toESM(require_jsx_runtime(), 1);
122431
123199
  function ReplFooter({
122432
123200
  appStore,
@@ -122472,7 +123240,7 @@ function ReplFooter({
122472
123240
  const indexPhase = useStoreSelector(appStore, (s) => s.indexPhase);
122473
123241
  const indexBadgeText = useStoreSelector(
122474
123242
  appStore,
122475
- (s) => (0, import_client_core39.formatIndexBadge)({
123243
+ (s) => (0, import_client_core40.formatIndexBadge)({
122476
123244
  mode: s.indexMode,
122477
123245
  phase: s.indexPhase,
122478
123246
  percent: s.indexPercent,
@@ -122677,7 +123445,7 @@ function FullscreenLayout({
122677
123445
 
122678
123446
  // src/components/dialogs/AgentsDashboard.tsx
122679
123447
  var import_react51 = __toESM(require_react(), 1);
122680
- var import_client_core40 = __toESM(require_dist(), 1);
123448
+ var import_client_core41 = __toESM(require_dist(), 1);
122681
123449
  var import_client_ui_core21 = __toESM(require_dist2(), 1);
122682
123450
  var import_strip_ansi4 = __toESM(require_strip_ansi(), 1);
122683
123451
  var import_jsx_runtime78 = __toESM(require_jsx_runtime(), 1);
@@ -122794,11 +123562,11 @@ function AgentsDashboard({
122794
123562
  setEvents((prev) => [...prev, ...fresh]);
122795
123563
  }
122796
123564
  setPollError(null);
122797
- if (!(0, import_client_core40.isTerminal)(job.status)) timer = setTimeout(tick, POLL_MS);
123565
+ if (!(0, import_client_core41.isTerminal)(job.status)) timer = setTimeout(tick, POLL_MS);
122798
123566
  } catch (e) {
122799
123567
  if (cancelled) return;
122800
- setPollError((0, import_client_core40.formatMissionsError)(e));
122801
- if (latest && (0, import_client_core40.isTerminal)(latest.status)) return;
123568
+ setPollError((0, import_client_core41.formatMissionsError)(e));
123569
+ if (latest && (0, import_client_core41.isTerminal)(latest.status)) return;
122802
123570
  timer = setTimeout(tick, POLL_MS);
122803
123571
  }
122804
123572
  };
@@ -122826,7 +123594,7 @@ function AgentsDashboard({
122826
123594
  cancelled = true;
122827
123595
  };
122828
123596
  }, [detailId, branchName]);
122829
- const liveSessionId = detailJob && !(0, import_client_core40.isTerminal)(detailJob.status) && detailJob.session_id ? detailJob.session_id : null;
123597
+ const liveSessionId = detailJob && !(0, import_client_core41.isTerminal)(detailJob.status) && detailJob.session_id ? detailJob.session_id : null;
122830
123598
  (0, import_react51.useEffect)(() => {
122831
123599
  if (!liveSessionId) return;
122832
123600
  liveIdRef.current = 0;
@@ -122835,16 +123603,16 @@ function AgentsDashboard({
122835
123603
  setLiveFrames(0);
122836
123604
  const nextId = () => liveIdRef.current += 1;
122837
123605
  const sub = panelRef.current.watch(liveSessionId, (env3) => {
122838
- if ((0, import_client_core40.desktopFrameOf)(env3) !== null) {
123606
+ if ((0, import_client_core41.desktopFrameOf)(env3) !== null) {
122839
123607
  setLiveFrames((n) => n + 1);
122840
123608
  return;
122841
123609
  }
122842
- const chunk = (0, import_client_core40.terminalChunkOf)(env3);
123610
+ const chunk = (0, import_client_core41.terminalChunkOf)(env3);
122843
123611
  if (chunk !== null) {
122844
- setLiveTerm((tail) => (0, import_client_core40.appendTerminalTail)(tail, (0, import_strip_ansi4.default)(chunk)));
123612
+ setLiveTerm((tail) => (0, import_client_core41.appendTerminalTail)(tail, (0, import_strip_ansi4.default)(chunk)));
122845
123613
  return;
122846
123614
  }
122847
- setLiveItems((prev) => (0, import_client_core40.applyLiveThreadEvent)(prev, env3, nextId));
123615
+ setLiveItems((prev) => (0, import_client_core41.applyLiveThreadEvent)(prev, env3, nextId));
122848
123616
  });
122849
123617
  return () => sub.dispose();
122850
123618
  }, [liveSessionId]);
@@ -122876,7 +123644,7 @@ function AgentsDashboard({
122876
123644
  const runAction = (action) => {
122877
123645
  setBusy(true);
122878
123646
  setError(null);
122879
- void action().catch((e) => setError((0, import_client_core40.formatMissionsError)(e))).finally(() => setBusy(false));
123647
+ void action().catch((e) => setError((0, import_client_core41.formatMissionsError)(e))).finally(() => setBusy(false));
122880
123648
  };
122881
123649
  const submitMessage = (id) => {
122882
123650
  const text = messageText.trim();
@@ -122892,7 +123660,7 @@ function AgentsDashboard({
122892
123660
  setMessaging(false);
122893
123661
  setMessageNote("Follow-up started.");
122894
123662
  setScreen({ kind: "detail", id: created.job_id });
122895
- }).catch((e) => setMessageNote((0, import_client_core40.formatMissionsError)(e))).finally(() => setBusy(false));
123663
+ }).catch((e) => setMessageNote((0, import_client_core41.formatMissionsError)(e))).finally(() => setBusy(false));
122896
123664
  return;
122897
123665
  }
122898
123666
  if (detailJob?.status === "needs_human_input") {
@@ -122902,7 +123670,7 @@ function AgentsDashboard({
122902
123670
  setMessageText("");
122903
123671
  setMessaging(false);
122904
123672
  setMessageNote("Resumed.");
122905
- }).catch((e) => setMessageNote((0, import_client_core40.formatMissionsError)(e))).finally(() => setBusy(false));
123673
+ }).catch((e) => setMessageNote((0, import_client_core41.formatMissionsError)(e))).finally(() => setBusy(false));
122906
123674
  return;
122907
123675
  }
122908
123676
  if (!text) {
@@ -122915,7 +123683,7 @@ function AgentsDashboard({
122915
123683
  setMessageText("");
122916
123684
  setMessaging(false);
122917
123685
  setMessageNote(res.delivered ? "Sent to the agent." : "Queued for the next phase.");
122918
- }).catch((e) => setMessageNote((0, import_client_core40.formatMissionsError)(e))).finally(() => setBusy(false));
123686
+ }).catch((e) => setMessageNote((0, import_client_core41.formatMissionsError)(e))).finally(() => setBusy(false));
122919
123687
  };
122920
123688
  const tokenHost = tokenStatus?.host || "github.com";
122921
123689
  const startConnect = () => {
@@ -122996,7 +123764,7 @@ function AgentsDashboard({
122996
123764
  setTokenInput(false);
122997
123765
  setTokenDraft("");
122998
123766
  setTokenNote("Token saved.");
122999
- }).catch((e) => setTokenNote((0, import_client_core40.formatMissionsError)(e))).finally(() => setTokenBusy(false));
123767
+ }).catch((e) => setTokenNote((0, import_client_core41.formatMissionsError)(e))).finally(() => setTokenBusy(false));
123000
123768
  };
123001
123769
  const submitJiraStep = () => {
123002
123770
  if (!jiraInput) return;
@@ -123025,7 +123793,7 @@ function AgentsDashboard({
123025
123793
  );
123026
123794
  setJiraInput(null);
123027
123795
  setJiraNote("Jira connected \u2014 the launch form's Ticket field is live.");
123028
- }).catch((e) => setJiraNote((0, import_client_core40.formatMissionsError)(e))).finally(() => setJiraBusy(false));
123796
+ }).catch((e) => setJiraNote((0, import_client_core41.formatMissionsError)(e))).finally(() => setJiraBusy(false));
123029
123797
  };
123030
123798
  const removeJira = () => {
123031
123799
  if (jiraBusy) return;
@@ -123034,7 +123802,7 @@ function AgentsDashboard({
123034
123802
  void panel.clearTicketConnection().then(() => {
123035
123803
  setJiraStatus((p) => p ? { ...p, configured: false, base_url: null, hint: null } : p);
123036
123804
  setJiraNote("Jira connection removed.");
123037
- }).catch((e) => setJiraNote((0, import_client_core40.formatMissionsError)(e))).finally(() => setJiraBusy(false));
123805
+ }).catch((e) => setJiraNote((0, import_client_core41.formatMissionsError)(e))).finally(() => setJiraBusy(false));
123038
123806
  };
123039
123807
  const removeToken = () => {
123040
123808
  if (tokenBusy) return;
@@ -123043,7 +123811,7 @@ function AgentsDashboard({
123043
123811
  void panel.clearToken().then(() => {
123044
123812
  setTokenStatus((p) => p ? { ...p, configured: false, hint: null } : p);
123045
123813
  setTokenNote("Token removed.");
123046
- }).catch((e) => setTokenNote((0, import_client_core40.formatMissionsError)(e))).finally(() => setTokenBusy(false));
123814
+ }).catch((e) => setTokenNote((0, import_client_core41.formatMissionsError)(e))).finally(() => setTokenBusy(false));
123047
123815
  };
123048
123816
  const submitLaunch = () => {
123049
123817
  const repo_url = form.repo_url.trim();
@@ -123063,7 +123831,7 @@ function AgentsDashboard({
123063
123831
  setForm(EMPTY_FORM);
123064
123832
  setField(0);
123065
123833
  setScreen({ kind: "list" });
123066
- }).catch((e) => setError((0, import_client_core40.formatMissionsError)(e))).finally(() => setBusy(false));
123834
+ }).catch((e) => setError((0, import_client_core41.formatMissionsError)(e))).finally(() => setBusy(false));
123067
123835
  };
123068
123836
  use_input_default((input, key) => {
123069
123837
  if (busy) return;
@@ -123102,14 +123870,14 @@ function AgentsDashboard({
123102
123870
  return;
123103
123871
  }
123104
123872
  if (key.escape || input === "q") return setScreen({ kind: "list" });
123105
- if (input === "m" && job && (!(0, import_client_core40.isTerminal)(job.status) || job.status === "complete")) {
123873
+ if (input === "m" && job && (!(0, import_client_core41.isTerminal)(job.status) || job.status === "complete")) {
123106
123874
  setMessageNote(null);
123107
123875
  return setMessaging(true);
123108
123876
  }
123109
- if (input === "i" && job && !(0, import_client_core40.isTerminal)(job.status) && job.status !== "needs_human_input") {
123877
+ if (input === "i" && job && !(0, import_client_core41.isTerminal)(job.status) && job.status !== "needs_human_input") {
123110
123878
  return runAction(() => panel.interrupt(screen.id).then(() => void 0));
123111
123879
  }
123112
- if (input === "c" && job && !(0, import_client_core40.isTerminal)(job.status)) {
123880
+ if (input === "c" && job && !(0, import_client_core41.isTerminal)(job.status)) {
123113
123881
  return runAction(() => panel.cancel(screen.id));
123114
123882
  }
123115
123883
  if (input === "r") return runAction(() => panel.refresh().then(() => void 0));
@@ -123182,7 +123950,7 @@ function AgentsDashboard({
123182
123950
  setError(null);
123183
123951
  return setScreen({ kind: "detail", id: here.id });
123184
123952
  }
123185
- if (input === "c" && !(0, import_client_core40.isTerminal)(here.status)) {
123953
+ if (input === "c" && !(0, import_client_core41.isTerminal)(here.status)) {
123186
123954
  return runAction(() => panel.cancel(here.id));
123187
123955
  }
123188
123956
  });
@@ -123209,7 +123977,7 @@ function AgentsDashboard({
123209
123977
  // point. This MUST match the `m`-key gate (which allows complete): if the
123210
123978
  // key opens messaging but the render gate stays !isTerminal, the user types
123211
123979
  // blind and errors never paint.
123212
- live: !!(detailJob && (!(0, import_client_core40.isTerminal)(detailJob.status) || detailJob.status === "complete")),
123980
+ live: !!(detailJob && (!(0, import_client_core41.isTerminal)(detailJob.status) || detailJob.status === "complete")),
123213
123981
  messaging,
123214
123982
  text: messageText,
123215
123983
  note: messageNote,
@@ -123261,10 +124029,10 @@ function footerHint(screen, job, messaging, conn) {
123261
124029
  }
123262
124030
  if (parked) return "m resume \xB7 c cancel \xB7 r refresh \xB7 q back";
123263
124031
  if (job?.status === "complete") return "m follow-up \xB7 r refresh \xB7 q back";
123264
- const steer = job && !(0, import_client_core40.isTerminal)(job.status) ? "m message \xB7 i interrupt \xB7 c cancel \xB7 " : "";
124032
+ const steer = job && !(0, import_client_core41.isTerminal)(job.status) ? "m message \xB7 i interrupt \xB7 c cancel \xB7 " : "";
123265
124033
  return `${steer}r refresh \xB7 q back`;
123266
124034
  }
123267
- const cancel = job && !(0, import_client_core40.isTerminal)(job.status) ? "c cancel \xB7 " : "";
124035
+ const cancel = job && !(0, import_client_core41.isTerminal)(job.status) ? "c cancel \xB7 " : "";
123268
124036
  return `\u2191/\u2193 move \xB7 enter open \xB7 n new \xB7 s connections \xB7 ${cancel}r refresh \xB7 q close`;
123269
124037
  }
123270
124038
  function ConnectionsView({
@@ -123398,7 +124166,7 @@ function JobDetailView({
123398
124166
  composer
123399
124167
  }) {
123400
124168
  if (!job) return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(ThemedText, { dim: true, children: "Job not found." });
123401
- const terminal = (0, import_client_core40.isTerminal)(job.status);
124169
+ const terminal = (0, import_client_core41.isTerminal)(job.status);
123402
124170
  return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Box2, { flexDirection: "column", children: [
123403
124171
  /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(ThemedText, { colorKey: "listSelection", bold: true, children: jobTitle(job) }),
123404
124172
  /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
@@ -123638,7 +124406,7 @@ function Root({
123638
124406
 
123639
124407
  // src/components/layout/SignInScreen.tsx
123640
124408
  var import_react55 = __toESM(require_react(), 1);
123641
- var import_client_core41 = __toESM(require_dist(), 1);
124409
+ var import_client_core42 = __toESM(require_dist(), 1);
123642
124410
 
123643
124411
  // src/components/layout/splash/Splash.tsx
123644
124412
  var import_react54 = __toESM(require_react(), 1);
@@ -124024,7 +124792,7 @@ function SignInScreen({
124024
124792
  setUrl(null);
124025
124793
  setError(null);
124026
124794
  try {
124027
- await (0, import_client_core41.signInViaBrowser)(
124795
+ await (0, import_client_core42.signInViaBrowser)(
124028
124796
  session,
124029
124797
  { accountsUrl, accountsApiUrl, client: "tui" },
124030
124798
  {
@@ -124036,7 +124804,7 @@ function SignInScreen({
124036
124804
  );
124037
124805
  onSignedIn();
124038
124806
  } catch (e) {
124039
- setError((0, import_client_core41.signInFailureText)(e));
124807
+ setError((0, import_client_core42.signInFailureText)(e));
124040
124808
  setPhase("error");
124041
124809
  }
124042
124810
  };
@@ -124201,16 +124969,16 @@ function createSessionAutosave(deps2) {
124201
124969
  }
124202
124970
 
124203
124971
  // src/services/presenceHost.ts
124204
- var import_client_core42 = __toESM(require_dist(), 1);
124972
+ var import_client_core43 = __toESM(require_dist(), 1);
124205
124973
  function startTuiPresence(opts) {
124206
- const registry = opts.registry ?? new import_client_core42.PresenceRegistry({ clientType: "tui" });
124974
+ const registry = opts.registry ?? new import_client_core43.PresenceRegistry({ clientType: "tui" });
124207
124975
  let currentSid = null;
124208
124976
  let lastStatus = "idle";
124209
124977
  const statusFromApp = (s) => s.pendingPermissions.length > 0 ? "waiting" : s.status === "streaming" ? "busy" : "idle";
124210
124978
  const stampGit = () => {
124211
124979
  if (!opts.workspaceRoot || !currentSid) return;
124212
124980
  const sid = currentSid;
124213
- void (0, import_client_core42.getGitInfo)(opts.workspaceRoot).then((info2) => {
124981
+ void (0, import_client_core43.getGitInfo)(opts.workspaceRoot).then((info2) => {
124214
124982
  if (sid !== currentSid) return;
124215
124983
  registry.updateSession(sid, {
124216
124984
  gitRoot: info2.gitRoot ?? void 0,
@@ -124246,11 +125014,11 @@ function startTuiPresence(opts) {
124246
125014
  ownSessionId: currentSid ?? void 0,
124247
125015
  fresh: true
124248
125016
  });
124249
- return peers.map((p) => `${(0, import_client_core42.describePeer)(p)} \u2014 ${p.session.status}`);
125017
+ return peers.map((p) => `${(0, import_client_core43.describePeer)(p)} \u2014 ${p.session.status}`);
124250
125018
  },
124251
125019
  async liveElsewhere(sessionId) {
124252
125020
  const peer = await registry.isSessionLiveElsewhere(sessionId);
124253
- return peer ? (0, import_client_core42.describePeer)(peer) : null;
125021
+ return peer ? (0, import_client_core43.describePeer)(peer) : null;
124254
125022
  },
124255
125023
  dispose() {
124256
125024
  unsubscribe();
@@ -124260,7 +125028,7 @@ function startTuiPresence(opts) {
124260
125028
  }
124261
125029
 
124262
125030
  // src/services/remoteControlHost.ts
124263
- var import_client_core43 = __toESM(require_dist(), 1);
125031
+ var import_client_core44 = __toESM(require_dist(), 1);
124264
125032
  import os6 from "os";
124265
125033
  var REMOTE_DENIED = /* @__PURE__ */ new Set([
124266
125034
  // Session/process-scoped.
@@ -124316,17 +125084,17 @@ function flattenInfoView(view) {
124316
125084
  function startTuiRemoteControl(opts) {
124317
125085
  let currentSid = null;
124318
125086
  const stateFromApp = (s) => s.pendingPermissions.length > 0 || s.pendingPlanApproval !== null || s.pendingAskUser !== null ? "needs_you" : s.status === "streaming" ? "running" : "idle";
124319
- const requireCurrent = (sessionId) => sessionId === currentSid ? null : (0, import_client_core43.rcRefuse)("unknown_session", "this terminal is on a different session");
125087
+ const requireCurrent = (sessionId) => sessionId === currentSid ? null : (0, import_client_core44.rcRefuse)("unknown_session", "this terminal is on a different session");
124320
125088
  const deliverText = (text, attachments) => {
124321
125089
  if (opts.appStore.getState().status === "streaming") {
124322
125090
  if (attachments !== void 0 && attachments.length > 0) {
124323
- return (0, import_client_core43.rcRefusePhotosMidTurn)();
125091
+ return (0, import_client_core44.rcRefusePhotosMidTurn)();
124324
125092
  }
124325
125093
  opts.verbs.steer(text);
124326
- return import_client_core43.RC_OK;
125094
+ return import_client_core44.RC_OK;
124327
125095
  }
124328
125096
  const sent = attachments !== void 0 && attachments.length > 0 ? opts.verbs.send(text, attachments) : opts.verbs.send(text);
124329
- return sent ? import_client_core43.RC_OK : (0, import_client_core43.rcRefuse)("signed_out", "sign in on this machine first");
125097
+ return sent ? import_client_core44.RC_OK : (0, import_client_core44.rcRefuse)("signed_out", "sign in on this machine first");
124330
125098
  };
124331
125099
  const commandCatalog = () => opts.commands === void 0 ? [] : opts.commands.registry.all().filter((command) => !REMOTE_DENIED.has(command.name)).map((command) => ({
124332
125100
  name: command.name,
@@ -124335,15 +125103,15 @@ function startTuiRemoteControl(opts) {
124335
125103
  }));
124336
125104
  const runRemoteCommand = async (text) => {
124337
125105
  const wired = opts.commands;
124338
- if (wired === void 0) return (0, import_client_core43.rcRefuse)("unsupported", "commands are not wired");
125106
+ if (wired === void 0) return (0, import_client_core44.rcRefuse)("unsupported", "commands are not wired");
124339
125107
  const parsed = wired.registry.parse(text);
124340
- if (parsed === null) return (0, import_client_core43.rcRefuse)("unsupported", "unknown command");
125108
+ if (parsed === null) return (0, import_client_core44.rcRefuse)("unsupported", "unknown command");
124341
125109
  const { command, args: args2 } = parsed;
124342
125110
  if (REMOTE_DENIED.has(command.name)) {
124343
- return (0, import_client_core43.rcRefuse)("unsupported", "this command runs at the terminal only");
125111
+ return (0, import_client_core44.rcRefuse)("unsupported", "this command runs at the terminal only");
124344
125112
  }
124345
125113
  if (REMOTE_ARG_REQUIRED.has(command.name) && args2.trim() === "") {
124346
- return (0, import_client_core43.rcRefuse)(
125114
+ return (0, import_client_core44.rcRefuse)(
124347
125115
  "unsupported",
124348
125116
  `add a value: /${command.name} ${command.argumentHint ?? "<value>"}`
124349
125117
  );
@@ -124369,11 +125137,11 @@ function startTuiRemoteControl(opts) {
124369
125137
  try {
124370
125138
  await command.run(args2, ctx);
124371
125139
  } catch (error) {
124372
- return (0, import_client_core43.rcRefuse)("internal", error instanceof Error ? error.message : String(error));
125140
+ return (0, import_client_core44.rcRefuse)("internal", error instanceof Error ? error.message : String(error));
124373
125141
  }
124374
125142
  return { ok: true, ...lines.length > 0 ? { output: lines.join("\n") } : {} };
124375
125143
  };
124376
- const host = (0, import_client_core43.createRemoteControlHost)({
125144
+ const host = (0, import_client_core44.createRemoteControlHost)({
124377
125145
  clientType: "tui",
124378
125146
  bridge: opts.bridge,
124379
125147
  machineId: os6.hostname(),
@@ -124405,18 +125173,18 @@ function startTuiRemoteControl(opts) {
124405
125173
  const refusal = requireCurrent(sessionId);
124406
125174
  if (refusal) return refusal;
124407
125175
  opts.verbs.deliverAgentMessage(message);
124408
- return import_client_core43.RC_OK;
125176
+ return import_client_core44.RC_OK;
124409
125177
  },
124410
125178
  resolvePermission: (sessionId, requestId, decision) => {
124411
125179
  const refusal = requireCurrent(sessionId);
124412
125180
  if (refusal) return refusal;
124413
- return opts.verbs.resolvePermission(requestId, decision, sessionId) ? import_client_core43.RC_OK : (0, import_client_core43.rcRefuse)("no_pending_permission", "that prompt was already answered");
125181
+ return opts.verbs.resolvePermission(requestId, decision, sessionId) ? import_client_core44.RC_OK : (0, import_client_core44.rcRefuse)("no_pending_permission", "that prompt was already answered");
124414
125182
  },
124415
125183
  interrupt: (sessionId) => {
124416
125184
  const refusal = requireCurrent(sessionId);
124417
125185
  if (refusal) return refusal;
124418
125186
  opts.verbs.interrupt();
124419
- return import_client_core43.RC_OK;
125187
+ return import_client_core44.RC_OK;
124420
125188
  },
124421
125189
  runCommand: (sessionId, text) => {
124422
125190
  const refusal = requireCurrent(sessionId);
@@ -124428,14 +125196,14 @@ function startTuiRemoteControl(opts) {
124428
125196
  if (refusal) return refusal;
124429
125197
  const ok2 = await opts.verbs.setModel(
124430
125198
  model,
124431
- effort === void 0 ? void 0 : (0, import_client_core43.rcEffortToLocal)(effort)
125199
+ effort === void 0 ? void 0 : (0, import_client_core44.rcEffortToLocal)(effort)
124432
125200
  );
124433
- return ok2 ? import_client_core43.RC_OK : (0, import_client_core43.rcRefuse)("internal", "couldn't switch the model");
125201
+ return ok2 ? import_client_core44.RC_OK : (0, import_client_core44.rcRefuse)("internal", "couldn't switch the model");
124434
125202
  },
124435
125203
  setMode: (sessionId, mode) => {
124436
125204
  const refusal = requireCurrent(sessionId);
124437
125205
  if (refusal) return refusal;
124438
- return opts.verbs.setMode(mode) ? import_client_core43.RC_OK : (0, import_client_core43.rcRefuse)("internal", "couldn't switch permissions");
125206
+ return opts.verbs.setMode(mode) ? import_client_core44.RC_OK : (0, import_client_core44.rcRefuse)("internal", "couldn't switch permissions");
124439
125207
  },
124440
125208
  committedMessages: (sessionId) => sessionId === currentSid ? opts.committedMessages() : [],
124441
125209
  // Cards parked before anyone was watching: replayed at the end of an attach
@@ -124446,7 +125214,7 @@ function startTuiRemoteControl(opts) {
124446
125214
  const now2 = Date.now() / 1e3;
124447
125215
  return [
124448
125216
  ...app.pendingPermissions.map(
124449
- (parked) => (0, import_client_core43.parkedPermissionEvent)(
125217
+ (parked) => (0, import_client_core44.parkedPermissionEvent)(
124450
125218
  sessionId,
124451
125219
  {
124452
125220
  requestId: parked.data.request_id,
@@ -124461,7 +125229,7 @@ function startTuiRemoteControl(opts) {
124461
125229
  // The other two parked-decision cards ride the backfill tail the same way —
124462
125230
  // a phone arriving mid-plan (or mid-question) has something to answer.
124463
125231
  ...app.pendingPlanApproval !== null ? [
124464
- (0, import_client_core43.parkedPlanApprovalEvent)(
125232
+ (0, import_client_core44.parkedPlanApprovalEvent)(
124465
125233
  sessionId,
124466
125234
  {
124467
125235
  requestId: app.pendingPlanApproval.requestId,
@@ -124471,7 +125239,7 @@ function startTuiRemoteControl(opts) {
124471
125239
  )
124472
125240
  ] : [],
124473
125241
  ...app.pendingAskUser !== null ? [
124474
- (0, import_client_core43.parkedAskUserEvent)(
125242
+ (0, import_client_core44.parkedAskUserEvent)(
124475
125243
  sessionId,
124476
125244
  {
124477
125245
  requestId: app.pendingAskUser.requestId,
@@ -124485,7 +125253,7 @@ function startTuiRemoteControl(opts) {
124485
125253
  resolvePlanApproval: (sessionId, requestId, approved) => {
124486
125254
  const refusal = requireCurrent(sessionId);
124487
125255
  if (refusal) return refusal;
124488
- return opts.verbs.resolvePlanApproval(requestId, approved, sessionId) ? import_client_core43.RC_OK : (0, import_client_core43.rcRefuse)("no_pending_permission", "that plan was already answered");
125256
+ return opts.verbs.resolvePlanApproval(requestId, approved, sessionId) ? import_client_core44.RC_OK : (0, import_client_core44.rcRefuse)("no_pending_permission", "that plan was already answered");
124489
125257
  },
124490
125258
  answerQuestions: (sessionId, requestId, answers) => {
124491
125259
  const refusal = requireCurrent(sessionId);
@@ -124494,7 +125262,7 @@ function startTuiRemoteControl(opts) {
124494
125262
  requestId,
124495
125263
  answers,
124496
125264
  sessionId
124497
- ) ? import_client_core43.RC_OK : (0, import_client_core43.rcRefuse)("no_pending_permission", "those questions were already answered");
125265
+ ) ? import_client_core44.RC_OK : (0, import_client_core44.rcRefuse)("no_pending_permission", "those questions were already answered");
124498
125266
  }
124499
125267
  }
124500
125268
  });
@@ -124519,7 +125287,7 @@ function startTuiRemoteControl(opts) {
124519
125287
  host.updateSession(currentSid, {
124520
125288
  ...model !== void 0 ? { model } : {},
124521
125289
  mode: app.permissionMode,
124522
- effort: (0, import_client_core43.rcEffortToWire)(app.reasoning)
125290
+ effort: (0, import_client_core44.rcEffortToWire)(app.reasoning)
124523
125291
  });
124524
125292
  }
124525
125293
  const next = stateFromApp(app);
@@ -124553,7 +125321,7 @@ function startTuiRemoteControl(opts) {
124553
125321
  ...app.sessionTitle !== "" ? { title: app.sessionTitle } : {},
124554
125322
  ...lastModel !== void 0 ? { model: lastModel } : {},
124555
125323
  mode: lastMode,
124556
- effort: (0, import_client_core43.rcEffortToWire)(lastEffort)
125324
+ effort: (0, import_client_core44.rcEffortToWire)(lastEffort)
124557
125325
  });
124558
125326
  },
124559
125327
  status: () => host.status(),
@@ -124594,19 +125362,19 @@ function appendHistory(text) {
124594
125362
  }
124595
125363
 
124596
125364
  // src/services/indexer.ts
124597
- var import_client_core45 = __toESM(require_dist(), 1);
125365
+ var import_client_core46 = __toESM(require_dist(), 1);
124598
125366
 
124599
125367
  // src/services/nodeFileSource.ts
124600
- var import_client_core44 = __toESM(require_dist(), 1);
125368
+ var import_client_core45 = __toESM(require_dist(), 1);
124601
125369
 
124602
125370
  // src/services/indexer.ts
124603
125371
  import { fileURLToPath as fileURLToPath2 } from "url";
124604
125372
  import * as fs12 from "fs";
124605
125373
  import * as path12 from "path";
124606
- var INDEX_WATCH_INCLUDE = `**/*.{${import_client_core45.INDEX_FILE_EXTENSIONS.join(",")}}`;
124607
- var EXCLUDE = "{" + [...import_client_core45.IGNORE_DIRS].map((d2) => `**/${d2}/**`).join(",") + "}";
125374
+ var INDEX_WATCH_INCLUDE = `**/*.{${import_client_core46.INDEX_FILE_EXTENSIONS.join(",")}}`;
125375
+ var EXCLUDE = "{" + [...import_client_core46.IGNORE_DIRS].map((d2) => `**/${d2}/**`).join(",") + "}";
124608
125376
  function createIndexer(bridge, workspaceRoot, store, onStatus, onFileEvent, options = {}) {
124609
- const fileSource = new import_client_core44.NodeFileSource(workspaceRoot, {
125377
+ const fileSource = new import_client_core45.NodeFileSource(workspaceRoot, {
124610
125378
  watchInclude: INDEX_WATCH_INCLUDE,
124611
125379
  watchExclude: EXCLUDE
124612
125380
  });
@@ -124622,9 +125390,9 @@ function createIndexer(bridge, workspaceRoot, store, onStatus, onFileEvent, opti
124622
125390
  setFileCount: (n) => onStatus?.("orion.index.files", n)
124623
125391
  };
124624
125392
  const workerScriptPath = options.workerScriptPath ?? bundledIndexWorkerPath();
124625
- const controller = new import_client_core45.IndexModeController({
124626
- initialMode: (0, import_client_core45.normalizeIndexMode)(options.mode, "on"),
124627
- create: (defer) => new import_client_core45.ProcessWorkspaceIndexer({
125393
+ const controller = new import_client_core46.IndexModeController({
125394
+ initialMode: (0, import_client_core46.normalizeIndexMode)(options.mode, "on"),
125395
+ create: (defer) => new import_client_core46.ProcessWorkspaceIndexer({
124628
125396
  getRoot: () => workspaceRoot,
124629
125397
  indexConfig,
124630
125398
  progress,
@@ -124635,7 +125403,7 @@ function createIndexer(bridge, workspaceRoot, store, onStatus, onFileEvent, opti
124635
125403
  // The enhanced level's embeddings ride the bridge's gateway relay.
124636
125404
  embeddings: bridge,
124637
125405
  fallback: {
124638
- indexer: new import_client_core45.WorkspaceIndexer(bridge, fileSource, indexConfig, progress, grammarDir, store),
125406
+ indexer: new import_client_core46.WorkspaceIndexer(bridge, fileSource, indexConfig, progress, grammarDir, store),
124639
125407
  reader: store
124640
125408
  },
124641
125409
  log: (message, error) => {
@@ -124644,7 +125412,7 @@ function createIndexer(bridge, workspaceRoot, store, onStatus, onFileEvent, opti
124644
125412
  }
124645
125413
  })
124646
125414
  });
124647
- const safety = (0, import_client_core45.classifyWorkspaceRootForIndexing)(workspaceRoot);
125415
+ const safety = (0, import_client_core46.classifyWorkspaceRootForIndexing)(workspaceRoot);
124648
125416
  if (!safety.safe) {
124649
125417
  onStatus?.("orion.index.state", "idle");
124650
125418
  onStatus?.("orion.index.percent", 0);
@@ -124785,7 +125553,7 @@ function shouldAutoApprove(fullyAutomatic, configAutoApprove) {
124785
125553
  }
124786
125554
 
124787
125555
  // src/headless/runHeadless.ts
124788
- var import_client_core46 = __toESM(require_dist(), 1);
125556
+ var import_client_core47 = __toESM(require_dist(), 1);
124789
125557
  var import_client_ui_core22 = __toESM(require_dist2(), 1);
124790
125558
  import * as os7 from "os";
124791
125559
  import { randomUUID } from "crypto";
@@ -124848,7 +125616,7 @@ function headlessEventLine(ev) {
124848
125616
  }
124849
125617
  async function runGoalLoop(deps2) {
124850
125618
  let turns = 0;
124851
- const runner = new import_client_core46.GoalRunner({
125619
+ const runner = new import_client_core47.GoalRunner({
124852
125620
  // An explicit `--max-turns` overrides. Interactive goal mode is deliberately UNCAPPED —
124853
125621
  // the evaluator decides when a goal is done, and a round count is not evidence about the
124854
125622
  // work. Headless keeps a real ceiling anyway: this mode exists to be run many times by a
@@ -124872,7 +125640,7 @@ async function runHeadless(flags2) {
124872
125640
  (message, error) => console.error(`[orion-net] ${message}${error ? `: ${String(error)}` : ""}`),
124873
125641
  { routeUrls: [config.apiUrl, config.accountsApiUrl, config.accountsUrl], secrets }
124874
125642
  );
124875
- const session = (0, import_client_core46.createAgentSession)(secrets, config, {
125643
+ const session = (0, import_client_core47.createAgentSession)(secrets, config, {
124876
125644
  trace: (line) => console.error(`[orion-auth] ${line}`)
124877
125645
  });
124878
125646
  const signedIn = await session.isSignedIn();
@@ -124899,16 +125667,16 @@ async function runHeadless(flags2) {
124899
125667
  reasoning: flags2.reasoning ?? ""
124900
125668
  });
124901
125669
  const authToken = async () => await session.currentAccessToken() ?? process.env.ORION_AUTH_TOKEN ?? null;
124902
- const bridge = new import_client_core46.OrionBridge(
125670
+ const bridge = new import_client_core47.OrionBridge(
124903
125671
  () => config.apiUrl,
124904
125672
  authToken,
124905
- import_client_core46.nodeEmitterFactory,
125673
+ import_client_core47.nodeEmitterFactory,
124906
125674
  () => session.refresh().then(() => true, () => false)
124907
125675
  );
124908
125676
  const brainLog = (message, error) => console.error(`[orion-brain] ${message}${error ? `: ${String(error)}` : ""}`);
124909
- const brain = (0, import_client_core46.createHostBrain)({
125677
+ const brain = (0, import_client_core47.createHostBrain)({
124910
125678
  topology: config.brainTopology,
124911
- resolveBinary: () => (0, import_client_core46.resolveBrainBinary)({
125679
+ resolveBinary: () => (0, import_client_core47.resolveBrainBinary)({
124912
125680
  configPath: config.brainPath,
124913
125681
  env: process.env,
124914
125682
  bundledCandidates: bundledBrainCandidates()
@@ -124920,13 +125688,13 @@ async function runHeadless(flags2) {
124920
125688
  // refused token back and burns the heal).
124921
125689
  renewBearer: async (refused) => await session.renewedAccessToken(refused) ?? process.env.ORION_AUTH_TOKEN ?? null,
124922
125690
  log: brainLog,
124923
- stdio: { env: () => (0, import_client_core46.networkEnvForChild)(process.env, { for: config.apiUrl }) },
124924
- socket: { env: () => (0, import_client_core46.networkEnvForChild)(process.env, { for: config.apiUrl }) }
125691
+ stdio: { env: () => (0, import_client_core47.networkEnvForChild)(process.env, { for: config.apiUrl }) },
125692
+ socket: { env: () => (0, import_client_core47.networkEnvForChild)(process.env, { for: config.apiUrl }) }
124925
125693
  });
124926
- const turnTransport = (0, import_client_core46.createTurnTransport)({
125694
+ const turnTransport = (0, import_client_core47.createTurnTransport)({
124927
125695
  mode: config.brain,
124928
125696
  bridge,
124929
- makeLocal: () => new import_client_core46.LocalBrainTransport({
125697
+ makeLocal: () => new import_client_core47.LocalBrainTransport({
124930
125698
  // Proactive freshness for the segment-holding bearer (the interactive TUI's twin).
124931
125699
  authToken: async () => await session.currentFreshAccessToken() ?? process.env.ORION_AUTH_TOKEN ?? null,
124932
125700
  gatewayUrl: () => config.apiUrl,
@@ -124934,9 +125702,9 @@ async function runHeadless(flags2) {
124934
125702
  log: brainLog
124935
125703
  })
124936
125704
  });
124937
- const codebaseIndexFallback = new import_client_core46.WorkspaceIndexStore();
124938
- const ripgrep = new import_client_core46.NodeRipgrepLocator({
124939
- bundledCandidates: () => (0, import_client_core46.vscodeRipgrepCandidates)((specifier) => __require.resolve(specifier))
125705
+ const codebaseIndexFallback = new import_client_core47.WorkspaceIndexStore();
125706
+ const ripgrep = new import_client_core47.NodeRipgrepLocator({
125707
+ bundledCandidates: () => (0, import_client_core47.vscodeRipgrepCandidates)((specifier) => __require.resolve(specifier))
124940
125708
  });
124941
125709
  const indexer = createIndexer(bridge, config.workspaceRoot, codebaseIndexFallback, void 0, void 0, {
124942
125710
  rgPath: ripgrep.locate(),
@@ -124946,13 +125714,13 @@ async function runHeadless(flags2) {
124946
125714
  mode: "on-demand"
124947
125715
  });
124948
125716
  void indexer.start().catch(() => void 0);
124949
- const permissionStore = new import_client_core46.PermissionSettingsStore({ workspaceRoot: config.workspaceRoot });
125717
+ const permissionStore = new import_client_core47.PermissionSettingsStore({ workspaceRoot: config.workspaceRoot });
124950
125718
  await permissionStore.load();
124951
- const executor = new import_client_core46.ToolExecutor(
125719
+ const executor = new import_client_core47.ToolExecutor(
124952
125720
  () => config.workspaceRoot,
124953
125721
  () => appStore.getState().permissionMode,
124954
125722
  secrets,
124955
- new import_client_core46.NullLspProvider(),
125723
+ new import_client_core47.NullLspProvider(),
124956
125724
  ripgrep,
124957
125725
  nullFrameSinkFactory,
124958
125726
  fallbackBrowserConfig,
@@ -124963,7 +125731,7 @@ async function runHeadless(flags2) {
124963
125731
  () => permissionStore.rules()
124964
125732
  );
124965
125733
  executor.enableFileHistorySpill();
124966
- executor.registerHostTool(import_client_core46.GOAL_REPORT_TOOL, async (params) => (0, import_client_core46.goalReportToolResult)(params));
125734
+ executor.registerHostTool(import_client_core47.GOAL_REPORT_TOOL, async (params) => (0, import_client_core47.goalReportToolResult)(params));
124967
125735
  const boundary = createBoundaryHandlers({
124968
125736
  bridge,
124969
125737
  executor,
@@ -124976,11 +125744,11 @@ async function runHeadless(flags2) {
124976
125744
  workspaceRoot: config.workspaceRoot,
124977
125745
  homeDir: os7.homedir()
124978
125746
  });
124979
- const sandboxAvailable = (0, import_client_core46.probeSandboxAvailable)();
125747
+ const sandboxAvailable = (0, import_client_core47.probeSandboxAvailable)();
124980
125748
  await (0, import_client_core9.refreshEndpointRouting)(appStore.getState().provider, {
124981
125749
  workspaceRoot: config.workspaceRoot
124982
125750
  });
124983
- await (0, import_client_core46.prewarmDuetExecutor)(config.workspaceRoot);
125751
+ await (0, import_client_core47.prewarmDuetExecutor)(config.workspaceRoot);
124984
125752
  await (0, import_client_core9.refreshDuetExecutorEndpoint)(config.workspaceRoot);
124985
125753
  const routing = () => {
124986
125754
  const a = appStore.getState();
@@ -125021,7 +125789,7 @@ async function runHeadless(flags2) {
125021
125789
  if (trace) process.stderr.write(`[event] ${headlessEventLine(ev)}
125022
125790
  `);
125023
125791
  };
125024
- const outcome = await (0, import_client_core46.driveTurn)(
125792
+ const outcome = await (0, import_client_core47.driveTurn)(
125025
125793
  turnTransport,
125026
125794
  {
125027
125795
  sessionId,
@@ -125030,9 +125798,9 @@ async function runHeadless(flags2) {
125030
125798
  getClientState: () => clientState,
125031
125799
  routing: routing(),
125032
125800
  // Every headless turn is a goal round — the claim tool is always on.
125033
- clientCapabilities: [import_client_core46.GOAL_CAPABILITY],
125801
+ clientCapabilities: [import_client_core47.GOAL_CAPABILITY],
125034
125802
  drainQueuedInput: () => [],
125035
- getOrionResources: () => (0, import_client_core46.buildOrionSnapshot)(config.workspaceRoot, void 0, sessionId),
125803
+ getOrionResources: () => (0, import_client_core47.buildOrionSnapshot)(config.workspaceRoot, void 0, sessionId),
125036
125804
  getFileHistoryManifest: () => executor.fileHistoryManifest(sessionId)
125037
125805
  },
125038
125806
  {
@@ -125048,8 +125816,8 @@ async function runHeadless(flags2) {
125048
125816
  if (Array.isArray(data.messages)) messages = data.messages;
125049
125817
  return {
125050
125818
  text: extractFinalAssistantText(data),
125051
- evidence: (0, import_client_core46.goalEvidenceFromWire)(data.messages),
125052
- claim: (0, import_client_core46.goalClaimFromWire)(data.messages)
125819
+ evidence: (0, import_client_core47.goalEvidenceFromWire)(data.messages),
125820
+ claim: (0, import_client_core47.goalClaimFromWire)(data.messages)
125053
125821
  };
125054
125822
  };
125055
125823
  const { endReason, turns } = await runGoalLoop({
@@ -125057,7 +125825,7 @@ async function runHeadless(flags2) {
125057
125825
  maxTurns: flags2.maxTurns,
125058
125826
  runTurn,
125059
125827
  evaluate: async ({ goal, evidence }) => {
125060
- const ruling = await (0, import_client_core46.evaluateGoalCompletion)({
125828
+ const ruling = await (0, import_client_core47.evaluateGoalCompletion)({
125061
125829
  bridge,
125062
125830
  goal,
125063
125831
  evidence,
@@ -125071,7 +125839,7 @@ async function runHeadless(flags2) {
125071
125839
  sessionProvider: routing().provider
125072
125840
  });
125073
125841
  if (ruling.evaluated && !ruling.ok && ruling.achievable) {
125074
- process.stderr.write(`[headless] not met yet \u2014 ${(0, import_client_core46.goalReasonLine)(ruling.reason)}
125842
+ process.stderr.write(`[headless] not met yet \u2014 ${(0, import_client_core47.goalReasonLine)(ruling.reason)}
125075
125843
  `);
125076
125844
  }
125077
125845
  return ruling;
@@ -125088,7 +125856,7 @@ async function runHeadless(flags2) {
125088
125856
  }
125089
125857
 
125090
125858
  // src/services/feedbackGate.ts
125091
- var import_client_core47 = __toESM(require_dist(), 1);
125859
+ var import_client_core48 = __toESM(require_dist(), 1);
125092
125860
  var import_client_ui_core23 = __toESM(require_dist2(), 1);
125093
125861
  import { randomUUID as randomUUID2 } from "crypto";
125094
125862
  var TuiFeedbackGate = class {
@@ -125138,7 +125906,7 @@ var TuiFeedbackGate = class {
125138
125906
  model: routing.model,
125139
125907
  provider: routing.provider
125140
125908
  });
125141
- void (0, import_client_core47.sendFeedbackImpression)(this.deps.submit, "shown", "tui");
125909
+ void (0, import_client_core48.sendFeedbackImpression)(this.deps.submit, "shown", "tui");
125142
125910
  }
125143
125911
  /** The user rated. Snapshot the transcript SYNCHRONOUSLY (before any await), then
125144
125912
  * scrub + assemble + send off the interactive path. Idempotent per requestId. */
@@ -125161,8 +125929,8 @@ var TuiFeedbackGate = class {
125161
125929
  model: meta.model,
125162
125930
  provider: meta.provider
125163
125931
  });
125164
- const { conversation, truncated } = (0, import_client_core47.scrubFeedbackConversation)(snapshot);
125165
- void (0, import_client_core47.sendFeedbackSubmission)(this.deps.submit, {
125932
+ const { conversation, truncated } = (0, import_client_core48.scrubFeedbackConversation)(snapshot);
125933
+ void (0, import_client_core48.sendFeedbackSubmission)(this.deps.submit, {
125166
125934
  ...body2,
125167
125935
  conversation,
125168
125936
  conversation_truncated: truncated
@@ -125191,7 +125959,7 @@ var TuiFeedbackGate = class {
125191
125959
  now2
125192
125960
  );
125193
125961
  this.safeSave((0, import_client_ui_core23.feedbackScalarsFromState)(state));
125194
- void (0, import_client_core47.sendFeedbackImpression)(this.deps.submit, "dismissed", "tui");
125962
+ void (0, import_client_core48.sendFeedbackImpression)(this.deps.submit, "dismissed", "tui");
125195
125963
  }
125196
125964
  return true;
125197
125965
  }
@@ -125205,7 +125973,7 @@ var TuiFeedbackGate = class {
125205
125973
 
125206
125974
  // src/main.tsx
125207
125975
  var import_jsx_runtime83 = __toESM(require_jsx_runtime(), 1);
125208
- var SANDBOX_AVAILABLE = (0, import_client_core48.probeSandboxAvailable)();
125976
+ var SANDBOX_AVAILABLE = (0, import_client_core49.probeSandboxAvailable)();
125209
125977
  async function main() {
125210
125978
  let headlessFlags = null;
125211
125979
  try {
@@ -125238,12 +126006,12 @@ async function main() {
125238
126006
  prompt: proxyCredentialPrompt
125239
126007
  });
125240
126008
  let pendingDuetReplan = null;
125241
- const duetAdvisorState = (0, import_client_core49.createDuetAdvisorState)();
125242
- const duetRouterGate = (0, import_client_core49.createDuetRouterGate)({
125243
- loadEncoder: (0, import_client_core49.createDefaultDuetRouterEncoder)(),
126009
+ const duetAdvisorState = (0, import_client_core50.createDuetAdvisorState)();
126010
+ const duetRouterGate = (0, import_client_core50.createDuetRouterGate)({
126011
+ loadEncoder: (0, import_client_core50.createDefaultDuetRouterEncoder)(),
125244
126012
  // "Executor decides": the same gate object owns the executor's one-token scorer, so the
125245
126013
  // turn path below has ONE call whichever entry is set (`duetExecutorGate.ts`).
125246
- executorGate: (0, import_client_core49.createDuetExecutorGate)({
126014
+ executorGate: (0, import_client_core50.createDuetExecutorGate)({
125247
126015
  onError: (stage, problem) => console.error(`[duet-executor-gate] ${stage} failed: ${problem}`)
125248
126016
  }),
125249
126017
  onError: (stage, error) => (
@@ -125258,7 +126026,7 @@ async function main() {
125258
126026
  const markDuetLegAtTurnStart = (text, entry, verdict) => {
125259
126027
  const s = appStore.getState();
125260
126028
  if (s.mode !== "duet") return;
125261
- const routed = (0, import_client_core49.willRouteToExecution)(s.duetPlan, text, entry, verdict);
126029
+ const routed = (0, import_client_core50.willRouteToExecution)(s.duetPlan, text, entry, verdict);
125262
126030
  if (routed) appStore.setState((st2) => ({ ...st2, duetExecutionStarted: true }));
125263
126031
  };
125264
126032
  const bindings = loadBindings();
@@ -125315,15 +126083,15 @@ async function main() {
125315
126083
  }
125316
126084
  });
125317
126085
  void (0, import_client_core9.refreshEndpointRouting)(config.provider, { workspaceRoot: config.workspaceRoot });
125318
- void (0, import_client_core49.prewarmInterimModels)(config.workspaceRoot);
125319
- void (0, import_client_core49.prewarmDuetExecutor)(config.workspaceRoot).then(
126086
+ void (0, import_client_core50.prewarmInterimModels)(config.workspaceRoot);
126087
+ void (0, import_client_core50.prewarmDuetExecutor)(config.workspaceRoot).then(
125320
126088
  () => (0, import_client_core9.refreshDuetExecutorEndpoint)(config.workspaceRoot)
125321
126089
  );
125322
- void (0, import_client_core49.prewarmDuetEntry)(config.workspaceRoot);
125323
- void (0, import_client_core49.loadCompactionTrigger)({ workspaceRoot: config.workspaceRoot }).then((trigger) => {
126090
+ void (0, import_client_core50.prewarmDuetEntry)(config.workspaceRoot);
126091
+ void (0, import_client_core50.loadCompactionTrigger)({ workspaceRoot: config.workspaceRoot }).then((trigger) => {
125324
126092
  if (trigger !== null) appStore.setState((s) => ({ ...s, contextTriggerRatio: trigger }));
125325
126093
  }).catch(() => void 0);
125326
- void (0, import_client_core49.prewarmRepoIdentity)(config.workspaceRoot);
126094
+ void (0, import_client_core50.prewarmRepoIdentity)(config.workspaceRoot);
125327
126095
  const setSessionTitle = (title) => {
125328
126096
  appStore.setState((s) => s.sessionTitle === title ? s : { ...s, sessionTitle: title });
125329
126097
  };
@@ -125335,12 +126103,12 @@ async function main() {
125335
126103
  // keep the terminal-tab title in step with the save
125336
126104
  });
125337
126105
  const transcriptStore = createTranscriptStore(autosave.onChange);
125338
- const session = (0, import_client_core49.createAgentSession)(secrets, config, {
126106
+ const session = (0, import_client_core50.createAgentSession)(secrets, config, {
125339
126107
  // Renewal/refresh breadcrumbs (step outcomes + timings, never tokens) — the evidence
125340
126108
  // the 2026-08-22 refresh-wedge investigation lacked.
125341
126109
  trace: (line) => console.error(`[orion-auth] ${line}`)
125342
126110
  });
125343
- const outcomes = new import_client_core49.OutcomeReporter({
126111
+ const outcomes = new import_client_core50.OutcomeReporter({
125344
126112
  apiBaseUrl: () => config.accountsApiUrl,
125345
126113
  accessToken: () => session.currentAccessToken()
125346
126114
  });
@@ -125390,10 +126158,10 @@ async function main() {
125390
126158
  }
125391
126159
  }
125392
126160
  const authToken = async () => await session.currentAccessToken() ?? process.env.ORION_AUTH_TOKEN ?? null;
125393
- const bridge = new import_client_core48.OrionBridge(
126161
+ const bridge = new import_client_core49.OrionBridge(
125394
126162
  () => config.apiUrl,
125395
126163
  authToken,
125396
- import_client_core49.nodeEmitterFactory,
126164
+ import_client_core50.nodeEmitterFactory,
125397
126165
  // Seamless refresh: a 401 coalesces ONE refresh through the AgentSession (single-flight), so a
125398
126166
  // token cycling mid-chat never logs the user out. `refreshAndSyncGate` also re-derives the
125399
126167
  // projected account slice so a definitively-revoked session re-gates the chat cleanly (no
@@ -125403,9 +126171,9 @@ async function main() {
125403
126171
  const brainLog = (message, error) => console.error(`[orion-brain] ${message}${error ? `: ${String(error)}` : ""}`);
125404
126172
  let brainInstance;
125405
126173
  const brain = () => {
125406
- brainInstance ??= (0, import_client_core49.createHostBrain)({
126174
+ brainInstance ??= (0, import_client_core50.createHostBrain)({
125407
126175
  topology: config.brainTopology,
125408
- resolveBinary: () => (0, import_client_core49.resolveBrainBinary)({
126176
+ resolveBinary: () => (0, import_client_core50.resolveBrainBinary)({
125409
126177
  configPath: config.brainPath,
125410
126178
  env: process.env,
125411
126179
  bundledCandidates: bundledBrainCandidates()
@@ -125419,15 +126187,15 @@ async function main() {
125419
126187
  log: brainLog,
125420
126188
  // The engine makes its own model calls, so it is handed the route to the gateway — and,
125421
126189
  // on a company network, Orion's own local proxy, which can authenticate where it cannot.
125422
- stdio: { env: () => (0, import_client_core49.networkEnvForChild)(process.env, { for: config.apiUrl }) },
125423
- socket: { env: () => (0, import_client_core49.networkEnvForChild)(process.env, { for: config.apiUrl }) }
126190
+ stdio: { env: () => (0, import_client_core50.networkEnvForChild)(process.env, { for: config.apiUrl }) },
126191
+ socket: { env: () => (0, import_client_core50.networkEnvForChild)(process.env, { for: config.apiUrl }) }
125424
126192
  });
125425
126193
  return brainInstance;
125426
126194
  };
125427
- const turnTransport = (0, import_client_core49.createTurnTransport)({
126195
+ const turnTransport = (0, import_client_core50.createTurnTransport)({
125428
126196
  mode: config.brain,
125429
126197
  bridge,
125430
- makeLocal: () => new import_client_core49.LocalBrainTransport({
126198
+ makeLocal: () => new import_client_core50.LocalBrainTransport({
125431
126199
  // Proactive freshness: the brain holds this bearer for a whole segment and cannot
125432
126200
  // ride the bridge's reactive 401-refresh — so validate-or-refresh before hand-off,
125433
126201
  // and re-derive the gate when there is nothing to hand over (signed out elsewhere).
@@ -125437,14 +126205,14 @@ async function main() {
125437
126205
  log: brainLog
125438
126206
  })
125439
126207
  });
125440
- const codebaseIndexFallback = new import_client_core48.WorkspaceIndexStore();
125441
- const ripgrep = new import_client_core49.NodeRipgrepLocator({
126208
+ const codebaseIndexFallback = new import_client_core49.WorkspaceIndexStore();
126209
+ const ripgrep = new import_client_core50.NodeRipgrepLocator({
125442
126210
  // Bundled-first rg: ships as an optionalDependency of this package, so an
125443
126211
  // `npm i -g` user gets fast search with nothing else installed. Resolved
125444
126212
  // from THIS package's node_modules via require.resolve (nested and hoisted
125445
126213
  // layouts both work); absent (install offline / postinstall failed) → the
125446
126214
  // locator falls through to PATH + well-known paths exactly as before.
125447
- bundledCandidates: () => (0, import_client_core49.vscodeRipgrepCandidates)((specifier) => __require.resolve(specifier))
126215
+ bundledCandidates: () => (0, import_client_core50.vscodeRipgrepCandidates)((specifier) => __require.resolve(specifier))
125448
126216
  });
125449
126217
  const indexer = createIndexer(
125450
126218
  bridge,
@@ -125476,21 +126244,21 @@ async function main() {
125476
126244
  );
125477
126245
  void indexer.start().catch(() => void 0);
125478
126246
  initIndexModeService({ appStore, setMode: (m2) => indexer.setMode(m2) });
125479
- const permissionStore = new import_client_core49.PermissionSettingsStore({ workspaceRoot: config.workspaceRoot });
126247
+ const permissionStore = new import_client_core50.PermissionSettingsStore({ workspaceRoot: config.workspaceRoot });
125480
126248
  await permissionStore.load();
125481
- const executor = new import_client_core48.ToolExecutor(
126249
+ const executor = new import_client_core49.ToolExecutor(
125482
126250
  () => config.workspaceRoot,
125483
126251
  // The session's EFFECTIVE mode — the same turbo⇒full_access law the wire rides
125484
126252
  // (`currentRouting`), never the bare store mode: the executor's membership
125485
126253
  // backstop must agree with the gate that already ruled on each call. Loop-run
125486
126254
  // sessions never enable turbo on the bridge, so they keep the configured mode
125487
126255
  // their own wire rides.
125488
- (sessionId2) => (0, import_client_core49.effectiveWirePermissionMode)(
126256
+ (sessionId2) => (0, import_client_core50.effectiveWirePermissionMode)(
125489
126257
  sessionId2 !== void 0 && bridge.isTurboModeEnabledForSession(sessionId2),
125490
126258
  appStore.getState().permissionMode
125491
126259
  ),
125492
126260
  secrets,
125493
- new import_client_core49.NullLspProvider(),
126261
+ new import_client_core50.NullLspProvider(),
125494
126262
  ripgrep,
125495
126263
  nullFrameSinkFactory,
125496
126264
  fallbackBrowserConfig,
@@ -125614,11 +126382,11 @@ async function main() {
125614
126382
  }
125615
126383
  renderLane(transcriptStore, appStore, ev);
125616
126384
  if (ev.event === "usage_recorded") {
125617
- (0, import_client_core48.recordTurnMetrics)({
126385
+ (0, import_client_core49.recordTurnMetrics)({
125618
126386
  app: "tui",
125619
126387
  sessionId,
125620
126388
  workspaceRoot: currentRouting().workspaceRoot,
125621
- turn: (0, import_client_core48.turnMetricsFromUsageRecorded)(ev.data ?? {})
126389
+ turn: (0, import_client_core49.turnMetricsFromUsageRecorded)(ev.data ?? {})
125622
126390
  });
125623
126391
  }
125624
126392
  if (ev.event === "file_modified") {
@@ -125642,11 +126410,11 @@ async function main() {
125642
126410
  sessionSub = bridge.onSessionEvent(sid, onSessionStreamEvent);
125643
126411
  };
125644
126412
  let goalRunner = null;
125645
- const cronController = new import_client_core49.CronController({
126413
+ const cronController = new import_client_core50.CronController({
125646
126414
  sessionId,
125647
126415
  submitTurn: (prompt) => sendTurn(prompt, "\u27F3 scheduled", void 0, "system"),
125648
126416
  isBusy: () => appStore.getState().status === "streaming",
125649
- persistence: (0, import_client_core50.fileCronPersistence)((0, import_client_core50.cronStorePath)(config.workspaceRoot))
126417
+ persistence: (0, import_client_core51.fileCronPersistence)((0, import_client_core51.cronStorePath)(config.workspaceRoot))
125650
126418
  });
125651
126419
  const resetTransient = () => {
125652
126420
  goalRunner?.stop();
@@ -125834,9 +126602,9 @@ async function main() {
125834
126602
  argumentHint: "",
125835
126603
  kind: "local",
125836
126604
  run: (_args, ctx) => {
125837
- const flagged = (0, import_client_core49.invalidateStandingPlan)(ctx.appStore.getState().duetPlan);
126605
+ const flagged = (0, import_client_core50.invalidateStandingPlan)(ctx.appStore.getState().duetPlan);
125838
126606
  if (flagged) ctx.appStore.setState((s) => ({ ...s, duetPlan: flagged }));
125839
- ctx.print((0, import_client_core49.duetReplanCommandNote)(flagged !== null));
126607
+ ctx.print((0, import_client_core50.duetReplanCommandNote)(flagged !== null));
125840
126608
  }
125841
126609
  });
125842
126610
  const getCompletions = (input) => {
@@ -125854,8 +126622,8 @@ async function main() {
125854
126622
  const anywhere = new Set(
125855
126623
  registry.all().filter((c3) => c3.source === "skill").map((c3) => c3.name)
125856
126624
  );
125857
- const ranges = (0, import_client_core49.scanSlashTokenRanges)(v2, anywhere);
125858
- const lead = (0, import_client_core49.matchSlashToken)(v2);
126625
+ const ranges = (0, import_client_core50.scanSlashTokenRanges)(v2, anywhere);
126626
+ const lead = (0, import_client_core50.matchSlashToken)(v2);
125859
126627
  if (lead && !anywhere.has(lead.name) && registry.get(lead.name)) {
125860
126628
  const start2 = v2.indexOf("/");
125861
126629
  ranges.unshift({ start: start2, end: start2 + lead.name.length + 1 });
@@ -125864,7 +126632,7 @@ async function main() {
125864
126632
  return ranges;
125865
126633
  };
125866
126634
  let fileEntries = [];
125867
- void new import_client_core44.NodeFileSource(config.workspaceRoot).findFiles("**/*", "{**/node_modules/**,**/.git/**,**/dist/**,**/build/**}", 5e3).then((abs) => {
126635
+ void new import_client_core45.NodeFileSource(config.workspaceRoot).findFiles("**/*", "{**/node_modules/**,**/.git/**,**/dist/**,**/build/**}", 5e3).then((abs) => {
125868
126636
  fileEntries = withDirectories(
125869
126637
  abs.map((p) => path13.relative(config.workspaceRoot, p).split(path13.sep).join("/"))
125870
126638
  );
@@ -125894,7 +126662,7 @@ async function main() {
125894
126662
  if (turn && streaming && !turn.cancelRequested && turn.phase === "stream") {
125895
126663
  turn.cancelRequested = true;
125896
126664
  outcomes.report({ kind: "cancel_context", kept_edits: turn.hadEdits });
125897
- turn.disposeFallback = (0, import_client_core49.armGracefulCancel)({
126665
+ turn.disposeFallback = (0, import_client_core50.armGracefulCancel)({
125898
126666
  controller: turn.abort,
125899
126667
  sendCancel: () => turnTransport.cancelTurn(turn.sessionId)
125900
126668
  });
@@ -125924,7 +126692,7 @@ async function main() {
125924
126692
  const boundary = createBoundaryHandlers({
125925
126693
  // Planner entry's other verdict: the planner chose to PLAN — the journal's verdict row.
125926
126694
  duetPlanPresented: () => {
125927
- (0, import_client_core49.journalDuetPlannerVerdict)(duetAdvisorState, { verdict: "plan" }, { workspaceRoot: config.workspaceRoot });
126695
+ (0, import_client_core50.journalDuetPlannerVerdict)(duetAdvisorState, { verdict: "plan" }, { workspaceRoot: config.workspaceRoot });
125928
126696
  },
125929
126697
  bridge,
125930
126698
  executor,
@@ -125954,7 +126722,7 @@ async function main() {
125954
126722
  };
125955
126723
  const heldAgentReports = [];
125956
126724
  let inboundPeerHop = null;
125957
- const agentManager = new import_client_core49.AgentManager((0, import_client_core49.brainAwareAgentTransport)(bridge, turnTransport), executor, async () => {
126725
+ const agentManager = new import_client_core50.AgentManager((0, import_client_core50.brainAwareAgentTransport)(bridge, turnTransport), executor, async () => {
125958
126726
  const result = await bridge.rpc("list_personas", {});
125959
126727
  return result.personas ?? [];
125960
126728
  });
@@ -125964,8 +126732,8 @@ async function main() {
125964
126732
  agentManager.attachOutcomeSink((outcome) => {
125965
126733
  oVaultSessions.for(outcome.parentSessionId, currentRouting().workspaceRoot)?.recordSiblingOutcome(outcome);
125966
126734
  });
125967
- void (0, import_client_core49.loadAgentDefs)(config.workspaceRoot).then((defs) => agentManager.prime(defs));
125968
- const workGraphManager = new import_client_core49.WorkGraphManager({ agents: agentManager, tools: executor });
126735
+ void (0, import_client_core50.loadAgentDefs)(config.workspaceRoot).then((defs) => agentManager.prime(defs));
126736
+ const workGraphManager = new import_client_core50.WorkGraphManager({ agents: agentManager, tools: executor });
125969
126737
  workGraphManager.registerTools(executor);
125970
126738
  const workPlanApproval = new WorkPlanApprovalBridge();
125971
126739
  function rejectPendingWorkPlan() {
@@ -125988,7 +126756,7 @@ async function main() {
125988
126756
  workRunTicker = setInterval(() => {
125989
126757
  const record = liveRunRecord;
125990
126758
  if (!record) return stopWorkRunTicker();
125991
- const view = (0, import_client_core49.buildRunGraphView)(record, agentManager.agentsFor(sessionId), Date.now(), tuiFlowBudget());
126759
+ const view = (0, import_client_core50.buildRunGraphView)(record, agentManager.agentsFor(sessionId), Date.now(), tuiFlowBudget());
125992
126760
  appStore.setState(
125993
126761
  (s) => s.workRun ? { ...s, workRun: { ...s.workRun, view } } : s
125994
126762
  );
@@ -126014,11 +126782,11 @@ async function main() {
126014
126782
  const status = appStore.getState().status;
126015
126783
  if (status !== "idle" && status !== "error") return;
126016
126784
  if (heldAgentReports.length === 0) return;
126017
- sendTurn(import_client_core49.SUBAGENT_WAKE_PROMPT, void 0, void 0, "system");
126785
+ sendTurn(import_client_core50.SUBAGENT_WAKE_PROMPT, void 0, void 0, "system");
126018
126786
  },
126019
126787
  onRunUpdate: (record) => {
126020
126788
  liveRunRecord = record;
126021
- const view = (0, import_client_core49.buildRunGraphView)(record, agentManager.agentsFor(sessionId), Date.now(), tuiFlowBudget());
126789
+ const view = (0, import_client_core50.buildRunGraphView)(record, agentManager.agentsFor(sessionId), Date.now(), tuiFlowBudget());
126022
126790
  if (view.live) {
126023
126791
  startWorkRunTicker();
126024
126792
  appStore.setState((s) => ({
@@ -126062,7 +126830,7 @@ async function main() {
126062
126830
  // execution — never "duet" agents themselves (mirrors the IDE/Power App).
126063
126831
  routing: () => ({ ...currentRouting(), mode: legMode() }),
126064
126832
  clientCapabilities: () => [
126065
- ...(0, import_client_core48.platformCapabilities)(),
126833
+ ...(0, import_client_core49.platformCapabilities)(),
126066
126834
  ...appStore.getState().subagentsEnabled ? ["subagents"] : []
126067
126835
  ],
126068
126836
  transcript: () => transcriptStore.getState().messages,
@@ -126071,7 +126839,7 @@ async function main() {
126071
126839
  const status = appStore.getState().status;
126072
126840
  if (status !== "idle" && status !== "error") return;
126073
126841
  if (heldAgentReports.length === 0) return;
126074
- sendTurn(import_client_core49.SUBAGENT_WAKE_PROMPT, void 0, void 0, "system");
126842
+ sendTurn(import_client_core50.SUBAGENT_WAKE_PROMPT, void 0, void 0, "system");
126075
126843
  },
126076
126844
  onLifecycle: (ev) => onRenderEvent({
126077
126845
  event: "agent_lifecycle",
@@ -126107,7 +126875,7 @@ async function main() {
126107
126875
  timestamp: Date.now(),
126108
126876
  data
126109
126877
  }),
126110
- getOrionResources: () => (0, import_client_core48.buildOrionSnapshot)(config.workspaceRoot, void 0, sid),
126878
+ getOrionResources: () => (0, import_client_core49.buildOrionSnapshot)(config.workspaceRoot, void 0, sid),
126111
126879
  // Full-dose source for review-persona children (lesson dosing) — the same
126112
126880
  // attention payload the parent turn itself ships.
126113
126881
  oVaultAttention: () => {
@@ -126160,7 +126928,7 @@ async function main() {
126160
126928
  // the /turbo-toggle vs --fully-automatic gap: the flag already overrides the
126161
126929
  // store mode at launch (launchPermissionMode); the toggle now buys the same
126162
126930
  // backend posture, so no ask is ever born and batch-mates stop deferring.
126163
- permissionMode: (0, import_client_core49.effectiveWirePermissionMode)(
126931
+ permissionMode: (0, import_client_core50.effectiveWirePermissionMode)(
126164
126932
  bridge.isTurboModeEnabledForSession(sessionId),
126165
126933
  a.permissionMode
126166
126934
  ),
@@ -126186,8 +126954,8 @@ async function main() {
126186
126954
  sandboxAvailable: SANDBOX_AVAILABLE
126187
126955
  };
126188
126956
  };
126189
- const oVaultSessions = new import_client_core48.OVaultSessions(() => process.env.ORION_OVAULT_CAPTURE !== "0");
126190
- oVaultSessions.syncRunner = new import_client_core48.OVaultSyncRunner({
126957
+ const oVaultSessions = new import_client_core49.OVaultSessions(() => process.env.ORION_OVAULT_CAPTURE !== "0");
126958
+ oVaultSessions.syncRunner = new import_client_core49.OVaultSyncRunner({
126191
126959
  auth: {
126192
126960
  apiBaseUrl: () => config.accountsApiUrl,
126193
126961
  accessToken: () => session.currentAccessToken(),
@@ -126252,11 +127020,11 @@ async function main() {
126252
127020
  if (note !== null) transcriptStore.setState((s) => appendNote(s, note));
126253
127021
  }
126254
127022
  const routerText = start2.skill ? "" : start2.text ?? "";
126255
- let duetEntry = import_client_core49.DUET_ENTRY_DEFAULT;
127023
+ let duetEntry = import_client_core50.DUET_ENTRY_DEFAULT;
126256
127024
  let duetRouterVerdict = null;
126257
127025
  if (appStore.getState().mode === "duet") {
126258
127026
  const routed = await duetRouterGate.prepareTurn(
126259
- (0, import_client_core49.duetEntryWireForSegment)(config.workspaceRoot),
127027
+ (0, import_client_core50.duetEntryWireForSegment)(config.workspaceRoot),
126260
127028
  routerText,
126261
127029
  // What the executor gate's prompt is built from: the standing record as it stands
126262
127030
  // BEFORE the advisor runs (the advisor may flag it for this turn; the gate asks the
@@ -126270,7 +127038,7 @@ async function main() {
126270
127038
  transcriptStore.setState((s) => appendNote(s, routerNote));
126271
127039
  }
126272
127040
  const before = appStore.getState().duetPlan;
126273
- const advice = await (0, import_client_core49.adviseDuetRoute)({
127041
+ const advice = await (0, import_client_core50.adviseDuetRoute)({
126274
127042
  text: routerText,
126275
127043
  record: before,
126276
127044
  workspaceRoot: config.workspaceRoot,
@@ -126288,7 +127056,7 @@ async function main() {
126288
127056
  }
126289
127057
  }
126290
127058
  markDuetLegAtTurnStart(routerText, duetEntry, duetRouterVerdict);
126291
- if (lastTurnComplete?.sessionId === sid && Date.now() - lastTurnComplete.at < import_client_core49.REPHRASE_WINDOW_MS) {
127059
+ if (lastTurnComplete?.sessionId === sid && Date.now() - lastTurnComplete.at < import_client_core50.REPHRASE_WINDOW_MS) {
126292
127060
  outcomes.report({ kind: "rephrase" });
126293
127061
  }
126294
127062
  triggerSecurityCapabilitiesRefresh(bridge, appStore);
@@ -126306,7 +127074,7 @@ async function main() {
126306
127074
  };
126307
127075
  try {
126308
127076
  const peerAgents = await presence.registry.peersForWire(sid).catch(() => []);
126309
- const outcome = await (0, import_client_core48.driveTurn)(
127077
+ const outcome = await (0, import_client_core49.driveTurn)(
126310
127078
  turnTransport,
126311
127079
  {
126312
127080
  sessionId: sid,
@@ -126331,19 +127099,19 @@ async function main() {
126331
127099
  // `workgraph` rides the same switch as the fan-out family: a work graph IS a
126332
127100
  // fan-out (its phases are sub-agents), so turning sub-agents off must hide both.
126333
127101
  clientCapabilities: [
126334
- ...(0, import_client_core48.platformCapabilities)(),
127102
+ ...(0, import_client_core49.platformCapabilities)(),
126335
127103
  ...appStore.getState().subagentsEnabled ? ["scheduling", "subagents", "workgraph"] : ["scheduling"],
126336
127104
  // This terminal can RECEIVE a peer message, so it may also address them.
126337
127105
  "agent_messaging",
126338
127106
  // This host owns a standing-plan record and can clear it, so Duet's
126339
127107
  // `request_replan` may be offered (further leg-gated backend-side).
126340
- import_client_core49.DUET_REPLAN_CAPABILITY,
127108
+ import_client_core50.DUET_REPLAN_CAPABILITY,
126341
127109
  // …and runs the planner's `hand_off` (leg marker, phase line, journal), so
126342
127110
  // planner entry may offer it (further leg-gated backend-side).
126343
- import_client_core49.DUET_HANDOFF_CAPABILITY,
127111
+ import_client_core50.DUET_HANDOFF_CAPABILITY,
126344
127112
  // `goal` lights up the goal_report claim tool, and only while a goal is
126345
127113
  // actually driving this conversation — an ordinary chat never sees it.
126346
- ...goalRunner !== null ? [import_client_core49.GOAL_CAPABILITY] : []
127114
+ ...goalRunner !== null ? [import_client_core50.GOAL_CAPABILITY] : []
126347
127115
  ],
126348
127116
  extraBody: {
126349
127117
  ...appStore.getState().subagentsEnabled ? agentManager.parentExtraBody() : {},
@@ -126360,7 +127128,7 @@ async function main() {
126360
127128
  // Ship the `.orion` snapshot so the backend's begin-turn loaders read
126361
127129
  // config / sub-agent defs / skills / hooks / memory / plugins from the
126362
127130
  // body — no live client-read channel in the stateless segment model.
126363
- getOrionResources: () => (0, import_client_core48.buildOrionSnapshot)(currentRouting().workspaceRoot, void 0, sid),
127131
+ getOrionResources: () => (0, import_client_core49.buildOrionSnapshot)(currentRouting().workspaceRoot, void 0, sid),
126364
127132
  getFileHistoryManifest: () => executor.fileHistoryManifest(sid),
126365
127133
  // Lesson-recall anchors: the TUI has no editor attention, so recently-touched
126366
127134
  // paths from the capture observer are the attention set.
@@ -126370,7 +127138,7 @@ async function main() {
126370
127138
  return { active: null, open: [], touched, related: executor.oVaultRelatedPaths?.(touched) ?? [] };
126371
127139
  }
126372
127140
  },
126373
- (0, import_client_core48.withOVault)(
127141
+ (0, import_client_core49.withOVault)(
126374
127142
  {
126375
127143
  ...boundary.makeHandlers(sid, ac.signal, onEvent),
126376
127144
  // Stops the driver from POSTING the next segment when the user cancelled at a
@@ -126382,7 +127150,7 @@ async function main() {
126382
127150
  onToolResult: (payload) => {
126383
127151
  if (payload.terminal_savings) {
126384
127152
  terminalSavings.push(payload.terminal_savings);
126385
- (0, import_client_core48.recordTurnMetrics)({
127153
+ (0, import_client_core49.recordTurnMetrics)({
126386
127154
  app: "tui",
126387
127155
  sessionId: sid,
126388
127156
  workspaceRoot: currentRouting().workspaceRoot,
@@ -126418,15 +127186,15 @@ async function main() {
126418
127186
  const data = outcome.event.data ?? {};
126419
127187
  endSettle = {
126420
127188
  kind: "complete",
126421
- finalText: (0, import_client_core49.finalAssistantTextFromWire)(data.messages),
126422
- evidence: (0, import_client_core49.goalEvidenceFromWire)(data.messages),
126423
- claim: (0, import_client_core49.goalClaimFromWire)(data.messages)
127189
+ finalText: (0, import_client_core50.finalAssistantTextFromWire)(data.messages),
127190
+ evidence: (0, import_client_core50.goalEvidenceFromWire)(data.messages),
127191
+ claim: (0, import_client_core50.goalClaimFromWire)(data.messages)
126424
127192
  };
126425
- (0, import_client_core48.recordTurnMetrics)({
127193
+ (0, import_client_core49.recordTurnMetrics)({
126426
127194
  app: "tui",
126427
127195
  sessionId: sid,
126428
127196
  workspaceRoot: currentRouting().workspaceRoot,
126429
- turn: (0, import_client_core48.turnMetricsFromComplete)(data),
127197
+ turn: (0, import_client_core49.turnMetricsFromComplete)(data),
126430
127198
  terminalSavings
126431
127199
  });
126432
127200
  void oVaultSessions.reflectorFor(sid, currentRouting().workspaceRoot, bridge)?.run("turn_complete").finally(
@@ -126472,14 +127240,14 @@ async function main() {
126472
127240
  if (currentTurn === turn) {
126473
127241
  const st2 = appStore.getState();
126474
127242
  if (st2.mode === "duet") {
126475
- (0, import_client_core49.journalDuetTurnEnd)(
127243
+ (0, import_client_core50.journalDuetTurnEnd)(
126476
127244
  duetAdvisorState,
126477
127245
  { outcome: settleOutcome, executionLeg: st2.duetExecutionStarted },
126478
127246
  { workspaceRoot: config.workspaceRoot }
126479
127247
  );
126480
127248
  }
126481
127249
  if (st2.duetPlan && st2.mode === "duet") {
126482
- const folded = (0, import_client_core49.foldDuetTurnEnd)(st2.duetPlan, st2.duetExecutionStarted, settleOutcome);
127250
+ const folded = (0, import_client_core50.foldDuetTurnEnd)(st2.duetPlan, st2.duetExecutionStarted, settleOutcome);
126483
127251
  appStore.setState((s2) => ({ ...s2, duetPlan: folded }));
126484
127252
  }
126485
127253
  settleSteerQueue({
@@ -126492,7 +127260,7 @@ async function main() {
126492
127260
  pendingDuetReplan = null;
126493
127261
  if (replanReason !== null && settleOutcome === "completed" && appStore.getState().mode === "duet") {
126494
127262
  setTimeout(() => {
126495
- sendTurn((0, import_client_core49.duetReplanFollowupPrompt)(replanReason, { hadPlan: appStore.getState().duetPlan !== null }), void 0, void 0, "system", {
127263
+ sendTurn((0, import_client_core50.duetReplanFollowupPrompt)(replanReason, { hadPlan: appStore.getState().duetPlan !== null }), void 0, void 0, "system", {
126496
127264
  ifBusy: "decline"
126497
127265
  });
126498
127266
  }, 0);
@@ -126585,27 +127353,27 @@ async function main() {
126585
127353
  void runTurn({ skill: { name: name2, args: args2 } }, snapshot);
126586
127354
  };
126587
127355
  cronController.start();
126588
- executor.registerHostTool("schedule_task", (0, import_client_core50.makeScheduleTaskHandler)(() => cronController));
126589
- executor.registerHostTool(import_client_core49.DUET_REPLAN_TOOL, async (params) => {
126590
- const flagged = (0, import_client_core49.invalidateStandingPlan)(appStore.getState().duetPlan);
127356
+ executor.registerHostTool("schedule_task", (0, import_client_core51.makeScheduleTaskHandler)(() => cronController));
127357
+ executor.registerHostTool(import_client_core50.DUET_REPLAN_TOOL, async (params) => {
127358
+ const flagged = (0, import_client_core50.invalidateStandingPlan)(appStore.getState().duetPlan);
126591
127359
  if (flagged) appStore.setState((s) => ({ ...s, duetPlan: flagged }));
126592
127360
  pendingDuetReplan = typeof params.reason === "string" ? params.reason : "";
126593
- return (0, import_client_core49.duetReplanResult)(flagged !== null);
127361
+ return (0, import_client_core50.duetReplanResult)(flagged !== null);
126594
127362
  });
126595
- executor.registerHostTool(import_client_core49.DUET_HANDOFF_TOOL, async (params) => {
127363
+ executor.registerHostTool(import_client_core50.DUET_HANDOFF_TOOL, async (params) => {
126596
127364
  appStore.setState((s) => ({ ...s, duetExecutionStarted: true }));
126597
- (0, import_client_core49.journalDuetPlannerVerdict)(
127365
+ (0, import_client_core50.journalDuetPlannerVerdict)(
126598
127366
  duetAdvisorState,
126599
- { verdict: "hand_off", brief: (0, import_client_core49.duetHandoffBrief)(params) },
127367
+ { verdict: "hand_off", brief: (0, import_client_core50.duetHandoffBrief)(params) },
126600
127368
  { workspaceRoot: config.workspaceRoot }
126601
127369
  );
126602
- return (0, import_client_core49.duetHandoffResult)();
127370
+ return (0, import_client_core50.duetHandoffResult)();
126603
127371
  });
126604
- executor.registerHostTool(import_client_core49.GOAL_REPORT_TOOL, async (params) => (0, import_client_core49.goalReportToolResult)(params));
127372
+ executor.registerHostTool(import_client_core50.GOAL_REPORT_TOOL, async (params) => (0, import_client_core50.goalReportToolResult)(params));
126605
127373
  const loopService = new LoopService({
126606
127374
  workspaceRoot: config.workspaceRoot,
126607
- schedulePath: loopSchedulePathFor((0, import_client_core49.runsRootFor)("loops", config.workspaceRoot)),
126608
- transport: (0, import_client_core49.brainAwareAgentTransport)(bridge, turnTransport),
127375
+ schedulePath: loopSchedulePathFor((0, import_client_core50.runsRootFor)("loops", config.workspaceRoot)),
127376
+ transport: (0, import_client_core50.brainAwareAgentTransport)(bridge, turnTransport),
126609
127377
  tools: executor,
126610
127378
  // The CONFIGURED mode rides here deliberately, not the turbo-effective one
126611
127379
  // (currentRouting applies the turbo→full_access law): a loop is standing
@@ -126641,14 +127409,14 @@ async function main() {
126641
127409
  );
126642
127410
  }
126643
127411
  }).catch(() => void 0);
126644
- let goalRoundLabel = import_client_core49.GOAL_CONTINUE_DISPLAY;
127412
+ let goalRoundLabel = import_client_core50.GOAL_CONTINUE_DISPLAY;
126645
127413
  const runGoalTurn = makeGoalRunTurn({
126646
127414
  send: (prompt, onTurnEnd) => {
126647
127415
  const outcome = sendTurn(prompt, goalRoundLabel, void 0, "system", {
126648
127416
  onTurnEnd,
126649
127417
  ifBusy: "decline"
126650
127418
  });
126651
- if (outcome === "started") goalRoundLabel = import_client_core49.GOAL_CONTINUE_DISPLAY;
127419
+ if (outcome === "started") goalRoundLabel = import_client_core50.GOAL_CONTINUE_DISPLAY;
126652
127420
  return outcome;
126653
127421
  }
126654
127422
  });
@@ -126661,11 +127429,11 @@ async function main() {
126661
127429
  return;
126662
127430
  }
126663
127431
  const goalSessionId = transcriptStore.getState().sessionId;
126664
- const runner = new import_client_core49.GoalRunner({
127432
+ const runner = new import_client_core50.GoalRunner({
126665
127433
  runTurn: runGoalTurn,
126666
127434
  // The goal ends when this says so — never when the agent says so.
126667
127435
  evaluate: async ({ goal: condition, evidence }) => {
126668
- const ruling = await (0, import_client_core49.evaluateGoalCompletion)({
127436
+ const ruling = await (0, import_client_core50.evaluateGoalCompletion)({
126669
127437
  bridge,
126670
127438
  goal: condition,
126671
127439
  evidence,
@@ -126692,18 +127460,18 @@ async function main() {
126692
127460
  // a long goal is a wall of identical continuation lines and a stuck one is
126693
127461
  // indistinguishable from a working one.
126694
127462
  onRound: (round) => {
126695
- const reason = (0, import_client_core49.goalRoundReason)(round);
127463
+ const reason = (0, import_client_core50.goalRoundReason)(round);
126696
127464
  if (reason !== "") {
126697
- transcriptStore.setState((s) => appendGoalNoteFor(s, goalSessionId, (0, import_client_core49.goalNotMetRow)(reason)));
127465
+ transcriptStore.setState((s) => appendGoalNoteFor(s, goalSessionId, (0, import_client_core50.goalNotMetRow)(reason)));
126698
127466
  }
126699
127467
  }
126700
127468
  });
126701
127469
  goalRunner = runner;
126702
- goalRoundLabel = (0, import_client_core49.goalStartDisplay)(goal);
127470
+ goalRoundLabel = (0, import_client_core50.goalStartDisplay)(goal);
126703
127471
  transcriptStore.setState((s) => setGoalActive(s, true));
126704
127472
  void runner.run(goal).then((reason) => {
126705
127473
  if (goalRunner === runner) goalRunner = null;
126706
- transcriptStore.setState((s) => appendGoalEndFor(s, goalSessionId, (0, import_client_core49.goalEndRow)(reason)));
127474
+ transcriptStore.setState((s) => appendGoalEndFor(s, goalSessionId, (0, import_client_core50.goalEndRow)(reason)));
126707
127475
  settleSteerQueue({
126708
127476
  app: appStore,
126709
127477
  isBusy: () => currentTurn !== null || goalRunner !== null,
@@ -126711,7 +127479,7 @@ async function main() {
126711
127479
  runCommand: routeInput
126712
127480
  });
126713
127481
  });
126714
- transcriptStore.setState((s) => appendGoalNoteFor(s, goalSessionId, (0, import_client_core49.goalSetRow)(goal)));
127482
+ transcriptStore.setState((s) => appendGoalNoteFor(s, goalSessionId, (0, import_client_core50.goalSetRow)(goal)));
126715
127483
  };
126716
127484
  const enqueueSteer = (text) => {
126717
127485
  appStore.setState((s) => ({ ...s, queuedMessages: [...s.queuedMessages, queuedSteer(text)] }));
@@ -126744,10 +127512,10 @@ async function main() {
126744
127512
  steer: (text) => enqueueMachineSteer(text),
126745
127513
  deliverAgentMessage: (message) => {
126746
127514
  inboundPeerHop = Math.max(inboundPeerHop ?? 0, message.hop);
126747
- heldAgentReports.push((0, import_client_core49.formatAgentMessage)(message));
127515
+ heldAgentReports.push((0, import_client_core50.formatAgentMessage)(message));
126748
127516
  const status = appStore.getState().status;
126749
127517
  if (status !== "idle" && status !== "error") return;
126750
- sendTurn((0, import_client_core49.peerMessageWakePrompt)(message), void 0, void 0, "system");
127518
+ sendTurn((0, import_client_core50.peerMessageWakePrompt)(message), void 0, void 0, "system");
126751
127519
  },
126752
127520
  resolvePermission: (requestId, decision, sid) => {
126753
127521
  const pending = appStore.getState().pendingPermissions.some((p) => p.data.request_id === requestId);
@@ -126903,14 +127671,14 @@ async function main() {
126903
127671
  // the live re-install, so the panel stays a dumb view; the status shown is the
126904
127672
  // transport's own record (a background refresh of the system store updates it).
126905
127673
  openNetwork: () => {
126906
- void (0, import_client_core49.readNetworkSettings)().then((settings) => {
127674
+ void (0, import_client_core50.readNetworkSettings)().then((settings) => {
126907
127675
  appStore.setState((s) => ({
126908
127676
  ...s,
126909
127677
  activePanel: {
126910
127678
  kind: "network",
126911
127679
  deps: {
126912
127680
  settings,
126913
- status: (0, import_client_core49.currentNetworkStatus)(),
127681
+ status: (0, import_client_core50.currentNetworkStatus)(),
126914
127682
  save: (next) => applyNetworkSettings(next, netLog, {
126915
127683
  routeUrls: [config.apiUrl, config.accountsApiUrl, config.accountsUrl],
126916
127684
  secrets,
@@ -126932,25 +127700,26 @@ async function main() {
126932
127700
  defaultApiUrl: config.apiUrl,
126933
127701
  entries,
126934
127702
  add: async (entry) => {
126935
- await (0, import_client_core49.saveCustomProvider)(entry, "user", opts);
126936
- (0, import_client_core49.clearEndpointCatalog)(entry.baseUrl);
126937
- panel(await (0, import_client_core49.loadCustomProviders)(opts));
127703
+ await (0, import_client_core50.saveCustomProvider)(entry, "user", opts);
127704
+ (0, import_client_core50.clearEndpointCatalog)(entry.baseUrl);
127705
+ panel(await (0, import_client_core50.loadCustomProviders)(opts));
126938
127706
  },
126939
127707
  remove: async (name2) => {
126940
127708
  for (const tier of ["user", "project", "local"]) {
126941
- if (await (0, import_client_core49.removeCustomProvider)(name2, tier, opts)) break;
127709
+ if (await (0, import_client_core50.removeCustomProvider)(name2, tier, opts)) break;
126942
127710
  }
126943
127711
  (0, import_client_core9.clearEndpointRouting)();
126944
- (0, import_client_core49.clearEndpointCatalog)();
126945
- panel(await (0, import_client_core49.loadCustomProviders)(opts));
127712
+ (0, import_client_core50.clearEndpointCatalog)();
127713
+ panel(await (0, import_client_core50.loadCustomProviders)(opts));
126946
127714
  },
126947
- probe: (baseUrl, apiKey) => (0, import_client_core49.probeModels)(baseUrl, apiKey),
127715
+ probe: (baseUrl, apiKey) => (0, import_client_core9.discoverEndpointModels)(baseUrl, apiKey),
127716
+ verify: (input) => (0, import_client_core9.verifyEndpointChat)(input),
126948
127717
  // A saved endpoint's models come from the CACHED catalog — opening one costs no
126949
127718
  // network, so limits stay editable long after the endpoint was added.
126950
127719
  modelsOf: (entry) => (0, import_client_core9.endpointModelViews)(entry),
126951
127720
  updateModels: async (name2, update) => {
126952
127721
  await (0, import_client_core9.updateCustomProviderModels)(name2, update, "user", opts);
126953
- panel(await (0, import_client_core49.loadCustomProviders)(opts));
127722
+ panel(await (0, import_client_core50.loadCustomProviders)(opts));
126954
127723
  },
126955
127724
  use: async (name2, model) => {
126956
127725
  const provider = `custom:${name2}`;
@@ -126968,7 +127737,7 @@ async function main() {
126968
127737
  }
126969
127738
  }
126970
127739
  }));
126971
- void (0, import_client_core49.loadCustomProviders)(opts).then(panel);
127740
+ void (0, import_client_core50.loadCustomProviders)(opts).then(panel);
126972
127741
  }
126973
127742
  };
126974
127743
  const routeInput = (text) => routeChatInput(text, {
@@ -126977,7 +127746,7 @@ async function main() {
126977
127746
  addMemory: (note) => void addMemoryLine(note),
126978
127747
  resolveCommand: async (line) => {
126979
127748
  let parsed = registry.parse(line);
126980
- if (!parsed && (0, import_client_core49.matchSlashToken)(line)) {
127749
+ if (!parsed && (0, import_client_core50.matchSlashToken)(line)) {
126981
127750
  await skillSlash.refresh().catch(() => void 0);
126982
127751
  parsed = registry.parse(line);
126983
127752
  }