ur-agent 1.30.4 → 1.30.6

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
@@ -11389,32 +11389,15 @@ function isRunningOnHomespace() {
11389
11389
  function isInProtectedNamespace() {
11390
11390
  return false;
11391
11391
  }
11392
- function getVertexRegionForModel(model) {
11393
- if (model) {
11394
- const match = VERTEX_REGION_OVERRIDES.find(([prefix]) => model.startsWith(prefix));
11395
- if (match) {
11396
- return process.env[match[1]] || getDefaultVertexRegion();
11397
- }
11398
- }
11392
+ function getVertexRegionForModel(_model) {
11399
11393
  return getDefaultVertexRegion();
11400
11394
  }
11401
- var getURConfigHomeDir, VERTEX_REGION_OVERRIDES;
11395
+ var getURConfigHomeDir;
11402
11396
  var init_envUtils = __esm(() => {
11403
11397
  init_memoize();
11404
11398
  getURConfigHomeDir = memoize_default(() => {
11405
11399
  return (process.env.UR_CONFIG_DIR ?? join(homedir2(), ".ur")).normalize("NFC");
11406
11400
  }, () => process.env.UR_CONFIG_DIR);
11407
- VERTEX_REGION_OVERRIDES = [
11408
- ["ur-modelH-4-5", "VERTEX_REGION_UR_MODELH_4_5"],
11409
- ["ur-3-5-modelH", "VERTEX_REGION_UR_3_5_MODELH"],
11410
- ["ur-3-5-modelS", "VERTEX_REGION_UR_3_5_MODELS"],
11411
- ["ur-3-7-modelS", "VERTEX_REGION_UR_3_7_MODELS"],
11412
- ["ur-modelO-4-1", "VERTEX_REGION_UR_4_1_MODELO"],
11413
- ["ur-modelO-4", "VERTEX_REGION_UR_4_0_MODELO"],
11414
- ["ur-modelS-4-6", "VERTEX_REGION_UR_4_6_MODELS"],
11415
- ["ur-modelS-4-5", "VERTEX_REGION_UR_4_5_MODELS"],
11416
- ["ur-modelS-4", "VERTEX_REGION_UR_4_0_MODELS"]
11417
- ];
11418
11401
  });
11419
11402
 
11420
11403
  // src/utils/process.ts
@@ -51123,59 +51106,59 @@ var init_configs = __esm(() => {
51123
51106
  ollama: DEFAULT_OLLAMA_MODEL
51124
51107
  };
51125
51108
  UR_MODELH_4_5_CONFIG = {
51126
- firstParty: "ur-modelH-4-5-20251001",
51127
- bedrock: "us.urhq.ur-modelH-4-5-20251001-v1:0",
51128
- vertex: "ur-modelH-4-5@20251001",
51129
- foundry: "ur-modelH-4-5",
51109
+ firstParty: "modelH",
51110
+ bedrock: "modelH",
51111
+ vertex: "modelH",
51112
+ foundry: "modelH",
51130
51113
  ollama: DEFAULT_OLLAMA_MODEL
51131
51114
  };
51132
51115
  UR_MODELS_4_CONFIG = {
51133
- firstParty: "ur-modelS-4-20250514",
51134
- bedrock: "us.urhq.ur-modelS-4-20250514-v1:0",
51135
- vertex: "ur-modelS-4@20250514",
51136
- foundry: "ur-modelS-4",
51116
+ firstParty: "modelS",
51117
+ bedrock: "modelS",
51118
+ vertex: "modelS",
51119
+ foundry: "modelS",
51137
51120
  ollama: DEFAULT_OLLAMA_MODEL
51138
51121
  };
51139
51122
  UR_MODELS_4_5_CONFIG = {
51140
- firstParty: "ur-modelS-4-5-20250929",
51141
- bedrock: "us.urhq.ur-modelS-4-5-20250929-v1:0",
51142
- vertex: "ur-modelS-4-5@20250929",
51143
- foundry: "ur-modelS-4-5",
51123
+ firstParty: "modelS",
51124
+ bedrock: "modelS",
51125
+ vertex: "modelS",
51126
+ foundry: "modelS",
51144
51127
  ollama: DEFAULT_OLLAMA_MODEL
51145
51128
  };
51146
51129
  UR_MODELO_4_CONFIG = {
51147
- firstParty: "ur-modelO-4-20250514",
51148
- bedrock: "us.urhq.ur-modelO-4-20250514-v1:0",
51149
- vertex: "ur-modelO-4@20250514",
51150
- foundry: "ur-modelO-4",
51130
+ firstParty: "modelO",
51131
+ bedrock: "modelO",
51132
+ vertex: "modelO",
51133
+ foundry: "modelO",
51151
51134
  ollama: DEFAULT_OLLAMA_MODEL
51152
51135
  };
51153
51136
  UR_MODELO_4_1_CONFIG = {
51154
- firstParty: "ur-modelO-4-1-20250805",
51155
- bedrock: "us.urhq.ur-modelO-4-1-20250805-v1:0",
51156
- vertex: "ur-modelO-4-1@20250805",
51157
- foundry: "ur-modelO-4-1",
51137
+ firstParty: "modelO",
51138
+ bedrock: "modelO",
51139
+ vertex: "modelO",
51140
+ foundry: "modelO",
51158
51141
  ollama: DEFAULT_OLLAMA_MODEL
51159
51142
  };
51160
51143
  UR_MODELO_4_5_CONFIG = {
51161
- firstParty: "ur-modelO-4-5-20251101",
51162
- bedrock: "us.urhq.ur-modelO-4-5-20251101-v1:0",
51163
- vertex: "ur-modelO-4-5@20251101",
51164
- foundry: "ur-modelO-4-5",
51144
+ firstParty: "modelO",
51145
+ bedrock: "modelO",
51146
+ vertex: "modelO",
51147
+ foundry: "modelO",
51165
51148
  ollama: DEFAULT_OLLAMA_MODEL
51166
51149
  };
51167
51150
  UR_MODELO_4_6_CONFIG = {
51168
- firstParty: "ur-modelO-4-6",
51169
- bedrock: "us.urhq.ur-modelO-4-6-v1",
51170
- vertex: "ur-modelO-4-6",
51171
- foundry: "ur-modelO-4-6",
51151
+ firstParty: "modelO",
51152
+ bedrock: "modelO",
51153
+ vertex: "modelO",
51154
+ foundry: "modelO",
51172
51155
  ollama: DEFAULT_OLLAMA_MODEL
51173
51156
  };
51174
51157
  UR_MODELS_4_6_CONFIG = {
51175
- firstParty: "ur-modelS-4-6",
51176
- bedrock: "us.urhq.ur-modelS-4-6",
51177
- vertex: "ur-modelS-4-6",
51178
- foundry: "ur-modelS-4-6",
51158
+ firstParty: "modelS",
51159
+ bedrock: "modelS",
51160
+ vertex: "modelS",
51161
+ foundry: "modelS",
51179
51162
  ollama: DEFAULT_OLLAMA_MODEL
51180
51163
  };
51181
51164
  ALL_MODEL_CONFIGS = {
@@ -51298,6 +51281,8 @@ function getProviderRuntimeInfo(settings = getInitialSettings()) {
51298
51281
  function getProviderRuntimeBackend(providerId) {
51299
51282
  const provider = resolveProviderId(providerId);
51300
51283
  switch (provider) {
51284
+ case "subscription":
51285
+ return "subscription:unconfigured";
51301
51286
  case "ollama":
51302
51287
  return "ollama";
51303
51288
  case "lmstudio":
@@ -51354,6 +51339,8 @@ function getProviderAccessTypeLabel(provider) {
51354
51339
  }
51355
51340
  function credentialTypeLabel(type) {
51356
51341
  switch (type) {
51342
+ case "subscription-login":
51343
+ return "subscription login";
51357
51344
  case "cli-login":
51358
51345
  return "subscription login";
51359
51346
  case "api-key":
@@ -51377,6 +51364,9 @@ function getProviderRuntimeBlockReason(providerId, env4 = process.env) {
51377
51364
  return `Unknown provider "${providerId}". Run: ur provider list`;
51378
51365
  }
51379
51366
  const definition = getProviderDefinition(provider);
51367
+ if (provider === "subscription") {
51368
+ return `Provider "subscription" represents subscription login, but no independent subscription runtime is configured. UR will not fake subscription models or call provider apps by default. Choose a local, server, or API provider with /model.`;
51369
+ }
51380
51370
  if (definition.runtimeKind !== "external-app") {
51381
51371
  return null;
51382
51372
  }
@@ -51388,8 +51378,9 @@ function getProviderRuntimeBlockReason(providerId, env4 = process.env) {
51388
51378
  function isProviderRuntimeSelectable(providerId, env4 = process.env) {
51389
51379
  return getProviderRuntimeBlockReason(providerId, env4) === null;
51390
51380
  }
51391
- function listProviders() {
51392
- return PROVIDER_IDS.map((id) => PROVIDERS[id]);
51381
+ function listProviders(options = {}) {
51382
+ const includeExternal = options.includeExternalAppBridges ?? externalAppProviderBridgeEnabled(options.env ?? process.env);
51383
+ return PROVIDER_IDS.map((id) => PROVIDERS[id]).filter((provider) => includeExternal || provider.runtimeKind !== "external-app");
51393
51384
  }
51394
51385
  function hasSecretLikeValue(value) {
51395
51386
  const trimmed = value.trim();
@@ -51635,6 +51626,15 @@ async function checkEndpoint(definition, settings, adapters, result) {
51635
51626
  }
51636
51627
  }
51637
51628
  async function checkSubscriptionProvider(definition, settings, adapters, result) {
51629
+ if (definition.credentialType === "subscription-login") {
51630
+ result.checks.push({
51631
+ name: "subscription_runtime",
51632
+ status: "fail",
51633
+ message: "No independent subscription runtime is configured."
51634
+ });
51635
+ addFailure(result, "subscription runtime unavailable", "Run /model and choose a connected local, server, or API provider.");
51636
+ return;
51637
+ }
51638
51638
  const commandPath = await resolveCommand(definition, settings, adapters);
51639
51639
  if (!commandPath) {
51640
51640
  const commands = definition.commandCandidates?.join(", ") ?? definition.id;
@@ -51804,7 +51804,7 @@ function getConnectionStatusFromDoctorResult(result) {
51804
51804
  if (result.failureReason?.includes("CLI missing") || result.failureReason?.includes("not found")) {
51805
51805
  return "missing";
51806
51806
  }
51807
- if (result.failureReason?.includes("not logged in") || result.failureReason?.includes("not authenticated") || result.failureReason?.includes("API key missing") || result.failureReason?.includes("endpoint") || result.failureReason?.includes("HTTP")) {
51807
+ if (result.failureReason?.includes("not logged in") || result.failureReason?.includes("not authenticated") || result.failureReason?.includes("subscription runtime unavailable") || result.failureReason?.includes("API key missing") || result.failureReason?.includes("endpoint") || result.failureReason?.includes("HTTP")) {
51808
51808
  return "unavailable";
51809
51809
  }
51810
51810
  return "unknown";
@@ -51824,6 +51824,9 @@ function formatProviderStatusLabel(status, provider, checks3) {
51824
51824
  if (provider.credentialType === "cli-login") {
51825
51825
  return "subscription login connected";
51826
51826
  }
51827
+ if (provider.credentialType === "subscription-login") {
51828
+ return "subscription connected";
51829
+ }
51827
51830
  return "connected";
51828
51831
  case "missing":
51829
51832
  if (provider.commandCandidates) {
@@ -52341,6 +52344,7 @@ var init_providerRegistry = __esm(() => {
52341
52344
  init_which();
52342
52345
  PROVIDER_IDS = [
52343
52346
  "ollama",
52347
+ "subscription",
52344
52348
  "lmstudio",
52345
52349
  "llama.cpp",
52346
52350
  "vllm",
@@ -52356,6 +52360,21 @@ var init_providerRegistry = __esm(() => {
52356
52360
  ];
52357
52361
  LOCALHOST_RE = /^(https?:\/\/)?(localhost|127\.0\.0\.1|\[::1\]|::1)(:\d+)?(\/|$)/i;
52358
52362
  PROVIDERS = {
52363
+ subscription: {
52364
+ id: "subscription",
52365
+ displayName: "Subscription",
52366
+ statusBarName: "Subscription",
52367
+ accessType: "subscription",
52368
+ credentialType: "subscription-login",
52369
+ modelDiscoveryType: "static",
52370
+ statusCheck: "subscription-login",
52371
+ listModels: "static",
52372
+ validateModel: "static-list",
52373
+ runtimeKind: "ur-native",
52374
+ authMode: "subscription",
52375
+ legalPath: "independent subscription runtime only",
52376
+ accessPathLabel: "subscription login; no external provider app bridge"
52377
+ },
52359
52378
  "codex-cli": {
52360
52379
  id: "codex-cli",
52361
52380
  displayName: "Codex CLI",
@@ -52587,6 +52606,10 @@ var init_providerRegistry = __esm(() => {
52587
52606
  }
52588
52607
  };
52589
52608
  PROVIDER_ALIAS_ENTRIES = [
52609
+ {
52610
+ canonical: "subscription",
52611
+ aliases: ["subscriptions", "subscription login"]
52612
+ },
52590
52613
  {
52591
52614
  canonical: "codex-cli",
52592
52615
  aliases: ["chatgpt", "codex", "codex cli", "openai codex", "chatgpt codex"]
@@ -52646,6 +52669,7 @@ var init_providerRegistry = __esm(() => {
52646
52669
  ...entry.aliases.map((alias) => [normalizeProviderInput(alias), entry.canonical])
52647
52670
  ]));
52648
52671
  PROVIDER_FAMILIES = {
52672
+ subscription: "subscription",
52649
52673
  "anthropic-api": "anthropic",
52650
52674
  "claude-code-cli": "anthropic",
52651
52675
  "openai-api": "openai",
@@ -52661,6 +52685,7 @@ var init_providerRegistry = __esm(() => {
52661
52685
  ollama: "ollama"
52662
52686
  };
52663
52687
  PROVIDER_MODELS = {
52688
+ subscription: [],
52664
52689
  "codex-cli": [
52665
52690
  { id: "codex/gpt-5.5", displayName: "GPT-5.5 (Codex CLI)", description: "Subscription model through official Codex CLI login", isDefault: true },
52666
52691
  { id: "codex/gpt-5.4", displayName: "GPT-5.4 (Codex CLI)", description: "Subscription model through official Codex CLI login" },
@@ -53677,666 +53702,6 @@ var init_antModels = __esm(() => {
53677
53702
  init_growthbook();
53678
53703
  });
53679
53704
 
53680
- // src/utils/fastMode.ts
53681
- function isFastModeEnabled() {
53682
- return !isEnvTruthy(process.env.UR_CODE_DISABLE_FAST_MODE);
53683
- }
53684
- function isFastModeAvailable() {
53685
- if (!isFastModeEnabled()) {
53686
- return false;
53687
- }
53688
- return getFastModeUnavailableReason() === null;
53689
- }
53690
- function getDisabledReasonMessage(disabledReason, authType) {
53691
- switch (disabledReason) {
53692
- case "free":
53693
- return authType === "oauth" ? "Fast mode requires a paid subscription" : "Fast mode unavailable during evaluation. Please purchase credits.";
53694
- case "preference":
53695
- return "Fast mode has been disabled by your organization";
53696
- case "extra_usage_disabled":
53697
- return "Fast mode requires extra usage billing \xB7 /extra-usage to enable";
53698
- case "network_error":
53699
- return "Fast mode unavailable due to network connectivity issues";
53700
- case "unknown":
53701
- return "Fast mode is currently unavailable";
53702
- }
53703
- }
53704
- function getFastModeUnavailableReason() {
53705
- if (!isFastModeEnabled()) {
53706
- return "Fast mode is not available";
53707
- }
53708
- const statigReason = getFeatureValue_CACHED_MAY_BE_STALE("tengu_penguins_off", null);
53709
- if (statigReason !== null) {
53710
- logForDebugging(`Fast mode unavailable: ${statigReason}`);
53711
- return statigReason;
53712
- }
53713
- if (!isInBundledMode() && getFeatureValue_CACHED_MAY_BE_STALE("tengu_marble_sandcastle", false)) {
53714
- return "Fast mode requires the native binary \xB7 Install from: https://ur.com/product/ur";
53715
- }
53716
- if (getIsNonInteractiveSession() && preferThirdPartyAuthentication() && !getKairosActive()) {
53717
- const flagFastMode = getSettingsForSource("flagSettings")?.fastMode;
53718
- if (!flagFastMode) {
53719
- const reason = "Fast mode is not available in the Agent SDK";
53720
- logForDebugging(`Fast mode unavailable: ${reason}`);
53721
- return reason;
53722
- }
53723
- }
53724
- if (getAPIProvider() !== "firstParty") {
53725
- const reason = "Fast mode is not available on Bedrock, Vertex, or Foundry";
53726
- logForDebugging(`Fast mode unavailable: ${reason}`);
53727
- return reason;
53728
- }
53729
- if (orgStatus.status === "disabled") {
53730
- if (orgStatus.reason === "network_error" || orgStatus.reason === "unknown") {
53731
- if (isEnvTruthy(process.env.UR_CODE_SKIP_FAST_MODE_NETWORK_ERRORS)) {
53732
- return null;
53733
- }
53734
- }
53735
- const authType = getURAIOAuthTokens() !== null ? "oauth" : "api-key";
53736
- const reason = getDisabledReasonMessage(orgStatus.reason, authType);
53737
- logForDebugging(`Fast mode unavailable: ${reason}`);
53738
- return reason;
53739
- }
53740
- return null;
53741
- }
53742
- function getFastModeModel() {
53743
- return "modelO" + (ismodelO1mMergeEnabled() ? "[1m]" : "");
53744
- }
53745
- function getInitialFastModeSetting(model) {
53746
- if (!isFastModeEnabled()) {
53747
- return false;
53748
- }
53749
- if (!isFastModeAvailable()) {
53750
- return false;
53751
- }
53752
- if (!isFastModeSupportedByModel(model)) {
53753
- return false;
53754
- }
53755
- const settings = getInitialSettings();
53756
- if (settings.fastModePerSessionOptIn) {
53757
- return false;
53758
- }
53759
- return settings.fastMode === true;
53760
- }
53761
- function isFastModeSupportedByModel(modelSetting) {
53762
- if (!isFastModeEnabled()) {
53763
- return false;
53764
- }
53765
- const model = modelSetting ?? getDefaultMainLoopModelSetting();
53766
- const parsedModel = parseUserSpecifiedModel(model);
53767
- return parsedModel.toLowerCase().includes("modelO-4-6");
53768
- }
53769
- function getFastModeRuntimeState() {
53770
- if (runtimeState.status === "cooldown" && Date.now() >= runtimeState.resetAt) {
53771
- if (isFastModeEnabled() && !hasLoggedCooldownExpiry) {
53772
- logForDebugging("Fast mode cooldown expired, re-enabling fast mode");
53773
- hasLoggedCooldownExpiry = true;
53774
- cooldownExpired.emit();
53775
- }
53776
- runtimeState = { status: "active" };
53777
- }
53778
- return runtimeState;
53779
- }
53780
- function triggerFastModeCooldown(resetTimestamp, reason) {
53781
- if (!isFastModeEnabled()) {
53782
- return;
53783
- }
53784
- runtimeState = { status: "cooldown", resetAt: resetTimestamp, reason };
53785
- hasLoggedCooldownExpiry = false;
53786
- const cooldownDurationMs = resetTimestamp - Date.now();
53787
- logForDebugging(`Fast mode cooldown triggered (${reason}), duration ${Math.round(cooldownDurationMs / 1000)}s`);
53788
- logEvent("tengu_fast_mode_fallback_triggered", {
53789
- cooldown_duration_ms: cooldownDurationMs,
53790
- cooldown_reason: reason
53791
- });
53792
- cooldownTriggered.emit(resetTimestamp, reason);
53793
- }
53794
- function clearFastModeCooldown() {
53795
- runtimeState = { status: "active" };
53796
- }
53797
- function handleFastModeRejectedByAPI() {
53798
- if (orgStatus.status === "disabled") {
53799
- return;
53800
- }
53801
- orgStatus = { status: "disabled", reason: "preference" };
53802
- updateSettingsForSource("userSettings", { fastMode: undefined });
53803
- saveGlobalConfig((current) => ({
53804
- ...current,
53805
- penguinModeOrgEnabled: false
53806
- }));
53807
- orgFastModeChange.emit(false);
53808
- }
53809
- function getOverageDisabledMessage(reason) {
53810
- switch (reason) {
53811
- case "out_of_credits":
53812
- return "Fast mode disabled \xB7 extra usage credits exhausted";
53813
- case "org_level_disabled":
53814
- case "org_service_level_disabled":
53815
- return "Fast mode disabled \xB7 extra usage disabled by your organization";
53816
- case "org_level_disabled_until":
53817
- return "Fast mode disabled \xB7 extra usage spending cap reached";
53818
- case "member_level_disabled":
53819
- return "Fast mode disabled \xB7 extra usage disabled for your account";
53820
- case "seat_tier_level_disabled":
53821
- case "seat_tier_zero_credit_limit":
53822
- case "member_zero_credit_limit":
53823
- return "Fast mode disabled \xB7 extra usage not available for your plan";
53824
- case "overage_not_provisioned":
53825
- case "no_limits_configured":
53826
- return "Fast mode requires extra usage billing \xB7 /extra-usage to enable";
53827
- default:
53828
- return "Fast mode disabled \xB7 extra usage not available";
53829
- }
53830
- }
53831
- function isOutOfCreditsReason(reason) {
53832
- return reason === "org_level_disabled_until" || reason === "out_of_credits";
53833
- }
53834
- function handleFastModeOverageRejection(reason) {
53835
- const message = getOverageDisabledMessage(reason);
53836
- logForDebugging(`Fast mode overage rejection: ${reason ?? "unknown"} \u2014 ${message}`);
53837
- logEvent("tengu_fast_mode_overage_rejected", {
53838
- overage_disabled_reason: reason ?? "unknown"
53839
- });
53840
- if (!isOutOfCreditsReason(reason)) {
53841
- updateSettingsForSource("userSettings", { fastMode: undefined });
53842
- saveGlobalConfig((current) => ({
53843
- ...current,
53844
- penguinModeOrgEnabled: false
53845
- }));
53846
- }
53847
- overageRejection.emit(message);
53848
- }
53849
- function isFastModeCooldown() {
53850
- return getFastModeRuntimeState().status === "cooldown";
53851
- }
53852
- function getFastModeState(model, fastModeUserEnabled) {
53853
- const enabled = isFastModeEnabled() && isFastModeAvailable() && !!fastModeUserEnabled && isFastModeSupportedByModel(model);
53854
- if (enabled && isFastModeCooldown()) {
53855
- return "cooldown";
53856
- }
53857
- if (enabled) {
53858
- return "on";
53859
- }
53860
- return "off";
53861
- }
53862
- async function fetchFastModeStatus(auth) {
53863
- const endpoint = `${getOauthConfig().BASE_API_URL}/api/ur_penguin_mode`;
53864
- const headers = "accessToken" in auth ? {
53865
- Authorization: `Bearer ${auth.accessToken}`,
53866
- "urhq-beta": OAUTH_BETA_HEADER
53867
- } : { "x-api-key": auth.apiKey };
53868
- const response = await axios_default.get(endpoint, { headers });
53869
- return response.data;
53870
- }
53871
- function resolveFastModeStatusFromCache() {
53872
- if (!isFastModeEnabled()) {
53873
- return;
53874
- }
53875
- if (orgStatus.status !== "pending") {
53876
- return;
53877
- }
53878
- const isAnt = process.env.USER_TYPE === "ant";
53879
- const cachedEnabled = getGlobalConfig().penguinModeOrgEnabled === true;
53880
- orgStatus = isAnt || cachedEnabled ? { status: "enabled" } : { status: "disabled", reason: "unknown" };
53881
- }
53882
- async function prefetchFastModeStatus() {
53883
- if (isEssentialTrafficOnly()) {
53884
- return;
53885
- }
53886
- if (!isFastModeEnabled()) {
53887
- return;
53888
- }
53889
- if (inflightPrefetch) {
53890
- logForDebugging("Fast mode prefetch in progress, returning in-flight promise");
53891
- return inflightPrefetch;
53892
- }
53893
- const apiKey = getURHQApiKey();
53894
- const hasUsableOAuth = getURAIOAuthTokens()?.accessToken && hasProfileScope();
53895
- if (!hasUsableOAuth && !apiKey) {
53896
- const isAnt = process.env.USER_TYPE === "ant";
53897
- const cachedEnabled = getGlobalConfig().penguinModeOrgEnabled === true;
53898
- orgStatus = isAnt || cachedEnabled ? { status: "enabled" } : { status: "disabled", reason: "preference" };
53899
- return;
53900
- }
53901
- const now2 = Date.now();
53902
- if (now2 - lastPrefetchAt < PREFETCH_MIN_INTERVAL_MS) {
53903
- logForDebugging("Skipping fast mode prefetch, fetched recently");
53904
- return;
53905
- }
53906
- lastPrefetchAt = now2;
53907
- const fetchWithCurrentAuth = async () => {
53908
- const currentTokens = getURAIOAuthTokens();
53909
- const auth = currentTokens?.accessToken && hasProfileScope() ? { accessToken: currentTokens.accessToken } : apiKey ? { apiKey } : null;
53910
- if (!auth) {
53911
- throw new Error("No auth available");
53912
- }
53913
- return fetchFastModeStatus(auth);
53914
- };
53915
- async function doFetch() {
53916
- try {
53917
- let status;
53918
- try {
53919
- status = await fetchWithCurrentAuth();
53920
- } catch (err) {
53921
- const isAuthError = axios_default.isAxiosError(err) && (err.response?.status === 401 || err.response?.status === 403 && typeof err.response?.data === "string" && err.response.data.includes("OAuth token has been revoked"));
53922
- if (isAuthError) {
53923
- const failedAccessToken = getURAIOAuthTokens()?.accessToken;
53924
- if (failedAccessToken) {
53925
- await handleOAuth401Error(failedAccessToken);
53926
- status = await fetchWithCurrentAuth();
53927
- } else {
53928
- throw err;
53929
- }
53930
- } else {
53931
- throw err;
53932
- }
53933
- }
53934
- const previousEnabled = orgStatus.status !== "pending" ? orgStatus.status === "enabled" : getGlobalConfig().penguinModeOrgEnabled;
53935
- orgStatus = status.enabled ? { status: "enabled" } : {
53936
- status: "disabled",
53937
- reason: status.disabled_reason ?? "preference"
53938
- };
53939
- if (previousEnabled !== status.enabled) {
53940
- if (!status.enabled) {
53941
- updateSettingsForSource("userSettings", { fastMode: undefined });
53942
- }
53943
- saveGlobalConfig((current) => ({
53944
- ...current,
53945
- penguinModeOrgEnabled: status.enabled
53946
- }));
53947
- orgFastModeChange.emit(status.enabled);
53948
- }
53949
- logForDebugging(`Org fast mode: ${status.enabled ? "enabled" : `disabled (${status.disabled_reason ?? "preference"})`}`);
53950
- } catch (err) {
53951
- const isAnt = process.env.USER_TYPE === "ant";
53952
- const cachedEnabled = getGlobalConfig().penguinModeOrgEnabled === true;
53953
- orgStatus = isAnt || cachedEnabled ? { status: "enabled" } : { status: "disabled", reason: "network_error" };
53954
- logForDebugging(`Failed to fetch org fast mode status, defaulting to ${orgStatus.status === "enabled" ? "enabled (cached)" : "disabled (network_error)"}: ${err}`, { level: "error" });
53955
- logEvent("tengu_org_penguin_mode_fetch_failed", {});
53956
- } finally {
53957
- inflightPrefetch = null;
53958
- }
53959
- }
53960
- inflightPrefetch = doFetch();
53961
- return inflightPrefetch;
53962
- }
53963
- var FAST_MODE_MODEL_DISPLAY = "modelO 4.6", runtimeState, hasLoggedCooldownExpiry = false, cooldownTriggered, cooldownExpired, onCooldownTriggered, onCooldownExpired, overageRejection, onFastModeOverageRejection, orgStatus, orgFastModeChange, onOrgFastModeChanged, PREFETCH_MIN_INTERVAL_MS = 30000, lastPrefetchAt = 0, inflightPrefetch = null;
53964
- var init_fastMode = __esm(() => {
53965
- init_axios2();
53966
- init_oauth();
53967
- init_growthbook();
53968
- init_state();
53969
- init_analytics();
53970
- init_auth();
53971
- init_config();
53972
- init_debug();
53973
- init_envUtils();
53974
- init_model();
53975
- init_providers();
53976
- init_settings2();
53977
- runtimeState = { status: "active" };
53978
- cooldownTriggered = createSignal();
53979
- cooldownExpired = createSignal();
53980
- onCooldownTriggered = cooldownTriggered.subscribe;
53981
- onCooldownExpired = cooldownExpired.subscribe;
53982
- overageRejection = createSignal();
53983
- onFastModeOverageRejection = overageRejection.subscribe;
53984
- orgStatus = { status: "pending" };
53985
- orgFastModeChange = createSignal();
53986
- onOrgFastModeChanged = orgFastModeChange.subscribe;
53987
- });
53988
-
53989
- // src/utils/modelCost.ts
53990
- function getmodelO46CostTier(fastMode) {
53991
- if (isFastModeEnabled() && fastMode) {
53992
- return COST_TIER_30_150;
53993
- }
53994
- return COST_TIER_5_25;
53995
- }
53996
- function tokensToUSDCost(modelCosts, usage) {
53997
- return usage.input_tokens / 1e6 * modelCosts.inputTokens + usage.output_tokens / 1e6 * modelCosts.outputTokens + (usage.cache_read_input_tokens ?? 0) / 1e6 * modelCosts.promptCacheReadTokens + (usage.cache_creation_input_tokens ?? 0) / 1e6 * modelCosts.promptCacheWriteTokens + (usage.server_tool_use?.web_search_requests ?? 0) * modelCosts.webSearchRequests;
53998
- }
53999
- function getModelCosts(model, usage) {
54000
- const shortName = getCanonicalName(model);
54001
- if (shortName === firstPartyNameToCanonical(UR_MODELO_4_6_CONFIG.firstParty)) {
54002
- const isFastMode = usage.speed === "fast";
54003
- return getmodelO46CostTier(isFastMode);
54004
- }
54005
- const costs = MODEL_COSTS[shortName];
54006
- if (!costs) {
54007
- trackUnknownModelCost(model, shortName);
54008
- return MODEL_COSTS[getCanonicalName(getDefaultMainLoopModelSetting())] ?? DEFAULT_UNKNOWN_MODEL_COST;
54009
- }
54010
- return costs;
54011
- }
54012
- function trackUnknownModelCost(model, shortName) {
54013
- logEvent("tengu_unknown_model_cost", {
54014
- model,
54015
- shortName
54016
- });
54017
- setHasUnknownModelCost();
54018
- }
54019
- function calculateUSDCost(resolvedModel, usage) {
54020
- if (getAPIProvider() === "ollama") {
54021
- return 0;
54022
- }
54023
- const modelCosts = getModelCosts(resolvedModel, usage);
54024
- return tokensToUSDCost(modelCosts, usage);
54025
- }
54026
- function formatPrice(price) {
54027
- if (Number.isInteger(price)) {
54028
- return `$${price}`;
54029
- }
54030
- return `$${price.toFixed(2)}`;
54031
- }
54032
- function formatModelPricing(costs) {
54033
- return `${formatPrice(costs.inputTokens)}/${formatPrice(costs.outputTokens)} per Mtok`;
54034
- }
54035
- var COST_TIER_3_15, COST_TIER_15_75, COST_TIER_5_25, COST_TIER_30_150, COST_MODELH_35, COST_MODELH_45, DEFAULT_UNKNOWN_MODEL_COST, MODEL_COSTS;
54036
- var init_modelCost = __esm(() => {
54037
- init_analytics();
54038
- init_state();
54039
- init_fastMode();
54040
- init_configs();
54041
- init_model();
54042
- init_providers();
54043
- COST_TIER_3_15 = {
54044
- inputTokens: 3,
54045
- outputTokens: 15,
54046
- promptCacheWriteTokens: 3.75,
54047
- promptCacheReadTokens: 0.3,
54048
- webSearchRequests: 0.01
54049
- };
54050
- COST_TIER_15_75 = {
54051
- inputTokens: 15,
54052
- outputTokens: 75,
54053
- promptCacheWriteTokens: 18.75,
54054
- promptCacheReadTokens: 1.5,
54055
- webSearchRequests: 0.01
54056
- };
54057
- COST_TIER_5_25 = {
54058
- inputTokens: 5,
54059
- outputTokens: 25,
54060
- promptCacheWriteTokens: 6.25,
54061
- promptCacheReadTokens: 0.5,
54062
- webSearchRequests: 0.01
54063
- };
54064
- COST_TIER_30_150 = {
54065
- inputTokens: 30,
54066
- outputTokens: 150,
54067
- promptCacheWriteTokens: 37.5,
54068
- promptCacheReadTokens: 3,
54069
- webSearchRequests: 0.01
54070
- };
54071
- COST_MODELH_35 = {
54072
- inputTokens: 0.8,
54073
- outputTokens: 4,
54074
- promptCacheWriteTokens: 1,
54075
- promptCacheReadTokens: 0.08,
54076
- webSearchRequests: 0.01
54077
- };
54078
- COST_MODELH_45 = {
54079
- inputTokens: 1,
54080
- outputTokens: 5,
54081
- promptCacheWriteTokens: 1.25,
54082
- promptCacheReadTokens: 0.1,
54083
- webSearchRequests: 0.01
54084
- };
54085
- DEFAULT_UNKNOWN_MODEL_COST = COST_TIER_5_25;
54086
- MODEL_COSTS = {
54087
- [firstPartyNameToCanonical(UR_3_5_MODELH_CONFIG.firstParty)]: COST_MODELH_35,
54088
- [firstPartyNameToCanonical(UR_MODELH_4_5_CONFIG.firstParty)]: COST_MODELH_45,
54089
- [firstPartyNameToCanonical(UR_3_5_V2_MODELS_CONFIG.firstParty)]: COST_TIER_3_15,
54090
- [firstPartyNameToCanonical(UR_3_7_MODELS_CONFIG.firstParty)]: COST_TIER_3_15,
54091
- [firstPartyNameToCanonical(UR_MODELS_4_CONFIG.firstParty)]: COST_TIER_3_15,
54092
- [firstPartyNameToCanonical(UR_MODELS_4_5_CONFIG.firstParty)]: COST_TIER_3_15,
54093
- [firstPartyNameToCanonical(UR_MODELS_4_6_CONFIG.firstParty)]: COST_TIER_3_15,
54094
- [firstPartyNameToCanonical(UR_MODELO_4_CONFIG.firstParty)]: COST_TIER_15_75,
54095
- [firstPartyNameToCanonical(UR_MODELO_4_1_CONFIG.firstParty)]: COST_TIER_15_75,
54096
- [firstPartyNameToCanonical(UR_MODELO_4_5_CONFIG.firstParty)]: COST_TIER_5_25,
54097
- [firstPartyNameToCanonical(UR_MODELO_4_6_CONFIG.firstParty)]: COST_TIER_5_25
54098
- };
54099
- });
54100
-
54101
- // src/constants/figures.ts
54102
- var BLACK_CIRCLE, UR_HOUSE = "\u2302", UP_ARROW = "\u2191", DOWN_ARROW = "\u2193", LIGHTNING_BOLT = "\u21AF", EFFORT_LOW = "\u25CB", EFFORT_MEDIUM = "\u25D0", EFFORT_HIGH = "\u25CF", EFFORT_MAX = "\u25C9", PAUSE_ICON = "\u23F8", REFRESH_ARROW = "\u21BB", DIAMOND_OPEN = "\u25C7", DIAMOND_FILLED = "\u25C6", REFERENCE_MARK = "\u203B", BLOCKQUOTE_BAR = "\u258E", BRIDGE_READY_INDICATOR = "\xB7\u2714\uFE0E\xB7", BRIDGE_FAILED_INDICATOR = "\xD7";
54103
- var init_figures2 = __esm(() => {
54104
- BLACK_CIRCLE = process.platform === "darwin" ? "\u23FA" : "\u25CF";
54105
- });
54106
-
54107
- // src/utils/model/aliases.ts
54108
- function isModelAlias(modelInput) {
54109
- return MODEL_ALIASES.includes(modelInput);
54110
- }
54111
- function isModelFamilyAlias(model) {
54112
- return MODEL_FAMILY_ALIASES.includes(model);
54113
- }
54114
- var MODEL_ALIASES, MODEL_FAMILY_ALIASES;
54115
- var init_aliases = __esm(() => {
54116
- MODEL_ALIASES = [
54117
- "modelS",
54118
- "modelO",
54119
- "modelH",
54120
- "best",
54121
- "modelS[1m]",
54122
- "modelO[1m]",
54123
- "modelOplan"
54124
- ];
54125
- MODEL_FAMILY_ALIASES = ["modelS", "modelO", "modelH"];
54126
- });
54127
-
54128
- // src/utils/model/modelAllowlist.ts
54129
- function modelBelongsToFamily(model, family) {
54130
- if (model.includes(family)) {
54131
- return true;
54132
- }
54133
- if (isModelAlias(model)) {
54134
- const resolved = parseUserSpecifiedModel(model).toLowerCase();
54135
- return resolved.includes(family);
54136
- }
54137
- return false;
54138
- }
54139
- function prefixMatchesModel(modelName, prefix) {
54140
- if (!modelName.startsWith(prefix)) {
54141
- return false;
54142
- }
54143
- return modelName.length === prefix.length || modelName[prefix.length] === "-";
54144
- }
54145
- function modelMatchesVersionPrefix(model, entry) {
54146
- const resolvedModel = isModelAlias(model) ? parseUserSpecifiedModel(model).toLowerCase() : model;
54147
- if (prefixMatchesModel(resolvedModel, entry)) {
54148
- return true;
54149
- }
54150
- if (!entry.startsWith("ur-") && prefixMatchesModel(resolvedModel, `ur-${entry}`)) {
54151
- return true;
54152
- }
54153
- return false;
54154
- }
54155
- function familyHasSpecificEntries(family, allowlist) {
54156
- for (const entry of allowlist) {
54157
- if (isModelFamilyAlias(entry)) {
54158
- continue;
54159
- }
54160
- const idx = entry.indexOf(family);
54161
- if (idx === -1) {
54162
- continue;
54163
- }
54164
- const afterFamily = idx + family.length;
54165
- if (afterFamily === entry.length || entry[afterFamily] === "-") {
54166
- return true;
54167
- }
54168
- }
54169
- return false;
54170
- }
54171
- function isModelAllowed(model) {
54172
- if (getAPIProvider() === "ollama") {
54173
- return true;
54174
- }
54175
- const settings = getSettings_DEPRECATED() || {};
54176
- const { availableModels } = settings;
54177
- if (!availableModels) {
54178
- return true;
54179
- }
54180
- if (availableModels.length === 0) {
54181
- return false;
54182
- }
54183
- const resolvedModel = resolveOverriddenModel(model);
54184
- const normalizedModel = resolvedModel.trim().toLowerCase();
54185
- const normalizedAllowlist = availableModels.map((m) => m.trim().toLowerCase());
54186
- if (normalizedAllowlist.includes(normalizedModel)) {
54187
- if (!isModelFamilyAlias(normalizedModel) || !familyHasSpecificEntries(normalizedModel, normalizedAllowlist)) {
54188
- return true;
54189
- }
54190
- }
54191
- for (const entry of normalizedAllowlist) {
54192
- if (isModelFamilyAlias(entry) && !familyHasSpecificEntries(entry, normalizedAllowlist) && modelBelongsToFamily(normalizedModel, entry)) {
54193
- return true;
54194
- }
54195
- }
54196
- if (isModelAlias(normalizedModel)) {
54197
- const resolved = parseUserSpecifiedModel(normalizedModel).toLowerCase();
54198
- if (normalizedAllowlist.includes(resolved)) {
54199
- return true;
54200
- }
54201
- }
54202
- for (const entry of normalizedAllowlist) {
54203
- if (!isModelFamilyAlias(entry) && isModelAlias(entry)) {
54204
- const resolved = parseUserSpecifiedModel(entry).toLowerCase();
54205
- if (resolved === normalizedModel) {
54206
- return true;
54207
- }
54208
- }
54209
- }
54210
- for (const entry of normalizedAllowlist) {
54211
- if (!isModelFamilyAlias(entry) && !isModelAlias(entry)) {
54212
- if (modelMatchesVersionPrefix(normalizedModel, entry)) {
54213
- return true;
54214
- }
54215
- }
54216
- }
54217
- return false;
54218
- }
54219
- var init_modelAllowlist = __esm(() => {
54220
- init_settings2();
54221
- init_aliases();
54222
- init_model();
54223
- init_modelStrings();
54224
- init_providers();
54225
- });
54226
-
54227
- // src/utils/stringUtils.ts
54228
- function escapeRegExp(str) {
54229
- return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
54230
- }
54231
- function capitalize(str) {
54232
- return str.charAt(0).toUpperCase() + str.slice(1);
54233
- }
54234
- function plural(n2, word, pluralWord = word + "s") {
54235
- return n2 === 1 ? word : pluralWord;
54236
- }
54237
- function firstLineOf(s) {
54238
- const nl = s.indexOf(`
54239
- `);
54240
- return nl === -1 ? s : s.slice(0, nl);
54241
- }
54242
- function countCharInString(str, char, start = 0) {
54243
- let count3 = 0;
54244
- let i2 = str.indexOf(char, start);
54245
- while (i2 !== -1) {
54246
- count3++;
54247
- i2 = str.indexOf(char, i2 + 1);
54248
- }
54249
- return count3;
54250
- }
54251
- function normalizeFullWidthDigits(input) {
54252
- return input.replace(/[\uFF10-\uFF19]/g, (ch) => String.fromCharCode(ch.charCodeAt(0) - 65248));
54253
- }
54254
- function normalizeFullWidthSpace(input) {
54255
- return input.replace(/\u3000/g, " ");
54256
- }
54257
- function safeJoinLines(lines, delimiter = ",", maxSize = MAX_STRING_LENGTH) {
54258
- const truncationMarker = "...[truncated]";
54259
- let result = "";
54260
- for (const line of lines) {
54261
- const delimiterToAdd = result ? delimiter : "";
54262
- const fullAddition = delimiterToAdd + line;
54263
- if (result.length + fullAddition.length <= maxSize) {
54264
- result += fullAddition;
54265
- } else {
54266
- const remainingSpace = maxSize - result.length - delimiterToAdd.length - truncationMarker.length;
54267
- if (remainingSpace > 0) {
54268
- result += delimiterToAdd + line.slice(0, remainingSpace) + truncationMarker;
54269
- } else {
54270
- result += truncationMarker;
54271
- }
54272
- return result;
54273
- }
54274
- }
54275
- return result;
54276
- }
54277
-
54278
- class EndTruncatingAccumulator {
54279
- maxSize;
54280
- content = "";
54281
- isTruncated = false;
54282
- totalBytesReceived = 0;
54283
- constructor(maxSize = MAX_STRING_LENGTH) {
54284
- this.maxSize = maxSize;
54285
- }
54286
- append(data) {
54287
- const str = typeof data === "string" ? data : data.toString();
54288
- this.totalBytesReceived += str.length;
54289
- if (this.isTruncated && this.content.length >= this.maxSize) {
54290
- return;
54291
- }
54292
- if (this.content.length + str.length > this.maxSize) {
54293
- const remainingSpace = this.maxSize - this.content.length;
54294
- if (remainingSpace > 0) {
54295
- this.content += str.slice(0, remainingSpace);
54296
- }
54297
- this.isTruncated = true;
54298
- } else {
54299
- this.content += str;
54300
- }
54301
- }
54302
- toString() {
54303
- if (!this.isTruncated) {
54304
- return this.content;
54305
- }
54306
- const truncatedBytes = this.totalBytesReceived - this.maxSize;
54307
- const truncatedKB = Math.round(truncatedBytes / 1024);
54308
- return this.content + `
54309
- ... [output truncated - ${truncatedKB}KB removed]`;
54310
- }
54311
- clear() {
54312
- this.content = "";
54313
- this.isTruncated = false;
54314
- this.totalBytesReceived = 0;
54315
- }
54316
- get length() {
54317
- return this.content.length;
54318
- }
54319
- get truncated() {
54320
- return this.isTruncated;
54321
- }
54322
- get totalBytes() {
54323
- return this.totalBytesReceived;
54324
- }
54325
- }
54326
- function truncateToLines(text, maxLines) {
54327
- const lines = text.split(`
54328
- `);
54329
- if (lines.length <= maxLines) {
54330
- return text;
54331
- }
54332
- return lines.slice(0, maxLines).join(`
54333
- `) + "\u2026";
54334
- }
54335
- var MAX_STRING_LENGTH;
54336
- var init_stringUtils = __esm(() => {
54337
- MAX_STRING_LENGTH = 2 ** 25;
54338
- });
54339
-
54340
53705
  // src/utils/model/ollamaRouter.ts
54341
53706
  function parseModelParamsB(name) {
54342
53707
  const lower = name.toLowerCase();
@@ -54566,472 +53931,6 @@ var init_ollamaModels = __esm(() => {
54566
53931
  cachedOllamaModelNames = [];
54567
53932
  });
54568
53933
 
54569
- // src/utils/model/model.ts
54570
- var exports_model = {};
54571
- __export(exports_model, {
54572
- resolveSkillModelOverride: () => resolveSkillModelOverride,
54573
- renderModelSetting: () => renderModelSetting,
54574
- renderModelName: () => renderModelName,
54575
- renderDefaultModelSetting: () => renderDefaultModelSetting,
54576
- parseUserSpecifiedModel: () => parseUserSpecifiedModel,
54577
- normalizeModelStringForAPI: () => normalizeModelStringForAPI,
54578
- modelDisplayString: () => modelDisplayString,
54579
- ismodelO1mMergeEnabled: () => ismodelO1mMergeEnabled,
54580
- isNonCustommodelOModel: () => isNonCustommodelOModel,
54581
- isLegacyModelRemapEnabled: () => isLegacyModelRemapEnabled,
54582
- getmodelO46PricingSuffix: () => getmodelO46PricingSuffix,
54583
- getUserSpecifiedModelSetting: () => getUserSpecifiedModelSetting,
54584
- getURAiUserDefaultModelDescription: () => getURAiUserDefaultModelDescription,
54585
- getSmallFastModel: () => getSmallFastModel,
54586
- getRuntimeMainLoopModel: () => getRuntimeMainLoopModel,
54587
- getPublicModelName: () => getPublicModelName,
54588
- getPublicModelDisplayName: () => getPublicModelDisplayName,
54589
- getMarketingNameForModel: () => getMarketingNameForModel,
54590
- getMainLoopModel: () => getMainLoopModel,
54591
- getDefaultmodelSModel: () => getDefaultmodelSModel,
54592
- getDefaultmodelOModel: () => getDefaultmodelOModel,
54593
- getDefaultmodelHModel: () => getDefaultmodelHModel,
54594
- getDefaultOllamaModel: () => getDefaultOllamaModel,
54595
- getDefaultMainLoopModelSetting: () => getDefaultMainLoopModelSetting,
54596
- getDefaultMainLoopModel: () => getDefaultMainLoopModel,
54597
- getCanonicalName: () => getCanonicalName,
54598
- getBestModel: () => getBestModel,
54599
- firstPartyNameToCanonical: () => firstPartyNameToCanonical,
54600
- __resetOllamaRouteMemoForTests: () => __resetOllamaRouteMemoForTests
54601
- });
54602
- function __resetOllamaRouteMemoForTests() {
54603
- memoizedRoutedDefaultModel = undefined;
54604
- memoizedRoutedFastModel = undefined;
54605
- }
54606
- function getDefaultOllamaModel() {
54607
- if (process.env.OLLAMA_MODEL) {
54608
- return process.env.OLLAMA_MODEL;
54609
- }
54610
- if (isOllamaAutoRouteEnabled()) {
54611
- if (memoizedRoutedDefaultModel)
54612
- return memoizedRoutedDefaultModel;
54613
- const routed = pickBestCoderModel(getCachedOllamaModelNames());
54614
- if (routed) {
54615
- memoizedRoutedDefaultModel = routed;
54616
- return routed;
54617
- }
54618
- }
54619
- return DEFAULT_OLLAMA_MODEL2;
54620
- }
54621
- function getSmallFastModel() {
54622
- if (getAPIProvider() === "ollama") {
54623
- if (process.env.OLLAMA_SMALL_FAST_MODEL) {
54624
- return process.env.OLLAMA_SMALL_FAST_MODEL;
54625
- }
54626
- if (isOllamaAutoRouteEnabled()) {
54627
- if (memoizedRoutedFastModel)
54628
- return memoizedRoutedFastModel;
54629
- const routed = pickSmallFastModel(getCachedOllamaModelNames());
54630
- if (routed) {
54631
- memoizedRoutedFastModel = routed;
54632
- return routed;
54633
- }
54634
- }
54635
- return getDefaultOllamaModel();
54636
- }
54637
- return process.env.URHQ_SMALL_FAST_MODEL || getDefaultmodelHModel();
54638
- }
54639
- function isNonCustommodelOModel(model) {
54640
- return model === getModelStrings2().modelO40 || model === getModelStrings2().modelO41 || model === getModelStrings2().modelO45 || model === getModelStrings2().modelO46;
54641
- }
54642
- function getUserSpecifiedModelSetting() {
54643
- let specifiedModel;
54644
- const modelOverride = getMainLoopModelOverride();
54645
- if (modelOverride !== undefined) {
54646
- specifiedModel = modelOverride;
54647
- } else {
54648
- const settings = getSettings_DEPRECATED() || {};
54649
- specifiedModel = process.env.URHQ_MODEL || settings.model || undefined;
54650
- }
54651
- if (specifiedModel && !isModelAllowed(specifiedModel)) {
54652
- return;
54653
- }
54654
- return specifiedModel;
54655
- }
54656
- function getMainLoopModel() {
54657
- const model = getUserSpecifiedModelSetting();
54658
- if (model !== undefined && model !== null) {
54659
- return parseUserSpecifiedModel(model);
54660
- }
54661
- return getDefaultMainLoopModel();
54662
- }
54663
- function getBestModel() {
54664
- return getDefaultmodelOModel();
54665
- }
54666
- function getDefaultmodelOModel() {
54667
- if (getAPIProvider() === "ollama") {
54668
- return getDefaultOllamaModel();
54669
- }
54670
- if (process.env.URHQ_DEFAULT_MODELO_MODEL) {
54671
- return process.env.URHQ_DEFAULT_MODELO_MODEL;
54672
- }
54673
- if (getAPIProvider() !== "firstParty") {
54674
- return getModelStrings2().modelO46;
54675
- }
54676
- return getModelStrings2().modelO46;
54677
- }
54678
- function getDefaultmodelSModel() {
54679
- if (getAPIProvider() === "ollama") {
54680
- return getDefaultOllamaModel();
54681
- }
54682
- if (process.env.URHQ_DEFAULT_MODELS_MODEL) {
54683
- return process.env.URHQ_DEFAULT_MODELS_MODEL;
54684
- }
54685
- if (getAPIProvider() !== "firstParty") {
54686
- return getModelStrings2().modelS45;
54687
- }
54688
- return getModelStrings2().modelS46;
54689
- }
54690
- function getDefaultmodelHModel() {
54691
- if (getAPIProvider() === "ollama") {
54692
- return process.env.OLLAMA_SMALL_FAST_MODEL || getDefaultOllamaModel();
54693
- }
54694
- if (process.env.URHQ_DEFAULT_MODELH_MODEL) {
54695
- return process.env.URHQ_DEFAULT_MODELH_MODEL;
54696
- }
54697
- return getModelStrings2().modelH45;
54698
- }
54699
- function getRuntimeMainLoopModel(params) {
54700
- const { permissionMode, mainLoopModel, exceeds200kTokens = false } = params;
54701
- if (getUserSpecifiedModelSetting() === "modelOplan" && permissionMode === "plan" && !exceeds200kTokens) {
54702
- return getDefaultmodelOModel();
54703
- }
54704
- if (getUserSpecifiedModelSetting() === "modelH" && permissionMode === "plan") {
54705
- return getDefaultmodelSModel();
54706
- }
54707
- return mainLoopModel;
54708
- }
54709
- function getDefaultMainLoopModelSetting() {
54710
- const settings = getSettings_DEPRECATED() || {};
54711
- const activeProvider = getActiveProviderSettings(settings).active ?? "ollama";
54712
- if (activeProvider !== "ollama") {
54713
- const providerDefault = getDefaultModelForProvider(activeProvider);
54714
- if (providerDefault) {
54715
- return providerDefault;
54716
- }
54717
- }
54718
- if (getAPIProvider() === "ollama") {
54719
- return getDefaultOllamaModel();
54720
- }
54721
- if (process.env.USER_TYPE === "ant") {
54722
- return getAntModelOverrideConfig2()?.defaultModel ?? getDefaultmodelOModel() + "[1m]";
54723
- }
54724
- if (isMaxSubscriber()) {
54725
- return getDefaultmodelOModel() + (ismodelO1mMergeEnabled() ? "[1m]" : "");
54726
- }
54727
- if (isTeamPremiumSubscriber()) {
54728
- return getDefaultmodelOModel() + (ismodelO1mMergeEnabled() ? "[1m]" : "");
54729
- }
54730
- return getDefaultmodelSModel();
54731
- }
54732
- function getDefaultMainLoopModel() {
54733
- return parseUserSpecifiedModel(getDefaultMainLoopModelSetting());
54734
- }
54735
- function firstPartyNameToCanonical(name) {
54736
- name = name.toLowerCase();
54737
- if (name.includes("ur-modelO-4-6")) {
54738
- return "ur-modelO-4-6";
54739
- }
54740
- if (name.includes("ur-modelO-4-5")) {
54741
- return "ur-modelO-4-5";
54742
- }
54743
- if (name.includes("ur-modelO-4-1")) {
54744
- return "ur-modelO-4-1";
54745
- }
54746
- if (name.includes("ur-modelO-4")) {
54747
- return "ur-modelO-4";
54748
- }
54749
- if (name.includes("ur-modelS-4-6")) {
54750
- return "ur-modelS-4-6";
54751
- }
54752
- if (name.includes("ur-modelS-4-5")) {
54753
- return "ur-modelS-4-5";
54754
- }
54755
- if (name.includes("ur-modelS-4")) {
54756
- return "ur-modelS-4";
54757
- }
54758
- if (name.includes("ur-modelH-4-5")) {
54759
- return "ur-modelH-4-5";
54760
- }
54761
- if (name.includes("ur-3-7-modelS")) {
54762
- return "ur-3-7-modelS";
54763
- }
54764
- if (name.includes("ur-3-5-modelS")) {
54765
- return "ur-3-5-modelS";
54766
- }
54767
- if (name.includes("ur-3-5-modelH")) {
54768
- return "ur-3-5-modelH";
54769
- }
54770
- if (name.includes("ur-3-modelO")) {
54771
- return "ur-3-modelO";
54772
- }
54773
- if (name.includes("ur-3-modelS")) {
54774
- return "ur-3-modelS";
54775
- }
54776
- if (name.includes("ur-3-modelH")) {
54777
- return "ur-3-modelH";
54778
- }
54779
- const match = name.match(/(ur-(\d+-\d+-)?\w+)/);
54780
- if (match && match[1]) {
54781
- return match[1];
54782
- }
54783
- return name;
54784
- }
54785
- function getCanonicalName(fullModelName) {
54786
- return firstPartyNameToCanonical(resolveOverriddenModel(fullModelName));
54787
- }
54788
- function getURAiUserDefaultModelDescription(fastMode = false) {
54789
- if (isMaxSubscriber() || isTeamPremiumSubscriber()) {
54790
- if (ismodelO1mMergeEnabled()) {
54791
- return `modelO 4.6 with 1M context \xB7 Most capable for complex work${fastMode ? getmodelO46PricingSuffix(true) : ""}`;
54792
- }
54793
- return `modelO 4.6 \xB7 Most capable for complex work${fastMode ? getmodelO46PricingSuffix(true) : ""}`;
54794
- }
54795
- return "modelS 4.6 \xB7 Best for everyday tasks";
54796
- }
54797
- function renderDefaultModelSetting(setting) {
54798
- if (setting === "modelOplan") {
54799
- return "modelO 4.6 in plan mode, else modelS 4.6";
54800
- }
54801
- return renderModelName(parseUserSpecifiedModel(setting));
54802
- }
54803
- function getmodelO46PricingSuffix(fastMode) {
54804
- if (getAPIProvider() !== "firstParty")
54805
- return "";
54806
- const pricing = formatModelPricing(getmodelO46CostTier(fastMode));
54807
- const fastModeIndicator = fastMode ? ` (${LIGHTNING_BOLT})` : "";
54808
- return ` \xB7${fastModeIndicator} ${pricing}`;
54809
- }
54810
- function ismodelO1mMergeEnabled() {
54811
- if (is1mContextDisabled() || isProSubscriber() || getAPIProvider() !== "firstParty") {
54812
- return false;
54813
- }
54814
- if (isURAISubscriber2() && getSubscriptionType() === null) {
54815
- return false;
54816
- }
54817
- return true;
54818
- }
54819
- function renderModelSetting(setting) {
54820
- if (setting === "modelOplan") {
54821
- return "modelO Plan";
54822
- }
54823
- if (isModelAlias(setting)) {
54824
- return capitalize(setting);
54825
- }
54826
- return renderModelName(setting);
54827
- }
54828
- function getPublicModelDisplayName(model) {
54829
- if (getAPIProvider() === "ollama") {
54830
- return null;
54831
- }
54832
- switch (model) {
54833
- case getModelStrings2().modelO46:
54834
- return "modelO 4.6";
54835
- case getModelStrings2().modelO46 + "[1m]":
54836
- return "modelO 4.6 (1M context)";
54837
- case getModelStrings2().modelO45:
54838
- return "modelO 4.5";
54839
- case getModelStrings2().modelO41:
54840
- return "modelO 4.1";
54841
- case getModelStrings2().modelO40:
54842
- return "modelO 4";
54843
- case getModelStrings2().modelS46 + "[1m]":
54844
- return "modelS 4.6 (1M context)";
54845
- case getModelStrings2().modelS46:
54846
- return "modelS 4.6";
54847
- case getModelStrings2().modelS45 + "[1m]":
54848
- return "modelS 4.5 (1M context)";
54849
- case getModelStrings2().modelS45:
54850
- return "modelS 4.5";
54851
- case getModelStrings2().modelS40:
54852
- return "modelS 4";
54853
- case getModelStrings2().modelS40 + "[1m]":
54854
- return "modelS 4 (1M context)";
54855
- case getModelStrings2().modelS37:
54856
- return "modelS 3.7";
54857
- case getModelStrings2().modelS35:
54858
- return "modelS 3.5";
54859
- case getModelStrings2().modelH45:
54860
- return "modelH 4.5";
54861
- case getModelStrings2().modelH35:
54862
- return "modelH 3.5";
54863
- default:
54864
- return null;
54865
- }
54866
- }
54867
- function maskModelCodename(baseName) {
54868
- const [codename = "", ...rest] = baseName.split("-");
54869
- const masked = codename.slice(0, 3) + "*".repeat(Math.max(0, codename.length - 3));
54870
- return [masked, ...rest].join("-");
54871
- }
54872
- function renderModelName(model) {
54873
- const publicName = getPublicModelDisplayName(model);
54874
- if (publicName) {
54875
- return publicName;
54876
- }
54877
- if (process.env.USER_TYPE === "ant") {
54878
- const resolved = parseUserSpecifiedModel(model);
54879
- const antModel = resolveAntModel2(model);
54880
- if (antModel) {
54881
- const baseName = antModel.model.replace(/\[1m\]$/i, "");
54882
- const masked = maskModelCodename(baseName);
54883
- const suffix = has1mContext(resolved) ? "[1m]" : "";
54884
- return masked + suffix;
54885
- }
54886
- if (resolved !== model) {
54887
- return `${model} (${resolved})`;
54888
- }
54889
- return resolved;
54890
- }
54891
- return model;
54892
- }
54893
- function getPublicModelName(model) {
54894
- if (getAPIProvider() === "ollama") {
54895
- return `Ollama (${model})`;
54896
- }
54897
- const publicName = getPublicModelDisplayName(model);
54898
- if (publicName) {
54899
- return `UR ${publicName}`;
54900
- }
54901
- return `UR (${model})`;
54902
- }
54903
- function parseUserSpecifiedModel(modelInput) {
54904
- const modelInputTrimmed = modelInput.trim();
54905
- const normalizedModel = modelInputTrimmed.toLowerCase();
54906
- const has1mTag = has1mContext(normalizedModel);
54907
- const modelString = has1mTag ? normalizedModel.replace(/\[1m]$/i, "").trim() : normalizedModel;
54908
- switch (modelString) {
54909
- case "modeloplan":
54910
- return getDefaultmodelSModel() + (has1mTag ? "[1m]" : "");
54911
- case "models":
54912
- return getDefaultmodelSModel() + (has1mTag ? "[1m]" : "");
54913
- case "modelh":
54914
- return getDefaultmodelHModel() + (has1mTag ? "[1m]" : "");
54915
- case "modelo":
54916
- return getDefaultmodelOModel() + (has1mTag ? "[1m]" : "");
54917
- case "best":
54918
- return getBestModel();
54919
- default:
54920
- }
54921
- if (getAPIProvider() === "firstParty" && isLegacymodelOFirstParty(modelString) && isLegacyModelRemapEnabled()) {
54922
- return getDefaultmodelOModel() + (has1mTag ? "[1m]" : "");
54923
- }
54924
- if (process.env.USER_TYPE === "ant") {
54925
- const has1mAntTag = has1mContext(normalizedModel);
54926
- const baseAntModel = normalizedModel.replace(/\[1m]$/i, "").trim();
54927
- const antModel = resolveAntModel2(baseAntModel);
54928
- if (antModel) {
54929
- const suffix = has1mAntTag ? "[1m]" : "";
54930
- return antModel.model + suffix;
54931
- }
54932
- }
54933
- if (has1mTag) {
54934
- return modelInputTrimmed.replace(/\[1m\]$/i, "").trim() + "[1m]";
54935
- }
54936
- return modelInputTrimmed;
54937
- }
54938
- function resolveSkillModelOverride(skillModel, currentModel) {
54939
- if (has1mContext(skillModel) || !has1mContext(currentModel)) {
54940
- return skillModel;
54941
- }
54942
- if (modelSupports1M(parseUserSpecifiedModel(skillModel))) {
54943
- return skillModel + "[1m]";
54944
- }
54945
- return skillModel;
54946
- }
54947
- function isLegacymodelOFirstParty(model) {
54948
- return LEGACY_MODELO_FIRSTPARTY.includes(model);
54949
- }
54950
- function isLegacyModelRemapEnabled() {
54951
- return !isEnvTruthy(process.env.UR_CODE_DISABLE_LEGACY_MODEL_REMAP);
54952
- }
54953
- function modelDisplayString(model) {
54954
- if (model === null) {
54955
- if (process.env.USER_TYPE === "ant") {
54956
- return `Default for Ants (${renderDefaultModelSetting(getDefaultMainLoopModelSetting())})`;
54957
- } else if (isURAISubscriber2()) {
54958
- return `Default (${getURAiUserDefaultModelDescription()})`;
54959
- }
54960
- return `Default (${getDefaultMainLoopModel()})`;
54961
- }
54962
- const resolvedModel = parseUserSpecifiedModel(model);
54963
- return model === resolvedModel ? resolvedModel : `${model} (${resolvedModel})`;
54964
- }
54965
- function getMarketingNameForModel(modelId) {
54966
- if (getAPIProvider() === "foundry" || getAPIProvider() === "ollama") {
54967
- return;
54968
- }
54969
- const has1m = modelId.toLowerCase().includes("[1m]");
54970
- const canonical = getCanonicalName(modelId);
54971
- if (canonical.includes("ur-modelO-4-6")) {
54972
- return has1m ? "modelO 4.6 (with 1M context)" : "modelO 4.6";
54973
- }
54974
- if (canonical.includes("ur-modelO-4-5")) {
54975
- return "modelO 4.5";
54976
- }
54977
- if (canonical.includes("ur-modelO-4-1")) {
54978
- return "modelO 4.1";
54979
- }
54980
- if (canonical.includes("ur-modelO-4")) {
54981
- return "modelO 4";
54982
- }
54983
- if (canonical.includes("ur-modelS-4-6")) {
54984
- return has1m ? "modelS 4.6 (with 1M context)" : "modelS 4.6";
54985
- }
54986
- if (canonical.includes("ur-modelS-4-5")) {
54987
- return has1m ? "modelS 4.5 (with 1M context)" : "modelS 4.5";
54988
- }
54989
- if (canonical.includes("ur-modelS-4")) {
54990
- return has1m ? "modelS 4 (with 1M context)" : "modelS 4";
54991
- }
54992
- if (canonical.includes("ur-3-7-modelS")) {
54993
- return "UR 3.7 modelS";
54994
- }
54995
- if (canonical.includes("ur-3-5-modelS")) {
54996
- return "UR 3.5 modelS";
54997
- }
54998
- if (canonical.includes("ur-modelH-4-5")) {
54999
- return "modelH 4.5";
55000
- }
55001
- if (canonical.includes("ur-3-5-modelH")) {
55002
- return "UR 3.5 modelH";
55003
- }
55004
- return;
55005
- }
55006
- function normalizeModelStringForAPI(model) {
55007
- return model.replace(/\[(1|2)m\]/gi, "");
55008
- }
55009
- var DEFAULT_OLLAMA_MODEL2 = "qwen3-coder:480b-cloud", memoizedRoutedDefaultModel, memoizedRoutedFastModel, LEGACY_MODELO_FIRSTPARTY;
55010
- var init_model = __esm(() => {
55011
- init_state();
55012
- init_auth();
55013
- init_context();
55014
- init_envUtils();
55015
- init_modelStrings();
55016
- init_modelCost();
55017
- init_settings2();
55018
- init_providers();
55019
- init_figures2();
55020
- init_modelAllowlist();
55021
- init_aliases();
55022
- init_stringUtils();
55023
- init_antModels();
55024
- init_ollamaModels();
55025
- init_ollamaRouter();
55026
- init_providerRegistry();
55027
- LEGACY_MODELO_FIRSTPARTY = [
55028
- "ur-modelO-4-20250514",
55029
- "ur-modelO-4-1-20250805",
55030
- "ur-modelO-4-0",
55031
- "ur-modelO-4-1"
55032
- ];
55033
- });
55034
-
55035
53934
  // src/utils/model/ollamaTuning.ts
55036
53935
  function computeOllamaNumCtx(input) {
55037
53936
  const {
@@ -57037,7 +55936,7 @@ function messagesToPrompt(params) {
57037
55936
  const text = contentToText2(message.content);
57038
55937
  if (!text)
57039
55938
  continue;
57040
- parts.push(label ? `${capitalize2(message.role)}: ${text}` : text);
55939
+ parts.push(label ? `${capitalize(message.role)}: ${text}` : text);
57041
55940
  }
57042
55941
  return parts.join(`
57043
55942
 
@@ -57084,7 +55983,7 @@ function contentToText2(content) {
57084
55983
  }).join(`
57085
55984
  `);
57086
55985
  }
57087
- function capitalize2(value) {
55986
+ function capitalize(value) {
57088
55987
  return value ? value[0].toUpperCase() + value.slice(1) : value;
57089
55988
  }
57090
55989
  function estimateTokens(text) {
@@ -57791,8 +56690,8 @@ function modelSupports1M(model) {
57791
56690
  if (getAPIProvider() === "ollama") {
57792
56691
  return false;
57793
56692
  }
57794
- const canonical = getCanonicalName(model);
57795
- return canonical.includes("ur-modelS-4") || canonical.includes("modelO-4-6");
56693
+ const cap = getModelCapability(model);
56694
+ return Boolean(cap?.max_input_tokens && cap.max_input_tokens >= 1e6);
57796
56695
  }
57797
56696
  function getContextWindowForModel(model, betas, apiProvider = getAPIProvider()) {
57798
56697
  if (apiProvider === "ollama") {
@@ -57842,10 +56741,7 @@ function getmodelS1mExpTreatmentEnabled(model) {
57842
56741
  if (has1mContext(model)) {
57843
56742
  return false;
57844
56743
  }
57845
- if (!getCanonicalName(model).includes("modelS-4-6")) {
57846
- return false;
57847
- }
57848
- return getGlobalConfig().clientDataCache?.["coral_reef_modelS"] === "true";
56744
+ return false;
57849
56745
  }
57850
56746
  function calculateContextPercentages(currentUsage, contextWindowSize) {
57851
56747
  if (!currentUsage) {
@@ -57860,8 +56756,8 @@ function calculateContextPercentages(currentUsage, contextWindowSize) {
57860
56756
  };
57861
56757
  }
57862
56758
  function getModelMaxOutputTokens(model) {
57863
- let defaultTokens;
57864
- let upperLimit;
56759
+ let defaultTokens = MAX_OUTPUT_TOKENS_DEFAULT;
56760
+ let upperLimit = MAX_OUTPUT_TOKENS_UPPER_LIMIT;
57865
56761
  if (process.env.USER_TYPE === "ant") {
57866
56762
  const antModel = resolveAntModel2(model.toLowerCase());
57867
56763
  if (antModel) {
@@ -57870,38 +56766,6 @@ function getModelMaxOutputTokens(model) {
57870
56766
  return { default: defaultTokens, upperLimit };
57871
56767
  }
57872
56768
  }
57873
- const m = getCanonicalName(model);
57874
- if (m.includes("modelO-4-6")) {
57875
- defaultTokens = 64000;
57876
- upperLimit = 128000;
57877
- } else if (m.includes("modelS-4-6")) {
57878
- defaultTokens = 32000;
57879
- upperLimit = 128000;
57880
- } else if (m.includes("modelO-4-5") || m.includes("modelS-4") || m.includes("modelH-4")) {
57881
- defaultTokens = 32000;
57882
- upperLimit = 64000;
57883
- } else if (m.includes("modelO-4-1") || m.includes("modelO-4")) {
57884
- defaultTokens = 32000;
57885
- upperLimit = 32000;
57886
- } else if (m.includes("ur-3-modelO")) {
57887
- defaultTokens = 4096;
57888
- upperLimit = 4096;
57889
- } else if (m.includes("ur-3-modelS")) {
57890
- defaultTokens = 8192;
57891
- upperLimit = 8192;
57892
- } else if (m.includes("ur-3-modelH")) {
57893
- defaultTokens = 4096;
57894
- upperLimit = 4096;
57895
- } else if (m.includes("3-5-modelS") || m.includes("3-5-modelH")) {
57896
- defaultTokens = 8192;
57897
- upperLimit = 8192;
57898
- } else if (m.includes("3-7-modelS")) {
57899
- defaultTokens = 32000;
57900
- upperLimit = 64000;
57901
- } else {
57902
- defaultTokens = MAX_OUTPUT_TOKENS_DEFAULT;
57903
- upperLimit = MAX_OUTPUT_TOKENS_UPPER_LIMIT;
57904
- }
57905
56769
  const cap = getModelCapability(model);
57906
56770
  if (cap?.max_tokens && cap.max_tokens >= 4096) {
57907
56771
  upperLimit = cap.max_tokens;
@@ -57915,15 +56779,1061 @@ function getMaxThinkingTokensForModel(model) {
57915
56779
  var MODEL_CONTEXT_WINDOW_DEFAULT = 200000, COMPACT_MAX_OUTPUT_TOKENS = 20000, MAX_OUTPUT_TOKENS_DEFAULT = 32000, MAX_OUTPUT_TOKENS_UPPER_LIMIT = 64000, CAPPED_DEFAULT_MAX_TOKENS = 8000, ESCALATED_MAX_TOKENS = 64000;
57916
56780
  var init_context = __esm(() => {
57917
56781
  init_betas();
57918
- init_config();
57919
56782
  init_envUtils();
57920
56783
  init_antModels();
57921
- init_model();
57922
56784
  init_modelCapabilities();
57923
56785
  init_ollamaModels();
57924
56786
  init_providers();
57925
56787
  });
57926
56788
 
56789
+ // src/utils/fastMode.ts
56790
+ function isFastModeEnabled() {
56791
+ return !isEnvTruthy(process.env.UR_CODE_DISABLE_FAST_MODE);
56792
+ }
56793
+ function isFastModeAvailable() {
56794
+ if (!isFastModeEnabled()) {
56795
+ return false;
56796
+ }
56797
+ return getFastModeUnavailableReason() === null;
56798
+ }
56799
+ function getDisabledReasonMessage(disabledReason, authType) {
56800
+ switch (disabledReason) {
56801
+ case "free":
56802
+ return authType === "oauth" ? "Fast mode requires a paid subscription" : "Fast mode unavailable during evaluation. Please purchase credits.";
56803
+ case "preference":
56804
+ return "Fast mode has been disabled by your organization";
56805
+ case "extra_usage_disabled":
56806
+ return "Fast mode requires extra usage billing \xB7 /extra-usage to enable";
56807
+ case "network_error":
56808
+ return "Fast mode unavailable due to network connectivity issues";
56809
+ case "unknown":
56810
+ return "Fast mode is currently unavailable";
56811
+ }
56812
+ }
56813
+ function getFastModeUnavailableReason() {
56814
+ if (!isFastModeEnabled()) {
56815
+ return "Fast mode is not available";
56816
+ }
56817
+ const statigReason = getFeatureValue_CACHED_MAY_BE_STALE("tengu_penguins_off", null);
56818
+ if (statigReason !== null) {
56819
+ logForDebugging(`Fast mode unavailable: ${statigReason}`);
56820
+ return statigReason;
56821
+ }
56822
+ if (!isInBundledMode() && getFeatureValue_CACHED_MAY_BE_STALE("tengu_marble_sandcastle", false)) {
56823
+ return "Fast mode requires the native binary \xB7 Install from: https://ur.com/product/ur";
56824
+ }
56825
+ if (getIsNonInteractiveSession() && preferThirdPartyAuthentication() && !getKairosActive()) {
56826
+ const flagFastMode = getSettingsForSource("flagSettings")?.fastMode;
56827
+ if (!flagFastMode) {
56828
+ const reason = "Fast mode is not available in the Agent SDK";
56829
+ logForDebugging(`Fast mode unavailable: ${reason}`);
56830
+ return reason;
56831
+ }
56832
+ }
56833
+ if (getAPIProvider() !== "firstParty") {
56834
+ const reason = "Fast mode is not available on Bedrock, Vertex, or Foundry";
56835
+ logForDebugging(`Fast mode unavailable: ${reason}`);
56836
+ return reason;
56837
+ }
56838
+ if (orgStatus.status === "disabled") {
56839
+ if (orgStatus.reason === "network_error" || orgStatus.reason === "unknown") {
56840
+ if (isEnvTruthy(process.env.UR_CODE_SKIP_FAST_MODE_NETWORK_ERRORS)) {
56841
+ return null;
56842
+ }
56843
+ }
56844
+ const authType = getURAIOAuthTokens() !== null ? "oauth" : "api-key";
56845
+ const reason = getDisabledReasonMessage(orgStatus.reason, authType);
56846
+ logForDebugging(`Fast mode unavailable: ${reason}`);
56847
+ return reason;
56848
+ }
56849
+ return null;
56850
+ }
56851
+ function getFastModeModel() {
56852
+ return "modelO" + (ismodelO1mMergeEnabled() ? "[1m]" : "");
56853
+ }
56854
+ function getInitialFastModeSetting(model) {
56855
+ if (!isFastModeEnabled()) {
56856
+ return false;
56857
+ }
56858
+ if (!isFastModeAvailable()) {
56859
+ return false;
56860
+ }
56861
+ if (!isFastModeSupportedByModel(model)) {
56862
+ return false;
56863
+ }
56864
+ const settings = getInitialSettings();
56865
+ if (settings.fastModePerSessionOptIn) {
56866
+ return false;
56867
+ }
56868
+ return settings.fastMode === true;
56869
+ }
56870
+ function isFastModeSupportedByModel(modelSetting) {
56871
+ if (!isFastModeEnabled()) {
56872
+ return false;
56873
+ }
56874
+ return false;
56875
+ }
56876
+ function getFastModeRuntimeState() {
56877
+ if (runtimeState.status === "cooldown" && Date.now() >= runtimeState.resetAt) {
56878
+ if (isFastModeEnabled() && !hasLoggedCooldownExpiry) {
56879
+ logForDebugging("Fast mode cooldown expired, re-enabling fast mode");
56880
+ hasLoggedCooldownExpiry = true;
56881
+ cooldownExpired.emit();
56882
+ }
56883
+ runtimeState = { status: "active" };
56884
+ }
56885
+ return runtimeState;
56886
+ }
56887
+ function triggerFastModeCooldown(resetTimestamp, reason) {
56888
+ if (!isFastModeEnabled()) {
56889
+ return;
56890
+ }
56891
+ runtimeState = { status: "cooldown", resetAt: resetTimestamp, reason };
56892
+ hasLoggedCooldownExpiry = false;
56893
+ const cooldownDurationMs = resetTimestamp - Date.now();
56894
+ logForDebugging(`Fast mode cooldown triggered (${reason}), duration ${Math.round(cooldownDurationMs / 1000)}s`);
56895
+ logEvent("tengu_fast_mode_fallback_triggered", {
56896
+ cooldown_duration_ms: cooldownDurationMs,
56897
+ cooldown_reason: reason
56898
+ });
56899
+ cooldownTriggered.emit(resetTimestamp, reason);
56900
+ }
56901
+ function clearFastModeCooldown() {
56902
+ runtimeState = { status: "active" };
56903
+ }
56904
+ function handleFastModeRejectedByAPI() {
56905
+ if (orgStatus.status === "disabled") {
56906
+ return;
56907
+ }
56908
+ orgStatus = { status: "disabled", reason: "preference" };
56909
+ updateSettingsForSource("userSettings", { fastMode: undefined });
56910
+ saveGlobalConfig((current) => ({
56911
+ ...current,
56912
+ penguinModeOrgEnabled: false
56913
+ }));
56914
+ orgFastModeChange.emit(false);
56915
+ }
56916
+ function getOverageDisabledMessage(reason) {
56917
+ switch (reason) {
56918
+ case "out_of_credits":
56919
+ return "Fast mode disabled \xB7 extra usage credits exhausted";
56920
+ case "org_level_disabled":
56921
+ case "org_service_level_disabled":
56922
+ return "Fast mode disabled \xB7 extra usage disabled by your organization";
56923
+ case "org_level_disabled_until":
56924
+ return "Fast mode disabled \xB7 extra usage spending cap reached";
56925
+ case "member_level_disabled":
56926
+ return "Fast mode disabled \xB7 extra usage disabled for your account";
56927
+ case "seat_tier_level_disabled":
56928
+ case "seat_tier_zero_credit_limit":
56929
+ case "member_zero_credit_limit":
56930
+ return "Fast mode disabled \xB7 extra usage not available for your plan";
56931
+ case "overage_not_provisioned":
56932
+ case "no_limits_configured":
56933
+ return "Fast mode requires extra usage billing \xB7 /extra-usage to enable";
56934
+ default:
56935
+ return "Fast mode disabled \xB7 extra usage not available";
56936
+ }
56937
+ }
56938
+ function isOutOfCreditsReason(reason) {
56939
+ return reason === "org_level_disabled_until" || reason === "out_of_credits";
56940
+ }
56941
+ function handleFastModeOverageRejection(reason) {
56942
+ const message = getOverageDisabledMessage(reason);
56943
+ logForDebugging(`Fast mode overage rejection: ${reason ?? "unknown"} \u2014 ${message}`);
56944
+ logEvent("tengu_fast_mode_overage_rejected", {
56945
+ overage_disabled_reason: reason ?? "unknown"
56946
+ });
56947
+ if (!isOutOfCreditsReason(reason)) {
56948
+ updateSettingsForSource("userSettings", { fastMode: undefined });
56949
+ saveGlobalConfig((current) => ({
56950
+ ...current,
56951
+ penguinModeOrgEnabled: false
56952
+ }));
56953
+ }
56954
+ overageRejection.emit(message);
56955
+ }
56956
+ function isFastModeCooldown() {
56957
+ return getFastModeRuntimeState().status === "cooldown";
56958
+ }
56959
+ function getFastModeState(model, fastModeUserEnabled) {
56960
+ const enabled = isFastModeEnabled() && isFastModeAvailable() && !!fastModeUserEnabled && isFastModeSupportedByModel(model);
56961
+ if (enabled && isFastModeCooldown()) {
56962
+ return "cooldown";
56963
+ }
56964
+ if (enabled) {
56965
+ return "on";
56966
+ }
56967
+ return "off";
56968
+ }
56969
+ async function fetchFastModeStatus(auth) {
56970
+ const endpoint = `${getOauthConfig().BASE_API_URL}/api/ur_penguin_mode`;
56971
+ const headers = "accessToken" in auth ? {
56972
+ Authorization: `Bearer ${auth.accessToken}`,
56973
+ "urhq-beta": OAUTH_BETA_HEADER
56974
+ } : { "x-api-key": auth.apiKey };
56975
+ const response = await axios_default.get(endpoint, { headers });
56976
+ return response.data;
56977
+ }
56978
+ function resolveFastModeStatusFromCache() {
56979
+ if (!isFastModeEnabled()) {
56980
+ return;
56981
+ }
56982
+ if (orgStatus.status !== "pending") {
56983
+ return;
56984
+ }
56985
+ const isAnt = process.env.USER_TYPE === "ant";
56986
+ const cachedEnabled = getGlobalConfig().penguinModeOrgEnabled === true;
56987
+ orgStatus = isAnt || cachedEnabled ? { status: "enabled" } : { status: "disabled", reason: "unknown" };
56988
+ }
56989
+ async function prefetchFastModeStatus() {
56990
+ if (isEssentialTrafficOnly()) {
56991
+ return;
56992
+ }
56993
+ if (!isFastModeEnabled()) {
56994
+ return;
56995
+ }
56996
+ if (inflightPrefetch) {
56997
+ logForDebugging("Fast mode prefetch in progress, returning in-flight promise");
56998
+ return inflightPrefetch;
56999
+ }
57000
+ const apiKey = getURHQApiKey();
57001
+ const hasUsableOAuth = getURAIOAuthTokens()?.accessToken && hasProfileScope();
57002
+ if (!hasUsableOAuth && !apiKey) {
57003
+ const isAnt = process.env.USER_TYPE === "ant";
57004
+ const cachedEnabled = getGlobalConfig().penguinModeOrgEnabled === true;
57005
+ orgStatus = isAnt || cachedEnabled ? { status: "enabled" } : { status: "disabled", reason: "preference" };
57006
+ return;
57007
+ }
57008
+ const now2 = Date.now();
57009
+ if (now2 - lastPrefetchAt < PREFETCH_MIN_INTERVAL_MS) {
57010
+ logForDebugging("Skipping fast mode prefetch, fetched recently");
57011
+ return;
57012
+ }
57013
+ lastPrefetchAt = now2;
57014
+ const fetchWithCurrentAuth = async () => {
57015
+ const currentTokens = getURAIOAuthTokens();
57016
+ const auth = currentTokens?.accessToken && hasProfileScope() ? { accessToken: currentTokens.accessToken } : apiKey ? { apiKey } : null;
57017
+ if (!auth) {
57018
+ throw new Error("No auth available");
57019
+ }
57020
+ return fetchFastModeStatus(auth);
57021
+ };
57022
+ async function doFetch() {
57023
+ try {
57024
+ let status;
57025
+ try {
57026
+ status = await fetchWithCurrentAuth();
57027
+ } catch (err) {
57028
+ const isAuthError = axios_default.isAxiosError(err) && (err.response?.status === 401 || err.response?.status === 403 && typeof err.response?.data === "string" && err.response.data.includes("OAuth token has been revoked"));
57029
+ if (isAuthError) {
57030
+ const failedAccessToken = getURAIOAuthTokens()?.accessToken;
57031
+ if (failedAccessToken) {
57032
+ await handleOAuth401Error(failedAccessToken);
57033
+ status = await fetchWithCurrentAuth();
57034
+ } else {
57035
+ throw err;
57036
+ }
57037
+ } else {
57038
+ throw err;
57039
+ }
57040
+ }
57041
+ const previousEnabled = orgStatus.status !== "pending" ? orgStatus.status === "enabled" : getGlobalConfig().penguinModeOrgEnabled;
57042
+ orgStatus = status.enabled ? { status: "enabled" } : {
57043
+ status: "disabled",
57044
+ reason: status.disabled_reason ?? "preference"
57045
+ };
57046
+ if (previousEnabled !== status.enabled) {
57047
+ if (!status.enabled) {
57048
+ updateSettingsForSource("userSettings", { fastMode: undefined });
57049
+ }
57050
+ saveGlobalConfig((current) => ({
57051
+ ...current,
57052
+ penguinModeOrgEnabled: status.enabled
57053
+ }));
57054
+ orgFastModeChange.emit(status.enabled);
57055
+ }
57056
+ logForDebugging(`Org fast mode: ${status.enabled ? "enabled" : `disabled (${status.disabled_reason ?? "preference"})`}`);
57057
+ } catch (err) {
57058
+ const isAnt = process.env.USER_TYPE === "ant";
57059
+ const cachedEnabled = getGlobalConfig().penguinModeOrgEnabled === true;
57060
+ orgStatus = isAnt || cachedEnabled ? { status: "enabled" } : { status: "disabled", reason: "network_error" };
57061
+ logForDebugging(`Failed to fetch org fast mode status, defaulting to ${orgStatus.status === "enabled" ? "enabled (cached)" : "disabled (network_error)"}: ${err}`, { level: "error" });
57062
+ logEvent("tengu_org_penguin_mode_fetch_failed", {});
57063
+ } finally {
57064
+ inflightPrefetch = null;
57065
+ }
57066
+ }
57067
+ inflightPrefetch = doFetch();
57068
+ return inflightPrefetch;
57069
+ }
57070
+ var FAST_MODE_MODEL_DISPLAY = "modelO 4.6", runtimeState, hasLoggedCooldownExpiry = false, cooldownTriggered, cooldownExpired, onCooldownTriggered, onCooldownExpired, overageRejection, onFastModeOverageRejection, orgStatus, orgFastModeChange, onOrgFastModeChanged, PREFETCH_MIN_INTERVAL_MS = 30000, lastPrefetchAt = 0, inflightPrefetch = null;
57071
+ var init_fastMode = __esm(() => {
57072
+ init_axios2();
57073
+ init_oauth();
57074
+ init_growthbook();
57075
+ init_state();
57076
+ init_analytics();
57077
+ init_auth();
57078
+ init_config();
57079
+ init_debug();
57080
+ init_envUtils();
57081
+ init_model();
57082
+ init_providers();
57083
+ init_settings2();
57084
+ runtimeState = { status: "active" };
57085
+ cooldownTriggered = createSignal();
57086
+ cooldownExpired = createSignal();
57087
+ onCooldownTriggered = cooldownTriggered.subscribe;
57088
+ onCooldownExpired = cooldownExpired.subscribe;
57089
+ overageRejection = createSignal();
57090
+ onFastModeOverageRejection = overageRejection.subscribe;
57091
+ orgStatus = { status: "pending" };
57092
+ orgFastModeChange = createSignal();
57093
+ onOrgFastModeChanged = orgFastModeChange.subscribe;
57094
+ });
57095
+
57096
+ // src/utils/modelCost.ts
57097
+ function getmodelO46CostTier(fastMode) {
57098
+ if (isFastModeEnabled() && fastMode) {
57099
+ return COST_TIER_30_150;
57100
+ }
57101
+ return COST_TIER_5_25;
57102
+ }
57103
+ function tokensToUSDCost(modelCosts, usage) {
57104
+ return usage.input_tokens / 1e6 * modelCosts.inputTokens + usage.output_tokens / 1e6 * modelCosts.outputTokens + (usage.cache_read_input_tokens ?? 0) / 1e6 * modelCosts.promptCacheReadTokens + (usage.cache_creation_input_tokens ?? 0) / 1e6 * modelCosts.promptCacheWriteTokens + (usage.server_tool_use?.web_search_requests ?? 0) * modelCosts.webSearchRequests;
57105
+ }
57106
+ function getModelCosts(model, usage) {
57107
+ const shortName = getCanonicalName(model);
57108
+ if (shortName === firstPartyNameToCanonical(UR_MODELO_4_6_CONFIG.firstParty)) {
57109
+ const isFastMode = usage.speed === "fast";
57110
+ return getmodelO46CostTier(isFastMode);
57111
+ }
57112
+ const costs = MODEL_COSTS[shortName];
57113
+ if (!costs) {
57114
+ trackUnknownModelCost(model, shortName);
57115
+ return MODEL_COSTS[getCanonicalName(getDefaultMainLoopModelSetting())] ?? DEFAULT_UNKNOWN_MODEL_COST;
57116
+ }
57117
+ return costs;
57118
+ }
57119
+ function trackUnknownModelCost(model, shortName) {
57120
+ logEvent("tengu_unknown_model_cost", {
57121
+ model,
57122
+ shortName
57123
+ });
57124
+ setHasUnknownModelCost();
57125
+ }
57126
+ function calculateUSDCost(resolvedModel, usage) {
57127
+ if (getAPIProvider() === "ollama") {
57128
+ return 0;
57129
+ }
57130
+ const modelCosts = getModelCosts(resolvedModel, usage);
57131
+ return tokensToUSDCost(modelCosts, usage);
57132
+ }
57133
+ function formatPrice(price) {
57134
+ if (Number.isInteger(price)) {
57135
+ return `$${price}`;
57136
+ }
57137
+ return `$${price.toFixed(2)}`;
57138
+ }
57139
+ function formatModelPricing(costs) {
57140
+ return `${formatPrice(costs.inputTokens)}/${formatPrice(costs.outputTokens)} per Mtok`;
57141
+ }
57142
+ var COST_TIER_3_15, COST_TIER_15_75, COST_TIER_5_25, COST_TIER_30_150, COST_MODELH_35, COST_MODELH_45, DEFAULT_UNKNOWN_MODEL_COST, MODEL_COSTS;
57143
+ var init_modelCost = __esm(() => {
57144
+ init_analytics();
57145
+ init_state();
57146
+ init_fastMode();
57147
+ init_configs();
57148
+ init_model();
57149
+ init_providers();
57150
+ COST_TIER_3_15 = {
57151
+ inputTokens: 3,
57152
+ outputTokens: 15,
57153
+ promptCacheWriteTokens: 3.75,
57154
+ promptCacheReadTokens: 0.3,
57155
+ webSearchRequests: 0.01
57156
+ };
57157
+ COST_TIER_15_75 = {
57158
+ inputTokens: 15,
57159
+ outputTokens: 75,
57160
+ promptCacheWriteTokens: 18.75,
57161
+ promptCacheReadTokens: 1.5,
57162
+ webSearchRequests: 0.01
57163
+ };
57164
+ COST_TIER_5_25 = {
57165
+ inputTokens: 5,
57166
+ outputTokens: 25,
57167
+ promptCacheWriteTokens: 6.25,
57168
+ promptCacheReadTokens: 0.5,
57169
+ webSearchRequests: 0.01
57170
+ };
57171
+ COST_TIER_30_150 = {
57172
+ inputTokens: 30,
57173
+ outputTokens: 150,
57174
+ promptCacheWriteTokens: 37.5,
57175
+ promptCacheReadTokens: 3,
57176
+ webSearchRequests: 0.01
57177
+ };
57178
+ COST_MODELH_35 = {
57179
+ inputTokens: 0.8,
57180
+ outputTokens: 4,
57181
+ promptCacheWriteTokens: 1,
57182
+ promptCacheReadTokens: 0.08,
57183
+ webSearchRequests: 0.01
57184
+ };
57185
+ COST_MODELH_45 = {
57186
+ inputTokens: 1,
57187
+ outputTokens: 5,
57188
+ promptCacheWriteTokens: 1.25,
57189
+ promptCacheReadTokens: 0.1,
57190
+ webSearchRequests: 0.01
57191
+ };
57192
+ DEFAULT_UNKNOWN_MODEL_COST = COST_TIER_5_25;
57193
+ MODEL_COSTS = {
57194
+ [firstPartyNameToCanonical(UR_3_5_MODELH_CONFIG.firstParty)]: COST_MODELH_35,
57195
+ [firstPartyNameToCanonical(UR_MODELH_4_5_CONFIG.firstParty)]: COST_MODELH_45,
57196
+ [firstPartyNameToCanonical(UR_3_5_V2_MODELS_CONFIG.firstParty)]: COST_TIER_3_15,
57197
+ [firstPartyNameToCanonical(UR_3_7_MODELS_CONFIG.firstParty)]: COST_TIER_3_15,
57198
+ [firstPartyNameToCanonical(UR_MODELS_4_CONFIG.firstParty)]: COST_TIER_3_15,
57199
+ [firstPartyNameToCanonical(UR_MODELS_4_5_CONFIG.firstParty)]: COST_TIER_3_15,
57200
+ [firstPartyNameToCanonical(UR_MODELS_4_6_CONFIG.firstParty)]: COST_TIER_3_15,
57201
+ [firstPartyNameToCanonical(UR_MODELO_4_CONFIG.firstParty)]: COST_TIER_15_75,
57202
+ [firstPartyNameToCanonical(UR_MODELO_4_1_CONFIG.firstParty)]: COST_TIER_15_75,
57203
+ [firstPartyNameToCanonical(UR_MODELO_4_5_CONFIG.firstParty)]: COST_TIER_5_25,
57204
+ [firstPartyNameToCanonical(UR_MODELO_4_6_CONFIG.firstParty)]: COST_TIER_5_25
57205
+ };
57206
+ });
57207
+
57208
+ // src/constants/figures.ts
57209
+ var BLACK_CIRCLE, UR_HOUSE = "\u2302", UP_ARROW = "\u2191", DOWN_ARROW = "\u2193", LIGHTNING_BOLT = "\u21AF", EFFORT_LOW = "\u25CB", EFFORT_MEDIUM = "\u25D0", EFFORT_HIGH = "\u25CF", EFFORT_MAX = "\u25C9", PAUSE_ICON = "\u23F8", REFRESH_ARROW = "\u21BB", DIAMOND_OPEN = "\u25C7", DIAMOND_FILLED = "\u25C6", REFERENCE_MARK = "\u203B", BLOCKQUOTE_BAR = "\u258E", BRIDGE_READY_INDICATOR = "\xB7\u2714\uFE0E\xB7", BRIDGE_FAILED_INDICATOR = "\xD7";
57210
+ var init_figures2 = __esm(() => {
57211
+ BLACK_CIRCLE = process.platform === "darwin" ? "\u23FA" : "\u25CF";
57212
+ });
57213
+
57214
+ // src/utils/model/aliases.ts
57215
+ function isModelAlias(modelInput) {
57216
+ return MODEL_ALIASES.includes(modelInput);
57217
+ }
57218
+ function isModelFamilyAlias(model) {
57219
+ return MODEL_FAMILY_ALIASES.includes(model);
57220
+ }
57221
+ var MODEL_ALIASES, MODEL_FAMILY_ALIASES;
57222
+ var init_aliases = __esm(() => {
57223
+ MODEL_ALIASES = [
57224
+ "modelS",
57225
+ "modelO",
57226
+ "modelH",
57227
+ "best",
57228
+ "modelS[1m]",
57229
+ "modelO[1m]",
57230
+ "modelOplan"
57231
+ ];
57232
+ MODEL_FAMILY_ALIASES = ["modelS", "modelO", "modelH"];
57233
+ });
57234
+
57235
+ // src/utils/model/modelAllowlist.ts
57236
+ function modelBelongsToFamily(model, family) {
57237
+ if (model.includes(family)) {
57238
+ return true;
57239
+ }
57240
+ if (isModelAlias(model)) {
57241
+ const resolved = parseUserSpecifiedModel(model).toLowerCase();
57242
+ return resolved.includes(family);
57243
+ }
57244
+ return false;
57245
+ }
57246
+ function prefixMatchesModel(modelName, prefix) {
57247
+ if (!modelName.startsWith(prefix)) {
57248
+ return false;
57249
+ }
57250
+ return modelName.length === prefix.length || modelName[prefix.length] === "-";
57251
+ }
57252
+ function modelMatchesVersionPrefix(model, entry) {
57253
+ const resolvedModel = isModelAlias(model) ? parseUserSpecifiedModel(model).toLowerCase() : model;
57254
+ if (prefixMatchesModel(resolvedModel, entry)) {
57255
+ return true;
57256
+ }
57257
+ if (!entry.startsWith("ur-") && prefixMatchesModel(resolvedModel, `ur-${entry}`)) {
57258
+ return true;
57259
+ }
57260
+ return false;
57261
+ }
57262
+ function familyHasSpecificEntries(family, allowlist) {
57263
+ for (const entry of allowlist) {
57264
+ if (isModelFamilyAlias(entry)) {
57265
+ continue;
57266
+ }
57267
+ const idx = entry.indexOf(family);
57268
+ if (idx === -1) {
57269
+ continue;
57270
+ }
57271
+ const afterFamily = idx + family.length;
57272
+ if (afterFamily === entry.length || entry[afterFamily] === "-") {
57273
+ return true;
57274
+ }
57275
+ }
57276
+ return false;
57277
+ }
57278
+ function isModelAllowed(model) {
57279
+ if (getAPIProvider() === "ollama") {
57280
+ return true;
57281
+ }
57282
+ const settings = getSettings_DEPRECATED() || {};
57283
+ const { availableModels } = settings;
57284
+ if (!availableModels) {
57285
+ return true;
57286
+ }
57287
+ if (availableModels.length === 0) {
57288
+ return false;
57289
+ }
57290
+ const resolvedModel = resolveOverriddenModel(model);
57291
+ const normalizedModel = resolvedModel.trim().toLowerCase();
57292
+ const normalizedAllowlist = availableModels.map((m) => m.trim().toLowerCase());
57293
+ if (normalizedAllowlist.includes(normalizedModel)) {
57294
+ if (!isModelFamilyAlias(normalizedModel) || !familyHasSpecificEntries(normalizedModel, normalizedAllowlist)) {
57295
+ return true;
57296
+ }
57297
+ }
57298
+ for (const entry of normalizedAllowlist) {
57299
+ if (isModelFamilyAlias(entry) && !familyHasSpecificEntries(entry, normalizedAllowlist) && modelBelongsToFamily(normalizedModel, entry)) {
57300
+ return true;
57301
+ }
57302
+ }
57303
+ if (isModelAlias(normalizedModel)) {
57304
+ const resolved = parseUserSpecifiedModel(normalizedModel).toLowerCase();
57305
+ if (normalizedAllowlist.includes(resolved)) {
57306
+ return true;
57307
+ }
57308
+ }
57309
+ for (const entry of normalizedAllowlist) {
57310
+ if (!isModelFamilyAlias(entry) && isModelAlias(entry)) {
57311
+ const resolved = parseUserSpecifiedModel(entry).toLowerCase();
57312
+ if (resolved === normalizedModel) {
57313
+ return true;
57314
+ }
57315
+ }
57316
+ }
57317
+ for (const entry of normalizedAllowlist) {
57318
+ if (!isModelFamilyAlias(entry) && !isModelAlias(entry)) {
57319
+ if (modelMatchesVersionPrefix(normalizedModel, entry)) {
57320
+ return true;
57321
+ }
57322
+ }
57323
+ }
57324
+ return false;
57325
+ }
57326
+ var init_modelAllowlist = __esm(() => {
57327
+ init_settings2();
57328
+ init_aliases();
57329
+ init_model();
57330
+ init_modelStrings();
57331
+ init_providers();
57332
+ });
57333
+
57334
+ // src/utils/stringUtils.ts
57335
+ function escapeRegExp(str) {
57336
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
57337
+ }
57338
+ function capitalize2(str) {
57339
+ return str.charAt(0).toUpperCase() + str.slice(1);
57340
+ }
57341
+ function plural(n2, word, pluralWord = word + "s") {
57342
+ return n2 === 1 ? word : pluralWord;
57343
+ }
57344
+ function firstLineOf(s) {
57345
+ const nl = s.indexOf(`
57346
+ `);
57347
+ return nl === -1 ? s : s.slice(0, nl);
57348
+ }
57349
+ function countCharInString(str, char, start = 0) {
57350
+ let count3 = 0;
57351
+ let i2 = str.indexOf(char, start);
57352
+ while (i2 !== -1) {
57353
+ count3++;
57354
+ i2 = str.indexOf(char, i2 + 1);
57355
+ }
57356
+ return count3;
57357
+ }
57358
+ function normalizeFullWidthDigits(input) {
57359
+ return input.replace(/[\uFF10-\uFF19]/g, (ch) => String.fromCharCode(ch.charCodeAt(0) - 65248));
57360
+ }
57361
+ function normalizeFullWidthSpace(input) {
57362
+ return input.replace(/\u3000/g, " ");
57363
+ }
57364
+ function safeJoinLines(lines, delimiter = ",", maxSize = MAX_STRING_LENGTH) {
57365
+ const truncationMarker = "...[truncated]";
57366
+ let result = "";
57367
+ for (const line of lines) {
57368
+ const delimiterToAdd = result ? delimiter : "";
57369
+ const fullAddition = delimiterToAdd + line;
57370
+ if (result.length + fullAddition.length <= maxSize) {
57371
+ result += fullAddition;
57372
+ } else {
57373
+ const remainingSpace = maxSize - result.length - delimiterToAdd.length - truncationMarker.length;
57374
+ if (remainingSpace > 0) {
57375
+ result += delimiterToAdd + line.slice(0, remainingSpace) + truncationMarker;
57376
+ } else {
57377
+ result += truncationMarker;
57378
+ }
57379
+ return result;
57380
+ }
57381
+ }
57382
+ return result;
57383
+ }
57384
+
57385
+ class EndTruncatingAccumulator {
57386
+ maxSize;
57387
+ content = "";
57388
+ isTruncated = false;
57389
+ totalBytesReceived = 0;
57390
+ constructor(maxSize = MAX_STRING_LENGTH) {
57391
+ this.maxSize = maxSize;
57392
+ }
57393
+ append(data) {
57394
+ const str = typeof data === "string" ? data : data.toString();
57395
+ this.totalBytesReceived += str.length;
57396
+ if (this.isTruncated && this.content.length >= this.maxSize) {
57397
+ return;
57398
+ }
57399
+ if (this.content.length + str.length > this.maxSize) {
57400
+ const remainingSpace = this.maxSize - this.content.length;
57401
+ if (remainingSpace > 0) {
57402
+ this.content += str.slice(0, remainingSpace);
57403
+ }
57404
+ this.isTruncated = true;
57405
+ } else {
57406
+ this.content += str;
57407
+ }
57408
+ }
57409
+ toString() {
57410
+ if (!this.isTruncated) {
57411
+ return this.content;
57412
+ }
57413
+ const truncatedBytes = this.totalBytesReceived - this.maxSize;
57414
+ const truncatedKB = Math.round(truncatedBytes / 1024);
57415
+ return this.content + `
57416
+ ... [output truncated - ${truncatedKB}KB removed]`;
57417
+ }
57418
+ clear() {
57419
+ this.content = "";
57420
+ this.isTruncated = false;
57421
+ this.totalBytesReceived = 0;
57422
+ }
57423
+ get length() {
57424
+ return this.content.length;
57425
+ }
57426
+ get truncated() {
57427
+ return this.isTruncated;
57428
+ }
57429
+ get totalBytes() {
57430
+ return this.totalBytesReceived;
57431
+ }
57432
+ }
57433
+ function truncateToLines(text, maxLines) {
57434
+ const lines = text.split(`
57435
+ `);
57436
+ if (lines.length <= maxLines) {
57437
+ return text;
57438
+ }
57439
+ return lines.slice(0, maxLines).join(`
57440
+ `) + "\u2026";
57441
+ }
57442
+ var MAX_STRING_LENGTH;
57443
+ var init_stringUtils = __esm(() => {
57444
+ MAX_STRING_LENGTH = 2 ** 25;
57445
+ });
57446
+
57447
+ // src/utils/model/model.ts
57448
+ var exports_model = {};
57449
+ __export(exports_model, {
57450
+ resolveSkillModelOverride: () => resolveSkillModelOverride,
57451
+ renderModelSetting: () => renderModelSetting,
57452
+ renderModelName: () => renderModelName,
57453
+ renderDefaultModelSetting: () => renderDefaultModelSetting,
57454
+ parseUserSpecifiedModel: () => parseUserSpecifiedModel,
57455
+ normalizeModelStringForAPI: () => normalizeModelStringForAPI,
57456
+ modelDisplayString: () => modelDisplayString,
57457
+ ismodelO1mMergeEnabled: () => ismodelO1mMergeEnabled,
57458
+ isNonCustommodelOModel: () => isNonCustommodelOModel,
57459
+ isLegacyModelRemapEnabled: () => isLegacyModelRemapEnabled,
57460
+ getmodelO46PricingSuffix: () => getmodelO46PricingSuffix,
57461
+ getUserSpecifiedModelSetting: () => getUserSpecifiedModelSetting,
57462
+ getURAiUserDefaultModelDescription: () => getURAiUserDefaultModelDescription,
57463
+ getSmallFastModel: () => getSmallFastModel,
57464
+ getRuntimeMainLoopModel: () => getRuntimeMainLoopModel,
57465
+ getPublicModelName: () => getPublicModelName,
57466
+ getPublicModelDisplayName: () => getPublicModelDisplayName,
57467
+ getMarketingNameForModel: () => getMarketingNameForModel,
57468
+ getMainLoopModel: () => getMainLoopModel,
57469
+ getDefaultmodelSModel: () => getDefaultmodelSModel,
57470
+ getDefaultmodelOModel: () => getDefaultmodelOModel,
57471
+ getDefaultmodelHModel: () => getDefaultmodelHModel,
57472
+ getDefaultOllamaModel: () => getDefaultOllamaModel,
57473
+ getDefaultMainLoopModelSetting: () => getDefaultMainLoopModelSetting,
57474
+ getDefaultMainLoopModel: () => getDefaultMainLoopModel,
57475
+ getCanonicalName: () => getCanonicalName,
57476
+ getBestModel: () => getBestModel,
57477
+ firstPartyNameToCanonical: () => firstPartyNameToCanonical,
57478
+ __resetOllamaRouteMemoForTests: () => __resetOllamaRouteMemoForTests
57479
+ });
57480
+ function __resetOllamaRouteMemoForTests() {
57481
+ memoizedRoutedDefaultModel = undefined;
57482
+ memoizedRoutedFastModel = undefined;
57483
+ }
57484
+ function getDefaultOllamaModel() {
57485
+ if (process.env.OLLAMA_MODEL) {
57486
+ return process.env.OLLAMA_MODEL;
57487
+ }
57488
+ if (isOllamaAutoRouteEnabled()) {
57489
+ if (memoizedRoutedDefaultModel)
57490
+ return memoizedRoutedDefaultModel;
57491
+ const routed = pickBestCoderModel(getCachedOllamaModelNames());
57492
+ if (routed) {
57493
+ memoizedRoutedDefaultModel = routed;
57494
+ return routed;
57495
+ }
57496
+ }
57497
+ return DEFAULT_OLLAMA_MODEL2;
57498
+ }
57499
+ function getSmallFastModel() {
57500
+ if (getAPIProvider() === "ollama") {
57501
+ if (process.env.OLLAMA_SMALL_FAST_MODEL) {
57502
+ return process.env.OLLAMA_SMALL_FAST_MODEL;
57503
+ }
57504
+ if (isOllamaAutoRouteEnabled()) {
57505
+ if (memoizedRoutedFastModel)
57506
+ return memoizedRoutedFastModel;
57507
+ const routed = pickSmallFastModel(getCachedOllamaModelNames());
57508
+ if (routed) {
57509
+ memoizedRoutedFastModel = routed;
57510
+ return routed;
57511
+ }
57512
+ }
57513
+ return getDefaultOllamaModel();
57514
+ }
57515
+ return process.env.URHQ_SMALL_FAST_MODEL || getDefaultmodelHModel();
57516
+ }
57517
+ function isNonCustommodelOModel(model) {
57518
+ return model === getModelStrings2().modelO40 || model === getModelStrings2().modelO41 || model === getModelStrings2().modelO45 || model === getModelStrings2().modelO46;
57519
+ }
57520
+ function getUserSpecifiedModelSetting() {
57521
+ let specifiedModel;
57522
+ const modelOverride = getMainLoopModelOverride();
57523
+ if (modelOverride !== undefined) {
57524
+ specifiedModel = modelOverride;
57525
+ } else {
57526
+ const settings = getSettings_DEPRECATED() || {};
57527
+ specifiedModel = process.env.URHQ_MODEL || settings.model || undefined;
57528
+ }
57529
+ if (specifiedModel && !isModelAllowed(specifiedModel)) {
57530
+ return;
57531
+ }
57532
+ return specifiedModel;
57533
+ }
57534
+ function getMainLoopModel() {
57535
+ const model = getUserSpecifiedModelSetting();
57536
+ if (model !== undefined && model !== null) {
57537
+ return parseUserSpecifiedModel(model);
57538
+ }
57539
+ return getDefaultMainLoopModel();
57540
+ }
57541
+ function getBestModel() {
57542
+ return getDefaultmodelOModel();
57543
+ }
57544
+ function getDefaultmodelOModel() {
57545
+ if (getAPIProvider() === "ollama") {
57546
+ return getDefaultOllamaModel();
57547
+ }
57548
+ if (process.env.URHQ_DEFAULT_MODELO_MODEL) {
57549
+ return process.env.URHQ_DEFAULT_MODELO_MODEL;
57550
+ }
57551
+ if (getAPIProvider() !== "firstParty") {
57552
+ return getModelStrings2().modelO46;
57553
+ }
57554
+ return getModelStrings2().modelO46;
57555
+ }
57556
+ function getDefaultmodelSModel() {
57557
+ if (getAPIProvider() === "ollama") {
57558
+ return getDefaultOllamaModel();
57559
+ }
57560
+ if (process.env.URHQ_DEFAULT_MODELS_MODEL) {
57561
+ return process.env.URHQ_DEFAULT_MODELS_MODEL;
57562
+ }
57563
+ if (getAPIProvider() !== "firstParty") {
57564
+ return getModelStrings2().modelS45;
57565
+ }
57566
+ return getModelStrings2().modelS46;
57567
+ }
57568
+ function getDefaultmodelHModel() {
57569
+ if (getAPIProvider() === "ollama") {
57570
+ return process.env.OLLAMA_SMALL_FAST_MODEL || getDefaultOllamaModel();
57571
+ }
57572
+ if (process.env.URHQ_DEFAULT_MODELH_MODEL) {
57573
+ return process.env.URHQ_DEFAULT_MODELH_MODEL;
57574
+ }
57575
+ return getModelStrings2().modelH45;
57576
+ }
57577
+ function getRuntimeMainLoopModel(params) {
57578
+ const { permissionMode, mainLoopModel, exceeds200kTokens = false } = params;
57579
+ if (getUserSpecifiedModelSetting() === "modelOplan" && permissionMode === "plan" && !exceeds200kTokens) {
57580
+ return getDefaultmodelOModel();
57581
+ }
57582
+ if (getUserSpecifiedModelSetting() === "modelH" && permissionMode === "plan") {
57583
+ return getDefaultmodelSModel();
57584
+ }
57585
+ return mainLoopModel;
57586
+ }
57587
+ function getDefaultMainLoopModelSetting() {
57588
+ const settings = getSettings_DEPRECATED() || {};
57589
+ const activeProvider = getActiveProviderSettings(settings).active ?? "ollama";
57590
+ if (activeProvider !== "ollama") {
57591
+ const providerDefault = getDefaultModelForProvider(activeProvider);
57592
+ if (providerDefault) {
57593
+ return providerDefault;
57594
+ }
57595
+ }
57596
+ if (getAPIProvider() === "ollama") {
57597
+ return getDefaultOllamaModel();
57598
+ }
57599
+ if (process.env.USER_TYPE === "ant") {
57600
+ return getAntModelOverrideConfig2()?.defaultModel ?? getDefaultmodelOModel() + "[1m]";
57601
+ }
57602
+ if (isMaxSubscriber()) {
57603
+ return getDefaultmodelOModel() + (ismodelO1mMergeEnabled() ? "[1m]" : "");
57604
+ }
57605
+ if (isTeamPremiumSubscriber()) {
57606
+ return getDefaultmodelOModel() + (ismodelO1mMergeEnabled() ? "[1m]" : "");
57607
+ }
57608
+ return getDefaultmodelSModel();
57609
+ }
57610
+ function getDefaultMainLoopModel() {
57611
+ return parseUserSpecifiedModel(getDefaultMainLoopModelSetting());
57612
+ }
57613
+ function firstPartyNameToCanonical(name) {
57614
+ return name.toLowerCase();
57615
+ }
57616
+ function getCanonicalName(fullModelName) {
57617
+ return firstPartyNameToCanonical(resolveOverriddenModel(fullModelName));
57618
+ }
57619
+ function getURAiUserDefaultModelDescription(fastMode = false) {
57620
+ if (isMaxSubscriber() || isTeamPremiumSubscriber()) {
57621
+ if (ismodelO1mMergeEnabled()) {
57622
+ return `modelO 4.6 with 1M context \xB7 Most capable for complex work${fastMode ? getmodelO46PricingSuffix(true) : ""}`;
57623
+ }
57624
+ return `modelO 4.6 \xB7 Most capable for complex work${fastMode ? getmodelO46PricingSuffix(true) : ""}`;
57625
+ }
57626
+ return "modelS 4.6 \xB7 Best for everyday tasks";
57627
+ }
57628
+ function renderDefaultModelSetting(setting) {
57629
+ if (setting === "modelOplan") {
57630
+ return "modelO 4.6 in plan mode, else modelS 4.6";
57631
+ }
57632
+ return renderModelName(parseUserSpecifiedModel(setting));
57633
+ }
57634
+ function getmodelO46PricingSuffix(fastMode) {
57635
+ if (getAPIProvider() !== "firstParty")
57636
+ return "";
57637
+ const pricing = formatModelPricing(getmodelO46CostTier(fastMode));
57638
+ const fastModeIndicator = fastMode ? ` (${LIGHTNING_BOLT})` : "";
57639
+ return ` \xB7${fastModeIndicator} ${pricing}`;
57640
+ }
57641
+ function ismodelO1mMergeEnabled() {
57642
+ if (is1mContextDisabled() || isProSubscriber() || getAPIProvider() !== "firstParty") {
57643
+ return false;
57644
+ }
57645
+ if (isURAISubscriber2() && getSubscriptionType() === null) {
57646
+ return false;
57647
+ }
57648
+ return true;
57649
+ }
57650
+ function renderModelSetting(setting) {
57651
+ if (setting === "modelOplan") {
57652
+ return "modelO Plan";
57653
+ }
57654
+ if (isModelAlias(setting)) {
57655
+ return capitalize2(setting);
57656
+ }
57657
+ return renderModelName(setting);
57658
+ }
57659
+ function getPublicModelDisplayName(model) {
57660
+ if (getAPIProvider() === "ollama") {
57661
+ return null;
57662
+ }
57663
+ switch (model) {
57664
+ case getModelStrings2().modelO46:
57665
+ return "modelO 4.6";
57666
+ case getModelStrings2().modelO46 + "[1m]":
57667
+ return "modelO 4.6 (1M context)";
57668
+ case getModelStrings2().modelO45:
57669
+ return "modelO 4.5";
57670
+ case getModelStrings2().modelO41:
57671
+ return "modelO 4.1";
57672
+ case getModelStrings2().modelO40:
57673
+ return "modelO 4";
57674
+ case getModelStrings2().modelS46 + "[1m]":
57675
+ return "modelS 4.6 (1M context)";
57676
+ case getModelStrings2().modelS46:
57677
+ return "modelS 4.6";
57678
+ case getModelStrings2().modelS45 + "[1m]":
57679
+ return "modelS 4.5 (1M context)";
57680
+ case getModelStrings2().modelS45:
57681
+ return "modelS 4.5";
57682
+ case getModelStrings2().modelS40:
57683
+ return "modelS 4";
57684
+ case getModelStrings2().modelS40 + "[1m]":
57685
+ return "modelS 4 (1M context)";
57686
+ case getModelStrings2().modelS37:
57687
+ return "modelS 3.7";
57688
+ case getModelStrings2().modelS35:
57689
+ return "modelS 3.5";
57690
+ case getModelStrings2().modelH45:
57691
+ return "modelH 4.5";
57692
+ case getModelStrings2().modelH35:
57693
+ return "modelH 3.5";
57694
+ default:
57695
+ return null;
57696
+ }
57697
+ }
57698
+ function maskModelCodename(baseName) {
57699
+ const [codename = "", ...rest] = baseName.split("-");
57700
+ const masked = codename.slice(0, 3) + "*".repeat(Math.max(0, codename.length - 3));
57701
+ return [masked, ...rest].join("-");
57702
+ }
57703
+ function renderModelName(model) {
57704
+ const publicName = getPublicModelDisplayName(model);
57705
+ if (publicName) {
57706
+ return publicName;
57707
+ }
57708
+ if (process.env.USER_TYPE === "ant") {
57709
+ const resolved = parseUserSpecifiedModel(model);
57710
+ const antModel = resolveAntModel2(model);
57711
+ if (antModel) {
57712
+ const baseName = antModel.model.replace(/\[1m\]$/i, "");
57713
+ const masked = maskModelCodename(baseName);
57714
+ const suffix = has1mContext(resolved) ? "[1m]" : "";
57715
+ return masked + suffix;
57716
+ }
57717
+ if (resolved !== model) {
57718
+ return `${model} (${resolved})`;
57719
+ }
57720
+ return resolved;
57721
+ }
57722
+ return model;
57723
+ }
57724
+ function getPublicModelName(model) {
57725
+ if (getAPIProvider() === "ollama") {
57726
+ return `Ollama (${model})`;
57727
+ }
57728
+ const publicName = getPublicModelDisplayName(model);
57729
+ if (publicName) {
57730
+ return `UR ${publicName}`;
57731
+ }
57732
+ return `UR (${model})`;
57733
+ }
57734
+ function parseUserSpecifiedModel(modelInput) {
57735
+ const modelInputTrimmed = modelInput.trim();
57736
+ const normalizedModel = modelInputTrimmed.toLowerCase();
57737
+ const has1mTag = has1mContext(normalizedModel);
57738
+ const modelString = has1mTag ? normalizedModel.replace(/\[1m]$/i, "").trim() : normalizedModel;
57739
+ switch (modelString) {
57740
+ case "modeloplan":
57741
+ return getDefaultmodelSModel() + (has1mTag ? "[1m]" : "");
57742
+ case "models":
57743
+ return getDefaultmodelSModel() + (has1mTag ? "[1m]" : "");
57744
+ case "modelh":
57745
+ return getDefaultmodelHModel() + (has1mTag ? "[1m]" : "");
57746
+ case "modelo":
57747
+ return getDefaultmodelOModel() + (has1mTag ? "[1m]" : "");
57748
+ case "best":
57749
+ return getBestModel();
57750
+ default:
57751
+ }
57752
+ if (getAPIProvider() === "firstParty" && isLegacymodelOFirstParty(modelString) && isLegacyModelRemapEnabled()) {
57753
+ return getDefaultmodelOModel() + (has1mTag ? "[1m]" : "");
57754
+ }
57755
+ if (process.env.USER_TYPE === "ant") {
57756
+ const has1mAntTag = has1mContext(normalizedModel);
57757
+ const baseAntModel = normalizedModel.replace(/\[1m]$/i, "").trim();
57758
+ const antModel = resolveAntModel2(baseAntModel);
57759
+ if (antModel) {
57760
+ const suffix = has1mAntTag ? "[1m]" : "";
57761
+ return antModel.model + suffix;
57762
+ }
57763
+ }
57764
+ if (has1mTag) {
57765
+ return modelInputTrimmed.replace(/\[1m\]$/i, "").trim() + "[1m]";
57766
+ }
57767
+ return modelInputTrimmed;
57768
+ }
57769
+ function resolveSkillModelOverride(skillModel, currentModel) {
57770
+ if (has1mContext(skillModel) || !has1mContext(currentModel)) {
57771
+ return skillModel;
57772
+ }
57773
+ if (modelSupports1M(parseUserSpecifiedModel(skillModel))) {
57774
+ return skillModel + "[1m]";
57775
+ }
57776
+ return skillModel;
57777
+ }
57778
+ function isLegacymodelOFirstParty(model) {
57779
+ return LEGACY_MODELO_FIRSTPARTY.includes(model);
57780
+ }
57781
+ function isLegacyModelRemapEnabled() {
57782
+ return !isEnvTruthy(process.env.UR_CODE_DISABLE_LEGACY_MODEL_REMAP);
57783
+ }
57784
+ function modelDisplayString(model) {
57785
+ if (model === null) {
57786
+ if (process.env.USER_TYPE === "ant") {
57787
+ return `Default for Ants (${renderDefaultModelSetting(getDefaultMainLoopModelSetting())})`;
57788
+ } else if (isURAISubscriber2()) {
57789
+ return `Default (${getURAiUserDefaultModelDescription()})`;
57790
+ }
57791
+ return `Default (${getDefaultMainLoopModel()})`;
57792
+ }
57793
+ const resolvedModel = parseUserSpecifiedModel(model);
57794
+ return model === resolvedModel ? resolvedModel : `${model} (${resolvedModel})`;
57795
+ }
57796
+ function getMarketingNameForModel(modelId) {
57797
+ if (getAPIProvider() === "foundry" || getAPIProvider() === "ollama") {
57798
+ return;
57799
+ }
57800
+ const has1m = modelId.toLowerCase().includes("[1m]");
57801
+ const canonical = getCanonicalName(modelId);
57802
+ if (canonical === "modelo") {
57803
+ return has1m ? "modelO (with 1M context)" : "modelO";
57804
+ }
57805
+ if (canonical === "models") {
57806
+ return has1m ? "modelS (with 1M context)" : "modelS";
57807
+ }
57808
+ if (canonical === "modelh") {
57809
+ return "modelH";
57810
+ }
57811
+ return;
57812
+ }
57813
+ function normalizeModelStringForAPI(model) {
57814
+ return model.replace(/\[(1|2)m\]/gi, "");
57815
+ }
57816
+ var DEFAULT_OLLAMA_MODEL2 = "qwen3-coder:480b-cloud", memoizedRoutedDefaultModel, memoizedRoutedFastModel, LEGACY_MODELO_FIRSTPARTY;
57817
+ var init_model = __esm(() => {
57818
+ init_state();
57819
+ init_auth();
57820
+ init_context();
57821
+ init_envUtils();
57822
+ init_modelStrings();
57823
+ init_modelCost();
57824
+ init_settings2();
57825
+ init_providers();
57826
+ init_figures2();
57827
+ init_modelAllowlist();
57828
+ init_aliases();
57829
+ init_stringUtils();
57830
+ init_antModels();
57831
+ init_ollamaModels();
57832
+ init_ollamaRouter();
57833
+ init_providerRegistry();
57834
+ LEGACY_MODELO_FIRSTPARTY = [];
57835
+ });
57836
+
57927
57837
  // src/utils/model/modelSupportOverrides.ts
57928
57838
  var TIERS, get3PModelCapabilityOverride;
57929
57839
  var init_modelSupportOverrides = __esm(() => {
@@ -58002,35 +57912,29 @@ function modelSupportsISP(model) {
58002
57912
  return true;
58003
57913
  }
58004
57914
  if (provider === "firstParty") {
58005
- return !canonical.includes("ur-3-");
57915
+ return true;
58006
57916
  }
58007
- return canonical.includes("ur-modelO-4") || canonical.includes("ur-modelS-4");
57917
+ return false;
58008
57918
  }
58009
- function vertexModelSupportsWebSearch(model) {
58010
- const canonical = getCanonicalName(model);
58011
- return canonical.includes("ur-modelO-4") || canonical.includes("ur-modelS-4") || canonical.includes("ur-modelH-4");
57919
+ function vertexModelSupportsWebSearch(_model) {
57920
+ return false;
58012
57921
  }
58013
57922
  function modelSupportsContextManagement(model) {
58014
57923
  if (getAPIProvider() === "ollama") {
58015
57924
  return false;
58016
57925
  }
58017
- const canonical = getCanonicalName(model);
58018
57926
  const provider = getAPIProvider();
58019
57927
  if (provider === "foundry") {
58020
57928
  return true;
58021
57929
  }
58022
57930
  if (provider === "firstParty") {
58023
- return !canonical.includes("ur-3-");
57931
+ return true;
58024
57932
  }
58025
- return canonical.includes("ur-modelO-4") || canonical.includes("ur-modelS-4") || canonical.includes("ur-modelH-4");
57933
+ return false;
58026
57934
  }
58027
57935
  function modelSupportsStructuredOutputs(model) {
58028
- const canonical = getCanonicalName(model);
58029
57936
  const provider = getAPIProvider();
58030
- if (provider !== "firstParty" && provider !== "foundry") {
58031
- return false;
58032
- }
58033
- return canonical.includes("ur-modelS-4-6") || canonical.includes("ur-modelS-4-5") || canonical.includes("ur-modelO-4-1") || canonical.includes("ur-modelO-4-5") || canonical.includes("ur-modelO-4-6") || canonical.includes("ur-modelH-4-5");
57937
+ return provider === "firstParty" || provider === "foundry";
58034
57938
  }
58035
57939
  function modelSupportsAutoMode(model) {
58036
57940
  if (false) {}
@@ -69407,7 +69311,7 @@ var init_auth = __esm(() => {
69407
69311
 
69408
69312
  // src/utils/userAgent.ts
69409
69313
  function getURCodeUserAgent() {
69410
- return `ur/${"1.30.4"}`;
69314
+ return `ur/${"1.30.6"}`;
69411
69315
  }
69412
69316
 
69413
69317
  // src/utils/workloadContext.ts
@@ -69429,7 +69333,7 @@ function getUserAgent() {
69429
69333
  const clientApp = process.env.UR_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.UR_AGENT_SDK_CLIENT_APP}` : "";
69430
69334
  const workload = getWorkload();
69431
69335
  const workloadSuffix = workload ? `, workload/${workload}` : "";
69432
- return `ur-cli/${"1.30.4"} (${process.env.USER_TYPE}, ${process.env.UR_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
69336
+ return `ur-cli/${"1.30.6"} (${process.env.USER_TYPE}, ${process.env.UR_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
69433
69337
  }
69434
69338
  function getMCPUserAgent() {
69435
69339
  const parts = [];
@@ -69443,7 +69347,7 @@ function getMCPUserAgent() {
69443
69347
  parts.push(`client-app/${process.env.UR_AGENT_SDK_CLIENT_APP}`);
69444
69348
  }
69445
69349
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
69446
- return `ur/${"1.30.4"}${suffix}`;
69350
+ return `ur/${"1.30.6"}${suffix}`;
69447
69351
  }
69448
69352
  function getWebFetchUserAgent() {
69449
69353
  return `UR-User (${getURCodeUserAgent()})`;
@@ -69581,7 +69485,7 @@ var init_user = __esm(() => {
69581
69485
  deviceId,
69582
69486
  sessionId: getSessionId(),
69583
69487
  email: getEmail(),
69584
- appVersion: "1.30.4",
69488
+ appVersion: "1.30.6",
69585
69489
  platform: getHostPlatformForAnalytics(),
69586
69490
  organizationUuid,
69587
69491
  accountUuid,
@@ -76098,7 +76002,7 @@ var init_metadata = __esm(() => {
76098
76002
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
76099
76003
  WHITESPACE_REGEX = /\s+/;
76100
76004
  getVersionBase = memoize_default(() => {
76101
- const match = "1.30.4".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
76005
+ const match = "1.30.6".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
76102
76006
  return match ? match[0] : undefined;
76103
76007
  });
76104
76008
  buildEnvContext = memoize_default(async () => {
@@ -76138,7 +76042,7 @@ var init_metadata = __esm(() => {
76138
76042
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
76139
76043
  isURCodeAction: isEnvTruthy(process.env.UR_CODE_ACTION),
76140
76044
  isURAiAuth: isURAISubscriber2(),
76141
- version: "1.30.4",
76045
+ version: "1.30.6",
76142
76046
  versionBase: getVersionBase(),
76143
76047
  buildTime: "",
76144
76048
  deploymentEnvironment: env2.detectDeploymentEnvironment(),
@@ -76808,7 +76712,7 @@ function initialize1PEventLogging() {
76808
76712
  const platform2 = getPlatform();
76809
76713
  const attributes = {
76810
76714
  [import_semantic_conventions4.ATTR_SERVICE_NAME]: "ur",
76811
- [import_semantic_conventions4.ATTR_SERVICE_VERSION]: "1.30.4"
76715
+ [import_semantic_conventions4.ATTR_SERVICE_VERSION]: "1.30.6"
76812
76716
  };
76813
76717
  if (platform2 === "wsl") {
76814
76718
  const wslVersion = getWslVersion();
@@ -76835,7 +76739,7 @@ function initialize1PEventLogging() {
76835
76739
  })
76836
76740
  ]
76837
76741
  });
76838
- firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.urhq.ur.events", "1.30.4");
76742
+ firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.urhq.ur.events", "1.30.6");
76839
76743
  }
76840
76744
  async function reinitialize1PEventLoggingIfConfigChanged() {
76841
76745
  if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
@@ -78255,7 +78159,7 @@ function buildHookSchemas() {
78255
78159
  prompt: exports_external.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),
78256
78160
  if: IfConditionSchema(),
78257
78161
  timeout: exports_external.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),
78258
- model: exports_external.string().optional().describe('Model to use for this prompt hook (e.g., "ur-modelS-4-6"). If not specified, uses the default small fast model.'),
78162
+ model: exports_external.string().optional().describe("Provider-scoped model to use for this prompt hook. If not specified, uses the active provider/model selection."),
78259
78163
  statusMessage: exports_external.string().optional().describe("Custom status message to display in spinner while hook runs"),
78260
78164
  once: exports_external.boolean().optional().describe("If true, hook runs once and is removed after execution")
78261
78165
  });
@@ -78274,7 +78178,7 @@ function buildHookSchemas() {
78274
78178
  prompt: exports_external.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),
78275
78179
  if: IfConditionSchema(),
78276
78180
  timeout: exports_external.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),
78277
- model: exports_external.string().optional().describe('Model to use for this agent hook (e.g., "ur-modelS-4-6"). If not specified, uses modelH.'),
78181
+ model: exports_external.string().optional().describe("Provider-scoped model to use for this agent hook. If not specified, uses the active provider/model selection."),
78278
78182
  statusMessage: exports_external.string().optional().describe("Custom status message to display in spinner while hook runs"),
78279
78183
  once: exports_external.boolean().optional().describe("If true, hook runs once and is removed after execution")
78280
78184
  });
@@ -79147,7 +79051,7 @@ function validatePermissionRule(rule) {
79147
79051
  return {
79148
79052
  valid: false,
79149
79053
  error: "Tool names must start with uppercase",
79150
- suggestion: `Use "${capitalize(String(parsed.toolName))}"`
79054
+ suggestion: `Use "${capitalize2(String(parsed.toolName))}"`
79151
79055
  };
79152
79056
  }
79153
79057
  const customValidation = getCustomValidation(parsed.toolName);
@@ -79360,8 +79264,8 @@ var init_types2 = __esm(() => {
79360
79264
  fallback: exports_external.union([exports_external.enum(PROVIDER_SETTING_IDS), exports_external.literal("disabled")]).optional().describe("Optional fallback provider; UR asks before using it"),
79361
79265
  preferences: exports_external.record(exports_external.string(), NonSecretPreferenceSchema).optional().describe("Non-secret provider preferences only")
79362
79266
  }).optional().describe("Legal provider configuration; credentials must stay in environment variables or official CLIs"),
79363
- availableModels: exports_external.array(exports_external.string()).optional().describe("Allowlist of models that users can select. " + 'Accepts family aliases ("modelO" allows any modelO version), ' + 'version prefixes ("modelO-4-5" allows only that version), ' + "and full model IDs. " + "If undefined, all models are available. If empty array, only the default model is available. " + "Typically set in managed settings by enterprise administrators."),
79364
- modelOverrides: exports_external.record(exports_external.string(), exports_external.string()).optional().describe('Override mapping from URHQ model ID (e.g. "ur-modelO-4-6") to provider-specific ' + "model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by " + "enterprise administrators."),
79267
+ availableModels: exports_external.array(exports_external.string()).optional().describe("Allowlist of models that users can select. " + "Accepts exact provider-scoped model IDs and provider-specific aliases. " + "If undefined, all models are available. If empty array, only the default model is available. " + "Typically set in managed settings by enterprise administrators."),
79268
+ modelOverrides: exports_external.record(exports_external.string(), exports_external.string()).optional().describe("Override mapping from an existing model ID to a provider-specific " + "model ID. Typically set in managed settings by " + "enterprise administrators."),
79365
79269
  enableAllProjectMcpServers: exports_external.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),
79366
79270
  enabledMcpjsonServers: exports_external.array(exports_external.string()).optional().describe("List of approved MCP servers from .mcp.json"),
79367
79271
  disabledMcpjsonServers: exports_external.array(exports_external.string()).optional().describe("List of rejected MCP servers from .mcp.json"),
@@ -82132,7 +82036,7 @@ function formatAgentTrendReport(report = buildAgentTrendReport()) {
82132
82036
  function formatA2AAgentCard(options = {}, pretty = true) {
82133
82037
  return JSON.stringify(buildA2AAgentCard(options), null, pretty ? 2 : 0);
82134
82038
  }
82135
- var urVersion = "1.30.4", coverage, priorityRoadmap;
82039
+ var urVersion = "1.30.6", coverage, priorityRoadmap;
82136
82040
  var init_trends = __esm(() => {
82137
82041
  coverage = [
82138
82042
  {
@@ -84125,7 +84029,7 @@ function getAttributionHeader(fingerprint) {
84125
84029
  if (!isAttributionHeaderEnabled()) {
84126
84030
  return "";
84127
84031
  }
84128
- const version2 = `${"1.30.4"}.${fingerprint}`;
84032
+ const version2 = `${"1.30.6"}.${fingerprint}`;
84129
84033
  const entrypoint = process.env.UR_CODE_ENTRYPOINT ?? "unknown";
84130
84034
  const cch = "";
84131
84035
  const workload = getWorkload();
@@ -127372,27 +127276,19 @@ function modelSupportsThinking(model) {
127372
127276
  return true;
127373
127277
  }
127374
127278
  }
127375
- const canonical = getCanonicalName(model);
127376
127279
  if (provider === "foundry" || provider === "firstParty") {
127377
- return !canonical.includes("ur-3-");
127280
+ return true;
127378
127281
  }
127379
- return canonical.includes("modelS-4") || canonical.includes("modelO-4");
127282
+ return false;
127380
127283
  }
127381
127284
  function modelSupportsAdaptiveThinking(model) {
127382
127285
  const supported3P = get3PModelCapabilityOverride(model, "adaptive_thinking");
127383
127286
  if (supported3P !== undefined) {
127384
127287
  return supported3P;
127385
127288
  }
127386
- const canonical = getCanonicalName(model);
127387
127289
  if (getAPIProvider() === "ollama") {
127388
127290
  return false;
127389
127291
  }
127390
- if (canonical.includes("modelO-4-6") || canonical.includes("modelS-4-6")) {
127391
- return true;
127392
- }
127393
- if (canonical.includes("modelO") || canonical.includes("modelS") || canonical.includes("modelH")) {
127394
- return false;
127395
- }
127396
127292
  const provider = getAPIProvider();
127397
127293
  return provider === "firstParty" || provider === "foundry";
127398
127294
  }
@@ -127410,7 +127306,6 @@ var RAINBOW_COLORS, RAINBOW_SHIMMER_COLORS;
127410
127306
  var init_thinking = __esm(() => {
127411
127307
  init_growthbook();
127412
127308
  init_antModels();
127413
- init_model();
127414
127309
  init_modelSupportOverrides();
127415
127310
  init_providers();
127416
127311
  init_settings2();
@@ -127436,7 +127331,6 @@ var init_thinking = __esm(() => {
127436
127331
 
127437
127332
  // src/utils/effort.ts
127438
127333
  function modelSupportsEffort(model) {
127439
- const m = model.toLowerCase();
127440
127334
  if (isEnvTruthy(process.env.UR_CODE_ALWAYS_ENABLE_EFFORT)) {
127441
127335
  return true;
127442
127336
  }
@@ -127444,12 +127338,6 @@ function modelSupportsEffort(model) {
127444
127338
  if (supported3P !== undefined) {
127445
127339
  return supported3P;
127446
127340
  }
127447
- if (m.includes("modelO-4-6") || m.includes("modelS-4-6")) {
127448
- return true;
127449
- }
127450
- if (m.includes("modelH") || m.includes("modelS") || m.includes("modelO")) {
127451
- return false;
127452
- }
127453
127341
  return getAPIProvider() === "firstParty";
127454
127342
  }
127455
127343
  function modelSupportsMaxEffort(model) {
@@ -127457,9 +127345,6 @@ function modelSupportsMaxEffort(model) {
127457
127345
  if (supported3P !== undefined) {
127458
127346
  return supported3P;
127459
127347
  }
127460
- if (model.toLowerCase().includes("modelO-4-6")) {
127461
- return true;
127462
- }
127463
127348
  if (process.env.USER_TYPE === "ant" && resolveAntModel(model)) {
127464
127349
  return true;
127465
127350
  }
@@ -127592,7 +127477,7 @@ function getDefaultEffortForModel(model) {
127592
127477
  }
127593
127478
  return;
127594
127479
  }
127595
- if (model.toLowerCase().includes("modelO-4-6")) {
127480
+ if (modelSupportsEffort(model)) {
127596
127481
  if (isProSubscriber()) {
127597
127482
  return "medium";
127598
127483
  }
@@ -191798,7 +191683,7 @@ function getTelemetryAttributes() {
191798
191683
  attributes["session.id"] = sessionId;
191799
191684
  }
191800
191685
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
191801
- attributes["app.version"] = "1.30.4";
191686
+ attributes["app.version"] = "1.30.6";
191802
191687
  }
191803
191688
  const oauthAccount = getOauthAccountInfo();
191804
191689
  if (oauthAccount) {
@@ -195058,27 +194943,7 @@ function sanitizeSurfaceKey(surfaceKey) {
195058
194943
  return `${surface}/${sanitizedModel}`;
195059
194944
  }
195060
194945
  function sanitizeModelName(shortName) {
195061
- if (shortName.includes("modelO-4-6"))
195062
- return "ur-modelO-4-6";
195063
- if (shortName.includes("modelO-4-5"))
195064
- return "ur-modelO-4-5";
195065
- if (shortName.includes("modelO-4-1"))
195066
- return "ur-modelO-4-1";
195067
- if (shortName.includes("modelO-4"))
195068
- return "ur-modelO-4";
195069
- if (shortName.includes("modelS-4-6"))
195070
- return "ur-modelS-4-6";
195071
- if (shortName.includes("modelS-4-5"))
195072
- return "ur-modelS-4-5";
195073
- if (shortName.includes("modelS-4"))
195074
- return "ur-modelS-4";
195075
- if (shortName.includes("modelS-3-7"))
195076
- return "ur-modelS-3-7";
195077
- if (shortName.includes("modelH-4-5"))
195078
- return "ur-modelH-4-5";
195079
- if (shortName.includes("modelH-3-5"))
195080
- return "ur-modelH-3-5";
195081
- return "ur";
194946
+ return shortName.replace(/[^a-zA-Z0-9._:/-]/g, "").slice(0, 80) || "provider-model";
195082
194947
  }
195083
194948
  function getClientSurface() {
195084
194949
  return process.env.UR_CODE_ENTRYPOINT ?? "cli";
@@ -227203,7 +227068,7 @@ function getInstallationEnv() {
227203
227068
  return;
227204
227069
  }
227205
227070
  function getURCodeVersion() {
227206
- return "1.30.4";
227071
+ return "1.30.6";
227207
227072
  }
227208
227073
  async function getInstalledVSCodeExtensionVersion(command) {
227209
227074
  const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
@@ -230042,7 +229907,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
230042
229907
  const client2 = new Client({
230043
229908
  name: "ur",
230044
229909
  title: "UR",
230045
- version: "1.30.4",
229910
+ version: "1.30.6",
230046
229911
  description: "UR-AGENT autonomous engineering workflow engine",
230047
229912
  websiteUrl: PRODUCT_URL
230048
229913
  }, {
@@ -230396,7 +230261,7 @@ var init_client5 = __esm(() => {
230396
230261
  const client2 = new Client({
230397
230262
  name: "ur",
230398
230263
  title: "UR",
230399
- version: "1.30.4",
230264
+ version: "1.30.6",
230400
230265
  description: "UR-AGENT autonomous engineering workflow engine",
230401
230266
  websiteUrl: PRODUCT_URL
230402
230267
  }, {
@@ -231507,7 +231372,7 @@ function getAgentModelDisplay(model) {
231507
231372
  return "Inherit from parent (default)";
231508
231373
  if (model === "inherit")
231509
231374
  return "Inherit from parent";
231510
- return capitalize(model);
231375
+ return capitalize2(model);
231511
231376
  }
231512
231377
  function getAgentModelOptions() {
231513
231378
  return [
@@ -233411,13 +233276,11 @@ function getExperimentAdvisorModels() {
233411
233276
  const config2 = getAdvisorConfig();
233412
233277
  return isAdvisorEnabled() && !canUserConfigureAdvisor() && config2.baseModel && config2.advisorModel ? { baseModel: config2.baseModel, advisorModel: config2.advisorModel } : undefined;
233413
233278
  }
233414
- function modelSupportsAdvisor(model) {
233415
- const m = model.toLowerCase();
233416
- return m.includes("modelO-4-6") || m.includes("modelS-4-6") || process.env.USER_TYPE === "ant";
233279
+ function modelSupportsAdvisor(_model) {
233280
+ return process.env.USER_TYPE === "ant" || shouldIncludeFirstPartyOnlyBetas();
233417
233281
  }
233418
- function isValidAdvisorModel(model) {
233419
- const m = model.toLowerCase();
233420
- return m.includes("modelO-4-6") || m.includes("modelS-4-6") || process.env.USER_TYPE === "ant";
233282
+ function isValidAdvisorModel(_model) {
233283
+ return process.env.USER_TYPE === "ant" || shouldIncludeFirstPartyOnlyBetas();
233421
233284
  }
233422
233285
  function getInitialAdvisorSetting() {
233423
233286
  if (!isAdvisorEnabled()) {
@@ -240212,9 +240075,9 @@ async function assertMinVersion() {
240212
240075
  if (false) {}
240213
240076
  try {
240214
240077
  const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
240215
- if (versionConfig.minVersion && lt("1.30.4", versionConfig.minVersion)) {
240078
+ if (versionConfig.minVersion && lt("1.30.6", versionConfig.minVersion)) {
240216
240079
  console.error(`
240217
- It looks like your version of UR (${"1.30.4"}) needs an update.
240080
+ It looks like your version of UR (${"1.30.6"}) needs an update.
240218
240081
  A newer version (${versionConfig.minVersion} or higher) is required to continue.
240219
240082
 
240220
240083
  To update, please run:
@@ -240430,7 +240293,7 @@ async function installGlobalPackage(specificVersion) {
240430
240293
  logError2(new AutoUpdaterError("Another process is currently installing an update"));
240431
240294
  logEvent("tengu_auto_updater_lock_contention", {
240432
240295
  pid: process.pid,
240433
- currentVersion: "1.30.4"
240296
+ currentVersion: "1.30.6"
240434
240297
  });
240435
240298
  return "in_progress";
240436
240299
  }
@@ -240439,7 +240302,7 @@ async function installGlobalPackage(specificVersion) {
240439
240302
  if (!env2.isRunningWithBun() && env2.isNpmFromWindowsPath()) {
240440
240303
  logError2(new Error("Windows NPM detected in WSL environment"));
240441
240304
  logEvent("tengu_auto_updater_windows_npm_in_wsl", {
240442
- currentVersion: "1.30.4"
240305
+ currentVersion: "1.30.6"
240443
240306
  });
240444
240307
  console.error(`
240445
240308
  Error: Windows NPM detected in WSL
@@ -240974,7 +240837,7 @@ function detectLinuxGlobPatternWarnings() {
240974
240837
  }
240975
240838
  async function getDoctorDiagnostic() {
240976
240839
  const installationType = await getCurrentInstallationType();
240977
- const version2 = typeof MACRO !== "undefined" ? "1.30.4" : "unknown";
240840
+ const version2 = typeof MACRO !== "undefined" ? "1.30.6" : "unknown";
240978
240841
  const installationPath = await getInstallationPath();
240979
240842
  const invokedBinary = getInvokedBinary();
240980
240843
  const multipleInstallations = await detectMultipleInstallations();
@@ -241909,8 +241772,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
241909
241772
  const maxVersion = await getMaxVersion();
241910
241773
  if (maxVersion && gt(version2, maxVersion)) {
241911
241774
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
241912
- if (gte("1.30.4", maxVersion)) {
241913
- logForDebugging(`Native installer: current version ${"1.30.4"} is already at or above maxVersion ${maxVersion}, skipping update`);
241775
+ if (gte("1.30.6", maxVersion)) {
241776
+ logForDebugging(`Native installer: current version ${"1.30.6"} is already at or above maxVersion ${maxVersion}, skipping update`);
241914
241777
  logEvent("tengu_native_update_skipped_max_version", {
241915
241778
  latency_ms: Date.now() - startTime,
241916
241779
  max_version: maxVersion,
@@ -241921,7 +241784,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
241921
241784
  version2 = maxVersion;
241922
241785
  }
241923
241786
  }
241924
- if (!forceReinstall && version2 === "1.30.4" && await versionIsAvailable(version2) && await isPossibleURBinary(executablePath)) {
241787
+ if (!forceReinstall && version2 === "1.30.6" && await versionIsAvailable(version2) && await isPossibleURBinary(executablePath)) {
241925
241788
  logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
241926
241789
  logEvent("tengu_native_update_complete", {
241927
241790
  latency_ms: Date.now() - startTime,
@@ -246591,7 +246454,7 @@ var init_coreSchemas = __esm(() => {
246591
246454
  tools: exports_external.array(exports_external.string()).optional().describe("Array of allowed tool names. If omitted, inherits all tools from parent"),
246592
246455
  disallowedTools: exports_external.array(exports_external.string()).optional().describe("Array of tool names to explicitly disallow for this agent"),
246593
246456
  prompt: exports_external.string().describe("The agent's system prompt"),
246594
- model: exports_external.string().optional().describe("Model alias (e.g. 'modelS', 'modelO', 'modelH') or full model ID (e.g. 'ur-modelO-4-5'). If omitted or 'inherit', uses the main model"),
246457
+ model: exports_external.string().optional().describe("Provider-scoped model ID. If omitted or 'inherit', uses the active provider/model selection."),
246595
246458
  mcpServers: exports_external.array(AgentMcpServerSpecSchema2()).optional(),
246596
246459
  criticalSystemReminder_EXPERIMENTAL: exports_external.string().optional().describe("Experimental: Critical reminder added to system prompt"),
246597
246460
  skills: exports_external.array(exports_external.string()).optional().describe("Array of skill names to preload into the agent context"),
@@ -294632,8 +294495,7 @@ var init_WebSearchTool = __esm(() => {
294632
294495
  return true;
294633
294496
  }
294634
294497
  if (provider === "vertex") {
294635
- const supportsWebSearch = model.includes("ur-modelO-4") || model.includes("ur-modelS-4") || model.includes("ur-modelH-4");
294636
- return supportsWebSearch;
294498
+ return false;
294637
294499
  }
294638
294500
  if (provider === "foundry") {
294639
294501
  return true;
@@ -299516,19 +299378,19 @@ function getModelOptionsBase(fastMode = false) {
299516
299378
  }
299517
299379
  function getModelFamilyInfo(model) {
299518
299380
  const canonical = getCanonicalName(model);
299519
- if (canonical.includes("ur-modelS-4-6") || canonical.includes("ur-modelS-4-5") || canonical.includes("ur-modelS-4-") || canonical.includes("ur-3-7-modelS") || canonical.includes("ur-3-5-modelS")) {
299381
+ if (canonical.includes("models")) {
299520
299382
  const currentName = getMarketingNameForModel(getDefaultmodelSModel());
299521
299383
  if (currentName) {
299522
299384
  return { alias: "modelS", currentVersionName: currentName };
299523
299385
  }
299524
299386
  }
299525
- if (canonical.includes("ur-modelO-4")) {
299387
+ if (canonical.includes("modelo")) {
299526
299388
  const currentName = getMarketingNameForModel(getDefaultmodelOModel());
299527
299389
  if (currentName) {
299528
299390
  return { alias: "modelO", currentVersionName: currentName };
299529
299391
  }
299530
299392
  }
299531
- if (canonical.includes("ur-modelH") || canonical.includes("ur-3-5-modelH")) {
299393
+ if (canonical.includes("modelh")) {
299532
299394
  const currentName = getMarketingNameForModel(getDefaultmodelHModel());
299533
299395
  if (currentName) {
299534
299396
  return { alias: "modelH", currentVersionName: currentName };
@@ -299739,16 +299601,6 @@ function get3PFallbackSuggestion(model) {
299739
299601
  if (getAPIProvider() === "firstParty") {
299740
299602
  return;
299741
299603
  }
299742
- const lowerModel = model.toLowerCase();
299743
- if (lowerModel.includes("modelO-4-6") || lowerModel.includes("modelO_4_6")) {
299744
- return getModelStrings2().modelO41;
299745
- }
299746
- if (lowerModel.includes("modelS-4-6") || lowerModel.includes("modelS_4_6")) {
299747
- return getModelStrings2().modelS45;
299748
- }
299749
- if (lowerModel.includes("modelS-4-5") || lowerModel.includes("modelS_4_5")) {
299750
- return getModelStrings2().modelS40;
299751
- }
299752
299604
  return;
299753
299605
  }
299754
299606
  var validModelCache;
@@ -299758,7 +299610,6 @@ var init_validateModel = __esm(() => {
299758
299610
  init_providers();
299759
299611
  init_sideQuery();
299760
299612
  init_urhq_sdk();
299761
- init_modelStrings();
299762
299613
  validModelCache = new Map;
299763
299614
  });
299764
299615
 
@@ -307189,7 +307040,7 @@ information. Do not blow your cover.
307189
307040
 
307190
307041
  NEVER include in commit messages or PR descriptions:
307191
307042
  - Internal model codenames (animal names like Capybara, Tengu, etc.)
307192
- - Unreleased model version numbers (e.g., modelO-4-7, modelS-4-8)
307043
+ - Unreleased model version numbers
307193
307044
  - Internal repo or project names (e.g., ur-cli-internal, urhqs/\u2026)
307194
307045
  - Internal tooling, Slack channels, or short links (e.g., go/cc, #ur-\u2026)
307195
307046
  - The phrase "UR" or any mention that you are an AI
@@ -307206,9 +307057,9 @@ GOOD:
307206
307057
 
307207
307058
  BAD (never write these):
307208
307059
  - "Fix bug found while testing with UR Capybara"
307209
- - "1-shotted by ur-modelO-4-6"
307060
+ - "1-shotted by internal-model-id"
307210
307061
  - "Generated with UR"
307211
- - "Co-Authored-By: UR modelO 4.6 <\u2026>"
307062
+ - "Co-Authored-By: UR internal model <\u2026>"
307212
307063
  `;
307213
307064
  }
307214
307065
  return "";
@@ -318611,7 +318462,7 @@ async function isToolSearchEnabled(model, tools, getToolPermissionContext, agent
318611
318462
  });
318612
318463
  }
318613
318464
  if (!modelSupportsToolReference(model)) {
318614
- logForDebugging(`Tool search disabled for model '${model}': model does not support tool_reference blocks. ` + `This feature is only available on UR modelS 4+, modelO 4+, and newer models.`);
318465
+ logForDebugging(`Tool search disabled for model '${model}': model does not support tool_reference blocks. ` + `This feature is only available on provider models that support tool_reference blocks.`);
318615
318466
  logModeDecision(false, "standard", "model_unsupported");
318616
318467
  return false;
318617
318468
  }
@@ -320418,7 +320269,7 @@ var init_FileReadTool = __esm(() => {
320418
320269
  }
320419
320270
  }
320420
320271
  });
320421
- MITIGATION_EXEMPT_MODELS = new Set(["ur-modelO-4-6"]);
320272
+ MITIGATION_EXEMPT_MODELS = new Set;
320422
320273
  memoryFileMtimes = new WeakMap;
320423
320274
  });
320424
320275
 
@@ -331465,7 +331316,7 @@ Run /share and post the JSON file to ${"https://github.com/Maitham16/UR/issues"}
331465
331316
  }
331466
331317
  if (isURAISubscriber2() && error40 instanceof APIError && error40.status === 400 && error40.message.toLowerCase().includes("invalid model name") && (isNonCustommodelOModel(model) || model === "modelO")) {
331467
331318
  return createAssistantAPIErrorMessage({
331468
- content: "UR modelO is not available with the UR Pro plan. If you have updated your subscription plan recently, run /logout and /login for the plan to take effect.",
331319
+ content: "The selected model is not available with the current plan. Run /model and choose a valid model for the active provider.",
331469
331320
  error: "invalid_request"
331470
331321
  });
331471
331322
  }
@@ -331563,16 +331414,6 @@ function get3PModelFallbackSuggestion(model) {
331563
331414
  if (getAPIProvider() === "firstParty") {
331564
331415
  return;
331565
331416
  }
331566
- const m = model.toLowerCase();
331567
- if (m.includes("modelO-4-6") || m.includes("modelO_4_6")) {
331568
- return getModelStrings2().modelO41;
331569
- }
331570
- if (m.includes("modelS-4-6") || m.includes("modelS_4_6")) {
331571
- return getModelStrings2().modelS45;
331572
- }
331573
- if (m.includes("modelS-4-5") || m.includes("modelS_4_5")) {
331574
- return getModelStrings2().modelS40;
331575
- }
331576
331417
  return;
331577
331418
  }
331578
331419
  function classifyAPIError(error40) {
@@ -331676,7 +331517,7 @@ function getErrorMessageIfRefusal(stopReason, model) {
331676
331517
  }
331677
331518
  logEvent("tengu_refusal_api_response", {});
331678
331519
  const baseMessage = getIsNonInteractiveSession() ? `${API_ERROR_MESSAGE_PREFIX}: UR is unable to respond to this request. Try rephrasing the request or attempting a different approach.` : `${API_ERROR_MESSAGE_PREFIX}: UR is unable to respond to this request. Please double press esc to edit your last message or start a new session for UR to assist with a different task.`;
331679
- const modelSuggestion = model !== "ur-modelS-4-20250514" ? " If you are seeing this refusal repeatedly, try running /model ur-modelS-4-20250514 to switch models." : "";
331520
+ const modelSuggestion = getIsNonInteractiveSession() ? "" : " If you are seeing this refusal repeatedly, run /model and choose another valid model for the active provider.";
331680
331521
  return createAssistantAPIErrorMessage({
331681
331522
  content: baseMessage + modelSuggestion,
331682
331523
  error: "invalid_request"
@@ -331689,7 +331530,6 @@ var init_errors6 = __esm(() => {
331689
331530
  init_auth();
331690
331531
  init_messages();
331691
331532
  init_model();
331692
- init_modelStrings();
331693
331533
  init_providers();
331694
331534
  init_state();
331695
331535
  init_apiLimits();
@@ -338848,7 +338688,7 @@ function Feedback({
338848
338688
  platform: env2.platform,
338849
338689
  gitRepo: envInfo.isGit,
338850
338690
  terminal: env2.terminal,
338851
- version: "1.30.4",
338691
+ version: "1.30.6",
338852
338692
  transcript: normalizeMessagesForAPI(messages),
338853
338693
  errors: sanitizedErrors,
338854
338694
  lastApiRequest: getLastAPIRequest(),
@@ -339040,7 +338880,7 @@ function Feedback({
339040
338880
  ", ",
339041
338881
  env2.terminal,
339042
338882
  ", v",
339043
- "1.30.4"
338883
+ "1.30.6"
339044
338884
  ]
339045
338885
  }, undefined, true, undefined, this)
339046
338886
  ]
@@ -339146,7 +338986,7 @@ ${sanitizedDescription}
339146
338986
  ` + `**Environment Info**
339147
338987
  ` + `- Platform: ${env2.platform}
339148
338988
  ` + `- Terminal: ${env2.terminal}
339149
- ` + `- Version: ${"1.30.4"}
338989
+ ` + `- Version: ${"1.30.6"}
339150
338990
  ` + `- Feedback ID: ${feedbackId}
339151
338991
  ` + `
339152
338992
  **Errors**
@@ -342257,7 +342097,7 @@ function buildPrimarySection() {
342257
342097
  }, undefined, false, undefined, this);
342258
342098
  return [{
342259
342099
  label: "Version",
342260
- value: "1.30.4"
342100
+ value: "1.30.6"
342261
342101
  }, {
342262
342102
  label: "Session name",
342263
342103
  value: nameValue
@@ -343235,7 +343075,7 @@ function ModelPicker({
343235
343075
  }, undefined, false, undefined, this),
343236
343076
  /* @__PURE__ */ jsx_dev_runtime172.jsxDEV(ThemedText, {
343237
343077
  dimColor: true,
343238
- children: headerText ?? "Switch between UR models. Applies to this session and future UR sessions. For other/previous model names, specify with --model."
343078
+ children: headerText ?? "Switch between models for the active provider. Applies to this session and future UR sessions. For other provider-scoped model names, specify with --model."
343239
343079
  }, undefined, false, undefined, this),
343240
343080
  sessionModel && /* @__PURE__ */ jsx_dev_runtime172.jsxDEV(ThemedText, {
343241
343081
  dimColor: true,
@@ -343437,11 +343277,11 @@ function isBilledAsExtraUsage(model, isFastMode, ismodelO1mMerged) {
343437
343277
  if (model === null || !has1mContext(model))
343438
343278
  return false;
343439
343279
  const m = model.toLowerCase().replace(/\[1m\]$/, "").trim();
343440
- const ismodelO46 = m === "modelO" || m.includes("modelO-4-6");
343441
- const ismodelS46 = m === "modelS" || m.includes("modelS-4-6");
343442
- if (ismodelO46 && ismodelO1mMerged)
343280
+ const ismodelO = m === "modelo";
343281
+ const ismodelS = m === "models";
343282
+ if (ismodelO && ismodelO1mMerged)
343443
343283
  return false;
343444
- return ismodelO46 || ismodelS46;
343284
+ return ismodelO || ismodelS;
343445
343285
  }
343446
343286
  var init_extraUsage = __esm(() => {
343447
343287
  init_auth();
@@ -345557,7 +345397,7 @@ function Config({
345557
345397
  }
345558
345398
  }, undefined, false, undefined, this)
345559
345399
  }, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime177.jsxDEV(ChannelDowngradeDialog, {
345560
- currentVersion: "1.30.4",
345400
+ currentVersion: "1.30.6",
345561
345401
  onChoice: (choice) => {
345562
345402
  setShowSubmenu(null);
345563
345403
  setTabsHidden(false);
@@ -345569,7 +345409,7 @@ function Config({
345569
345409
  autoUpdatesChannel: "stable"
345570
345410
  };
345571
345411
  if (choice === "stay") {
345572
- newSettings.minimumVersion = "1.30.4";
345412
+ newSettings.minimumVersion = "1.30.6";
345573
345413
  }
345574
345414
  updateSettingsForSource("userSettings", newSettings);
345575
345415
  setSettingsData((prev_27) => ({
@@ -351074,7 +350914,7 @@ function Doctor(t0) {
351074
350914
  upperLimit: TASK_MAX_OUTPUT_UPPER_LIMIT
351075
350915
  }, {
351076
350916
  name: "UR_CODE_MAX_OUTPUT_TOKENS",
351077
- ...getModelMaxOutputTokens("ur-modelO-4-6")
350917
+ ...getModelMaxOutputTokens("active-provider-model")
351078
350918
  }];
351079
350919
  t4 = envVars.map(_temp84).filter(_temp93);
351080
350920
  $3[5] = t4;
@@ -353639,7 +353479,7 @@ function HelpV2(t0) {
353639
353479
  let t6;
353640
353480
  if ($3[31] !== tabs) {
353641
353481
  t6 = /* @__PURE__ */ jsx_dev_runtime204.jsxDEV(Tabs, {
353642
- title: `UR v${"1.30.4"}`,
353482
+ title: `UR v${"1.30.6"}`,
353643
353483
  color: "professionalBlue",
353644
353484
  defaultTab: "general",
353645
353485
  children: tabs
@@ -354385,7 +354225,7 @@ function buildToolUseContext(tools, readFileStateCache) {
354385
354225
  async function handleInitialize(options2) {
354386
354226
  return {
354387
354227
  name: "ur-agent",
354388
- version: "1.30.4",
354228
+ version: "1.30.6",
354389
354229
  protocolVersion: "0.1.0",
354390
354230
  workspaceRoot: options2.cwd,
354391
354231
  capabilities: {
@@ -359613,7 +359453,7 @@ function MCPAgentServerMenu({
359613
359453
  authAbortControllerRef.current = null;
359614
359454
  }
359615
359455
  }, [agentServer, onComplete]);
359616
- const capitalizedServerName = capitalize(String(agentServer.name));
359456
+ const capitalizedServerName = capitalize2(String(agentServer.name));
359617
359457
  if (isAuthenticating) {
359618
359458
  return /* @__PURE__ */ jsx_dev_runtime221.jsxDEV(ThemedBox_default, {
359619
359459
  flexDirection: "column",
@@ -361842,7 +361682,7 @@ function MCPRemoteServerMenu({
361842
361682
  }
361843
361683
  }
361844
361684
  });
361845
- const capitalizedServerName = capitalize(String(server2.name));
361685
+ const capitalizedServerName = capitalize2(String(server2.name));
361846
361686
  const serverCommandsCount = filterMcpPromptsByServer(mcp.commands, server2.name).length;
361847
361687
  const toggleMcpServer = useMcpToggleEnabled();
361848
361688
  const handleURAIAuth = import_react128.default.useCallback(async () => {
@@ -362626,7 +362466,7 @@ function MCPStdioServerMenu({
362626
362466
  onComplete(`Failed to ${action2} MCP server '${server2.name}': ${errorMessage2(err2)}`);
362627
362467
  }
362628
362468
  }, [server2.client.type, server2.name, toggleMcpServer, onCancel, onComplete]);
362629
- const capitalizedServerName = capitalize(String(server2.name));
362469
+ const capitalizedServerName = capitalize2(String(server2.name));
362630
362470
  const serverCommandsCount = filterMcpPromptsByServer(mcp.commands, server2.name).length;
362631
362471
  const menuOptions = [];
362632
362472
  if (server2.client.type !== "disabled" && serverToolsCount > 0) {
@@ -374509,7 +374349,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
374509
374349
  return [];
374510
374350
  }
374511
374351
  }
374512
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.30.4") {
374352
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.30.6") {
374513
374353
  if (process.env.USER_TYPE === "ant") {
374514
374354
  const changelog = "";
374515
374355
  if (changelog) {
@@ -374536,7 +374376,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.30.4")
374536
374376
  releaseNotes
374537
374377
  };
374538
374378
  }
374539
- function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.30.4") {
374379
+ function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.30.6") {
374540
374380
  if (process.env.USER_TYPE === "ant") {
374541
374381
  const changelog = "";
374542
374382
  if (changelog) {
@@ -375706,7 +375546,7 @@ function getRecentActivitySync() {
375706
375546
  return cachedActivity;
375707
375547
  }
375708
375548
  function getLogoDisplayData() {
375709
- const version2 = process.env.DEMO_VERSION ?? "1.30.4";
375549
+ const version2 = process.env.DEMO_VERSION ?? "1.30.6";
375710
375550
  const serverUrl = getDirectConnectServerUrl();
375711
375551
  const displayPath = process.env.DEMO_VERSION ? "/code/ur" : getDisplayPath(getCwd2());
375712
375552
  const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
@@ -376495,7 +376335,7 @@ function LogoV2() {
376495
376335
  if ($3[2] === Symbol.for("react.memo_cache_sentinel")) {
376496
376336
  t2 = () => {
376497
376337
  const currentConfig = getGlobalConfig();
376498
- if (currentConfig.lastReleaseNotesSeen === "1.30.4") {
376338
+ if (currentConfig.lastReleaseNotesSeen === "1.30.6") {
376499
376339
  return;
376500
376340
  }
376501
376341
  saveGlobalConfig(_temp326);
@@ -377180,12 +377020,12 @@ function LogoV2() {
377180
377020
  return t41;
377181
377021
  }
377182
377022
  function _temp326(current) {
377183
- if (current.lastReleaseNotesSeen === "1.30.4") {
377023
+ if (current.lastReleaseNotesSeen === "1.30.6") {
377184
377024
  return current;
377185
377025
  }
377186
377026
  return {
377187
377027
  ...current,
377188
- lastReleaseNotesSeen: "1.30.4"
377028
+ lastReleaseNotesSeen: "1.30.6"
377189
377029
  };
377190
377030
  }
377191
377031
  function _temp243(s_0) {
@@ -587307,7 +587147,7 @@ function ColorPicker(t0) {
587307
587147
  }, undefined, false, undefined, this),
587308
587148
  /* @__PURE__ */ jsx_dev_runtime309.jsxDEV(ThemedText, {
587309
587149
  bold: isSelected,
587310
- children: capitalize(option22)
587150
+ children: capitalize2(option22)
587311
587151
  }, undefined, false, undefined, this)
587312
587152
  ]
587313
587153
  }, undefined, true, undefined, this)
@@ -592900,7 +592740,7 @@ async function captureMemoryDiagnostics(trigger2, dumpNumber = 0) {
592900
592740
  smapsRollup,
592901
592741
  platform: process.platform,
592902
592742
  nodeVersion: process.version,
592903
- ccVersion: "1.30.4"
592743
+ ccVersion: "1.30.6"
592904
592744
  };
592905
592745
  }
592906
592746
  async function performHeapDump(trigger2 = "manual", dumpNumber = 0) {
@@ -593486,7 +593326,7 @@ var init_bridge_kick = __esm(() => {
593486
593326
  var call136 = async () => {
593487
593327
  return {
593488
593328
  type: "text",
593489
- value: "1.30.4"
593329
+ value: "1.30.6"
593490
593330
  };
593491
593331
  }, version2, version_default;
593492
593332
  var init_version = __esm(() => {
@@ -596985,13 +596825,13 @@ function SetModelAndClose({
596985
596825
  return;
596986
596826
  }
596987
596827
  if (model && ismodelO1mUnavailable(model)) {
596988
- onDone(`modelO 4.6 with 1M context is not available for your account. Learn more: https://docs.ur.dev/docs/en/model-config#extended-context-with-1m`, {
596828
+ onDone(`The selected 1M-context model is not available for your account. Choose another model with /model.`, {
596989
596829
  display: "system"
596990
596830
  });
596991
596831
  return;
596992
596832
  }
596993
596833
  if (model && ismodelS1mUnavailable(model)) {
596994
- onDone(`modelS 4.6 with 1M context is not available for your account. Learn more: https://docs.ur.dev/docs/en/model-config#extended-context-with-1m`, {
596834
+ onDone(`The selected 1M-context model is not available for your account. Choose another model with /model.`, {
596995
596835
  display: "system"
596996
596836
  });
596997
596837
  return;
@@ -597065,11 +596905,11 @@ function SetModelAndClose({
597065
596905
  }
597066
596906
  function ismodelO1mUnavailable(model) {
597067
596907
  const m = model.toLowerCase();
597068
- return !checkmodelO1mAccess() && !ismodelO1mMergeEnabled() && m.includes("modelO") && m.includes("[1m]");
596908
+ return !checkmodelO1mAccess() && !ismodelO1mMergeEnabled() && m.includes("modelo") && m.includes("[1m]");
597069
596909
  }
597070
596910
  function ismodelS1mUnavailable(model) {
597071
596911
  const m = model.toLowerCase();
597072
- return !checkmodelS1mAccess() && (m.includes("modelS[1m]") || m.includes("modelS-4-6[1m]"));
596912
+ return !checkmodelS1mAccess() && m.includes("models") && m.includes("[1m]");
597073
596913
  }
597074
596914
  function ShowModelAndClose(t0) {
597075
596915
  const {
@@ -603439,7 +603279,7 @@ function generateHtmlReport(data, insights) {
603439
603279
  </html>`;
603440
603280
  }
603441
603281
  function buildExportData(data, insights, facets, remoteStats) {
603442
- const version3 = typeof MACRO !== "undefined" ? "1.30.4" : "unknown";
603282
+ const version3 = typeof MACRO !== "undefined" ? "1.30.6" : "unknown";
603443
603283
  const remote_hosts_collected = remoteStats?.hosts.filter((h2) => h2.sessionCount > 0).map((h2) => h2.name);
603444
603284
  const facets_summary = {
603445
603285
  total: facets.size,
@@ -607717,7 +607557,7 @@ var init_sessionStorage = __esm(() => {
607717
607557
  init_settings2();
607718
607558
  init_slowOperations();
607719
607559
  init_uuid();
607720
- VERSION5 = typeof MACRO !== "undefined" ? "1.30.4" : "unknown";
607560
+ VERSION5 = typeof MACRO !== "undefined" ? "1.30.6" : "unknown";
607721
607561
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
607722
607562
  SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
607723
607563
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -608922,7 +608762,7 @@ var init_filesystem = __esm(() => {
608922
608762
  });
608923
608763
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
608924
608764
  const nonce = randomBytes18(16).toString("hex");
608925
- return join200(getURTempDir(), "bundled-skills", "1.30.4", nonce);
608765
+ return join200(getURTempDir(), "bundled-skills", "1.30.6", nonce);
608926
608766
  });
608927
608767
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
608928
608768
  });
@@ -614643,9 +614483,9 @@ async function computeSimpleEnvInfo(modelId, additionalWorkingDirectories) {
614643
614483
  `OS Version: ${unameSR}`,
614644
614484
  modelDescription,
614645
614485
  knowledgeCutoffMessage,
614646
- includeURProductInfo ? `The most recent UR model family is UR 4.5/4.6. Model IDs \u2014 modelO 4.6: '${UR_4_5_OR_4_6_MODEL_IDS.modelO}', modelS 4.6: '${UR_4_5_OR_4_6_MODEL_IDS.modelS}', modelH 4.5: '${UR_4_5_OR_4_6_MODEL_IDS.modelH}'. When building AI applications, default to the latest and most capable UR models.` : null,
614486
+ includeURProductInfo ? `UR uses the provider and model selected in /model. Do not invent UR-specific model IDs; choose models from the active provider's model list.` : null,
614647
614487
  includeURProductInfo ? `UR is available as a CLI in the terminal, desktop app (Mac/Windows), web app (ur.ai/code), and IDE extensions (VS Code, JetBrains).` : null,
614648
- includeURProductInfo ? `Fast mode for UR uses the same ${FRONTIER_MODEL_NAME} model with faster output. It does NOT switch to a different model. It can be toggled with /fast.` : null
614488
+ includeURProductInfo ? `Fast mode for UR keeps the selected provider/model and requests faster output when that backend supports it. It can be toggled with /fast.` : null
614649
614489
  ].filter((item) => item !== null);
614650
614490
  return [
614651
614491
  `# Environment`,
@@ -614656,17 +614496,14 @@ async function computeSimpleEnvInfo(modelId, additionalWorkingDirectories) {
614656
614496
  }
614657
614497
  function getKnowledgeCutoff(modelId) {
614658
614498
  const canonical = getCanonicalName(modelId);
614659
- if (canonical.includes("ur-modelS-4-6")) {
614660
- return "August 2025";
614661
- } else if (canonical.includes("ur-modelO-4-6")) {
614662
- return "May 2025";
614663
- } else if (canonical.includes("ur-modelO-4-5")) {
614664
- return "May 2025";
614665
- } else if (canonical.includes("ur-modelH-4")) {
614666
- return "February 2025";
614667
- } else if (canonical.includes("ur-modelO-4") || canonical.includes("ur-modelS-4")) {
614668
- return "January 2025";
614669
- }
614499
+ if (canonical.includes("gpt-5"))
614500
+ return "2025";
614501
+ if (canonical.includes("gpt-4"))
614502
+ return "2024";
614503
+ if (canonical.includes("claude"))
614504
+ return "2025";
614505
+ if (canonical.includes("gemini"))
614506
+ return "2025";
614670
614507
  return null;
614671
614508
  }
614672
614509
  function getShellInfoLine() {
@@ -614732,7 +614569,7 @@ function getFunctionResultClearingSection(model) {
614732
614569
 
614733
614570
  Old tool results will be automatically cleared from context to free up space. The ${config3.keepRecent} most recent results are always kept.`;
614734
614571
  }
614735
- var getCachedMCConfigForFRC = null, DISCOVER_SKILLS_TOOL_NAME = null, SYSTEM_PROMPT_DYNAMIC_BOUNDARY = "__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__", FRONTIER_MODEL_NAME = "UR modelO 4.6", UR_4_5_OR_4_6_MODEL_IDS, DEFAULT_AGENT_PROMPT = `You are an agent for Ur. Given the user's message, you should use the tools available to complete the task. Complete the task fully\u2014don't gold-plate, but don't leave it half-done. When you complete the task, respond with a concise report covering what was done and any key findings \u2014 the caller will relay this to the user, so it only needs the essentials.`, SUMMARIZE_TOOL_RESULTS_SECTION = `When working with tool results, write down any important information you might need later in your response, as the original tool result may be cleared later.`;
614572
+ var getCachedMCConfigForFRC = null, DISCOVER_SKILLS_TOOL_NAME = null, SYSTEM_PROMPT_DYNAMIC_BOUNDARY = "__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__", DEFAULT_AGENT_PROMPT = `You are an agent for Ur. Given the user's message, you should use the tools available to complete the task. Complete the task fully\u2014don't gold-plate, but don't leave it half-done. When you complete the task, respond with a concise report covering what was done and any key findings \u2014 the caller will relay this to the user, so it only needs the essentials.`, SUMMARIZE_TOOL_RESULTS_SECTION = `When working with tool results, write down any important information you might need later in your response, as the original tool result may be cleared later.`;
614736
614573
  var init_prompts4 = __esm(() => {
614737
614574
  init_env();
614738
614575
  init_git();
@@ -614768,11 +614605,6 @@ var init_prompts4 = __esm(() => {
614768
614605
  init_memdir();
614769
614606
  init_undercover();
614770
614607
  init_mcpInstructionsDelta();
614771
- UR_4_5_OR_4_6_MODEL_IDS = {
614772
- modelO: "ur-modelO-4-6",
614773
- modelS: "ur-modelS-4-6",
614774
- modelH: "ur-modelH-4-5-20251001"
614775
- };
614776
614608
  });
614777
614609
 
614778
614610
  // src/utils/api.ts
@@ -615219,7 +615051,7 @@ function computeFingerprint(messageText2, version3) {
615219
615051
  }
615220
615052
  function computeFingerprintFromMessages(messages) {
615221
615053
  const firstMessageText = extractFirstMessageText(messages);
615222
- return computeFingerprint(firstMessageText, "1.30.4");
615054
+ return computeFingerprint(firstMessageText, "1.30.6");
615223
615055
  }
615224
615056
  var FINGERPRINT_SALT = "59cf53e54c78";
615225
615057
  var init_fingerprint = () => {};
@@ -617086,7 +616918,7 @@ async function sideQuery(opts) {
617086
616918
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
617087
616919
  }
617088
616920
  const messageText2 = extractFirstUserMessageText(messages);
617089
- const fingerprint = computeFingerprint(messageText2, "1.30.4");
616921
+ const fingerprint = computeFingerprint(messageText2, "1.30.6");
617090
616922
  const attributionHeader = getAttributionHeader(fingerprint);
617091
616923
  const systemBlocks = [
617092
616924
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -621823,7 +621655,7 @@ function buildSystemInitMessage(inputs) {
621823
621655
  slash_commands: inputs.commands.filter((c4) => c4.userInvocable !== false).map((c4) => c4.name),
621824
621656
  apiKeySource: getURHQApiKeyWithSource().source,
621825
621657
  betas: getSdkBetas(),
621826
- ur_version: "1.30.4",
621658
+ ur_version: "1.30.6",
621827
621659
  output_style: outputStyle2,
621828
621660
  agents: inputs.agents.map((agent) => agent.agentType),
621829
621661
  skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill2) => skill2.name),
@@ -636451,7 +636283,7 @@ var init_useVoiceEnabled = __esm(() => {
636451
636283
  function getSemverPart(version3) {
636452
636284
  return `${import_semver13.major(version3, { loose: true })}.${import_semver13.minor(version3, { loose: true })}.${import_semver13.patch(version3, { loose: true })}`;
636453
636285
  }
636454
- function useUpdateNotification(updatedVersion, initialVersion = "1.30.4") {
636286
+ function useUpdateNotification(updatedVersion, initialVersion = "1.30.6") {
636455
636287
  const [lastNotifiedSemver, setLastNotifiedSemver] = import_react226.useState(() => getSemverPart(initialVersion));
636456
636288
  if (!updatedVersion) {
636457
636289
  return null;
@@ -636500,7 +636332,7 @@ function AutoUpdater({
636500
636332
  return;
636501
636333
  }
636502
636334
  if (false) {}
636503
- const currentVersion = "1.30.4";
636335
+ const currentVersion = "1.30.6";
636504
636336
  const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
636505
636337
  let latestVersion = await getLatestVersion(channel);
636506
636338
  const isDisabled = isAutoUpdaterDisabled();
@@ -636729,12 +636561,12 @@ function NativeAutoUpdater({
636729
636561
  logEvent("tengu_native_auto_updater_start", {});
636730
636562
  try {
636731
636563
  const maxVersion = await getMaxVersion();
636732
- if (maxVersion && gt("1.30.4", maxVersion)) {
636564
+ if (maxVersion && gt("1.30.6", maxVersion)) {
636733
636565
  const msg = await getMaxVersionMessage();
636734
636566
  setMaxVersionIssue(msg ?? "affects your version");
636735
636567
  }
636736
636568
  const result = await installLatest(channel);
636737
- const currentVersion = "1.30.4";
636569
+ const currentVersion = "1.30.6";
636738
636570
  const latencyMs = Date.now() - startTime;
636739
636571
  if (result.lockFailed) {
636740
636572
  logEvent("tengu_native_auto_updater_lock_contention", {
@@ -636871,17 +636703,17 @@ function PackageManagerAutoUpdater(t0) {
636871
636703
  const maxVersion = await getMaxVersion();
636872
636704
  if (maxVersion && latest && gt(latest, maxVersion)) {
636873
636705
  logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
636874
- if (gte("1.30.4", maxVersion)) {
636875
- logForDebugging(`PackageManagerAutoUpdater: current version ${"1.30.4"} is already at or above maxVersion ${maxVersion}, skipping update`);
636706
+ if (gte("1.30.6", maxVersion)) {
636707
+ logForDebugging(`PackageManagerAutoUpdater: current version ${"1.30.6"} is already at or above maxVersion ${maxVersion}, skipping update`);
636876
636708
  setUpdateAvailable(false);
636877
636709
  return;
636878
636710
  }
636879
636711
  latest = maxVersion;
636880
636712
  }
636881
- const hasUpdate = latest && !gte("1.30.4", latest) && !shouldSkipVersion(latest);
636713
+ const hasUpdate = latest && !gte("1.30.6", latest) && !shouldSkipVersion(latest);
636882
636714
  setUpdateAvailable(!!hasUpdate);
636883
636715
  if (hasUpdate) {
636884
- logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.30.4"} -> ${latest}`);
636716
+ logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.30.6"} -> ${latest}`);
636885
636717
  }
636886
636718
  };
636887
636719
  $3[0] = t1;
@@ -636915,7 +636747,7 @@ function PackageManagerAutoUpdater(t0) {
636915
636747
  wrap: "truncate",
636916
636748
  children: [
636917
636749
  "currentVersion: ",
636918
- "1.30.4"
636750
+ "1.30.6"
636919
636751
  ]
636920
636752
  }, undefined, true, undefined, this);
636921
636753
  $3[3] = verbose;
@@ -649251,7 +649083,6 @@ function statusBarShouldDisplay({
649251
649083
  function buildDefaultStatusBar({
649252
649084
  version: version3,
649253
649085
  providerLabel,
649254
- authMode,
649255
649086
  model,
649256
649087
  mode: mode2,
649257
649088
  branch: branch2,
@@ -649261,36 +649092,31 @@ function buildDefaultStatusBar({
649261
649092
  latestVersion,
649262
649093
  isCheckingUpdate
649263
649094
  }) {
649264
- const parts = [`UR-AGENT v${version3}`];
649095
+ const parts = [];
649265
649096
  if (providerLabel) {
649266
- parts.push(`Provider: ${providerLabel}`);
649267
- }
649268
- if (authMode) {
649269
- parts.push(`Auth: ${authMode}`);
649097
+ parts.push(providerLabel);
649270
649098
  }
649271
649099
  if (model) {
649272
- parts.push(`model: ${model}`);
649100
+ parts.push(model);
649273
649101
  }
649274
649102
  if (mode2) {
649275
- parts.push(`mode: ${mode2}`);
649103
+ parts.push(mode2);
649276
649104
  }
649277
649105
  if (branch2 && branch2 !== "HEAD") {
649278
- parts.push(`branch: ${branch2}`);
649106
+ parts.push(branch2);
649279
649107
  }
649280
649108
  if (taskTotalCount > 0) {
649281
649109
  parts.push(`tasks: ${taskRunningCount}/${taskTotalCount} running`);
649282
- } else {
649283
- parts.push("tasks: idle");
649284
649110
  }
649285
649111
  if (checksStatus) {
649286
- parts.push(`checks: ${checksStatus}`);
649112
+ parts.push(checksStatus);
649287
649113
  }
649288
649114
  if (isCheckingUpdate) {
649289
- parts.push("Update: checking");
649115
+ parts.push("update checking");
649290
649116
  } else if (isUpdateAvailable(version3, latestVersion)) {
649291
- parts.push(`Update: ${version3} -> ${latestVersion} available`);
649117
+ parts.push(`update ${latestVersion} available`);
649292
649118
  }
649293
- return parts.join(" | ");
649119
+ return parts.length > 0 ? parts.join(" | ") : "ready";
649294
649120
  }
649295
649121
  var init_statusBar = __esm(() => {
649296
649122
  init_updateNotice();
@@ -649372,7 +649198,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
649372
649198
  project_dir: getOriginalCwd(),
649373
649199
  added_dirs: addedDirs
649374
649200
  },
649375
- version: "1.30.4",
649201
+ version: "1.30.6",
649376
649202
  output_style: {
649377
649203
  name: outputStyleName
649378
649204
  },
@@ -649455,7 +649281,7 @@ function StatusLineInner({
649455
649281
  const taskValues = Object.values(tasks2);
649456
649282
  const taskRunningCount = taskValues.filter((task2) => task2.status === "running" || task2.status === "pending").length;
649457
649283
  const defaultStatusLineText = buildDefaultStatusBar({
649458
- version: "1.30.4",
649284
+ version: "1.30.6",
649459
649285
  providerLabel: providerRuntime.providerLabel,
649460
649286
  authMode: providerRuntime.authLabel,
649461
649287
  model: providerRuntime.model ?? renderModelName(mainLoopModel),
@@ -660783,7 +660609,7 @@ function EffortOptionLabel(t0) {
660783
660609
  }
660784
660610
  function shouldShowEffortCallout(model) {
660785
660611
  const parsed = parseUserSpecifiedModel(model);
660786
- if (!parsed.toLowerCase().includes("modelO-4-6")) {
660612
+ if (!parsed.toLowerCase().includes("modelo")) {
660787
660613
  return false;
660788
660614
  }
660789
660615
  const config3 = getGlobalConfig();
@@ -660943,7 +660769,7 @@ async function submitTranscriptShare(messages, trigger2, appearanceId) {
660943
660769
  } catch {}
660944
660770
  const data = {
660945
660771
  trigger: trigger2,
660946
- version: "1.30.4",
660772
+ version: "1.30.6",
660947
660773
  platform: process.platform,
660948
660774
  transcript,
660949
660775
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -663204,7 +663030,7 @@ var init_tipRegistry = __esm(() => {
663204
663030
  },
663205
663031
  {
663206
663032
  id: "modelOplan-mode-reminder",
663207
- content: async () => `Your default model setting is modelO Plan Mode. Press ${getShortcutDisplay("chat:cycleMode", "Chat", "shift+tab")} twice to activate Plan Mode and plan with UR modelO.`,
663033
+ content: async () => `Your default model setting is plan mode. Press ${getShortcutDisplay("chat:cycleMode", "Chat", "shift+tab")} twice to activate Plan Mode.`,
663208
663034
  cooldownSessions: 2,
663209
663035
  async isRelevant() {
663210
663036
  if (process.env.USER_TYPE === "ant")
@@ -666942,8 +666768,8 @@ var init_useModelMigrationNotifications = __esm(() => {
666942
666768
  if (!recent(c4.modelS45To46MigrationTimestamp))
666943
666769
  return;
666944
666770
  return {
666945
- key: "modelS-46-update",
666946
- text: "Model updated to modelS 4.6",
666771
+ key: "model-alias-update",
666772
+ text: "Model setting updated",
666947
666773
  color: "suggestion",
666948
666774
  priority: "high",
666949
666775
  timeoutMs: 3000
@@ -666956,7 +666782,7 @@ var init_useModelMigrationNotifications = __esm(() => {
666956
666782
  return;
666957
666783
  return {
666958
666784
  key: "modelO-pro-update",
666959
- text: isLegacyRemap ? "Model updated to modelO 4.6 \xB7 Set UR_CODE_DISABLE_LEGACY_MODEL_REMAP=1 to opt out" : "Model updated to modelO 4.6",
666785
+ text: isLegacyRemap ? "Model setting updated \xB7 Set UR_CODE_DISABLE_LEGACY_MODEL_REMAP=1 to opt out" : "Model setting updated",
666960
666786
  color: "suggestion",
666961
666787
  priority: "high",
666962
666788
  timeoutMs: isLegacyRemap ? 8000 : 3000
@@ -672827,7 +672653,7 @@ function WelcomeV2() {
672827
672653
  dimColor: true,
672828
672654
  children: [
672829
672655
  "v",
672830
- "1.30.4"
672656
+ "1.30.6"
672831
672657
  ]
672832
672658
  }, undefined, true, undefined, this)
672833
672659
  ]
@@ -674087,7 +673913,7 @@ function completeOnboarding() {
674087
673913
  saveGlobalConfig((current) => ({
674088
673914
  ...current,
674089
673915
  hasCompletedOnboarding: true,
674090
- lastOnboardingVersion: "1.30.4"
673916
+ lastOnboardingVersion: "1.30.6"
674091
673917
  }));
674092
673918
  }
674093
673919
  function showDialog(root2, renderer) {
@@ -678941,32 +678767,8 @@ var init_migrateFennecTomodelO = __esm(() => {
678941
678767
 
678942
678768
  // src/migrations/migrateLegacymodelOToCurrent.ts
678943
678769
  function migrateLegacymodelOToCurrent() {
678944
- if (getAPIProvider() !== "firstParty") {
678945
- return;
678946
- }
678947
- if (!isLegacyModelRemapEnabled()) {
678948
- return;
678949
- }
678950
- const model = getSettingsForSource("userSettings")?.model;
678951
- if (model !== "ur-modelO-4-20250514" && model !== "ur-modelO-4-1-20250805" && model !== "ur-modelO-4-0" && model !== "ur-modelO-4-1") {
678952
- return;
678953
- }
678954
- updateSettingsForSource("userSettings", { model: "modelO" });
678955
- saveGlobalConfig((current) => ({
678956
- ...current,
678957
- legacymodelOMigrationTimestamp: Date.now()
678958
- }));
678959
- logEvent("tengu_legacy_modelO_migration", {
678960
- from_model: model
678961
- });
678770
+ return;
678962
678771
  }
678963
- var init_migrateLegacymodelOToCurrent = __esm(() => {
678964
- init_analytics();
678965
- init_config();
678966
- init_model();
678967
- init_providers();
678968
- init_settings2();
678969
- });
678970
678772
 
678971
678773
  // src/migrations/migratemodelOTomodelO1m.ts
678972
678774
  function migratemodelOTomodelO1m() {
@@ -679011,62 +678813,19 @@ function migratemodelS1mTomodelS45() {
679011
678813
  if (config3.modelS1m45MigrationComplete) {
679012
678814
  return;
679013
678815
  }
679014
- const model = getSettingsForSource("userSettings")?.model;
679015
- if (model === "modelS[1m]") {
679016
- updateSettingsForSource("userSettings", {
679017
- model: "modelS-4-5-20250929[1m]"
679018
- });
679019
- }
679020
- const override = getMainLoopModelOverride();
679021
- if (override === "modelS[1m]") {
679022
- setMainLoopModelOverride("modelS-4-5-20250929[1m]");
679023
- }
679024
678816
  saveGlobalConfig((current) => ({
679025
678817
  ...current,
679026
678818
  modelS1m45MigrationComplete: true
679027
678819
  }));
679028
678820
  }
679029
678821
  var init_migratemodelS1mTomodelS45 = __esm(() => {
679030
- init_state();
679031
678822
  init_config();
679032
- init_settings2();
679033
678823
  });
679034
678824
 
679035
678825
  // src/migrations/migratemodelS45TomodelS46.ts
679036
678826
  function migratemodelS45TomodelS46() {
679037
- if (getAPIProvider() !== "firstParty") {
679038
- return;
679039
- }
679040
- if (!isProSubscriber() && !isMaxSubscriber() && !isTeamPremiumSubscriber()) {
679041
- return;
679042
- }
679043
- const model = getSettingsForSource("userSettings")?.model;
679044
- if (model !== "ur-modelS-4-5-20250929" && model !== "ur-modelS-4-5-20250929[1m]" && model !== "modelS-4-5-20250929" && model !== "modelS-4-5-20250929[1m]") {
679045
- return;
679046
- }
679047
- const has1m = model.endsWith("[1m]");
679048
- updateSettingsForSource("userSettings", {
679049
- model: has1m ? "modelS[1m]" : "modelS"
679050
- });
679051
- const config3 = getGlobalConfig();
679052
- if (config3.numStartups > 1) {
679053
- saveGlobalConfig((current) => ({
679054
- ...current,
679055
- modelS45To46MigrationTimestamp: Date.now()
679056
- }));
679057
- }
679058
- logEvent("tengu_modelS45_to_46_migration", {
679059
- from_model: model,
679060
- has_1m: has1m
679061
- });
678827
+ return;
679062
678828
  }
679063
- var init_migratemodelS45TomodelS46 = __esm(() => {
679064
- init_analytics();
679065
- init_auth();
679066
- init_config();
679067
- init_providers();
679068
- init_settings2();
679069
- });
679070
678829
 
679071
678830
  // src/migrations/resetAutoModeOptInForDefaultOffer.ts
679072
678831
  var init_resetAutoModeOptInForDefaultOffer = __esm(() => {
@@ -679191,7 +678950,7 @@ function appendToLog(path24, message) {
679191
678950
  cwd: getFsImplementation().cwd(),
679192
678951
  userType: process.env.USER_TYPE,
679193
678952
  sessionId: getSessionId(),
679194
- version: "1.30.4"
678953
+ version: "1.30.6"
679195
678954
  };
679196
678955
  getLogWriter(path24).write(messageWithTimestamp);
679197
678956
  }
@@ -683285,8 +683044,8 @@ async function getEnvLessBridgeConfig() {
683285
683044
  }
683286
683045
  async function checkEnvLessBridgeMinVersion() {
683287
683046
  const cfg = await getEnvLessBridgeConfig();
683288
- if (cfg.min_version && lt("1.30.4", cfg.min_version)) {
683289
- return `Your version of UR (${"1.30.4"}) is too old for Remote Control.
683047
+ if (cfg.min_version && lt("1.30.6", cfg.min_version)) {
683048
+ return `Your version of UR (${"1.30.6"}) is too old for Remote Control.
683290
683049
  Version ${cfg.min_version} or higher is required. Run \`ur update\` to update.`;
683291
683050
  }
683292
683051
  return null;
@@ -683760,7 +683519,7 @@ async function initBridgeCore(params) {
683760
683519
  const rawApi = createBridgeApiClient({
683761
683520
  baseUrl,
683762
683521
  getAccessToken,
683763
- runnerVersion: "1.30.4",
683522
+ runnerVersion: "1.30.6",
683764
683523
  onDebug: logForDebugging,
683765
683524
  onAuth401,
683766
683525
  getTrustedDeviceToken
@@ -689442,7 +689201,7 @@ async function startMCPServer(cwd3, debug2, verbose) {
689442
689201
  setCwd(cwd3);
689443
689202
  const server2 = new Server({
689444
689203
  name: "ur/tengu",
689445
- version: "1.30.4"
689204
+ version: "1.30.6"
689446
689205
  }, {
689447
689206
  capabilities: {
689448
689207
  tools: {}
@@ -691419,7 +691178,7 @@ async function update() {
691419
691178
  logEvent("tengu_update_check", {});
691420
691179
  const diagnostic = await getDoctorDiagnostic();
691421
691180
  const result = await checkUpgradeStatus({
691422
- currentVersion: "1.30.4",
691181
+ currentVersion: "1.30.6",
691423
691182
  packageName: UR_AGENT_PACKAGE_NAME,
691424
691183
  installationType: diagnostic.installationType,
691425
691184
  latestVersion: () => getLatestNpmPackageVersion(UR_AGENT_PACKAGE_NAME)
@@ -692665,7 +692424,7 @@ ${customInstructions}` : customInstructions;
692665
692424
  }
692666
692425
  }
692667
692426
  logForDiagnosticsNoPII("info", "started", {
692668
- version: "1.30.4",
692427
+ version: "1.30.6",
692669
692428
  is_native_binary: isInBundledMode()
692670
692429
  });
692671
692430
  registerCleanup(async () => {
@@ -693451,7 +693210,7 @@ Usage: ur --remote "your task description"`, () => gracefulShutdown(1));
693451
693210
  pendingHookMessages
693452
693211
  }, renderAndRun);
693453
693212
  }
693454
- }).version("1.30.4 (UR-AGENT)", "-v, --version", "Output the version number");
693213
+ }).version("1.30.6 (UR-AGENT)", "-v, --version", "Output the version number");
693455
693214
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
693456
693215
  program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
693457
693216
  if (canUserConfigureAdvisor()) {
@@ -694291,11 +694050,9 @@ var init_main3 = __esm(() => {
694291
694050
  init_migrateBypassPermissionsAcceptedToSettings();
694292
694051
  init_migrateEnableAllProjectMcpServersToSettings();
694293
694052
  init_migrateFennecTomodelO();
694294
- init_migrateLegacymodelOToCurrent();
694295
694053
  init_migratemodelOTomodelO1m();
694296
694054
  init_migrateReplBridgeEnabledToRemoteControlAtStartup();
694297
694055
  init_migratemodelS1mTomodelS45();
694298
- init_migratemodelS45TomodelS46();
694299
694056
  init_resetAutoModeOptInForDefaultOffer();
694300
694057
  init_resetProTomodelODefault();
694301
694058
  init_RemoteSessionManager();
@@ -694336,7 +694093,7 @@ if (false) {}
694336
694093
  async function main2() {
694337
694094
  const args = process.argv.slice(2);
694338
694095
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
694339
- console.log(`${"1.30.4"} (UR-AGENT)`);
694096
+ console.log(`${"1.30.6"} (UR-AGENT)`);
694340
694097
  return;
694341
694098
  }
694342
694099
  if (args[0] === "a2a" && args[1] === "serve" && !args.includes("--help") && !args.includes("-h")) {