ur-agent 1.81.1 → 1.81.3

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
@@ -53073,6 +53073,25 @@ function asCount(value) {
53073
53073
  function isRecord(value) {
53074
53074
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
53075
53075
  }
53076
+ function parseModelReasoningCapabilities(value) {
53077
+ if (!isRecord(value))
53078
+ return;
53079
+ const supportedEfforts = value.supported_efforts === null ? null : Array.isArray(value.supported_efforts) ? Array.from(new Set(value.supported_efforts.filter((entry) => typeof entry === "string").map((entry) => entry.trim().toLowerCase()).filter(Boolean))) : undefined;
53080
+ const defaultEffort = asString(value.default_effort)?.toLowerCase();
53081
+ const defaultEnabled = typeof value.default_enabled === "boolean" ? value.default_enabled : undefined;
53082
+ const mandatory = typeof value.mandatory === "boolean" ? value.mandatory : undefined;
53083
+ const supportsMaxTokens = typeof value.supports_max_tokens === "boolean" ? value.supports_max_tokens : undefined;
53084
+ if (supportedEfforts === undefined && defaultEffort === undefined && defaultEnabled === undefined && mandatory === undefined && supportsMaxTokens === undefined) {
53085
+ return;
53086
+ }
53087
+ return {
53088
+ ...supportedEfforts !== undefined ? { supportedEfforts } : {},
53089
+ ...defaultEffort !== undefined ? { defaultEffort } : {},
53090
+ ...defaultEnabled !== undefined ? { defaultEnabled } : {},
53091
+ ...mandatory !== undefined ? { mandatory } : {},
53092
+ ...supportsMaxTokens !== undefined ? { supportsMaxTokens } : {}
53093
+ };
53094
+ }
53076
53095
  function asEpochSeconds(value) {
53077
53096
  if (typeof value === "number" && Number.isFinite(value) && value > 0) {
53078
53097
  return Math.floor(value);
@@ -53144,6 +53163,7 @@ function toDiscoveredModel(entry, providerLabel) {
53144
53163
  const humanName = asString(raw.display_name) ?? asString(raw.displayName) ?? asString(raw.name);
53145
53164
  const supportedParameters = Array.isArray(raw.supported_parameters) ? raw.supported_parameters.filter((value) => typeof value === "string") : Array.isArray(raw.supportedGenerationMethods) ? raw.supportedGenerationMethods.filter((value) => typeof value === "string") : undefined;
53146
53165
  const capabilities = isRecord(raw.capabilities) ? raw.capabilities : undefined;
53166
+ const reasoning = parseModelReasoningCapabilities(raw.reasoning);
53147
53167
  const expirationDate = asEpochSeconds(raw.expiration_date);
53148
53168
  const deprecated = raw.deprecated === true || expirationDate !== undefined && expirationDate <= Math.floor(Date.now() / 1000) || /deprecated/i.test(asString(raw.description) ?? "");
53149
53169
  const expires = expirationDate !== undefined && !deprecated ? `expires ${new Date(expirationDate * 1000).toISOString().slice(0, 10)}` : null;
@@ -53163,6 +53183,7 @@ function toDiscoveredModel(entry, providerLabel) {
53163
53183
  ...outputTokenLimit ? { outputTokenLimit } : {},
53164
53184
  ...supportedParameters ? { supportedParameters } : {},
53165
53185
  ...capabilities ? { capabilities } : {},
53186
+ ...reasoning ? { reasoning } : {},
53166
53187
  ...expirationDate ? { expirationDate } : {},
53167
53188
  ...deprecated ? { deprecated: true } : {}
53168
53189
  };
@@ -53742,6 +53763,7 @@ __export(exports_providerRegistry, {
53742
53763
  getProviderRuntimeInfo: () => getProviderRuntimeInfo,
53743
53764
  getProviderRuntimeBlockReason: () => getProviderRuntimeBlockReason,
53744
53765
  getProviderRuntimeBackend: () => getProviderRuntimeBackend,
53766
+ getProviderReasoningCapabilitiesForModel: () => getProviderReasoningCapabilitiesForModel,
53745
53767
  getProviderFamily: () => getProviderFamily,
53746
53768
  getProviderDefinition: () => getProviderDefinition,
53747
53769
  getProviderContextLengthForModel: () => getProviderContextLengthForModel,
@@ -54875,6 +54897,20 @@ function getProviderContextLengthForModel(model, provider = getInitialSettings()
54875
54897
  const length = match?.contextLength;
54876
54898
  return typeof length === "number" && Number.isFinite(length) && length > 0 ? Math.floor(length) : undefined;
54877
54899
  }
54900
+ function getProviderReasoningCapabilitiesForModel(model, provider = getRuntimeProviderId(), settings = getInitialSettings()) {
54901
+ const providerId = resolveProviderId(provider);
54902
+ if (!providerId)
54903
+ return;
54904
+ const wanted = model.trim().toLowerCase();
54905
+ if (!wanted)
54906
+ return;
54907
+ const known = [
54908
+ ...getCachedProviderModels(providerId, settings),
54909
+ ...PROVIDER_MODELS[providerId] ?? []
54910
+ ];
54911
+ const match = known.find((entry) => entry.id.toLowerCase() === wanted) ?? known.find((entry) => wanted.includes(entry.id.toLowerCase()));
54912
+ return match?.reasoning;
54913
+ }
54878
54914
  function cacheProviderModelsForProvider(providerId, models, settings = getInitialSettings()) {
54879
54915
  const provider = resolveProviderId(providerId);
54880
54916
  if (!provider) {
@@ -55126,6 +55162,7 @@ async function discoverApiProviderModels(provider, definition, options) {
55126
55162
  ...model.outputTokenLimit ? { outputTokenLimit: model.outputTokenLimit } : {},
55127
55163
  ...model.supportedParameters ? { supportedParameters: model.supportedParameters } : {},
55128
55164
  ...model.capabilities ? { capabilities: model.capabilities } : {},
55165
+ ...model.reasoning ? { reasoning: model.reasoning } : {},
55129
55166
  ...model.expirationDate ? { expirationDate: model.expirationDate } : {},
55130
55167
  ...model.deprecated ? { deprecated: true } : {}
55131
55168
  }));
@@ -55261,7 +55298,9 @@ function getValidModelIdsForProvider(providerId) {
55261
55298
  }
55262
55299
  function formatInvalidProviderModelMessage(providerId, modelId, validModels, suggestedModel) {
55263
55300
  const provider = resolveProviderId(providerId) ?? String(providerId);
55264
- const validList = validModels.length > 0 ? validModels.join(", ") : "(no models discovered)";
55301
+ const visibleModels = validModels.slice(0, 8);
55302
+ const hiddenCount = validModels.length - visibleModels.length;
55303
+ const validList = validModels.length > 0 ? `${visibleModels.join(", ")}${hiddenCount > 0 ? `, \u2026 and ${hiddenCount} more` : ""}` : "(no models discovered)";
55265
55304
  const suggested = suggestedModel ?? validModels[0] ?? "<valid-model>";
55266
55305
  return `Model "${modelId}" is not available for provider "${provider}". Valid models for ${provider}: ${validList}. Run /model and choose a model from ${provider}, or run: ur config set model ${suggested}`;
55267
55306
  }
@@ -55843,6 +55882,12 @@ var init_providerRegistry = __esm(() => {
55843
55882
  });
55844
55883
 
55845
55884
  // src/utils/model/providers.ts
55885
+ function getRuntimeProvider() {
55886
+ return getRuntimeProviderId();
55887
+ }
55888
+ function getRuntimeModelReasoningCapabilities(model, provider = getRuntimeProviderId()) {
55889
+ return getProviderReasoningCapabilitiesForModel(model, provider);
55890
+ }
55846
55891
  function getAPIProvider() {
55847
55892
  return getRuntimeProviderId() === "ollama" ? "ollama" : "foundry";
55848
55893
  }
@@ -90686,6 +90731,352 @@ var init_ollama = __esm(() => {
90686
90731
  LEVELED_THINK_MODEL_RE = /gpt-oss/i;
90687
90732
  });
90688
90733
 
90734
+ // src/utils/model/modelSupportOverrides.ts
90735
+ var TIERS, get3PModelCapabilityOverride;
90736
+ var init_modelSupportOverrides = __esm(() => {
90737
+ init_memoize();
90738
+ init_providers();
90739
+ TIERS = [
90740
+ {
90741
+ modelEnvVar: "URHQ_DEFAULT_MODELO_MODEL",
90742
+ capabilitiesEnvVar: "URHQ_DEFAULT_MODELO_MODEL_SUPPORTED_CAPABILITIES"
90743
+ },
90744
+ {
90745
+ modelEnvVar: "URHQ_DEFAULT_MODELS_MODEL",
90746
+ capabilitiesEnvVar: "URHQ_DEFAULT_MODELS_MODEL_SUPPORTED_CAPABILITIES"
90747
+ },
90748
+ {
90749
+ modelEnvVar: "URHQ_DEFAULT_MODELH_MODEL",
90750
+ capabilitiesEnvVar: "URHQ_DEFAULT_MODELH_MODEL_SUPPORTED_CAPABILITIES"
90751
+ }
90752
+ ];
90753
+ get3PModelCapabilityOverride = memoize_default((model, capability) => {
90754
+ if (isFirstPartyRuntime()) {
90755
+ return;
90756
+ }
90757
+ const m = model.toLowerCase();
90758
+ for (const tier of TIERS) {
90759
+ const pinned = process.env[tier.modelEnvVar];
90760
+ const capabilities = process.env[tier.capabilitiesEnvVar];
90761
+ if (!pinned || capabilities === undefined)
90762
+ continue;
90763
+ if (m !== pinned.toLowerCase())
90764
+ continue;
90765
+ return capabilities.toLowerCase().split(",").map((s) => s.trim()).includes(capability);
90766
+ }
90767
+ return;
90768
+ }, (model, capability) => `${model.toLowerCase()}:${capability}`);
90769
+ });
90770
+
90771
+ // src/utils/thinking.ts
90772
+ function isUltrathinkEnabled() {
90773
+ if (true) {
90774
+ return false;
90775
+ }
90776
+ return getFeatureValue_CACHED_MAY_BE_STALE("tengu_turtle_carbon", true);
90777
+ }
90778
+ function hasUltrathinkKeyword(text) {
90779
+ return /\bultrathink\b/i.test(text);
90780
+ }
90781
+ function findThinkingTriggerPositions(text) {
90782
+ const positions = [];
90783
+ const matches = text.matchAll(/\bultrathink\b/gi);
90784
+ for (const match of matches) {
90785
+ if (match.index !== undefined) {
90786
+ positions.push({
90787
+ word: match[0],
90788
+ start: match.index,
90789
+ end: match.index + match[0].length
90790
+ });
90791
+ }
90792
+ }
90793
+ return positions;
90794
+ }
90795
+ function getRainbowColor(charIndex, shimmer = false) {
90796
+ const colors = shimmer ? RAINBOW_SHIMMER_COLORS : RAINBOW_COLORS;
90797
+ return colors[charIndex % colors.length];
90798
+ }
90799
+ function modelSupportsThinking(model) {
90800
+ const provider = getAPIProvider();
90801
+ if (provider === "ollama") {
90802
+ return true;
90803
+ }
90804
+ const supported3P = get3PModelCapabilityOverride(model, "thinking");
90805
+ if (supported3P !== undefined) {
90806
+ return supported3P;
90807
+ }
90808
+ if (process.env.USER_TYPE === "ant") {
90809
+ if (resolveAntModel(model.toLowerCase())) {
90810
+ return true;
90811
+ }
90812
+ }
90813
+ if (provider === "foundry" || isFirstPartyRuntime()) {
90814
+ return true;
90815
+ }
90816
+ return false;
90817
+ }
90818
+ function modelSupportsAdaptiveThinking(model) {
90819
+ const supported3P = get3PModelCapabilityOverride(model, "adaptive_thinking");
90820
+ if (supported3P !== undefined) {
90821
+ return supported3P;
90822
+ }
90823
+ if (getAPIProvider() === "ollama") {
90824
+ return false;
90825
+ }
90826
+ const provider = getAPIProvider();
90827
+ return isFirstPartyRuntime() || provider === "foundry";
90828
+ }
90829
+ function shouldEnableThinkingByDefault() {
90830
+ if (process.env.MAX_THINKING_TOKENS) {
90831
+ return parseInt(process.env.MAX_THINKING_TOKENS, 10) > 0;
90832
+ }
90833
+ const { settings } = getSettingsWithErrors();
90834
+ if (settings.alwaysThinkingEnabled === false) {
90835
+ return false;
90836
+ }
90837
+ return true;
90838
+ }
90839
+ var RAINBOW_COLORS, RAINBOW_SHIMMER_COLORS;
90840
+ var init_thinking = __esm(() => {
90841
+ init_growthbook();
90842
+ init_antModels();
90843
+ init_modelSupportOverrides();
90844
+ init_providers();
90845
+ init_settings2();
90846
+ RAINBOW_COLORS = [
90847
+ "rainbow_red",
90848
+ "rainbow_orange",
90849
+ "rainbow_yellow",
90850
+ "rainbow_green",
90851
+ "rainbow_blue",
90852
+ "rainbow_indigo",
90853
+ "rainbow_violet"
90854
+ ];
90855
+ RAINBOW_SHIMMER_COLORS = [
90856
+ "rainbow_red_shimmer",
90857
+ "rainbow_orange_shimmer",
90858
+ "rainbow_yellow_shimmer",
90859
+ "rainbow_green_shimmer",
90860
+ "rainbow_blue_shimmer",
90861
+ "rainbow_indigo_shimmer",
90862
+ "rainbow_violet_shimmer"
90863
+ ];
90864
+ });
90865
+
90866
+ // src/utils/effort.ts
90867
+ function modelSupportsEffort(model, provider = getRuntimeProvider()) {
90868
+ if (isEnvTruthy(process.env.UR_CODE_ALWAYS_ENABLE_EFFORT)) {
90869
+ return true;
90870
+ }
90871
+ const supported3P = get3PModelCapabilityOverride(model, "effort");
90872
+ if (supported3P !== undefined) {
90873
+ return supported3P;
90874
+ }
90875
+ const discovered = getRuntimeModelReasoningCapabilities(model, provider);
90876
+ if (discovered?.supportedEfforts === null)
90877
+ return true;
90878
+ if (discovered?.supportedEfforts !== undefined) {
90879
+ return discovered.supportedEfforts.some((effort) => effort !== "none");
90880
+ }
90881
+ if (discovered && provider === "openrouter") {
90882
+ return true;
90883
+ }
90884
+ return getAPIProvider() === "ollama";
90885
+ }
90886
+ function modelSupportsMaxEffort(model, provider = getRuntimeProvider()) {
90887
+ const supported3P = get3PModelCapabilityOverride(model, "max_effort");
90888
+ if (supported3P !== undefined) {
90889
+ return supported3P;
90890
+ }
90891
+ const discovered = getRuntimeModelReasoningCapabilities(model, provider);
90892
+ if (discovered?.supportedEfforts === null)
90893
+ return true;
90894
+ if (discovered?.supportedEfforts !== undefined) {
90895
+ return provider === "openrouter" || discovered.supportedEfforts.some((effort) => effort === "max" || effort === "xhigh");
90896
+ }
90897
+ if (discovered && provider === "openrouter") {
90898
+ return true;
90899
+ }
90900
+ if (process.env.USER_TYPE === "ant" && resolveAntModel(model)) {
90901
+ return true;
90902
+ }
90903
+ return false;
90904
+ }
90905
+ function toOpenRouterReasoningEffort(model, effort) {
90906
+ const supported = getRuntimeModelReasoningCapabilities(model, "openrouter")?.supportedEfforts;
90907
+ if (effort !== "max")
90908
+ return effort;
90909
+ if (supported === null || supported === undefined)
90910
+ return "max";
90911
+ if (supported.includes("max"))
90912
+ return "max";
90913
+ if (supported.includes("xhigh"))
90914
+ return "xhigh";
90915
+ return "high";
90916
+ }
90917
+ function isEffortLevel(value) {
90918
+ return EFFORT_LEVELS.includes(value);
90919
+ }
90920
+ function parseEffortValue(value) {
90921
+ if (value === undefined || value === null || value === "") {
90922
+ return;
90923
+ }
90924
+ if (typeof value === "number" && isValidNumericEffort(value)) {
90925
+ return value;
90926
+ }
90927
+ const str = String(value).toLowerCase();
90928
+ if (isEffortLevel(str)) {
90929
+ return str;
90930
+ }
90931
+ const numericValue = parseInt(str, 10);
90932
+ if (!isNaN(numericValue) && isValidNumericEffort(numericValue)) {
90933
+ return numericValue;
90934
+ }
90935
+ return;
90936
+ }
90937
+ function toPersistableEffort(value) {
90938
+ if (value === "low" || value === "medium" || value === "high") {
90939
+ return value;
90940
+ }
90941
+ if (value === "max" && process.env.USER_TYPE === "ant") {
90942
+ return value;
90943
+ }
90944
+ return;
90945
+ }
90946
+ function getInitialEffortSetting() {
90947
+ return toPersistableEffort(getInitialSettings().effortLevel);
90948
+ }
90949
+ function resolvePickerEffortPersistence(picked, modelDefault, priorPersisted, toggledInPicker) {
90950
+ const hadExplicit = priorPersisted !== undefined || toggledInPicker;
90951
+ return hadExplicit || picked !== modelDefault ? picked : undefined;
90952
+ }
90953
+ function getEffortEnvOverride() {
90954
+ const envOverride = process.env.UR_CODE_EFFORT_LEVEL;
90955
+ return envOverride?.toLowerCase() === "unset" || envOverride?.toLowerCase() === "auto" ? null : parseEffortValue(envOverride);
90956
+ }
90957
+ function resolveAppliedEffort(model, appStateEffortValue, provider = getRuntimeProvider()) {
90958
+ const envOverride = getEffortEnvOverride();
90959
+ if (envOverride === null) {
90960
+ return;
90961
+ }
90962
+ const resolved = envOverride ?? appStateEffortValue ?? getDefaultEffortForModel(model);
90963
+ if (resolved === "max" && !modelSupportsMaxEffort(model, provider)) {
90964
+ return "high";
90965
+ }
90966
+ return resolved;
90967
+ }
90968
+ function getDisplayedEffortLevel(model, appStateEffort, provider = getRuntimeProvider()) {
90969
+ const resolved = resolveAppliedEffort(model, appStateEffort, provider) ?? "high";
90970
+ return convertEffortValueToLevel(resolved);
90971
+ }
90972
+ function getEffortSuffix(model, effortValue, provider = getRuntimeProvider()) {
90973
+ if (effortValue === undefined)
90974
+ return "";
90975
+ const resolved = resolveAppliedEffort(model, effortValue, provider);
90976
+ if (resolved === undefined)
90977
+ return "";
90978
+ return ` with ${convertEffortValueToLevel(resolved)} effort`;
90979
+ }
90980
+ function isValidNumericEffort(value) {
90981
+ return Number.isInteger(value);
90982
+ }
90983
+ function convertEffortValueToLevel(value) {
90984
+ if (typeof value === "string") {
90985
+ return isEffortLevel(value) ? value : "high";
90986
+ }
90987
+ if (process.env.USER_TYPE === "ant" && typeof value === "number") {
90988
+ if (value <= 50)
90989
+ return "low";
90990
+ if (value <= 85)
90991
+ return "medium";
90992
+ if (value <= 100)
90993
+ return "high";
90994
+ return "max";
90995
+ }
90996
+ return "high";
90997
+ }
90998
+ function getEffortLevelDescription(level) {
90999
+ switch (level) {
91000
+ case "low":
91001
+ return "Quick, straightforward implementation with minimal overhead";
91002
+ case "medium":
91003
+ return "Balanced approach with standard implementation and testing";
91004
+ case "high":
91005
+ return "Comprehensive implementation with extensive testing and documentation";
91006
+ case "max":
91007
+ return "Maximum capability with deepest reasoning";
91008
+ }
91009
+ }
91010
+ function getEffortValueDescription(value) {
91011
+ if (process.env.USER_TYPE === "ant" && typeof value === "number") {
91012
+ return `[ANT-ONLY] Numeric effort value of ${value}`;
91013
+ }
91014
+ if (typeof value === "string") {
91015
+ return getEffortLevelDescription(value);
91016
+ }
91017
+ return "Balanced approach with standard implementation and testing";
91018
+ }
91019
+ function getmodelODefaultEffortConfig() {
91020
+ const config2 = getFeatureValue_CACHED_MAY_BE_STALE("tengu_grey_step2", MODELO_DEFAULT_EFFORT_CONFIG_DEFAULT);
91021
+ return {
91022
+ ...MODELO_DEFAULT_EFFORT_CONFIG_DEFAULT,
91023
+ ...config2
91024
+ };
91025
+ }
91026
+ function getDefaultEffortForModel(model) {
91027
+ if (process.env.USER_TYPE === "ant") {
91028
+ const config2 = getAntModelOverrideConfig();
91029
+ const isDefaultModel = config2?.defaultModel !== undefined && model.toLowerCase() === config2.defaultModel.toLowerCase();
91030
+ if (isDefaultModel && config2?.defaultModelEffortLevel) {
91031
+ return config2.defaultModelEffortLevel;
91032
+ }
91033
+ const antModel = resolveAntModel(model);
91034
+ if (antModel) {
91035
+ if (antModel.defaultEffortLevel) {
91036
+ return antModel.defaultEffortLevel;
91037
+ }
91038
+ if (antModel.defaultEffortValue !== undefined) {
91039
+ return antModel.defaultEffortValue;
91040
+ }
91041
+ }
91042
+ return;
91043
+ }
91044
+ if (modelSupportsEffort(model)) {
91045
+ if (isProSubscriber()) {
91046
+ return "medium";
91047
+ }
91048
+ if (getmodelODefaultEffortConfig().enabled && (isMaxSubscriber() || isTeamSubscriber())) {
91049
+ return "medium";
91050
+ }
91051
+ }
91052
+ if (isUltrathinkEnabled() && modelSupportsEffort(model)) {
91053
+ return "medium";
91054
+ }
91055
+ return;
91056
+ }
91057
+ var EFFORT_LEVELS, MODELO_DEFAULT_EFFORT_CONFIG_DEFAULT;
91058
+ var init_effort = __esm(() => {
91059
+ init_thinking();
91060
+ init_settings2();
91061
+ init_auth();
91062
+ init_growthbook();
91063
+ init_providers();
91064
+ init_modelSupportOverrides();
91065
+ init_envUtils();
91066
+ init_antModels();
91067
+ EFFORT_LEVELS = [
91068
+ "low",
91069
+ "medium",
91070
+ "high",
91071
+ "max"
91072
+ ];
91073
+ MODELO_DEFAULT_EFFORT_CONFIG_DEFAULT = {
91074
+ enabled: true,
91075
+ dialogTitle: "We recommend medium effort for modelO",
91076
+ dialogDescription: "Effort determines how long UR thinks for when completing your task. We recommend medium effort for most tasks to balance speed and intelligence and maximize rate limits. Use ultrathink to trigger high effort when needed."
91077
+ };
91078
+ });
91079
+
90689
91080
  // src/services/api/usageNormalization.ts
90690
91081
  function count3(value) {
90691
91082
  if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
@@ -90710,12 +91101,18 @@ function normalizeOpenAIChatUsage(usage) {
90710
91101
  const promptTokens = count3(u2.prompt_tokens);
90711
91102
  const cacheRead = count3(promptDetails.cached_tokens);
90712
91103
  const cacheWrite2 = count3(promptDetails.cache_write_tokens);
90713
- return withOptionalFields({
90714
- input_tokens: remainder(promptTokens, cacheRead, cacheWrite2),
90715
- output_tokens: count3(u2.completion_tokens),
90716
- cache_creation_input_tokens: cacheWrite2,
90717
- cache_read_input_tokens: cacheRead
90718
- }, count3(completionDetails.reasoning_tokens), count3(u2.total_tokens));
91104
+ return {
91105
+ ...withOptionalFields({
91106
+ input_tokens: remainder(promptTokens, cacheRead, cacheWrite2),
91107
+ output_tokens: count3(u2.completion_tokens),
91108
+ cache_creation_input_tokens: cacheWrite2,
91109
+ cache_read_input_tokens: cacheRead
91110
+ }, count3(completionDetails.reasoning_tokens), count3(u2.total_tokens)),
91111
+ server_tool_use: {
91112
+ web_search_requests: count3(u2.server_tool_use?.web_search_requests),
91113
+ web_fetch_requests: count3(u2.server_tool_use?.web_fetch_requests)
91114
+ }
91115
+ };
90719
91116
  }
90720
91117
  function normalizeOpenAIResponsesUsage(usage) {
90721
91118
  const u2 = usage ?? {};
@@ -90759,6 +91156,45 @@ function getStoredGeminiThoughtSignature(block) {
90759
91156
  }
90760
91157
  var GEMINI_THOUGHT_SIGNATURE = "gemini_thought_signature";
90761
91158
 
91159
+ // src/services/api/openRouterCitations.ts
91160
+ function collectOpenRouterUrlCitations(annotations) {
91161
+ if (!Array.isArray(annotations))
91162
+ return [];
91163
+ const citations = new Map;
91164
+ for (const annotation of annotations) {
91165
+ if (!annotation || typeof annotation !== "object")
91166
+ continue;
91167
+ const record2 = annotation;
91168
+ if (record2.type !== "url_citation")
91169
+ continue;
91170
+ const citation = record2.url_citation;
91171
+ if (!citation || typeof citation !== "object")
91172
+ continue;
91173
+ const value = citation;
91174
+ if (typeof value.url !== "string" || !/^https?:\/\//i.test(value.url)) {
91175
+ continue;
91176
+ }
91177
+ const rawTitle = typeof value.title === "string" && value.title.trim() ? value.title.trim() : new URL(value.url).hostname;
91178
+ const title = rawTitle.replace(/[\r\n]+/g, " ").replace(/[\[\]]/g, "").trim();
91179
+ if (!citations.has(value.url)) {
91180
+ citations.set(value.url, { url: value.url, title });
91181
+ }
91182
+ }
91183
+ return [...citations.values()];
91184
+ }
91185
+ function formatOpenRouterCitations(citations) {
91186
+ const unique = new Map;
91187
+ for (const citation of citations)
91188
+ unique.set(citation.url, citation);
91189
+ if (unique.size === 0)
91190
+ return "";
91191
+ return `
91192
+
91193
+ Sources:
91194
+ ${[...unique.values()].map((citation) => `- [${citation.title}](${citation.url})`).join(`
91195
+ `)}`;
91196
+ }
91197
+
90762
91198
  // src/services/api/providerHttp.ts
90763
91199
  function parsePositiveInteger(value) {
90764
91200
  if (typeof value !== "string" && typeof value !== "number")
@@ -91183,6 +91619,7 @@ async function* streamOpenAIEvents(body, options) {
91183
91619
  let finishReason;
91184
91620
  let usage = EMPTY_USAGE;
91185
91621
  const emittedToolIds = new Set;
91622
+ const urlCitations = new Map;
91186
91623
  const toolStates = new Map;
91187
91624
  let activeThinkingIndex = null;
91188
91625
  const stopThinking = function* () {
@@ -91275,6 +91712,9 @@ async function* streamOpenAIEvents(body, options) {
91275
91712
  }
91276
91713
  for (const choice of chunk?.choices ?? []) {
91277
91714
  const delta = choice?.delta ?? {};
91715
+ for (const citation of collectOpenRouterUrlCitations(delta.annotations ?? choice?.message?.annotations)) {
91716
+ urlCitations.set(citation.url, citation);
91717
+ }
91278
91718
  const reasoning = typeof delta.reasoning_content === "string" ? delta.reasoning_content : typeof delta.reasoning === "string" ? delta.reasoning : "";
91279
91719
  if (reasoning.length > 0) {
91280
91720
  for (const event of ensureThinking())
@@ -91349,6 +91789,16 @@ async function* streamOpenAIEvents(body, options) {
91349
91789
  }
91350
91790
  }
91351
91791
  }
91792
+ const citationText = formatOpenRouterCitations(urlCitations.values());
91793
+ if (citationText) {
91794
+ for (const event of ensureText())
91795
+ yield event;
91796
+ yield {
91797
+ type: "content_block_delta",
91798
+ index: activeTextIndex,
91799
+ delta: { type: "text_delta", text: citationText }
91800
+ };
91801
+ }
91352
91802
  for (const event of stopText())
91353
91803
  yield event;
91354
91804
  for (const event of stopThinking())
@@ -92278,6 +92728,12 @@ function toOpenAICompatibleRequest(params, providerName = "openai-compatible") {
92278
92728
  const tools = toOpenAITools(params.tools, providerName);
92279
92729
  const responseFormat = toOpenAIResponseFormat(params.output_config?.format);
92280
92730
  const reasoningEffort = toOpenAIReasoningEffort(params);
92731
+ const openRouterReasoning = providerName === "openrouter" && reasoningEffort ? {
92732
+ effort: toOpenRouterReasoningEffort(String(params.model ?? ""), reasoningEffort)
92733
+ } : undefined;
92734
+ const compatibleReasoningEffort = reasoningEffort === "max" ? "high" : reasoningEffort;
92735
+ const openRouterServerSearch = providerName === "openrouter" && tools.some((tool) => tool?.type === "openrouter:web_search");
92736
+ const toolChoice = openRouterServerSearch ? undefined : mapOpenAIToolChoice(params.tool_choice);
92281
92737
  return {
92282
92738
  model: params.model,
92283
92739
  messages: toOpenAIMessages(params, providerName),
@@ -92286,12 +92742,12 @@ function toOpenAICompatibleRequest(params, providerName = "openai-compatible") {
92286
92742
  ...params.top_p !== undefined && { top_p: params.top_p },
92287
92743
  ...params.stop_sequences?.length > 0 && { stop: params.stop_sequences },
92288
92744
  ...params.metadata !== undefined && { metadata: params.metadata },
92289
- ...reasoningEffort && { reasoning_effort: reasoningEffort },
92745
+ ...openRouterReasoning ? { reasoning: openRouterReasoning } : compatibleReasoningEffort ? { reasoning_effort: compatibleReasoningEffort } : {},
92290
92746
  ...responseFormat && { response_format: responseFormat },
92291
92747
  stream: Boolean(params.stream),
92292
92748
  ...params.stream && providerName !== "openrouter" ? { stream_options: { include_usage: true } } : {},
92293
92749
  ...tools.length > 0 ? { tools } : {},
92294
- ...params.tool_choice !== undefined ? { tool_choice: mapOpenAIToolChoice(params.tool_choice) } : {}
92750
+ ...toolChoice !== undefined ? { tool_choice: toolChoice } : {}
92295
92751
  };
92296
92752
  }
92297
92753
  function toOpenAIResponseFormat(format4) {
@@ -92308,10 +92764,9 @@ function toOpenAIResponseFormat(format4) {
92308
92764
  }
92309
92765
  function toOpenAIReasoningEffort(params) {
92310
92766
  const requested = params.output_config?.effort;
92311
- if (requested === "low" || requested === "medium" || requested === "high")
92767
+ if (requested === "low" || requested === "medium" || requested === "high" || requested === "max") {
92312
92768
  return requested;
92313
- if (requested === "max")
92314
- return "high";
92769
+ }
92315
92770
  if (params.thinking?.type === "adaptive")
92316
92771
  return "medium";
92317
92772
  if (params.thinking?.type !== "enabled")
@@ -92438,7 +92893,7 @@ function toOpenAITools(tools, providerName = "OpenAI") {
92438
92893
  throw new ToolSchemaValidationError(`${providerName} tools must be an array.`);
92439
92894
  }
92440
92895
  const result = tools.map((tool) => toOpenAITool(tool, providerName));
92441
- assertUniqueToolNames(result.map((tool) => tool.function.name), providerName);
92896
+ assertUniqueToolNames(result.filter((tool) => tool?.type === "function").map((tool) => tool.function.name), providerName);
92442
92897
  return result;
92443
92898
  }
92444
92899
  function mapOpenAIToolChoice(toolChoice) {
@@ -92514,6 +92969,16 @@ function isOpenAIToolStopReason2(reason) {
92514
92969
  return reason === "tool_calls" || reason === "function_call" || reason === "tool_use";
92515
92970
  }
92516
92971
  function toOpenAITool(tool, providerName) {
92972
+ if (providerName === "openrouter" && tool?.type === "web_search_20250305") {
92973
+ return {
92974
+ type: "openrouter:web_search",
92975
+ parameters: {
92976
+ ...Number.isInteger(tool.max_uses) && tool.max_uses > 0 ? { max_uses: tool.max_uses } : {},
92977
+ ...Array.isArray(tool.allowed_domains) && tool.allowed_domains.length > 0 ? { allowed_domains: tool.allowed_domains } : {},
92978
+ ...Array.isArray(tool.blocked_domains) && tool.blocked_domains.length > 0 ? { excluded_domains: tool.blocked_domains } : {}
92979
+ }
92980
+ };
92981
+ }
92517
92982
  if (tool?.type === "function" && tool.function) {
92518
92983
  assertValidToolName(tool.function.name, providerName);
92519
92984
  const strict2 = tool.function.strict === true;
@@ -92652,7 +93117,8 @@ function parseOpenAIMessageContent(message, legacyText, providerName) {
92652
93117
  if (reasoning.length > 0) {
92653
93118
  content.push({ type: "thinking", thinking: reasoning });
92654
93119
  }
92655
- const text = openAIMessageText(message?.content, legacyText);
93120
+ const citationText = formatOpenRouterCitations(collectOpenRouterUrlCitations(message?.annotations));
93121
+ const text = openAIMessageText(message?.content, legacyText) + citationText;
92656
93122
  if (text.length > 0) {
92657
93123
  content.push({ type: "text", text });
92658
93124
  }
@@ -92754,6 +93220,7 @@ function hasToolUse(content) {
92754
93220
  }
92755
93221
  var init_openaiCompatible = __esm(() => {
92756
93222
  init_kimiToolCalls();
93223
+ init_effort();
92757
93224
  init_toolSchema();
92758
93225
  init_providerClient();
92759
93226
  init_streamingAdapters();
@@ -95032,7 +95499,10 @@ function formatRuntimeDispatchError({
95032
95499
  suggestedModel
95033
95500
  }) {
95034
95501
  const provider = resolveProviderId(providerId) ?? String(providerId);
95035
- const valid = validModels?.length ? validModels.join(", ") : getValidModelIdsForProvider(provider).join(", ") || "(no models discovered)";
95502
+ const discoveredModels = validModels?.length ? validModels : getValidModelIdsForProvider(provider);
95503
+ const visibleModels = discoveredModels.slice(0, 8);
95504
+ const hiddenCount = discoveredModels.length - visibleModels.length;
95505
+ const valid = discoveredModels.length ? `${visibleModels.join(", ")}${hiddenCount > 0 ? `, \u2026 and ${hiddenCount} more` : ""}` : "(no models discovered)";
95036
95506
  const suggestion = suggestedModel ?? getDefaultModelForProvider(provider) ?? "<valid-model>";
95037
95507
  return `Provider "${provider}" is selected with model "${model}", but runtime dispatch cannot use that provider/model pair. Reason: ${why}. Valid models for ${provider}: ${valid}. Run /model and choose a model from ${provider}, or run: ur config set model ${suggestion}`;
95038
95508
  }
@@ -95077,7 +95547,7 @@ async function assertFreshRuntimeModel(providerId, options) {
95077
95547
  const provider = getProviderDefinition(providerId);
95078
95548
  if (provider.modelDiscoveryType !== "live")
95079
95549
  return;
95080
- const settings = getInitialSettings();
95550
+ const settings = options.settings ?? getInitialSettings();
95081
95551
  const env4 = provider.envKey && options.apiKey ? { ...process.env, [provider.envKey]: options.apiKey } : process.env;
95082
95552
  const discovered = await ensureProviderModelsFresh(providerId, {
95083
95553
  settings,
@@ -95152,12 +95622,12 @@ async function createLocalProviderClient(providerId, options = {}) {
95152
95622
  throw new Error(`Provider "${providerId}" is not an Ollama runtime. Runtime backend is ${getProviderRuntimeBackend(providerId)}.`);
95153
95623
  }
95154
95624
  const { createOllamaURHQClient: createOllamaURHQClient2 } = await Promise.resolve().then(() => (init_ollama(), exports_ollama));
95155
- const settings = getInitialSettings();
95625
+ const settings = options.settings ?? getInitialSettings();
95156
95626
  const baseUrlOverride = resolveProviderBaseUrl(providerId, settings);
95157
95627
  return createOllamaURHQClient2({ baseUrlOverride });
95158
95628
  }
95159
95629
  async function createOpenAICompatibleProviderClient(providerId, options = {}) {
95160
- const settings = getInitialSettings();
95630
+ const settings = options.settings ?? getInitialSettings();
95161
95631
  const providerSettings = getActiveProviderSettings(settings);
95162
95632
  const provider = getProviderDefinition(providerId);
95163
95633
  const baseUrl = providerSettings.active === providerId ? providerSettings.baseUrl ?? provider.defaultBaseUrl : provider.defaultBaseUrl;
@@ -95178,7 +95648,7 @@ async function createSubscriptionClient(providerId, options = {}) {
95178
95648
  if (runtimeBlock) {
95179
95649
  throw new Error(runtimeBlock);
95180
95650
  }
95181
- const settings = getInitialSettings();
95651
+ const settings = options.settings ?? getInitialSettings();
95182
95652
  const providerSettings = getActiveProviderSettings(settings);
95183
95653
  const { which: which2 } = await Promise.resolve().then(() => (init_which(), exports_which));
95184
95654
  let commandPath = providerSettings.commandPath ?? null;
@@ -95201,7 +95671,7 @@ async function createSubscriptionClient(providerId, options = {}) {
95201
95671
  }
95202
95672
  async function createAPIClient(providerId, options = {}) {
95203
95673
  const provider = getProviderDefinition(providerId);
95204
- const settings = getInitialSettings();
95674
+ const settings = options.settings ?? getInitialSettings();
95205
95675
  const providerSettings = getActiveProviderSettings(settings);
95206
95676
  const apiKey = options.apiKey ?? getProviderApiKey(providerId);
95207
95677
  if (provider.envKey && !apiKey) {
@@ -95276,20 +95746,30 @@ async function getURHQClient({
95276
95746
  maxRetries,
95277
95747
  model,
95278
95748
  fetchOverride,
95279
- source
95749
+ source,
95750
+ providerSettings
95280
95751
  }) {
95281
- const runtime = resolveActiveProviderModel({ model, source });
95752
+ const settings = providerSettings ? {
95753
+ ...getInitialSettings(),
95754
+ provider: {
95755
+ ...providerSettings,
95756
+ ...providerSettings.responses ? { responses: { ...providerSettings.responses } } : {}
95757
+ }
95758
+ } : undefined;
95759
+ const runtime = resolveActiveProviderModel({ settings, model, source });
95282
95760
  return createProviderClient(runtime.providerId, {
95283
95761
  apiKey,
95284
95762
  maxRetries,
95285
95763
  model: runtime.model,
95286
95764
  fetchOverride,
95287
- source
95765
+ source,
95766
+ settings
95288
95767
  });
95289
95768
  }
95290
95769
  var CLIENT_REQUEST_ID_HEADER = "x-client-request-id";
95291
95770
  var init_client2 = __esm(() => {
95292
95771
  init_providerClient();
95772
+ init_settings2();
95293
95773
  });
95294
95774
 
95295
95775
  // src/utils/model/modelCapabilities.ts
@@ -96224,13 +96704,14 @@ function getDefaultOllamaModel() {
96224
96704
  }
96225
96705
  return DEFAULT_OLLAMA_MODEL2;
96226
96706
  }
96227
- function getSmallFastModel() {
96228
- if (process.env.OLLAMA_MODEL !== undefined && process.env.OLLAMA_SMALL_FAST_MODEL === undefined) {
96707
+ function getSmallFastModel(providerSettings) {
96708
+ const activeProvider = providerSettings?.active ?? getActiveProviderSettings().active;
96709
+ if (activeProvider === "ollama" && process.env.OLLAMA_MODEL !== undefined && process.env.OLLAMA_SMALL_FAST_MODEL === undefined) {
96229
96710
  const mainLoopModel = getMainLoopModel();
96230
96711
  if (mainLoopModel)
96231
96712
  return mainLoopModel;
96232
96713
  }
96233
- if (getAPIProvider() === "ollama") {
96714
+ if (activeProvider === "ollama" || !activeProvider && getAPIProvider() === "ollama") {
96234
96715
  if (process.env.OLLAMA_SMALL_FAST_MODEL) {
96235
96716
  return process.env.OLLAMA_SMALL_FAST_MODEL;
96236
96717
  }
@@ -96248,7 +96729,11 @@ function getSmallFastModel() {
96248
96729
  return sessionModel;
96249
96730
  return getDefaultOllamaModel();
96250
96731
  }
96251
- return process.env.URHQ_SMALL_FAST_MODEL || getDefaultmodelHModel();
96732
+ if (process.env.URHQ_SMALL_FAST_MODEL) {
96733
+ return process.env.URHQ_SMALL_FAST_MODEL;
96734
+ }
96735
+ const selectedModel = providerSettings?.model ?? getMainLoopModel();
96736
+ return selectedModel || getDefaultmodelHModel();
96252
96737
  }
96253
96738
  function isNonCustommodelOModel(model) {
96254
96739
  return model === getModelStrings2().modelO40 || model === getModelStrings2().modelO41 || model === getModelStrings2().modelO45 || model === getModelStrings2().modelO46;
@@ -96580,43 +97065,6 @@ var init_model = __esm(() => {
96580
97065
  LEGACY_MODELO_FIRSTPARTY = [];
96581
97066
  });
96582
97067
 
96583
- // src/utils/model/modelSupportOverrides.ts
96584
- var TIERS, get3PModelCapabilityOverride;
96585
- var init_modelSupportOverrides = __esm(() => {
96586
- init_memoize();
96587
- init_providers();
96588
- TIERS = [
96589
- {
96590
- modelEnvVar: "URHQ_DEFAULT_MODELO_MODEL",
96591
- capabilitiesEnvVar: "URHQ_DEFAULT_MODELO_MODEL_SUPPORTED_CAPABILITIES"
96592
- },
96593
- {
96594
- modelEnvVar: "URHQ_DEFAULT_MODELS_MODEL",
96595
- capabilitiesEnvVar: "URHQ_DEFAULT_MODELS_MODEL_SUPPORTED_CAPABILITIES"
96596
- },
96597
- {
96598
- modelEnvVar: "URHQ_DEFAULT_MODELH_MODEL",
96599
- capabilitiesEnvVar: "URHQ_DEFAULT_MODELH_MODEL_SUPPORTED_CAPABILITIES"
96600
- }
96601
- ];
96602
- get3PModelCapabilityOverride = memoize_default((model, capability) => {
96603
- if (isFirstPartyRuntime()) {
96604
- return;
96605
- }
96606
- const m = model.toLowerCase();
96607
- for (const tier of TIERS) {
96608
- const pinned = process.env[tier.modelEnvVar];
96609
- const capabilities = process.env[tier.capabilitiesEnvVar];
96610
- if (!pinned || capabilities === undefined)
96611
- continue;
96612
- if (m !== pinned.toLowerCase())
96613
- continue;
96614
- return capabilities.toLowerCase().split(",").map((s) => s.trim()).includes(capability);
96615
- }
96616
- return;
96617
- }, (model, capability) => `${model.toLowerCase()}:${capability}`);
96618
- });
96619
-
96620
97068
  // src/utils/betas.ts
96621
97069
  function partitionBetasByAllowlist(betas) {
96622
97070
  const allowed = [];
@@ -107788,7 +108236,7 @@ var init_auth = __esm(() => {
107788
108236
 
107789
108237
  // src/utils/userAgent.ts
107790
108238
  function getURCodeUserAgent() {
107791
- return `ur/${"1.81.1"}`;
108239
+ return `ur/${"1.81.3"}`;
107792
108240
  }
107793
108241
 
107794
108242
  // src/utils/workloadContext.ts
@@ -107810,7 +108258,7 @@ function getUserAgent() {
107810
108258
  const clientApp = process.env.UR_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.UR_AGENT_SDK_CLIENT_APP}` : "";
107811
108259
  const workload = getWorkload();
107812
108260
  const workloadSuffix = workload ? `, workload/${workload}` : "";
107813
- return `ur-cli/${"1.81.1"} (${process.env.USER_TYPE}, ${process.env.UR_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
108261
+ return `ur-cli/${"1.81.3"} (${process.env.USER_TYPE}, ${process.env.UR_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
107814
108262
  }
107815
108263
  function getMCPUserAgent() {
107816
108264
  const parts = [];
@@ -107824,7 +108272,7 @@ function getMCPUserAgent() {
107824
108272
  parts.push(`client-app/${process.env.UR_AGENT_SDK_CLIENT_APP}`);
107825
108273
  }
107826
108274
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
107827
- return `ur/${"1.81.1"}${suffix}`;
108275
+ return `ur/${"1.81.3"}${suffix}`;
107828
108276
  }
107829
108277
  function getWebFetchUserAgent() {
107830
108278
  return `UR-User (${getURCodeUserAgent()})`;
@@ -107962,7 +108410,7 @@ var init_user = __esm(() => {
107962
108410
  deviceId,
107963
108411
  sessionId: getSessionId(),
107964
108412
  email: getEmail(),
107965
- appVersion: "1.81.1",
108413
+ appVersion: "1.81.3",
107966
108414
  platform: getHostPlatformForAnalytics(),
107967
108415
  organizationUuid,
107968
108416
  accountUuid,
@@ -115849,7 +116297,7 @@ var init_metadata = __esm(() => {
115849
116297
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
115850
116298
  WHITESPACE_REGEX = /\s+/;
115851
116299
  getVersionBase = memoize_default(() => {
115852
- const match = "1.81.1".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
116300
+ const match = "1.81.3".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
115853
116301
  return match ? match[0] : undefined;
115854
116302
  });
115855
116303
  buildEnvContext = memoize_default(async () => {
@@ -115889,7 +116337,7 @@ var init_metadata = __esm(() => {
115889
116337
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
115890
116338
  isURCodeAction: isEnvTruthy(process.env.UR_CODE_ACTION),
115891
116339
  isURAiAuth: isURAISubscriber(),
115892
- version: "1.81.1",
116340
+ version: "1.81.3",
115893
116341
  versionBase: getVersionBase(),
115894
116342
  buildTime: "",
115895
116343
  deploymentEnvironment: env2.detectDeploymentEnvironment(),
@@ -116559,7 +117007,7 @@ function initialize1PEventLogging() {
116559
117007
  const platform2 = getPlatform();
116560
117008
  const attributes = {
116561
117009
  [import_semantic_conventions4.ATTR_SERVICE_NAME]: "ur",
116562
- [import_semantic_conventions4.ATTR_SERVICE_VERSION]: "1.81.1"
117010
+ [import_semantic_conventions4.ATTR_SERVICE_VERSION]: "1.81.3"
116563
117011
  };
116564
117012
  if (platform2 === "wsl") {
116565
117013
  const wslVersion = getWslVersion();
@@ -116587,7 +117035,7 @@ function initialize1PEventLogging() {
116587
117035
  })
116588
117036
  ]
116589
117037
  });
116590
- firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.urhq.ur.events", "1.81.1");
117038
+ firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.urhq.ur.events", "1.81.3");
116591
117039
  }
116592
117040
  async function reinitialize1PEventLoggingIfConfigChanged() {
116593
117041
  if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
@@ -126553,7 +127001,7 @@ function formatA2AAgentCard(options = {}, pretty = true) {
126553
127001
  function formatA2AV1AgentCard(options = {}, pretty = true) {
126554
127002
  return JSON.stringify(buildA2AV1AgentCard(options), null, pretty ? 2 : 0);
126555
127003
  }
126556
- var urVersion = "1.81.1", researchSnapshotDate = "2026-08-10", coverage, priorityRoadmap;
127004
+ var urVersion = "1.81.3", researchSnapshotDate = "2026-08-10", coverage, priorityRoadmap;
126557
127005
  var init_trends = __esm(() => {
126558
127006
  init_a2aCardSignature();
126559
127007
  coverage = [
@@ -129443,7 +129891,7 @@ function getAttributionHeader(fingerprint) {
129443
129891
  if (!isAttributionHeaderEnabled()) {
129444
129892
  return "";
129445
129893
  }
129446
- const version2 = `${"1.81.1"}.${fingerprint}`;
129894
+ const version2 = `${"1.81.3"}.${fingerprint}`;
129447
129895
  const entrypoint = process.env.UR_CODE_ENTRYPOINT ?? "unknown";
129448
129896
  const cch = "";
129449
129897
  const workload = getWorkload();
@@ -170342,285 +170790,6 @@ var init_pluginDirectories = __esm(() => {
170342
170790
  init_pathValidation();
170343
170791
  });
170344
170792
 
170345
- // src/utils/thinking.ts
170346
- function isUltrathinkEnabled() {
170347
- if (true) {
170348
- return false;
170349
- }
170350
- return getFeatureValue_CACHED_MAY_BE_STALE("tengu_turtle_carbon", true);
170351
- }
170352
- function hasUltrathinkKeyword(text2) {
170353
- return /\bultrathink\b/i.test(text2);
170354
- }
170355
- function findThinkingTriggerPositions(text2) {
170356
- const positions = [];
170357
- const matches = text2.matchAll(/\bultrathink\b/gi);
170358
- for (const match of matches) {
170359
- if (match.index !== undefined) {
170360
- positions.push({
170361
- word: match[0],
170362
- start: match.index,
170363
- end: match.index + match[0].length
170364
- });
170365
- }
170366
- }
170367
- return positions;
170368
- }
170369
- function getRainbowColor(charIndex, shimmer = false) {
170370
- const colors = shimmer ? RAINBOW_SHIMMER_COLORS : RAINBOW_COLORS;
170371
- return colors[charIndex % colors.length];
170372
- }
170373
- function modelSupportsThinking(model) {
170374
- const provider = getAPIProvider();
170375
- if (provider === "ollama") {
170376
- return true;
170377
- }
170378
- const supported3P = get3PModelCapabilityOverride(model, "thinking");
170379
- if (supported3P !== undefined) {
170380
- return supported3P;
170381
- }
170382
- if (process.env.USER_TYPE === "ant") {
170383
- if (resolveAntModel(model.toLowerCase())) {
170384
- return true;
170385
- }
170386
- }
170387
- if (provider === "foundry" || isFirstPartyRuntime()) {
170388
- return true;
170389
- }
170390
- return false;
170391
- }
170392
- function modelSupportsAdaptiveThinking(model) {
170393
- const supported3P = get3PModelCapabilityOverride(model, "adaptive_thinking");
170394
- if (supported3P !== undefined) {
170395
- return supported3P;
170396
- }
170397
- if (getAPIProvider() === "ollama") {
170398
- return false;
170399
- }
170400
- const provider = getAPIProvider();
170401
- return isFirstPartyRuntime() || provider === "foundry";
170402
- }
170403
- function shouldEnableThinkingByDefault() {
170404
- if (process.env.MAX_THINKING_TOKENS) {
170405
- return parseInt(process.env.MAX_THINKING_TOKENS, 10) > 0;
170406
- }
170407
- const { settings } = getSettingsWithErrors();
170408
- if (settings.alwaysThinkingEnabled === false) {
170409
- return false;
170410
- }
170411
- return true;
170412
- }
170413
- var RAINBOW_COLORS, RAINBOW_SHIMMER_COLORS;
170414
- var init_thinking = __esm(() => {
170415
- init_growthbook();
170416
- init_antModels();
170417
- init_modelSupportOverrides();
170418
- init_providers();
170419
- init_settings2();
170420
- RAINBOW_COLORS = [
170421
- "rainbow_red",
170422
- "rainbow_orange",
170423
- "rainbow_yellow",
170424
- "rainbow_green",
170425
- "rainbow_blue",
170426
- "rainbow_indigo",
170427
- "rainbow_violet"
170428
- ];
170429
- RAINBOW_SHIMMER_COLORS = [
170430
- "rainbow_red_shimmer",
170431
- "rainbow_orange_shimmer",
170432
- "rainbow_yellow_shimmer",
170433
- "rainbow_green_shimmer",
170434
- "rainbow_blue_shimmer",
170435
- "rainbow_indigo_shimmer",
170436
- "rainbow_violet_shimmer"
170437
- ];
170438
- });
170439
-
170440
- // src/utils/effort.ts
170441
- function modelSupportsEffort(model) {
170442
- if (isEnvTruthy(process.env.UR_CODE_ALWAYS_ENABLE_EFFORT)) {
170443
- return true;
170444
- }
170445
- const supported3P = get3PModelCapabilityOverride(model, "effort");
170446
- if (supported3P !== undefined) {
170447
- return supported3P;
170448
- }
170449
- return getAPIProvider() === "ollama";
170450
- }
170451
- function modelSupportsMaxEffort(model) {
170452
- const supported3P = get3PModelCapabilityOverride(model, "max_effort");
170453
- if (supported3P !== undefined) {
170454
- return supported3P;
170455
- }
170456
- if (process.env.USER_TYPE === "ant" && resolveAntModel(model)) {
170457
- return true;
170458
- }
170459
- return false;
170460
- }
170461
- function isEffortLevel(value) {
170462
- return EFFORT_LEVELS.includes(value);
170463
- }
170464
- function parseEffortValue(value) {
170465
- if (value === undefined || value === null || value === "") {
170466
- return;
170467
- }
170468
- if (typeof value === "number" && isValidNumericEffort(value)) {
170469
- return value;
170470
- }
170471
- const str = String(value).toLowerCase();
170472
- if (isEffortLevel(str)) {
170473
- return str;
170474
- }
170475
- const numericValue = parseInt(str, 10);
170476
- if (!isNaN(numericValue) && isValidNumericEffort(numericValue)) {
170477
- return numericValue;
170478
- }
170479
- return;
170480
- }
170481
- function toPersistableEffort(value) {
170482
- if (value === "low" || value === "medium" || value === "high") {
170483
- return value;
170484
- }
170485
- if (value === "max" && process.env.USER_TYPE === "ant") {
170486
- return value;
170487
- }
170488
- return;
170489
- }
170490
- function getInitialEffortSetting() {
170491
- return toPersistableEffort(getInitialSettings().effortLevel);
170492
- }
170493
- function resolvePickerEffortPersistence(picked, modelDefault, priorPersisted, toggledInPicker) {
170494
- const hadExplicit = priorPersisted !== undefined || toggledInPicker;
170495
- return hadExplicit || picked !== modelDefault ? picked : undefined;
170496
- }
170497
- function getEffortEnvOverride() {
170498
- const envOverride = process.env.UR_CODE_EFFORT_LEVEL;
170499
- return envOverride?.toLowerCase() === "unset" || envOverride?.toLowerCase() === "auto" ? null : parseEffortValue(envOverride);
170500
- }
170501
- function resolveAppliedEffort(model, appStateEffortValue) {
170502
- const envOverride = getEffortEnvOverride();
170503
- if (envOverride === null) {
170504
- return;
170505
- }
170506
- const resolved = envOverride ?? appStateEffortValue ?? getDefaultEffortForModel(model);
170507
- if (resolved === "max" && !modelSupportsMaxEffort(model)) {
170508
- return "high";
170509
- }
170510
- return resolved;
170511
- }
170512
- function getDisplayedEffortLevel(model, appStateEffort) {
170513
- const resolved = resolveAppliedEffort(model, appStateEffort) ?? "high";
170514
- return convertEffortValueToLevel(resolved);
170515
- }
170516
- function getEffortSuffix(model, effortValue) {
170517
- if (effortValue === undefined)
170518
- return "";
170519
- const resolved = resolveAppliedEffort(model, effortValue);
170520
- if (resolved === undefined)
170521
- return "";
170522
- return ` with ${convertEffortValueToLevel(resolved)} effort`;
170523
- }
170524
- function isValidNumericEffort(value) {
170525
- return Number.isInteger(value);
170526
- }
170527
- function convertEffortValueToLevel(value) {
170528
- if (typeof value === "string") {
170529
- return isEffortLevel(value) ? value : "high";
170530
- }
170531
- if (process.env.USER_TYPE === "ant" && typeof value === "number") {
170532
- if (value <= 50)
170533
- return "low";
170534
- if (value <= 85)
170535
- return "medium";
170536
- if (value <= 100)
170537
- return "high";
170538
- return "max";
170539
- }
170540
- return "high";
170541
- }
170542
- function getEffortLevelDescription(level) {
170543
- switch (level) {
170544
- case "low":
170545
- return "Quick, straightforward implementation with minimal overhead";
170546
- case "medium":
170547
- return "Balanced approach with standard implementation and testing";
170548
- case "high":
170549
- return "Comprehensive implementation with extensive testing and documentation";
170550
- case "max":
170551
- return "Maximum capability with deepest reasoning";
170552
- }
170553
- }
170554
- function getEffortValueDescription(value) {
170555
- if (process.env.USER_TYPE === "ant" && typeof value === "number") {
170556
- return `[ANT-ONLY] Numeric effort value of ${value}`;
170557
- }
170558
- if (typeof value === "string") {
170559
- return getEffortLevelDescription(value);
170560
- }
170561
- return "Balanced approach with standard implementation and testing";
170562
- }
170563
- function getmodelODefaultEffortConfig() {
170564
- const config3 = getFeatureValue_CACHED_MAY_BE_STALE("tengu_grey_step2", MODELO_DEFAULT_EFFORT_CONFIG_DEFAULT);
170565
- return {
170566
- ...MODELO_DEFAULT_EFFORT_CONFIG_DEFAULT,
170567
- ...config3
170568
- };
170569
- }
170570
- function getDefaultEffortForModel(model) {
170571
- if (process.env.USER_TYPE === "ant") {
170572
- const config3 = getAntModelOverrideConfig();
170573
- const isDefaultModel = config3?.defaultModel !== undefined && model.toLowerCase() === config3.defaultModel.toLowerCase();
170574
- if (isDefaultModel && config3?.defaultModelEffortLevel) {
170575
- return config3.defaultModelEffortLevel;
170576
- }
170577
- const antModel = resolveAntModel(model);
170578
- if (antModel) {
170579
- if (antModel.defaultEffortLevel) {
170580
- return antModel.defaultEffortLevel;
170581
- }
170582
- if (antModel.defaultEffortValue !== undefined) {
170583
- return antModel.defaultEffortValue;
170584
- }
170585
- }
170586
- return;
170587
- }
170588
- if (modelSupportsEffort(model)) {
170589
- if (isProSubscriber()) {
170590
- return "medium";
170591
- }
170592
- if (getmodelODefaultEffortConfig().enabled && (isMaxSubscriber() || isTeamSubscriber())) {
170593
- return "medium";
170594
- }
170595
- }
170596
- if (isUltrathinkEnabled() && modelSupportsEffort(model)) {
170597
- return "medium";
170598
- }
170599
- return;
170600
- }
170601
- var EFFORT_LEVELS, MODELO_DEFAULT_EFFORT_CONFIG_DEFAULT;
170602
- var init_effort = __esm(() => {
170603
- init_thinking();
170604
- init_settings2();
170605
- init_auth();
170606
- init_growthbook();
170607
- init_providers();
170608
- init_modelSupportOverrides();
170609
- init_envUtils();
170610
- init_antModels();
170611
- EFFORT_LEVELS = [
170612
- "low",
170613
- "medium",
170614
- "high",
170615
- "max"
170616
- ];
170617
- MODELO_DEFAULT_EFFORT_CONFIG_DEFAULT = {
170618
- enabled: true,
170619
- dialogTitle: "We recommend medium effort for modelO",
170620
- dialogDescription: "Effort determines how long UR thinks for when completing your task. We recommend medium effort for most tasks to balance speed and intelligence and maximize rate limits. Use ultrathink to trigger high effort when needed."
170621
- };
170622
- });
170623
-
170624
170793
  // src/utils/dxt/mcpbCompat.ts
170625
170794
  var exports_mcpbCompat = {};
170626
170795
  __export(exports_mcpbCompat, {
@@ -184643,7 +184812,7 @@ var init_projectSafety = __esm(() => {
184643
184812
  function getInstruments() {
184644
184813
  if (instruments)
184645
184814
  return instruments;
184646
- const meter = import_api10.metrics.getMeter("ur-agent.gen_ai", "1.81.1");
184815
+ const meter = import_api10.metrics.getMeter("ur-agent.gen_ai", "1.81.3");
184647
184816
  instruments = {
184648
184817
  operationDuration: meter.createHistogram("gen_ai.client.operation.duration", {
184649
184818
  description: "GenAI operation duration.",
@@ -184741,7 +184910,7 @@ function genAiAgentAttributes() {
184741
184910
  "gen_ai.operation.name": GEN_AI_OPERATION_INVOKE_AGENT,
184742
184911
  "gen_ai.provider.name": "ur",
184743
184912
  "gen_ai.agent.name": "UR-Nexus",
184744
- "gen_ai.agent.version": "1.81.1"
184913
+ "gen_ai.agent.version": "1.81.3"
184745
184914
  };
184746
184915
  }
184747
184916
  function genAiWorkflowAttributes(workflowName, workflowRunId) {
@@ -184762,7 +184931,7 @@ function genAiWorkflowAttributes(workflowName, workflowRunId) {
184762
184931
  function startGenAiWorkflowSpan(workflowName, workflowRunId) {
184763
184932
  const attributes = genAiWorkflowAttributes(workflowName, workflowRunId);
184764
184933
  const name = typeof attributes["gen_ai.workflow.name"] === "string" ? `invoke_workflow ${attributes["gen_ai.workflow.name"]}` : GEN_AI_OPERATION_INVOKE_WORKFLOW;
184765
- return import_api10.trace.getTracer("ur-agent.gen_ai", "1.81.1").startSpan(name, { kind: import_api10.SpanKind.INTERNAL, attributes });
184934
+ return import_api10.trace.getTracer("ur-agent.gen_ai", "1.81.3").startSpan(name, { kind: import_api10.SpanKind.INTERNAL, attributes });
184766
184935
  }
184767
184936
  function endGenAiWorkflowSpan(span, options2 = {}) {
184768
184937
  try {
@@ -184800,7 +184969,7 @@ function startGenAiMemorySpan(operation, options2 = {}) {
184800
184969
  if (options2.recordCount !== undefined && Number.isInteger(options2.recordCount) && options2.recordCount >= 0) {
184801
184970
  attributes["gen_ai.memory.record.count"] = options2.recordCount;
184802
184971
  }
184803
- return import_api10.trace.getTracer("ur-agent.gen_ai", "1.81.1").startSpan(operation, { kind: import_api10.SpanKind.INTERNAL, attributes });
184972
+ return import_api10.trace.getTracer("ur-agent.gen_ai", "1.81.3").startSpan(operation, { kind: import_api10.SpanKind.INTERNAL, attributes });
184804
184973
  }
184805
184974
  function endGenAiMemorySpan(span, options2 = {}) {
184806
184975
  try {
@@ -278515,7 +278684,7 @@ function getTelemetryAttributes() {
278515
278684
  attributes["session.id"] = sessionId;
278516
278685
  }
278517
278686
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
278518
- attributes["app.version"] = "1.81.1";
278687
+ attributes["app.version"] = "1.81.3";
278519
278688
  }
278520
278689
  const oauthAccount = getOauthAccountInfo();
278521
278690
  if (oauthAccount) {
@@ -319919,7 +320088,7 @@ function getInstallationEnv() {
319919
320088
  return;
319920
320089
  }
319921
320090
  function getURCodeVersion() {
319922
- return "1.81.1";
320091
+ return "1.81.3";
319923
320092
  }
319924
320093
  async function getInstalledVSCodeExtensionVersion(command) {
319925
320094
  const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
@@ -327289,7 +327458,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
327289
327458
  const client2 = new Client({
327290
327459
  name: "ur",
327291
327460
  title: "UR",
327292
- version: "1.81.1",
327461
+ version: "1.81.3",
327293
327462
  description: "UR-Nexus autonomous engineering workflow engine",
327294
327463
  websiteUrl: PRODUCT_URL
327295
327464
  }, {
@@ -327650,7 +327819,7 @@ var init_client5 = __esm(() => {
327650
327819
  const client2 = new Client({
327651
327820
  name: "ur",
327652
327821
  title: "UR",
327653
- version: "1.81.1",
327822
+ version: "1.81.3",
327654
327823
  description: "UR-Nexus autonomous engineering workflow engine",
327655
327824
  websiteUrl: PRODUCT_URL
327656
327825
  }, {
@@ -340423,7 +340592,7 @@ async function createRuntime() {
340423
340592
  bootstrapTelemetry();
340424
340593
  const resource = defaultResource().merge(detectResources({ detectors: [envDetector] })).merge(resourceFromAttributes({
340425
340594
  [import_semantic_conventions7.ATTR_SERVICE_NAME]: "ur-agent",
340426
- [import_semantic_conventions7.ATTR_SERVICE_VERSION]: "1.81.1"
340595
+ [import_semantic_conventions7.ATTR_SERVICE_VERSION]: "1.81.3"
340427
340596
  }));
340428
340597
  const tracerProvider = exporters.traces.length > 0 ? new BasicTracerProvider({
340429
340598
  resource,
@@ -340456,11 +340625,11 @@ async function createRuntime() {
340456
340625
  setMeterProvider(meterProvider);
340457
340626
  setLoggerProvider(loggerProvider);
340458
340627
  if (meterProvider) {
340459
- const meter = meterProvider.getMeter("ur-agent", "1.81.1");
340628
+ const meter = meterProvider.getMeter("ur-agent", "1.81.3");
340460
340629
  setMeter(meter, (name, options2) => meter.createCounter(name, options2));
340461
340630
  }
340462
340631
  if (loggerProvider) {
340463
- setEventLogger(loggerProvider.getLogger("ur-agent.events", "1.81.1"));
340632
+ setEventLogger(loggerProvider.getLogger("ur-agent.events", "1.81.3"));
340464
340633
  }
340465
340634
  if (!cleanupRegistered3) {
340466
340635
  cleanupRegistered3 = true;
@@ -341122,9 +341291,9 @@ async function assertMinVersion() {
341122
341291
  if (false) {}
341123
341292
  try {
341124
341293
  const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
341125
- if (versionConfig.minVersion && lt("1.81.1", versionConfig.minVersion)) {
341294
+ if (versionConfig.minVersion && lt("1.81.3", versionConfig.minVersion)) {
341126
341295
  console.error(`
341127
- It looks like your version of UR (${"1.81.1"}) needs an update.
341296
+ It looks like your version of UR (${"1.81.3"}) needs an update.
341128
341297
  A newer version (${versionConfig.minVersion} or higher) is required to continue.
341129
341298
 
341130
341299
  To update, please run:
@@ -341340,7 +341509,7 @@ async function installGlobalPackage(specificVersion) {
341340
341509
  logError2(new AutoUpdaterError("Another process is currently installing an update"));
341341
341510
  logEvent("tengu_auto_updater_lock_contention", {
341342
341511
  pid: process.pid,
341343
- currentVersion: "1.81.1"
341512
+ currentVersion: "1.81.3"
341344
341513
  });
341345
341514
  return "in_progress";
341346
341515
  }
@@ -341349,7 +341518,7 @@ async function installGlobalPackage(specificVersion) {
341349
341518
  if (!env2.isRunningWithBun() && env2.isNpmFromWindowsPath()) {
341350
341519
  logError2(new Error("Windows NPM detected in WSL environment"));
341351
341520
  logEvent("tengu_auto_updater_windows_npm_in_wsl", {
341352
- currentVersion: "1.81.1"
341521
+ currentVersion: "1.81.3"
341353
341522
  });
341354
341523
  console.error(`
341355
341524
  Error: Windows NPM detected in WSL
@@ -341884,7 +342053,7 @@ function detectLinuxGlobPatternWarnings() {
341884
342053
  }
341885
342054
  async function getDoctorDiagnostic() {
341886
342055
  const installationType = await getCurrentInstallationType();
341887
- const version2 = typeof MACRO !== "undefined" ? "1.81.1" : "unknown";
342056
+ const version2 = typeof MACRO !== "undefined" ? "1.81.3" : "unknown";
341888
342057
  const installationPath = await getInstallationPath();
341889
342058
  const invokedBinary = getInvokedBinary();
341890
342059
  const multipleInstallations = await detectMultipleInstallations();
@@ -342819,8 +342988,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
342819
342988
  const maxVersion = await getMaxVersion();
342820
342989
  if (maxVersion && gt(version2, maxVersion)) {
342821
342990
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
342822
- if (gte("1.81.1", maxVersion)) {
342823
- logForDebugging(`Native installer: current version ${"1.81.1"} is already at or above maxVersion ${maxVersion}, skipping update`);
342991
+ if (gte("1.81.3", maxVersion)) {
342992
+ logForDebugging(`Native installer: current version ${"1.81.3"} is already at or above maxVersion ${maxVersion}, skipping update`);
342824
342993
  logEvent("tengu_native_update_skipped_max_version", {
342825
342994
  latency_ms: Date.now() - startTime,
342826
342995
  max_version: maxVersion,
@@ -342831,7 +343000,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
342831
343000
  version2 = maxVersion;
342832
343001
  }
342833
343002
  }
342834
- if (!forceReinstall && version2 === "1.81.1" && await versionIsAvailable(version2) && await isPossibleURBinary(executablePath)) {
343003
+ if (!forceReinstall && version2 === "1.81.3" && await versionIsAvailable(version2) && await isPossibleURBinary(executablePath)) {
342835
343004
  logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
342836
343005
  logEvent("tengu_native_update_complete", {
342837
343006
  latency_ms: Date.now() - startTime,
@@ -351636,7 +351805,8 @@ function SpinnerWithVerbInner({
351636
351805
  };
351637
351806
  }, [mode]);
351638
351807
  const effortValue = useAppState((s_4) => s_4.effortValue);
351639
- const effortSuffix = getEffortSuffix(getMainLoopModel(), effortValue);
351808
+ const effortProvider = useAppState((s_4) => s_4.provider.active);
351809
+ const effortSuffix = getEffortSuffix(getMainLoopModel(), effortValue, effortProvider);
351640
351810
  const runningTeammates = getAllInProcessTeammateTasks(tasks).filter((t) => t.status === "running");
351641
351811
  const hasRunningTeammates = runningTeammates.length > 0;
351642
351812
  const allIdle = hasRunningTeammates && runningTeammates.every((t_0) => t_0.isIdle);
@@ -392681,9 +392851,10 @@ function checkRepeatedFailure(signature, config3 = REPEATED_FAILURE_DEFAULTS) {
392681
392851
  };
392682
392852
  }
392683
392853
  if (failures >= config3.limit) {
392854
+ const recoveryHint = config3.recoveryHint ? ` ${config3.recoveryHint.trim()}` : "";
392684
392855
  return {
392685
392856
  action: "refuse",
392686
- reason: `This exact call has already failed ${failures} times with the same ` + `arguments, so it will fail again. Do not retry it unchanged. Either ` + `fix the arguments, use a different tool, or tell the user what is ` + `blocking you and stop.`
392857
+ reason: `This exact call has already failed ${failures} times with the same ` + `arguments, so it will fail again. Do not retry it unchanged. Either ` + `fix the arguments, use a different tool, or tell the user what is ` + `blocking you and stop.${recoveryHint}`
392687
392858
  };
392688
392859
  }
392689
392860
  return { action: "allow" };
@@ -393035,7 +393206,7 @@ async function getURLMarkdownContent(url3, abortController) {
393035
393206
  URL_CACHE.set(url3, entry, { size: Math.max(1, contentBytes) });
393036
393207
  return entry;
393037
393208
  }
393038
- async function applyPromptToMarkdown(prompt, markdownContent, signal, isNonInteractiveSession, isPreapprovedDomain) {
393209
+ async function applyPromptToMarkdown(prompt, markdownContent, signal, isNonInteractiveSession, isPreapprovedDomain, providerSettings) {
393039
393210
  const truncatedContent = markdownContent.length > MAX_MARKDOWN_LENGTH ? markdownContent.slice(0, MAX_MARKDOWN_LENGTH) + `
393040
393211
 
393041
393212
  [Content truncated due to length...]` : markdownContent;
@@ -393049,7 +393220,8 @@ async function applyPromptToMarkdown(prompt, markdownContent, signal, isNonInter
393049
393220
  agents: [],
393050
393221
  isNonInteractiveSession,
393051
393222
  hasAppendSystemPrompt: false,
393052
- mcpTools: []
393223
+ mcpTools: [],
393224
+ providerSettings
393053
393225
  }
393054
393226
  });
393055
393227
  if (signal.aborted) {
@@ -393493,7 +393665,7 @@ To complete your request, I need to fetch content from the redirected URL. Pleas
393493
393665
  if (isPreapproved && contentType2.includes("text/markdown") && content.length < MAX_MARKDOWN_LENGTH) {
393494
393666
  result = content;
393495
393667
  } else {
393496
- result = await applyPromptToMarkdown(prompt, content, abortController.signal, isNonInteractiveSession, isPreapproved);
393668
+ result = await applyPromptToMarkdown(prompt, content, abortController.signal, isNonInteractiveSession, isPreapproved, context5.getAppState().provider);
393497
393669
  }
393498
393670
  if (persistedPath) {
393499
393671
  result += `
@@ -396211,8 +396383,9 @@ function renderToolUseProgressMessage9(progressMessages) {
396211
396383
  }
396212
396384
  function renderToolResultMessage17(output) {
396213
396385
  const {
396214
- searchCount
396386
+ searchCount: inferredSearchCount
396215
396387
  } = getSearchSummary(output.results ?? []);
396388
+ const searchCount = output.searchCount ?? inferredSearchCount;
396216
396389
  const timeDisplay = output.durationSeconds >= 1 ? `${Math.round(output.durationSeconds)}s` : `${Math.round(output.durationSeconds * 1000)}ms`;
396217
396390
  return /* @__PURE__ */ jsx_dev_runtime144.jsxDEV(ThemedBox_default, {
396218
396391
  justifyContent: "space-between",
@@ -396257,7 +396430,7 @@ function makeToolSchema(input, maxUses) {
396257
396430
  max_uses: maxUses
396258
396431
  };
396259
396432
  }
396260
- function makeOutputFromSearchResponse(result, query2, durationSeconds) {
396433
+ function makeOutputFromSearchResponse(result, query2, durationSeconds, searchCount) {
396261
396434
  const results = [];
396262
396435
  let textAcc = "";
396263
396436
  let inText = true;
@@ -396300,7 +396473,8 @@ function makeOutputFromSearchResponse(result, query2, durationSeconds) {
396300
396473
  return {
396301
396474
  query: query2,
396302
396475
  results,
396303
- durationSeconds
396476
+ durationSeconds,
396477
+ ...searchCount !== undefined ? { searchCount } : {}
396304
396478
  };
396305
396479
  }
396306
396480
  var inputSchema28, searchResultSchema, outputSchema24, WebSearchTool;
@@ -396337,7 +396511,8 @@ var init_WebSearchTool = __esm(() => {
396337
396511
  outputSchema24 = lazySchema(() => exports_external.object({
396338
396512
  query: exports_external.string().describe("The search query that was executed"),
396339
396513
  results: exports_external.array(exports_external.union([searchResultSchema(), exports_external.string()])).describe("Search results and/or text commentary from the model"),
396340
- durationSeconds: exports_external.number().describe("Time taken to complete the search operation")
396514
+ durationSeconds: exports_external.number().describe("Time taken to complete the search operation"),
396515
+ searchCount: exports_external.number().int().nonnegative().optional().describe("Provider-reported number of web searches performed")
396341
396516
  }));
396342
396517
  WebSearchTool = buildTool({
396343
396518
  name: WEB_SEARCH_TOOL_NAME,
@@ -396472,7 +396647,7 @@ var init_WebSearchTool = __esm(() => {
396472
396647
  const startTime = performance.now();
396473
396648
  const { query: query2 } = input;
396474
396649
  const userMessage = createUserMessage({
396475
- content: "Perform a web search for the query: " + query2
396650
+ content: "You MUST use the provided web search tool at least once. Perform a web search for the query: " + query2
396476
396651
  });
396477
396652
  const budget = reserveWebSearchBudget(8);
396478
396653
  if (budget.granted === 0) {
@@ -396491,7 +396666,7 @@ var init_WebSearchTool = __esm(() => {
396491
396666
  signal: context5.abortController.signal,
396492
396667
  options: {
396493
396668
  getToolPermissionContext: async () => appState.toolPermissionContext,
396494
- model: usemodelH ? getSmallFastModel() : context5.options.mainLoopModel,
396669
+ model: usemodelH ? getSmallFastModel(appState.provider) : context5.options.mainLoopModel,
396495
396670
  toolChoice: usemodelH ? { type: "tool", name: "web_search" } : undefined,
396496
396671
  isNonInteractiveSession: context5.options.isNonInteractiveSession,
396497
396672
  hasAppendSystemPrompt: !!context5.options.appendSystemPrompt,
@@ -396500,7 +396675,8 @@ var init_WebSearchTool = __esm(() => {
396500
396675
  agents: context5.options.agentDefinitions.activeAgents,
396501
396676
  mcpTools: [],
396502
396677
  agentId: context5.agentId,
396503
- effortValue: appState.effortValue
396678
+ effortValue: appState.effortValue,
396679
+ providerSettings: appState.provider
396504
396680
  }
396505
396681
  });
396506
396682
  const allContentBlocks = [];
@@ -396513,6 +396689,7 @@ var init_WebSearchTool = __esm(() => {
396513
396689
  for await (const event of queryStream) {
396514
396690
  if (event.type === "assistant") {
396515
396691
  allContentBlocks.push(...event.message.content);
396692
+ actualSearches = Math.max(actualSearches, event.message.usage?.server_tool_use?.web_search_requests ?? 0);
396516
396693
  continue;
396517
396694
  }
396518
396695
  if (event.type === "stream_event" && event.event?.type === "content_block_start") {
@@ -396574,7 +396751,10 @@ var init_WebSearchTool = __esm(() => {
396574
396751
  }
396575
396752
  const endTime = performance.now();
396576
396753
  const durationSeconds = (endTime - startTime) / 1000;
396577
- const data = makeOutputFromSearchResponse(allContentBlocks, query2, durationSeconds);
396754
+ const data = makeOutputFromSearchResponse(allContentBlocks, query2, durationSeconds, actualSearches);
396755
+ if (actualSearches === 0) {
396756
+ throw new Error("The selected provider returned text without performing a web search. Retry with a model that supports OpenRouter web search or switch providers.");
396757
+ }
396578
396758
  return { data };
396579
396759
  },
396580
396760
  mapToolResultToToolResultBlockParam(output, toolUseID) {
@@ -413507,7 +413687,7 @@ function isAnyTracingEnabled() {
413507
413687
  return isTelemetryEnabled() || isEnhancedTelemetryEnabled() || isBetaTracingEnabled();
413508
413688
  }
413509
413689
  function getTracer() {
413510
- return import_api39.trace.getTracer("ur-agent.gen_ai", "1.81.1");
413690
+ return import_api39.trace.getTracer("ur-agent.gen_ai", "1.81.3");
413511
413691
  }
413512
413692
  function createSpanAttributes(spanType, customAttributes = {}) {
413513
413693
  const baseAttributes = getTelemetryAttributes();
@@ -414906,6 +415086,9 @@ var init_toolHooks = __esm(() => {
414906
415086
  });
414907
415087
 
414908
415088
  // src/services/tools/toolExecution.ts
415089
+ function getToolRepeatedFailurePolicy(toolName) {
415090
+ return toolName === FILE_EDIT_TOOL_NAME || toolName === FILE_WRITE_TOOL_NAME || toolName === NOTEBOOK_EDIT_TOOL_NAME ? CODE_EDIT_REPEAT_POLICY : REPEATED_FAILURE_DEFAULTS;
415091
+ }
414909
415092
  function countToolCalls(messages, excludedMessageId) {
414910
415093
  if (!Array.isArray(messages))
414911
415094
  return 0;
@@ -415310,7 +415493,7 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input, toolUseContex
415310
415493
  }
415311
415494
  }
415312
415495
  let callSig = callSignature(tool.name, input, repeatedFailureScope(toolUseContext, messageId));
415313
- const repeat2 = checkRepeatedFailure(callSig);
415496
+ const repeat2 = checkRepeatedFailure(callSig, getToolRepeatedFailurePolicy(tool.name));
415314
415497
  if (repeat2.action !== "allow") {
415315
415498
  logEvent("tengu_repeated_failure_guard", {
415316
415499
  toolName: sanitizeToolNameForAnalytics(tool.name),
@@ -416214,7 +416397,7 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input, toolUseContex
416214
416397
  }
416215
416398
  }
416216
416399
  }
416217
- var UNKNOWN_TOOL_REPEAT_POLICY, HOOK_TIMING_DISPLAY_THRESHOLD_MS2 = 500, SLOW_PHASE_LOG_THRESHOLD_MS = 2000;
416400
+ var UNKNOWN_TOOL_REPEAT_POLICY, CODE_EDIT_REPEAT_POLICY, HOOK_TIMING_DISPLAY_THRESHOLD_MS2 = 500, SLOW_PHASE_LOG_THRESHOLD_MS = 2000;
416218
416401
  var init_toolExecution = __esm(() => {
416219
416402
  init_analytics();
416220
416403
  init_metadata();
@@ -416261,6 +416444,12 @@ var init_toolExecution = __esm(() => {
416261
416444
  limit: 1,
416262
416445
  abortAfter: 3
416263
416446
  };
416447
+ CODE_EDIT_REPEAT_POLICY = {
416448
+ enabled: true,
416449
+ limit: 2,
416450
+ abortAfter: 3,
416451
+ recoveryHint: "Read the current target again, then rebuild the edit from the exact current content and use a unique anchor (or replace_all only when every match is intended)."
416452
+ };
416264
416453
  });
416265
416454
 
416266
416455
  // src/services/tools/StreamingToolExecutor.ts
@@ -418501,6 +418690,7 @@ async function* queryLoop(params, consumedCommandUuids, ownedRepeatedFailureQuer
418501
418690
  hasPendingMcpServers: appState.mcp.clients.some((c4) => c4.type === "pending"),
418502
418691
  queryTracking,
418503
418692
  effortValue: appState.effortValue,
418693
+ providerSettings: appState.provider,
418504
418694
  advisorModel: appState.advisorModel,
418505
418695
  skipCacheWrite,
418506
418696
  agentId: toolUseContext.agentId,
@@ -420993,7 +421183,8 @@ async function streamCompactSummary({
420993
421183
  querySource: "compact",
420994
421184
  agents: context5.options.agentDefinitions.activeAgents,
420995
421185
  mcpTools: [],
420996
- effortValue: appState.effortValue
421186
+ effortValue: appState.effortValue,
421187
+ providerSettings: appState.provider
420997
421188
  }
420998
421189
  });
420999
421190
  const streamIter = streamingGen[Symbol.asyncIterator]();
@@ -443655,7 +443846,7 @@ function Feedback({
443655
443846
  platform: env2.platform,
443656
443847
  gitRepo: envInfo.isGit,
443657
443848
  terminal: env2.terminal,
443658
- version: "1.81.1",
443849
+ version: "1.81.3",
443659
443850
  transcript: normalizeMessagesForAPI(messages),
443660
443851
  errors: sanitizedErrors,
443661
443852
  lastApiRequest: getLastAPIRequest(),
@@ -443847,7 +444038,7 @@ function Feedback({
443847
444038
  ", ",
443848
444039
  env2.terminal,
443849
444040
  ", v",
443850
- "1.81.1"
444041
+ "1.81.3"
443851
444042
  ]
443852
444043
  }, undefined, true, undefined, this)
443853
444044
  ]
@@ -443953,7 +444144,7 @@ ${sanitizedDescription}
443953
444144
  ` + `**Environment Info**
443954
444145
  ` + `- Platform: ${env2.platform}
443955
444146
  ` + `- Terminal: ${env2.terminal}
443956
- ` + `- Version: ${"1.81.1"}
444147
+ ` + `- Version: ${"1.81.3"}
443957
444148
  ` + `- Feedback ID: ${feedbackId}
443958
444149
  ` + `
443959
444150
  **Errors**
@@ -447063,7 +447254,7 @@ function buildPrimarySection() {
447063
447254
  }, undefined, false, undefined, this);
447064
447255
  return [{
447065
447256
  label: "Version",
447066
- value: "1.81.1"
447257
+ value: "1.81.3"
447067
447258
  }, {
447068
447259
  label: "Session name",
447069
447260
  value: nameValue
@@ -447830,10 +448021,10 @@ var init_ThemePicker = __esm(() => {
447830
448021
  });
447831
448022
 
447832
448023
  // src/components/EffortIndicator.ts
447833
- function getEffortNotificationText(effortValue, model) {
447834
- if (!modelSupportsEffort(model))
448024
+ function getEffortNotificationText(effortValue, model, provider) {
448025
+ if (!modelSupportsEffort(model, provider))
447835
448026
  return;
447836
- const level = getDisplayedEffortLevel(model, effortValue);
448027
+ const level = getDisplayedEffortLevel(model, effortValue, provider);
447837
448028
  return `${effortLevelToSymbol(level)} ${level} \xB7 /effort`;
447838
448029
  }
447839
448030
  function effortLevelToSymbol(level) {
@@ -450445,7 +450636,7 @@ function Config({
450445
450636
  }
450446
450637
  }, undefined, false, undefined, this)
450447
450638
  }, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime179.jsxDEV(ChannelDowngradeDialog, {
450448
- currentVersion: "1.81.1",
450639
+ currentVersion: "1.81.3",
450449
450640
  onChoice: (choice) => {
450450
450641
  setShowSubmenu(null);
450451
450642
  setTabsHidden(false);
@@ -450457,7 +450648,7 @@ function Config({
450457
450648
  autoUpdatesChannel: "stable"
450458
450649
  };
450459
450650
  if (choice === "stay") {
450460
- newSettings.minimumVersion = "1.81.1";
450651
+ newSettings.minimumVersion = "1.81.3";
450461
450652
  }
450462
450653
  updateSettingsForSource("userSettings", newSettings);
450463
450654
  setSettingsData((prev_27) => ({
@@ -458766,7 +458957,7 @@ function HelpV2(t0) {
458766
458957
  let t6;
458767
458958
  if ($2[31] !== tabs) {
458768
458959
  t6 = /* @__PURE__ */ jsx_dev_runtime206.jsxDEV(Tabs, {
458769
- title: `UR v${"1.81.1"}`,
458960
+ title: `UR v${"1.81.3"}`,
458770
458961
  color: "professionalBlue",
458771
458962
  defaultTab: "general",
458772
458963
  children: tabs
@@ -459699,7 +459890,7 @@ function buildToolUseContext(tools, readFileStateCache, toolPermissionContext, a
459699
459890
  async function handleInitialize(options2) {
459700
459891
  return {
459701
459892
  name: "UR",
459702
- version: "1.81.1",
459893
+ version: "1.81.3",
459703
459894
  protocolVersion: "0.1.0",
459704
459895
  workspaceRoot: options2.cwd,
459705
459896
  capabilities: {
@@ -476807,7 +476998,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
476807
476998
  return [];
476808
476999
  }
476809
477000
  }
476810
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.81.1") {
477001
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.81.3") {
476811
477002
  if (process.env.USER_TYPE === "ant") {
476812
477003
  const changelog = "";
476813
477004
  if (changelog) {
@@ -476834,7 +477025,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.81.1")
476834
477025
  releaseNotes
476835
477026
  };
476836
477027
  }
476837
- function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.81.1") {
477028
+ function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.81.3") {
476838
477029
  if (process.env.USER_TYPE === "ant") {
476839
477030
  const changelog = "";
476840
477031
  if (changelog) {
@@ -479739,7 +479930,7 @@ function getRecentActivitySync() {
479739
479930
  return cachedActivity;
479740
479931
  }
479741
479932
  function getLogoDisplayData() {
479742
- const version2 = process.env.DEMO_VERSION ?? "1.81.1";
479933
+ const version2 = process.env.DEMO_VERSION ?? "1.81.3";
479743
479934
  const serverUrl = getDirectConnectServerUrl();
479744
479935
  const displayPath = process.env.DEMO_VERSION ? "/code/ur" : getDisplayPath(getCwd());
479745
479936
  const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
@@ -479813,35 +480004,87 @@ var init_logoV2Utils = __esm(() => {
479813
480004
  });
479814
480005
 
479815
480006
  // src/components/LogoV2/URBanner.tsx
480007
+ function getURWordmarkGlyphTone(glyph, row, column) {
480008
+ if (glyph === "\u2588") {
480009
+ return SPECULAR_GLYPHS.has(`${row}:${column}`) ? "warningShimmer" : "urShimmer";
480010
+ }
480011
+ if ("\u2557\u2551\u2554\u255D\u255A\u2550".includes(glyph))
480012
+ return "ur";
480013
+ return;
480014
+ }
479816
480015
  function URBanner() {
480016
+ if (isScreenReaderMode()) {
480017
+ return /* @__PURE__ */ jsx_dev_runtime233.jsxDEV(ThemedText, {
480018
+ children: "UR \u2014 the autonomous agent"
480019
+ }, undefined, false, undefined, this);
480020
+ }
479817
480021
  return /* @__PURE__ */ jsx_dev_runtime233.jsxDEV(ThemedBox_default, {
479818
480022
  flexDirection: "column",
479819
480023
  alignItems: "center",
479820
480024
  children: [
479821
- ROWS.map((row, i3) => /* @__PURE__ */ jsx_dev_runtime233.jsxDEV(ThemedText, {
479822
- color: "ur",
480025
+ UR_WORDMARK_ROWS.map((row, i3) => /* @__PURE__ */ jsx_dev_runtime233.jsxDEV(ThemedText, {
479823
480026
  bold: true,
479824
- children: row
480027
+ children: [...row].map((glyph, column) => /* @__PURE__ */ jsx_dev_runtime233.jsxDEV(ThemedText, {
480028
+ color: getURWordmarkGlyphTone(glyph, i3, column),
480029
+ children: glyph
480030
+ }, `${i3}:${column}`, false, undefined, this))
479825
480031
  }, i3, false, undefined, this)),
479826
480032
  /* @__PURE__ */ jsx_dev_runtime233.jsxDEV(ThemedText, {
479827
- color: "ur",
479828
- dimColor: true,
479829
- children: "the autonomous agent"
479830
- }, undefined, false, undefined, this)
480033
+ bold: true,
480034
+ children: [
480035
+ /* @__PURE__ */ jsx_dev_runtime233.jsxDEV(ThemedText, {
480036
+ color: "warningShimmer",
480037
+ children: "\u2726"
480038
+ }, undefined, false, undefined, this),
480039
+ /* @__PURE__ */ jsx_dev_runtime233.jsxDEV(ThemedText, {
480040
+ color: "urShimmer",
480041
+ children: [
480042
+ " ",
480043
+ UR_WORDMARK_TAGLINE,
480044
+ " "
480045
+ ]
480046
+ }, undefined, true, undefined, this),
480047
+ /* @__PURE__ */ jsx_dev_runtime233.jsxDEV(ThemedText, {
480048
+ color: "warningShimmer",
480049
+ children: "\u2726"
480050
+ }, undefined, false, undefined, this)
480051
+ ]
480052
+ }, undefined, true, undefined, this)
479831
480053
  ]
479832
480054
  }, undefined, true, undefined, this);
479833
480055
  }
479834
- var jsx_dev_runtime233, ROWS;
480056
+ var jsx_dev_runtime233, UR_WORDMARK_ROWS, UR_WORDMARK_TAGLINE = "THE AUTONOMOUS AGENT", SPECULAR_GLYPHS;
479835
480057
  var init_URBanner = __esm(() => {
479836
480058
  init_ink2();
480059
+ init_screenReader();
479837
480060
  jsx_dev_runtime233 = __toESM(require_jsx_dev_runtime(), 1);
479838
- ROWS = [
479839
- "\u2588 \u2588 \u2588\u2588\u2588\u2588 ",
479840
- "\u2588 \u2588 \u2588 \u2588",
479841
- "\u2588 \u2588 \u2588\u2588\u2588\u2588 ",
479842
- "\u2588 \u2588 \u2588 \u2588 ",
479843
- " \u2588\u2588\u2588 \u2588 \u2588"
480061
+ UR_WORDMARK_ROWS = [
480062
+ "\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ",
480063
+ "\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557",
480064
+ "\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D",
480065
+ "\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557",
480066
+ "\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551 \u2588\u2588\u2551",
480067
+ " \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D"
479844
480068
  ];
480069
+ SPECULAR_GLYPHS = new Set([
480070
+ "0:0",
480071
+ "0:1",
480072
+ "0:6",
480073
+ "0:7",
480074
+ "0:11",
480075
+ "0:12",
480076
+ "0:13",
480077
+ "0:14",
480078
+ "0:15",
480079
+ "0:16",
480080
+ "1:0",
480081
+ "1:6",
480082
+ "1:11",
480083
+ "1:15",
480084
+ "2:0",
480085
+ "2:6",
480086
+ "2:11"
480087
+ ]);
479845
480088
  });
479846
480089
 
479847
480090
  // src/components/LogoV2/UrHouse.tsx
@@ -480158,6 +480401,7 @@ function CondensedLogo() {
480158
480401
  } = useTerminalSize();
480159
480402
  const agent = useAppState(_temp104);
480160
480403
  const effortValue = useAppState(_temp240);
480404
+ const effortProvider = useAppState((s) => s.provider.active);
480161
480405
  const model = useMainLoopModel();
480162
480406
  const modelDisplayName = renderModelSetting(model);
480163
480407
  const {
@@ -480210,7 +480454,7 @@ function CondensedLogo() {
480210
480454
  textWidth
480211
480455
  } = getCondensedLogoLayout(columns);
480212
480456
  const truncatedVersion = truncate3(version2, Math.max(textWidth - 4, 1));
480213
- const effortSuffix = getEffortSuffix(model, effortValue);
480457
+ const effortSuffix = getEffortSuffix(model, effortValue, effortProvider);
480214
480458
  const {
480215
480459
  shouldSplit,
480216
480460
  truncatedModel,
@@ -480586,6 +480830,7 @@ function LogoV2() {
480586
480830
  const showOverageCreditUpsell = useShowOverageCreditUpsell();
480587
480831
  const agent = useAppState(_temp107);
480588
480832
  const effortValue = useAppState(_temp241);
480833
+ const effortProvider = useAppState((s) => s.provider.active);
480589
480834
  const config4 = getGlobalConfig();
480590
480835
  let changelog;
480591
480836
  try {
@@ -480607,7 +480852,7 @@ function LogoV2() {
480607
480852
  if ($2[2] === Symbol.for("react.memo_cache_sentinel")) {
480608
480853
  t2 = () => {
480609
480854
  const currentConfig = getGlobalConfig();
480610
- if (currentConfig.lastReleaseNotesSeen === "1.81.1") {
480855
+ if (currentConfig.lastReleaseNotesSeen === "1.81.3") {
480611
480856
  return;
480612
480857
  }
480613
480858
  saveGlobalConfig(_temp325);
@@ -480680,7 +480925,7 @@ function LogoV2() {
480680
480925
  agentName: agentNameFromSettings
480681
480926
  } = getLogoDisplayData();
480682
480927
  const agentName = agent ?? agentNameFromSettings;
480683
- const effortSuffix = getEffortSuffix(model, effortValue);
480928
+ const effortSuffix = getEffortSuffix(model, effortValue, effortProvider);
480684
480929
  const t9 = fullModelDisplayName + effortSuffix;
480685
480930
  let t10;
480686
480931
  if ($2[13] !== t9) {
@@ -481292,12 +481537,12 @@ function LogoV2() {
481292
481537
  return t41;
481293
481538
  }
481294
481539
  function _temp325(current) {
481295
- if (current.lastReleaseNotesSeen === "1.81.1") {
481540
+ if (current.lastReleaseNotesSeen === "1.81.3") {
481296
481541
  return current;
481297
481542
  }
481298
481543
  return {
481299
481544
  ...current,
481300
- lastReleaseNotesSeen: "1.81.1"
481545
+ lastReleaseNotesSeen: "1.81.3"
481301
481546
  };
481302
481547
  }
481303
481548
  function _temp241(s_0) {
@@ -497247,7 +497492,7 @@ function compileAgenticCiWorkflow(specName = "default", options2 = {}) {
497247
497492
  if (spec.name !== specName) {
497248
497493
  throw new Error("Agentic CI workflow spec name does not match");
497249
497494
  }
497250
- const packageVersion = options2.packageVersion ?? (typeof MACRO !== "undefined" ? "1.81.1" : "1.81.1");
497495
+ const packageVersion = options2.packageVersion ?? (typeof MACRO !== "undefined" ? "1.81.3" : "1.81.3");
497251
497496
  if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(packageVersion)) {
497252
497497
  throw new Error("invalid ur-agent package version");
497253
497498
  }
@@ -498240,7 +498485,7 @@ runner; \`ur trigger\` is the inbound parser that decides what to run.
498240
498485
  path: ".github/workflows/ur.yml",
498241
498486
  root: "project",
498242
498487
  content: compileAgenticCiWorkflow("default", {
498243
- packageVersion: typeof MACRO !== "undefined" ? "1.81.1" : "1.81.1"
498488
+ packageVersion: typeof MACRO !== "undefined" ? "1.81.3" : "1.81.3"
498244
498489
  })
498245
498490
  },
498246
498491
  {
@@ -498303,7 +498548,7 @@ function value(tokens, flag) {
498303
498548
  return index2 >= 0 ? tokens[index2 + 1] : undefined;
498304
498549
  }
498305
498550
  function cliVersion() {
498306
- return typeof MACRO !== "undefined" ? "1.81.1" : "1.81.1";
498551
+ return typeof MACRO !== "undefined" ? "1.81.3" : "1.81.3";
498307
498552
  }
498308
498553
  function workflowPath(cwd2) {
498309
498554
  return join168(cwd2, ".github", "workflows", "ur-agentic-ci.yml");
@@ -504159,7 +504404,7 @@ function createAcpStdioApp(deps) {
504159
504404
  }
504160
504405
  },
504161
504406
  authMethods: [],
504162
- agentInfo: { name: "UR-Nexus", version: "1.81.1" }
504407
+ agentInfo: { name: "UR-Nexus", version: "1.81.3" }
504163
504408
  })).onRequest("authenticate", () => ({})).onRequest("session/new", async (context6) => {
504164
504409
  const result = runtime2.newSession(context6.params.cwd, context6.params.mcpServers, context6.params.additionalDirectories);
504165
504410
  await runtime2.announce({
@@ -504256,7 +504501,7 @@ function createAcpStdioAgent(deps) {
504256
504501
  }
504257
504502
  },
504258
504503
  authMethods: [],
504259
- agentInfo: { name: "UR-Nexus", version: "1.81.1" }
504504
+ agentInfo: { name: "UR-Nexus", version: "1.81.3" }
504260
504505
  });
504261
504506
  return;
504262
504507
  case "authenticate":
@@ -715508,7 +715753,7 @@ async function captureMemoryDiagnostics(trigger2, dumpNumber = 0) {
715508
715753
  smapsRollup,
715509
715754
  platform: process.platform,
715510
715755
  nodeVersion: process.version,
715511
- ccVersion: "1.81.1"
715756
+ ccVersion: "1.81.3"
715512
715757
  };
715513
715758
  }
715514
715759
  async function performHeapDump(trigger2 = "manual", dumpNumber = 0) {
@@ -716097,7 +716342,7 @@ var init_bridge_kick = __esm(() => {
716097
716342
  var call154 = async () => {
716098
716343
  return {
716099
716344
  type: "text",
716100
- value: "1.81.1"
716345
+ value: "1.81.3"
716101
716346
  };
716102
716347
  }, version2, version_default;
716103
716348
  var init_version = __esm(() => {
@@ -719111,9 +719356,10 @@ function ProviderFirstModelPicker({
719111
719356
  const [credentialNotice, setCredentialNotice] = import_react186.useState(null);
719112
719357
  const [modelReloadToken, setModelReloadToken] = import_react186.useState(0);
719113
719358
  const terminalSize = import_react186.useContext(TerminalSizeContext);
719114
- const keyInputColumns = Math.max(20, (terminalSize?.columns ?? 80) - 14);
719359
+ const keyInputColumns = getProviderKeyInputColumns(terminalSize?.columns);
719115
719360
  const effortValue = useAppState(selectEffortValue2);
719116
- const [effort] = import_react186.useState(effortValue !== undefined ? convertEffortValueToLevel(effortValue) : undefined);
719361
+ const [effort, setEffort] = import_react186.useState(effortValue !== undefined ? convertEffortValueToLevel(effortValue) : undefined);
719362
+ const [hasToggledEffort, setHasToggledEffort] = import_react186.useState(false);
719117
719363
  const appThinkingEnabled = useAppState(selectThinkingEnabled2);
719118
719364
  const hasToggledThinking = false;
719119
719365
  const [thinkingEnabled] = import_react186.useState(() => appThinkingEnabled ?? shouldEnableThinkingByDefault());
@@ -719163,7 +719409,11 @@ function ProviderFirstModelPicker({
719163
719409
  const options5 = result.models.map((model) => ({
719164
719410
  value: model.id,
719165
719411
  label: model.displayName,
719166
- description: `${model.description} \xB7 ${result.source}`,
719412
+ description: formatProviderModelDescription(model, result.source, providerId),
719413
+ pricing: model.pricing,
719414
+ contextLength: model.contextLength,
719415
+ supportedParameters: model.supportedParameters,
719416
+ reasoning: model.reasoning,
719167
719417
  ...model.supportedParameters !== undefined && !model.supportedParameters.includes("tools") ? { disabled: true } : {}
719168
719418
  }));
719169
719419
  setModelOptions(options5);
@@ -719208,6 +719458,11 @@ function ProviderFirstModelPicker({
719208
719458
  const modelVisibleCount = Math.max(1, Math.min(modelSelectOptions.length, Math.max(5, (terminalSize?.rows ?? 24) - 14)));
719209
719459
  const focusedProvider = providerOptions.find((p2) => p2.value === focusedProviderValue);
719210
719460
  const focusedModel = modelOptions.find((m) => m.value === focusedModelValue);
719461
+ const focusedResolvedModel = focusedModel ? parseUserSpecifiedModel(focusedModel.value) : undefined;
719462
+ const focusedSupportsEffort = focusedResolvedModel ? modelSupportsEffort(focusedResolvedModel) : false;
719463
+ const focusedSupportsMax = focusedResolvedModel ? modelSupportsMaxEffort(focusedResolvedModel) : false;
719464
+ const focusedDefaultEffort = focusedResolvedModel ? convertEffortValueToLevel(getDefaultEffortForModel(focusedResolvedModel) ?? "high") : "high";
719465
+ const displayedEffort = effort === "max" && !focusedSupportsMax ? "high" : effort ?? focusedDefaultEffort;
719211
719466
  function handleProviderFocus(value2) {
719212
719467
  setFocusedProviderValue(value2);
719213
719468
  setProviderWarning(null);
@@ -719215,6 +719470,20 @@ function ProviderFirstModelPicker({
719215
719470
  function handleModelFocus(value2) {
719216
719471
  setFocusedModelValue(value2);
719217
719472
  }
719473
+ function handleCycleEffort(direction) {
719474
+ if (!focusedSupportsEffort)
719475
+ return;
719476
+ setEffort((previous) => cycleProviderPickerEffort(previous ?? focusedDefaultEffort, direction, focusedSupportsMax));
719477
+ setHasToggledEffort(true);
719478
+ }
719479
+ use_input_default((_input, key, event) => {
719480
+ if (!key.leftArrow && !key.rightArrow)
719481
+ return;
719482
+ handleCycleEffort(key.rightArrow ? "right" : "left");
719483
+ event.stopImmediatePropagation();
719484
+ }, {
719485
+ isActive: step === "model" && !loadingModels && focusedSupportsEffort
719486
+ });
719218
719487
  function handleProviderSelect(value2) {
719219
719488
  const provider = providerOptions.find((p2) => p2.value === value2);
719220
719489
  if (provider) {
@@ -719296,6 +719565,14 @@ function ProviderFirstModelPicker({
719296
719565
  return;
719297
719566
  }
719298
719567
  }
719568
+ if (hasToggledEffort) {
719569
+ const persistable = effort ? toPersistableEffort(effort) : undefined;
719570
+ if (persistable !== undefined) {
719571
+ updateSettingsForSource("userSettings", {
719572
+ effortLevel: persistable
719573
+ });
719574
+ }
719575
+ }
719299
719576
  setAppState((prev) => ({
719300
719577
  ...prev,
719301
719578
  provider: {
@@ -719303,10 +719580,10 @@ function ProviderFirstModelPicker({
719303
719580
  active: selectedProvider?.value,
719304
719581
  model: value2
719305
719582
  },
719306
- effortValue: effort,
719583
+ ...hasToggledEffort ? { effortValue: effort } : {},
719307
719584
  ...hasToggledThinking ? { thinkingEnabled } : {}
719308
719585
  }));
719309
- onSelect(value2, effort, selectedProvider ? {
719586
+ onSelect(value2, hasToggledEffort ? effort : undefined, selectedProvider ? {
719310
719587
  providerId: selectedProvider.value,
719311
719588
  providerName: selectedProvider.label,
719312
719589
  accessType: selectedProvider.accessType,
@@ -719476,22 +719753,33 @@ function ProviderFirstModelPicker({
719476
719753
  ]
719477
719754
  }, undefined, true, undefined, this),
719478
719755
  /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(ThemedBox_default, {
719756
+ width: "100%",
719757
+ flexDirection: "row",
719479
719758
  children: [
719480
- /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(ThemedText, {
719481
- children: "API key: "
719759
+ /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(ThemedBox_default, {
719760
+ width: 12,
719761
+ flexShrink: 0,
719762
+ children: /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(ThemedText, {
719763
+ bold: true,
719764
+ color: "subtle",
719765
+ children: "API key"
719766
+ }, undefined, false, undefined, this)
719482
719767
  }, undefined, false, undefined, this),
719483
- /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(TextInput, {
719484
- value: apiKeyInput,
719485
- onChange: setApiKeyInput,
719486
- onSubmit: handleKeySubmit,
719487
- mask: "*",
719488
- placeholder: "paste key, then Enter",
719489
- focus: true,
719490
- showCursor: true,
719491
- multiline: false,
719492
- columns: keyInputColumns,
719493
- cursorOffset: apiKeyCursorOffset,
719494
- onChangeCursorOffset: setApiKeyCursorOffset
719768
+ /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(ThemedBox_default, {
719769
+ flexGrow: 1,
719770
+ children: /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(TextInput, {
719771
+ value: apiKeyInput,
719772
+ onChange: setApiKeyInput,
719773
+ onSubmit: handleKeySubmit,
719774
+ mask: "*",
719775
+ placeholder: "paste key, then Enter",
719776
+ focus: true,
719777
+ showCursor: true,
719778
+ multiline: false,
719779
+ columns: keyInputColumns,
719780
+ cursorOffset: apiKeyCursorOffset,
719781
+ onChangeCursorOffset: setApiKeyCursorOffset
719782
+ }, undefined, false, undefined, this)
719495
719783
  }, undefined, false, undefined, this)
719496
719784
  ]
719497
719785
  }, undefined, true, undefined, this),
@@ -719684,34 +719972,31 @@ function ProviderFirstModelPicker({
719684
719972
  /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(ThemedText, {
719685
719973
  color: "remember",
719686
719974
  bold: true,
719687
- children: "Select model"
719975
+ children: selectedProvider?.value === "openrouter" ? "OpenRouter model catalog" : "Select model"
719688
719976
  }, undefined, false, undefined, this),
719689
719977
  /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(ThemedText, {
719690
719978
  dimColor: true,
719691
- children: [
719692
- "Showing models for ",
719693
- selectedProvider?.label,
719694
- " (",
719695
- selectedProvider?.accessType,
719696
- ")"
719697
- ]
719698
- }, undefined, true, undefined, this),
719979
+ children: selectedProvider?.value === "openrouter" ? `${modelOptions.length} current models from your OpenRouter account` : `Showing models for ${selectedProvider?.label} (${selectedProvider?.accessType})`
719980
+ }, undefined, false, undefined, this),
719699
719981
  /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(ThemedText, {
719700
- dimColor: true,
719701
- color: "subtle",
719982
+ color: modelSource === "live" ? "success" : "subtle",
719702
719983
  children: [
719703
- "Model source: ",
719704
- modelSource
719984
+ formatModelSourceLabel(modelSource),
719985
+ /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(ThemedText, {
719986
+ dimColor: true,
719987
+ color: "subtle",
719988
+ children: [
719989
+ " ",
719990
+ "\xB7 agent-capable models can be selected"
719991
+ ]
719992
+ }, undefined, true, undefined, this)
719705
719993
  ]
719706
719994
  }, undefined, true, undefined, this),
719707
719995
  /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(ThemedText, {
719708
719996
  dimColor: true,
719709
719997
  color: "subtle",
719710
- children: [
719711
- "Esc to change provider \xB7 ctrl+r to refresh from ",
719712
- selectedProvider?.label
719713
- ]
719714
- }, undefined, true, undefined, this)
719998
+ children: "\u2191\u2193 browse \xB7 Enter select \xB7 \u2190\u2192 effort \xB7 Ctrl+R refresh \xB7 Esc providers"
719999
+ }, undefined, false, undefined, this)
719715
720000
  ]
719716
720001
  }, undefined, true, undefined, this),
719717
720002
  loadingModels ? /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(ThemedBox_default, {
@@ -719743,25 +720028,34 @@ function ProviderFirstModelPicker({
719743
720028
  flexDirection: "column",
719744
720029
  children: [
719745
720030
  /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(ThemedText, {
719746
- dimColor: true,
719747
- children: [
719748
- focusedModel.label,
719749
- " \xB7 ",
719750
- focusedModel.description
719751
- ]
719752
- }, undefined, true, undefined, this),
720031
+ bold: true,
720032
+ color: "text",
720033
+ children: focusedModel.label
720034
+ }, undefined, false, undefined, this),
719753
720035
  /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(ThemedText, {
719754
720036
  dimColor: true,
719755
- color: "subtle",
720037
+ children: focusedModel.description
720038
+ }, undefined, false, undefined, this),
720039
+ focusedSupportsEffort && /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(ThemedText, {
719756
720040
  children: [
719757
- "Source: ",
719758
- modelSource
720041
+ /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(ThemedText, {
720042
+ color: "ur",
720043
+ children: [
720044
+ effortLevelToSymbol(displayedEffort),
720045
+ " ",
720046
+ displayedEffort.toUpperCase()
720047
+ ]
720048
+ }, undefined, true, undefined, this),
720049
+ /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(ThemedText, {
720050
+ dimColor: true,
720051
+ color: "subtle",
720052
+ children: [
720053
+ " ",
720054
+ "effort \xB7 use \u2190 \u2192 to adjust"
720055
+ ]
720056
+ }, undefined, true, undefined, this)
719759
720057
  ]
719760
- }, undefined, true, undefined, this),
719761
- modelSupportsEffort(parseUserSpecifiedModel(focusedModel.value)) && /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(ThemedText, {
719762
- dimColor: true,
719763
- children: "\u2190 \u2192 to adjust effort"
719764
- }, undefined, false, undefined, this)
720058
+ }, undefined, true, undefined, this)
719765
720059
  ]
719766
720060
  }, undefined, true, undefined, this),
719767
720061
  modelWarning && /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(ThemedBox_default, {
@@ -719824,6 +720118,45 @@ function ProviderFirstModelPicker({
719824
720118
  }, undefined, false, undefined, this);
719825
720119
  }
719826
720120
  function noop8() {}
720121
+ function getProviderKeyInputColumns(terminalColumns) {
720122
+ const columns = Number.isFinite(terminalColumns) && terminalColumns > 0 ? Math.floor(terminalColumns) : 80;
720123
+ return Math.max(8, columns - 20);
720124
+ }
720125
+ function cycleProviderPickerEffort(current, direction, includeMax) {
720126
+ const levels = includeMax ? ["low", "medium", "high", "max"] : ["low", "medium", "high"];
720127
+ const index2 = levels.indexOf(current);
720128
+ const currentIndex = index2 >= 0 ? index2 : levels.indexOf("high");
720129
+ const delta = direction === "right" ? 1 : -1;
720130
+ return levels[(currentIndex + delta + levels.length) % levels.length];
720131
+ }
720132
+ function formatModelSourceLabel(source) {
720133
+ if (source === "live")
720134
+ return "\u25CF LIVE CATALOG";
720135
+ if (source === "cache")
720136
+ return "\u25D0 CACHED CATALOG";
720137
+ return "\u25CB BUILT-IN CATALOG";
720138
+ }
720139
+ function formatProviderModelDescription(model, source, providerId) {
720140
+ if (providerId !== "openrouter") {
720141
+ return `${model.description} \xB7 ${source}`;
720142
+ }
720143
+ const details = [];
720144
+ if (model.pricing === "free")
720145
+ details.push("FREE");
720146
+ else if (model.pricing === "paid")
720147
+ details.push("PAID");
720148
+ if (model.contextLength) {
720149
+ details.push(model.contextLength >= 1e6 ? `${Math.round(model.contextLength / 1e6)}M context` : `${Math.round(model.contextLength / 1000)}K context`);
720150
+ }
720151
+ if (model.supportedParameters?.includes("tools"))
720152
+ details.push("tools");
720153
+ else if (model.supportedParameters)
720154
+ details.push("chat only");
720155
+ if (model.reasoning || model.supportedParameters?.some((parameter) => parameter === "reasoning" || parameter === "reasoning_effort")) {
720156
+ details.push("reasoning");
720157
+ }
720158
+ return details.length > 0 ? details.join(" \xB7 ") : model.description;
720159
+ }
719827
720160
  var import_react186, jsx_dev_runtime336, selectCurrentProvider = (s) => s.provider?.active ?? "ollama", selectEffortValue2 = (s) => s.effortValue, selectThinkingEnabled2 = (s) => s.thinkingEnabled;
719828
720161
  var init_ProviderFirstModelPicker = __esm(() => {
719829
720162
  init_analytics();
@@ -719845,6 +720178,7 @@ var init_ProviderFirstModelPicker = __esm(() => {
719845
720178
  init_model();
719846
720179
  init_thinking();
719847
720180
  init_providerClient();
720181
+ init_EffortIndicator();
719848
720182
  import_react186 = __toESM(require_react(), 1);
719849
720183
  jsx_dev_runtime336 = __toESM(require_jsx_dev_runtime(), 1);
719850
720184
  });
@@ -719892,13 +720226,15 @@ function ModelPickerWrapper(t0) {
719892
720226
  setAppState((prev) => ({
719893
720227
  ...prev,
719894
720228
  mainLoopModel: model,
719895
- mainLoopModelForSession: null
720229
+ mainLoopModelForSession: null,
720230
+ ...model && metadata ? {
720231
+ provider: {
720232
+ ...prev.provider,
720233
+ active: metadata.providerId,
720234
+ model
720235
+ }
720236
+ } : {}
719896
720237
  }));
719897
- if (model && metadata) {
719898
- setProviderModel(metadata.providerId, model, {
719899
- modelSource: metadata.modelSource
719900
- });
719901
- }
719902
720238
  let message = metadata ? `Selected provider: ${source_default.bold(metadata.providerName)} (${metadata.accessType})
719903
720239
  Selected model: ${source_default.bold(renderModelLabel(model))}
719904
720240
  Model source: ${metadata.modelSource}
@@ -721771,7 +722107,7 @@ __export(exports_effort, {
721771
722107
  executeEffort: () => executeEffort,
721772
722108
  call: () => call168
721773
722109
  });
721774
- function setEffortValue(effortValue) {
722110
+ function setEffortValue(effortValue, model) {
721775
722111
  const persistable = toPersistableEffort(effortValue);
721776
722112
  if (persistable !== undefined) {
721777
722113
  const result = updateSettingsForSource("userSettings", {
@@ -721806,6 +722142,15 @@ function setEffortValue(effortValue) {
721806
722142
  }
721807
722143
  const description = getEffortValueDescription(effortValue);
721808
722144
  const suffix = persistable !== undefined ? "" : " (this session only)";
722145
+ const appliedLevel = model ? getDisplayedEffortLevel(model, effortValue) : effortValue;
722146
+ if (typeof effortValue === "string" && appliedLevel !== effortValue) {
722147
+ return {
722148
+ message: `Requested effort level ${effortValue}${suffix}, but ${model} advertises up to ${appliedLevel}; applied ${appliedLevel}: ${getEffortValueDescription(appliedLevel)}`,
722149
+ effortUpdate: {
722150
+ value: effortValue
722151
+ }
722152
+ };
722153
+ }
721809
722154
  return {
721810
722155
  message: `Set effort level to ${effortValue}${suffix}: ${description}`,
721811
722156
  effortUpdate: {
@@ -721822,6 +722167,12 @@ function showCurrentEffort(appStateEffort, model) {
721822
722167
  message: `Effort level: auto (currently ${level})`
721823
722168
  };
721824
722169
  }
722170
+ const appliedLevel = getDisplayedEffortLevel(model, appStateEffort);
722171
+ if (typeof effectiveValue === "string" && appliedLevel !== effectiveValue) {
722172
+ return {
722173
+ message: `Requested effort: ${effectiveValue}; applied effort for ${model}: ${appliedLevel} (${getEffortValueDescription(appliedLevel)})`
722174
+ };
722175
+ }
721825
722176
  const description = getEffortValueDescription(effectiveValue);
721826
722177
  return {
721827
722178
  message: `Current effort level: ${effectiveValue} (${description})`
@@ -721856,7 +722207,7 @@ function unsetEffortLevel() {
721856
722207
  }
721857
722208
  };
721858
722209
  }
721859
- function executeEffort(args) {
722210
+ function executeEffort(args, model) {
721860
722211
  const normalized = args.toLowerCase();
721861
722212
  if (normalized === "auto" || normalized === "unset") {
721862
722213
  return unsetEffortLevel();
@@ -721866,7 +722217,7 @@ function executeEffort(args) {
721866
722217
  message: `Invalid argument: ${args}. Valid options are: low, medium, high, max, auto`
721867
722218
  };
721868
722219
  }
721869
- return setEffortValue(normalized);
722220
+ return setEffortValue(normalized, model);
721870
722221
  }
721871
722222
  function ShowCurrentEffort(t0) {
721872
722223
  const {
@@ -721938,7 +722289,14 @@ Effort levels:
721938
722289
  onDone
721939
722290
  }, undefined, false, undefined, this);
721940
722291
  }
721941
- const result = executeEffort(args);
722292
+ const model = getMainLoopModel();
722293
+ const runtimeProvider = getRuntimeProvider();
722294
+ if (args.toLowerCase() === "max" && runtimeProvider === "openrouter" && !getProviderReasoningCapabilitiesForModel(model, runtimeProvider)) {
722295
+ await ensureProviderModelsFresh(runtimeProvider).catch(() => {
722296
+ return;
722297
+ });
722298
+ }
722299
+ const result = executeEffort(args, model);
721942
722300
  return /* @__PURE__ */ jsx_dev_runtime345.jsxDEV(ApplyEffortAndClose, {
721943
722301
  result,
721944
722302
  onDone
@@ -721950,6 +722308,9 @@ var init_effort2 = __esm(() => {
721950
722308
  init_analytics();
721951
722309
  init_AppState();
721952
722310
  init_effort();
722311
+ init_providerRegistry();
722312
+ init_model();
722313
+ init_providers();
721953
722314
  init_settings2();
721954
722315
  import_compiler_runtime251 = __toESM(require_compiler_runtime(), 1);
721955
722316
  React105 = __toESM(require_react(), 1);
@@ -727340,7 +727701,7 @@ function generateHtmlReport(data, insights) {
727340
727701
  </html>`;
727341
727702
  }
727342
727703
  function buildExportData(data, insights, facets, remoteStats) {
727343
- const version3 = typeof MACRO !== "undefined" ? "1.81.1" : "unknown";
727704
+ const version3 = typeof MACRO !== "undefined" ? "1.81.3" : "unknown";
727344
727705
  const remote_hosts_collected = remoteStats?.hosts.filter((h2) => h2.sessionCount > 0).map((h2) => h2.name);
727345
727706
  const facets_summary = {
727346
727707
  total: facets.size,
@@ -731653,7 +732014,7 @@ var init_sessionStorage = __esm(() => {
731653
732014
  init_settings2();
731654
732015
  init_slowOperations();
731655
732016
  init_uuid();
731656
- VERSION7 = typeof MACRO !== "undefined" ? "1.81.1" : "unknown";
732017
+ VERSION7 = typeof MACRO !== "undefined" ? "1.81.3" : "unknown";
731657
732018
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
731658
732019
  SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
731659
732020
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -732868,7 +733229,7 @@ var init_filesystem = __esm(() => {
732868
733229
  });
732869
733230
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
732870
733231
  const nonce = randomBytes24(16).toString("hex");
732871
- return join243(getURTempDir(), "bundled-skills", "1.81.1", nonce);
733232
+ return join243(getURTempDir(), "bundled-skills", "1.81.3", nonce);
732872
733233
  });
732873
733234
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
732874
733235
  });
@@ -739268,7 +739629,7 @@ function computeFingerprint(messageText2, version3) {
739268
739629
  }
739269
739630
  function computeFingerprintFromMessages(messages) {
739270
739631
  const firstMessageText = extractFirstMessageText(messages);
739271
- return computeFingerprint(firstMessageText, "1.81.1");
739632
+ return computeFingerprint(firstMessageText, "1.81.3");
739272
739633
  }
739273
739634
  var FINGERPRINT_SALT = "59cf53e54c78";
739274
739635
  var init_fingerprint = () => {};
@@ -739681,7 +740042,8 @@ async function* executeNonStreamingRequest(clientOptions, retryOptions, paramsFr
739681
740042
  maxRetries: 0,
739682
740043
  model: clientOptions.model,
739683
740044
  fetchOverride: clientOptions.fetchOverride,
739684
- source: clientOptions.source
740045
+ source: clientOptions.source,
740046
+ providerSettings: clientOptions.providerSettings
739685
740047
  }), async (urhq, attempt, context6) => {
739686
740048
  const start = Date.now();
739687
740049
  const retryParams = paramsFromContext(context6);
@@ -739971,7 +740333,7 @@ ${deferredToolList}
739971
740333
  setThinkingClearLatched(true);
739972
740334
  }
739973
740335
  }
739974
- const effort = resolveAppliedEffort(options5.model, options5.effortValue);
740336
+ const effort = resolveAppliedEffort(options5.model, options5.effortValue, options5.providerSettings?.active);
739975
740337
  if (false) {}
739976
740338
  const newContext = isBetaTracingEnabled() || shouldCaptureGenAiContent() ? {
739977
740339
  systemPrompt: systemPrompt.join(`
@@ -740161,7 +740523,8 @@ ${deferredToolList}
740161
740523
  maxRetries: 0,
740162
740524
  model: options5.model,
740163
740525
  fetchOverride: options5.fetchOverride,
740164
- source: options5.querySource
740526
+ source: options5.querySource,
740527
+ providerSettings: options5.providerSettings
740165
740528
  }), async (urhq, attempt, context6) => {
740166
740529
  attemptNumber = attempt;
740167
740530
  isFastModeRequest = context6.fastMode ?? false;
@@ -740592,7 +740955,11 @@ ${deferredToolList}
740592
740955
  model: options5.model,
740593
740956
  fallback_cause: streamIdleAborted ? "watchdog" : "other"
740594
740957
  });
740595
- const result = yield* executeNonStreamingRequest({ model: options5.model, source: options5.querySource }, {
740958
+ const result = yield* executeNonStreamingRequest({
740959
+ model: options5.model,
740960
+ source: options5.querySource,
740961
+ providerSettings: options5.providerSettings
740962
+ }, {
740596
740963
  model: options5.model,
740597
740964
  fallbackModel: options5.fallbackModel,
740598
740965
  thinkingConfig,
@@ -740649,7 +741016,11 @@ ${deferredToolList}
740649
741016
  fallback_cause: "404_stream_creation"
740650
741017
  });
740651
741018
  try {
740652
- const result = yield* executeNonStreamingRequest({ model: options5.model, source: options5.querySource }, {
741019
+ const result = yield* executeNonStreamingRequest({
741020
+ model: options5.model,
741021
+ source: options5.querySource,
741022
+ providerSettings: options5.providerSettings
741023
+ }, {
740653
741024
  model: options5.model,
740654
741025
  fallbackModel: options5.fallbackModel,
740655
741026
  thinkingConfig,
@@ -741016,7 +741387,7 @@ async function querymodelH({
741016
741387
  signal,
741017
741388
  options: {
741018
741389
  ...options5,
741019
- model: getSmallFastModel(),
741390
+ model: getSmallFastModel(options5.providerSettings),
741020
741391
  enablePromptCaching: options5.enablePromptCaching ?? false,
741021
741392
  outputFormat,
741022
741393
  async getToolPermissionContext() {
@@ -741193,7 +741564,7 @@ async function sideQuery(opts) {
741193
741564
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
741194
741565
  }
741195
741566
  const messageText2 = extractFirstUserMessageText(messages);
741196
- const fingerprint2 = computeFingerprint(messageText2, "1.81.1");
741567
+ const fingerprint2 = computeFingerprint(messageText2, "1.81.3");
741197
741568
  const attributionHeader = getAttributionHeader(fingerprint2);
741198
741569
  const systemBlocks = [
741199
741570
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -746027,7 +746398,7 @@ function buildSystemInitMessage(inputs) {
746027
746398
  slash_commands: inputs.commands.filter((c4) => c4.userInvocable !== false).map((c4) => c4.name),
746028
746399
  apiKeySource: getURHQApiKeyWithSource().source,
746029
746400
  betas: getSdkBetas(),
746030
- ur_version: "1.81.1",
746401
+ ur_version: "1.81.3",
746031
746402
  output_style: outputStyle,
746032
746403
  agents: inputs.agents.map((agent2) => agent2.agentType),
746033
746404
  skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill2) => skill2.name),
@@ -759863,7 +760234,7 @@ var init_useVoiceEnabled = __esm(() => {
759863
760234
  function getSemverPart(version3) {
759864
760235
  return `${import_semver13.major(version3, { loose: true })}.${import_semver13.minor(version3, { loose: true })}.${import_semver13.patch(version3, { loose: true })}`;
759865
760236
  }
759866
- function useUpdateNotification(updatedVersion, initialVersion = "1.81.1") {
760237
+ function useUpdateNotification(updatedVersion, initialVersion = "1.81.3") {
759867
760238
  const [lastNotifiedSemver, setLastNotifiedSemver] = import_react225.useState(() => getSemverPart(initialVersion));
759868
760239
  if (!updatedVersion) {
759869
760240
  return null;
@@ -759912,7 +760283,7 @@ function AutoUpdater({
759912
760283
  return;
759913
760284
  }
759914
760285
  if (false) {}
759915
- const currentVersion = "1.81.1";
760286
+ const currentVersion = "1.81.3";
759916
760287
  const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
759917
760288
  let latestVersion = await getLatestVersion(channel);
759918
760289
  const isDisabled = isAutoUpdaterDisabled();
@@ -760141,12 +760512,12 @@ function NativeAutoUpdater({
760141
760512
  logEvent("tengu_native_auto_updater_start", {});
760142
760513
  try {
760143
760514
  const maxVersion = await getMaxVersion();
760144
- if (maxVersion && gt("1.81.1", maxVersion)) {
760515
+ if (maxVersion && gt("1.81.3", maxVersion)) {
760145
760516
  const msg = await getMaxVersionMessage();
760146
760517
  setMaxVersionIssue(msg ?? "affects your version");
760147
760518
  }
760148
760519
  const result = await installLatest(channel);
760149
- const currentVersion = "1.81.1";
760520
+ const currentVersion = "1.81.3";
760150
760521
  const latencyMs = Date.now() - startTime;
760151
760522
  if (result.lockFailed) {
760152
760523
  logEvent("tengu_native_auto_updater_lock_contention", {
@@ -760283,17 +760654,17 @@ function PackageManagerAutoUpdater(t0) {
760283
760654
  const maxVersion = await getMaxVersion();
760284
760655
  if (maxVersion && latest && gt(latest, maxVersion)) {
760285
760656
  logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
760286
- if (gte("1.81.1", maxVersion)) {
760287
- logForDebugging(`PackageManagerAutoUpdater: current version ${"1.81.1"} is already at or above maxVersion ${maxVersion}, skipping update`);
760657
+ if (gte("1.81.3", maxVersion)) {
760658
+ logForDebugging(`PackageManagerAutoUpdater: current version ${"1.81.3"} is already at or above maxVersion ${maxVersion}, skipping update`);
760288
760659
  setUpdateAvailable(false);
760289
760660
  return;
760290
760661
  }
760291
760662
  latest = maxVersion;
760292
760663
  }
760293
- const hasUpdate = latest && !gte("1.81.1", latest) && !shouldSkipVersion(latest);
760664
+ const hasUpdate = latest && !gte("1.81.3", latest) && !shouldSkipVersion(latest);
760294
760665
  setUpdateAvailable(!!hasUpdate);
760295
760666
  if (hasUpdate) {
760296
- logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.81.1"} -> ${latest}`);
760667
+ logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.81.3"} -> ${latest}`);
760297
760668
  }
760298
760669
  };
760299
760670
  $2[0] = t1;
@@ -760327,7 +760698,7 @@ function PackageManagerAutoUpdater(t0) {
760327
760698
  wrap: "truncate",
760328
760699
  children: [
760329
760700
  "currentVersion: ",
760330
- "1.81.1"
760701
+ "1.81.3"
760331
760702
  ]
760332
760703
  }, undefined, true, undefined, this);
760333
760704
  $2[3] = verbose;
@@ -771180,7 +771551,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
771180
771551
  project_dir: getOriginalCwd(),
771181
771552
  added_dirs: addedDirs
771182
771553
  },
771183
- version: "1.81.1",
771554
+ version: "1.81.3",
771184
771555
  output_style: {
771185
771556
  name: outputStyleName
771186
771557
  },
@@ -771315,7 +771686,7 @@ function StatusLineInner({
771315
771686
  const attention = customStatusError ?? taskAttention;
771316
771687
  const terminalSize = React133.useContext(TerminalSizeContext);
771317
771688
  const defaultStatusLineText = buildDefaultStatusBar({
771318
- version: "1.81.1",
771689
+ version: "1.81.3",
771319
771690
  providerLabel: providerRuntime.providerLabel,
771320
771691
  authMode: providerRuntime.authLabel,
771321
771692
  model: renderModelName(mainLoopModel) || providerRuntime.model || "",
@@ -773817,6 +774188,7 @@ function PromptInput({
773817
774188
  const thinkingEnabled = useAppState((s) => s.thinkingEnabled);
773818
774189
  const isFastMode = useAppState((s) => isFastModeEnabled() ? s.fastMode : false);
773819
774190
  const effortValue = useAppState((s) => s.effortValue);
774191
+ const effortProvider = useAppState((s) => s.provider.active);
773820
774192
  const viewedTeammate = getViewedTeammateTask(store2.getState());
773821
774193
  const viewingAgentName = viewedTeammate?.identity.agentName;
773822
774194
  const viewingAgentColor = viewedTeammate?.identity.color && AGENT_COLORS.includes(viewedTeammate.identity.color) ? viewedTeammate.identity.color : undefined;
@@ -774985,7 +775357,7 @@ function PromptInput({
774985
775357
  const fastModeCooldown = isFastModeEnabled() ? isFastModeCooldown() : false;
774986
775358
  const showFastIcon = isFastModeEnabled() ? isFastMode && (isFastModeAvailable() || fastModeCooldown) : false;
774987
775359
  const showFastIconHint = useShowFastIconHint(showFastIcon ?? false);
774988
- const effortNotificationText = briefOwnsGap ? undefined : getEffortNotificationText(effortValue, mainLoopModel);
775360
+ const effortNotificationText = briefOwnsGap ? undefined : getEffortNotificationText(effortValue, mainLoopModel, effortProvider);
774989
775361
  import_react258.useEffect(() => {
774990
775362
  if (!effortNotificationText) {
774991
775363
  removeNotification("effort-level");
@@ -783570,7 +783942,7 @@ async function submitTranscriptShare(messages, trigger2, appearanceId) {
783570
783942
  } catch {}
783571
783943
  const data = {
783572
783944
  trigger: trigger2,
783573
- version: "1.81.1",
783945
+ version: "1.81.3",
783574
783946
  platform: process.platform,
783575
783947
  transcript,
783576
783948
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -795939,7 +796311,7 @@ function WelcomeV2() {
795939
796311
  dimColor: true,
795940
796312
  children: [
795941
796313
  "v",
795942
- "1.81.1"
796314
+ "1.81.3"
795943
796315
  ]
795944
796316
  }, undefined, true, undefined, this)
795945
796317
  ]
@@ -797199,7 +797571,7 @@ function completeOnboarding() {
797199
797571
  saveGlobalConfig((current) => ({
797200
797572
  ...current,
797201
797573
  hasCompletedOnboarding: true,
797202
- lastOnboardingVersion: "1.81.1"
797574
+ lastOnboardingVersion: "1.81.3"
797203
797575
  }));
797204
797576
  }
797205
797577
  function showDialog(root2, renderer) {
@@ -802345,7 +802717,7 @@ function appendToLog(path28, message) {
802345
802717
  cwd: getFsImplementation().cwd(),
802346
802718
  userType: process.env.USER_TYPE,
802347
802719
  sessionId: getSessionId(),
802348
- version: "1.81.1"
802720
+ version: "1.81.3"
802349
802721
  };
802350
802722
  getLogWriter(path28).write(messageWithTimestamp);
802351
802723
  }
@@ -806509,8 +806881,8 @@ async function getEnvLessBridgeConfig() {
806509
806881
  }
806510
806882
  async function checkEnvLessBridgeMinVersion() {
806511
806883
  const cfg = await getEnvLessBridgeConfig();
806512
- if (cfg.min_version && lt("1.81.1", cfg.min_version)) {
806513
- return `Your version of UR (${"1.81.1"}) is too old for Remote Control.
806884
+ if (cfg.min_version && lt("1.81.3", cfg.min_version)) {
806885
+ return `Your version of UR (${"1.81.3"}) is too old for Remote Control.
806514
806886
  Version ${cfg.min_version} or higher is required. Run \`ur update\` to update.`;
806515
806887
  }
806516
806888
  return null;
@@ -806984,7 +807356,7 @@ async function initBridgeCore(params) {
806984
807356
  const rawApi = createBridgeApiClient({
806985
807357
  baseUrl,
806986
807358
  getAccessToken,
806987
- runnerVersion: "1.81.1",
807359
+ runnerVersion: "1.81.3",
806988
807360
  onDebug: logForDebugging,
806989
807361
  onAuth401,
806990
807362
  getTrustedDeviceToken
@@ -816457,7 +816829,7 @@ function getAgUiCapabilities() {
816457
816829
  name: "UR-Nexus",
816458
816830
  type: "ur-nexus",
816459
816831
  description: "Provider-flexible, local-first autonomous engineering workflow agent.",
816460
- version: "1.81.1",
816832
+ version: "1.81.3",
816461
816833
  provider: "UR",
816462
816834
  documentationUrl: "https://github.com/Maitham16/UR/blob/master/docs/AG_UI.md"
816463
816835
  },
@@ -817684,7 +818056,7 @@ function createMCPServer(cwd4, debug2, verbose) {
817684
818056
  };
817685
818057
  const server2 = new Server({
817686
818058
  name: "ur-nexus",
817687
- version: "1.81.1"
818059
+ version: "1.81.3"
817688
818060
  }, {
817689
818061
  capabilities: {
817690
818062
  tools: {}
@@ -818888,7 +819260,7 @@ function thrownResponse(error40) {
818888
819260
  }
818889
819261
  async function createUrMcp2026Runtime(options5) {
818890
819262
  const server2 = createMCPServer(options5.cwd, options5.debug === true, options5.verbose === true);
818891
- const client2 = new Client({ name: "ur-mcp-2026-adapter", version: "1.81.1" }, { capabilities: {} });
819263
+ const client2 = new Client({ name: "ur-mcp-2026-adapter", version: "1.81.3" }, { capabilities: {} });
818892
819264
  const [clientTransport, serverTransport] = createLinkedTransportPair();
818893
819265
  try {
818894
819266
  await server2.connect(serverTransport);
@@ -818899,7 +819271,7 @@ async function createUrMcp2026Runtime(options5) {
818899
819271
  }
818900
819272
  const runtime2 = new Mcp2026Runtime({
818901
819273
  cwd: options5.cwd,
818902
- version: "1.81.1",
819274
+ version: "1.81.3",
818903
819275
  backend: {
818904
819276
  listTools: async () => {
818905
819277
  const listed = await client2.listTools();
@@ -821634,7 +822006,7 @@ async function update() {
821634
822006
  logEvent("tengu_update_check", {});
821635
822007
  const diagnostic2 = await getDoctorDiagnostic();
821636
822008
  const result = await checkUpgradeStatus({
821637
- currentVersion: "1.81.1",
822009
+ currentVersion: "1.81.3",
821638
822010
  packageName: UR_AGENT_PACKAGE_NAME,
821639
822011
  installationType: diagnostic2.installationType,
821640
822012
  latestVersion: () => getLatestNpmPackageVersion(UR_AGENT_PACKAGE_NAME)
@@ -822962,7 +823334,7 @@ ${customInstructions}` : customInstructions;
822962
823334
  }
822963
823335
  }
822964
823336
  logForDiagnosticsNoPII("info", "started", {
822965
- version: "1.81.1",
823337
+ version: "1.81.3",
822966
823338
  is_native_binary: isInBundledMode()
822967
823339
  });
822968
823340
  registerCleanup(async () => {
@@ -823749,7 +824121,7 @@ Usage: ur --remote "your task description"`, () => gracefulShutdown(1));
823749
824121
  pendingHookMessages
823750
824122
  }, renderAndRun);
823751
824123
  }
823752
- }).version("1.81.1 (UR-Nexus)", "-v, --version", "Output the version number");
824124
+ }).version("1.81.3 (UR-Nexus)", "-v, --version", "Output the version number");
823753
824125
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
823754
824126
  program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
823755
824127
  if (canUserConfigureAdvisor()) {
@@ -824876,7 +825248,7 @@ if (false) {}
824876
825248
  async function main2() {
824877
825249
  const args = process.argv.slice(2);
824878
825250
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
824879
- console.log(`${"1.81.1"} (UR-Nexus)`);
825251
+ console.log(`${"1.81.3"} (UR-Nexus)`);
824880
825252
  return;
824881
825253
  }
824882
825254
  if (args[0] === "a2a" && args[1] === "serve" && !args.includes("--help") && !args.includes("-h")) {