ur-agent 1.84.2 → 1.84.4

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/dist/cli.js CHANGED
@@ -60375,7 +60375,7 @@ async function fetchWithProviderReliability(input2, init, options) {
60375
60375
  const body = await response.text().catch(() => "");
60376
60376
  throw new ProviderHTTPError(options.failureMessage(response, body), {
60377
60377
  status: response.status,
60378
- body,
60378
+ body: options.failureBody ? options.failureBody(response, body) : body,
60379
60379
  headers: response.headers
60380
60380
  });
60381
60381
  }
@@ -60787,6 +60787,7 @@ __export(exports_providerRegistry, {
60787
60787
  resolveProviderId: () => resolveProviderId,
60788
60788
  providerForAuthAlias: () => providerForAuthAlias,
60789
60789
  providerAliasesFor: () => providerAliasesFor,
60790
+ markProviderModelUnavailable: () => markProviderModelUnavailable,
60790
60791
  listProviders: () => listProviders,
60791
60792
  listModelsForProviderWithSource: () => listModelsForProviderWithSource,
60792
60793
  listModelsForProvider: () => listModelsForProvider,
@@ -60891,7 +60892,10 @@ function getActiveProviderSettings(settings = getInitialSettings()) {
60891
60892
  baseUrl: getScopedProviderBaseUrl(active, effectiveSettings),
60892
60893
  baseUrls: configured.baseUrls,
60893
60894
  commandPath: configured.commandPath,
60894
- fallback
60895
+ fallback,
60896
+ openaiTransport: configured.openaiTransport,
60897
+ responses: configured.responses,
60898
+ openrouter: configured.openrouter
60895
60899
  };
60896
60900
  }
60897
60901
  function getProviderRuntimeInfo(settings = getInitialSettings()) {
@@ -61155,6 +61159,65 @@ function setSafeProviderConfig(key, value, options = {}) {
61155
61159
  return { ok: false, message: "responses.tool_search must be off or hosted." };
61156
61160
  }
61157
61161
  settings = { provider: { responses: { toolSearch: trimmed } } };
61162
+ } else if (key === "openrouter.routing") {
61163
+ if (!["auto", "throughput", "latency", "price"].includes(trimmed)) {
61164
+ return {
61165
+ ok: false,
61166
+ message: "openrouter.routing must be auto, throughput, latency, or price."
61167
+ };
61168
+ }
61169
+ settings = {
61170
+ provider: { openrouter: { routing: trimmed } }
61171
+ };
61172
+ } else if (key === "openrouter.allow_fallbacks" || key === "openrouter.require_parameters") {
61173
+ if (trimmed !== "true" && trimmed !== "false" && trimmed !== "auto") {
61174
+ return { ok: false, message: `${key} must be true, false, or auto.` };
61175
+ }
61176
+ const field = key === "openrouter.allow_fallbacks" ? "allowFallbacks" : "requireParameters";
61177
+ settings = {
61178
+ provider: {
61179
+ openrouter: {
61180
+ [field]: trimmed === "auto" ? undefined : trimmed === "true"
61181
+ }
61182
+ }
61183
+ };
61184
+ } else if (key === "openrouter.preferred_min_throughput" || key === "openrouter.preferred_max_latency") {
61185
+ const parsed = trimmed === "auto" ? undefined : Number(trimmed);
61186
+ if (parsed !== undefined && (!Number.isFinite(parsed) || parsed <= 0)) {
61187
+ return { ok: false, message: `${key} must be a positive number or auto.` };
61188
+ }
61189
+ const field = key === "openrouter.preferred_min_throughput" ? "preferredMinThroughput" : "preferredMaxLatency";
61190
+ settings = {
61191
+ provider: { openrouter: { [field]: parsed } }
61192
+ };
61193
+ } else if (key === "openrouter.service_tier") {
61194
+ if (!["auto", "default", "flex", "priority", "fast"].includes(trimmed)) {
61195
+ return {
61196
+ ok: false,
61197
+ message: "openrouter.service_tier must be auto, default, flex, priority, or fast."
61198
+ };
61199
+ }
61200
+ settings = {
61201
+ provider: {
61202
+ openrouter: {
61203
+ serviceTier: trimmed
61204
+ }
61205
+ }
61206
+ };
61207
+ } else if (key === "openrouter.speed") {
61208
+ if (trimmed !== "standard" && trimmed !== "fast") {
61209
+ return {
61210
+ ok: false,
61211
+ message: "openrouter.speed must be standard or fast."
61212
+ };
61213
+ }
61214
+ settings = {
61215
+ provider: {
61216
+ openrouter: {
61217
+ speed: trimmed
61218
+ }
61219
+ }
61220
+ };
61158
61221
  } else if (key === "model") {
61159
61222
  const currentSettings = getInitialSettings();
61160
61223
  const currentProvider = getActiveProviderSettings(currentSettings).active ?? "ollama";
@@ -61299,6 +61362,85 @@ function openAiCompatibleModelUrls(baseUrl) {
61299
61362
  url3.pathname = `${rootPath}/models`;
61300
61363
  return [versioned, url3.toString().replace(/\/$/, "")];
61301
61364
  }
61365
+ function isNvidiaHostedApi(baseUrl) {
61366
+ try {
61367
+ return new URL(normalizeBaseUrl(baseUrl)).hostname.toLowerCase() === NVIDIA_HOSTED_API_HOST;
61368
+ } catch {
61369
+ return false;
61370
+ }
61371
+ }
61372
+ function normalizeNvidiaIdentifier(value) {
61373
+ return value.toLowerCase().replace(/[^a-z0-9]+/gu, "");
61374
+ }
61375
+ function isNvidiaAgentModelCandidate(modelId) {
61376
+ return !/(?:^|[/_.-])(?:calibration|deplot|detector|embed(?:ding|qa)?|guard|nemoguard|nemoretriever|nvclip|ocr|parse|rerank|retriever|reward|safety|translate)(?:$|[/_.-])/iu.test(modelId);
61377
+ }
61378
+ function parseNvidiaActiveFunctionInventory(value) {
61379
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
61380
+ throw new Error("NVIDIA account function inventory returned an invalid response.");
61381
+ }
61382
+ const functions = value.functions;
61383
+ if (!Array.isArray(functions)) {
61384
+ throw new Error("NVIDIA account function inventory omitted its functions list.");
61385
+ }
61386
+ const active = functions.filter((entry) => {
61387
+ if (!entry || typeof entry !== "object" || Array.isArray(entry))
61388
+ return false;
61389
+ return String(entry.status ?? "").toUpperCase() === "ACTIVE";
61390
+ });
61391
+ const descriptors2 = active.flatMap((entry) => {
61392
+ const record2 = entry;
61393
+ const values = [
61394
+ ...typeof record2.name === "string" ? [record2.name] : [],
61395
+ ...Array.isArray(record2.tags) ? record2.tags.filter((tag) => typeof tag === "string") : typeof record2.tags === "string" ? [record2.tags] : []
61396
+ ];
61397
+ return values.map(normalizeNvidiaIdentifier).filter(Boolean);
61398
+ });
61399
+ return {
61400
+ activeFunctionCount: active.length,
61401
+ descriptors: [...new Set(descriptors2)]
61402
+ };
61403
+ }
61404
+ async function fetchNvidiaActiveFunctionInventory(fetchImpl, apiKey, signal) {
61405
+ let response;
61406
+ try {
61407
+ response = await fetchImpl(NVIDIA_FUNCTIONS_URL, {
61408
+ method: "GET",
61409
+ signal,
61410
+ headers: { Authorization: `Bearer ${apiKey}` }
61411
+ });
61412
+ } catch (error61) {
61413
+ throw new Error(`NVIDIA account function inventory is unreachable: ${error61 instanceof Error ? error61.message : String(error61)}`);
61414
+ }
61415
+ if (!response.ok) {
61416
+ throw new Error(`NVIDIA account function inventory returned HTTP ${response.status}.`);
61417
+ }
61418
+ let body;
61419
+ try {
61420
+ body = await response.json();
61421
+ } catch {
61422
+ throw new Error("NVIDIA account function inventory returned malformed JSON.");
61423
+ }
61424
+ return parseNvidiaActiveFunctionInventory(body);
61425
+ }
61426
+ function filterNvidiaHostedModels(models, inventory) {
61427
+ if (inventory.activeFunctionCount === 0 || inventory.descriptors.length === 0) {
61428
+ return [];
61429
+ }
61430
+ return models.flatMap((model) => {
61431
+ if (!isNvidiaAgentModelCandidate(model.id))
61432
+ return [];
61433
+ const basename4 = model.id.split("/").at(-1) ?? model.id;
61434
+ const normalizedModel = normalizeNvidiaIdentifier(basename4);
61435
+ if (!normalizedModel || !inventory.descriptors.some((descriptor) => descriptor.includes(normalizedModel))) {
61436
+ return [];
61437
+ }
61438
+ return [{
61439
+ ...model,
61440
+ description: `${model.description} \xB7 active for connected NVIDIA account`
61441
+ }];
61442
+ });
61443
+ }
61302
61444
  async function checkEndpoint(definition, settings, adapters, result) {
61303
61445
  if (!definition.endpointKind)
61304
61446
  return;
@@ -61331,7 +61473,7 @@ async function checkEndpoint(definition, settings, adapters, result) {
61331
61473
  const fetchImpl = adapters.fetch ?? fetch;
61332
61474
  let reachableUrl;
61333
61475
  let modelsUrl;
61334
- let modelsBody = "";
61476
+ let detectedModels = [];
61335
61477
  let lastStatus;
61336
61478
  let lastError;
61337
61479
  for (const candidate of candidates) {
@@ -61357,7 +61499,7 @@ async function checkEndpoint(definition, settings, adapters, result) {
61357
61499
  const names = definition.endpointKind === "ollama" ? parseOllamaModelNamesFromTags(parsed) : parseOpenAICompatibleModelNames(parsed);
61358
61500
  if (names.length > 0) {
61359
61501
  modelsUrl = candidate;
61360
- modelsBody = body;
61502
+ detectedModels = modelDefinitionsFromNames(definition.id, names, "live");
61361
61503
  break;
61362
61504
  }
61363
61505
  }
@@ -61393,14 +61535,46 @@ async function checkEndpoint(definition, settings, adapters, result) {
61393
61535
  message: `${reachableUrl} is reachable but returned no models. Load a model in the server, or check that base_url includes the API path (e.g. /v1).`
61394
61536
  });
61395
61537
  }
61538
+ const verifiesNvidiaAccountFunctions = definition.id === "nvidia-nim" && isNvidiaHostedApi(baseUrl);
61539
+ if (verifiesNvidiaAccountFunctions && modelsUrl && apiKey) {
61540
+ try {
61541
+ const inventory = await fetchNvidiaActiveFunctionInventory(fetchImpl, apiKey, AbortSignal.timeout(1e4));
61542
+ detectedModels = filterNvidiaHostedModels(detectedModels, inventory);
61543
+ if (detectedModels.length === 0) {
61544
+ result.checks.push({
61545
+ name: "account_models",
61546
+ status: "fail",
61547
+ message: "NVIDIA returned no active chat models for this account."
61548
+ });
61549
+ addFailure(result, "NVIDIA account has no active chat models", "Confirm the key at build.nvidia.com, then reconnect with: ur connect nvidia-nim");
61550
+ } else {
61551
+ result.checks.push({
61552
+ name: "account_models",
61553
+ status: "pass",
61554
+ message: `${detectedModels.length} account-active NVIDIA chat models are selectable.`
61555
+ });
61556
+ }
61557
+ } catch (error61) {
61558
+ result.checks.push({
61559
+ name: "account_models",
61560
+ status: "fail",
61561
+ message: error61 instanceof Error ? error61.message : String(error61)
61562
+ });
61563
+ addFailure(result, "NVIDIA account model inventory unavailable", "Reconnect the build.nvidia.com key with: ur connect nvidia-nim");
61564
+ }
61565
+ }
61396
61566
  if (settings.model) {
61397
- if (modelsBody && !modelsBody.includes(settings.model)) {
61567
+ const modelDetected = detectedModels.some((model) => model.id === settings.model);
61568
+ if (modelsUrl && !modelDetected) {
61398
61569
  result.checks.push({
61399
61570
  name: "model",
61400
- status: "warn",
61401
- message: `Model "${settings.model}" was not found in the detectable model list.`
61571
+ status: verifiesNvidiaAccountFunctions ? "fail" : "warn",
61572
+ message: verifiesNvidiaAccountFunctions ? `Model "${settings.model}" is not an account-active NVIDIA chat model.` : `Model "${settings.model}" was not found in the detectable model list.`
61402
61573
  });
61403
- } else if (modelsBody) {
61574
+ if (verifiesNvidiaAccountFunctions) {
61575
+ addFailure(result, "selected NVIDIA NIM model is inactive", "Run /model, choose NVIDIA NIM, and select an account-active model.");
61576
+ }
61577
+ } else if (modelsUrl) {
61404
61578
  result.checks.push({
61405
61579
  name: "model",
61406
61580
  status: "pass",
@@ -61909,6 +62083,7 @@ Ready: ${result.ok ? "yes" : "no"}${failure}${fix}`;
61909
62083
  function clearProviderModelCacheForTests() {
61910
62084
  cachedModelsByProvider.clear();
61911
62085
  cachedModelsWrittenAt.clear();
62086
+ unavailableModelsByEndpoint.clear();
61912
62087
  modelDiscoveryCoalescer.clear();
61913
62088
  }
61914
62089
  function clearProviderModelCache(providerId) {
@@ -61924,14 +62099,42 @@ function clearProviderModelCache(providerId) {
61924
62099
  cachedModelsWrittenAt.delete(key);
61925
62100
  }
61926
62101
  }
62102
+ for (const key of unavailableModelsByEndpoint.keys()) {
62103
+ if (key === provider || key.startsWith(prefix)) {
62104
+ unavailableModelsByEndpoint.delete(key);
62105
+ }
62106
+ }
61927
62107
  }
61928
62108
  function inFlightModelDiscoveryCount() {
61929
62109
  return modelDiscoveryCoalescer.size;
61930
62110
  }
62111
+ function withoutRuntimeUnavailableModels(key, models) {
62112
+ const unavailable = unavailableModelsByEndpoint.get(key);
62113
+ if (!unavailable?.size)
62114
+ return models;
62115
+ return models.filter((model) => !unavailable.has(model.id.toLowerCase()));
62116
+ }
61931
62117
  function rememberModels(key, models) {
61932
- cachedModelsByProvider.set(key, models);
62118
+ cachedModelsByProvider.set(key, withoutRuntimeUnavailableModels(key, models));
61933
62119
  cachedModelsWrittenAt.set(key, Date.now());
61934
62120
  }
62121
+ function markProviderModelUnavailable(providerId, modelId, baseUrl) {
62122
+ const provider = resolveProviderId(providerId);
62123
+ const normalizedModel = modelId.trim().toLowerCase();
62124
+ if (!provider || !normalizedModel)
62125
+ return;
62126
+ const keys2 = baseUrl ? [providerEndpointCacheKey(provider, baseUrl)] : [...cachedModelsByProvider.keys()].filter((key) => key === provider || key.startsWith(`${provider}@`));
62127
+ for (const key of keys2) {
62128
+ const unavailable = unavailableModelsByEndpoint.get(key) ?? new Set;
62129
+ unavailable.add(normalizedModel);
62130
+ unavailableModelsByEndpoint.set(key, unavailable);
62131
+ const cached2 = cachedModelsByProvider.get(key);
62132
+ if (cached2) {
62133
+ cachedModelsByProvider.set(key, cached2.filter((model) => model.id.toLowerCase() !== normalizedModel));
62134
+ }
62135
+ modelDiscoveryCoalescer.cancel(key);
62136
+ }
62137
+ }
61935
62138
  function cachedModelsAgeMs(key) {
61936
62139
  const writtenAt = cachedModelsWrittenAt.get(key);
61937
62140
  return writtenAt === undefined ? undefined : Date.now() - writtenAt;
@@ -62045,6 +62248,9 @@ function providerModelCacheKey(provider, settings = getInitialSettings()) {
62045
62248
  }
62046
62249
  if (!endpoint)
62047
62250
  return provider;
62251
+ return providerEndpointCacheKey(provider, endpoint);
62252
+ }
62253
+ function providerEndpointCacheKey(provider, endpoint) {
62048
62254
  try {
62049
62255
  const url3 = new URL(normalizeBaseUrl(endpoint));
62050
62256
  url3.hash = "";
@@ -62061,11 +62267,15 @@ function providerModelCacheKey(provider, settings = getInitialSettings()) {
62061
62267
  function getCachedProviderModels(provider, settings = getInitialSettings()) {
62062
62268
  return cachedModelsByProvider.get(providerModelCacheKey(provider, settings)) ?? [];
62063
62269
  }
62270
+ function providerCapabilityModelId(provider, model) {
62271
+ const normalized = model.trim().toLowerCase();
62272
+ return provider === "openrouter" ? normalized.replace(/:(?:nitro|floor|exacto)$/u, "") : normalized;
62273
+ }
62064
62274
  function getProviderContextLengthForModel(model, provider = getInitialSettings().provider?.active ?? DEFAULT_PROVIDER_ID, settings = getInitialSettings()) {
62065
62275
  const providerId = resolveProviderId(provider);
62066
62276
  if (!providerId)
62067
62277
  return;
62068
- const wanted = model.trim().toLowerCase();
62278
+ const wanted = providerCapabilityModelId(providerId, model);
62069
62279
  if (!wanted)
62070
62280
  return;
62071
62281
  const known = [
@@ -62080,7 +62290,7 @@ function getProviderOutputTokenLimitForModel(model, provider = getRuntimeProvide
62080
62290
  const providerId = resolveProviderId(provider);
62081
62291
  if (!providerId)
62082
62292
  return;
62083
- const wanted = model.trim().toLowerCase();
62293
+ const wanted = providerCapabilityModelId(providerId, model);
62084
62294
  if (!wanted)
62085
62295
  return;
62086
62296
  const known = [
@@ -62095,7 +62305,7 @@ function getProviderReasoningCapabilitiesForModel(model, provider = getRuntimePr
62095
62305
  const providerId = resolveProviderId(provider);
62096
62306
  if (!providerId)
62097
62307
  return;
62098
- const wanted = model.trim().toLowerCase();
62308
+ const wanted = providerCapabilityModelId(providerId, model);
62099
62309
  if (!wanted)
62100
62310
  return;
62101
62311
  const known = [
@@ -62386,7 +62596,15 @@ async function discoverLiveModelsForProvider(provider, options = {}) {
62386
62596
  const body = await response.json().catch(() => null);
62387
62597
  const discovered = parseDiscoveredModels(body, getProviderDefinition(provider).displayName);
62388
62598
  if (discovered.length > 0) {
62389
- return modelDefinitionsFromDiscovered(discovered, provider);
62599
+ const models = modelDefinitionsFromDiscovered(discovered, provider);
62600
+ if (provider === "nvidia-nim" && isNvidiaHostedApi(baseUrl)) {
62601
+ if (!apiKey) {
62602
+ throw new Error("NVIDIA hosted model discovery requires an API key.");
62603
+ }
62604
+ const inventory = await fetchNvidiaActiveFunctionInventory(fetchImpl, apiKey, options.signal);
62605
+ return filterNvidiaHostedModels(models, inventory);
62606
+ }
62607
+ return models;
62390
62608
  }
62391
62609
  }
62392
62610
  if (!reachedOk && lastError) {
@@ -62547,11 +62765,12 @@ async function listModelsForProviderWithSource(providerId, options = {}) {
62547
62765
  ...options,
62548
62766
  signal: boundedSignal
62549
62767
  })), options.signal);
62550
- if (liveModels.length > 0) {
62551
- rememberModels(cacheKey, liveModels);
62768
+ const selectableLiveModels = withoutRuntimeUnavailableModels(cacheKey, liveModels);
62769
+ if (selectableLiveModels.length > 0) {
62770
+ rememberModels(cacheKey, selectableLiveModels);
62552
62771
  return {
62553
62772
  provider,
62554
- models: liveModels,
62773
+ models: selectableLiveModels,
62555
62774
  source: "live"
62556
62775
  };
62557
62776
  }
@@ -62701,11 +62920,12 @@ function validateProviderModelPair(providerId, modelId, options = {}) {
62701
62920
  const staticModelIds = staticDefinitions.filter(isAgentCapable).map((model) => model.id);
62702
62921
  const hasDynamicModels = models.some((model) => model.isDynamic) || getProviderDefinition(provider).modelDiscoveryType === "live";
62703
62922
  const validModelIds = suppliedModels.length > 0 ? suppliedModels : hasDynamicModels ? cachedModels.length > 0 ? cachedModels : staticModelIds : Array.from(new Set([...staticModelIds, ...cachedModels]));
62923
+ const comparableModelId = providerCapabilityModelId(provider, modelId);
62704
62924
  const selectedDefinition = [
62705
62925
  ...cachedDefinitions,
62706
62926
  ...suppliedDefinitions,
62707
62927
  ...staticDefinitions
62708
- ].find((model) => model.id === modelId);
62928
+ ].find((model) => model.id.toLowerCase() === comparableModelId);
62709
62929
  if (selectedDefinition?.supportedParameters !== undefined && !selectedDefinition.supportedParameters.includes("tools")) {
62710
62930
  const defaultModel2 = getDefaultModelForProvider(provider);
62711
62931
  return {
@@ -62715,7 +62935,7 @@ function validateProviderModelPair(providerId, modelId, options = {}) {
62715
62935
  suggestedModel: defaultModel2
62716
62936
  };
62717
62937
  }
62718
- if (validModelIds.includes(modelId)) {
62938
+ if (validModelIds.some((validModelId) => validModelId.toLowerCase() === comparableModelId)) {
62719
62939
  return { valid: true };
62720
62940
  }
62721
62941
  const noAuthoritativeList = cachedModels.length === 0 && suppliedModels.length === 0;
@@ -62778,7 +62998,7 @@ function setProviderModel(providerId, modelId, options = {}) {
62778
62998
  modelSource: options.modelSource ?? "static"
62779
62999
  };
62780
63000
  }
62781
- var PROVIDER_IDS, DEFAULT_PROVIDER_ID = "ollama", UR_NATIVE_PROVIDER_BOUNDARY = "UR-native runtime: UR owns provider request shaping, native tool-call parsing, native streaming, and UR-run tool permission/sandbox/verifier flow.", SUBSCRIPTION_CLI_PROVIDER_BOUNDARY = "External vendor CLI boundary: UR passes prompt text to the official CLI and receives final text output. UR-native tool calling, UR Bash/File tool execution, UR-native streaming, local command permissions, sandbox guarantees, and verifier/done-gate checks apply to UR-run tools/final UR output, not to actions the external CLI performs internally.", UNCONFIGURED_SUBSCRIPTION_PROVIDER_BOUNDARY = "Unconfigured subscription placeholder: no runtime is attached. Choose a specific subscription CLI, API, local, or server provider.", UR_NATIVE_CAPABILITIES, SUBSCRIPTION_CLI_CAPABILITIES, SUBSCRIPTION_PLACEHOLDER_CAPABILITIES, PROVIDERS, PROVIDER_ALIAS_ENTRIES, PROVIDER_ALIASES, PROVIDER_FAMILIES, EFFORT_LOW_MEDIUM_HIGH, EFFORT_LOW_MEDIUM_HIGH_XHIGH, EFFORT_LOW_MEDIUM_HIGH_MAX, EFFORT_LOW_MEDIUM_HIGH_XHIGH_MAX, OPENAI_GPT_56_EFFORTS, GEMINI_MINIMAL_TO_HIGH, NVIDIA_NONE_LOW_HIGH, NVIDIA_NONE_HIGH_MAX, NVIDIA_FULL_EFFORT_RANGE, PROVIDER_MODELS, cachedModelsByProvider, cachedModelsWrittenAt, modelDiscoveryCoalescer, MODEL_DISCOVERY_TIMEOUT_MS = 15000, validateProviderModelCompatibility;
63001
+ var PROVIDER_IDS, DEFAULT_PROVIDER_ID = "ollama", UR_NATIVE_PROVIDER_BOUNDARY = "UR-native runtime: UR owns provider request shaping, native tool-call parsing, native streaming, and UR-run tool permission/sandbox/verifier flow.", SUBSCRIPTION_CLI_PROVIDER_BOUNDARY = "External vendor CLI boundary: UR passes prompt text to the official CLI and receives final text output. UR-native tool calling, UR Bash/File tool execution, UR-native streaming, local command permissions, sandbox guarantees, and verifier/done-gate checks apply to UR-run tools/final UR output, not to actions the external CLI performs internally.", UNCONFIGURED_SUBSCRIPTION_PROVIDER_BOUNDARY = "Unconfigured subscription placeholder: no runtime is attached. Choose a specific subscription CLI, API, local, or server provider.", UR_NATIVE_CAPABILITIES, SUBSCRIPTION_CLI_CAPABILITIES, SUBSCRIPTION_PLACEHOLDER_CAPABILITIES, PROVIDERS, PROVIDER_ALIAS_ENTRIES, PROVIDER_ALIASES, PROVIDER_FAMILIES, NVIDIA_HOSTED_API_HOST = "integrate.api.nvidia.com", NVIDIA_FUNCTIONS_URL = "https://api.nvcf.nvidia.com/v2/nvcf/functions?visibility=authorized&visibility=public", EFFORT_LOW_MEDIUM_HIGH, EFFORT_LOW_MEDIUM_HIGH_XHIGH, EFFORT_LOW_MEDIUM_HIGH_MAX, EFFORT_LOW_MEDIUM_HIGH_XHIGH_MAX, OPENAI_GPT_56_EFFORTS, GEMINI_MINIMAL_TO_HIGH, NVIDIA_NONE_LOW_HIGH, NVIDIA_NONE_HIGH_MAX, NVIDIA_FULL_EFFORT_RANGE, PROVIDER_MODELS, cachedModelsByProvider, cachedModelsWrittenAt, unavailableModelsByEndpoint, modelDiscoveryCoalescer, MODEL_DISCOVERY_TIMEOUT_MS = 15000, validateProviderModelCompatibility;
62782
63002
  var init_providerRegistry = __esm(() => {
62783
63003
  init_execFileNoThrow();
62784
63004
  init_ollamaConfig();
@@ -63370,6 +63590,7 @@ var init_providerRegistry = __esm(() => {
63370
63590
  };
63371
63591
  cachedModelsByProvider = new Map;
63372
63592
  cachedModelsWrittenAt = new Map;
63593
+ unavailableModelsByEndpoint = new Map;
63373
63594
  modelDiscoveryCoalescer = new RequestCoalescer;
63374
63595
  validateProviderModelCompatibility = validateProviderModelPair;
63375
63596
  });
@@ -231133,7 +231354,7 @@ var init_metadata = __esm(() => {
231133
231354
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
231134
231355
  WHITESPACE_REGEX2 = /\s+/;
231135
231356
  getVersionBase = memoize_default(() => {
231136
- const match = "1.84.2".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
231357
+ const match = "1.84.4".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
231137
231358
  return match ? match[0] : undefined;
231138
231359
  });
231139
231360
  buildEnvContext = memoize_default(async () => {
@@ -231173,7 +231394,7 @@ var init_metadata = __esm(() => {
231173
231394
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
231174
231395
  isURCodeAction: isEnvTruthy(process.env.UR_CODE_ACTION),
231175
231396
  isURAiAuth: isURAISubscriber(),
231176
- version: "1.84.2",
231397
+ version: "1.84.4",
231177
231398
  versionBase: getVersionBase(),
231178
231399
  buildTime: "",
231179
231400
  deploymentEnvironment: env2.detectDeploymentEnvironment(),
@@ -238612,7 +238833,7 @@ function getAttributionHeader(fingerprint) {
238612
238833
  if (!isAttributionHeaderEnabled()) {
238613
238834
  return "";
238614
238835
  }
238615
- const version2 = `${"1.84.2"}.${fingerprint}`;
238836
+ const version2 = `${"1.84.4"}.${fingerprint}`;
238616
238837
  const entrypoint = process.env.UR_CODE_ENTRYPOINT ?? "unknown";
238617
238838
  const cch = "";
238618
238839
  const workload = getWorkload();
@@ -261816,6 +262037,16 @@ async function createOpenAICompatibleClient(options2) {
261816
262037
  const endpoint = normalizeOpenAICompatibleBaseUrl(options2.baseUrl);
261817
262038
  const maxRetries = options2.maxRetries;
261818
262039
  const providerId = options2.providerId ?? "openai-compatible";
262040
+ const isUnavailableNvidiaFunction = (response, body) => providerId === "nvidia-nim" && response.status === 404 && /function\s+['"][^'"]+['"]\s*:\s*not found for account\s+['"][^'"]+['"]/iu.test(body);
262041
+ const failureMessage = (response, body, streaming, model) => {
262042
+ if (isUnavailableNvidiaFunction(response, body)) {
262043
+ const modelId = typeof model === "string" && model.trim() ? model.trim() : "selected model";
262044
+ markProviderModelUnavailable(providerId, modelId, options2.baseUrl);
262045
+ return `NVIDIA NIM model "${modelId}" is not active for this account. UR removed it from this session's catalog; run /model and choose an account-active NVIDIA model.`;
262046
+ }
262047
+ return `OpenAI-compatible${streaming ? " streaming" : ""} request failed for ${endpoint} (${response.status}): ${body || response.statusText}`;
262048
+ };
262049
+ const failureBody = (response, body) => isUnavailableNvidiaFunction(response, body) ? undefined : body;
261819
262050
  async function doRequest(params, requestOptions) {
261820
262051
  const response = await fetchWithProviderReliability(endpoint, {
261821
262052
  method: "POST",
@@ -261830,7 +262061,8 @@ async function createOpenAICompatibleClient(options2) {
261830
262061
  maxRetries,
261831
262062
  timeoutMs: requestOptions?.timeoutMs,
261832
262063
  signal: requestOptions?.signal,
261833
- failureMessage: (response2, body) => `OpenAI-compatible request failed for ${endpoint} (${response2.status}): ${body || response2.statusText}`
262064
+ failureMessage: (response2, body) => failureMessage(response2, body, false, params.model),
262065
+ failureBody
261834
262066
  });
261835
262067
  const data = await response.json();
261836
262068
  return {
@@ -261855,7 +262087,8 @@ async function createOpenAICompatibleClient(options2) {
261855
262087
  timeoutMs: requestOptions?.timeoutMs,
261856
262088
  signal,
261857
262089
  streaming: true,
261858
- failureMessage: (response2, body) => `OpenAI-compatible streaming request failed for ${endpoint} (${response2.status}): ${body || response2.statusText}`
262090
+ failureMessage: (response2, body) => failureMessage(response2, body, true, params.model),
262091
+ failureBody
261859
262092
  });
261860
262093
  const requestId = response.headers.get("x-request-id") ?? response.headers.get("x-request-id".toLowerCase()) ?? `openai-compatible-${randomUUID6()}`;
261861
262094
  return {
@@ -261954,7 +262187,7 @@ function openAICompatibleAnthropicCountUrl(chatEndpoint) {
261954
262187
  url3.pathname = url3.pathname.replace(/\/chat\/completions\/?$/u, "/messages/count_tokens");
261955
262188
  return url3.toString().replace(/\/$/u, "");
261956
262189
  }
261957
- function toOpenAICompatibleRequest(params, providerName = "openai-compatible") {
262190
+ function toOpenAICompatibleRequest(params, providerName = "openai-compatible", options2 = {}) {
261958
262191
  const tools = toOpenAITools(params.tools, providerName);
261959
262192
  const responseFormat = toOpenAIResponseFormat(params.output_config?.format);
261960
262193
  const reasoningEffort = toOpenAIReasoningEffort(params, providerName);
@@ -261967,8 +262200,10 @@ function toOpenAICompatibleRequest(params, providerName = "openai-compatible") {
261967
262200
  })() : undefined;
261968
262201
  const openRouterServerSearch = providerName === "openrouter" && tools.some((tool) => tool?.type === "openrouter:web_search");
261969
262202
  const toolChoice = openRouterServerSearch ? undefined : mapOpenAIToolChoice(params.tool_choice);
261970
- const openRouterProviderPreferences = providerName === "openrouter" ? openRouterRoutingPreferences(params) : undefined;
262203
+ const openRouterProviderPreferences = providerName === "openrouter" ? openRouterRoutingPreferences(params, options2.openrouter) : undefined;
261971
262204
  const openRouterSessionId = providerName === "openrouter" ? resolveOpenRouterSessionId(params) : undefined;
262205
+ const openRouterServiceTier = providerName === "openrouter" ? params.service_tier ?? options2.openrouter?.serviceTier : undefined;
262206
+ const openRouterSpeed = providerName === "openrouter" ? params.speed ?? options2.openrouter?.speed : undefined;
261972
262207
  const nvidiaCodingAgentTemplate = providerName === "nvidia-nim" && /^nvidia\/nemotron-3-(?:super|ultra)(?:-|$)/iu.test(String(params.model ?? "")) && tools.length > 0 ? { force_nonempty_content: true } : undefined;
261973
262208
  return {
261974
262209
  model: params.model,
@@ -261985,6 +262220,8 @@ function toOpenAICompatibleRequest(params, providerName = "openai-compatible") {
261985
262220
  provider: openRouterProviderPreferences
261986
262221
  },
261987
262222
  ...openRouterSessionId && { session_id: openRouterSessionId },
262223
+ ...openRouterServiceTier && openRouterServiceTier !== "auto" ? { service_tier: openRouterServiceTier } : {},
262224
+ ...openRouterSpeed === "fast" ? { speed: "fast" } : {},
261988
262225
  ...nvidiaCodingAgentTemplate && {
261989
262226
  chat_template_kwargs: nvidiaCodingAgentTemplate
261990
262227
  },
@@ -261994,14 +262231,33 @@ function toOpenAICompatibleRequest(params, providerName = "openai-compatible") {
261994
262231
  ...toolChoice !== undefined ? { tool_choice: toolChoice } : {}
261995
262232
  };
261996
262233
  }
261997
- function openRouterRoutingPreferences(params) {
262234
+ function openRouterRoutingPreferences(params, settings) {
261998
262235
  if (params?.provider && typeof params.provider === "object" && !Array.isArray(params.provider)) {
261999
262236
  return params.provider;
262000
262237
  }
262001
262238
  const model = typeof params?.model === "string" ? params.model : "";
262002
- if (/:(?:nitro|floor|exacto)$/iu.test(model))
262003
- return;
262004
- return { sort: "latency" };
262239
+ const usesModelRoutingVariant = /:(?:nitro|floor|exacto)$/iu.test(model);
262240
+ const preferences = {};
262241
+ const strategy = settings?.routing ?? "auto";
262242
+ const hasTools = Array.isArray(params?.tools) && params.tools.length > 0 || params?.tool_choice !== undefined;
262243
+ if (strategy !== "auto") {
262244
+ preferences.sort = strategy;
262245
+ } else if (!usesModelRoutingVariant && !hasTools) {
262246
+ preferences.sort = "throughput";
262247
+ }
262248
+ if (settings?.allowFallbacks !== undefined) {
262249
+ preferences.allow_fallbacks = settings.allowFallbacks;
262250
+ }
262251
+ if (settings?.requireParameters !== undefined) {
262252
+ preferences.require_parameters = settings.requireParameters;
262253
+ }
262254
+ if (settings?.preferredMinThroughput !== undefined) {
262255
+ preferences.preferred_min_throughput = settings.preferredMinThroughput;
262256
+ }
262257
+ if (settings?.preferredMaxLatency !== undefined) {
262258
+ preferences.preferred_max_latency = settings.preferredMaxLatency;
262259
+ }
262260
+ return Object.keys(preferences).length > 0 ? preferences : undefined;
262005
262261
  }
262006
262262
  function resolveOpenRouterSessionId(params) {
262007
262263
  const explicit = validOpenRouterSessionId(params?.session_id);
@@ -272029,6 +272285,15 @@ var init_types4 = __esm(() => {
272029
272285
  compactThreshold: exports_external.number().int().min(1000).optional().describe("Token threshold for server-side Responses compaction."),
272030
272286
  toolSearch: exports_external.enum(["off", "hosted"]).optional().describe("Deferred Responses API tool search mode. Defaults to off.")
272031
272287
  }).optional().describe("Privacy-conscious OpenAI Responses API options."),
272288
+ openrouter: exports_external.object({
272289
+ routing: exports_external.enum(["auto", "throughput", "latency", "price"]).optional().describe("OpenRouter routing strategy. Auto preserves Auto Exacto for tool turns and prioritizes throughput for ordinary turns."),
272290
+ allowFallbacks: exports_external.boolean().optional().describe("Allow OpenRouter to try another upstream endpoint after a provider failure."),
272291
+ requireParameters: exports_external.boolean().optional().describe("Only route through OpenRouter endpoints that support every request parameter."),
272292
+ preferredMinThroughput: exports_external.number().positive().optional().describe("Preferred OpenRouter median throughput in output tokens per second."),
272293
+ preferredMaxLatency: exports_external.number().positive().optional().describe("Preferred OpenRouter median time-to-first-token latency in seconds."),
272294
+ serviceTier: exports_external.enum(["auto", "default", "flex", "priority", "fast"]).optional().describe("OpenRouter upstream service tier; priority may cost more and is model-dependent."),
272295
+ speed: exports_external.enum(["standard", "fast"]).optional().describe("Request OpenRouter fast mode on models that explicitly support it.")
272296
+ }).optional().describe("OpenRouter performance and routing controls."),
272032
272297
  preferences: exports_external.record(exports_external.string(), NonSecretPreferenceSchema).optional().describe("Non-secret provider preferences only")
272033
272298
  }).optional().describe("Legal provider configuration; credentials must stay in environment variables or official CLIs"),
272034
272299
  availableModels: exports_external.array(exports_external.string()).optional().describe("Allowlist of models that users can select. " + "Accepts exact provider-scoped model IDs and provider-specific aliases. " + "If undefined, all models are available. If empty array, only the default model is available. " + "Typically set in managed settings by enterprise administrators."),
@@ -304647,7 +304912,7 @@ function getTelemetryAttributes() {
304647
304912
  attributes["session.id"] = sessionId;
304648
304913
  }
304649
304914
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
304650
- attributes["app.version"] = "1.84.2";
304915
+ attributes["app.version"] = "1.84.4";
304651
304916
  }
304652
304917
  const oauthAccount = getOauthAccountInfo();
304653
304918
  if (oauthAccount) {
@@ -307678,7 +307943,7 @@ var require_src3 = __commonJS((exports) => {
307678
307943
  function getInstruments() {
307679
307944
  if (instruments)
307680
307945
  return instruments;
307681
- const meter = import_api2.metrics.getMeter("ur-agent.gen_ai", "1.84.2");
307946
+ const meter = import_api2.metrics.getMeter("ur-agent.gen_ai", "1.84.4");
307682
307947
  instruments = {
307683
307948
  operationDuration: meter.createHistogram("gen_ai.client.operation.duration", {
307684
307949
  description: "GenAI operation duration.",
@@ -307776,7 +308041,7 @@ function genAiAgentAttributes() {
307776
308041
  "gen_ai.operation.name": GEN_AI_OPERATION_INVOKE_AGENT,
307777
308042
  "gen_ai.provider.name": "ur",
307778
308043
  "gen_ai.agent.name": "UR-Nexus",
307779
- "gen_ai.agent.version": "1.84.2"
308044
+ "gen_ai.agent.version": "1.84.4"
307780
308045
  };
307781
308046
  }
307782
308047
  function genAiWorkflowAttributes(workflowName, workflowRunId) {
@@ -307797,7 +308062,7 @@ function genAiWorkflowAttributes(workflowName, workflowRunId) {
307797
308062
  function startGenAiWorkflowSpan(workflowName, workflowRunId) {
307798
308063
  const attributes = genAiWorkflowAttributes(workflowName, workflowRunId);
307799
308064
  const name = typeof attributes["gen_ai.workflow.name"] === "string" ? `invoke_workflow ${attributes["gen_ai.workflow.name"]}` : GEN_AI_OPERATION_INVOKE_WORKFLOW;
307800
- return import_api2.trace.getTracer("ur-agent.gen_ai", "1.84.2").startSpan(name, { kind: import_api2.SpanKind.INTERNAL, attributes });
308065
+ return import_api2.trace.getTracer("ur-agent.gen_ai", "1.84.4").startSpan(name, { kind: import_api2.SpanKind.INTERNAL, attributes });
307801
308066
  }
307802
308067
  function endGenAiWorkflowSpan(span, options2 = {}) {
307803
308068
  try {
@@ -307835,7 +308100,7 @@ function startGenAiMemorySpan(operation, options2 = {}) {
307835
308100
  if (options2.recordCount !== undefined && Number.isInteger(options2.recordCount) && options2.recordCount >= 0) {
307836
308101
  attributes["gen_ai.memory.record.count"] = options2.recordCount;
307837
308102
  }
307838
- return import_api2.trace.getTracer("ur-agent.gen_ai", "1.84.2").startSpan(operation, { kind: import_api2.SpanKind.INTERNAL, attributes });
308103
+ return import_api2.trace.getTracer("ur-agent.gen_ai", "1.84.4").startSpan(operation, { kind: import_api2.SpanKind.INTERNAL, attributes });
307839
308104
  }
307840
308105
  function endGenAiMemorySpan(span, options2 = {}) {
307841
308106
  try {
@@ -322242,7 +322507,7 @@ async function createRuntime() {
322242
322507
  bootstrapTelemetry();
322243
322508
  const resource = defaultResource().merge(detectResources({ detectors: [envDetector] })).merge(resourceFromAttributes({
322244
322509
  [import_semantic_conventions6.ATTR_SERVICE_NAME]: "ur-agent",
322245
- [import_semantic_conventions6.ATTR_SERVICE_VERSION]: "1.84.2"
322510
+ [import_semantic_conventions6.ATTR_SERVICE_VERSION]: "1.84.4"
322246
322511
  }));
322247
322512
  const tracerProvider = exporters.traces.length > 0 ? new BasicTracerProvider({
322248
322513
  resource,
@@ -322275,11 +322540,11 @@ async function createRuntime() {
322275
322540
  setMeterProvider(meterProvider);
322276
322541
  setLoggerProvider(loggerProvider);
322277
322542
  if (meterProvider) {
322278
- const meter = meterProvider.getMeter("ur-agent", "1.84.2");
322543
+ const meter = meterProvider.getMeter("ur-agent", "1.84.4");
322279
322544
  setMeter(meter, (name, options2) => meter.createCounter(name, options2));
322280
322545
  }
322281
322546
  if (loggerProvider) {
322282
- setEventLogger(loggerProvider.getLogger("ur-agent.events", "1.84.2"));
322547
+ setEventLogger(loggerProvider.getLogger("ur-agent.events", "1.84.4"));
322283
322548
  }
322284
322549
  if (!cleanupRegistered4) {
322285
322550
  cleanupRegistered4 = true;
@@ -322828,7 +323093,7 @@ function isAnyTracingEnabled() {
322828
323093
  return isTelemetryEnabled() || isEnhancedTelemetryEnabled() || isBetaTracingEnabled();
322829
323094
  }
322830
323095
  function getTracer() {
322831
- return import_api32.trace.getTracer("ur-agent.gen_ai", "1.84.2");
323096
+ return import_api32.trace.getTracer("ur-agent.gen_ai", "1.84.4");
322832
323097
  }
322833
323098
  function createSpanAttributes(spanType, customAttributes = {}) {
322834
323099
  const baseAttributes = getTelemetryAttributes();
@@ -329678,6 +329943,72 @@ var init_tokenBudget2 = __esm(() => {
329678
329943
  init_tokenBudget();
329679
329944
  });
329680
329945
 
329946
+ // src/query/outputLimitRecovery.ts
329947
+ import { createHash as createHash17 } from "crypto";
329948
+
329949
+ class OutputLimitRecoveryTracker {
329950
+ seen = new Set;
329951
+ continuationCount = 0;
329952
+ consecutiveStalls = 0;
329953
+ record(messages) {
329954
+ const fingerprint = progressFingerprint(messages);
329955
+ const stallReason = !fingerprint ? "empty" : this.seen.has(fingerprint) ? "repeated" : undefined;
329956
+ this.continuationCount++;
329957
+ if (stallReason) {
329958
+ this.consecutiveStalls++;
329959
+ } else {
329960
+ this.consecutiveStalls = 0;
329961
+ this.seen.add(fingerprint);
329962
+ }
329963
+ return {
329964
+ shouldContinue: this.consecutiveStalls < 2,
329965
+ continuationCount: this.continuationCount,
329966
+ consecutiveStalls: this.consecutiveStalls,
329967
+ ...stallReason ? { stallReason } : {}
329968
+ };
329969
+ }
329970
+ reset() {
329971
+ this.seen.clear();
329972
+ this.continuationCount = 0;
329973
+ this.consecutiveStalls = 0;
329974
+ }
329975
+ }
329976
+ function progressFingerprint(messages) {
329977
+ const material = messages.filter((message) => !message.isApiErrorMessage).flatMap((message) => {
329978
+ const content = message.message?.content;
329979
+ return Array.isArray(content) ? content : content === undefined ? [] : [content];
329980
+ }).map(projectProgressValue).filter((value) => value !== undefined && value !== "");
329981
+ if (material.length === 0)
329982
+ return;
329983
+ return createHash17("sha256").update(JSON.stringify(material)).digest("hex");
329984
+ }
329985
+ function projectProgressValue(value) {
329986
+ if (typeof value === "string")
329987
+ return value.replace(/\s+/gu, " ").trim();
329988
+ if (typeof value === "number" || typeof value === "boolean" || value === null) {
329989
+ return value;
329990
+ }
329991
+ if (Array.isArray(value))
329992
+ return value.map(projectProgressValue);
329993
+ if (!value || typeof value !== "object")
329994
+ return;
329995
+ const record2 = value;
329996
+ const type = typeof record2.type === "string" ? record2.type : undefined;
329997
+ if (type === "redacted_thinking" && typeof record2.data === "string") {
329998
+ return { type, opaqueBytes: record2.data.length };
329999
+ }
330000
+ const projected = {};
330001
+ for (const key of Object.keys(record2).sort()) {
330002
+ if (/^(?:id|request_id|signature|uuid)$/u.test(key))
330003
+ continue;
330004
+ const nested = projectProgressValue(record2[key]);
330005
+ if (nested !== undefined && nested !== "")
330006
+ projected[key] = nested;
330007
+ }
330008
+ return projected;
330009
+ }
330010
+ var init_outputLimitRecovery = () => {};
330011
+
329681
330012
  // src/query.ts
329682
330013
  function* yieldMissingToolResultBlocks(assistantMessages, errorMessage3) {
329683
330014
  for (const assistantMessage of assistantMessages) {
@@ -329740,6 +330071,7 @@ async function* queryLoop(params, consumedCommandUuids, ownedRepeatedFailureQuer
329740
330071
  pendingToolUseSummary: undefined,
329741
330072
  transition: undefined
329742
330073
  };
330074
+ const outputLimitRecovery = new OutputLimitRecoveryTracker;
329743
330075
  const budgetTracker = null;
329744
330076
  let taskBudgetRemaining = undefined;
329745
330077
  const config3 = buildQueryConfig();
@@ -330158,6 +330490,9 @@ async function* queryLoop(params, consumedCommandUuids, ownedRepeatedFailureQuer
330158
330490
  }
330159
330491
  if (!needsFollowUp) {
330160
330492
  const lastMessage = assistantMessages.at(-1);
330493
+ const hitOutputLimit = isWithheldMaxOutputTokens(lastMessage);
330494
+ if (!hitOutputLimit)
330495
+ outputLimitRecovery.reset();
330161
330496
  const isWithheld413 = lastMessage?.type === "assistant" && lastMessage.isApiErrorMessage && isPromptTooLongMessage(lastMessage);
330162
330497
  const isWithheldMedia = mediaRecoveryEnabled && reactiveCompact?.isWithheldMediaSizeError(lastMessage);
330163
330498
  if (isWithheld413) {
@@ -330249,30 +330584,11 @@ async function* queryLoop(params, consumedCommandUuids, ownedRepeatedFailureQuer
330249
330584
  });
330250
330585
  return { reason: isWithheldMedia ? "image_error" : "prompt_too_long" };
330251
330586
  } else if (false) {}
330252
- if (isWithheldMaxOutputTokens(lastMessage)) {
330253
- const capEnabled = getFeatureValue_CACHED_MAY_BE_STALE("tengu_otk_slot_v1", false);
330254
- if (capEnabled && maxOutputTokensOverride === undefined && !process.env.UR_CODE_MAX_OUTPUT_TOKENS) {
330255
- logEvent("tengu_max_tokens_escalate", {
330256
- escalatedTo: ESCALATED_MAX_TOKENS
330257
- });
330258
- const next2 = {
330259
- messages: messagesForQuery,
330260
- toolUseContext,
330261
- autoCompactTracking: tracking,
330262
- maxOutputTokensRecoveryCount,
330263
- hasAttemptedReactiveCompact,
330264
- maxOutputTokensOverride: ESCALATED_MAX_TOKENS,
330265
- pendingToolUseSummary: undefined,
330266
- stopHookActive: undefined,
330267
- turnCount,
330268
- transition: { reason: "max_output_tokens_escalate" }
330269
- };
330270
- state = next2;
330271
- continue;
330272
- }
330273
- if (maxOutputTokensRecoveryCount < MAX_OUTPUT_TOKENS_RECOVERY_LIMIT) {
330587
+ if (hitOutputLimit) {
330588
+ const recovery = outputLimitRecovery.record(assistantMessages);
330589
+ if (recovery.shouldContinue) {
330274
330590
  const recoveryMessage = createUserMessage({
330275
- content: `Output token limit hit. Resume directly \u2014 no apology, no recap of what you were doing. ` + `Pick up mid-thought if that is where the cut happened. Break remaining work into smaller pieces.`,
330591
+ content: `The provider ended this response at its per-response output boundary. ` + `Continue from the exact cutoff with only novel work\u2014do not apologize, recap, restart, or repeat prior text. ` + `Preserve the task and tool state; if the requested work is complete, finish now.`,
330276
330592
  isMeta: true
330277
330593
  });
330278
330594
  const next2 = {
@@ -330291,13 +330607,17 @@ async function* queryLoop(params, consumedCommandUuids, ownedRepeatedFailureQuer
330291
330607
  turnCount,
330292
330608
  transition: {
330293
330609
  reason: "max_output_tokens_recovery",
330294
- attempt: maxOutputTokensRecoveryCount + 1
330610
+ attempt: recovery.continuationCount
330295
330611
  }
330296
330612
  };
330297
330613
  state = next2;
330298
330614
  continue;
330299
330615
  }
330300
- yield lastMessage;
330616
+ yield createAssistantAPIErrorMessage({
330617
+ content: `Model "${currentModel}" repeatedly reached its per-response output boundary without novel progress (${recovery.stallReason === "empty" ? "empty output" : "replayed output"}). UR has no fixed total-output continuation ceiling; it stopped this stalled loop to avoid repeating the same provider calls.`,
330618
+ apiError: "max_output_tokens",
330619
+ error: "max_output_tokens"
330620
+ });
330301
330621
  }
330302
330622
  if (lastMessage?.isApiErrorMessage) {
330303
330623
  executeStopFailureHooks(lastMessage, toolUseContext);
@@ -330406,6 +330726,7 @@ ${nudge.reminder}
330406
330726
  }
330407
330727
  return { reason: "completed" };
330408
330728
  }
330729
+ outputLimitRecovery.reset();
330409
330730
  let shouldPreventContinuation = false;
330410
330731
  let updatedToolUseContext = toolUseContext;
330411
330732
  queryCheckpoint("query_tool_execution_start");
@@ -330634,7 +330955,7 @@ ${loopHit.reminder}
330634
330955
  state = next;
330635
330956
  }
330636
330957
  }
330637
- var reactiveCompact = null, skillPrefetch = null, MAX_OUTPUT_TOKENS_RECOVERY_LIMIT = 3;
330958
+ var reactiveCompact = null, skillPrefetch = null;
330638
330959
  var init_query = __esm(() => {
330639
330960
  init_withRetry();
330640
330961
  init_autoCompact();
@@ -330657,8 +330978,6 @@ var init_query = __esm(() => {
330657
330978
  init_headlessProfiler();
330658
330979
  init_model();
330659
330980
  init_tokens();
330660
- init_context4();
330661
- init_growthbook();
330662
330981
  init_prompt10();
330663
330982
  init_postSamplingHooks();
330664
330983
  init_hooks5();
@@ -330676,6 +330995,7 @@ var init_query = __esm(() => {
330676
330995
  init_deps();
330677
330996
  init_state();
330678
330997
  init_tokenBudget2();
330998
+ init_outputLimitRecovery();
330679
330999
  });
330680
331000
 
330681
331001
  // src/services/api/emptyUsage.ts
@@ -334752,7 +335072,7 @@ var init_agent = __esm(() => {
334752
335072
  });
334753
335073
 
334754
335074
  // src/utils/fingerprint.ts
334755
- import { createHash as createHash17 } from "crypto";
335075
+ import { createHash as createHash18 } from "crypto";
334756
335076
  function extractFirstMessageText(messages) {
334757
335077
  const firstUserMessage = messages.find((msg) => msg.type === "user");
334758
335078
  if (!firstUserMessage) {
@@ -334774,12 +335094,12 @@ function computeFingerprint(messageText2, version2) {
334774
335094
  const indices = [4, 7, 20];
334775
335095
  const chars = indices.map((i3) => messageText2[i3] || "0").join("");
334776
335096
  const fingerprintInput = `${FINGERPRINT_SALT}${chars}${version2}`;
334777
- const hash4 = createHash17("sha256").update(fingerprintInput).digest("hex");
335097
+ const hash4 = createHash18("sha256").update(fingerprintInput).digest("hex");
334778
335098
  return hash4.slice(0, 3);
334779
335099
  }
334780
335100
  function computeFingerprintFromMessages(messages) {
334781
335101
  const firstMessageText = extractFirstMessageText(messages);
334782
- return computeFingerprint(firstMessageText, "1.84.2");
335102
+ return computeFingerprint(firstMessageText, "1.84.4");
334783
335103
  }
334784
335104
  var FINGERPRINT_SALT = "59cf53e54c78";
334785
335105
  var init_fingerprint = () => {};
@@ -334821,7 +335141,7 @@ async function sideQuery(opts) {
334821
335141
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
334822
335142
  }
334823
335143
  const messageText2 = extractFirstUserMessageText(messages);
334824
- const fingerprint = computeFingerprint(messageText2, "1.84.2");
335144
+ const fingerprint = computeFingerprint(messageText2, "1.84.4");
334825
335145
  const attributionHeader = getAttributionHeader(fingerprint);
334826
335146
  const systemBlocks = [
334827
335147
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -336520,7 +336840,7 @@ var init_trustedDevice = __esm(() => {
336520
336840
  });
336521
336841
 
336522
336842
  // src/services/analytics/datadog.ts
336523
- import { createHash as createHash18 } from "crypto";
336843
+ import { createHash as createHash19 } from "crypto";
336524
336844
  function camelToSnakeCase(str2) {
336525
336845
  return str2.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
336526
336846
  }
@@ -336728,7 +337048,7 @@ var init_datadog = __esm(() => {
336728
337048
  });
336729
337049
  getUserBucket = memoize_default(() => {
336730
337050
  const userId = getOrCreateUserID();
336731
- const hash4 = createHash18("sha256").update(userId).digest("hex");
337051
+ const hash4 = createHash19("sha256").update(userId).digest("hex");
336732
337052
  return parseInt(hash4.slice(0, 8), 16) % NUM_USER_BUCKETS;
336733
337053
  });
336734
337054
  });
@@ -336928,7 +337248,7 @@ var init_user = __esm(() => {
336928
337248
  deviceId,
336929
337249
  sessionId: getSessionId(),
336930
337250
  email: getEmail(),
336931
- appVersion: "1.84.2",
337251
+ appVersion: "1.84.4",
336932
337252
  platform: getHostPlatformForAnalytics(),
336933
337253
  organizationUuid,
336934
337254
  accountUuid,
@@ -337688,7 +338008,7 @@ var init_growthbook_experiment_event = __esm(() => {
337688
338008
 
337689
338009
  // src/utils/userAgent.ts
337690
338010
  function getURCodeUserAgent() {
337691
- return `ur/${"1.84.2"}`;
338011
+ return `ur/${"1.84.4"}`;
337692
338012
  }
337693
338013
 
337694
338014
  // src/services/analytics/firstPartyEventLoggingExporter.ts
@@ -338344,7 +338664,7 @@ function initialize1PEventLogging() {
338344
338664
  const platform4 = getPlatform();
338345
338665
  const attributes = {
338346
338666
  [import_semantic_conventions7.ATTR_SERVICE_NAME]: "ur",
338347
- [import_semantic_conventions7.ATTR_SERVICE_VERSION]: "1.84.2"
338667
+ [import_semantic_conventions7.ATTR_SERVICE_VERSION]: "1.84.4"
338348
338668
  };
338349
338669
  if (platform4 === "wsl") {
338350
338670
  const wslVersion = getWslVersion();
@@ -338372,7 +338692,7 @@ function initialize1PEventLogging() {
338372
338692
  })
338373
338693
  ]
338374
338694
  });
338375
- firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.urhq.ur.events", "1.84.2");
338695
+ firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.urhq.ur.events", "1.84.4");
338376
338696
  }
338377
338697
  async function reinitialize1PEventLoggingIfConfigChanged() {
338378
338698
  if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
@@ -338898,7 +339218,7 @@ var init_types9 = __esm(() => {
338898
339218
  });
338899
339219
 
338900
339220
  // src/services/policyLimits/index.ts
338901
- import { createHash as createHash19 } from "crypto";
339221
+ import { createHash as createHash20 } from "crypto";
338902
339222
  import { readFileSync as fsReadFileSync } from "fs";
338903
339223
  import { unlink as unlink10, writeFile as writeFile16 } from "fs/promises";
338904
339224
  import { join as join82 } from "path";
@@ -338944,7 +339264,7 @@ function sortKeysDeep(obj) {
338944
339264
  function computeChecksum(restrictions) {
338945
339265
  const sorted = sortKeysDeep(restrictions);
338946
339266
  const normalized = jsonStringify(sorted);
338947
- const hash4 = createHash19("sha256").update(normalized).digest("hex");
339267
+ const hash4 = createHash20("sha256").update(normalized).digest("hex");
338948
339268
  return `sha256:${hash4}`;
338949
339269
  }
338950
339270
  function isPolicyLimitsEligible() {
@@ -340721,7 +341041,7 @@ var init_types10 = __esm(() => {
340721
341041
  });
340722
341042
 
340723
341043
  // src/services/remoteManagedSettings/index.ts
340724
- import { createHash as createHash20 } from "crypto";
341044
+ import { createHash as createHash21 } from "crypto";
340725
341045
  import { open as open8, unlink as unlink11 } from "fs/promises";
340726
341046
  function initializeRemoteManagedSettingsLoadingPromise() {
340727
341047
  if (loadingCompletePromise2) {
@@ -340759,7 +341079,7 @@ function sortKeysDeep2(obj) {
340759
341079
  function computeChecksumFromSettings(settings) {
340760
341080
  const sorted = sortKeysDeep2(settings);
340761
341081
  const normalized = jsonStringify(sorted);
340762
- const hash4 = createHash20("sha256").update(normalized).digest("hex");
341082
+ const hash4 = createHash21("sha256").update(normalized).digest("hex");
340763
341083
  return `sha256:${hash4}`;
340764
341084
  }
340765
341085
  function isEligibleForRemoteManagedSettings() {
@@ -341342,7 +341662,7 @@ var init_auth_code_listener = __esm(() => {
341342
341662
  });
341343
341663
 
341344
341664
  // src/services/oauth/crypto.ts
341345
- import { createHash as createHash21, randomBytes as randomBytes12 } from "crypto";
341665
+ import { createHash as createHash22, randomBytes as randomBytes12 } from "crypto";
341346
341666
  function base64URLEncode(buffer) {
341347
341667
  return buffer.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
341348
341668
  }
@@ -341350,7 +341670,7 @@ function generateCodeVerifier() {
341350
341670
  return base64URLEncode(randomBytes12(32));
341351
341671
  }
341352
341672
  function generateCodeChallenge(verifier) {
341353
- const hash4 = createHash21("sha256");
341673
+ const hash4 = createHash22("sha256");
341354
341674
  hash4.update(verifier);
341355
341675
  return base64URLEncode(hash4.digest());
341356
341676
  }
@@ -341674,9 +341994,9 @@ async function assertMinVersion() {
341674
341994
  if (false) {}
341675
341995
  try {
341676
341996
  const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
341677
- if (versionConfig.minVersion && lt("1.84.2", versionConfig.minVersion)) {
341997
+ if (versionConfig.minVersion && lt("1.84.4", versionConfig.minVersion)) {
341678
341998
  console.error(`
341679
- It looks like your version of UR (${"1.84.2"}) needs an update.
341999
+ It looks like your version of UR (${"1.84.4"}) needs an update.
341680
342000
  A newer version (${versionConfig.minVersion} or higher) is required to continue.
341681
342001
 
341682
342002
  To update, please run:
@@ -341892,7 +342212,7 @@ async function installGlobalPackage(specificVersion) {
341892
342212
  logError2(new AutoUpdaterError("Another process is currently installing an update"));
341893
342213
  logEvent("tengu_auto_updater_lock_contention", {
341894
342214
  pid: process.pid,
341895
- currentVersion: "1.84.2"
342215
+ currentVersion: "1.84.4"
341896
342216
  });
341897
342217
  return "in_progress";
341898
342218
  }
@@ -341901,7 +342221,7 @@ async function installGlobalPackage(specificVersion) {
341901
342221
  if (!env2.isRunningWithBun() && env2.isNpmFromWindowsPath()) {
341902
342222
  logError2(new Error("Windows NPM detected in WSL environment"));
341903
342223
  logEvent("tengu_auto_updater_windows_npm_in_wsl", {
341904
- currentVersion: "1.84.2"
342224
+ currentVersion: "1.84.4"
341905
342225
  });
341906
342226
  console.error(`
341907
342227
  Error: Windows NPM detected in WSL
@@ -342436,7 +342756,7 @@ function detectLinuxGlobPatternWarnings() {
342436
342756
  }
342437
342757
  async function getDoctorDiagnostic() {
342438
342758
  const installationType = await getCurrentInstallationType();
342439
- const version2 = typeof MACRO !== "undefined" ? "1.84.2" : "unknown";
342759
+ const version2 = typeof MACRO !== "undefined" ? "1.84.4" : "unknown";
342440
342760
  const installationPath = await getInstallationPath();
342441
342761
  const invokedBinary = getInvokedBinary();
342442
342762
  const multipleInstallations = await detectMultipleInstallations();
@@ -343503,7 +343823,7 @@ function getInstallationEnv() {
343503
343823
  return;
343504
343824
  }
343505
343825
  function getURCodeVersion() {
343506
- return "1.84.2";
343826
+ return "1.84.4";
343507
343827
  }
343508
343828
  async function getInstalledVSCodeExtensionVersion(command) {
343509
343829
  const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
@@ -344167,7 +344487,7 @@ function getUserBinDir(options2) {
344167
344487
  var init_xdg = () => {};
344168
344488
 
344169
344489
  // src/utils/nativeInstaller/download.ts
344170
- import { createHash as createHash22 } from "crypto";
344490
+ import { createHash as createHash23 } from "crypto";
344171
344491
  import { chmod as chmod3, writeFile as writeFile19 } from "fs/promises";
344172
344492
  import { join as join90 } from "path";
344173
344493
  async function getLatestVersionFromArtifactory(tag2 = "latest") {
@@ -344353,7 +344673,7 @@ async function downloadAndVerifyBinary(binaryUrl, expectedChecksum, binaryPath,
344353
344673
  ...requestConfig
344354
344674
  });
344355
344675
  clearStallTimer();
344356
- const hash4 = createHash22("sha256");
344676
+ const hash4 = createHash23("sha256");
344357
344677
  hash4.update(response.data);
344358
344678
  const actualChecksum = hash4.digest("hex");
344359
344679
  if (actualChecksum !== expectedChecksum) {
@@ -344984,8 +345304,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
344984
345304
  const maxVersion = await getMaxVersion();
344985
345305
  if (maxVersion && gt(version2, maxVersion)) {
344986
345306
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
344987
- if (gte("1.84.2", maxVersion)) {
344988
- logForDebugging(`Native installer: current version ${"1.84.2"} is already at or above maxVersion ${maxVersion}, skipping update`);
345307
+ if (gte("1.84.4", maxVersion)) {
345308
+ logForDebugging(`Native installer: current version ${"1.84.4"} is already at or above maxVersion ${maxVersion}, skipping update`);
344989
345309
  logEvent("tengu_native_update_skipped_max_version", {
344990
345310
  latency_ms: Date.now() - startTime,
344991
345311
  max_version: maxVersion,
@@ -344996,7 +345316,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
344996
345316
  version2 = maxVersion;
344997
345317
  }
344998
345318
  }
344999
- if (!forceReinstall && version2 === "1.84.2" && await versionIsAvailable(version2) && await isPossibleURBinary(executablePath)) {
345319
+ if (!forceReinstall && version2 === "1.84.4" && await versionIsAvailable(version2) && await isPossibleURBinary(executablePath)) {
345000
345320
  logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
345001
345321
  logEvent("tengu_native_update_complete", {
345002
345322
  latency_ms: Date.now() - startTime,
@@ -365053,11 +365373,11 @@ var init_skillUsageTracking = __esm(() => {
365053
365373
  });
365054
365374
 
365055
365375
  // src/utils/telemetry/pluginTelemetry.ts
365056
- import { createHash as createHash23 } from "crypto";
365376
+ import { createHash as createHash24 } from "crypto";
365057
365377
  import { sep as sep12 } from "path";
365058
365378
  function hashPluginId(name, marketplace) {
365059
365379
  const key = marketplace ? `${name}@${marketplace.toLowerCase()}` : name;
365060
- return createHash23("sha256").update(key + PLUGIN_ID_HASH_SALT).digest("hex").slice(0, 16);
365380
+ return createHash24("sha256").update(key + PLUGIN_ID_HASH_SALT).digest("hex").slice(0, 16);
365061
365381
  }
365062
365382
  function getTelemetryPluginScope(name, marketplace, managedNames) {
365063
365383
  if (marketplace === BUILTIN_MARKETPLACE_NAME2)
@@ -367563,7 +367883,7 @@ var init_sessionIngress = __esm(() => {
367563
367883
  });
367564
367884
 
367565
367885
  // src/utils/fileHistory.ts
367566
- import { createHash as createHash24 } from "crypto";
367886
+ import { createHash as createHash25 } from "crypto";
367567
367887
  import {
367568
367888
  chmod as chmod5,
367569
367889
  copyFile as copyFile6,
@@ -367987,7 +368307,7 @@ async function computeDiffStatsForFile(originalFile, backupFileName) {
367987
368307
  };
367988
368308
  }
367989
368309
  function getBackupFileName(filePath, version2) {
367990
- const fileNameHash = createHash24("sha256").update(filePath).digest("hex").slice(0, 16);
368310
+ const fileNameHash = createHash25("sha256").update(filePath).digest("hex").slice(0, 16);
367991
368311
  return `${fileNameHash}@v${version2}`;
367992
368312
  }
367993
368313
  function resolveBackupPath(backupFileName, sessionId) {
@@ -368949,11 +369269,11 @@ var init_filesApi = __esm(() => {
368949
369269
  });
368950
369270
 
368951
369271
  // src/utils/tempfile.ts
368952
- import { createHash as createHash25, randomUUID as randomUUID24 } from "crypto";
369272
+ import { createHash as createHash26, randomUUID as randomUUID24 } from "crypto";
368953
369273
  import { tmpdir as tmpdir11 } from "os";
368954
369274
  import { join as join97 } from "path";
368955
369275
  function generateTempFilePath(prefix = "ur-prompt", extension = ".md", options2) {
368956
- const id = options2?.contentHash ? createHash25("sha256").update(options2.contentHash).digest("hex").slice(0, 16) : randomUUID24();
369276
+ const id = options2?.contentHash ? createHash26("sha256").update(options2.contentHash).digest("hex").slice(0, 16) : randomUUID24();
368957
369277
  return join97(tmpdir11(), `${prefix}-${id}${extension}`);
368958
369278
  }
368959
369279
  var init_tempfile = () => {};
@@ -376039,12 +376359,12 @@ var init_diff2 = __esm(() => {
376039
376359
  });
376040
376360
 
376041
376361
  // src/utils/fileOperationAnalytics.ts
376042
- import { createHash as createHash26 } from "crypto";
376362
+ import { createHash as createHash27 } from "crypto";
376043
376363
  function hashFilePath(filePath) {
376044
- return createHash26("sha256").update(filePath).digest("hex").slice(0, 16);
376364
+ return createHash27("sha256").update(filePath).digest("hex").slice(0, 16);
376045
376365
  }
376046
376366
  function hashFileContent(content) {
376047
- return createHash26("sha256").update(content).digest("hex");
376367
+ return createHash27("sha256").update(content).digest("hex");
376048
376368
  }
376049
376369
  function logFileOperation(params) {
376050
376370
  const metadata = {
@@ -409675,7 +409995,7 @@ import {
409675
409995
  writeFileSync as writeFileSync18
409676
409996
  } from "fs";
409677
409997
  import {
409678
- createHash as createHash27,
409998
+ createHash as createHash28,
409679
409999
  createPrivateKey,
409680
410000
  createPublicKey,
409681
410001
  randomUUID as randomUUID28,
@@ -409684,7 +410004,7 @@ import {
409684
410004
  } from "crypto";
409685
410005
  import { basename as basename29, join as join110, relative as relative23, sep as sep20 } from "path";
409686
410006
  function sha256(value) {
409687
- return createHash27("sha256").update(value).digest("hex");
410007
+ return createHash28("sha256").update(value).digest("hex");
409688
410008
  }
409689
410009
  function stableJson2(value) {
409690
410010
  if (Array.isArray(value))
@@ -417309,7 +417629,7 @@ var init_managedPlugins = __esm(() => {
417309
417629
  });
417310
417630
 
417311
417631
  // src/utils/plugins/pluginVersioning.ts
417312
- import { createHash as createHash28 } from "crypto";
417632
+ import { createHash as createHash29 } from "crypto";
417313
417633
  async function calculatePluginVersion(pluginId, source, manifest, installPath, providedVersion, gitCommitSha) {
417314
417634
  if (manifest?.version) {
417315
417635
  logForDebugging(`Using manifest version for ${pluginId}: ${manifest.version}`);
@@ -417323,7 +417643,7 @@ async function calculatePluginVersion(pluginId, source, manifest, installPath, p
417323
417643
  const shortSha = gitCommitSha.substring(0, 12);
417324
417644
  if (typeof source === "object" && source.source === "git-subdir") {
417325
417645
  const normPath = source.path.replace(/\\/g, "/").replace(/^\.\//, "").replace(/\/+$/, "");
417326
- const pathHash = createHash28("sha256").update(normPath).digest("hex").substring(0, 8);
417646
+ const pathHash = createHash29("sha256").update(normPath).digest("hex").substring(0, 8);
417327
417647
  const v = `${shortSha}-${pathHash}`;
417328
417648
  logForDebugging(`Using git-subdir SHA+path version for ${pluginId}: ${v} (path=${normPath})`);
417329
417649
  return v;
@@ -420208,7 +420528,7 @@ var init_config7 = __esm(() => {
420208
420528
  });
420209
420529
 
420210
420530
  // src/services/mcp/utils.ts
420211
- import { createHash as createHash29 } from "crypto";
420531
+ import { createHash as createHash30 } from "crypto";
420212
420532
  import { join as join124 } from "path";
420213
420533
  function filterToolsByServer(tools, serverName) {
420214
420534
  const prefix = `mcp__${normalizeNameForMCP(serverName)}__`;
@@ -420248,7 +420568,7 @@ function hashMcpConfig(config3) {
420248
420568
  }
420249
420569
  return v;
420250
420570
  });
420251
- return createHash29("sha256").update(stable).digest("hex").slice(0, 16);
420571
+ return createHash30("sha256").update(stable).digest("hex").slice(0, 16);
420252
420572
  }
420253
420573
  function excludeStalePluginClients(mcp, configs) {
420254
420574
  const stale = mcp.clients.filter((c4) => {
@@ -420997,7 +421317,7 @@ var init_xaaIdpLogin = __esm(() => {
420997
421317
  });
420998
421318
 
420999
421319
  // src/services/mcp/auth.ts
421000
- import { createHash as createHash30, randomBytes as randomBytes18, randomUUID as randomUUID32 } from "crypto";
421320
+ import { createHash as createHash31, randomBytes as randomBytes18, randomUUID as randomUUID32 } from "crypto";
421001
421321
  import { mkdir as mkdir26 } from "fs/promises";
421002
421322
  import { createServer as createServer9 } from "http";
421003
421323
  import { join as join125 } from "path";
@@ -421111,7 +421431,7 @@ function getServerKey(serverName, serverConfig) {
421111
421431
  url: serverConfig.url,
421112
421432
  headers: serverConfig.headers || {}
421113
421433
  });
421114
- const hash4 = createHash30("sha256").update(configJson).digest("hex").substring(0, 16);
421434
+ const hash4 = createHash31("sha256").update(configJson).digest("hex").substring(0, 16);
421115
421435
  return `${serverName}|${hash4}`;
421116
421436
  }
421117
421437
  function hasMcpDiscoveryButNoToken(serverName, serverConfig) {
@@ -438860,7 +439180,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
438860
439180
  const client = new Client({
438861
439181
  name: "ur",
438862
439182
  title: "UR",
438863
- version: "1.84.2",
439183
+ version: "1.84.4",
438864
439184
  description: "UR-Nexus autonomous engineering workflow engine",
438865
439185
  websiteUrl: PRODUCT_URL
438866
439186
  }, {
@@ -439217,7 +439537,7 @@ var init_client2 = __esm(() => {
439217
439537
  const client = new Client({
439218
439538
  name: "ur",
439219
439539
  title: "UR",
439220
- version: "1.84.2",
439540
+ version: "1.84.4",
439221
439541
  description: "UR-Nexus autonomous engineering workflow engine",
439222
439542
  websiteUrl: PRODUCT_URL
439223
439543
  }, {
@@ -439848,7 +440168,7 @@ var init_client2 = __esm(() => {
439848
440168
  });
439849
440169
 
439850
440170
  // src/utils/api.ts
439851
- import { createHash as createHash31 } from "crypto";
440171
+ import { createHash as createHash32 } from "crypto";
439852
440172
  function filterSwarmFieldsFromSchema(toolName, schema) {
439853
440173
  const fieldsToRemove = SWARM_FIELDS_BY_TOOL[toolName];
439854
440174
  if (!fieldsToRemove || fieldsToRemove.length === 0) {
@@ -439942,7 +440262,7 @@ function logAPIPrefix(systemPrompt) {
439942
440262
  logEvent("tengu_sysprompt_block", {
439943
440263
  snippet: firstSystemPrompt?.slice(0, 20),
439944
440264
  length: firstSystemPrompt?.length ?? 0,
439945
- hash: firstSystemPrompt ? createHash31("sha256").update(firstSystemPrompt).digest("hex") : ""
440265
+ hash: firstSystemPrompt ? createHash32("sha256").update(firstSystemPrompt).digest("hex") : ""
439946
440266
  });
439947
440267
  }
439948
440268
  function splitSysPromptPrefix(systemPrompt, options2) {
@@ -440258,6 +440578,9 @@ var init_api3 = __esm(() => {
440258
440578
  });
440259
440579
 
440260
440580
  // src/utils/model/providerRequestTuning.ts
440581
+ function formatOutputTokenLimitMessage(model, requestedMaxTokens) {
440582
+ return `The provider reported that model "${model}" reached its per-response output boundary on a ${requestedMaxTokens}-token response chunk. This is not a total task-output limit: UR's agent loop continues automatically while the model makes novel progress. UR_CODE_MAX_OUTPUT_TOKENS may change the chunk size up to the model's verified limit.`;
440583
+ }
440261
440584
  function usesConservativeOutputReservation(provider) {
440262
440585
  return CONSERVATIVE_OUTPUT_PROVIDERS.has(provider);
440263
440586
  }
@@ -440268,6 +440591,7 @@ var init_providerRequestTuning = __esm(() => {
440268
440591
  "lmstudio",
440269
440592
  "llama.cpp",
440270
440593
  "vllm",
440594
+ "unsloth",
440271
440595
  "openai-compatible"
440272
440596
  ]);
440273
440597
  });
@@ -440385,7 +440709,7 @@ __export(exports_evalProvenance, {
440385
440709
  getEvalProvenanceSnapshot: () => getEvalProvenanceSnapshot,
440386
440710
  fingerprintConfigurationPart: () => fingerprintConfigurationPart
440387
440711
  });
440388
- import { createHash as createHash32 } from "crypto";
440712
+ import { createHash as createHash33 } from "crypto";
440389
440713
  function canonicalize2(value, seen = new WeakSet) {
440390
440714
  if (value === null || typeof value !== "object")
440391
440715
  return value;
@@ -440399,7 +440723,7 @@ function canonicalize2(value, seen = new WeakSet) {
440399
440723
  }
440400
440724
  function fingerprintConfigurationPart(value) {
440401
440725
  const canonical = JSON.stringify(canonicalize2(value));
440402
- return createHash32("sha256").update(canonical).digest("hex");
440726
+ return createHash33("sha256").update(canonical).digest("hex");
440403
440727
  }
440404
440728
  function recordEvalConfiguration(config3) {
440405
440729
  const lifecycle = config3.promptLifecycle ?? CURRENT_PROMPT_LIFECYCLE;
@@ -441615,7 +441939,7 @@ ${deferredToolList}
441615
441939
  max_tokens: maxOutputTokens
441616
441940
  });
441617
441941
  yield createAssistantAPIErrorMessage({
441618
- content: `${API_ERROR_MESSAGE_PREFIX}: UR's response exceeded the ${maxOutputTokens} output token maximum. To configure this behavior, set the UR_CODE_MAX_OUTPUT_TOKENS environment variable.`,
441942
+ content: `${API_ERROR_MESSAGE_PREFIX}: ${formatOutputTokenLimitMessage(options2.model, maxOutputTokens)}`,
441619
441943
  apiError: "max_output_tokens",
441620
441944
  error: "max_output_tokens"
441621
441945
  });
@@ -442242,12 +442566,9 @@ function adjustParamsForNonStreaming(params, maxTokensCap) {
442242
442566
  max_tokens: cappedMaxTokens
442243
442567
  };
442244
442568
  }
442245
- function isMaxTokensCapEnabled() {
442246
- return getFeatureValue_CACHED_MAY_BE_STALE("tengu_otk_slot_v1", false);
442247
- }
442248
442569
  function getMaxOutputTokensForModel(model, provider = getRuntimeProvider()) {
442249
442570
  const maxOutputTokens = getModelMaxOutputTokens(model, provider);
442250
- const defaultTokens = usesConservativeOutputReservation(provider) ? Math.min(maxOutputTokens.default, SELF_HOSTED_DEFAULT_MAX_OUTPUT_TOKENS) : isMaxTokensCapEnabled() ? Math.min(maxOutputTokens.default, CAPPED_DEFAULT_MAX_TOKENS) : maxOutputTokens.default;
442571
+ const defaultTokens = usesConservativeOutputReservation(provider) ? Math.min(maxOutputTokens.default, SELF_HOSTED_DEFAULT_MAX_OUTPUT_TOKENS) : maxOutputTokens.default;
442251
442572
  const result = validateBoundedIntEnvVar("UR_CODE_MAX_OUTPUT_TOKENS", process.env.UR_CODE_MAX_OUTPUT_TOKENS, defaultTokens, maxOutputTokens.upperLimit);
442252
442573
  return result.effective;
442253
442574
  }
@@ -449440,11 +449761,11 @@ var init_privateState = __esm(() => {
449440
449761
  });
449441
449762
 
449442
449763
  // src/services/sideChats/sideChatStore.ts
449443
- import { createHash as createHash33, randomUUID as randomUUID36 } from "crypto";
449764
+ import { createHash as createHash34, randomUUID as randomUUID36 } from "crypto";
449444
449765
  import { existsSync as existsSync28, lstatSync as lstatSync7, readdirSync as readdirSync10 } from "fs";
449445
449766
  import { join as join129 } from "path";
449446
449767
  function digest2(value) {
449447
- return `sha256:${createHash33("sha256").update(value).digest("hex")}`;
449768
+ return `sha256:${createHash34("sha256").update(value).digest("hex")}`;
449448
449769
  }
449449
449770
  function stableJson3(value) {
449450
449771
  if (Array.isArray(value))
@@ -449661,7 +449982,7 @@ var init_sideChatStore = __esm(() => {
449661
449982
  MAX_CONTENT_BYTES = 64 * 1024;
449662
449983
  ID_RE = /^[a-zA-Z0-9._-]{1,200}$/;
449663
449984
  DIGEST_RE2 = /^sha256:[a-f0-9]{64}$/;
449664
- GENESIS = `sha256:${createHash33("sha256").update("ur-side-chat-genesis-v1").digest("hex")}`;
449985
+ GENESIS = `sha256:${createHash34("sha256").update("ur-side-chat-genesis-v1").digest("hex")}`;
449665
449986
  });
449666
449987
 
449667
449988
  // src/commands/btw/btw.tsx
@@ -450088,7 +450409,7 @@ function Feedback({
450088
450409
  platform: env2.platform,
450089
450410
  gitRepo: envInfo.isGit,
450090
450411
  terminal: env2.terminal,
450091
- version: "1.84.2",
450412
+ version: "1.84.4",
450092
450413
  transcript: normalizeMessagesForAPI(messages),
450093
450414
  errors: sanitizedErrors,
450094
450415
  lastApiRequest: getLastAPIRequest(),
@@ -450278,7 +450599,7 @@ function Feedback({
450278
450599
  ", ",
450279
450600
  env2.terminal,
450280
450601
  ", v",
450281
- "1.84.2"
450602
+ "1.84.4"
450282
450603
  ]
450283
450604
  }, undefined, true, undefined, this)
450284
450605
  ]
@@ -450384,7 +450705,7 @@ ${sanitizedDescription}
450384
450705
  ` + `**Environment Info**
450385
450706
  ` + `- Platform: ${env2.platform}
450386
450707
  ` + `- Terminal: ${env2.terminal}
450387
- ` + `- Version: ${"1.84.2"}
450708
+ ` + `- Version: ${"1.84.4"}
450388
450709
  ` + `- Feedback ID: ${feedbackId}
450389
450710
  ` + `
450390
450711
  **Errors**
@@ -453494,7 +453815,7 @@ function buildPrimarySection() {
453494
453815
  }, undefined, false, undefined, this);
453495
453816
  return [{
453496
453817
  label: "Version",
453497
- value: "1.84.2"
453818
+ value: "1.84.4"
453498
453819
  }, {
453499
453820
  label: "Session name",
453500
453821
  value: nameValue
@@ -457008,7 +457329,7 @@ function Config({
457008
457329
  }
457009
457330
  }, undefined, false, undefined, this)
457010
457331
  }, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime176.jsxDEV(ChannelDowngradeDialog, {
457011
- currentVersion: "1.84.2",
457332
+ currentVersion: "1.84.4",
457012
457333
  onChoice: (choice) => {
457013
457334
  setShowSubmenu(null);
457014
457335
  setTabsHidden(false);
@@ -457020,7 +457341,7 @@ function Config({
457020
457341
  autoUpdatesChannel: "stable"
457021
457342
  };
457022
457343
  if (choice === "stay") {
457023
- newSettings.minimumVersion = "1.84.2";
457344
+ newSettings.minimumVersion = "1.84.4";
457024
457345
  }
457025
457346
  updateSettingsForSource("userSettings", newSettings);
457026
457347
  setSettingsData((prev_27) => ({
@@ -465337,7 +465658,7 @@ function HelpV2(t0) {
465337
465658
  let t6;
465338
465659
  if ($2[31] !== tabs) {
465339
465660
  t6 = /* @__PURE__ */ jsx_dev_runtime203.jsxDEV(Tabs, {
465340
- title: `UR v${"1.84.2"}`,
465661
+ title: `UR v${"1.84.4"}`,
465341
465662
  color: "professionalBlue",
465342
465663
  defaultTab: "general",
465343
465664
  children: tabs
@@ -466271,7 +466592,7 @@ function buildToolUseContext(tools, readFileStateCache, toolPermissionContext, a
466271
466592
  async function handleInitialize(options2) {
466272
466593
  return {
466273
466594
  name: "UR",
466274
- version: "1.84.2",
466595
+ version: "1.84.4",
466275
466596
  protocolVersion: "0.1.0",
466276
466597
  workspaceRoot: options2.cwd,
466277
466598
  capabilities: {
@@ -483404,7 +483725,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
483404
483725
  return [];
483405
483726
  }
483406
483727
  }
483407
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.84.2") {
483728
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.84.4") {
483408
483729
  if (process.env.USER_TYPE === "ant") {
483409
483730
  const changelog = "";
483410
483731
  if (changelog) {
@@ -483431,7 +483752,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.84.2")
483431
483752
  releaseNotes
483432
483753
  };
483433
483754
  }
483434
- function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.84.2") {
483755
+ function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.84.4") {
483435
483756
  if (process.env.USER_TYPE === "ant") {
483436
483757
  const changelog = "";
483437
483758
  if (changelog) {
@@ -486339,7 +486660,7 @@ function getRecentActivitySync() {
486339
486660
  return cachedActivity;
486340
486661
  }
486341
486662
  function getLogoDisplayData() {
486342
- const version2 = process.env.DEMO_VERSION ?? "1.84.2";
486663
+ const version2 = process.env.DEMO_VERSION ?? "1.84.4";
486343
486664
  const serverUrl = getDirectConnectServerUrl();
486344
486665
  const displayPath = process.env.DEMO_VERSION ? "/code/ur" : getDisplayPath(getCwd());
486345
486666
  const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
@@ -487227,7 +487548,7 @@ function LogoV2() {
487227
487548
  if ($2[2] === Symbol.for("react.memo_cache_sentinel")) {
487228
487549
  t2 = () => {
487229
487550
  const currentConfig = getGlobalConfig();
487230
- if (currentConfig.lastReleaseNotesSeen === "1.84.2") {
487551
+ if (currentConfig.lastReleaseNotesSeen === "1.84.4") {
487231
487552
  return;
487232
487553
  }
487233
487554
  saveGlobalConfig(_temp327);
@@ -487915,12 +488236,12 @@ function LogoV2() {
487915
488236
  return t41;
487916
488237
  }
487917
488238
  function _temp327(current) {
487918
- if (current.lastReleaseNotesSeen === "1.84.2") {
488239
+ if (current.lastReleaseNotesSeen === "1.84.4") {
487919
488240
  return current;
487920
488241
  }
487921
488242
  return {
487922
488243
  ...current,
487923
- lastReleaseNotesSeen: "1.84.2"
488244
+ lastReleaseNotesSeen: "1.84.4"
487924
488245
  };
487925
488246
  }
487926
488247
  function _temp240(s_0) {
@@ -503064,7 +503385,7 @@ var init_guardrails = __esm(() => {
503064
503385
  });
503065
503386
 
503066
503387
  // src/services/agents/agenticCi.ts
503067
- import { createHash as createHash34, randomUUID as randomUUID42 } from "crypto";
503388
+ import { createHash as createHash35, randomUUID as randomUUID42 } from "crypto";
503068
503389
  import {
503069
503390
  existsSync as existsSync37,
503070
503391
  mkdtempSync as mkdtempSync5,
@@ -503548,7 +503869,7 @@ function boundedTail(text2, maxChars = AGENTIC_CI_MAX_LOG_CHARS) {
503548
503869
  return value.length <= maxChars ? value : value.slice(-maxChars);
503549
503870
  }
503550
503871
  function sha2562(value) {
503551
- return createHash34("sha256").update(value).digest("hex");
503872
+ return createHash35("sha256").update(value).digest("hex");
503552
503873
  }
503553
503874
  function containsPath(base2, candidate) {
503554
503875
  const rel = relative36(resolve52(base2), resolve52(candidate));
@@ -504013,7 +504334,7 @@ function compileAgenticCiWorkflow(specName = "default", options2 = {}) {
504013
504334
  if (spec.name !== specName) {
504014
504335
  throw new Error("Agentic CI workflow spec name does not match");
504015
504336
  }
504016
- const packageVersion = options2.packageVersion ?? (typeof MACRO !== "undefined" ? "1.84.2" : "1.84.2");
504337
+ const packageVersion = options2.packageVersion ?? (typeof MACRO !== "undefined" ? "1.84.4" : "1.84.4");
504017
504338
  if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(packageVersion)) {
504018
504339
  throw new Error("invalid ur-agent package version");
504019
504340
  }
@@ -505009,7 +505330,7 @@ runner; \`ur trigger\` is the inbound parser that decides what to run.
505009
505330
  path: ".github/workflows/ur.yml",
505010
505331
  root: "project",
505011
505332
  content: compileAgenticCiWorkflow("default", {
505012
- packageVersion: typeof MACRO !== "undefined" ? "1.84.2" : "1.84.2"
505333
+ packageVersion: typeof MACRO !== "undefined" ? "1.84.4" : "1.84.4"
505013
505334
  })
505014
505335
  },
505015
505336
  {
@@ -505072,7 +505393,7 @@ function value(tokens, flag) {
505072
505393
  return index2 >= 0 ? tokens[index2 + 1] : undefined;
505073
505394
  }
505074
505395
  function cliVersion() {
505075
- return typeof MACRO !== "undefined" ? "1.84.2" : "1.84.2";
505396
+ return typeof MACRO !== "undefined" ? "1.84.4" : "1.84.4";
505076
505397
  }
505077
505398
  function workflowPath(cwd2) {
505078
505399
  return join156(cwd2, ".github", "workflows", "ur-agentic-ci.yml");
@@ -505678,7 +505999,7 @@ var init_agent_templates2 = __esm(() => {
505678
505999
 
505679
506000
  // src/services/agents/a2aCardSignature.ts
505680
506001
  import {
505681
- createHash as createHash35,
506002
+ createHash as createHash36,
505682
506003
  createPrivateKey as createPrivateKey2,
505683
506004
  createPublicKey as createPublicKey2,
505684
506005
  generateKeyPairSync,
@@ -505981,7 +506302,7 @@ function formatA2AV1AgentCard(options2 = {}, pretty = true) {
505981
506302
  var urVersion, researchSnapshotDate = "2026-08-10", coverage2, priorityRoadmap;
505982
506303
  var init_trends = __esm(() => {
505983
506304
  init_a2aCardSignature();
505984
- urVersion = typeof MACRO !== "undefined" ? "1.84.2" : "1.84.2";
506305
+ urVersion = typeof MACRO !== "undefined" ? "1.84.4" : "1.84.4";
505985
506306
  coverage2 = [
505986
506307
  {
505987
506308
  id: "local-runtime",
@@ -511714,7 +512035,7 @@ function createAcpStdioApp(deps) {
511714
512035
  }
511715
512036
  },
511716
512037
  authMethods: [],
511717
- agentInfo: { name: "UR-Nexus", version: "1.84.2" }
512038
+ agentInfo: { name: "UR-Nexus", version: "1.84.4" }
511718
512039
  })).onRequest("authenticate", () => ({})).onRequest("session/new", async (context6) => {
511719
512040
  const result = runtime2.newSession(context6.params.cwd, context6.params.mcpServers, context6.params.additionalDirectories);
511720
512041
  await runtime2.announce({
@@ -511811,7 +512132,7 @@ function createAcpStdioAgent(deps) {
511811
512132
  }
511812
512133
  },
511813
512134
  authMethods: [],
511814
- agentInfo: { name: "UR-Nexus", version: "1.84.2" }
512135
+ agentInfo: { name: "UR-Nexus", version: "1.84.4" }
511815
512136
  });
511816
512137
  return;
511817
512138
  case "authenticate":
@@ -512590,7 +512911,7 @@ var init_connect2 = __esm(() => {
512590
512911
  });
512591
512912
 
512592
512913
  // src/services/agents/scheduler.ts
512593
- import { createHash as createHash36 } from "crypto";
512914
+ import { createHash as createHash37 } from "crypto";
512594
512915
  import { existsSync as existsSync41, mkdirSync as mkdirSync27, unlinkSync as unlinkSync7, writeFileSync as writeFileSync28 } from "fs";
512595
512916
  import { homedir as homedir31 } from "os";
512596
512917
  import { join as join158 } from "path";
@@ -512598,7 +512919,7 @@ function defaultBin() {
512598
512919
  return { file: process.execPath, args: [process.argv[1] ?? ""] };
512599
512920
  }
512600
512921
  function schedulerLabel(cwd2) {
512601
- const hash4 = createHash36("sha1").update(cwd2).digest("hex").slice(0, 8);
512922
+ const hash4 = createHash37("sha1").update(cwd2).digest("hex").slice(0, 8);
512602
512923
  return `com.ur.automation.${hash4}`;
512603
512924
  }
512604
512925
  function detectPlatform() {
@@ -514538,7 +514859,7 @@ import {
514538
514859
  resolve as resolve55,
514539
514860
  sep as sep38
514540
514861
  } from "path";
514541
- import { createHash as createHash37, randomUUID as randomUUID45 } from "crypto";
514862
+ import { createHash as createHash38, randomUUID as randomUUID45 } from "crypto";
514542
514863
  function artifactsDir(cwd2) {
514543
514864
  return join162(cwd2, ".ur", "artifacts");
514544
514865
  }
@@ -514676,7 +514997,7 @@ function pathIsWithin(root2, candidate) {
514676
514997
  return fromRoot === "" || fromRoot !== ".." && !fromRoot.startsWith(`..${sep38}`) && !isAbsolute36(fromRoot);
514677
514998
  }
514678
514999
  function hashFile(path26) {
514679
- const hash4 = createHash37("sha256");
515000
+ const hash4 = createHash38("sha256");
514680
515001
  const fd2 = openSync7(path26, "r");
514681
515002
  const buffer = Buffer.allocUnsafe(1024 * 1024);
514682
515003
  try {
@@ -514722,7 +515043,7 @@ function recordArtifact(cwd2, input2) {
514722
515043
  const sourceFd = openSync7(sourcePath, constants8.O_RDONLY | noFollow);
514723
515044
  let destinationFd;
514724
515045
  let copiedBytes = 0;
514725
- const attachmentHash = createHash37("sha256");
515046
+ const attachmentHash = createHash38("sha256");
514726
515047
  try {
514727
515048
  const openedStat = fstatSync(sourceFd);
514728
515049
  const currentPathStat = lstatSync12(sourcePath);
@@ -519345,11 +519666,11 @@ var init_worktree3 = __esm(() => {
519345
519666
  });
519346
519667
 
519347
519668
  // src/services/agents/auditExport.ts
519348
- import { createHash as createHash38 } from "crypto";
519669
+ import { createHash as createHash39 } from "crypto";
519349
519670
  import { existsSync as existsSync52, readFileSync as readFileSync51 } from "fs";
519350
519671
  import { join as join171 } from "path";
519351
519672
  function chainHash(prev, payload) {
519352
- return createHash38("sha256").update(prev).update(JSON.stringify(payload)).digest("hex");
519673
+ return createHash39("sha256").update(prev).update(JSON.stringify(payload)).digest("hex");
519353
519674
  }
519354
519675
  function readActionsLedger(cwd2) {
519355
519676
  const path26 = join171(cwd2, ".ur", "actions.jsonl");
@@ -519820,7 +520141,7 @@ var init_recipe2 = __esm(() => {
519820
520141
  });
519821
520142
 
519822
520143
  // src/services/agents/arena.ts
519823
- import { createHash as createHash39, randomUUID as randomUUID48 } from "crypto";
520144
+ import { createHash as createHash40, randomUUID as randomUUID48 } from "crypto";
519824
520145
  import {
519825
520146
  existsSync as existsSync56,
519826
520147
  mkdirSync as mkdirSync38,
@@ -520269,7 +520590,7 @@ async function removeWorktree(cwd2, worktree2) {
520269
520590
  rmSync14(worktree2, { recursive: true, force: true });
520270
520591
  }
520271
520592
  function sha2563(value2) {
520272
- return createHash39("sha256").update(value2).digest("hex");
520593
+ return createHash40("sha256").update(value2).digest("hex");
520273
520594
  }
520274
520595
  function sanitizeCandidate(candidate, retainWorktree = false) {
520275
520596
  return {
@@ -520681,7 +521002,7 @@ function createDefaultManagedCloudClient() {
520681
521002
  var init_cloudManagedRunner = () => {};
520682
521003
 
520683
521004
  // src/services/agents/cloudTasks.ts
520684
- import { createHash as createHash40, randomUUID as randomUUID50 } from "crypto";
521005
+ import { createHash as createHash41, randomUUID as randomUUID50 } from "crypto";
520685
521006
  import { spawn as spawn16 } from "child_process";
520686
521007
  import {
520687
521008
  appendFileSync as appendFileSync7,
@@ -521345,7 +521666,7 @@ async function steerCloudTask(cwd2, id, message, options2 = {}) {
521345
521666
  reason: "message must be between 1 byte and 64 KiB"
521346
521667
  };
521347
521668
  }
521348
- const messageSha256 = createHash40("sha256").update(trimmed).digest("hex");
521669
+ const messageSha256 = createHash41("sha256").update(trimmed).digest("hex");
521349
521670
  const reservation = withManifestMutation(cwd2, (manifest) => {
521350
521671
  const task = manifest.tasks.find((candidate) => candidate.id === id);
521351
521672
  if (!task)
@@ -522967,7 +523288,7 @@ var init_sources2 = __esm(() => {
522967
523288
  });
522968
523289
 
522969
523290
  // src/memdir/memoryIntegrity.ts
522970
- import { createHash as createHash41, createHmac as createHmac3 } from "crypto";
523291
+ import { createHash as createHash42, createHmac as createHmac3 } from "crypto";
522971
523292
  import {
522972
523293
  existsSync as existsSync62,
522973
523294
  mkdirSync as mkdirSync42,
@@ -522999,7 +523320,7 @@ function manifestPathFor2(dir) {
522999
523320
  return join182(dir, MANIFEST_NAME);
523000
523321
  }
523001
523322
  function digestOf(content) {
523002
- return createHash41("sha256").update(content).digest("hex");
523323
+ return createHash42("sha256").update(content).digest("hex");
523003
523324
  }
523004
523325
  function listMemoryFiles(dir) {
523005
523326
  if (!existsSync62(dir))
@@ -524623,7 +524944,7 @@ var init_knowledge3 = __esm(() => {
524623
524944
  });
524624
524945
 
524625
524946
  // src/services/agents/crew.ts
524626
- import { createHash as createHash42, randomUUID as randomUUID51 } from "crypto";
524947
+ import { createHash as createHash43, randomUUID as randomUUID51 } from "crypto";
524627
524948
  import {
524628
524949
  existsSync as existsSync65,
524629
524950
  mkdirSync as mkdirSync45,
@@ -524646,7 +524967,7 @@ function sanitizeCrewName(name) {
524646
524967
  return "crew";
524647
524968
  if (normalized.length <= 80)
524648
524969
  return normalized;
524649
- const suffix = createHash42("sha256").update(normalized).digest("hex").slice(0, 10);
524970
+ const suffix = createHash43("sha256").update(normalized).digest("hex").slice(0, 10);
524650
524971
  return `${normalized.slice(0, 69)}-${suffix}`;
524651
524972
  }
524652
524973
  function crewPath(cwd2, name) {
@@ -524975,7 +525296,7 @@ This attempt runs in an isolated git worktree. ` + "Do not push, publish, deploy
524975
525296
  }
524976
525297
  async function ensureWorktree(cwd2, crew, attemptId) {
524977
525298
  const normalizedAttemptId = attemptId.replace(/[^a-zA-Z0-9_-]/g, "-");
524978
- const attemptHash = createHash42("sha256").update(attemptId).digest("hex").slice(0, 10);
525299
+ const attemptHash = createHash43("sha256").update(attemptId).digest("hex").slice(0, 10);
524979
525300
  const safeAttemptId = `${normalizedAttemptId.slice(0, 96)}-${attemptHash}`;
524980
525301
  const path26 = join187(crewDir(cwd2), ".worktrees", `${crew}-${safeAttemptId}`);
524981
525302
  const branch = `ur/crew/${crew}/${safeAttemptId}`;
@@ -527689,7 +528010,7 @@ var init_escalate2 = __esm(() => {
527689
528010
  });
527690
528011
 
527691
528012
  // src/services/agents/learnedPlaybooks.ts
527692
- import { createHash as createHash43 } from "crypto";
528013
+ import { createHash as createHash44 } from "crypto";
527693
528014
  import {
527694
528015
  chmodSync as chmodSync8,
527695
528016
  existsSync as existsSync71,
@@ -527704,7 +528025,7 @@ function storePath(cwd2) {
527704
528025
  return join193(learningDir2(cwd2), "playbooks.json");
527705
528026
  }
527706
528027
  function digest3(value2) {
527707
- return `sha256:${createHash43("sha256").update(JSON.stringify(value2)).digest("hex")}`;
528028
+ return `sha256:${createHash44("sha256").update(JSON.stringify(value2)).digest("hex")}`;
527708
528029
  }
527709
528030
  function emptyStore() {
527710
528031
  return { version: 1, candidates: [] };
@@ -527909,7 +528230,7 @@ function mineLearnedPlaybooks(cwd2, options2 = {}) {
527909
528230
  }));
527910
528231
  generated.push({
527911
528232
  version: 1,
527912
- id: `lp-${createHash43("sha256").update(fingerprint2).digest("hex").slice(0, 16)}`,
528233
+ id: `lp-${createHash44("sha256").update(fingerprint2).digest("hex").slice(0, 16)}`,
527913
528234
  name,
527914
528235
  status: "candidate",
527915
528236
  revision: 1,
@@ -531735,7 +532056,7 @@ function formatTriggerDecision(decision, command5, json2) {
531735
532056
  }
531736
532057
 
531737
532058
  // src/services/agents/triggerReceiver.ts
531738
- import { createHash as createHash44, createHmac as createHmac4, randomUUID as randomUUID53, timingSafeEqual } from "crypto";
532059
+ import { createHash as createHash45, createHmac as createHmac4, randomUUID as randomUUID53, timingSafeEqual } from "crypto";
531739
532060
  import {
531740
532061
  mkdirSync as mkdirSync54,
531741
532062
  readFileSync as readFileSync73,
@@ -531747,7 +532068,7 @@ import {
531747
532068
  } from "http";
531748
532069
  import { dirname as dirname78, join as join199 } from "path";
531749
532070
  function hashIdentifier(value2) {
531750
- return createHash44("sha256").update(value2).digest("hex");
532071
+ return createHash45("sha256").update(value2).digest("hex");
531751
532072
  }
531752
532073
  function constantTimeEqual(actual, expected) {
531753
532074
  if (actual === undefined)
@@ -532572,7 +532893,7 @@ var init_sdk2 = __esm(() => {
532572
532893
  });
532573
532894
 
532574
532895
  // src/services/agents/trajectory.ts
532575
- import { createHash as createHash45 } from "crypto";
532896
+ import { createHash as createHash46 } from "crypto";
532576
532897
  function record2(value2) {
532577
532898
  return value2 && typeof value2 === "object" ? value2 : {};
532578
532899
  }
@@ -532585,7 +532906,7 @@ function normalizeTrajectoryTool(value2) {
532585
532906
  function opaqueId(value2) {
532586
532907
  if (typeof value2 !== "string" || !value2)
532587
532908
  return;
532588
- return createHash45("sha256").update(value2).digest("hex").slice(0, 16);
532909
+ return createHash46("sha256").update(value2).digest("hex").slice(0, 16);
532589
532910
  }
532590
532911
  function contentBlocks(message) {
532591
532912
  const content = record2(message).content;
@@ -536032,7 +536353,7 @@ var init_os2 = __esm(() => {
536032
536353
  });
536033
536354
 
536034
536355
  // src/services/agents/workspaceCoordinator.ts
536035
- import { createHash as createHash46, randomUUID as randomUUID55 } from "crypto";
536356
+ import { createHash as createHash47, randomUUID as randomUUID55 } from "crypto";
536036
536357
  import { existsSync as existsSync81, lstatSync as lstatSync18, realpathSync as realpathSync15, rmSync as rmSync20 } from "fs";
536037
536358
  import { tmpdir as tmpdir21 } from "os";
536038
536359
  import { dirname as dirname80, isAbsolute as isAbsolute44, join as join204, relative as relative47, resolve as resolve64 } from "path";
@@ -536052,7 +536373,7 @@ function assertId(value2, label) {
536052
536373
  throw new Error(`Invalid ${label}: ${value2}`);
536053
536374
  }
536054
536375
  function hash4(value2) {
536055
- return `sha256:${createHash46("sha256").update(value2).digest("hex")}`;
536376
+ return `sha256:${createHash47("sha256").update(value2).digest("hex")}`;
536056
536377
  }
536057
536378
  function stableJson4(value2) {
536058
536379
  if (Array.isArray(value2))
@@ -709288,7 +709609,7 @@ var init_forget2 = __esm(() => {
709288
709609
  });
709289
709610
 
709290
709611
  // src/services/research/researchWorkspace.ts
709291
- import { createHash as createHash47, randomUUID as randomUUID57 } from "crypto";
709612
+ import { createHash as createHash48, randomUUID as randomUUID57 } from "crypto";
709292
709613
  import {
709293
709614
  existsSync as existsSync89,
709294
709615
  mkdirSync as mkdirSync62,
@@ -709598,7 +709919,7 @@ function writeResearchReport(root2, output2, report) {
709598
709919
  return absolute;
709599
709920
  }
709600
709921
  function researchProjectDigest(project2) {
709601
- return createHash47("sha256").update(JSON.stringify(project2)).digest("hex");
709922
+ return createHash48("sha256").update(JSON.stringify(project2)).digest("hex");
709602
709923
  }
709603
709924
  var ID_RE5, MAX_PROJECTS = 1000, MAX_SOURCES = 2000, MAX_FINDINGS = 5000, MAX_QUESTIONS = 2000, MAX_PROJECT_BYTES, SECRET_QUERY_KEY;
709604
709925
  var init_researchWorkspace = __esm(() => {
@@ -725814,7 +726135,7 @@ async function captureMemoryDiagnostics(trigger2, dumpNumber = 0) {
725814
726135
  smapsRollup,
725815
726136
  platform: process.platform,
725816
726137
  nodeVersion: process.version,
725817
- ccVersion: "1.84.2"
726138
+ ccVersion: "1.84.4"
725818
726139
  };
725819
726140
  }
725820
726141
  async function performHeapDump(trigger2 = "manual", dumpNumber = 0) {
@@ -726403,7 +726724,7 @@ var init_bridge_kick = __esm(() => {
726403
726724
  var call153 = async () => {
726404
726725
  return {
726405
726726
  type: "text",
726406
- value: "1.84.2"
726727
+ value: "1.84.4"
726407
726728
  };
726408
726729
  }, version2, version_default;
726409
726730
  var init_version = __esm(() => {
@@ -738297,7 +738618,7 @@ function generateHtmlReport(data, insights) {
738297
738618
  </html>`;
738298
738619
  }
738299
738620
  function buildExportData(data, insights, facets, remoteStats) {
738300
- const version3 = typeof MACRO !== "undefined" ? "1.84.2" : "unknown";
738621
+ const version3 = typeof MACRO !== "undefined" ? "1.84.4" : "unknown";
738301
738622
  const remote_hosts_collected = remoteStats?.hosts.filter((h2) => h2.sessionCount > 0).map((h2) => h2.name);
738302
738623
  const facets_summary = {
738303
738624
  total: facets.size,
@@ -742612,7 +742933,7 @@ var init_sessionStorage = __esm(() => {
742612
742933
  init_settings2();
742613
742934
  init_slowOperations();
742614
742935
  init_uuid();
742615
- VERSION7 = typeof MACRO !== "undefined" ? "1.84.2" : "unknown";
742936
+ VERSION7 = typeof MACRO !== "undefined" ? "1.84.4" : "unknown";
742616
742937
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
742617
742938
  SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
742618
742939
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -743827,7 +744148,7 @@ var init_filesystem = __esm(() => {
743827
744148
  });
743828
744149
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
743829
744150
  const nonce = randomBytes23(16).toString("hex");
743830
- return join234(getURTempDir(), "bundled-skills", "1.84.2", nonce);
744151
+ return join234(getURTempDir(), "bundled-skills", "1.84.4", nonce);
743831
744152
  });
743832
744153
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
743833
744154
  });
@@ -762303,11 +762624,11 @@ __export(exports_openrouter, {
762303
762624
  });
762304
762625
  import { randomUUID as randomUUID66 } from "crypto";
762305
762626
  async function createOpenRouterClient(options5) {
762306
- const { apiKey, baseUrl, maxRetries } = options5;
762627
+ const { apiKey, baseUrl, maxRetries, openrouter } = options5;
762307
762628
  const endpoint = normalizeProviderEndpoint(baseUrl, "https://openrouter.ai/api/v1", "/chat/completions");
762308
762629
  async function doRequest(params, requestOptions) {
762309
762630
  const clientRequestId = params?.headers?.["x-client-request-id"];
762310
- const response = await axiosPostWithProviderReliability(endpoint, toOpenAICompatibleRequest(params, "openrouter"), {
762631
+ const response = await axiosPostWithProviderReliability(endpoint, toOpenAICompatibleRequest(params, "openrouter", { openrouter }), {
762311
762632
  headers: {
762312
762633
  "Content-Type": "application/json",
762313
762634
  Authorization: `Bearer ${apiKey}`,
@@ -762331,7 +762652,7 @@ async function createOpenRouterClient(options5) {
762331
762652
  const clientRequestId = params?.headers?.["x-client-request-id"];
762332
762653
  const streamController = controller ?? new AbortController;
762333
762654
  const signal = mergeAbortSignals([requestOptions?.signal, streamController.signal]);
762334
- const response = await axiosPostWithProviderReliability(endpoint, toOpenAICompatibleRequest({ ...params, stream: true }, "openrouter"), {
762655
+ const response = await axiosPostWithProviderReliability(endpoint, toOpenAICompatibleRequest({ ...params, stream: true }, "openrouter", { openrouter }), {
762335
762656
  headers: {
762336
762657
  "Content-Type": "application/json",
762337
762658
  Authorization: `Bearer ${apiKey}`,
@@ -764642,7 +764963,8 @@ async function createAPIClient(providerId, options5 = {}) {
764642
764963
  apiKey,
764643
764964
  baseUrl: resolveProviderBaseUrl(providerId, settings),
764644
764965
  maxRetries: options5.maxRetries ?? 3,
764645
- model: options5.model
764966
+ model: options5.model,
764967
+ openrouter: providerSettings.openrouter
764646
764968
  });
764647
764969
  }
764648
764970
  if (providerId === "openai-api" && providerSettings.active === providerId && providerSettings.openaiTransport === "responses") {
@@ -764921,12 +765243,12 @@ function calculateContextPercentages(currentUsage, contextWindowSize) {
764921
765243
  }
764922
765244
  function getModelMaxOutputTokens(model, provider, settings) {
764923
765245
  let defaultTokens = MAX_OUTPUT_TOKENS_DEFAULT;
764924
- let upperLimit = MAX_OUTPUT_TOKENS_UPPER_LIMIT;
765246
+ let upperLimit = UNKNOWN_MODEL_OUTPUT_TOKENS_UPPER_LIMIT;
764925
765247
  if (process.env.USER_TYPE === "ant") {
764926
765248
  const antModel = resolveAntModel(model.toLowerCase());
764927
765249
  if (antModel) {
764928
765250
  defaultTokens = antModel.defaultMaxTokens ?? MAX_OUTPUT_TOKENS_DEFAULT;
764929
- upperLimit = antModel.upperMaxTokensLimit ?? MAX_OUTPUT_TOKENS_UPPER_LIMIT;
765251
+ upperLimit = antModel.upperMaxTokensLimit ?? UNKNOWN_MODEL_OUTPUT_TOKENS_UPPER_LIMIT;
764930
765252
  return { default: defaultTokens, upperLimit };
764931
765253
  }
764932
765254
  }
@@ -764937,7 +765259,7 @@ function getModelMaxOutputTokens(model, provider, settings) {
764937
765259
  }
764938
765260
  const providerOutputLimit = getProviderOutputTokenLimitForModel(model, provider, settings);
764939
765261
  if (providerOutputLimit !== undefined) {
764940
- upperLimit = Math.min(upperLimit, providerOutputLimit);
765262
+ upperLimit = cap?.max_tokens ? Math.min(upperLimit, providerOutputLimit) : providerOutputLimit;
764941
765263
  defaultTokens = Math.min(defaultTokens, upperLimit);
764942
765264
  }
764943
765265
  return { default: defaultTokens, upperLimit };
@@ -764945,7 +765267,7 @@ function getModelMaxOutputTokens(model, provider, settings) {
764945
765267
  function getMaxThinkingTokensForModel(model) {
764946
765268
  return getModelMaxOutputTokens(model).upperLimit - 1;
764947
765269
  }
764948
- var MODEL_CONTEXT_WINDOW_DEFAULT = 200000, COMPACT_MAX_OUTPUT_TOKENS = 20000, MAX_OUTPUT_TOKENS_DEFAULT = 32000, MAX_OUTPUT_TOKENS_UPPER_LIMIT = 64000, CAPPED_DEFAULT_MAX_TOKENS = 8000, ESCALATED_MAX_TOKENS = 64000;
765270
+ var MODEL_CONTEXT_WINDOW_DEFAULT = 200000, COMPACT_MAX_OUTPUT_TOKENS = 20000, MAX_OUTPUT_TOKENS_DEFAULT = 32000, UNKNOWN_MODEL_OUTPUT_TOKENS_UPPER_LIMIT = 64000;
764949
765271
  var init_context4 = __esm(() => {
764950
765272
  init_betas();
764951
765273
  init_providerRegistry();
@@ -775622,7 +775944,7 @@ function getUserAgent() {
775622
775944
  const clientApp = process.env.UR_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.UR_AGENT_SDK_CLIENT_APP}` : "";
775623
775945
  const workload = getWorkload();
775624
775946
  const workloadSuffix = workload ? `, workload/${workload}` : "";
775625
- return `ur-cli/${"1.84.2"} (${process.env.USER_TYPE}, ${process.env.UR_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
775947
+ return `ur-cli/${"1.84.4"} (${process.env.USER_TYPE}, ${process.env.UR_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
775626
775948
  }
775627
775949
  function getMCPUserAgent() {
775628
775950
  const parts = [];
@@ -775636,7 +775958,7 @@ function getMCPUserAgent() {
775636
775958
  parts.push(`client-app/${process.env.UR_AGENT_SDK_CLIENT_APP}`);
775637
775959
  }
775638
775960
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
775639
- return `ur/${"1.84.2"}${suffix}`;
775961
+ return `ur/${"1.84.4"}${suffix}`;
775640
775962
  }
775641
775963
  function getWebFetchUserAgent() {
775642
775964
  return `UR-User (${getURCodeUserAgent()})`;
@@ -777349,12 +777671,12 @@ var init_oauth2 = __esm(() => {
777349
777671
  });
777350
777672
 
777351
777673
  // src/utils/secureStorage/macOsKeychainHelpers.ts
777352
- import { createHash as createHash48 } from "crypto";
777674
+ import { createHash as createHash49 } from "crypto";
777353
777675
  import { userInfo as userInfo3 } from "os";
777354
777676
  function getMacOsKeychainStorageServiceName(serviceSuffix = "") {
777355
777677
  const configDir = getURConfigHomeDir();
777356
777678
  const isDefaultDir = !process.env.UR_CONFIG_DIR;
777357
- const dirHash = isDefaultDir ? "" : `-${createHash48("sha256").update(configDir).digest("hex").substring(0, 8)}`;
777679
+ const dirHash = isDefaultDir ? "" : `-${createHash49("sha256").update(configDir).digest("hex").substring(0, 8)}`;
777358
777680
  return `UR${getOauthConfig().OAUTH_FILE_SUFFIX}${serviceSuffix}${dirHash}`;
777359
777681
  }
777360
777682
  function getUsername2() {
@@ -777926,7 +778248,7 @@ import {
777926
778248
  writeFileSync as writeFileSync73
777927
778249
  } from "fs";
777928
778250
  import { isAbsolute as isAbsolute55, join as join245, relative as relative65, resolve as resolve76, sep as sep51 } from "path";
777929
- import { createHash as createHash49, randomUUID as randomUUID70 } from "crypto";
778251
+ import { createHash as createHash50, randomUUID as randomUUID70 } from "crypto";
777930
778252
  function now6() {
777931
778253
  return new Date().toISOString();
777932
778254
  }
@@ -778220,7 +778542,7 @@ function steerBackgroundTask(cwd2, id, text2, source) {
778220
778542
  reason: "message must be between 1 byte and 64 KiB"
778221
778543
  };
778222
778544
  }
778223
- const messageSha256 = createHash49("sha256").update(message).digest("hex");
778545
+ const messageSha256 = createHash50("sha256").update(message).digest("hex");
778224
778546
  ensureDirs2(task2.cwd);
778225
778547
  const lockPath2 = `${task2.inboxFile}.lock`;
778226
778548
  writeFileSync73(lockPath2, "", { flag: "a", mode: 384 });
@@ -778915,7 +779237,7 @@ async function establishPrTrust(task2, cwd2) {
778915
779237
  return {
778916
779238
  originUrl,
778917
779239
  repository,
778918
- configDigest: createHash49("sha256").update(config4).digest("hex"),
779240
+ configDigest: createHash50("sha256").update(config4).digest("hex"),
778919
779241
  baseHead
778920
779242
  };
778921
779243
  }
@@ -778927,7 +779249,7 @@ async function validatePrTrust(task2, cwd2) {
778927
779249
  const originUrl = await readPrTrustValue(task2, cwd2, ["remote", "get-url", "--push", "origin"]);
778928
779250
  const config4 = await readPrTrustValue(task2, cwd2, ["config", "--null", "--list", "--show-origin"]);
778929
779251
  const branch2 = await readPrTrustValue(task2, cwd2, ["symbolic-ref", "--quiet", "--short", "HEAD"]);
778930
- const configDigest = createHash49("sha256").update(config4).digest("hex");
779252
+ const configDigest = createHash50("sha256").update(config4).digest("hex");
778931
779253
  if (originUrl !== trust.originUrl || githubRepositoryFromRemote(originUrl) !== trust.repository || configDigest !== trust.configDigest || branch2 !== task2.branch) {
778932
779254
  throw new Error("Repository trust state changed during the background run; refusing to publish.");
778933
779255
  }
@@ -779240,7 +779562,7 @@ __export(exports_delegation, {
779240
779562
  attenuateDelegationToken: () => attenuateDelegationToken
779241
779563
  });
779242
779564
  import {
779243
- createHash as createHash50,
779565
+ createHash as createHash51,
779244
779566
  createHmac as createHmac5,
779245
779567
  randomUUID as randomUUID71,
779246
779568
  timingSafeEqual as timingSafeEqual2
@@ -779258,8 +779580,8 @@ function sign2(secret, payload) {
779258
779580
  return createHmac5("sha256", secret).update(payload).digest("base64url");
779259
779581
  }
779260
779582
  function constantTimeStringEqual(a2, b) {
779261
- const left = createHash50("sha256").update(a2, "utf8").digest();
779262
- const right = createHash50("sha256").update(b, "utf8").digest();
779583
+ const left = createHash51("sha256").update(a2, "utf8").digest();
779584
+ const right = createHash51("sha256").update(b, "utf8").digest();
779263
779585
  return timingSafeEqual2(left, right);
779264
779586
  }
779265
779587
  function normalizeScope(scope) {
@@ -785778,7 +786100,7 @@ var init_a2aPushNotifications = __esm(() => {
785778
786100
  });
785779
786101
 
785780
786102
  // src/services/agents/a2aProtocol.ts
785781
- import { createHash as createHash51, randomUUID as randomUUID73 } from "crypto";
786103
+ import { createHash as createHash52, randomUUID as randomUUID73 } from "crypto";
785782
786104
  import {
785783
786105
  existsSync as existsSync103,
785784
786106
  mkdirSync as mkdirSync72,
@@ -785994,7 +786316,7 @@ class PersistentA2ATaskStore {
785994
786316
  async listVisible(params, context6) {
785995
786317
  const owner2 = ownerFromContext(context6);
785996
786318
  const identity5 = identityFromContext(context6);
785997
- const filterKey = createHash51("sha256").update(JSON.stringify({
786319
+ const filterKey = createHash52("sha256").update(JSON.stringify({
785998
786320
  owner: owner2,
785999
786321
  contextId: params.contextId ?? null,
786000
786322
  status: params.status ?? null,
@@ -786514,7 +786836,7 @@ var init_a2aProtocol = __esm(() => {
786514
786836
  });
786515
786837
 
786516
786838
  // src/services/agents/a2aV1.ts
786517
- import { createHash as createHash52 } from "crypto";
786839
+ import { createHash as createHash53 } from "crypto";
786518
786840
  function errorDetails2(error61) {
786519
786841
  if (error61.details?.length)
786520
786842
  return error61.details;
@@ -786645,7 +786967,7 @@ function validateA2AV1Tenant(value2) {
786645
786967
  function namespaceA2AV1Identity(identity5, tenant2, requestedSkill2) {
786646
786968
  return {
786647
786969
  ...identity5,
786648
- userName: tenant2 ? `a2a-v1-tenant:${createHash52("sha256").update(`${tenant2}\x00${identity5.userName}`).digest("base64url")}` : identity5.userName,
786970
+ userName: tenant2 ? `a2a-v1-tenant:${createHash53("sha256").update(`${tenant2}\x00${identity5.userName}`).digest("base64url")}` : identity5.userName,
786649
786971
  ...requestedSkill2 ? { requestedSkill: requestedSkill2 } : {}
786650
786972
  };
786651
786973
  }
@@ -786959,7 +787281,7 @@ __export(exports_a2aServer, {
786959
787281
  handleA2ARequest: () => handleA2ARequest,
786960
787282
  authorizeRequest: () => authorizeRequest
786961
787283
  });
786962
- import { createHash as createHash53, randomUUID as randomUUID74 } from "crypto";
787284
+ import { createHash as createHash54, randomUUID as randomUUID74 } from "crypto";
786963
787285
  import {
786964
787286
  existsSync as existsSync104,
786965
787287
  mkdirSync as mkdirSync73,
@@ -787072,7 +787394,7 @@ function isAsyncIterable(value2) {
787072
787394
  }
787073
787395
  function agentCardResponse(card, version3, request) {
787074
787396
  const payload = JSON.stringify(card, null, 2);
787075
- const etag = `"${createHash53("sha256").update(payload).digest("base64url")}"`;
787397
+ const etag = `"${createHash54("sha256").update(payload).digest("base64url")}"`;
787076
787398
  const notModified = request?.headers.get("if-none-match") === etag;
787077
787399
  return new Response(notModified ? null : payload, {
787078
787400
  status: notModified ? 304 : 200,
@@ -792799,7 +793121,7 @@ function buildSystemInitMessage(inputs) {
792799
793121
  slash_commands: inputs.commands.filter((c4) => c4.userInvocable !== false).map((c4) => c4.name),
792800
793122
  apiKeySource: getURHQApiKeyWithSource().source,
792801
793123
  betas: getSdkBetas(),
792802
- ur_version: "1.84.2",
793124
+ ur_version: "1.84.4",
792803
793125
  output_style: outputStyle,
792804
793126
  agents: inputs.agents.map((agent2) => agent2.agentType),
792805
793127
  skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill2) => skill2.name),
@@ -796340,7 +796662,7 @@ var init_useVoiceEnabled = __esm(() => {
796340
796662
  function getSemverPart(version3) {
796341
796663
  return `${import_semver13.major(version3, { loose: true })}.${import_semver13.minor(version3, { loose: true })}.${import_semver13.patch(version3, { loose: true })}`;
796342
796664
  }
796343
- function useUpdateNotification(updatedVersion, initialVersion = "1.84.2") {
796665
+ function useUpdateNotification(updatedVersion, initialVersion = "1.84.4") {
796344
796666
  const [lastNotifiedSemver, setLastNotifiedSemver] = import_react225.useState(() => getSemverPart(initialVersion));
796345
796667
  if (!updatedVersion) {
796346
796668
  return null;
@@ -796389,7 +796711,7 @@ function AutoUpdater({
796389
796711
  return;
796390
796712
  }
796391
796713
  if (false) {}
796392
- const currentVersion = "1.84.2";
796714
+ const currentVersion = "1.84.4";
796393
796715
  const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
796394
796716
  let latestVersion = await getLatestVersion(channel);
796395
796717
  const isDisabled = isAutoUpdaterDisabled();
@@ -796618,12 +796940,12 @@ function NativeAutoUpdater({
796618
796940
  logEvent("tengu_native_auto_updater_start", {});
796619
796941
  try {
796620
796942
  const maxVersion = await getMaxVersion();
796621
- if (maxVersion && gt("1.84.2", maxVersion)) {
796943
+ if (maxVersion && gt("1.84.4", maxVersion)) {
796622
796944
  const msg = await getMaxVersionMessage();
796623
796945
  setMaxVersionIssue(msg ?? "affects your version");
796624
796946
  }
796625
796947
  const result = await installLatest(channel);
796626
- const currentVersion = "1.84.2";
796948
+ const currentVersion = "1.84.4";
796627
796949
  const latencyMs = Date.now() - startTime;
796628
796950
  if (result.lockFailed) {
796629
796951
  logEvent("tengu_native_auto_updater_lock_contention", {
@@ -796760,17 +797082,17 @@ function PackageManagerAutoUpdater(t0) {
796760
797082
  const maxVersion = await getMaxVersion();
796761
797083
  if (maxVersion && latest && gt(latest, maxVersion)) {
796762
797084
  logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
796763
- if (gte("1.84.2", maxVersion)) {
796764
- logForDebugging(`PackageManagerAutoUpdater: current version ${"1.84.2"} is already at or above maxVersion ${maxVersion}, skipping update`);
797085
+ if (gte("1.84.4", maxVersion)) {
797086
+ logForDebugging(`PackageManagerAutoUpdater: current version ${"1.84.4"} is already at or above maxVersion ${maxVersion}, skipping update`);
796765
797087
  setUpdateAvailable(false);
796766
797088
  return;
796767
797089
  }
796768
797090
  latest = maxVersion;
796769
797091
  }
796770
- const hasUpdate = latest && !gte("1.84.2", latest) && !shouldSkipVersion(latest);
797092
+ const hasUpdate = latest && !gte("1.84.4", latest) && !shouldSkipVersion(latest);
796771
797093
  setUpdateAvailable(!!hasUpdate);
796772
797094
  if (hasUpdate) {
796773
- logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.84.2"} -> ${latest}`);
797095
+ logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.84.4"} -> ${latest}`);
796774
797096
  }
796775
797097
  };
796776
797098
  $2[0] = t1;
@@ -796804,7 +797126,7 @@ function PackageManagerAutoUpdater(t0) {
796804
797126
  wrap: "truncate",
796805
797127
  children: [
796806
797128
  "currentVersion: ",
796807
- "1.84.2"
797129
+ "1.84.4"
796808
797130
  ]
796809
797131
  }, undefined, true, undefined, this);
796810
797132
  $2[3] = verbose;
@@ -807653,7 +807975,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
807653
807975
  project_dir: getOriginalCwd(),
807654
807976
  added_dirs: addedDirs
807655
807977
  },
807656
- version: "1.84.2",
807978
+ version: "1.84.4",
807657
807979
  output_style: {
807658
807980
  name: outputStyleName
807659
807981
  },
@@ -807788,7 +808110,7 @@ function StatusLineInner({
807788
808110
  const attention = customStatusError ?? taskAttention;
807789
808111
  const terminalSize = React138.useContext(TerminalSizeContext);
807790
808112
  const defaultStatusLineText = buildDefaultStatusBar({
807791
- version: "1.84.2",
808113
+ version: "1.84.4",
807792
808114
  providerLabel: providerRuntime.providerLabel,
807793
808115
  authMode: providerRuntime.authLabel,
807794
808116
  model: renderModelName(mainLoopModel) || providerRuntime.model || "",
@@ -820179,7 +820501,7 @@ async function submitTranscriptShare(messages, trigger2, appearanceId) {
820179
820501
  } catch {}
820180
820502
  const data = {
820181
820503
  trigger: trigger2,
820182
- version: "1.84.2",
820504
+ version: "1.84.4",
820183
820505
  platform: process.platform,
820184
820506
  transcript,
820185
820507
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -832561,7 +832883,7 @@ function WelcomeV2() {
832561
832883
  dimColor: true,
832562
832884
  children: [
832563
832885
  "v",
832564
- "1.84.2"
832886
+ "1.84.4"
832565
832887
  ]
832566
832888
  }, undefined, true, undefined, this)
832567
832889
  ]
@@ -833807,7 +834129,7 @@ function completeOnboarding() {
833807
834129
  saveGlobalConfig((current) => ({
833808
834130
  ...current,
833809
834131
  hasCompletedOnboarding: true,
833810
- lastOnboardingVersion: "1.84.2"
834132
+ lastOnboardingVersion: "1.84.4"
833811
834133
  }));
833812
834134
  }
833813
834135
  function showDialog(root2, renderer) {
@@ -838804,7 +839126,7 @@ function appendToLog(path28, message) {
838804
839126
  cwd: getFsImplementation().cwd(),
838805
839127
  userType: process.env.USER_TYPE,
838806
839128
  sessionId: getSessionId(),
838807
- version: "1.84.2"
839129
+ version: "1.84.4"
838808
839130
  };
838809
839131
  getLogWriter(path28).write(messageWithTimestamp);
838810
839132
  }
@@ -842967,8 +843289,8 @@ async function getEnvLessBridgeConfig() {
842967
843289
  }
842968
843290
  async function checkEnvLessBridgeMinVersion() {
842969
843291
  const cfg = await getEnvLessBridgeConfig();
842970
- if (cfg.min_version && lt("1.84.2", cfg.min_version)) {
842971
- return `Your version of UR (${"1.84.2"}) is too old for Remote Control.
843292
+ if (cfg.min_version && lt("1.84.4", cfg.min_version)) {
843293
+ return `Your version of UR (${"1.84.4"}) is too old for Remote Control.
842972
843294
  Version ${cfg.min_version} or higher is required. Run \`ur update\` to update.`;
842973
843295
  }
842974
843296
  return null;
@@ -843442,7 +843764,7 @@ async function initBridgeCore(params) {
843442
843764
  const rawApi = createBridgeApiClient({
843443
843765
  baseUrl,
843444
843766
  getAccessToken,
843445
- runnerVersion: "1.84.2",
843767
+ runnerVersion: "1.84.4",
843446
843768
  onDebug: logForDebugging,
843447
843769
  onAuth401,
843448
843770
  getTrustedDeviceToken
@@ -856763,7 +857085,7 @@ __export(exports_agUi, {
856763
857085
  getAgUiCapabilities: () => getAgUiCapabilities,
856764
857086
  createAgUiHttpHandler: () => createAgUiHttpHandler
856765
857087
  });
856766
- import { createHash as createHash54 } from "crypto";
857088
+ import { createHash as createHash55 } from "crypto";
856767
857089
  function isLoopback4(host) {
856768
857090
  const normalized = host.toLowerCase();
856769
857091
  return normalized === "127.0.0.1" || normalized === "localhost" || normalized === "::1" || normalized === "0:0:0:0:0:0:0:1";
@@ -856820,7 +857142,7 @@ function authenticate2(request, token) {
856820
857142
  }
856821
857143
  return {
856822
857144
  ok: true,
856823
- owner: `bearer:${createHash54("sha256").update(supplied).digest("base64url")}`
857145
+ owner: `bearer:${createHash55("sha256").update(supplied).digest("base64url")}`
856824
857146
  };
856825
857147
  }
856826
857148
  function allowedOrigin(request, allowedOrigins2) {
@@ -856884,7 +857206,7 @@ function getAgUiCapabilities() {
856884
857206
  name: "UR-Nexus",
856885
857207
  type: "ur-nexus",
856886
857208
  description: "Provider-flexible, local-first autonomous engineering workflow agent.",
856887
- version: "1.84.2",
857209
+ version: "1.84.4",
856888
857210
  provider: "UR",
856889
857211
  documentationUrl: "https://github.com/Maitham16/UR/blob/master/docs/AG_UI.md"
856890
857212
  },
@@ -857704,7 +858026,7 @@ function createMCPServer(cwd4, debug2, verbose) {
857704
858026
  };
857705
858027
  const server2 = new Server({
857706
858028
  name: "ur-nexus",
857707
- version: "1.84.2"
858029
+ version: "1.84.4"
857708
858030
  }, {
857709
858031
  capabilities: {
857710
858032
  tools: {}
@@ -858762,7 +859084,7 @@ __export(exports_mcp2026, {
858762
859084
  createUrMcp2026Runtime: () => createUrMcp2026Runtime,
858763
859085
  createMcp2026HttpHandler: () => createMcp2026HttpHandler
858764
859086
  });
858765
- import { createHash as createHash55 } from "crypto";
859087
+ import { createHash as createHash56 } from "crypto";
858766
859088
  function isRecord9(value2) {
858767
859089
  return Boolean(value2) && typeof value2 === "object" && !Array.isArray(value2);
858768
859090
  }
@@ -858803,7 +859125,7 @@ function authenticate3(request, token) {
858803
859125
  }
858804
859126
  return {
858805
859127
  ok: true,
858806
- owner: `bearer:${createHash55("sha256").update(supplied).digest("base64url")}`
859128
+ owner: `bearer:${createHash56("sha256").update(supplied).digest("base64url")}`
858807
859129
  };
858808
859130
  }
858809
859131
  function response(status2, body, origin2, extraHeaders = {}) {
@@ -858907,7 +859229,7 @@ function thrownResponse(error61) {
858907
859229
  }
858908
859230
  async function createUrMcp2026Runtime(options5) {
858909
859231
  const server2 = createMCPServer(options5.cwd, options5.debug === true, options5.verbose === true);
858910
- const client2 = new Client({ name: "ur-mcp-2026-adapter", version: "1.84.2" }, { capabilities: {} });
859232
+ const client2 = new Client({ name: "ur-mcp-2026-adapter", version: "1.84.4" }, { capabilities: {} });
858911
859233
  const [clientTransport, serverTransport] = createLinkedTransportPair();
858912
859234
  try {
858913
859235
  await server2.connect(serverTransport);
@@ -858918,7 +859240,7 @@ async function createUrMcp2026Runtime(options5) {
858918
859240
  }
858919
859241
  const runtime2 = new Mcp2026Runtime({
858920
859242
  cwd: options5.cwd,
858921
- version: "1.84.2",
859243
+ version: "1.84.4",
858922
859244
  backend: {
858923
859245
  listTools: async () => {
858924
859246
  const listed = await client2.listTools();
@@ -859841,6 +860163,13 @@ var init_providers2 = __esm(() => {
859841
860163
  "responses.store",
859842
860164
  "responses.compact_threshold",
859843
860165
  "responses.tool_search",
860166
+ "openrouter.routing",
860167
+ "openrouter.allow_fallbacks",
860168
+ "openrouter.require_parameters",
860169
+ "openrouter.preferred_min_throughput",
860170
+ "openrouter.preferred_max_latency",
860171
+ "openrouter.service_tier",
860172
+ "openrouter.speed",
859844
860173
  "model",
859845
860174
  "base_url"
859846
860175
  ];
@@ -859901,6 +860230,41 @@ function providerConfigEntries() {
859901
860230
  value: configured.responses?.toolSearch ?? null,
859902
860231
  category: "provider"
859903
860232
  },
860233
+ {
860234
+ key: "openrouter.routing",
860235
+ value: configured.openrouter?.routing ?? "auto",
860236
+ category: "provider"
860237
+ },
860238
+ {
860239
+ key: "openrouter.allow_fallbacks",
860240
+ value: configured.openrouter?.allowFallbacks ?? true,
860241
+ category: "provider"
860242
+ },
860243
+ {
860244
+ key: "openrouter.require_parameters",
860245
+ value: configured.openrouter?.requireParameters ?? null,
860246
+ category: "provider"
860247
+ },
860248
+ {
860249
+ key: "openrouter.preferred_min_throughput",
860250
+ value: configured.openrouter?.preferredMinThroughput ?? null,
860251
+ category: "provider"
860252
+ },
860253
+ {
860254
+ key: "openrouter.preferred_max_latency",
860255
+ value: configured.openrouter?.preferredMaxLatency ?? null,
860256
+ category: "provider"
860257
+ },
860258
+ {
860259
+ key: "openrouter.service_tier",
860260
+ value: configured.openrouter?.serviceTier ?? "auto",
860261
+ category: "provider"
860262
+ },
860263
+ {
860264
+ key: "openrouter.speed",
860265
+ value: configured.openrouter?.speed ?? "standard",
860266
+ category: "provider"
860267
+ },
859904
860268
  { key: "model", value: active3.model ?? null, category: "provider" },
859905
860269
  { key: "base_url", value: active3.baseUrl ?? null, category: "provider" }
859906
860270
  ];
@@ -861754,7 +862118,7 @@ async function update() {
861754
862118
  logEvent("tengu_update_check", {});
861755
862119
  const diagnostic2 = await getDoctorDiagnostic();
861756
862120
  const result = await checkUpgradeStatus({
861757
- currentVersion: "1.84.2",
862121
+ currentVersion: "1.84.4",
861758
862122
  packageName: UR_AGENT_PACKAGE_NAME,
861759
862123
  installationType: diagnostic2.installationType,
861760
862124
  latestVersion: () => getLatestNpmPackageVersion(UR_AGENT_PACKAGE_NAME)
@@ -863082,7 +863446,7 @@ ${customInstructions}` : customInstructions;
863082
863446
  }
863083
863447
  }
863084
863448
  logForDiagnosticsNoPII("info", "started", {
863085
- version: "1.84.2",
863449
+ version: "1.84.4",
863086
863450
  is_native_binary: isInBundledMode()
863087
863451
  });
863088
863452
  registerCleanup(async () => {
@@ -863869,7 +864233,7 @@ Usage: ur --remote "your task description"`, () => gracefulShutdown(1));
863869
864233
  pendingHookMessages
863870
864234
  }, renderAndRun);
863871
864235
  }
863872
- }).version("1.84.2 (UR-Nexus)", "-v, --version", "Output the version number");
864236
+ }).version("1.84.4 (UR-Nexus)", "-v, --version", "Output the version number");
863873
864237
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
863874
864238
  program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
863875
864239
  if (canUserConfigureAdvisor()) {
@@ -864996,7 +865360,7 @@ if (false) {}
864996
865360
  async function main2() {
864997
865361
  const args = process.argv.slice(2);
864998
865362
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
864999
- console.log(`${"1.84.2"} (UR-Nexus)`);
865363
+ console.log(`${"1.84.4"} (UR-Nexus)`);
865000
865364
  return;
865001
865365
  }
865002
865366
  if (args[0] === "a2a" && args[1] === "serve" && !args.includes("--help") && !args.includes("-h")) {