@makerbi/openclaude 0.14.8 → 0.15.0

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.
Files changed (3) hide show
  1. package/dist/cli.mjs +858 -406
  2. package/dist/sdk.mjs +288 -80
  3. package/package.json +3 -3
package/dist/cli.mjs CHANGED
@@ -18728,7 +18728,7 @@ var init_codexOAuthShared = __esm(() => {
18728
18728
  });
18729
18729
 
18730
18730
  // src/utils/codexCredentials.ts
18731
- function getCodexSecureStorage() {
18731
+ function getCodexPrimarySecureStorage() {
18732
18732
  return getSecureStorage({ allowPlainTextFallback: false });
18733
18733
  }
18734
18734
  function parseJwtExpiryMs(token) {
@@ -18766,6 +18766,69 @@ function normalizeCodexCredentialBlob(value) {
18766
18766
  lastRefreshFailureAt
18767
18767
  };
18768
18768
  }
18769
+ function getRecord(data) {
18770
+ return data && typeof data === "object" ? data : {};
18771
+ }
18772
+ function hasStoredCodexRecord(data) {
18773
+ return Object.prototype.hasOwnProperty.call(getRecord(data), CODEX_STORAGE_KEY);
18774
+ }
18775
+ function hasNonCodexStorageFields(data) {
18776
+ return Object.keys(getRecord(data)).some((key) => key !== CODEX_STORAGE_KEY);
18777
+ }
18778
+ function readCodexFromPlainTextStorage() {
18779
+ try {
18780
+ const data = plainTextStorage.read();
18781
+ return normalizeCodexCredentialBlob(data?.[CODEX_STORAGE_KEY]);
18782
+ } catch {
18783
+ return;
18784
+ }
18785
+ }
18786
+ async function readCodexFromPlainTextStorageAsync() {
18787
+ try {
18788
+ const data = await plainTextStorage.readAsync();
18789
+ return normalizeCodexCredentialBlob(data?.[CODEX_STORAGE_KEY]);
18790
+ } catch {
18791
+ return;
18792
+ }
18793
+ }
18794
+ function writeCodexToPlainTextStorage(codex) {
18795
+ try {
18796
+ const previous = plainTextStorage.read() || {};
18797
+ const next = {
18798
+ ...getRecord(previous),
18799
+ [CODEX_STORAGE_KEY]: codex
18800
+ };
18801
+ return plainTextStorage.update(next);
18802
+ } catch {
18803
+ return { success: false };
18804
+ }
18805
+ }
18806
+ function removeCodexFromPlainTextStorage() {
18807
+ try {
18808
+ const previous = plainTextStorage.read();
18809
+ if (!hasStoredCodexRecord(previous)) {
18810
+ return { success: true };
18811
+ }
18812
+ const next = { ...getRecord(previous) };
18813
+ delete next[CODEX_STORAGE_KEY];
18814
+ if (Object.keys(next).length === 0) {
18815
+ return plainTextStorage.delete() ? { success: true } : {
18816
+ success: false,
18817
+ warning: CODEX_PLAINTEXT_CLEANUP_FAILED_WARNING
18818
+ };
18819
+ }
18820
+ const result = plainTextStorage.update(next);
18821
+ return result.success ? { success: true } : {
18822
+ success: false,
18823
+ warning: result.warning ?? CODEX_PLAINTEXT_CLEANUP_FAILED_WARNING
18824
+ };
18825
+ } catch {
18826
+ return {
18827
+ success: false,
18828
+ warning: CODEX_PLAINTEXT_CLEANUP_FAILED_WARNING
18829
+ };
18830
+ }
18831
+ }
18769
18832
  function shouldRefreshCodexToken(blob) {
18770
18833
  const expiresAt = parseJwtExpiryMs(blob.accessToken) ?? parseJwtExpiryMs(blob.idToken);
18771
18834
  if (expiresAt === undefined) {
@@ -18798,21 +18861,23 @@ function readCodexCredentials() {
18798
18861
  if (isBareMode())
18799
18862
  return;
18800
18863
  try {
18801
- const data = getCodexSecureStorage().read();
18802
- return normalizeCodexCredentialBlob(data?.codex);
18803
- } catch {
18804
- return;
18805
- }
18864
+ const data = getCodexPrimarySecureStorage().read();
18865
+ const primaryCodex = normalizeCodexCredentialBlob(data?.codex);
18866
+ if (primaryCodex)
18867
+ return primaryCodex;
18868
+ } catch {}
18869
+ return readCodexFromPlainTextStorage();
18806
18870
  }
18807
18871
  async function readCodexCredentialsAsync() {
18808
18872
  if (isBareMode())
18809
18873
  return;
18810
18874
  try {
18811
- const data = await getCodexSecureStorage().readAsync();
18812
- return normalizeCodexCredentialBlob(data?.codex);
18813
- } catch {
18814
- return;
18815
- }
18875
+ const data = await getCodexPrimarySecureStorage().readAsync();
18876
+ const primaryCodex = normalizeCodexCredentialBlob(data?.codex);
18877
+ if (primaryCodex)
18878
+ return primaryCodex;
18879
+ } catch {}
18880
+ return readCodexFromPlainTextStorageAsync();
18816
18881
  }
18817
18882
  function isCodexRefreshFailureCoolingDown(blob, now = Date.now()) {
18818
18883
  return isWithinRefreshFailureCooldown(blob, now);
@@ -18825,11 +18890,12 @@ function saveCodexCredentials(credentials) {
18825
18890
  if (!normalized) {
18826
18891
  return { success: false, warning: "Codex credentials are incomplete." };
18827
18892
  }
18828
- const secureStorage = getCodexSecureStorage();
18829
- const previous = secureStorage.read() || {};
18830
- const previousCodex = normalizeCodexCredentialBlob(previous[CODEX_STORAGE_KEY]);
18893
+ const secureStorage = getCodexPrimarySecureStorage();
18894
+ const previous = secureStorage.read();
18895
+ const previousNativeCodex = normalizeCodexCredentialBlob(previous?.[CODEX_STORAGE_KEY]);
18896
+ const previousCodex = previousNativeCodex ?? readCodexFromPlainTextStorage();
18831
18897
  const next = {
18832
- ...previous,
18898
+ ...getRecord(previous),
18833
18899
  [CODEX_STORAGE_KEY]: {
18834
18900
  ...normalized,
18835
18901
  profileId: normalized.profileId ?? previousCodex?.profileId,
@@ -18840,8 +18906,37 @@ function saveCodexCredentials(credentials) {
18840
18906
  if (result.success) {
18841
18907
  const storedCodex = normalizeCodexCredentialBlob(next[CODEX_STORAGE_KEY]);
18842
18908
  inMemoryLastRefreshFailureAt = storedCodex?.lastRefreshFailureAt ?? null;
18909
+ const cleanupResult = removeCodexFromPlainTextStorage();
18910
+ if (!cleanupResult.success) {
18911
+ return {
18912
+ success: true,
18913
+ warning: cleanupResult.warning ?? CODEX_PLAINTEXT_CLEANUP_FAILED_WARNING
18914
+ };
18915
+ }
18916
+ return result;
18843
18917
  }
18844
- return result;
18918
+ if (previousNativeCodex && hasNonCodexStorageFields(previous)) {
18919
+ return result;
18920
+ }
18921
+ const fallbackResult = writeCodexToPlainTextStorage(next[CODEX_STORAGE_KEY]);
18922
+ if (fallbackResult.success) {
18923
+ if (previousNativeCodex && !secureStorage.delete()) {
18924
+ return {
18925
+ success: false,
18926
+ warning: CODEX_FALLBACK_NATIVE_DELETE_FAILED_WARNING
18927
+ };
18928
+ }
18929
+ if (!previousNativeCodex && !hasNonCodexStorageFields(previous)) {
18930
+ secureStorage.delete();
18931
+ }
18932
+ const storedCodex = normalizeCodexCredentialBlob(next[CODEX_STORAGE_KEY]);
18933
+ inMemoryLastRefreshFailureAt = storedCodex?.lastRefreshFailureAt ?? null;
18934
+ return {
18935
+ success: true,
18936
+ warning: fallbackResult.warning
18937
+ };
18938
+ }
18939
+ return fallbackResult.warning ? fallbackResult : result;
18845
18940
  }
18846
18941
  function persistCodexRefreshFailure(credentials, occurredAt) {
18847
18942
  const result = saveCodexCredentials({
@@ -18856,14 +18951,27 @@ function clearCodexCredentials() {
18856
18951
  if (isBareMode()) {
18857
18952
  return { success: true };
18858
18953
  }
18859
- const secureStorage = getCodexSecureStorage();
18860
- const previous = secureStorage.read() || {};
18861
- const next = { ...previous };
18954
+ const secureStorage = getCodexPrimarySecureStorage();
18955
+ const previous = secureStorage.read();
18956
+ const previousCodex = normalizeCodexCredentialBlob(previous?.[CODEX_STORAGE_KEY]);
18957
+ if (!previousCodex) {
18958
+ const plaintextResult2 = removeCodexFromPlainTextStorage();
18959
+ if (plaintextResult2.success) {
18960
+ inMemoryLastRefreshFailureAt = null;
18961
+ }
18962
+ return plaintextResult2;
18963
+ }
18964
+ const next = { ...getRecord(previous) };
18862
18965
  delete next[CODEX_STORAGE_KEY];
18863
18966
  const result = secureStorage.update(next);
18864
- if (result.success) {
18865
- inMemoryLastRefreshFailureAt = null;
18967
+ if (!result.success) {
18968
+ return result;
18969
+ }
18970
+ const plaintextResult = removeCodexFromPlainTextStorage();
18971
+ if (!plaintextResult.success) {
18972
+ return plaintextResult;
18866
18973
  }
18974
+ inMemoryLastRefreshFailureAt = null;
18867
18975
  return result;
18868
18976
  }
18869
18977
  async function refreshCodexAccessTokenIfNeeded(options) {
@@ -18877,7 +18985,8 @@ async function refreshCodexAccessTokenIfNeeded(options) {
18877
18985
  if (!current) {
18878
18986
  return { refreshed: false };
18879
18987
  }
18880
- if (!current.refreshToken) {
18988
+ const refreshToken = current.refreshToken;
18989
+ if (!refreshToken) {
18881
18990
  return { refreshed: false, credentials: current };
18882
18991
  }
18883
18992
  if (!options?.force && !shouldRefreshCodexToken(current)) {
@@ -18895,7 +19004,7 @@ async function refreshCodexAccessTokenIfNeeded(options) {
18895
19004
  const body = new URLSearchParams({
18896
19005
  client_id: getCodexOAuthClientId(),
18897
19006
  grant_type: "refresh_token",
18898
- refresh_token: current.refreshToken
19007
+ refresh_token: refreshToken
18899
19008
  });
18900
19009
  const { signal, cleanup } = createCombinedAbortSignal(undefined, {
18901
19010
  timeoutMs: 15000
@@ -18952,11 +19061,12 @@ async function refreshCodexAccessTokenIfNeeded(options) {
18952
19061
  })();
18953
19062
  return inFlightCodexRefresh;
18954
19063
  }
18955
- var CODEX_STORAGE_KEY = "codex", CODEX_TOKEN_REFRESH_SKEW_MS = 60000, CODEX_TOKEN_REFRESH_RETRY_COOLDOWN_MS = 60000, inFlightCodexRefresh = null, inMemoryLastRefreshFailureAt = null;
19064
+ var CODEX_STORAGE_KEY = "codex", CODEX_TOKEN_REFRESH_SKEW_MS = 60000, CODEX_TOKEN_REFRESH_RETRY_COOLDOWN_MS = 60000, CODEX_FALLBACK_NATIVE_DELETE_FAILED_WARNING = "Codex credentials were written to plaintext fallback, but stale native secure storage could not be removed.", CODEX_PLAINTEXT_CLEANUP_FAILED_WARNING = "Codex credentials were saved, but stale plaintext fallback credentials could not be removed.", inFlightCodexRefresh = null, inMemoryLastRefreshFailureAt = null;
18956
19065
  var init_codexCredentials = __esm(() => {
18957
19066
  init_envUtils();
18958
19067
  init_combinedAbortSignal();
18959
19068
  init_secureStorage();
19069
+ init_plainTextStorage();
18960
19070
  init_codexOAuthShared();
18961
19071
  });
18962
19072
 
@@ -19953,6 +20063,7 @@ var init_gitlawb_opengateway = __esm(() => {
19953
20063
  preset: {
19954
20064
  id: "gitlawb-opengateway",
19955
20065
  description: "Gitlawb Opengateway — free hosted Xiaomi MiMo + GMI Cloud partner models (API key required, mint at https://gitlawb.com/opengateway/keys)",
20066
+ apiKeyEnvVars: ["OPENGATEWAY_API_KEY"],
19956
20067
  label: "Gitlawb Opengateway",
19957
20068
  name: "Gitlawb Opengateway",
19958
20069
  vendorId: "openai",
@@ -21845,6 +21956,9 @@ var init_integrationArtifacts_generated = __esm(() => {
21845
21956
  description: "Gitlawb Opengateway — free hosted Xiaomi MiMo + GMI Cloud partner models (API key required, mint at https://gitlawb.com/opengateway/keys)",
21846
21957
  label: "Gitlawb Opengateway",
21847
21958
  name: "Gitlawb Opengateway",
21959
+ apiKeyEnvVars: [
21960
+ "OPENGATEWAY_API_KEY"
21961
+ ],
21848
21962
  baseUrlEnvVars: [
21849
21963
  "OPENGATEWAY_BASE_URL",
21850
21964
  "OPENAI_BASE_URL"
@@ -23279,6 +23393,8 @@ function normalizePathWithV1(pathname) {
23279
23393
  return `${trimmed}/v1`;
23280
23394
  }
23281
23395
  function isLikelyOllamaEndpoint(baseUrl) {
23396
+ if (!baseUrl)
23397
+ return false;
23282
23398
  try {
23283
23399
  const parsed = new URL(baseUrl);
23284
23400
  const hostname = parsed.hostname.toLowerCase();
@@ -41937,7 +42053,7 @@ function getCredentialEnvValidationError(validation, env3, request) {
41937
42053
  return invalidValue.message;
41938
42054
  }
41939
42055
  }
41940
- if (validation.allowLocalBaseUrlWithoutCredential && request && isLocalProviderUrl(request.baseUrl)) {
42056
+ if (validation.allowLocalBaseUrlWithoutCredential && request && (isLocalProviderUrl(request.baseUrl) || isLikelyOllamaEndpoint(request.baseUrl))) {
41941
42057
  return null;
41942
42058
  }
41943
42059
  if (validation.credentialEnvVars.some((envVar) => hasNonEmptyEnvValue2(env3, envVar))) {
@@ -42065,7 +42181,7 @@ async function getProviderValidationError(env3 = process.env, options) {
42065
42181
  hasStoredXaiOAuthCredentials: options?.hasStoredXaiOAuthCredentials
42066
42182
  });
42067
42183
  if (descriptorValidationError) {
42068
- if (validationTarget.kind === "vendor" && validationTarget.descriptor.id === "openai" && !env3.OPENAI_API_KEY && !isLocalProviderUrl(request.baseUrl)) {
42184
+ if (validationTarget.kind === "vendor" && validationTarget.descriptor.id === "openai" && !env3.OPENAI_API_KEY && !isLocalProviderUrl(request.baseUrl) && !isLikelyOllamaEndpoint(request.baseUrl)) {
42069
42185
  return getOpenAIMissingKeyMessage();
42070
42186
  }
42071
42187
  return descriptorValidationError;
@@ -42076,7 +42192,7 @@ async function getProviderValidationError(env3 = process.env, options) {
42076
42192
  if (genericRouteValidation.applicable) {
42077
42193
  return genericRouteValidation.error;
42078
42194
  }
42079
- if (!env3.OPENAI_API_KEY && !isLocalProviderUrl(request.baseUrl)) {
42195
+ if (!env3.OPENAI_API_KEY && !isLocalProviderUrl(request.baseUrl) && !isLikelyOllamaEndpoint(request.baseUrl)) {
42080
42196
  if (validationTarget?.descriptor.setup?.requiresAuth === false) {
42081
42197
  return null;
42082
42198
  }
@@ -93314,7 +93430,7 @@ async function initialize() {
93314
93430
  if (dirs.length === 0)
93315
93431
  return;
93316
93432
  logForDebugging(`Watching for changes in setting files ${[...settingsFiles].join(", ")}...${dropInDir ? ` and drop-in directory ${dropInDir}` : ""}`);
93317
- watcher = esm_default.watch(dirs, {
93433
+ watcher = dependencies.watch(dirs, {
93318
93434
  persistent: true,
93319
93435
  ignoreInitial: true,
93320
93436
  depth: 0,
@@ -93354,8 +93470,10 @@ function dispose() {
93354
93470
  for (const timer of pendingDeletions.values())
93355
93471
  clearTimeout(timer);
93356
93472
  pendingDeletions.clear();
93473
+ clearSettingsDebounce();
93474
+ settingsSourceGenerations.clear();
93357
93475
  lastMdmSnapshot = null;
93358
- clearInternalWrites();
93476
+ dependencies.clearInternalWrites();
93359
93477
  settingsChanged.clear();
93360
93478
  const w = watcher;
93361
93479
  watcher = null;
@@ -93368,7 +93486,7 @@ async function getWatchTargets() {
93368
93486
  if (source === "flagSettings") {
93369
93487
  continue;
93370
93488
  }
93371
- const path10 = getSettingsFilePathForSource(source);
93489
+ const path10 = dependencies.getSettingsFilePathForSource(source);
93372
93490
  if (!path10) {
93373
93491
  continue;
93374
93492
  }
@@ -93378,7 +93496,7 @@ async function getWatchTargets() {
93378
93496
  }
93379
93497
  dirToSettingsFiles.get(dir).add(path10);
93380
93498
  try {
93381
- const stats = await stat10(path10);
93499
+ const stats = await dependencies.stat(path10);
93382
93500
  if (stats.isFile()) {
93383
93501
  dirsWithExistingFiles.add(dir);
93384
93502
  }
@@ -93394,9 +93512,9 @@ async function getWatchTargets() {
93394
93512
  }
93395
93513
  }
93396
93514
  let dropInDir = null;
93397
- const managedDropIn = getManagedSettingsDropInDir();
93515
+ const managedDropIn = dependencies.getManagedSettingsDropInDir();
93398
93516
  try {
93399
- const stats = await stat10(managedDropIn);
93517
+ const stats = await dependencies.stat(managedDropIn);
93400
93518
  if (stats.isDirectory()) {
93401
93519
  dirsWithExistingFiles.add(managedDropIn);
93402
93520
  dropInDir = managedDropIn;
@@ -93418,6 +93536,8 @@ function settingSourceToConfigChangeSource(source) {
93418
93536
  }
93419
93537
  }
93420
93538
  function handleChange(path10) {
93539
+ if (disposed)
93540
+ return;
93421
93541
  const source = getSourceForPath(path10);
93422
93542
  if (!source)
93423
93543
  return;
@@ -93427,19 +93547,24 @@ function handleChange(path10) {
93427
93547
  pendingDeletions.delete(path10);
93428
93548
  logForDebugging(`Cancelled pending deletion of ${path10} — file was recreated`);
93429
93549
  }
93430
- if (consumeInternalWrite(path10, INTERNAL_WRITE_WINDOW_MS)) {
93550
+ if (dependencies.consumeInternalWrite(path10, INTERNAL_WRITE_WINDOW_MS)) {
93431
93551
  return;
93432
93552
  }
93433
93553
  logForDebugging(`Detected change to ${path10}`);
93434
- executeConfigChangeHooks(settingSourceToConfigChangeSource(source), path10).then((results) => {
93435
- if (hasBlockingResult(results)) {
93554
+ const generation = nextSettingsSourceGeneration(source);
93555
+ dependencies.executeConfigChangeHooks(settingSourceToConfigChangeSource(source), path10).then((results) => {
93556
+ if (dependencies.hasBlockingResult(results)) {
93436
93557
  logForDebugging(`ConfigChange hook blocked change to ${path10}`);
93437
93558
  return;
93438
93559
  }
93439
- fanOut(source);
93560
+ if (disposed)
93561
+ return;
93562
+ scheduleFanOut(source, generation);
93440
93563
  });
93441
93564
  }
93442
93565
  function handleAdd(path10) {
93566
+ if (disposed)
93567
+ return;
93443
93568
  const source = getSourceForPath(path10);
93444
93569
  if (!source)
93445
93570
  return;
@@ -93452,31 +93577,38 @@ function handleAdd(path10) {
93452
93577
  handleChange(path10);
93453
93578
  }
93454
93579
  function handleDelete(path10) {
93580
+ if (disposed)
93581
+ return;
93455
93582
  const source = getSourceForPath(path10);
93456
93583
  if (!source)
93457
93584
  return;
93458
93585
  logForDebugging(`Detected deletion of ${path10}`);
93459
93586
  if (pendingDeletions.has(path10))
93460
93587
  return;
93461
- const timer = setTimeout((p, src) => {
93588
+ const generation = nextSettingsSourceGeneration(source);
93589
+ const timer = setTimeout((p, src, gen) => {
93590
+ if (disposed)
93591
+ return;
93462
93592
  pendingDeletions.delete(p);
93463
- executeConfigChangeHooks(settingSourceToConfigChangeSource(src), p).then((results) => {
93464
- if (hasBlockingResult(results)) {
93593
+ dependencies.executeConfigChangeHooks(settingSourceToConfigChangeSource(src), p).then((results) => {
93594
+ if (dependencies.hasBlockingResult(results)) {
93465
93595
  logForDebugging(`ConfigChange hook blocked deletion of ${p}`);
93466
93596
  return;
93467
93597
  }
93468
- fanOut(src);
93598
+ if (disposed)
93599
+ return;
93600
+ scheduleFanOut(src, gen);
93469
93601
  });
93470
- }, testOverrides?.deletionGrace ?? DELETION_GRACE_MS, path10, source);
93602
+ }, testOverrides?.deletionGrace ?? DELETION_GRACE_MS, path10, source, generation);
93471
93603
  pendingDeletions.set(path10, timer);
93472
93604
  }
93473
93605
  function getSourceForPath(path10) {
93474
93606
  const normalizedPath = platformPath.normalize(path10);
93475
- const dropInDir = getManagedSettingsDropInDir();
93607
+ const dropInDir = platformPath.normalize(dependencies.getManagedSettingsDropInDir());
93476
93608
  if (normalizedPath.startsWith(dropInDir + platformPath.sep)) {
93477
93609
  return "policySettings";
93478
93610
  }
93479
- return SETTING_SOURCES.find((source) => getSettingsFilePathForSource(source) === normalizedPath);
93611
+ return SETTING_SOURCES.find((source) => platformPath.normalize(dependencies.getSettingsFilePathForSource(source) ?? "") === normalizedPath);
93480
93612
  }
93481
93613
  function startMdmPoll() {
93482
93614
  const initial = getMdmSettings();
@@ -93511,9 +93643,46 @@ function startMdmPoll() {
93511
93643
  mdmPollTimer.unref();
93512
93644
  }
93513
93645
  function fanOut(source) {
93514
- resetSettingsCache();
93646
+ dependencies.resetSettingsCache();
93515
93647
  settingsChanged.emit(source);
93516
93648
  }
93649
+ function clearSettingsDebounce() {
93650
+ if (settingsDebounceTimer) {
93651
+ clearTimeout(settingsDebounceTimer);
93652
+ settingsDebounceTimer = null;
93653
+ }
93654
+ pendingSettingsSources.clear();
93655
+ }
93656
+ function nextSettingsSourceGeneration(source) {
93657
+ const generation = (settingsSourceGenerations.get(source) ?? 0) + 1;
93658
+ settingsSourceGenerations.set(source, generation);
93659
+ return generation;
93660
+ }
93661
+ function scheduleFanOut(source, generation) {
93662
+ if (disposed)
93663
+ return;
93664
+ if (settingsSourceGenerations.get(source) !== generation)
93665
+ return;
93666
+ pendingSettingsSources.set(source, generation);
93667
+ if (settingsDebounceTimer) {
93668
+ clearTimeout(settingsDebounceTimer);
93669
+ }
93670
+ settingsDebounceTimer = setTimeout(() => {
93671
+ settingsDebounceTimer = null;
93672
+ if (disposed) {
93673
+ pendingSettingsSources.clear();
93674
+ return;
93675
+ }
93676
+ const sources = [...pendingSettingsSources].flatMap(([src, generation2]) => settingsSourceGenerations.get(src) === generation2 ? [src] : []);
93677
+ pendingSettingsSources.clear();
93678
+ if (sources.length === 0)
93679
+ return;
93680
+ dependencies.resetSettingsCache();
93681
+ for (const src of sources) {
93682
+ settingsChanged.emit(src);
93683
+ }
93684
+ }, testOverrides?.settingsDebounce ?? SETTINGS_DEBOUNCE_MS);
93685
+ }
93517
93686
  function notifyChange(source) {
93518
93687
  logForDebugging(`Programmatic settings change notification for ${source}`);
93519
93688
  fanOut(source);
@@ -93526,6 +93695,8 @@ function resetForTesting(overrides) {
93526
93695
  for (const timer of pendingDeletions.values())
93527
93696
  clearTimeout(timer);
93528
93697
  pendingDeletions.clear();
93698
+ clearSettingsDebounce();
93699
+ settingsSourceGenerations.clear();
93529
93700
  lastMdmSnapshot = null;
93530
93701
  initialized = false;
93531
93702
  disposed = false;
@@ -93534,7 +93705,7 @@ function resetForTesting(overrides) {
93534
93705
  watcher = null;
93535
93706
  return w ? w.close() : Promise.resolve();
93536
93707
  }
93537
- var FILE_STABILITY_THRESHOLD_MS = 1000, FILE_STABILITY_POLL_INTERVAL_MS = 500, INTERNAL_WRITE_WINDOW_MS = 5000, MDM_POLL_INTERVAL_MS, DELETION_GRACE_MS, watcher = null, mdmPollTimer = null, lastMdmSnapshot = null, initialized = false, disposed = false, pendingDeletions, settingsChanged, testOverrides = null, subscribe, settingsChangeDetector;
93708
+ var FILE_STABILITY_THRESHOLD_MS = 1000, FILE_STABILITY_POLL_INTERVAL_MS = 500, INTERNAL_WRITE_WINDOW_MS = 5000, MDM_POLL_INTERVAL_MS, DELETION_GRACE_MS, SETTINGS_DEBOUNCE_MS = 500, watcher = null, mdmPollTimer = null, lastMdmSnapshot = null, initialized = false, disposed = false, pendingDeletions, settingsDebounceTimer = null, pendingSettingsSources, settingsSourceGenerations, settingsChanged, testOverrides = null, defaultDependencies, dependencies, subscribe, settingsChangeDetector;
93538
93709
  var init_changeDetector = __esm(() => {
93539
93710
  init_esm2();
93540
93711
  init_state();
@@ -93552,7 +93723,21 @@ var init_changeDetector = __esm(() => {
93552
93723
  MDM_POLL_INTERVAL_MS = 30 * 60 * 1000;
93553
93724
  DELETION_GRACE_MS = FILE_STABILITY_THRESHOLD_MS + FILE_STABILITY_POLL_INTERVAL_MS + 200;
93554
93725
  pendingDeletions = new Map;
93726
+ pendingSettingsSources = new Map;
93727
+ settingsSourceGenerations = new Map;
93555
93728
  settingsChanged = createSignal();
93729
+ defaultDependencies = {
93730
+ clearInternalWrites,
93731
+ consumeInternalWrite,
93732
+ executeConfigChangeHooks,
93733
+ getManagedSettingsDropInDir,
93734
+ getSettingsFilePathForSource,
93735
+ hasBlockingResult,
93736
+ resetSettingsCache,
93737
+ stat: stat10,
93738
+ watch: esm_default.watch.bind(esm_default)
93739
+ };
93740
+ dependencies = defaultDependencies;
93556
93741
  subscribe = settingsChanged.subscribe;
93557
93742
  settingsChangeDetector = {
93558
93743
  initialize,
@@ -134956,8 +135141,8 @@ More information can be found at: https://a.co/c895JFp`);
134956
135141
  try {
134957
135142
  const appPackageJsonPath = node_path.join(nodeModulesParentDir, "package.json");
134958
135143
  const packageJson = await promises.readFile(appPackageJsonPath, "utf-8");
134959
- const { dependencies, devDependencies } = JSON.parse(packageJson);
134960
- const version2 = devDependencies?.typescript ?? dependencies?.typescript;
135144
+ const { dependencies: dependencies2, devDependencies } = JSON.parse(packageJson);
135145
+ const version2 = devDependencies?.typescript ?? dependencies2?.typescript;
134961
135146
  if (typeof version2 !== "string") {
134962
135147
  continue;
134963
135148
  }
@@ -232303,7 +232488,7 @@ var init_metadata = __esm(() => {
232303
232488
  isClaudeAiAuth: isClaudeAISubscriber(),
232304
232489
  version: "99.0.0",
232305
232490
  versionBase: getVersionBase(),
232306
- buildTime: "2026-05-26T10:21:00.272Z",
232491
+ buildTime: "2026-05-27T07:41:16.072Z",
232307
232492
  deploymentEnvironment: env2.detectDeploymentEnvironment(),
232308
232493
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
232309
232494
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -243316,6 +243501,10 @@ function modelSupportsThinking(model2) {
243316
243501
  if (descriptorSupportsThinking !== undefined) {
243317
243502
  return descriptorSupportsThinking;
243318
243503
  }
243504
+ const routeId = resolveActiveRouteIdFromEnv(process.env);
243505
+ if (routeId === "ollama") {
243506
+ return false;
243507
+ }
243319
243508
  }
243320
243509
  return canonical.includes("sonnet-4") || canonical.includes("opus-4");
243321
243510
  }
@@ -243344,6 +243533,9 @@ function shouldEnableThinkingByDefault() {
243344
243533
  }
243345
243534
  return true;
243346
243535
  }
243536
+ function shouldUseThinkingForModel(model2, thinkingConfig) {
243537
+ return thinkingConfig.type !== "disabled" && !isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_THINKING) && modelSupportsThinking(model2);
243538
+ }
243347
243539
  var RAINBOW_COLORS, RAINBOW_SHIMMER_COLORS;
243348
243540
  var init_thinking = __esm(() => {
243349
243541
  init_growthbook();
@@ -243353,6 +243545,7 @@ var init_thinking = __esm(() => {
243353
243545
  init_modelSupportOverrides();
243354
243546
  init_providers();
243355
243547
  init_settings2();
243548
+ init_envUtils();
243356
243549
  RAINBOW_COLORS = [
243357
243550
  "rainbow_red",
243358
243551
  "rainbow_orange",
@@ -314881,12 +315074,23 @@ function getAgentModel(agentModel, parentModel, toolSpecifiedModel, permissionMo
314881
315074
  }
314882
315075
  return resolvedModel;
314883
315076
  };
314884
- if (toolSpecifiedModel) {
314885
- if (aliasMatchesParentTier(toolSpecifiedModel, parentModel)) {
315077
+ const trimmedToolSpecifiedModel = toolSpecifiedModel?.trim();
315078
+ if (trimmedToolSpecifiedModel) {
315079
+ if (trimmedToolSpecifiedModel.toLowerCase() === "inherit") {
315080
+ return getRuntimeMainLoopModel({
315081
+ permissionMode: permissionMode ?? "default",
315082
+ mainLoopModel: parentModel,
315083
+ exceeds200kTokens: false
315084
+ });
315085
+ }
315086
+ if (aliasMatchesParentTier(trimmedToolSpecifiedModel, parentModel)) {
315087
+ assertToolSpecifiedModelAllowed(trimmedToolSpecifiedModel, parentModel);
314886
315088
  return parentModel;
314887
315089
  }
314888
- const model3 = parseUserSpecifiedModel(toolSpecifiedModel);
314889
- return applyParentRegionPrefix(model3, toolSpecifiedModel);
315090
+ const model3 = parseUserSpecifiedModel(trimmedToolSpecifiedModel);
315091
+ const effectiveModel = applyParentRegionPrefix(model3, trimmedToolSpecifiedModel);
315092
+ assertToolSpecifiedModelAllowed(trimmedToolSpecifiedModel, effectiveModel);
315093
+ return effectiveModel;
314890
315094
  }
314891
315095
  const agentModelWithExp = agentModel ?? getDefaultSubagentModel();
314892
315096
  if ((agentModelWithExp === "haiku" || agentModelWithExp === "sonnet") && !checkIsClaudeNativeProvider()) {
@@ -314922,6 +315126,12 @@ function aliasMatchesParentTier(alias, parentModel) {
314922
315126
  return false;
314923
315127
  }
314924
315128
  }
315129
+ function assertToolSpecifiedModelAllowed(requestedModel, effectiveModel) {
315130
+ if (isModelAllowed(requestedModel) || effectiveModel !== requestedModel && isModelAllowed(effectiveModel)) {
315131
+ return;
315132
+ }
315133
+ throw new Error(`Model '${requestedModel}' is not available. Your organization restricts model selection.`);
315134
+ }
314925
315135
  function checkIsClaudeNativeProvider() {
314926
315136
  const provider = getAPIProvider();
314927
315137
  return provider === "bedrock" || provider === "vertex" || provider === "foundry" || provider === "firstParty" && isFirstPartyAnthropicBaseUrl();
@@ -314962,6 +315172,7 @@ var init_agent = __esm(() => {
314962
315172
  init_stringUtils();
314963
315173
  init_aliases();
314964
315174
  init_bedrock2();
315175
+ init_modelAllowlist();
314965
315176
  init_model();
314966
315177
  init_providers();
314967
315178
  AGENT_MODEL_OPTIONS = [...MODEL_ALIASES, "inherit"];
@@ -366127,6 +366338,13 @@ function getGitHubReleaseAssetName(platform4) {
366127
366338
  function getCurlExecutable() {
366128
366339
  return process.platform === "win32" ? "curl.exe" : "curl";
366129
366340
  }
366341
+ function getNullOutputPath() {
366342
+ return process.platform === "win32" ? "NUL" : "/dev/null";
366343
+ }
366344
+ function parseReleaseVersionFromUrl(url3) {
366345
+ const match = url3.trim().match(/\/releases\/tag\/(v?\d+\.\d+\.\d+(?:-\S+)?)$/);
366346
+ return match ? normalizeReleaseVersion(match[1]) : null;
366347
+ }
366130
366348
  function shouldFallbackToCurl(error42) {
366131
366349
  const message = error42 instanceof Error ? error42.message : String(error42);
366132
366350
  if (axios_default.isAxiosError(error42)) {
@@ -366134,6 +366352,29 @@ function shouldFallbackToCurl(error42) {
366134
366352
  }
366135
366353
  return /EAI_AGAIN|ECONNRESET|ETIMEDOUT|ENOTFOUND|network|timeout/i.test(message);
366136
366354
  }
366355
+ async function getLatestVersionFromGitHubLatestRedirect() {
366356
+ const latestUrl = `${GITHUB_RELEASES_WEB_URL}/latest`;
366357
+ const { stdout, stderr, code, error: error42 } = await execFileNoThrowWithCwd(getCurlExecutable(), [
366358
+ "-L",
366359
+ "--silent",
366360
+ "--show-error",
366361
+ "--max-time",
366362
+ "30",
366363
+ "--output",
366364
+ getNullOutputPath(),
366365
+ "--write-out",
366366
+ "%{url_effective}",
366367
+ latestUrl
366368
+ ], {
366369
+ timeout: 35000,
366370
+ preserveOutputOnError: true
366371
+ });
366372
+ if (code !== 0) {
366373
+ logForDebugging(`GitHub latest redirect fallback failed: ${error42 || stderr || `curl exited with code ${code}`}`, { level: "warn" });
366374
+ return null;
366375
+ }
366376
+ return parseReleaseVersionFromUrl(stdout);
366377
+ }
366137
366378
  async function fetchJsonWithCurl(url3, timeoutMs) {
366138
366379
  const { stdout, stderr, code, error: error42 } = await execFileNoThrowWithCwd(getCurlExecutable(), [
366139
366380
  "-L",
@@ -366235,6 +366476,13 @@ async function getLatestVersionFromGitHubReleases2(channel = "latest") {
366235
366476
  });
366236
366477
  return normalizeReleaseVersion(tagName.trim());
366237
366478
  } catch (error42) {
366479
+ if (channel === "latest") {
366480
+ const fallbackVersion = await getLatestVersionFromGitHubLatestRedirect();
366481
+ if (fallbackVersion) {
366482
+ logForDebugging(`Resolved latest GitHub release via redirect fallback: ${fallbackVersion}`, { level: "warn" });
366483
+ return fallbackVersion;
366484
+ }
366485
+ }
366238
366486
  const latencyMs = Date.now() - startTime;
366239
366487
  const errorMessage2 = error42 instanceof Error ? error42.message : String(error42);
366240
366488
  let httpStatus;
@@ -366491,7 +366739,7 @@ async function downloadVersion(version2, stagingPath) {
366491
366739
  await downloadVersionFromGitHubRelease(version2, stagingPath);
366492
366740
  return "binary";
366493
366741
  }
366494
- var GITHUB_RELEASES_API_URL = "https://api.github.com/repos/AndersonBY/openclaude/releases", GITHUB_RELEASE_DOWNLOAD_BASE_URL = "https://github.com/AndersonBY/openclaude/releases/download", ARTIFACTORY_REGISTRY_URL, DEFAULT_STALL_TIMEOUT_MS = 60000, MAX_DOWNLOAD_RETRIES = 3, StallTimeoutError;
366742
+ var GITHUB_RELEASES_API_URL = "https://api.github.com/repos/AndersonBY/openclaude/releases", GITHUB_RELEASES_WEB_URL = "https://github.com/AndersonBY/openclaude/releases", GITHUB_RELEASE_DOWNLOAD_BASE_URL = "https://github.com/AndersonBY/openclaude/releases/download", ARTIFACTORY_REGISTRY_URL, DEFAULT_STALL_TIMEOUT_MS = 60000, MAX_DOWNLOAD_RETRIES = 3, StallTimeoutError;
366495
366743
  var init_download = __esm(() => {
366496
366744
  init_axios2();
366497
366745
  init_debug();
@@ -366800,6 +367048,9 @@ async function isPossibleClaudeBinary(filePath) {
366800
367048
  if (!stats.isFile() || stats.size === 0) {
366801
367049
  return false;
366802
367050
  }
367051
+ if (env2.platform === "win32") {
367052
+ return true;
367053
+ }
366803
367054
  await access2(filePath, fsConstants2.X_OK);
366804
367055
  return true;
366805
367056
  } catch {
@@ -367141,6 +367392,7 @@ async function updateSymlink(symlinkPath, targetPath) {
367141
367392
  await rename2(symlinkPath, oldFileName);
367142
367393
  try {
367143
367394
  await copyFile2(targetPath, symlinkPath);
367395
+ await chmod5(symlinkPath, 493);
367144
367396
  try {
367145
367397
  await unlink7(oldFileName);
367146
367398
  } catch {}
@@ -367157,6 +367409,7 @@ async function updateSymlink(symlinkPath, targetPath) {
367157
367409
  } else {
367158
367410
  try {
367159
367411
  await copyFile2(targetPath, symlinkPath);
367412
+ await chmod5(symlinkPath, 493);
367160
367413
  } catch (e) {
367161
367414
  if (isENOENT(e)) {
367162
367415
  throw new Error(`Source file does not exist: ${targetPath}`);
@@ -370489,6 +370742,7 @@ function useCodexOAuthFlow(options2) {
370489
370742
  if (!saved.success) {
370490
370743
  throw new Error(saved.warning ?? "Codex OAuth succeeded, but credentials could not be saved securely.");
370491
370744
  }
370745
+ return { warning: saved.warning };
370492
370746
  };
370493
370747
  await onAuthenticated(tokens, persistCredentials);
370494
370748
  }).catch((error42) => {
@@ -371304,12 +371558,16 @@ function ProviderManager({ mode, onDone }) {
371304
371558
  function clearStartupProviderOverrideFromUserSettings() {
371305
371559
  return clearStartupProviderOverrides();
371306
371560
  }
371561
+ function formatWarningsForMessage(warnings) {
371562
+ const joined = warnings.join("; ");
371563
+ return /[.!?]$/.test(joined.trim()) ? joined : `${joined}.`;
371564
+ }
371307
371565
  function buildCodexOAuthActivationMessage(options2) {
371308
371566
  if (options2.activationWarning) {
371309
- return `${options2.prefix}. Saved for next startup. Warning: ${options2.warnings.join("; ")}.`;
371567
+ return `${options2.prefix}. Saved for next startup. Warning: ${formatWarningsForMessage(options2.warnings)}`;
371310
371568
  }
371311
371569
  if (options2.warnings.length > 0) {
371312
- return `${options2.prefix}. OpenClaude switched to it for this session with warnings: ${options2.warnings.join("; ")}.`;
371570
+ return `${options2.prefix}. OpenClaude switched to it for this session with warnings: ${formatWarningsForMessage(options2.warnings)}`;
371313
371571
  }
371314
371572
  return `${options2.prefix}. OpenClaude switched to it for this session.`;
371315
371573
  }
@@ -372528,13 +372786,17 @@ function ProviderManager({ mode, onDone }) {
372528
372786
  returnToMenu();
372529
372787
  return;
372530
372788
  }
372531
- persistCredentials({ profileId: saved.id });
372789
+ const persistenceResult = persistCredentials({
372790
+ profileId: saved.id
372791
+ });
372792
+ const storageWarning = persistenceResult && typeof persistenceResult === "object" ? persistenceResult.warning : null;
372532
372793
  const settingsOverrideError = clearStartupProviderOverrideFromUserSettings();
372533
372794
  const activationWarning = await activateCodexOAuthSession(tokens);
372534
372795
  setHasStoredCodexOAuthCredentials(true);
372535
372796
  setStoredCodexOAuthProfileId(saved.id);
372536
372797
  refreshProfiles();
372537
372798
  const warnings = [
372799
+ storageWarning,
372538
372800
  activationWarning,
372539
372801
  settingsOverrideError ? `could not clear startup provider override (${settingsOverrideError})` : null
372540
372802
  ].filter((warning) => Boolean(warning));
@@ -406271,6 +406533,7 @@ function getDisableExtglobCommand(shellPath) {
406271
406533
  }
406272
406534
  async function createBashShellProvider(shellPath, options2) {
406273
406535
  let currentSandboxTmpDir;
406536
+ const skipSnapshot = options2?.skipSnapshot === true;
406274
406537
  const snapshotPromise = options2?.skipSnapshot ? Promise.resolve(undefined) : createAndSaveSnapshot(shellPath).catch((error42) => {
406275
406538
  logForDebugging(`Failed to create shell snapshot: ${error42}`);
406276
406539
  return;
@@ -406326,7 +406589,7 @@ async function createBashShellProvider(shellPath, options2) {
406326
406589
  return { commandString, cwdFilePath };
406327
406590
  },
406328
406591
  getSpawnArgs(commandString) {
406329
- const skipLoginShell = lastSnapshotFilePath !== undefined;
406592
+ const skipLoginShell = skipSnapshot || lastSnapshotFilePath !== undefined;
406330
406593
  if (skipLoginShell) {
406331
406594
  logForDebugging("Spawning shell without login (-l flag skipped)");
406332
406595
  }
@@ -406511,6 +406774,9 @@ async function findSuitableShell() {
406511
406774
  logForDebugging(`CLAUDE_CODE_SHELL="${shellOverride}" is not a valid bash/zsh path, falling back to detection`);
406512
406775
  }
406513
406776
  }
406777
+ if (getPlatform() === "windows") {
406778
+ return findGitBashPath();
406779
+ }
406514
406780
  const env_shell = process.env.SHELL;
406515
406781
  const isEnvShellSupported = env_shell && (env_shell.includes("bash") || env_shell.includes("zsh"));
406516
406782
  const preferBash = env_shell?.includes("bash");
@@ -406542,7 +406808,9 @@ async function findSuitableShell() {
406542
406808
  }
406543
406809
  async function getShellConfigImpl() {
406544
406810
  const binShell = await findSuitableShell();
406545
- const provider = await createBashShellProvider(binShell);
406811
+ const provider = await createBashShellProvider(binShell, {
406812
+ skipSnapshot: false
406813
+ });
406546
406814
  return { provider };
406547
406815
  }
406548
406816
  async function exec3(command, abortSignal, shellType, options2) {
@@ -460350,7 +460618,7 @@ var init_AgentTool = __esm(() => {
460350
460618
  description: exports_external.string().describe("A short (3-5 word) description of the task"),
460351
460619
  prompt: exports_external.string().describe("The task for the agent to perform"),
460352
460620
  subagent_type: exports_external.string().optional().describe("The type of specialized agent to use for this task"),
460353
- model: exports_external.enum(["sonnet", "opus", "haiku"]).optional().describe("Optional model override for this agent. Takes precedence over the agent definition's model frontmatter. If omitted, uses the agent definition's model, or inherits from the parent."),
460621
+ model: exports_external.string().trim().min(1, "Model cannot be empty").optional().describe("Optional model override for this agent. Accepts aliases such as sonnet, opus, haiku, inherit, or a provider-supported model ID. Takes precedence over the agent definition's model frontmatter. If omitted, uses the agent definition's model, or inherits from the parent."),
460354
460622
  run_in_background: exports_external.boolean().optional().describe("Set to true to run this agent in the background. You will be notified when it completes.")
460355
460623
  }));
460356
460624
  fullInputSchema2 = lazySchema(() => {
@@ -460457,6 +460725,8 @@ var init_AgentTool = __esm(() => {
460457
460725
  if (agentDef?.color) {
460458
460726
  setAgentColor(subagent_type, agentDef.color);
460459
460727
  }
460728
+ const rawTeammateModel = model2 ?? agentDef?.model;
460729
+ const resolvedTeammateModel = rawTeammateModel === undefined ? undefined : getAgentModel(agentDef?.model, toolUseContext.options.mainLoopModel, model2, permissionMode);
460460
460730
  const result = await spawnTeammate({
460461
460731
  name,
460462
460732
  prompt,
@@ -460464,7 +460734,7 @@ var init_AgentTool = __esm(() => {
460464
460734
  team_name: teamName,
460465
460735
  use_splitpane: true,
460466
460736
  plan_mode_required: spawnMode === "plan",
460467
- model: model2 ?? agentDef?.model,
460737
+ model: resolvedTeammateModel,
460468
460738
  agent_type: subagent_type,
460469
460739
  invokingRequestId: assistantMessage2?.requestId
460470
460740
  }, toolUseContext);
@@ -464108,6 +464378,16 @@ function getAttributionTexts() {
464108
464378
  }
464109
464379
  return { commit: "", pr: "" };
464110
464380
  }
464381
+ const settings = getInitialSettings();
464382
+ if (settings.attribution) {
464383
+ return {
464384
+ commit: settings.attribution.commit ?? "",
464385
+ pr: settings.attribution.pr ?? ""
464386
+ };
464387
+ }
464388
+ if (settings.includeCoAuthoredBy !== true) {
464389
+ return { commit: "", pr: "" };
464390
+ }
464111
464391
  const model2 = getMainLoopModel();
464112
464392
  const apiProvider = getAPIProvider();
464113
464393
  const modelName = getDefaultCommitCoAuthorName({
@@ -464115,20 +464395,9 @@ function getAttributionTexts() {
464115
464395
  apiProvider,
464116
464396
  isInternalRepo: isInternalModelRepoCached()
464117
464397
  });
464118
- const defaultAttribution = "\uD83E\uDD16 Generated with [OpenClaude](https://github.com/AndersonBY/openclaude)";
464119
464398
  const coAuthorEmail = getDefaultCommitCoAuthorEmail(apiProvider);
464120
464399
  const defaultCommit = isEnvTruthy(process.env.OPENCLAUDE_DISABLE_CO_AUTHORED_BY) ? "" : `Co-Authored-By: ${modelName} <${coAuthorEmail}>`;
464121
- const settings = getInitialSettings();
464122
- if (settings.attribution) {
464123
- return {
464124
- commit: settings.attribution.commit ?? defaultCommit,
464125
- pr: settings.attribution.pr ?? defaultAttribution
464126
- };
464127
- }
464128
- if (settings.includeCoAuthoredBy === false) {
464129
- return { commit: "", pr: "" };
464130
- }
464131
- return { commit: defaultCommit, pr: defaultAttribution };
464400
+ return { commit: defaultCommit, pr: DEFAULT_PR_ATTRIBUTION };
464132
464401
  }
464133
464402
  function isTerminalOutput(content) {
464134
464403
  for (const tag2 of TERMINAL_OUTPUT_TAGS) {
@@ -464239,13 +464508,15 @@ async function getEnhancedPRAttribution(getAppState) {
464239
464508
  return "";
464240
464509
  }
464241
464510
  const settings = getInitialSettings();
464242
- if (settings.attribution?.pr) {
464511
+ if (settings.attribution?.pr !== undefined) {
464243
464512
  return settings.attribution.pr;
464244
464513
  }
464245
- if (settings.includeCoAuthoredBy === false) {
464514
+ if (settings.attribution) {
464515
+ return "";
464516
+ }
464517
+ if (settings.includeCoAuthoredBy !== true) {
464246
464518
  return "";
464247
464519
  }
464248
- const defaultAttribution = "\uD83E\uDD16 Generated with [OpenClaude](https://github.com/AndersonBY/openclaude)";
464249
464520
  const appState = getAppState();
464250
464521
  logForDebugging(`PR Attribution: appState.attribution exists: ${!!appState.attribution}`);
464251
464522
  if (appState.attribution) {
@@ -464265,7 +464536,7 @@ async function getEnhancedPRAttribution(getAppState) {
464265
464536
  const shortModelName = isInternal ? rawModelName : sanitizeModelName(rawModelName);
464266
464537
  if (claudePercent === 0 && promptCount === 0 && memoryAccessCount === 0) {
464267
464538
  logForDebugging("PR Attribution: returning default (no data)");
464268
- return defaultAttribution;
464539
+ return DEFAULT_PR_ATTRIBUTION;
464269
464540
  }
464270
464541
  const memSuffix = memoryAccessCount > 0 ? `, ${memoryAccessCount} ${memoryAccessCount === 1 ? "memory" : "memories"} recalled` : "";
464271
464542
  const summary = `\uD83E\uDD16 Generated with [OpenClaude](https://github.com/AndersonBY/openclaude) (${claudePercent}% ${promptCount}-shotted by ${shortModelName}${memSuffix})`;
@@ -464273,7 +464544,7 @@ async function getEnhancedPRAttribution(getAppState) {
464273
464544
  logForDebugging(`PR Attribution: returning summary: ${summary}`);
464274
464545
  return summary;
464275
464546
  }
464276
- var MEMORY_ACCESS_TOOL_NAMES;
464547
+ var DEFAULT_PR_ATTRIBUTION = "\uD83E\uDD16 Generated with [OpenClaude](https://github.com/AndersonBY/openclaude)", MEMORY_ACCESS_TOOL_NAMES;
464277
464548
  var init_attribution = __esm(() => {
464278
464549
  init_state();
464279
464550
  init_envUtils();
@@ -471762,7 +472033,7 @@ function getAnthropicEnvMetadata() {
471762
472033
  function getBuildAgeMinutes() {
471763
472034
  if (false)
471764
472035
  ;
471765
- const buildTime = new Date("2026-05-26T10:21:00.272Z").getTime();
472036
+ const buildTime = new Date("2026-05-27T07:41:16.072Z").getTime();
471766
472037
  if (isNaN(buildTime))
471767
472038
  return;
471768
472039
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -498247,7 +498518,7 @@ ${USAGE}` };
498247
498518
  return { type: "text", value: error42 };
498248
498519
  return {
498249
498520
  type: "text",
498250
- value: "Commit attribution reset to the OpenClaude default."
498521
+ value: "Commit attribution reset to the privacy-preserving default."
498251
498522
  };
498252
498523
  }
498253
498524
  case "set-attribution":
@@ -499901,7 +500172,7 @@ function buildPrimarySection() {
499901
500172
  }, undefined, false, undefined, this);
499902
500173
  return [{
499903
500174
  label: "Version",
499904
- value: "0.14.8"
500175
+ value: "0.15.0"
499905
500176
  }, {
499906
500177
  label: "Session name",
499907
500178
  value: nameValue
@@ -514796,7 +515067,7 @@ function getReleaseTagUrl(version2 = publicBuildVersion) {
514796
515067
  return `${OPENCLAUDE_RELEASES_URL}/tag/v${normalizePublicVersion(version2)}`;
514797
515068
  }
514798
515069
  function getPublicBuildVersion() {
514799
- return "0.14.8";
515070
+ return "0.15.0";
514800
515071
  }
514801
515072
  var import_semver9, OPENCLAUDE_RELEASES_URL = "https://github.com/AndersonBY/openclaude/releases", fallbackBuildVersion, publicBuildVersion;
514802
515073
  var init_version = __esm(() => {
@@ -538891,15 +539162,15 @@ var require_filter_parse = __commonJS((exports, module) => {
538891
539162
  }
538892
539163
  return byteWidth;
538893
539164
  }
538894
- var Filter = module.exports = function(bitmapInfo, dependencies) {
539165
+ var Filter = module.exports = function(bitmapInfo, dependencies2) {
538895
539166
  let width = bitmapInfo.width;
538896
539167
  let height = bitmapInfo.height;
538897
539168
  let interlace = bitmapInfo.interlace;
538898
539169
  let bpp = bitmapInfo.bpp;
538899
539170
  let depth = bitmapInfo.depth;
538900
- this.read = dependencies.read;
538901
- this.write = dependencies.write;
538902
- this.complete = dependencies.complete;
539171
+ this.read = dependencies2.read;
539172
+ this.write = dependencies2.write;
539173
+ this.complete = dependencies2.complete;
538903
539174
  this._imageIndex = 0;
538904
539175
  this._images = [];
538905
539176
  if (interlace) {
@@ -539106,7 +539377,7 @@ var require_crc = __commonJS((exports, module) => {
539106
539377
  var require_parser5 = __commonJS((exports, module) => {
539107
539378
  var constants5 = require_constants11();
539108
539379
  var CrcCalculator = require_crc();
539109
- var Parser2 = module.exports = function(options2, dependencies) {
539380
+ var Parser2 = module.exports = function(options2, dependencies2) {
539110
539381
  this._options = options2;
539111
539382
  options2.checkCRC = options2.checkCRC !== false;
539112
539383
  this._hasIHDR = false;
@@ -539121,17 +539392,17 @@ var require_parser5 = __commonJS((exports, module) => {
539121
539392
  this._chunks[constants5.TYPE_PLTE] = this._handlePLTE.bind(this);
539122
539393
  this._chunks[constants5.TYPE_tRNS] = this._handleTRNS.bind(this);
539123
539394
  this._chunks[constants5.TYPE_gAMA] = this._handleGAMA.bind(this);
539124
- this.read = dependencies.read;
539125
- this.error = dependencies.error;
539126
- this.metadata = dependencies.metadata;
539127
- this.gamma = dependencies.gamma;
539128
- this.transColor = dependencies.transColor;
539129
- this.palette = dependencies.palette;
539130
- this.parsed = dependencies.parsed;
539131
- this.inflateData = dependencies.inflateData;
539132
- this.finished = dependencies.finished;
539133
- this.simpleTransparency = dependencies.simpleTransparency;
539134
- this.headersFinished = dependencies.headersFinished || function() {};
539395
+ this.read = dependencies2.read;
539396
+ this.error = dependencies2.error;
539397
+ this.metadata = dependencies2.metadata;
539398
+ this.gamma = dependencies2.gamma;
539399
+ this.transColor = dependencies2.transColor;
539400
+ this.palette = dependencies2.palette;
539401
+ this.parsed = dependencies2.parsed;
539402
+ this.inflateData = dependencies2.inflateData;
539403
+ this.finished = dependencies2.finished;
539404
+ this.simpleTransparency = dependencies2.simpleTransparency;
539405
+ this.headersFinished = dependencies2.headersFinished || function() {};
539135
539406
  };
539136
539407
  Parser2.prototype.start = function() {
539137
539408
  this.read(constants5.PNG_SIGNATURE.length, this._parseSignature.bind(this));
@@ -566722,7 +566993,8 @@ function AgentsList(t0) {
566722
566993
  onBack,
566723
566994
  onSelect,
566724
566995
  onCreateNew,
566725
- changes
566996
+ changes,
566997
+ activeAgentName
566726
566998
  } = t0;
566727
566999
  const [selectedAgent, setSelectedAgent] = React105.useState(null);
566728
567000
  const [isCreateNewSelected, setIsCreateNewSelected] = React105.useState(true);
@@ -566756,81 +567028,83 @@ function AgentsList(t0) {
566756
567028
  t2 = $2[3];
566757
567029
  }
566758
567030
  const renderCreateNewOption = t2;
566759
- let t3;
566760
- if ($2[4] !== isCreateNewSelected || $2[5] !== selectedAgent?.agentType || $2[6] !== selectedAgent?.source) {
566761
- t3 = (agent_0) => {
566762
- const isBuiltIn = agent_0.source === "built-in";
566763
- const isSelected = !isBuiltIn && !isCreateNewSelected && selectedAgent?.agentType === agent_0.agentType && selectedAgent?.source === agent_0.source;
566764
- const {
566765
- isOverridden,
566766
- overriddenBy
566767
- } = getOverrideInfo(agent_0);
566768
- const dimmed = isBuiltIn || isOverridden;
566769
- const textColor = !isBuiltIn && isSelected ? "suggestion" : undefined;
566770
- const resolvedModel = resolveAgentModelDisplay(agent_0);
566771
- return /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedBox_default, {
566772
- children: [
566773
- /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
566774
- dimColor: dimmed && !isSelected,
566775
- color: textColor,
566776
- children: isBuiltIn ? "" : isSelected ? `${figures_default.pointer} ` : " "
566777
- }, undefined, false, undefined, this),
566778
- /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
566779
- dimColor: dimmed && !isSelected,
566780
- color: textColor,
566781
- children: agent_0.agentType
566782
- }, undefined, false, undefined, this),
566783
- resolvedModel && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
566784
- dimColor: true,
566785
- color: textColor,
566786
- children: [
566787
- " · ",
566788
- resolvedModel
566789
- ]
566790
- }, undefined, true, undefined, this),
566791
- agent_0.memory && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
566792
- dimColor: true,
566793
- color: textColor,
566794
- children: [
566795
- " · ",
566796
- agent_0.memory,
566797
- " memory"
566798
- ]
566799
- }, undefined, true, undefined, this),
566800
- overriddenBy && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
566801
- dimColor: !isSelected,
566802
- color: isSelected ? "warning" : undefined,
566803
- children: [
566804
- " ",
566805
- figures_default.warning,
566806
- " shadowed by ",
566807
- getOverrideSourceLabel(overriddenBy)
566808
- ]
566809
- }, undefined, true, undefined, this)
566810
- ]
566811
- }, `${agent_0.agentType}-${agent_0.source}`, true, undefined, this);
566812
- };
566813
- $2[4] = isCreateNewSelected;
566814
- $2[5] = selectedAgent?.agentType;
566815
- $2[6] = selectedAgent?.source;
566816
- $2[7] = t3;
566817
- } else {
566818
- t3 = $2[7];
566819
- }
566820
- const renderAgent = t3;
567031
+ const renderAgent = (agent_0) => {
567032
+ const isSelected = !isCreateNewSelected && selectedAgent?.agentType === agent_0.agentType && selectedAgent?.source === agent_0.source;
567033
+ const isActive = agent_0.agentType === activeAgentName && !agent_0.overriddenBy;
567034
+ const {
567035
+ isOverridden,
567036
+ overriddenBy
567037
+ } = getOverrideInfo(agent_0);
567038
+ const dimmed = agent_0.source === "built-in" || isOverridden;
567039
+ const textColor = isSelected ? "suggestion" : undefined;
567040
+ const resolvedModel = resolveAgentModelDisplay(agent_0);
567041
+ return /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedBox_default, {
567042
+ children: [
567043
+ /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567044
+ dimColor: dimmed && !isSelected,
567045
+ color: textColor,
567046
+ children: isSelected ? `${figures_default.pointer} ` : " "
567047
+ }, undefined, false, undefined, this),
567048
+ /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567049
+ dimColor: dimmed && !isSelected,
567050
+ color: textColor,
567051
+ children: agent_0.agentType
567052
+ }, undefined, false, undefined, this),
567053
+ resolvedModel && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567054
+ dimColor: true,
567055
+ color: textColor,
567056
+ children: [
567057
+ " · ",
567058
+ resolvedModel
567059
+ ]
567060
+ }, undefined, true, undefined, this),
567061
+ agent_0.memory && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567062
+ dimColor: true,
567063
+ color: textColor,
567064
+ children: [
567065
+ " · ",
567066
+ agent_0.memory,
567067
+ " memory"
567068
+ ]
567069
+ }, undefined, true, undefined, this),
567070
+ isActive && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567071
+ color: "success",
567072
+ children: [
567073
+ " ",
567074
+ figures_default.tick,
567075
+ " active"
567076
+ ]
567077
+ }, undefined, true, undefined, this),
567078
+ overriddenBy && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567079
+ dimColor: !isSelected,
567080
+ color: isSelected ? "warning" : undefined,
567081
+ children: [
567082
+ " ",
567083
+ figures_default.warning,
567084
+ " shadowed by ",
567085
+ getOverrideSourceLabel(overriddenBy)
567086
+ ]
567087
+ }, undefined, true, undefined, this)
567088
+ ]
567089
+ }, `${agent_0.agentType}-${agent_0.source}`, true, undefined, this);
567090
+ };
566821
567091
  let t4;
566822
567092
  if ($2[8] !== sortedAgents || $2[9] !== source) {
566823
567093
  bb0: {
566824
567094
  const nonBuiltIn = sortedAgents.filter(_temp263);
566825
567095
  if (source === "all") {
566826
- t4 = AGENT_SOURCE_GROUPS.filter(_temp339).flatMap((t52) => {
567096
+ t4 = AGENT_SOURCE_GROUPS.flatMap((t52) => {
566827
567097
  const {
566828
567098
  source: groupSource
566829
567099
  } = t52;
566830
- return nonBuiltIn.filter((a_0) => a_0.source === groupSource);
567100
+ return sortedAgents.filter((a_0) => a_0.source === groupSource);
566831
567101
  });
566832
567102
  break bb0;
566833
567103
  }
567104
+ if (source === "built-in") {
567105
+ t4 = sortedAgents;
567106
+ break bb0;
567107
+ }
566834
567108
  t4 = nonBuiltIn;
566835
567109
  }
566836
567110
  $2[8] = sortedAgents;
@@ -567065,29 +567339,30 @@ function AgentsList(t0) {
567065
567339
  } else {
567066
567340
  t27 = $2[64];
567067
567341
  }
567068
- let t28;
567069
- if ($2[65] !== handleKeyDown || $2[66] !== t233 || $2[67] !== t27) {
567070
- t28 = /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedBox_default, {
567071
- flexDirection: "column",
567072
- gap: 1,
567073
- tabIndex: 0,
567074
- autoFocus: true,
567075
- onKeyDown: handleKeyDown,
567076
- children: [
567077
- t233,
567078
- t242,
567079
- t25,
567080
- t26,
567081
- t27
567082
- ]
567083
- }, undefined, true, undefined, this);
567084
- $2[65] = handleKeyDown;
567085
- $2[66] = t233;
567086
- $2[67] = t27;
567087
- $2[68] = t28;
567088
- } else {
567089
- t28 = $2[68];
567090
- }
567342
+ const t28 = /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedBox_default, {
567343
+ flexDirection: "column",
567344
+ gap: 1,
567345
+ tabIndex: 0,
567346
+ autoFocus: true,
567347
+ onKeyDown: handleKeyDown,
567348
+ children: [
567349
+ /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567350
+ dimColor: true,
567351
+ children: [
567352
+ "Current session agent: ",
567353
+ /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567354
+ bold: true,
567355
+ children: activeAgentName ?? "none"
567356
+ }, undefined, false, undefined, this)
567357
+ ]
567358
+ }, undefined, true, undefined, this),
567359
+ t233,
567360
+ t242,
567361
+ t25,
567362
+ t26,
567363
+ t27
567364
+ ]
567365
+ }, undefined, true, undefined, this);
567091
567366
  let t29;
567092
567367
  if ($2[69] !== onBack || $2[70] !== sourceTitle || $2[71] !== t28) {
567093
567368
  t29 = /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(Dialog, {
@@ -567120,19 +567395,27 @@ function AgentsList(t0) {
567120
567395
  t18 = `${t232} agents`;
567121
567396
  t19 = onBack;
567122
567397
  t20 = true;
567123
- if ($2[75] !== changes) {
567124
- t21 = changes && changes.length > 0 && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedBox_default, {
567125
- marginTop: 1,
567126
- children: /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567398
+ t21 = /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(jsx_dev_runtime318.Fragment, {
567399
+ children: [
567400
+ /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567127
567401
  dimColor: true,
567128
- children: changes[changes.length - 1]
567402
+ children: [
567403
+ "Current session agent: ",
567404
+ /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567405
+ bold: true,
567406
+ children: activeAgentName ?? "none"
567407
+ }, undefined, false, undefined, this)
567408
+ ]
567409
+ }, undefined, true, undefined, this),
567410
+ changes && changes.length > 0 && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedBox_default, {
567411
+ marginTop: 1,
567412
+ children: /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567413
+ dimColor: true,
567414
+ children: changes[changes.length - 1]
567415
+ }, undefined, false, undefined, this)
567129
567416
  }, undefined, false, undefined, this)
567130
- }, undefined, false, undefined, this);
567131
- $2[75] = changes;
567132
- $2[76] = t21;
567133
- } else {
567134
- t21 = $2[76];
567135
- }
567417
+ ]
567418
+ }, undefined, true, undefined, this);
567136
567419
  T0 = ThemedBox_default;
567137
567420
  t11 = "column";
567138
567421
  t12 = 0;
@@ -567320,9 +567603,6 @@ function _temp522(a_3) {
567320
567603
  function _temp430(a_2) {
567321
567604
  return a_2.source === "built-in";
567322
567605
  }
567323
- function _temp339(g) {
567324
- return g.source !== "built-in";
567325
- }
567326
567606
  function _temp263(a2) {
567327
567607
  return a2.source !== "built-in";
567328
567608
  }
@@ -567430,7 +567710,7 @@ function WizardProvider(t0) {
567430
567710
  }
567431
567711
  } else {
567432
567712
  if (currentStepIndex > 0) {
567433
- setCurrentStepIndex(_temp340);
567713
+ setCurrentStepIndex(_temp339);
567434
567714
  } else {
567435
567715
  if (onCancel) {
567436
567716
  onCancel();
@@ -567544,7 +567824,7 @@ function WizardProvider(t0) {
567544
567824
  }
567545
567825
  return t14;
567546
567826
  }
567547
- function _temp340(prev_2) {
567827
+ function _temp339(prev_2) {
567548
567828
  return prev_2 - 1;
567549
567829
  }
567550
567830
  function _temp264(prev_1) {
@@ -568220,7 +568500,7 @@ function ConfirmStep(t0) {
568220
568500
  color: "error",
568221
568501
  children: "Errors:"
568222
568502
  }, undefined, false, undefined, this),
568223
- validation.errors.map(_temp341)
568503
+ validation.errors.map(_temp340)
568224
568504
  ]
568225
568505
  }, undefined, true, undefined, this);
568226
568506
  $2[4] = agent2;
@@ -568388,7 +568668,7 @@ function ConfirmStep(t0) {
568388
568668
  }
568389
568669
  return t25;
568390
568670
  }
568391
- function _temp341(err2, i_0) {
568671
+ function _temp340(err2, i_0) {
568392
568672
  return /* @__PURE__ */ jsx_dev_runtime323.jsxDEV(ThemedText, {
568393
568673
  color: "error",
568394
568674
  children: [
@@ -570020,11 +570300,13 @@ function AgentsMenu(t0) {
570020
570300
  const $2 = import_react_compiler_runtime252.c(157);
570021
570301
  const {
570022
570302
  tools,
570023
- onExit: onExit2
570303
+ onExit: onExit2,
570304
+ onSetActiveAgent,
570305
+ initialModeState
570024
570306
  } = t0;
570025
570307
  let t1;
570026
570308
  if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
570027
- t1 = {
570309
+ t1 = initialModeState ?? {
570028
570310
  mode: "list-agents",
570029
570311
  source: "all"
570030
570312
  };
@@ -570035,7 +570317,8 @@ function AgentsMenu(t0) {
570035
570317
  const [modeState, setModeState] = import_react182.useState(t1);
570036
570318
  const agentDefinitions = useAppState(_temp147);
570037
570319
  const mcpTools = useAppState(_temp266);
570038
- const toolPermissionContext = useAppState(_temp342);
570320
+ const toolPermissionContext = useAppState(_temp341);
570321
+ const activeAgentName = useAppState((s) => s.agent);
570039
570322
  const setAppState = useSetAppState();
570040
570323
  const {
570041
570324
  allAgents,
@@ -570238,25 +570521,15 @@ ${changes.join(`
570238
570521
  } else {
570239
570522
  t17 = $2[39];
570240
570523
  }
570241
- let t18;
570242
- if ($2[40] !== changes || $2[41] !== modeState.source || $2[42] !== resolvedAgents || $2[43] !== t15 || $2[44] !== t16) {
570243
- t18 = /* @__PURE__ */ jsx_dev_runtime335.jsxDEV(AgentsList, {
570244
- source: modeState.source,
570245
- agents: resolvedAgents,
570246
- onBack: t15,
570247
- onSelect: t16,
570248
- onCreateNew: t17,
570249
- changes
570250
- }, undefined, false, undefined, this);
570251
- $2[40] = changes;
570252
- $2[41] = modeState.source;
570253
- $2[42] = resolvedAgents;
570254
- $2[43] = t15;
570255
- $2[44] = t16;
570256
- $2[45] = t18;
570257
- } else {
570258
- t18 = $2[45];
570259
- }
570524
+ const t18 = /* @__PURE__ */ jsx_dev_runtime335.jsxDEV(AgentsList, {
570525
+ source: modeState.source,
570526
+ agents: resolvedAgents,
570527
+ onBack: t15,
570528
+ onSelect: t16,
570529
+ onCreateNew: t17,
570530
+ changes,
570531
+ activeAgentName
570532
+ }, undefined, false, undefined, this);
570260
570533
  let t19;
570261
570534
  if ($2[46] === Symbol.for("react.memo_cache_sentinel")) {
570262
570535
  t19 = /* @__PURE__ */ jsx_dev_runtime335.jsxDEV(AgentNavigationFooter, {}, undefined, false, undefined, this);
@@ -570309,16 +570582,16 @@ ${changes.join(`
570309
570582
  case "agent-menu": {
570310
570583
  let t13;
570311
570584
  if ($2[53] !== allAgents || $2[54] !== modeState.agent.agentType || $2[55] !== modeState.agent.source) {
570312
- let t142;
570585
+ let t14;
570313
570586
  if ($2[57] !== modeState.agent.agentType || $2[58] !== modeState.agent.source) {
570314
- t142 = (a_9) => a_9.agentType === modeState.agent.agentType && a_9.source === modeState.agent.source;
570587
+ t14 = (a_9) => a_9.agentType === modeState.agent.agentType && a_9.source === modeState.agent.source;
570315
570588
  $2[57] = modeState.agent.agentType;
570316
570589
  $2[58] = modeState.agent.source;
570317
- $2[59] = t142;
570590
+ $2[59] = t14;
570318
570591
  } else {
570319
- t142 = $2[59];
570592
+ t14 = $2[59];
570320
570593
  }
570321
- t13 = allAgents.find(t142);
570594
+ t13 = allAgents.find(t14);
570322
570595
  $2[53] = allAgents;
570323
570596
  $2[54] = modeState.agent.agentType;
570324
570597
  $2[55] = modeState.agent.source;
@@ -570329,90 +570602,71 @@ ${changes.join(`
570329
570602
  const freshAgent_1 = t13;
570330
570603
  const agentToUse = freshAgent_1 || modeState.agent;
570331
570604
  const isEditable = agentToUse.source !== "built-in" && agentToUse.source !== "plugin" && agentToUse.source !== "flagSettings";
570332
- let t14;
570333
- if ($2[60] === Symbol.for("react.memo_cache_sentinel")) {
570334
- t14 = {
570335
- label: "View agent",
570336
- value: "view"
570337
- };
570338
- $2[60] = t14;
570339
- } else {
570340
- t14 = $2[60];
570341
- }
570342
- let t15;
570343
- if ($2[61] !== isEditable) {
570344
- t15 = isEditable ? [{
570345
- label: "Edit agent",
570346
- value: "edit"
570347
- }, {
570348
- label: "Delete agent",
570349
- value: "delete"
570350
- }] : [];
570351
- $2[61] = isEditable;
570352
- $2[62] = t15;
570353
- } else {
570354
- t15 = $2[62];
570355
- }
570356
- let t16;
570357
- if ($2[63] === Symbol.for("react.memo_cache_sentinel")) {
570358
- t16 = {
570359
- label: "Back",
570360
- value: "back"
570361
- };
570362
- $2[63] = t16;
570363
- } else {
570364
- t16 = $2[63];
570365
- }
570366
- let t17;
570367
- if ($2[64] !== t15) {
570368
- t17 = [t14, ...t15, t16];
570369
- $2[64] = t15;
570370
- $2[65] = t17;
570371
- } else {
570372
- t17 = $2[65];
570373
- }
570374
- const menuItems = t17;
570375
- let t18;
570376
- if ($2[66] !== agentToUse || $2[67] !== modeState) {
570377
- t18 = (value_0) => {
570378
- bb129:
570379
- switch (value_0) {
570380
- case "view": {
570381
- setModeState({
570382
- mode: "view-agent",
570383
- agent: agentToUse,
570384
- previousMode: modeState.previousMode
570385
- });
570386
- break bb129;
570387
- }
570388
- case "edit": {
570389
- setModeState({
570390
- mode: "edit-agent",
570391
- agent: agentToUse,
570392
- previousMode: modeState
570393
- });
570394
- break bb129;
570395
- }
570396
- case "delete": {
570397
- setModeState({
570398
- mode: "delete-confirm",
570399
- agent: agentToUse,
570400
- previousMode: modeState
570401
- });
570402
- break bb129;
570403
- }
570404
- case "back": {
570405
- setModeState(modeState.previousMode);
570406
- }
570605
+ const isActiveAgent = agentToUse.agentType === activeAgentName;
570606
+ const sessionAgentToUse = agents.find((a_10) => a_10.agentType === agentToUse.agentType) ?? agentToUse;
570607
+ const editableItems = isEditable ? [{
570608
+ label: "Edit agent",
570609
+ value: "edit"
570610
+ }, {
570611
+ label: "Delete agent",
570612
+ value: "delete"
570613
+ }] : [];
570614
+ const activeAgentItems = isActiveAgent ? [{
570615
+ label: "Active agent",
570616
+ value: "active-agent",
570617
+ disabled: true
570618
+ }] : onSetActiveAgent ? [{
570619
+ label: "Set as active agent",
570620
+ value: "set-active"
570621
+ }] : [];
570622
+ const menuItems = [{
570623
+ label: "View agent",
570624
+ value: "view"
570625
+ }, ...activeAgentItems, ...editableItems, {
570626
+ label: "Back",
570627
+ value: "back"
570628
+ }];
570629
+ const handleMenuSelect = (value_0) => {
570630
+ bb129:
570631
+ switch (value_0) {
570632
+ case "view": {
570633
+ setModeState({
570634
+ mode: "view-agent",
570635
+ agent: agentToUse,
570636
+ previousMode: modeState.previousMode
570637
+ });
570638
+ break bb129;
570639
+ }
570640
+ case "set-active": {
570641
+ onSetActiveAgent?.(sessionAgentToUse);
570642
+ setChanges((prev) => [...prev, `Active session agent set to: ${source_default.bold(sessionAgentToUse.agentType)}`]);
570643
+ setModeState({
570644
+ mode: "list-agents",
570645
+ source: "all"
570646
+ });
570647
+ break bb129;
570407
570648
  }
570408
- };
570409
- $2[66] = agentToUse;
570410
- $2[67] = modeState;
570411
- $2[68] = t18;
570412
- } else {
570413
- t18 = $2[68];
570414
- }
570415
- const handleMenuSelect = t18;
570649
+ case "edit": {
570650
+ setModeState({
570651
+ mode: "edit-agent",
570652
+ agent: agentToUse,
570653
+ previousMode: modeState
570654
+ });
570655
+ break bb129;
570656
+ }
570657
+ case "delete": {
570658
+ setModeState({
570659
+ mode: "delete-confirm",
570660
+ agent: agentToUse,
570661
+ previousMode: modeState
570662
+ });
570663
+ break bb129;
570664
+ }
570665
+ case "back": {
570666
+ setModeState(modeState.previousMode);
570667
+ }
570668
+ }
570669
+ };
570416
570670
  let t19;
570417
570671
  if ($2[69] !== modeState.previousMode) {
570418
570672
  t19 = () => setModeState(modeState.previousMode);
@@ -570884,7 +571138,7 @@ function _temp523(a_0) {
570884
571138
  function _temp431(a2) {
570885
571139
  return a2.source === "built-in";
570886
571140
  }
570887
- function _temp342(s_1) {
571141
+ function _temp341(s_1) {
570888
571142
  return s_1.toolPermissionContext;
570889
571143
  }
570890
571144
  function _temp266(s_0) {
@@ -570928,7 +571182,8 @@ async function call60(onDone, context2) {
570928
571182
  const tools = getTools(permissionContext);
570929
571183
  return /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(AgentsMenu, {
570930
571184
  tools,
570931
- onExit: onDone
571185
+ onExit: onDone,
571186
+ onSetActiveAgent: context2.setActiveSessionAgent
570932
571187
  }, undefined, false, undefined, this);
570933
571188
  }
570934
571189
  var jsx_dev_runtime336;
@@ -571809,7 +572064,7 @@ var init_bridge_kick = __esm(() => {
571809
572064
  var call66 = async () => {
571810
572065
  return {
571811
572066
  type: "text",
571812
- value: `${"99.0.0"} (built ${"2026-05-26T10:21:00.272Z"})`
572067
+ value: `${"99.0.0"} (built ${"2026-05-27T07:41:16.072Z"})`
571813
572068
  };
571814
572069
  }, version2, version_default;
571815
572070
  var init_version2 = __esm(() => {
@@ -572571,7 +572826,7 @@ function SandboxDependenciesTab(t0) {
572571
572826
  const bwrapMissing = t3;
572572
572827
  let t4;
572573
572828
  if ($2[5] !== depCheck.errors) {
572574
- t4 = depCheck.errors.some(_temp343);
572829
+ t4 = depCheck.errors.some(_temp342);
572575
572830
  $2[5] = depCheck.errors;
572576
572831
  $2[6] = t4;
572577
572832
  } else {
@@ -572789,7 +573044,7 @@ function _temp524(err2) {
572789
573044
  function _temp432(e_2) {
572790
573045
  return !e_2.includes("ripgrep") && !e_2.includes("bwrap") && !e_2.includes("socat");
572791
573046
  }
572792
- function _temp343(e_1) {
573047
+ function _temp342(e_1) {
572793
573048
  return e_1.includes("socat");
572794
573049
  }
572795
573050
  function _temp267(e_0) {
@@ -573904,7 +574159,7 @@ function ClaudeInChromeMenu(t0) {
573904
574159
  bb22:
573905
574160
  switch (action2) {
573906
574161
  case "install-extension": {
573907
- setSelectKey(_temp344);
574162
+ setSelectKey(_temp343);
573908
574163
  setShowInstallHint(true);
573909
574164
  openUrl(CHROME_EXTENSION_URL);
573910
574165
  break bb22;
@@ -574208,7 +574463,7 @@ function _temp525(k) {
574208
574463
  function _temp433(k_0) {
574209
574464
  return k_0 + 1;
574210
574465
  }
574211
- function _temp344(k_1) {
574466
+ function _temp343(k_1) {
574212
574467
  return k_1 + 1;
574213
574468
  }
574214
574469
  function _temp268(c6) {
@@ -575434,6 +575689,7 @@ async function streamRenderedMessages(messages, tools, sink, {
575434
575689
  screen: "prompt",
575435
575690
  streamingToolUses: [],
575436
575691
  showAllInTranscript: true,
575692
+ hideLogo: true,
575437
575693
  isLoading: false,
575438
575694
  renderRange: range
575439
575695
  }, undefined, false, undefined, this)
@@ -576324,6 +576580,7 @@ var init_openaiModelDiscovery = __esm(() => {
576324
576580
  var exports_model2 = {};
576325
576581
  __export(exports_model2, {
576326
576582
  shouldAutoRefreshRouteCatalog: () => shouldAutoRefreshRouteCatalog,
576583
+ mergeActiveProfileModelOptions: () => mergeActiveProfileModelOptions,
576327
576584
  call: () => call74
576328
576585
  });
576329
576586
  function renderModelLabel(model2) {
@@ -576339,6 +576596,37 @@ function haveSameModelOptions(left, right) {
576339
576596
  return other2 !== undefined && option.value === other2.value && option.label === other2.label && option.description === other2.description && option.descriptionForModel === other2.descriptionForModel;
576340
576597
  });
576341
576598
  }
576599
+ function mergeActiveProfileModelOptions(routeId, routeOptions) {
576600
+ const activeProfile = getActiveProviderProfile();
576601
+ if (!activeProfile) {
576602
+ return routeOptions;
576603
+ }
576604
+ const profileEnvApplied = process.env.CLAUDE_CODE_PROVIDER_PROFILE_ENV_APPLIED === "1" && process.env.CLAUDE_CODE_PROVIDER_PROFILE_ENV_APPLIED_ID === activeProfile.id;
576605
+ const activeProfileRouteId = resolveRouteIdFromBaseUrl(activeProfile.baseUrl) ?? resolveProfileRoute(activeProfile.provider).routeId;
576606
+ if (!profileEnvApplied || activeProfileRouteId !== routeId) {
576607
+ return routeOptions;
576608
+ }
576609
+ const profileOptions = getProfileModelOptions(activeProfile);
576610
+ if (profileOptions.length === 0) {
576611
+ return routeOptions;
576612
+ }
576613
+ const routeOptionsByValue = new Map(routeOptions.flatMap((option) => {
576614
+ const value = typeof option.value === "string" ? option.value.trim().toLowerCase() : "";
576615
+ return value ? [[value, option]] : [];
576616
+ }));
576617
+ const merged = [];
576618
+ const seen = new Set;
576619
+ for (const option of profileOptions) {
576620
+ const value = typeof option.value === "string" ? option.value.trim() : "";
576621
+ const key = value.toLowerCase();
576622
+ if (!value || seen.has(key)) {
576623
+ continue;
576624
+ }
576625
+ seen.add(key);
576626
+ merged.push(routeOptionsByValue.get(key) ?? option);
576627
+ }
576628
+ return merged;
576629
+ }
576342
576630
  function getActiveRouteId() {
576343
576631
  const activeProfile = getActiveProviderProfile();
576344
576632
  return resolveActiveRouteIdFromEnv(process.env, {
@@ -576392,11 +576680,12 @@ async function loadDescriptorDiscoveryContext(routeId) {
576392
576680
  if (staticEntries.length === 0) {
576393
576681
  return null;
576394
576682
  }
576683
+ const routeOptions2 = buildRouteCatalogModelOptions(routeLabel, staticEntries, routeDefaultModel);
576395
576684
  return {
576396
576685
  kind: "descriptor",
576397
576686
  autoRefresh: false,
576398
576687
  canRefresh,
576399
- optionsOverride: buildRouteCatalogModelOptions(routeLabel, staticEntries, routeDefaultModel),
576688
+ optionsOverride: mergeActiveProfileModelOptions(routeId, routeOptions2),
576400
576689
  routeId,
576401
576690
  routeDefaultModel,
576402
576691
  routeLabel
@@ -576426,12 +576715,13 @@ async function loadDescriptorDiscoveryContext(routeId) {
576426
576715
  tone: "info"
576427
576716
  };
576428
576717
  }
576718
+ const routeOptions = buildRouteCatalogModelOptions(routeLabel, mergedEntries, routeDefaultModel);
576429
576719
  return {
576430
576720
  kind: "descriptor",
576431
576721
  autoRefresh,
576432
576722
  canRefresh,
576433
576723
  discoveryState,
576434
- optionsOverride: buildRouteCatalogModelOptions(routeLabel, mergedEntries, routeDefaultModel),
576724
+ optionsOverride: mergeActiveProfileModelOptions(routeId, routeOptions),
576435
576725
  routeId,
576436
576726
  routeDefaultModel,
576437
576727
  routeLabel
@@ -576577,7 +576867,7 @@ function ModelPickerWrapper({
576577
576867
  ...getOpenAIDiscoveryRequestOptions(discoveryContext.routeId),
576578
576868
  forceRefresh: true
576579
576869
  });
576580
- const nextOptions = buildRouteCatalogModelOptions(discoveryContext.routeLabel, result?.models ?? [], discoveryContext.routeDefaultModel);
576870
+ const nextOptions = mergeActiveProfileModelOptions(discoveryContext.routeId, buildRouteCatalogModelOptions(discoveryContext.routeLabel, result?.models ?? [], discoveryContext.routeDefaultModel));
576581
576871
  const changed = !haveSameModelOptions(optionsOverride ?? [], nextOptions);
576582
576872
  setOptionsOverride(nextOptions);
576583
576873
  setDiscoveryState(descriptorDiscoveryStateForResult({
@@ -576753,7 +577043,7 @@ async function refreshModelsAndSummarize() {
576753
577043
  ...getOpenAIDiscoveryRequestOptions(discoveryContext.routeId),
576754
577044
  forceRefresh: true
576755
577045
  });
576756
- const nextOptions = buildRouteCatalogModelOptions(discoveryContext.routeLabel, result?.models ?? [], discoveryContext.routeDefaultModel);
577046
+ const nextOptions = mergeActiveProfileModelOptions(discoveryContext.routeId, buildRouteCatalogModelOptions(discoveryContext.routeLabel, result?.models ?? [], discoveryContext.routeDefaultModel));
576757
577047
  const changed = !haveSameModelOptions(discoveryContext.optionsOverride, nextOptions);
576758
577048
  return descriptorDiscoveryStateForResult({
576759
577049
  changed,
@@ -576827,6 +577117,7 @@ var init_model2 = __esm(() => {
576827
577117
  init_discoveryCache();
576828
577118
  init_discoveryService();
576829
577119
  init_routeMetadata();
577120
+ init_profileResolver();
576830
577121
  init_providerConfig();
576831
577122
  init_AppState();
576832
577123
  init_extraUsage();
@@ -596547,15 +596838,15 @@ ${deferredToolList}
596547
596838
  }
596548
596839
  }
596549
596840
  const maxOutputTokens2 = retryContext?.maxTokensOverride || options2.maxOutputTokensOverride || getMaxOutputTokensForModel(options2.model);
596550
- const hasThinking = thinkingConfig.type !== "disabled" && !isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_THINKING);
596841
+ const hasThinking = shouldUseThinkingForModel(retryContext.model, thinkingConfig);
596551
596842
  let thinking = undefined;
596552
- if (hasThinking && modelSupportsThinking(options2.model)) {
596553
- if (!isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING) && modelSupportsAdaptiveThinking(options2.model)) {
596843
+ if (hasThinking) {
596844
+ if (!isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING) && modelSupportsAdaptiveThinking(retryContext.model)) {
596554
596845
  thinking = {
596555
596846
  type: "adaptive"
596556
596847
  };
596557
596848
  } else {
596558
- let thinkingBudget = getMaxThinkingTokensForModel(options2.model);
596849
+ let thinkingBudget = getMaxThinkingTokensForModel(retryContext.model);
596559
596850
  if (thinkingConfig.type === "enabled" && thinkingConfig.budgetTokens !== undefined) {
596560
596851
  thinkingBudget = thinkingConfig.budgetTokens;
596561
596852
  }
@@ -599320,6 +599611,9 @@ function preconnectAnthropicApi() {
599320
599611
  if (fired)
599321
599612
  return;
599322
599613
  fired = true;
599614
+ if (isEnvTruthy(process.env.CLAUDE_CODE_USE_OPENAI) || isEnvTruthy(process.env.CLAUDE_CODE_USE_GEMINI) || isEnvTruthy(process.env.CLAUDE_CODE_USE_GITHUB) || isEnvTruthy(process.env.CLAUDE_CODE_USE_MISTRAL)) {
599615
+ return;
599616
+ }
599323
599617
  if (getAPIProvider() !== "firstParty") {
599324
599618
  return;
599325
599619
  }
@@ -602140,8 +602434,8 @@ var init_types15 = __esm(() => {
602140
602434
  attribution: exports_external.object({
602141
602435
  commit: exports_external.string().optional().describe("Attribution text for git commits, including any trailers. " + "Empty string hides attribution."),
602142
602436
  pr: exports_external.string().optional().describe("Attribution text for pull request descriptions. " + "Empty string hides attribution.")
602143
- }).optional().describe("Customize attribution text for commits and PRs. " + "Each field defaults to the standard Claude Code attribution if not set."),
602144
- includeCoAuthoredBy: exports_external.boolean().optional().describe("Deprecated: Use attribution instead. " + "Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)"),
602437
+ }).optional().describe("Customize attribution text for commits and PRs. " + "Unspecified fields are off by default; set a non-empty string to opt in."),
602438
+ includeCoAuthoredBy: exports_external.boolean().optional().describe("Deprecated: Use attribution instead. " + "Whether to include Claude's co-authored by attribution in commits and PRs (defaults to false)"),
602145
602439
  includeGitInstructions: exports_external.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),
602146
602440
  permissions: PermissionsSchema().optional().describe("Tool usage permissions configuration"),
602147
602441
  model: exports_external.string().optional().describe("Override the default model used by Claude Code"),
@@ -604267,7 +604561,7 @@ function printStartupScreen(modelOverride) {
604267
604561
  const sLen = ` ● ${sL} Ready — type /help to begin`.length;
604268
604562
  out.push(boxRow(sRow, W2, sLen, BORDER));
604269
604563
  out.push(`${ansiRgb(...BORDER)}╚${"═".repeat(W2 - 2)}╝${RESET2}`);
604270
- out.push(` ${DIM2}${ansiRgb(...DIMCOL)}openclaude ${RESET2}${ansiRgb(...ACCENT)}v${"0.14.8"}${RESET2}`);
604564
+ out.push(` ${DIM2}${ansiRgb(...DIMCOL)}openclaude ${RESET2}${ansiRgb(...ACCENT)}v${"0.15.0"}${RESET2}`);
604271
604565
  out.push("");
604272
604566
  process.stdout.write(out.join(`
604273
604567
  `) + `
@@ -609039,7 +609333,7 @@ function QuestionNavigationBar(t0) {
609039
609333
  }
609040
609334
  const tabHeaders = questions.map(_temp157);
609041
609335
  const idealWidths = tabHeaders.map(_temp269);
609042
- const totalIdealWidth = idealWidths.reduce(_temp345, 0);
609336
+ const totalIdealWidth = idealWidths.reduce(_temp344, 0);
609043
609337
  if (totalIdealWidth <= availableForTabs) {
609044
609338
  t2 = tabHeaders;
609045
609339
  break bb0;
@@ -609207,7 +609501,7 @@ function QuestionNavigationBar(t0) {
609207
609501
  }
609208
609502
  return t7;
609209
609503
  }
609210
- function _temp345(sum, w) {
609504
+ function _temp344(sum, w) {
609211
609505
  return sum + w;
609212
609506
  }
609213
609507
  function _temp269(header_0) {
@@ -609798,7 +610092,7 @@ function QuestionView(t0) {
609798
610092
  t7 = $2[17];
609799
610093
  }
609800
610094
  const options2 = t7;
609801
- const hasAnyPreview = !question.multiSelect && question.options.some(_temp346);
610095
+ const hasAnyPreview = !question.multiSelect && question.options.some(_temp345);
609802
610096
  if (hasAnyPreview) {
609803
610097
  let t82;
609804
610098
  if ($2[30] !== answers || $2[31] !== currentQuestionIndex || $2[32] !== hideSubmitTab || $2[33] !== minContentHeight || $2[34] !== minContentWidth || $2[35] !== onAnswer || $2[36] !== onCancel || $2[37] !== onFinishPlanInterview || $2[38] !== onRespondToClaude || $2[39] !== onTabNext || $2[40] !== onTabPrev || $2[41] !== onTextInputFocus || $2[42] !== onUpdateQuestionState || $2[43] !== question || $2[44] !== questionStates || $2[45] !== questions) {
@@ -610187,7 +610481,7 @@ function QuestionView(t0) {
610187
610481
  function _temp434(v) {
610188
610482
  return v !== "__other__";
610189
610483
  }
610190
- function _temp346(opt_0) {
610484
+ function _temp345(opt_0) {
610191
610485
  return opt_0.preview;
610192
610486
  }
610193
610487
  function _temp270(opt) {
@@ -610885,7 +611179,7 @@ function AskUserQuestionPermissionRequestBody(t0) {
610885
611179
  const onRemoveImage = t8;
610886
611180
  let t9;
610887
611181
  if ($2[18] !== pastedContentsByQuestion) {
610888
- t9 = Object.values(pastedContentsByQuestion).flatMap(_temp271).filter(_temp347);
611182
+ t9 = Object.values(pastedContentsByQuestion).flatMap(_temp271).filter(_temp346);
610889
611183
  $2[18] = pastedContentsByQuestion;
610890
611184
  $2[19] = t9;
610891
611185
  } else {
@@ -611326,7 +611620,7 @@ function _temp526(c_0) {
611326
611620
  function _temp435(s) {
611327
611621
  return s.toolPermissionContext.mode;
611328
611622
  }
611329
- function _temp347(c6) {
611623
+ function _temp346(c6) {
611330
611624
  return c6.type === "image";
611331
611625
  }
611332
611626
  function _temp271(contents) {
@@ -612562,7 +612856,7 @@ function SuggestionDisplay(t0) {
612562
612856
  }, undefined, false, undefined, this),
612563
612857
  /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(ThemedBox_default, {
612564
612858
  flexDirection: "column",
612565
- children: directories.map(_temp348)
612859
+ children: directories.map(_temp347)
612566
612860
  }, undefined, false, undefined, this)
612567
612861
  ]
612568
612862
  }, undefined, true, undefined, this),
@@ -612598,7 +612892,7 @@ function SuggestionDisplay(t0) {
612598
612892
  }
612599
612893
  return t1;
612600
612894
  }
612601
- function _temp348(dir, index_0) {
612895
+ function _temp347(dir, index_0) {
612602
612896
  return /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(ThemedText, {
612603
612897
  children: [
612604
612898
  figures_default.bullet,
@@ -618234,7 +618528,7 @@ function NotebookEditToolDiffInner(t0) {
618234
618528
  firstLine: new_source.split(`
618235
618529
  `)[0] ?? null,
618236
618530
  fileContent: oldSource
618237
- }, _.newStart, false, undefined, this)), _temp349) : /* @__PURE__ */ jsx_dev_runtime396.jsxDEV(HighlightedCode, {
618531
+ }, _.newStart, false, undefined, this)), _temp348) : /* @__PURE__ */ jsx_dev_runtime396.jsxDEV(HighlightedCode, {
618238
618532
  code: new_source,
618239
618533
  filePath: cell_type === "markdown" ? "file.md" : notebook_path
618240
618534
  }, undefined, false, undefined, this);
@@ -618271,7 +618565,7 @@ function NotebookEditToolDiffInner(t0) {
618271
618565
  }
618272
618566
  return t10;
618273
618567
  }
618274
- function _temp349(i3) {
618568
+ function _temp348(i3) {
618275
618569
  return /* @__PURE__ */ jsx_dev_runtime396.jsxDEV(NoSelect, {
618276
618570
  fromLeftEdge: true,
618277
618571
  children: /* @__PURE__ */ jsx_dev_runtime396.jsxDEV(ThemedText, {
@@ -622674,7 +622968,7 @@ function CompanionFloatingBubble() {
622674
622968
  if (!reaction) {
622675
622969
  return;
622676
622970
  }
622677
- const timer = setInterval(_temp350, TICK_MS2, setTick);
622971
+ const timer = setInterval(_temp349, TICK_MS2, setTick);
622678
622972
  return () => clearInterval(timer);
622679
622973
  };
622680
622974
  t3 = [reaction];
@@ -622710,7 +623004,7 @@ function CompanionFloatingBubble() {
622710
623004
  }
622711
623005
  return t5;
622712
623006
  }
622713
- function _temp350(set3) {
623007
+ function _temp349(set3) {
622714
623008
  return set3(_temp274);
622715
623009
  }
622716
623010
  function _temp274(s_0) {
@@ -628066,7 +628360,7 @@ function BridgeDialog(t0) {
628066
628360
  useRegisterOverlay("bridge-dialog");
628067
628361
  const connected = useAppState(_temp183);
628068
628362
  const sessionActive = useAppState(_temp276);
628069
- const reconnecting = useAppState(_temp351);
628363
+ const reconnecting = useAppState(_temp350);
628070
628364
  const connectUrl = useAppState(_temp437);
628071
628365
  const sessionUrl = useAppState(_temp528);
628072
628366
  const error42 = useAppState(_temp622);
@@ -628494,7 +628788,7 @@ function _temp528(s_3) {
628494
628788
  function _temp437(s_2) {
628495
628789
  return s_2.replBridgeConnectUrl;
628496
628790
  }
628497
- function _temp351(s_1) {
628791
+ function _temp350(s_1) {
628498
628792
  return s_1.replBridgeReconnecting;
628499
628793
  }
628500
628794
  function _temp276(s_0) {
@@ -629224,12 +629518,12 @@ function _temp438(query_0, controller_1, setMatches_0, setTruncated_0, setIsSear
629224
629518
  return;
629225
629519
  }
629226
629520
  if (collected === 0) {
629227
- setMatches_0(_temp352);
629521
+ setMatches_0(_temp351);
629228
629522
  }
629229
629523
  setIsSearching_0(false);
629230
629524
  });
629231
629525
  }
629232
- function _temp352(m_2) {
629526
+ function _temp351(m_2) {
629233
629527
  return m_2.length ? [] : m_2;
629234
629528
  }
629235
629529
  function _temp277() {}
@@ -629474,7 +629768,7 @@ function QuickOpenDialog(t0) {
629474
629768
  if (gen !== queryGenRef.current) {
629475
629769
  return;
629476
629770
  }
629477
- const paths2 = items.filter(_temp187).map(_temp278).filter(_temp353).map(_temp439);
629771
+ const paths2 = items.filter(_temp187).map(_temp278).filter(_temp352).map(_temp439);
629478
629772
  setResults(paths2);
629479
629773
  });
629480
629774
  };
@@ -629665,7 +629959,7 @@ function _temp529(p_3) {
629665
629959
  function _temp439(p_0) {
629666
629960
  return p_0.split(path22.sep).join("/");
629667
629961
  }
629668
- function _temp353(p) {
629962
+ function _temp352(p) {
629669
629963
  return !p.endsWith(path22.sep);
629670
629964
  }
629671
629965
  function _temp278(i_0) {
@@ -632305,7 +632599,7 @@ function BackgroundTaskStatus(t0) {
632305
632599
  const viewingAgentTaskId = useAppState(_temp280);
632306
632600
  let t3;
632307
632601
  if ($2[0] !== tasks2) {
632308
- t3 = Object.values(tasks2 ?? {}).filter(_temp354);
632602
+ t3 = Object.values(tasks2 ?? {}).filter(_temp353);
632309
632603
  $2[0] = tasks2;
632310
632604
  $2[1] = t3;
632311
632605
  } else {
@@ -632590,7 +632884,7 @@ function _temp530(t_0) {
632590
632884
  function _temp440(s_1) {
632591
632885
  return s_1.expandedView;
632592
632886
  }
632593
- function _temp354(t) {
632887
+ function _temp353(t) {
632594
632888
  return isBackgroundTask(t) && true;
632595
632889
  }
632596
632890
  function _temp280(s_0) {
@@ -640954,18 +641248,25 @@ async function initialize3() {
640954
641248
  if (initialized4 || disposed3)
640955
641249
  return;
640956
641250
  initialized4 = true;
641251
+ unregisterCleanup = registerCleanup(async () => {
641252
+ await dispose3();
641253
+ });
640957
641254
  if (!dynamicSkillsCallbackRegistered) {
640958
641255
  dynamicSkillsCallbackRegistered = true;
640959
- onDynamicSkillsLoaded(() => {
640960
- clearCommandMemoizationCaches();
641256
+ unregisterDynamicSkillsCallback = dependencies2.onDynamicSkillsLoaded(() => {
641257
+ if (disposed3)
641258
+ return;
641259
+ dependencies2.clearCommandMemoizationCaches();
640961
641260
  skillsChanged.emit();
640962
641261
  });
640963
641262
  }
640964
641263
  const paths2 = await getWatchablePaths();
641264
+ if (disposed3)
641265
+ return;
640965
641266
  if (paths2.length === 0)
640966
641267
  return;
640967
641268
  logForDebugging(`Watching for changes in skill/command directories: ${paths2.join(", ")}...`);
640968
- watcher5 = esm_default.watch(paths2, {
641269
+ watcher5 = dependencies2.watch(paths2, {
640969
641270
  persistent: true,
640970
641271
  ignoreInitial: true,
640971
641272
  depth: 2,
@@ -640986,9 +641287,6 @@ async function initialize3() {
640986
641287
  watcher5.on("add", handleChange3);
640987
641288
  watcher5.on("change", handleChange3);
640988
641289
  watcher5.on("unlink", handleChange3);
640989
- unregisterCleanup = registerCleanup(async () => {
640990
- await dispose3();
640991
- });
640992
641290
  }
640993
641291
  function dispose3() {
640994
641292
  disposed3 = true;
@@ -640996,6 +641294,11 @@ function dispose3() {
640996
641294
  unregisterCleanup();
640997
641295
  unregisterCleanup = null;
640998
641296
  }
641297
+ if (unregisterDynamicSkillsCallback) {
641298
+ unregisterDynamicSkillsCallback();
641299
+ unregisterDynamicSkillsCallback = null;
641300
+ dynamicSkillsCallbackRegistered = false;
641301
+ }
640999
641302
  let closePromise = Promise.resolve();
641000
641303
  if (watcher5) {
641001
641304
  closePromise = watcher5.close();
@@ -641006,27 +641309,29 @@ function dispose3() {
641006
641309
  reloadTimer = null;
641007
641310
  }
641008
641311
  pendingChangedPaths.clear();
641312
+ lastReloadTime = 0;
641313
+ reloadInProgress = false;
641009
641314
  skillsChanged.clear();
641010
641315
  return closePromise;
641011
641316
  }
641012
641317
  async function getWatchablePaths() {
641013
- const fs5 = getFsImplementation();
641318
+ const fs5 = dependencies2.getFsImplementation();
641014
641319
  const paths2 = [];
641015
- const userSkillsPath = getSkillsPath("userSettings", "skills");
641320
+ const userSkillsPath = dependencies2.getSkillsPath("userSettings", "skills");
641016
641321
  if (userSkillsPath) {
641017
641322
  try {
641018
641323
  await fs5.stat(userSkillsPath);
641019
641324
  paths2.push(userSkillsPath);
641020
641325
  } catch {}
641021
641326
  }
641022
- const userCommandsPath = getSkillsPath("userSettings", "commands");
641327
+ const userCommandsPath = dependencies2.getSkillsPath("userSettings", "commands");
641023
641328
  if (userCommandsPath) {
641024
641329
  try {
641025
641330
  await fs5.stat(userCommandsPath);
641026
641331
  paths2.push(userCommandsPath);
641027
641332
  } catch {}
641028
641333
  }
641029
- const projectSkillsPath = getSkillsPath("projectSettings", "skills");
641334
+ const projectSkillsPath = dependencies2.getSkillsPath("projectSettings", "skills");
641030
641335
  if (projectSkillsPath) {
641031
641336
  try {
641032
641337
  const absolutePath = platformPath2.resolve(projectSkillsPath);
@@ -641034,7 +641339,7 @@ async function getWatchablePaths() {
641034
641339
  paths2.push(absolutePath);
641035
641340
  } catch {}
641036
641341
  }
641037
- const projectCommandsPath = getSkillsPath("projectSettings", "commands");
641342
+ const projectCommandsPath = dependencies2.getSkillsPath("projectSettings", "commands");
641038
641343
  if (projectCommandsPath) {
641039
641344
  try {
641040
641345
  const absolutePath = platformPath2.resolve(projectCommandsPath);
@@ -641052,6 +641357,8 @@ async function getWatchablePaths() {
641052
641357
  return paths2;
641053
641358
  }
641054
641359
  function handleChange3(path24) {
641360
+ if (disposed3)
641361
+ return;
641055
641362
  logForDebugging(`Detected skill change: ${path24}`);
641056
641363
  logEvent("tengu_skill_file_changed", {
641057
641364
  source: "chokidar"
@@ -641059,40 +641366,80 @@ function handleChange3(path24) {
641059
641366
  scheduleReload(path24);
641060
641367
  }
641061
641368
  function scheduleReload(changedPath) {
641369
+ if (disposed3)
641370
+ return;
641062
641371
  pendingChangedPaths.add(changedPath);
641372
+ if (reloadInProgress)
641373
+ return;
641374
+ scheduleReloadTimer();
641375
+ }
641376
+ function scheduleReloadTimer() {
641063
641377
  if (reloadTimer)
641064
641378
  clearTimeout(reloadTimer);
641379
+ const debounceMs = testOverrides2?.reloadDebounce ?? RELOAD_DEBOUNCE_MS;
641380
+ const reloadCooldownMs = testOverrides2?.reloadCooldown ?? RELOAD_COOLDOWN_MS;
641381
+ const cooldownRemaining = lastReloadTime + reloadCooldownMs - Date.now();
641382
+ const delay = Math.max(debounceMs, cooldownRemaining);
641065
641383
  reloadTimer = setTimeout(async () => {
641066
641384
  reloadTimer = null;
641385
+ if (disposed3)
641386
+ return;
641067
641387
  const paths2 = [...pendingChangedPaths];
641068
641388
  pendingChangedPaths.clear();
641069
- const results = await executeConfigChangeHooks("skills", paths2[0]);
641070
- if (hasBlockingResult(results)) {
641071
- logForDebugging(`ConfigChange hook blocked skill reload (${paths2.length} paths)`);
641389
+ if (paths2.length === 0)
641072
641390
  return;
641391
+ reloadInProgress = true;
641392
+ try {
641393
+ const results = await dependencies2.executeConfigChangeHooks("skills", paths2[0]);
641394
+ if (dependencies2.hasBlockingResult(results)) {
641395
+ logForDebugging(`ConfigChange hook blocked skill reload (${paths2.length} paths)`);
641396
+ return;
641397
+ }
641398
+ if (disposed3)
641399
+ return;
641400
+ if (pendingChangedPaths.size > 0) {
641401
+ logForDebugging(`Deferring skill reload because ${pendingChangedPaths.size} newer paths arrived during hooks`);
641402
+ return;
641403
+ }
641404
+ dependencies2.clearCommandsCache();
641405
+ dependencies2.resetSentSkillNames();
641406
+ lastReloadTime = Date.now();
641407
+ skillsChanged.emit();
641408
+ } finally {
641409
+ reloadInProgress = false;
641410
+ if (!disposed3 && pendingChangedPaths.size > 0) {
641411
+ scheduleReloadTimer();
641412
+ }
641073
641413
  }
641074
- clearSkillCaches();
641075
- clearCommandsCache();
641076
- resetSentSkillNames();
641077
- skillsChanged.emit();
641078
- }, testOverrides2?.reloadDebounce ?? RELOAD_DEBOUNCE_MS);
641414
+ }, delay);
641079
641415
  }
641080
641416
  async function resetForTesting2(overrides) {
641081
641417
  if (watcher5) {
641082
641418
  await watcher5.close();
641083
641419
  watcher5 = null;
641084
641420
  }
641421
+ if (unregisterCleanup) {
641422
+ unregisterCleanup();
641423
+ unregisterCleanup = null;
641424
+ }
641425
+ if (unregisterDynamicSkillsCallback) {
641426
+ unregisterDynamicSkillsCallback();
641427
+ unregisterDynamicSkillsCallback = null;
641428
+ dynamicSkillsCallbackRegistered = false;
641429
+ }
641085
641430
  if (reloadTimer) {
641086
641431
  clearTimeout(reloadTimer);
641087
641432
  reloadTimer = null;
641088
641433
  }
641089
641434
  pendingChangedPaths.clear();
641435
+ lastReloadTime = 0;
641436
+ reloadInProgress = false;
641090
641437
  skillsChanged.clear();
641091
641438
  initialized4 = false;
641092
641439
  disposed3 = false;
641093
641440
  testOverrides2 = overrides ?? null;
641094
641441
  }
641095
- var FILE_STABILITY_THRESHOLD_MS3 = 1000, FILE_STABILITY_POLL_INTERVAL_MS3 = 500, RELOAD_DEBOUNCE_MS = 300, POLLING_INTERVAL_MS3 = 2000, USE_POLLING, watcher5 = null, reloadTimer = null, pendingChangedPaths, initialized4 = false, disposed3 = false, dynamicSkillsCallbackRegistered = false, unregisterCleanup = null, skillsChanged, testOverrides2 = null, subscribe2, skillChangeDetector;
641442
+ var FILE_STABILITY_THRESHOLD_MS3 = 1000, FILE_STABILITY_POLL_INTERVAL_MS3 = 500, RELOAD_DEBOUNCE_MS = 3000, RELOAD_COOLDOWN_MS = 5000, POLLING_INTERVAL_MS3 = 2000, USE_POLLING, watcher5 = null, reloadTimer = null, pendingChangedPaths, lastReloadTime = 0, reloadInProgress = false, initialized4 = false, disposed3 = false, dynamicSkillsCallbackRegistered = false, unregisterDynamicSkillsCallback = null, unregisterCleanup = null, skillsChanged, testOverrides2 = null, defaultDependencies2, dependencies2, subscribe2, skillChangeDetector;
641096
641443
  var init_skillChangeDetector = __esm(() => {
641097
641444
  init_esm2();
641098
641445
  init_state();
@@ -641106,6 +641453,18 @@ var init_skillChangeDetector = __esm(() => {
641106
641453
  USE_POLLING = typeof Bun !== "undefined";
641107
641454
  pendingChangedPaths = new Set;
641108
641455
  skillsChanged = createSignal();
641456
+ defaultDependencies2 = {
641457
+ clearCommandMemoizationCaches,
641458
+ clearCommandsCache,
641459
+ executeConfigChangeHooks,
641460
+ getFsImplementation,
641461
+ getSkillsPath,
641462
+ hasBlockingResult,
641463
+ onDynamicSkillsLoaded,
641464
+ resetSentSkillNames,
641465
+ watch: esm_default.watch.bind(esm_default)
641466
+ };
641467
+ dependencies2 = defaultDependencies2;
641109
641468
  subscribe2 = skillsChanged.subscribe;
641110
641469
  skillChangeDetector = {
641111
641470
  initialize: initialize3,
@@ -642423,6 +642782,34 @@ var init_useInboxPoller = __esm(() => {
642423
642782
  import_react280 = __toESM(require_react(), 1);
642424
642783
  });
642425
642784
 
642785
+ // src/screens/replActiveAgentModel.ts
642786
+ function getActiveSessionAgentModelSelection({
642787
+ agent: agent2,
642788
+ baseMainLoopModel,
642789
+ hasExplicitModelOverride,
642790
+ hasAgentManagedModel
642791
+ }) {
642792
+ if (hasExplicitModelOverride) {
642793
+ return { shouldUpdateModel: false };
642794
+ }
642795
+ if (agent2.model && agent2.model !== "inherit") {
642796
+ return {
642797
+ shouldUpdateModel: true,
642798
+ mainLoopModelForSession: parseUserSpecifiedModel(agent2.model)
642799
+ };
642800
+ }
642801
+ if (!hasAgentManagedModel) {
642802
+ return { shouldUpdateModel: false };
642803
+ }
642804
+ return {
642805
+ shouldUpdateModel: true,
642806
+ mainLoopModelForSession: baseMainLoopModel ?? getDefaultMainLoopModelSetting()
642807
+ };
642808
+ }
642809
+ var init_replActiveAgentModel = __esm(() => {
642810
+ init_model();
642811
+ });
642812
+
642426
642813
  // src/hooks/useTaskListWatcher.ts
642427
642814
  var import_react281;
642428
642815
  var init_useTaskListWatcher = __esm(() => {
@@ -643693,7 +644080,7 @@ function usePostCompactSurvey(messages, isLoading, t0, t1) {
643693
644080
  import_react291.useEffect(t6, t7);
643694
644081
  let t8;
643695
644082
  if ($2[7] !== messages) {
643696
- t8 = new Set(messages.filter(_temp355).map(_temp441));
644083
+ t8 = new Set(messages.filter(_temp354).map(_temp441));
643697
644084
  $2[7] = messages;
643698
644085
  $2[8] = t8;
643699
644086
  } else {
@@ -643772,7 +644159,7 @@ function usePostCompactSurvey(messages, isLoading, t0, t1) {
643772
644159
  function _temp441(msg_0) {
643773
644160
  return msg_0.uuid;
643774
644161
  }
643775
- function _temp355(msg) {
644162
+ function _temp354(msg) {
643776
644163
  return isCompactBoundaryMessage(msg);
643777
644164
  }
643778
644165
  function _temp283(appearanceId_0, selected) {
@@ -646776,7 +647163,7 @@ function useMcpConnectivityStatus(t0) {
646776
647163
  }
646777
647164
  const failedLocalClients = mcpClients.filter(_temp204);
646778
647165
  const failedClaudeAiClients = mcpClients.filter(_temp286);
646779
- const needsAuthLocalServers = mcpClients.filter(_temp356);
647166
+ const needsAuthLocalServers = mcpClients.filter(_temp355);
646780
647167
  const needsAuthClaudeAiServers = mcpClients.filter(_temp442);
646781
647168
  if (failedLocalClients.length === 0 && failedClaudeAiClients.length === 0 && needsAuthLocalServers.length === 0 && needsAuthClaudeAiServers.length === 0) {
646782
647169
  return;
@@ -646898,7 +647285,7 @@ function useMcpConnectivityStatus(t0) {
646898
647285
  function _temp442(client_2) {
646899
647286
  return client_2.type === "needs-auth" && client_2.config.type === "claudeai-proxy" && hasClaudeAiMcpEverConnected(client_2.name);
646900
647287
  }
646901
- function _temp356(client_1) {
647288
+ function _temp355(client_1) {
646902
647289
  return client_1.type === "needs-auth" && client_1.config.type !== "claudeai-proxy";
646903
647290
  }
646904
647291
  function _temp286(client_0) {
@@ -647793,7 +648180,7 @@ function usePluginInstallationStatus() {
647793
648180
  const failedMarketplaces = t12;
647794
648181
  let t22;
647795
648182
  if ($2[3] !== installationStatus.plugins) {
647796
- t22 = installationStatus.plugins.filter(_temp357);
648183
+ t22 = installationStatus.plugins.filter(_temp356);
647797
648184
  $2[3] = installationStatus.plugins;
647798
648185
  $2[4] = t22;
647799
648186
  } else {
@@ -647884,7 +648271,7 @@ function usePluginInstallationStatus() {
647884
648271
  }
647885
648272
  import_react300.useEffect(t1, t2);
647886
648273
  }
647887
- function _temp357(p) {
648274
+ function _temp356(p) {
647888
648275
  return p.status === "failed";
647889
648276
  }
647890
648277
  function _temp289(m) {
@@ -649121,7 +649508,7 @@ function useFastModeNotification() {
649121
649508
  return;
649122
649509
  }
649123
649510
  return onFastModeOverageRejection((message) => {
649124
- setAppState(_temp358);
649511
+ setAppState(_temp357);
649125
649512
  addNotification({
649126
649513
  key: OVERAGE_REJECTED_KEY,
649127
649514
  color: "warning",
@@ -649188,7 +649575,7 @@ function useFastModeNotification() {
649188
649575
  }
649189
649576
  import_react307.useEffect(t4, t5);
649190
649577
  }
649191
- function _temp358(prev_0) {
649578
+ function _temp357(prev_0) {
649192
649579
  return {
649193
649580
  ...prev_0,
649194
649581
  fastMode: false
@@ -650985,6 +651372,8 @@ function REPL({
650985
651372
  onTurnComplete,
650986
651373
  disabled = false,
650987
651374
  mainThreadAgentDefinition: initialMainThreadAgentDefinition,
651375
+ baseMainLoopModel = null,
651376
+ hasExplicitModelOverride = false,
650988
651377
  disableSlashCommands = false,
650989
651378
  taskListId,
650990
651379
  remoteSessionConfig,
@@ -651048,6 +651437,34 @@ function REPL({
651048
651437
  const store = useAppStateStore();
651049
651438
  const terminal = useTerminalNotification();
651050
651439
  const mainLoopModel = useMainLoopModel();
651440
+ const appMainLoopModel = useAppState((s) => s.mainLoopModel);
651441
+ const appMainLoopModelForSession = useAppState((s) => s.mainLoopModelForSession);
651442
+ const initialAgentModelSelection = !hasExplicitModelOverride && initialMainThreadAgentDefinition?.model && initialMainThreadAgentDefinition.model !== "inherit" ? getActiveSessionAgentModelSelection({
651443
+ agent: initialMainThreadAgentDefinition,
651444
+ baseMainLoopModel,
651445
+ hasExplicitModelOverride,
651446
+ hasAgentManagedModel: false
651447
+ }) : undefined;
651448
+ const explicitModelOverrideRef = import_react315.useRef(hasExplicitModelOverride);
651449
+ const baseMainLoopModelRef = import_react315.useRef(baseMainLoopModel);
651450
+ const agentManagedModelRef = import_react315.useRef(initialAgentModelSelection?.shouldUpdateModel ? initialAgentModelSelection.mainLoopModelForSession : undefined);
651451
+ const previousMainLoopModelForSessionRef = import_react315.useRef(appMainLoopModelForSession);
651452
+ const didTrackInitialModelStateRef = import_react315.useRef(false);
651453
+ import_react315.useEffect(() => {
651454
+ const previousMainLoopModelForSession = previousMainLoopModelForSessionRef.current;
651455
+ previousMainLoopModelForSessionRef.current = appMainLoopModelForSession;
651456
+ if (!didTrackInitialModelStateRef.current) {
651457
+ didTrackInitialModelStateRef.current = true;
651458
+ return;
651459
+ }
651460
+ const currentEffectiveModelSetting = appMainLoopModelForSession ?? appMainLoopModel;
651461
+ const clearedAgentManagedSessionModel = previousMainLoopModelForSession !== null && appMainLoopModelForSession === null;
651462
+ if (!clearedAgentManagedSessionModel && currentEffectiveModelSetting === agentManagedModelRef.current)
651463
+ return;
651464
+ explicitModelOverrideRef.current = true;
651465
+ baseMainLoopModelRef.current = currentEffectiveModelSetting;
651466
+ agentManagedModelRef.current = undefined;
651467
+ }, [appMainLoopModel, appMainLoopModelForSession]);
651051
651468
  const [localCommands, setLocalCommands] = import_react315.useState(initialCommands);
651052
651469
  useSkillsChange(isRemoteSession ? undefined : getProjectRoot(), setLocalCommands);
651053
651470
  const proactiveActive = React165.useSyncExternalStore(proactiveModule5?.subscribeToProactiveChanges ?? PROACTIVE_NO_OP_SUBSCRIBE, proactiveModule5?.isProactiveActive ?? PROACTIVE_FALSE);
@@ -652191,6 +652608,31 @@ Error: sandbox required but unavailable: ${reason}
652191
652608
  },
652192
652609
  resume: resume2,
652193
652610
  setConversationId,
652611
+ setActiveSessionAgent: (agent2) => {
652612
+ const modelSelection = getActiveSessionAgentModelSelection({
652613
+ agent: agent2,
652614
+ baseMainLoopModel: baseMainLoopModelRef.current,
652615
+ hasExplicitModelOverride: explicitModelOverrideRef.current,
652616
+ hasAgentManagedModel: agentManagedModelRef.current !== undefined
652617
+ });
652618
+ setMainThreadAgentDefinition(agent2);
652619
+ setMainThreadAgentType(agent2.agentType);
652620
+ saveAgentSetting(agent2.agentType);
652621
+ if (modelSelection.shouldUpdateModel) {
652622
+ agentManagedModelRef.current = modelSelection.mainLoopModelForSession;
652623
+ setMainLoopModelOverride(modelSelection.mainLoopModelForSession);
652624
+ notifySessionMetadataChanged({
652625
+ model: modelSelection.mainLoopModelForSession
652626
+ });
652627
+ }
652628
+ setAppState((prev) => ({
652629
+ ...prev,
652630
+ agent: agent2.agentType,
652631
+ ...modelSelection.shouldUpdateModel ? {
652632
+ mainLoopModelForSession: modelSelection.mainLoopModelForSession
652633
+ } : {}
652634
+ }));
652635
+ },
652194
652636
  requestPrompt,
652195
652637
  contentReplacementState: contentReplacementStateRef.current,
652196
652638
  syncToolResultReplacements
@@ -654313,9 +654755,11 @@ var init_REPL = __esm(() => {
654313
654755
  init_commitAttribution();
654314
654756
  init_sessionStorage();
654315
654757
  init_sessionRestore();
654758
+ init_sessionState();
654316
654759
  init_concurrentSessions();
654317
654760
  init_RemoteAgentTask();
654318
654761
  init_useInboxPoller();
654762
+ init_replActiveAgentModel();
654319
654763
  init_agentSwarmsEnabled();
654320
654764
  init_useTaskListWatcher();
654321
654765
  init_ide();
@@ -655578,7 +656022,7 @@ function WelcomeV2() {
655578
656022
  dimColor: true,
655579
656023
  children: [
655580
656024
  "v",
655581
- "0.14.8",
656025
+ "0.15.0",
655582
656026
  " "
655583
656027
  ]
655584
656028
  }, undefined, true, undefined, this)
@@ -655778,7 +656222,7 @@ function WelcomeV2() {
655778
656222
  dimColor: true,
655779
656223
  children: [
655780
656224
  "v",
655781
- "0.14.8",
656225
+ "0.15.0",
655782
656226
  " "
655783
656227
  ]
655784
656228
  }, undefined, true, undefined, this)
@@ -656004,7 +656448,7 @@ function AppleTerminalWelcomeV2(t0) {
656004
656448
  dimColor: true,
656005
656449
  children: [
656006
656450
  "v",
656007
- "0.14.8",
656451
+ "0.15.0",
656008
656452
  " "
656009
656453
  ]
656010
656454
  }, undefined, true, undefined, this);
@@ -656258,7 +656702,7 @@ function AppleTerminalWelcomeV2(t0) {
656258
656702
  dimColor: true,
656259
656703
  children: [
656260
656704
  "v",
656261
- "0.14.8",
656705
+ "0.15.0",
656262
656706
  " "
656263
656707
  ]
656264
656708
  }, undefined, true, undefined, this);
@@ -657426,9 +657870,9 @@ function _temp531(current) {
657426
657870
  };
657427
657871
  }
657428
657872
  function _temp443(command_0) {
657429
- return command_0.type === "prompt" && (command_0.loadedFrom === "skills" || command_0.loadedFrom === "plugin") && (command_0.source === "projectSettings" || command_0.source === "localSettings" || command_0.source === "plugin") && command_0.allowedTools?.some(_temp359);
657873
+ return command_0.type === "prompt" && (command_0.loadedFrom === "skills" || command_0.loadedFrom === "plugin") && (command_0.source === "projectSettings" || command_0.source === "localSettings" || command_0.source === "plugin") && command_0.allowedTools?.some(_temp358);
657430
657874
  }
657431
- function _temp359(tool_0) {
657875
+ function _temp358(tool_0) {
657432
657876
  return tool_0 === BASH_TOOL_NAME || tool_0.startsWith(BASH_TOOL_NAME + "(");
657433
657877
  }
657434
657878
  function _temp298(command10) {
@@ -658962,6 +659406,8 @@ function ResumeConversation({
658962
659406
  dynamicMcpConfig,
658963
659407
  debug,
658964
659408
  mainThreadAgentDefinition,
659409
+ baseMainLoopModel,
659410
+ hasExplicitModelOverride,
658965
659411
  autoConnectIdeFlag,
658966
659412
  strictMcpConfig = false,
658967
659413
  systemPrompt,
@@ -659183,6 +659629,8 @@ function ResumeConversation({
659183
659629
  systemPrompt,
659184
659630
  appendSystemPrompt,
659185
659631
  mainThreadAgentDefinition: resumeData.mainThreadAgentDefinition,
659632
+ baseMainLoopModel,
659633
+ hasExplicitModelOverride,
659186
659634
  autoConnectIdeFlag,
659187
659635
  disableSlashCommands,
659188
659636
  taskListId,
@@ -659296,7 +659744,7 @@ function CrossProjectMessage(t0) {
659296
659744
  } else {
659297
659745
  t1 = $2[0];
659298
659746
  }
659299
- import_react328.default.useEffect(_temp360, t1);
659747
+ import_react328.default.useEffect(_temp359, t1);
659300
659748
  let t2;
659301
659749
  if ($2[1] === Symbol.for("react.memo_cache_sentinel")) {
659302
659750
  t2 = /* @__PURE__ */ jsx_dev_runtime488.jsxDEV(ThemedText, {
@@ -659362,7 +659810,7 @@ function CrossProjectMessage(t0) {
659362
659810
  }
659363
659811
  return t6;
659364
659812
  }
659365
- function _temp360() {
659813
+ function _temp359() {
659366
659814
  const timeout2 = setTimeout(_temp2101, 100);
659367
659815
  return () => clearTimeout(timeout2);
659368
659816
  }
@@ -673803,7 +674251,7 @@ __export(exports_update, {
673803
674251
  async function update() {
673804
674252
  if (getAPIProvider() !== "firstParty") {
673805
674253
  writeToStdout(source_default.yellow(`Auto-update is not available for third-party provider builds.
673806
- `) + `Current version: ${"0.14.8"}
674254
+ `) + `Current version: ${"0.15.0"}
673807
674255
 
673808
674256
  ` + `To update, reinstall from npm:
673809
674257
  ` + source_default.bold(` npm install -g ${"@makerbi/openclaude"}@latest`) + `
@@ -673814,7 +674262,7 @@ async function update() {
673814
674262
  await gracefulShutdown(0);
673815
674263
  }
673816
674264
  logEvent("tengu_update_check", {});
673817
- writeToStdout(`Current version: ${"0.14.8"}
674265
+ writeToStdout(`Current version: ${"0.15.0"}
673818
674266
  `);
673819
674267
  const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
673820
674268
  writeToStdout(`Checking for updates to ${channel} version...
@@ -673899,8 +674347,8 @@ async function update() {
673899
674347
  writeToStdout(`Claude is managed by Homebrew.
673900
674348
  `);
673901
674349
  const latest = await getLatestVersion(channel);
673902
- if (latest && !gte("0.14.8", latest)) {
673903
- writeToStdout(`Update available: ${"0.14.8"} → ${latest}
674350
+ if (latest && !gte("0.15.0", latest)) {
674351
+ writeToStdout(`Update available: ${"0.15.0"} → ${latest}
673904
674352
  `);
673905
674353
  writeToStdout(`
673906
674354
  `);
@@ -673916,8 +674364,8 @@ async function update() {
673916
674364
  writeToStdout(`Claude is managed by winget.
673917
674365
  `);
673918
674366
  const latest = await getLatestVersion(channel);
673919
- if (latest && !gte("0.14.8", latest)) {
673920
- writeToStdout(`Update available: ${"0.14.8"} → ${latest}
674367
+ if (latest && !gte("0.15.0", latest)) {
674368
+ writeToStdout(`Update available: ${"0.15.0"} → ${latest}
673921
674369
  `);
673922
674370
  writeToStdout(`
673923
674371
  `);
@@ -673933,8 +674381,8 @@ async function update() {
673933
674381
  writeToStdout(`Claude is managed by apk.
673934
674382
  `);
673935
674383
  const latest = await getLatestVersion(channel);
673936
- if (latest && !gte("0.14.8", latest)) {
673937
- writeToStdout(`Update available: ${"0.14.8"} → ${latest}
674384
+ if (latest && !gte("0.15.0", latest)) {
674385
+ writeToStdout(`Update available: ${"0.15.0"} → ${latest}
673938
674386
  `);
673939
674387
  writeToStdout(`
673940
674388
  `);
@@ -673999,11 +674447,11 @@ async function update() {
673999
674447
  `);
674000
674448
  await gracefulShutdown(1);
674001
674449
  }
674002
- if (result.latestVersion === "0.14.8") {
674003
- writeToStdout(source_default.green(`OpenClaude is up to date (${"0.14.8"})`) + `
674450
+ if (result.latestVersion === "0.15.0") {
674451
+ writeToStdout(source_default.green(`OpenClaude is up to date (${"0.15.0"})`) + `
674004
674452
  `);
674005
674453
  } else {
674006
- writeToStdout(source_default.green(`Successfully updated from ${"0.14.8"} to version ${result.latestVersion}`) + `
674454
+ writeToStdout(source_default.green(`Successfully updated from ${"0.15.0"} to version ${result.latestVersion}`) + `
674007
674455
  `);
674008
674456
  await regenerateCompletionCache();
674009
674457
  }
@@ -674063,12 +674511,12 @@ async function update() {
674063
674511
  `);
674064
674512
  await gracefulShutdown(1);
674065
674513
  }
674066
- if (latestVersion === "0.14.8") {
674067
- writeToStdout(source_default.green(`OpenClaude is up to date (${"0.14.8"})`) + `
674514
+ if (latestVersion === "0.15.0") {
674515
+ writeToStdout(source_default.green(`OpenClaude is up to date (${"0.15.0"})`) + `
674068
674516
  `);
674069
674517
  await gracefulShutdown(0);
674070
674518
  }
674071
- writeToStdout(`New version available: ${latestVersion} (current: ${"0.14.8"})
674519
+ writeToStdout(`New version available: ${latestVersion} (current: ${"0.15.0"})
674072
674520
  `);
674073
674521
  writeToStdout(`Installing update...
674074
674522
  `);
@@ -674113,7 +674561,7 @@ async function update() {
674113
674561
  logForDebugging(`update: Installation status: ${status2}`);
674114
674562
  switch (status2) {
674115
674563
  case "success":
674116
- writeToStdout(source_default.green(`Successfully updated from ${"0.14.8"} to version ${latestVersion}`) + `
674564
+ writeToStdout(source_default.green(`Successfully updated from ${"0.15.0"} to version ${latestVersion}`) + `
674117
674565
  `);
674118
674566
  await regenerateCompletionCache();
674119
674567
  break;
@@ -675083,6 +675531,8 @@ ${hint}` : hint;
675083
675531
  if (false) {}
675084
675532
  const userSpecifiedModel = options2.model === "default" ? getDefaultMainLoopModel() : options2.model;
675085
675533
  const userSpecifiedFallbackModel = fallbackModel === "default" ? getDefaultMainLoopModel() : fallbackModel;
675534
+ const hasExplicitModelOverride = userSpecifiedModel !== undefined;
675535
+ const baseMainLoopModel = userSpecifiedModel ?? getUserSpecifiedModelSetting() ?? null;
675086
675536
  const currentCwd2 = worktreeEnabled ? getCwd() : preSetupCwd;
675087
675537
  logForDebugging("[STARTUP] Loading commands and agents...");
675088
675538
  const commandsStart = Date.now();
@@ -675809,6 +676259,8 @@ ${customInstructions}` : customInstructions;
675809
676259
  mcpClients,
675810
676260
  autoConnectIdeFlag: ide2,
675811
676261
  mainThreadAgentDefinition,
676262
+ baseMainLoopModel,
676263
+ hasExplicitModelOverride,
675812
676264
  disableSlashCommands,
675813
676265
  dynamicMcpConfig,
675814
676266
  strictMcpConfig,
@@ -676166,7 +676618,7 @@ Usage: openclaude --remote "your task description"`, () => gracefulShutdown(1));
676166
676618
  pendingHookMessages
676167
676619
  }, renderAndRun);
676168
676620
  }
676169
- }).version("0.14.8 (OpenClaude)", "-v, --version", "Output the version number");
676621
+ }).version("0.15.0 (OpenClaude)", "-v, --version", "Output the version number");
676170
676622
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
676171
676623
  program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
676172
676624
  if (canUserConfigureAdvisor()) {
@@ -676743,7 +677195,7 @@ if (false) {}
676743
677195
  async function main2() {
676744
677196
  const args = process.argv.slice(2);
676745
677197
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
676746
- console.log(`${"0.14.8"} (OpenClaude)`);
677198
+ console.log(`${"0.15.0"} (OpenClaude)`);
676747
677199
  return;
676748
677200
  }
676749
677201
  if (args.includes("--provider")) {
@@ -676896,4 +677348,4 @@ async function main2() {
676896
677348
  }
676897
677349
  main2();
676898
677350
 
676899
- //# debugId=0163E3661EF4533664756E2164756E21
677351
+ //# debugId=7A5287DBF0759A3864756E2164756E21