@makerbi/openclaude 0.14.9 → 0.15.1

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 +854 -407
  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:36:27.285Z",
232491
+ buildTime: "2026-05-27T08:20:35.775Z",
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"];
@@ -366837,6 +367048,9 @@ async function isPossibleClaudeBinary(filePath) {
366837
367048
  if (!stats.isFile() || stats.size === 0) {
366838
367049
  return false;
366839
367050
  }
367051
+ if (env2.platform === "win32") {
367052
+ return true;
367053
+ }
366840
367054
  await access2(filePath, fsConstants2.X_OK);
366841
367055
  return true;
366842
367056
  } catch {
@@ -367044,6 +367258,9 @@ async function performVersionUpdate(version2, forceReinstall) {
367044
367258
  }
367045
367259
  await removeDirectoryIfEmpty(executablePath);
367046
367260
  await updateSymlink(executablePath, installPath);
367261
+ if (!await executableMatchesInstallPath(executablePath, installPath)) {
367262
+ throw new Error(`Failed to update executable at ${executablePath} to installed version ${version2}. ` + `The executable does not match ${installPath}. ` + `Check write permissions to ${executablePath}.`);
367263
+ }
367047
367264
  if (!await isPossibleClaudeBinary(executablePath)) {
367048
367265
  let installPathExists = false;
367049
367266
  try {
@@ -367178,6 +367395,7 @@ async function updateSymlink(symlinkPath, targetPath) {
367178
367395
  await rename2(symlinkPath, oldFileName);
367179
367396
  try {
367180
367397
  await copyFile2(targetPath, symlinkPath);
367398
+ await chmod5(symlinkPath, 493);
367181
367399
  try {
367182
367400
  await unlink7(oldFileName);
367183
367401
  } catch {}
@@ -367194,6 +367412,7 @@ async function updateSymlink(symlinkPath, targetPath) {
367194
367412
  } else {
367195
367413
  try {
367196
367414
  await copyFile2(targetPath, symlinkPath);
367415
+ await chmod5(symlinkPath, 493);
367197
367416
  } catch (e) {
367198
367417
  if (isENOENT(e)) {
367199
367418
  throw new Error(`Source file does not exist: ${targetPath}`);
@@ -367204,7 +367423,7 @@ async function updateSymlink(symlinkPath, targetPath) {
367204
367423
  return true;
367205
367424
  } catch (error42) {
367206
367425
  logError2(new Error(`Failed to copy executable from ${targetPath} to ${symlinkPath}: ${error42}`));
367207
- return false;
367426
+ throw error42;
367208
367427
  }
367209
367428
  }
367210
367429
  const parentDir = dirname27(symlinkPath);
@@ -367213,7 +367432,7 @@ async function updateSymlink(symlinkPath, targetPath) {
367213
367432
  logForDebugging(`Created directory ${parentDir} for symlink`);
367214
367433
  } catch (mkdirError) {
367215
367434
  logError2(new Error(`Failed to create directory ${parentDir}: ${mkdirError}`));
367216
- return false;
367435
+ throw mkdirError;
367217
367436
  }
367218
367437
  try {
367219
367438
  let symlinkExists = false;
@@ -367246,9 +367465,38 @@ async function updateSymlink(symlinkPath, targetPath) {
367246
367465
  await unlink7(tempSymlink);
367247
367466
  } catch {}
367248
367467
  logError2(new Error(`Failed to create symlink from ${symlinkPath} to ${targetPath}: ${error42}`));
367468
+ throw error42;
367469
+ }
367470
+ }
367471
+ async function filesHaveSameContent(leftPath, rightPath) {
367472
+ try {
367473
+ const [leftStats, rightStats] = await Promise.all([
367474
+ stat20(leftPath),
367475
+ stat20(rightPath)
367476
+ ]);
367477
+ if (!leftStats.isFile() || !rightStats.isFile() || leftStats.size !== rightStats.size) {
367478
+ return false;
367479
+ }
367480
+ const [leftContent, rightContent] = await Promise.all([
367481
+ readFile15(leftPath),
367482
+ readFile15(rightPath)
367483
+ ]);
367484
+ return leftContent.equals(rightContent);
367485
+ } catch {
367249
367486
  return false;
367250
367487
  }
367251
367488
  }
367489
+ async function executableMatchesInstallPath(executablePath, installPath) {
367490
+ if (getPlatform2().startsWith("win32")) {
367491
+ return filesHaveSameContent(executablePath, installPath);
367492
+ }
367493
+ try {
367494
+ const target = await readlink(executablePath);
367495
+ return resolve20(dirname27(executablePath), target) === resolve20(installPath) && await isPossibleClaudeBinary(installPath);
367496
+ } catch {
367497
+ return filesHaveSameContent(executablePath, installPath);
367498
+ }
367499
+ }
367252
367500
  async function checkInstall(force = false) {
367253
367501
  if (isEnvTruthy(process.env.DISABLE_INSTALLATION_CHECKS)) {
367254
367502
  return [];
@@ -370526,6 +370774,7 @@ function useCodexOAuthFlow(options2) {
370526
370774
  if (!saved.success) {
370527
370775
  throw new Error(saved.warning ?? "Codex OAuth succeeded, but credentials could not be saved securely.");
370528
370776
  }
370777
+ return { warning: saved.warning };
370529
370778
  };
370530
370779
  await onAuthenticated(tokens, persistCredentials);
370531
370780
  }).catch((error42) => {
@@ -371341,12 +371590,16 @@ function ProviderManager({ mode, onDone }) {
371341
371590
  function clearStartupProviderOverrideFromUserSettings() {
371342
371591
  return clearStartupProviderOverrides();
371343
371592
  }
371593
+ function formatWarningsForMessage(warnings) {
371594
+ const joined = warnings.join("; ");
371595
+ return /[.!?]$/.test(joined.trim()) ? joined : `${joined}.`;
371596
+ }
371344
371597
  function buildCodexOAuthActivationMessage(options2) {
371345
371598
  if (options2.activationWarning) {
371346
- return `${options2.prefix}. Saved for next startup. Warning: ${options2.warnings.join("; ")}.`;
371599
+ return `${options2.prefix}. Saved for next startup. Warning: ${formatWarningsForMessage(options2.warnings)}`;
371347
371600
  }
371348
371601
  if (options2.warnings.length > 0) {
371349
- return `${options2.prefix}. OpenClaude switched to it for this session with warnings: ${options2.warnings.join("; ")}.`;
371602
+ return `${options2.prefix}. OpenClaude switched to it for this session with warnings: ${formatWarningsForMessage(options2.warnings)}`;
371350
371603
  }
371351
371604
  return `${options2.prefix}. OpenClaude switched to it for this session.`;
371352
371605
  }
@@ -372565,13 +372818,17 @@ function ProviderManager({ mode, onDone }) {
372565
372818
  returnToMenu();
372566
372819
  return;
372567
372820
  }
372568
- persistCredentials({ profileId: saved.id });
372821
+ const persistenceResult = persistCredentials({
372822
+ profileId: saved.id
372823
+ });
372824
+ const storageWarning = persistenceResult && typeof persistenceResult === "object" ? persistenceResult.warning : null;
372569
372825
  const settingsOverrideError = clearStartupProviderOverrideFromUserSettings();
372570
372826
  const activationWarning = await activateCodexOAuthSession(tokens);
372571
372827
  setHasStoredCodexOAuthCredentials(true);
372572
372828
  setStoredCodexOAuthProfileId(saved.id);
372573
372829
  refreshProfiles();
372574
372830
  const warnings = [
372831
+ storageWarning,
372575
372832
  activationWarning,
372576
372833
  settingsOverrideError ? `could not clear startup provider override (${settingsOverrideError})` : null
372577
372834
  ].filter((warning) => Boolean(warning));
@@ -406308,6 +406565,7 @@ function getDisableExtglobCommand(shellPath) {
406308
406565
  }
406309
406566
  async function createBashShellProvider(shellPath, options2) {
406310
406567
  let currentSandboxTmpDir;
406568
+ const skipSnapshot = options2?.skipSnapshot === true;
406311
406569
  const snapshotPromise = options2?.skipSnapshot ? Promise.resolve(undefined) : createAndSaveSnapshot(shellPath).catch((error42) => {
406312
406570
  logForDebugging(`Failed to create shell snapshot: ${error42}`);
406313
406571
  return;
@@ -406363,7 +406621,7 @@ async function createBashShellProvider(shellPath, options2) {
406363
406621
  return { commandString, cwdFilePath };
406364
406622
  },
406365
406623
  getSpawnArgs(commandString) {
406366
- const skipLoginShell = lastSnapshotFilePath !== undefined;
406624
+ const skipLoginShell = skipSnapshot || lastSnapshotFilePath !== undefined;
406367
406625
  if (skipLoginShell) {
406368
406626
  logForDebugging("Spawning shell without login (-l flag skipped)");
406369
406627
  }
@@ -406548,6 +406806,9 @@ async function findSuitableShell() {
406548
406806
  logForDebugging(`CLAUDE_CODE_SHELL="${shellOverride}" is not a valid bash/zsh path, falling back to detection`);
406549
406807
  }
406550
406808
  }
406809
+ if (getPlatform() === "windows") {
406810
+ return findGitBashPath();
406811
+ }
406551
406812
  const env_shell = process.env.SHELL;
406552
406813
  const isEnvShellSupported = env_shell && (env_shell.includes("bash") || env_shell.includes("zsh"));
406553
406814
  const preferBash = env_shell?.includes("bash");
@@ -406579,7 +406840,9 @@ async function findSuitableShell() {
406579
406840
  }
406580
406841
  async function getShellConfigImpl() {
406581
406842
  const binShell = await findSuitableShell();
406582
- const provider = await createBashShellProvider(binShell);
406843
+ const provider = await createBashShellProvider(binShell, {
406844
+ skipSnapshot: false
406845
+ });
406583
406846
  return { provider };
406584
406847
  }
406585
406848
  async function exec3(command, abortSignal, shellType, options2) {
@@ -460387,7 +460650,7 @@ var init_AgentTool = __esm(() => {
460387
460650
  description: exports_external.string().describe("A short (3-5 word) description of the task"),
460388
460651
  prompt: exports_external.string().describe("The task for the agent to perform"),
460389
460652
  subagent_type: exports_external.string().optional().describe("The type of specialized agent to use for this task"),
460390
- 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."),
460653
+ 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."),
460391
460654
  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.")
460392
460655
  }));
460393
460656
  fullInputSchema2 = lazySchema(() => {
@@ -460494,6 +460757,8 @@ var init_AgentTool = __esm(() => {
460494
460757
  if (agentDef?.color) {
460495
460758
  setAgentColor(subagent_type, agentDef.color);
460496
460759
  }
460760
+ const rawTeammateModel = model2 ?? agentDef?.model;
460761
+ const resolvedTeammateModel = rawTeammateModel === undefined ? undefined : getAgentModel(agentDef?.model, toolUseContext.options.mainLoopModel, model2, permissionMode);
460497
460762
  const result = await spawnTeammate({
460498
460763
  name,
460499
460764
  prompt,
@@ -460501,7 +460766,7 @@ var init_AgentTool = __esm(() => {
460501
460766
  team_name: teamName,
460502
460767
  use_splitpane: true,
460503
460768
  plan_mode_required: spawnMode === "plan",
460504
- model: model2 ?? agentDef?.model,
460769
+ model: resolvedTeammateModel,
460505
460770
  agent_type: subagent_type,
460506
460771
  invokingRequestId: assistantMessage2?.requestId
460507
460772
  }, toolUseContext);
@@ -464145,6 +464410,16 @@ function getAttributionTexts() {
464145
464410
  }
464146
464411
  return { commit: "", pr: "" };
464147
464412
  }
464413
+ const settings = getInitialSettings();
464414
+ if (settings.attribution) {
464415
+ return {
464416
+ commit: settings.attribution.commit ?? "",
464417
+ pr: settings.attribution.pr ?? ""
464418
+ };
464419
+ }
464420
+ if (settings.includeCoAuthoredBy !== true) {
464421
+ return { commit: "", pr: "" };
464422
+ }
464148
464423
  const model2 = getMainLoopModel();
464149
464424
  const apiProvider = getAPIProvider();
464150
464425
  const modelName = getDefaultCommitCoAuthorName({
@@ -464152,20 +464427,9 @@ function getAttributionTexts() {
464152
464427
  apiProvider,
464153
464428
  isInternalRepo: isInternalModelRepoCached()
464154
464429
  });
464155
- const defaultAttribution = "\uD83E\uDD16 Generated with [OpenClaude](https://github.com/AndersonBY/openclaude)";
464156
464430
  const coAuthorEmail = getDefaultCommitCoAuthorEmail(apiProvider);
464157
464431
  const defaultCommit = isEnvTruthy(process.env.OPENCLAUDE_DISABLE_CO_AUTHORED_BY) ? "" : `Co-Authored-By: ${modelName} <${coAuthorEmail}>`;
464158
- const settings = getInitialSettings();
464159
- if (settings.attribution) {
464160
- return {
464161
- commit: settings.attribution.commit ?? defaultCommit,
464162
- pr: settings.attribution.pr ?? defaultAttribution
464163
- };
464164
- }
464165
- if (settings.includeCoAuthoredBy === false) {
464166
- return { commit: "", pr: "" };
464167
- }
464168
- return { commit: defaultCommit, pr: defaultAttribution };
464432
+ return { commit: defaultCommit, pr: DEFAULT_PR_ATTRIBUTION };
464169
464433
  }
464170
464434
  function isTerminalOutput(content) {
464171
464435
  for (const tag2 of TERMINAL_OUTPUT_TAGS) {
@@ -464276,13 +464540,15 @@ async function getEnhancedPRAttribution(getAppState) {
464276
464540
  return "";
464277
464541
  }
464278
464542
  const settings = getInitialSettings();
464279
- if (settings.attribution?.pr) {
464543
+ if (settings.attribution?.pr !== undefined) {
464280
464544
  return settings.attribution.pr;
464281
464545
  }
464282
- if (settings.includeCoAuthoredBy === false) {
464546
+ if (settings.attribution) {
464547
+ return "";
464548
+ }
464549
+ if (settings.includeCoAuthoredBy !== true) {
464283
464550
  return "";
464284
464551
  }
464285
- const defaultAttribution = "\uD83E\uDD16 Generated with [OpenClaude](https://github.com/AndersonBY/openclaude)";
464286
464552
  const appState = getAppState();
464287
464553
  logForDebugging(`PR Attribution: appState.attribution exists: ${!!appState.attribution}`);
464288
464554
  if (appState.attribution) {
@@ -464302,7 +464568,7 @@ async function getEnhancedPRAttribution(getAppState) {
464302
464568
  const shortModelName = isInternal ? rawModelName : sanitizeModelName(rawModelName);
464303
464569
  if (claudePercent === 0 && promptCount === 0 && memoryAccessCount === 0) {
464304
464570
  logForDebugging("PR Attribution: returning default (no data)");
464305
- return defaultAttribution;
464571
+ return DEFAULT_PR_ATTRIBUTION;
464306
464572
  }
464307
464573
  const memSuffix = memoryAccessCount > 0 ? `, ${memoryAccessCount} ${memoryAccessCount === 1 ? "memory" : "memories"} recalled` : "";
464308
464574
  const summary = `\uD83E\uDD16 Generated with [OpenClaude](https://github.com/AndersonBY/openclaude) (${claudePercent}% ${promptCount}-shotted by ${shortModelName}${memSuffix})`;
@@ -464310,7 +464576,7 @@ async function getEnhancedPRAttribution(getAppState) {
464310
464576
  logForDebugging(`PR Attribution: returning summary: ${summary}`);
464311
464577
  return summary;
464312
464578
  }
464313
- var MEMORY_ACCESS_TOOL_NAMES;
464579
+ var DEFAULT_PR_ATTRIBUTION = "\uD83E\uDD16 Generated with [OpenClaude](https://github.com/AndersonBY/openclaude)", MEMORY_ACCESS_TOOL_NAMES;
464314
464580
  var init_attribution = __esm(() => {
464315
464581
  init_state();
464316
464582
  init_envUtils();
@@ -471799,7 +472065,7 @@ function getAnthropicEnvMetadata() {
471799
472065
  function getBuildAgeMinutes() {
471800
472066
  if (false)
471801
472067
  ;
471802
- const buildTime = new Date("2026-05-26T10:36:27.285Z").getTime();
472068
+ const buildTime = new Date("2026-05-27T08:20:35.775Z").getTime();
471803
472069
  if (isNaN(buildTime))
471804
472070
  return;
471805
472071
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -498284,7 +498550,7 @@ ${USAGE}` };
498284
498550
  return { type: "text", value: error42 };
498285
498551
  return {
498286
498552
  type: "text",
498287
- value: "Commit attribution reset to the OpenClaude default."
498553
+ value: "Commit attribution reset to the privacy-preserving default."
498288
498554
  };
498289
498555
  }
498290
498556
  case "set-attribution":
@@ -499938,7 +500204,7 @@ function buildPrimarySection() {
499938
500204
  }, undefined, false, undefined, this);
499939
500205
  return [{
499940
500206
  label: "Version",
499941
- value: "0.14.9"
500207
+ value: "0.15.1"
499942
500208
  }, {
499943
500209
  label: "Session name",
499944
500210
  value: nameValue
@@ -514833,7 +515099,7 @@ function getReleaseTagUrl(version2 = publicBuildVersion) {
514833
515099
  return `${OPENCLAUDE_RELEASES_URL}/tag/v${normalizePublicVersion(version2)}`;
514834
515100
  }
514835
515101
  function getPublicBuildVersion() {
514836
- return "0.14.9";
515102
+ return "0.15.1";
514837
515103
  }
514838
515104
  var import_semver9, OPENCLAUDE_RELEASES_URL = "https://github.com/AndersonBY/openclaude/releases", fallbackBuildVersion, publicBuildVersion;
514839
515105
  var init_version = __esm(() => {
@@ -538928,15 +539194,15 @@ var require_filter_parse = __commonJS((exports, module) => {
538928
539194
  }
538929
539195
  return byteWidth;
538930
539196
  }
538931
- var Filter = module.exports = function(bitmapInfo, dependencies) {
539197
+ var Filter = module.exports = function(bitmapInfo, dependencies2) {
538932
539198
  let width = bitmapInfo.width;
538933
539199
  let height = bitmapInfo.height;
538934
539200
  let interlace = bitmapInfo.interlace;
538935
539201
  let bpp = bitmapInfo.bpp;
538936
539202
  let depth = bitmapInfo.depth;
538937
- this.read = dependencies.read;
538938
- this.write = dependencies.write;
538939
- this.complete = dependencies.complete;
539203
+ this.read = dependencies2.read;
539204
+ this.write = dependencies2.write;
539205
+ this.complete = dependencies2.complete;
538940
539206
  this._imageIndex = 0;
538941
539207
  this._images = [];
538942
539208
  if (interlace) {
@@ -539143,7 +539409,7 @@ var require_crc = __commonJS((exports, module) => {
539143
539409
  var require_parser5 = __commonJS((exports, module) => {
539144
539410
  var constants5 = require_constants11();
539145
539411
  var CrcCalculator = require_crc();
539146
- var Parser2 = module.exports = function(options2, dependencies) {
539412
+ var Parser2 = module.exports = function(options2, dependencies2) {
539147
539413
  this._options = options2;
539148
539414
  options2.checkCRC = options2.checkCRC !== false;
539149
539415
  this._hasIHDR = false;
@@ -539158,17 +539424,17 @@ var require_parser5 = __commonJS((exports, module) => {
539158
539424
  this._chunks[constants5.TYPE_PLTE] = this._handlePLTE.bind(this);
539159
539425
  this._chunks[constants5.TYPE_tRNS] = this._handleTRNS.bind(this);
539160
539426
  this._chunks[constants5.TYPE_gAMA] = this._handleGAMA.bind(this);
539161
- this.read = dependencies.read;
539162
- this.error = dependencies.error;
539163
- this.metadata = dependencies.metadata;
539164
- this.gamma = dependencies.gamma;
539165
- this.transColor = dependencies.transColor;
539166
- this.palette = dependencies.palette;
539167
- this.parsed = dependencies.parsed;
539168
- this.inflateData = dependencies.inflateData;
539169
- this.finished = dependencies.finished;
539170
- this.simpleTransparency = dependencies.simpleTransparency;
539171
- this.headersFinished = dependencies.headersFinished || function() {};
539427
+ this.read = dependencies2.read;
539428
+ this.error = dependencies2.error;
539429
+ this.metadata = dependencies2.metadata;
539430
+ this.gamma = dependencies2.gamma;
539431
+ this.transColor = dependencies2.transColor;
539432
+ this.palette = dependencies2.palette;
539433
+ this.parsed = dependencies2.parsed;
539434
+ this.inflateData = dependencies2.inflateData;
539435
+ this.finished = dependencies2.finished;
539436
+ this.simpleTransparency = dependencies2.simpleTransparency;
539437
+ this.headersFinished = dependencies2.headersFinished || function() {};
539172
539438
  };
539173
539439
  Parser2.prototype.start = function() {
539174
539440
  this.read(constants5.PNG_SIGNATURE.length, this._parseSignature.bind(this));
@@ -566759,7 +567025,8 @@ function AgentsList(t0) {
566759
567025
  onBack,
566760
567026
  onSelect,
566761
567027
  onCreateNew,
566762
- changes
567028
+ changes,
567029
+ activeAgentName
566763
567030
  } = t0;
566764
567031
  const [selectedAgent, setSelectedAgent] = React105.useState(null);
566765
567032
  const [isCreateNewSelected, setIsCreateNewSelected] = React105.useState(true);
@@ -566793,81 +567060,83 @@ function AgentsList(t0) {
566793
567060
  t2 = $2[3];
566794
567061
  }
566795
567062
  const renderCreateNewOption = t2;
566796
- let t3;
566797
- if ($2[4] !== isCreateNewSelected || $2[5] !== selectedAgent?.agentType || $2[6] !== selectedAgent?.source) {
566798
- t3 = (agent_0) => {
566799
- const isBuiltIn = agent_0.source === "built-in";
566800
- const isSelected = !isBuiltIn && !isCreateNewSelected && selectedAgent?.agentType === agent_0.agentType && selectedAgent?.source === agent_0.source;
566801
- const {
566802
- isOverridden,
566803
- overriddenBy
566804
- } = getOverrideInfo(agent_0);
566805
- const dimmed = isBuiltIn || isOverridden;
566806
- const textColor = !isBuiltIn && isSelected ? "suggestion" : undefined;
566807
- const resolvedModel = resolveAgentModelDisplay(agent_0);
566808
- return /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedBox_default, {
566809
- children: [
566810
- /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
566811
- dimColor: dimmed && !isSelected,
566812
- color: textColor,
566813
- children: isBuiltIn ? "" : isSelected ? `${figures_default.pointer} ` : " "
566814
- }, undefined, false, undefined, this),
566815
- /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
566816
- dimColor: dimmed && !isSelected,
566817
- color: textColor,
566818
- children: agent_0.agentType
566819
- }, undefined, false, undefined, this),
566820
- resolvedModel && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
566821
- dimColor: true,
566822
- color: textColor,
566823
- children: [
566824
- " · ",
566825
- resolvedModel
566826
- ]
566827
- }, undefined, true, undefined, this),
566828
- agent_0.memory && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
566829
- dimColor: true,
566830
- color: textColor,
566831
- children: [
566832
- " · ",
566833
- agent_0.memory,
566834
- " memory"
566835
- ]
566836
- }, undefined, true, undefined, this),
566837
- overriddenBy && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
566838
- dimColor: !isSelected,
566839
- color: isSelected ? "warning" : undefined,
566840
- children: [
566841
- " ",
566842
- figures_default.warning,
566843
- " shadowed by ",
566844
- getOverrideSourceLabel(overriddenBy)
566845
- ]
566846
- }, undefined, true, undefined, this)
566847
- ]
566848
- }, `${agent_0.agentType}-${agent_0.source}`, true, undefined, this);
566849
- };
566850
- $2[4] = isCreateNewSelected;
566851
- $2[5] = selectedAgent?.agentType;
566852
- $2[6] = selectedAgent?.source;
566853
- $2[7] = t3;
566854
- } else {
566855
- t3 = $2[7];
566856
- }
566857
- const renderAgent = t3;
567063
+ const renderAgent = (agent_0) => {
567064
+ const isSelected = !isCreateNewSelected && selectedAgent?.agentType === agent_0.agentType && selectedAgent?.source === agent_0.source;
567065
+ const isActive = agent_0.agentType === activeAgentName && !agent_0.overriddenBy;
567066
+ const {
567067
+ isOverridden,
567068
+ overriddenBy
567069
+ } = getOverrideInfo(agent_0);
567070
+ const dimmed = agent_0.source === "built-in" || isOverridden;
567071
+ const textColor = isSelected ? "suggestion" : undefined;
567072
+ const resolvedModel = resolveAgentModelDisplay(agent_0);
567073
+ return /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedBox_default, {
567074
+ children: [
567075
+ /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567076
+ dimColor: dimmed && !isSelected,
567077
+ color: textColor,
567078
+ children: isSelected ? `${figures_default.pointer} ` : " "
567079
+ }, undefined, false, undefined, this),
567080
+ /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567081
+ dimColor: dimmed && !isSelected,
567082
+ color: textColor,
567083
+ children: agent_0.agentType
567084
+ }, undefined, false, undefined, this),
567085
+ resolvedModel && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567086
+ dimColor: true,
567087
+ color: textColor,
567088
+ children: [
567089
+ " · ",
567090
+ resolvedModel
567091
+ ]
567092
+ }, undefined, true, undefined, this),
567093
+ agent_0.memory && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567094
+ dimColor: true,
567095
+ color: textColor,
567096
+ children: [
567097
+ " · ",
567098
+ agent_0.memory,
567099
+ " memory"
567100
+ ]
567101
+ }, undefined, true, undefined, this),
567102
+ isActive && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567103
+ color: "success",
567104
+ children: [
567105
+ " ",
567106
+ figures_default.tick,
567107
+ " active"
567108
+ ]
567109
+ }, undefined, true, undefined, this),
567110
+ overriddenBy && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567111
+ dimColor: !isSelected,
567112
+ color: isSelected ? "warning" : undefined,
567113
+ children: [
567114
+ " ",
567115
+ figures_default.warning,
567116
+ " shadowed by ",
567117
+ getOverrideSourceLabel(overriddenBy)
567118
+ ]
567119
+ }, undefined, true, undefined, this)
567120
+ ]
567121
+ }, `${agent_0.agentType}-${agent_0.source}`, true, undefined, this);
567122
+ };
566858
567123
  let t4;
566859
567124
  if ($2[8] !== sortedAgents || $2[9] !== source) {
566860
567125
  bb0: {
566861
567126
  const nonBuiltIn = sortedAgents.filter(_temp263);
566862
567127
  if (source === "all") {
566863
- t4 = AGENT_SOURCE_GROUPS.filter(_temp339).flatMap((t52) => {
567128
+ t4 = AGENT_SOURCE_GROUPS.flatMap((t52) => {
566864
567129
  const {
566865
567130
  source: groupSource
566866
567131
  } = t52;
566867
- return nonBuiltIn.filter((a_0) => a_0.source === groupSource);
567132
+ return sortedAgents.filter((a_0) => a_0.source === groupSource);
566868
567133
  });
566869
567134
  break bb0;
566870
567135
  }
567136
+ if (source === "built-in") {
567137
+ t4 = sortedAgents;
567138
+ break bb0;
567139
+ }
566871
567140
  t4 = nonBuiltIn;
566872
567141
  }
566873
567142
  $2[8] = sortedAgents;
@@ -567102,29 +567371,30 @@ function AgentsList(t0) {
567102
567371
  } else {
567103
567372
  t27 = $2[64];
567104
567373
  }
567105
- let t28;
567106
- if ($2[65] !== handleKeyDown || $2[66] !== t233 || $2[67] !== t27) {
567107
- t28 = /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedBox_default, {
567108
- flexDirection: "column",
567109
- gap: 1,
567110
- tabIndex: 0,
567111
- autoFocus: true,
567112
- onKeyDown: handleKeyDown,
567113
- children: [
567114
- t233,
567115
- t242,
567116
- t25,
567117
- t26,
567118
- t27
567119
- ]
567120
- }, undefined, true, undefined, this);
567121
- $2[65] = handleKeyDown;
567122
- $2[66] = t233;
567123
- $2[67] = t27;
567124
- $2[68] = t28;
567125
- } else {
567126
- t28 = $2[68];
567127
- }
567374
+ const t28 = /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedBox_default, {
567375
+ flexDirection: "column",
567376
+ gap: 1,
567377
+ tabIndex: 0,
567378
+ autoFocus: true,
567379
+ onKeyDown: handleKeyDown,
567380
+ children: [
567381
+ /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567382
+ dimColor: true,
567383
+ children: [
567384
+ "Current session agent: ",
567385
+ /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567386
+ bold: true,
567387
+ children: activeAgentName ?? "none"
567388
+ }, undefined, false, undefined, this)
567389
+ ]
567390
+ }, undefined, true, undefined, this),
567391
+ t233,
567392
+ t242,
567393
+ t25,
567394
+ t26,
567395
+ t27
567396
+ ]
567397
+ }, undefined, true, undefined, this);
567128
567398
  let t29;
567129
567399
  if ($2[69] !== onBack || $2[70] !== sourceTitle || $2[71] !== t28) {
567130
567400
  t29 = /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(Dialog, {
@@ -567157,19 +567427,27 @@ function AgentsList(t0) {
567157
567427
  t18 = `${t232} agents`;
567158
567428
  t19 = onBack;
567159
567429
  t20 = true;
567160
- if ($2[75] !== changes) {
567161
- t21 = changes && changes.length > 0 && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedBox_default, {
567162
- marginTop: 1,
567163
- children: /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567430
+ t21 = /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(jsx_dev_runtime318.Fragment, {
567431
+ children: [
567432
+ /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567164
567433
  dimColor: true,
567165
- children: changes[changes.length - 1]
567434
+ children: [
567435
+ "Current session agent: ",
567436
+ /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567437
+ bold: true,
567438
+ children: activeAgentName ?? "none"
567439
+ }, undefined, false, undefined, this)
567440
+ ]
567441
+ }, undefined, true, undefined, this),
567442
+ changes && changes.length > 0 && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedBox_default, {
567443
+ marginTop: 1,
567444
+ children: /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567445
+ dimColor: true,
567446
+ children: changes[changes.length - 1]
567447
+ }, undefined, false, undefined, this)
567166
567448
  }, undefined, false, undefined, this)
567167
- }, undefined, false, undefined, this);
567168
- $2[75] = changes;
567169
- $2[76] = t21;
567170
- } else {
567171
- t21 = $2[76];
567172
- }
567449
+ ]
567450
+ }, undefined, true, undefined, this);
567173
567451
  T0 = ThemedBox_default;
567174
567452
  t11 = "column";
567175
567453
  t12 = 0;
@@ -567357,9 +567635,6 @@ function _temp522(a_3) {
567357
567635
  function _temp430(a_2) {
567358
567636
  return a_2.source === "built-in";
567359
567637
  }
567360
- function _temp339(g) {
567361
- return g.source !== "built-in";
567362
- }
567363
567638
  function _temp263(a2) {
567364
567639
  return a2.source !== "built-in";
567365
567640
  }
@@ -567467,7 +567742,7 @@ function WizardProvider(t0) {
567467
567742
  }
567468
567743
  } else {
567469
567744
  if (currentStepIndex > 0) {
567470
- setCurrentStepIndex(_temp340);
567745
+ setCurrentStepIndex(_temp339);
567471
567746
  } else {
567472
567747
  if (onCancel) {
567473
567748
  onCancel();
@@ -567581,7 +567856,7 @@ function WizardProvider(t0) {
567581
567856
  }
567582
567857
  return t14;
567583
567858
  }
567584
- function _temp340(prev_2) {
567859
+ function _temp339(prev_2) {
567585
567860
  return prev_2 - 1;
567586
567861
  }
567587
567862
  function _temp264(prev_1) {
@@ -568257,7 +568532,7 @@ function ConfirmStep(t0) {
568257
568532
  color: "error",
568258
568533
  children: "Errors:"
568259
568534
  }, undefined, false, undefined, this),
568260
- validation.errors.map(_temp341)
568535
+ validation.errors.map(_temp340)
568261
568536
  ]
568262
568537
  }, undefined, true, undefined, this);
568263
568538
  $2[4] = agent2;
@@ -568425,7 +568700,7 @@ function ConfirmStep(t0) {
568425
568700
  }
568426
568701
  return t25;
568427
568702
  }
568428
- function _temp341(err2, i_0) {
568703
+ function _temp340(err2, i_0) {
568429
568704
  return /* @__PURE__ */ jsx_dev_runtime323.jsxDEV(ThemedText, {
568430
568705
  color: "error",
568431
568706
  children: [
@@ -570057,11 +570332,13 @@ function AgentsMenu(t0) {
570057
570332
  const $2 = import_react_compiler_runtime252.c(157);
570058
570333
  const {
570059
570334
  tools,
570060
- onExit: onExit2
570335
+ onExit: onExit2,
570336
+ onSetActiveAgent,
570337
+ initialModeState
570061
570338
  } = t0;
570062
570339
  let t1;
570063
570340
  if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
570064
- t1 = {
570341
+ t1 = initialModeState ?? {
570065
570342
  mode: "list-agents",
570066
570343
  source: "all"
570067
570344
  };
@@ -570072,7 +570349,8 @@ function AgentsMenu(t0) {
570072
570349
  const [modeState, setModeState] = import_react182.useState(t1);
570073
570350
  const agentDefinitions = useAppState(_temp147);
570074
570351
  const mcpTools = useAppState(_temp266);
570075
- const toolPermissionContext = useAppState(_temp342);
570352
+ const toolPermissionContext = useAppState(_temp341);
570353
+ const activeAgentName = useAppState((s) => s.agent);
570076
570354
  const setAppState = useSetAppState();
570077
570355
  const {
570078
570356
  allAgents,
@@ -570275,25 +570553,15 @@ ${changes.join(`
570275
570553
  } else {
570276
570554
  t17 = $2[39];
570277
570555
  }
570278
- let t18;
570279
- if ($2[40] !== changes || $2[41] !== modeState.source || $2[42] !== resolvedAgents || $2[43] !== t15 || $2[44] !== t16) {
570280
- t18 = /* @__PURE__ */ jsx_dev_runtime335.jsxDEV(AgentsList, {
570281
- source: modeState.source,
570282
- agents: resolvedAgents,
570283
- onBack: t15,
570284
- onSelect: t16,
570285
- onCreateNew: t17,
570286
- changes
570287
- }, undefined, false, undefined, this);
570288
- $2[40] = changes;
570289
- $2[41] = modeState.source;
570290
- $2[42] = resolvedAgents;
570291
- $2[43] = t15;
570292
- $2[44] = t16;
570293
- $2[45] = t18;
570294
- } else {
570295
- t18 = $2[45];
570296
- }
570556
+ const t18 = /* @__PURE__ */ jsx_dev_runtime335.jsxDEV(AgentsList, {
570557
+ source: modeState.source,
570558
+ agents: resolvedAgents,
570559
+ onBack: t15,
570560
+ onSelect: t16,
570561
+ onCreateNew: t17,
570562
+ changes,
570563
+ activeAgentName
570564
+ }, undefined, false, undefined, this);
570297
570565
  let t19;
570298
570566
  if ($2[46] === Symbol.for("react.memo_cache_sentinel")) {
570299
570567
  t19 = /* @__PURE__ */ jsx_dev_runtime335.jsxDEV(AgentNavigationFooter, {}, undefined, false, undefined, this);
@@ -570346,16 +570614,16 @@ ${changes.join(`
570346
570614
  case "agent-menu": {
570347
570615
  let t13;
570348
570616
  if ($2[53] !== allAgents || $2[54] !== modeState.agent.agentType || $2[55] !== modeState.agent.source) {
570349
- let t142;
570617
+ let t14;
570350
570618
  if ($2[57] !== modeState.agent.agentType || $2[58] !== modeState.agent.source) {
570351
- t142 = (a_9) => a_9.agentType === modeState.agent.agentType && a_9.source === modeState.agent.source;
570619
+ t14 = (a_9) => a_9.agentType === modeState.agent.agentType && a_9.source === modeState.agent.source;
570352
570620
  $2[57] = modeState.agent.agentType;
570353
570621
  $2[58] = modeState.agent.source;
570354
- $2[59] = t142;
570622
+ $2[59] = t14;
570355
570623
  } else {
570356
- t142 = $2[59];
570624
+ t14 = $2[59];
570357
570625
  }
570358
- t13 = allAgents.find(t142);
570626
+ t13 = allAgents.find(t14);
570359
570627
  $2[53] = allAgents;
570360
570628
  $2[54] = modeState.agent.agentType;
570361
570629
  $2[55] = modeState.agent.source;
@@ -570366,90 +570634,71 @@ ${changes.join(`
570366
570634
  const freshAgent_1 = t13;
570367
570635
  const agentToUse = freshAgent_1 || modeState.agent;
570368
570636
  const isEditable = agentToUse.source !== "built-in" && agentToUse.source !== "plugin" && agentToUse.source !== "flagSettings";
570369
- let t14;
570370
- if ($2[60] === Symbol.for("react.memo_cache_sentinel")) {
570371
- t14 = {
570372
- label: "View agent",
570373
- value: "view"
570374
- };
570375
- $2[60] = t14;
570376
- } else {
570377
- t14 = $2[60];
570378
- }
570379
- let t15;
570380
- if ($2[61] !== isEditable) {
570381
- t15 = isEditable ? [{
570382
- label: "Edit agent",
570383
- value: "edit"
570384
- }, {
570385
- label: "Delete agent",
570386
- value: "delete"
570387
- }] : [];
570388
- $2[61] = isEditable;
570389
- $2[62] = t15;
570390
- } else {
570391
- t15 = $2[62];
570392
- }
570393
- let t16;
570394
- if ($2[63] === Symbol.for("react.memo_cache_sentinel")) {
570395
- t16 = {
570396
- label: "Back",
570397
- value: "back"
570398
- };
570399
- $2[63] = t16;
570400
- } else {
570401
- t16 = $2[63];
570402
- }
570403
- let t17;
570404
- if ($2[64] !== t15) {
570405
- t17 = [t14, ...t15, t16];
570406
- $2[64] = t15;
570407
- $2[65] = t17;
570408
- } else {
570409
- t17 = $2[65];
570410
- }
570411
- const menuItems = t17;
570412
- let t18;
570413
- if ($2[66] !== agentToUse || $2[67] !== modeState) {
570414
- t18 = (value_0) => {
570415
- bb129:
570416
- switch (value_0) {
570417
- case "view": {
570418
- setModeState({
570419
- mode: "view-agent",
570420
- agent: agentToUse,
570421
- previousMode: modeState.previousMode
570422
- });
570423
- break bb129;
570424
- }
570425
- case "edit": {
570426
- setModeState({
570427
- mode: "edit-agent",
570428
- agent: agentToUse,
570429
- previousMode: modeState
570430
- });
570431
- break bb129;
570432
- }
570433
- case "delete": {
570434
- setModeState({
570435
- mode: "delete-confirm",
570436
- agent: agentToUse,
570437
- previousMode: modeState
570438
- });
570439
- break bb129;
570440
- }
570441
- case "back": {
570442
- setModeState(modeState.previousMode);
570443
- }
570637
+ const isActiveAgent = agentToUse.agentType === activeAgentName;
570638
+ const sessionAgentToUse = agents.find((a_10) => a_10.agentType === agentToUse.agentType) ?? agentToUse;
570639
+ const editableItems = isEditable ? [{
570640
+ label: "Edit agent",
570641
+ value: "edit"
570642
+ }, {
570643
+ label: "Delete agent",
570644
+ value: "delete"
570645
+ }] : [];
570646
+ const activeAgentItems = isActiveAgent ? [{
570647
+ label: "Active agent",
570648
+ value: "active-agent",
570649
+ disabled: true
570650
+ }] : onSetActiveAgent ? [{
570651
+ label: "Set as active agent",
570652
+ value: "set-active"
570653
+ }] : [];
570654
+ const menuItems = [{
570655
+ label: "View agent",
570656
+ value: "view"
570657
+ }, ...activeAgentItems, ...editableItems, {
570658
+ label: "Back",
570659
+ value: "back"
570660
+ }];
570661
+ const handleMenuSelect = (value_0) => {
570662
+ bb129:
570663
+ switch (value_0) {
570664
+ case "view": {
570665
+ setModeState({
570666
+ mode: "view-agent",
570667
+ agent: agentToUse,
570668
+ previousMode: modeState.previousMode
570669
+ });
570670
+ break bb129;
570671
+ }
570672
+ case "set-active": {
570673
+ onSetActiveAgent?.(sessionAgentToUse);
570674
+ setChanges((prev) => [...prev, `Active session agent set to: ${source_default.bold(sessionAgentToUse.agentType)}`]);
570675
+ setModeState({
570676
+ mode: "list-agents",
570677
+ source: "all"
570678
+ });
570679
+ break bb129;
570444
570680
  }
570445
- };
570446
- $2[66] = agentToUse;
570447
- $2[67] = modeState;
570448
- $2[68] = t18;
570449
- } else {
570450
- t18 = $2[68];
570451
- }
570452
- const handleMenuSelect = t18;
570681
+ case "edit": {
570682
+ setModeState({
570683
+ mode: "edit-agent",
570684
+ agent: agentToUse,
570685
+ previousMode: modeState
570686
+ });
570687
+ break bb129;
570688
+ }
570689
+ case "delete": {
570690
+ setModeState({
570691
+ mode: "delete-confirm",
570692
+ agent: agentToUse,
570693
+ previousMode: modeState
570694
+ });
570695
+ break bb129;
570696
+ }
570697
+ case "back": {
570698
+ setModeState(modeState.previousMode);
570699
+ }
570700
+ }
570701
+ };
570453
570702
  let t19;
570454
570703
  if ($2[69] !== modeState.previousMode) {
570455
570704
  t19 = () => setModeState(modeState.previousMode);
@@ -570921,7 +571170,7 @@ function _temp523(a_0) {
570921
571170
  function _temp431(a2) {
570922
571171
  return a2.source === "built-in";
570923
571172
  }
570924
- function _temp342(s_1) {
571173
+ function _temp341(s_1) {
570925
571174
  return s_1.toolPermissionContext;
570926
571175
  }
570927
571176
  function _temp266(s_0) {
@@ -570965,7 +571214,8 @@ async function call60(onDone, context2) {
570965
571214
  const tools = getTools(permissionContext);
570966
571215
  return /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(AgentsMenu, {
570967
571216
  tools,
570968
- onExit: onDone
571217
+ onExit: onDone,
571218
+ onSetActiveAgent: context2.setActiveSessionAgent
570969
571219
  }, undefined, false, undefined, this);
570970
571220
  }
570971
571221
  var jsx_dev_runtime336;
@@ -571846,7 +572096,7 @@ var init_bridge_kick = __esm(() => {
571846
572096
  var call66 = async () => {
571847
572097
  return {
571848
572098
  type: "text",
571849
- value: `${"99.0.0"} (built ${"2026-05-26T10:36:27.285Z"})`
572099
+ value: `${"99.0.0"} (built ${"2026-05-27T08:20:35.775Z"})`
571850
572100
  };
571851
572101
  }, version2, version_default;
571852
572102
  var init_version2 = __esm(() => {
@@ -572608,7 +572858,7 @@ function SandboxDependenciesTab(t0) {
572608
572858
  const bwrapMissing = t3;
572609
572859
  let t4;
572610
572860
  if ($2[5] !== depCheck.errors) {
572611
- t4 = depCheck.errors.some(_temp343);
572861
+ t4 = depCheck.errors.some(_temp342);
572612
572862
  $2[5] = depCheck.errors;
572613
572863
  $2[6] = t4;
572614
572864
  } else {
@@ -572826,7 +573076,7 @@ function _temp524(err2) {
572826
573076
  function _temp432(e_2) {
572827
573077
  return !e_2.includes("ripgrep") && !e_2.includes("bwrap") && !e_2.includes("socat");
572828
573078
  }
572829
- function _temp343(e_1) {
573079
+ function _temp342(e_1) {
572830
573080
  return e_1.includes("socat");
572831
573081
  }
572832
573082
  function _temp267(e_0) {
@@ -573941,7 +574191,7 @@ function ClaudeInChromeMenu(t0) {
573941
574191
  bb22:
573942
574192
  switch (action2) {
573943
574193
  case "install-extension": {
573944
- setSelectKey(_temp344);
574194
+ setSelectKey(_temp343);
573945
574195
  setShowInstallHint(true);
573946
574196
  openUrl(CHROME_EXTENSION_URL);
573947
574197
  break bb22;
@@ -574245,7 +574495,7 @@ function _temp525(k) {
574245
574495
  function _temp433(k_0) {
574246
574496
  return k_0 + 1;
574247
574497
  }
574248
- function _temp344(k_1) {
574498
+ function _temp343(k_1) {
574249
574499
  return k_1 + 1;
574250
574500
  }
574251
574501
  function _temp268(c6) {
@@ -575471,6 +575721,7 @@ async function streamRenderedMessages(messages, tools, sink, {
575471
575721
  screen: "prompt",
575472
575722
  streamingToolUses: [],
575473
575723
  showAllInTranscript: true,
575724
+ hideLogo: true,
575474
575725
  isLoading: false,
575475
575726
  renderRange: range
575476
575727
  }, undefined, false, undefined, this)
@@ -576361,6 +576612,7 @@ var init_openaiModelDiscovery = __esm(() => {
576361
576612
  var exports_model2 = {};
576362
576613
  __export(exports_model2, {
576363
576614
  shouldAutoRefreshRouteCatalog: () => shouldAutoRefreshRouteCatalog,
576615
+ mergeActiveProfileModelOptions: () => mergeActiveProfileModelOptions,
576364
576616
  call: () => call74
576365
576617
  });
576366
576618
  function renderModelLabel(model2) {
@@ -576376,6 +576628,37 @@ function haveSameModelOptions(left, right) {
576376
576628
  return other2 !== undefined && option.value === other2.value && option.label === other2.label && option.description === other2.description && option.descriptionForModel === other2.descriptionForModel;
576377
576629
  });
576378
576630
  }
576631
+ function mergeActiveProfileModelOptions(routeId, routeOptions) {
576632
+ const activeProfile = getActiveProviderProfile();
576633
+ if (!activeProfile) {
576634
+ return routeOptions;
576635
+ }
576636
+ const profileEnvApplied = process.env.CLAUDE_CODE_PROVIDER_PROFILE_ENV_APPLIED === "1" && process.env.CLAUDE_CODE_PROVIDER_PROFILE_ENV_APPLIED_ID === activeProfile.id;
576637
+ const activeProfileRouteId = resolveRouteIdFromBaseUrl(activeProfile.baseUrl) ?? resolveProfileRoute(activeProfile.provider).routeId;
576638
+ if (!profileEnvApplied || activeProfileRouteId !== routeId) {
576639
+ return routeOptions;
576640
+ }
576641
+ const profileOptions = getProfileModelOptions(activeProfile);
576642
+ if (profileOptions.length === 0) {
576643
+ return routeOptions;
576644
+ }
576645
+ const routeOptionsByValue = new Map(routeOptions.flatMap((option) => {
576646
+ const value = typeof option.value === "string" ? option.value.trim().toLowerCase() : "";
576647
+ return value ? [[value, option]] : [];
576648
+ }));
576649
+ const merged = [];
576650
+ const seen = new Set;
576651
+ for (const option of profileOptions) {
576652
+ const value = typeof option.value === "string" ? option.value.trim() : "";
576653
+ const key = value.toLowerCase();
576654
+ if (!value || seen.has(key)) {
576655
+ continue;
576656
+ }
576657
+ seen.add(key);
576658
+ merged.push(routeOptionsByValue.get(key) ?? option);
576659
+ }
576660
+ return merged;
576661
+ }
576379
576662
  function getActiveRouteId() {
576380
576663
  const activeProfile = getActiveProviderProfile();
576381
576664
  return resolveActiveRouteIdFromEnv(process.env, {
@@ -576429,11 +576712,12 @@ async function loadDescriptorDiscoveryContext(routeId) {
576429
576712
  if (staticEntries.length === 0) {
576430
576713
  return null;
576431
576714
  }
576715
+ const routeOptions2 = buildRouteCatalogModelOptions(routeLabel, staticEntries, routeDefaultModel);
576432
576716
  return {
576433
576717
  kind: "descriptor",
576434
576718
  autoRefresh: false,
576435
576719
  canRefresh,
576436
- optionsOverride: buildRouteCatalogModelOptions(routeLabel, staticEntries, routeDefaultModel),
576720
+ optionsOverride: mergeActiveProfileModelOptions(routeId, routeOptions2),
576437
576721
  routeId,
576438
576722
  routeDefaultModel,
576439
576723
  routeLabel
@@ -576463,12 +576747,13 @@ async function loadDescriptorDiscoveryContext(routeId) {
576463
576747
  tone: "info"
576464
576748
  };
576465
576749
  }
576750
+ const routeOptions = buildRouteCatalogModelOptions(routeLabel, mergedEntries, routeDefaultModel);
576466
576751
  return {
576467
576752
  kind: "descriptor",
576468
576753
  autoRefresh,
576469
576754
  canRefresh,
576470
576755
  discoveryState,
576471
- optionsOverride: buildRouteCatalogModelOptions(routeLabel, mergedEntries, routeDefaultModel),
576756
+ optionsOverride: mergeActiveProfileModelOptions(routeId, routeOptions),
576472
576757
  routeId,
576473
576758
  routeDefaultModel,
576474
576759
  routeLabel
@@ -576614,7 +576899,7 @@ function ModelPickerWrapper({
576614
576899
  ...getOpenAIDiscoveryRequestOptions(discoveryContext.routeId),
576615
576900
  forceRefresh: true
576616
576901
  });
576617
- const nextOptions = buildRouteCatalogModelOptions(discoveryContext.routeLabel, result?.models ?? [], discoveryContext.routeDefaultModel);
576902
+ const nextOptions = mergeActiveProfileModelOptions(discoveryContext.routeId, buildRouteCatalogModelOptions(discoveryContext.routeLabel, result?.models ?? [], discoveryContext.routeDefaultModel));
576618
576903
  const changed = !haveSameModelOptions(optionsOverride ?? [], nextOptions);
576619
576904
  setOptionsOverride(nextOptions);
576620
576905
  setDiscoveryState(descriptorDiscoveryStateForResult({
@@ -576790,7 +577075,7 @@ async function refreshModelsAndSummarize() {
576790
577075
  ...getOpenAIDiscoveryRequestOptions(discoveryContext.routeId),
576791
577076
  forceRefresh: true
576792
577077
  });
576793
- const nextOptions = buildRouteCatalogModelOptions(discoveryContext.routeLabel, result?.models ?? [], discoveryContext.routeDefaultModel);
577078
+ const nextOptions = mergeActiveProfileModelOptions(discoveryContext.routeId, buildRouteCatalogModelOptions(discoveryContext.routeLabel, result?.models ?? [], discoveryContext.routeDefaultModel));
576794
577079
  const changed = !haveSameModelOptions(discoveryContext.optionsOverride, nextOptions);
576795
577080
  return descriptorDiscoveryStateForResult({
576796
577081
  changed,
@@ -576864,6 +577149,7 @@ var init_model2 = __esm(() => {
576864
577149
  init_discoveryCache();
576865
577150
  init_discoveryService();
576866
577151
  init_routeMetadata();
577152
+ init_profileResolver();
576867
577153
  init_providerConfig();
576868
577154
  init_AppState();
576869
577155
  init_extraUsage();
@@ -596584,15 +596870,15 @@ ${deferredToolList}
596584
596870
  }
596585
596871
  }
596586
596872
  const maxOutputTokens2 = retryContext?.maxTokensOverride || options2.maxOutputTokensOverride || getMaxOutputTokensForModel(options2.model);
596587
- const hasThinking = thinkingConfig.type !== "disabled" && !isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_THINKING);
596873
+ const hasThinking = shouldUseThinkingForModel(retryContext.model, thinkingConfig);
596588
596874
  let thinking = undefined;
596589
- if (hasThinking && modelSupportsThinking(options2.model)) {
596590
- if (!isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING) && modelSupportsAdaptiveThinking(options2.model)) {
596875
+ if (hasThinking) {
596876
+ if (!isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING) && modelSupportsAdaptiveThinking(retryContext.model)) {
596591
596877
  thinking = {
596592
596878
  type: "adaptive"
596593
596879
  };
596594
596880
  } else {
596595
- let thinkingBudget = getMaxThinkingTokensForModel(options2.model);
596881
+ let thinkingBudget = getMaxThinkingTokensForModel(retryContext.model);
596596
596882
  if (thinkingConfig.type === "enabled" && thinkingConfig.budgetTokens !== undefined) {
596597
596883
  thinkingBudget = thinkingConfig.budgetTokens;
596598
596884
  }
@@ -599357,6 +599643,9 @@ function preconnectAnthropicApi() {
599357
599643
  if (fired)
599358
599644
  return;
599359
599645
  fired = true;
599646
+ 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)) {
599647
+ return;
599648
+ }
599360
599649
  if (getAPIProvider() !== "firstParty") {
599361
599650
  return;
599362
599651
  }
@@ -602177,8 +602466,8 @@ var init_types15 = __esm(() => {
602177
602466
  attribution: exports_external.object({
602178
602467
  commit: exports_external.string().optional().describe("Attribution text for git commits, including any trailers. " + "Empty string hides attribution."),
602179
602468
  pr: exports_external.string().optional().describe("Attribution text for pull request descriptions. " + "Empty string hides attribution.")
602180
- }).optional().describe("Customize attribution text for commits and PRs. " + "Each field defaults to the standard Claude Code attribution if not set."),
602181
- 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)"),
602469
+ }).optional().describe("Customize attribution text for commits and PRs. " + "Unspecified fields are off by default; set a non-empty string to opt in."),
602470
+ 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)"),
602182
602471
  includeGitInstructions: exports_external.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),
602183
602472
  permissions: PermissionsSchema().optional().describe("Tool usage permissions configuration"),
602184
602473
  model: exports_external.string().optional().describe("Override the default model used by Claude Code"),
@@ -604304,7 +604593,7 @@ function printStartupScreen(modelOverride) {
604304
604593
  const sLen = ` ● ${sL} Ready — type /help to begin`.length;
604305
604594
  out.push(boxRow(sRow, W2, sLen, BORDER));
604306
604595
  out.push(`${ansiRgb(...BORDER)}╚${"═".repeat(W2 - 2)}╝${RESET2}`);
604307
- out.push(` ${DIM2}${ansiRgb(...DIMCOL)}openclaude ${RESET2}${ansiRgb(...ACCENT)}v${"0.14.9"}${RESET2}`);
604596
+ out.push(` ${DIM2}${ansiRgb(...DIMCOL)}openclaude ${RESET2}${ansiRgb(...ACCENT)}v${"0.15.1"}${RESET2}`);
604308
604597
  out.push("");
604309
604598
  process.stdout.write(out.join(`
604310
604599
  `) + `
@@ -609076,7 +609365,7 @@ function QuestionNavigationBar(t0) {
609076
609365
  }
609077
609366
  const tabHeaders = questions.map(_temp157);
609078
609367
  const idealWidths = tabHeaders.map(_temp269);
609079
- const totalIdealWidth = idealWidths.reduce(_temp345, 0);
609368
+ const totalIdealWidth = idealWidths.reduce(_temp344, 0);
609080
609369
  if (totalIdealWidth <= availableForTabs) {
609081
609370
  t2 = tabHeaders;
609082
609371
  break bb0;
@@ -609244,7 +609533,7 @@ function QuestionNavigationBar(t0) {
609244
609533
  }
609245
609534
  return t7;
609246
609535
  }
609247
- function _temp345(sum, w) {
609536
+ function _temp344(sum, w) {
609248
609537
  return sum + w;
609249
609538
  }
609250
609539
  function _temp269(header_0) {
@@ -609835,7 +610124,7 @@ function QuestionView(t0) {
609835
610124
  t7 = $2[17];
609836
610125
  }
609837
610126
  const options2 = t7;
609838
- const hasAnyPreview = !question.multiSelect && question.options.some(_temp346);
610127
+ const hasAnyPreview = !question.multiSelect && question.options.some(_temp345);
609839
610128
  if (hasAnyPreview) {
609840
610129
  let t82;
609841
610130
  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) {
@@ -610224,7 +610513,7 @@ function QuestionView(t0) {
610224
610513
  function _temp434(v) {
610225
610514
  return v !== "__other__";
610226
610515
  }
610227
- function _temp346(opt_0) {
610516
+ function _temp345(opt_0) {
610228
610517
  return opt_0.preview;
610229
610518
  }
610230
610519
  function _temp270(opt) {
@@ -610922,7 +611211,7 @@ function AskUserQuestionPermissionRequestBody(t0) {
610922
611211
  const onRemoveImage = t8;
610923
611212
  let t9;
610924
611213
  if ($2[18] !== pastedContentsByQuestion) {
610925
- t9 = Object.values(pastedContentsByQuestion).flatMap(_temp271).filter(_temp347);
611214
+ t9 = Object.values(pastedContentsByQuestion).flatMap(_temp271).filter(_temp346);
610926
611215
  $2[18] = pastedContentsByQuestion;
610927
611216
  $2[19] = t9;
610928
611217
  } else {
@@ -611363,7 +611652,7 @@ function _temp526(c_0) {
611363
611652
  function _temp435(s) {
611364
611653
  return s.toolPermissionContext.mode;
611365
611654
  }
611366
- function _temp347(c6) {
611655
+ function _temp346(c6) {
611367
611656
  return c6.type === "image";
611368
611657
  }
611369
611658
  function _temp271(contents) {
@@ -612599,7 +612888,7 @@ function SuggestionDisplay(t0) {
612599
612888
  }, undefined, false, undefined, this),
612600
612889
  /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(ThemedBox_default, {
612601
612890
  flexDirection: "column",
612602
- children: directories.map(_temp348)
612891
+ children: directories.map(_temp347)
612603
612892
  }, undefined, false, undefined, this)
612604
612893
  ]
612605
612894
  }, undefined, true, undefined, this),
@@ -612635,7 +612924,7 @@ function SuggestionDisplay(t0) {
612635
612924
  }
612636
612925
  return t1;
612637
612926
  }
612638
- function _temp348(dir, index_0) {
612927
+ function _temp347(dir, index_0) {
612639
612928
  return /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(ThemedText, {
612640
612929
  children: [
612641
612930
  figures_default.bullet,
@@ -618271,7 +618560,7 @@ function NotebookEditToolDiffInner(t0) {
618271
618560
  firstLine: new_source.split(`
618272
618561
  `)[0] ?? null,
618273
618562
  fileContent: oldSource
618274
- }, _.newStart, false, undefined, this)), _temp349) : /* @__PURE__ */ jsx_dev_runtime396.jsxDEV(HighlightedCode, {
618563
+ }, _.newStart, false, undefined, this)), _temp348) : /* @__PURE__ */ jsx_dev_runtime396.jsxDEV(HighlightedCode, {
618275
618564
  code: new_source,
618276
618565
  filePath: cell_type === "markdown" ? "file.md" : notebook_path
618277
618566
  }, undefined, false, undefined, this);
@@ -618308,7 +618597,7 @@ function NotebookEditToolDiffInner(t0) {
618308
618597
  }
618309
618598
  return t10;
618310
618599
  }
618311
- function _temp349(i3) {
618600
+ function _temp348(i3) {
618312
618601
  return /* @__PURE__ */ jsx_dev_runtime396.jsxDEV(NoSelect, {
618313
618602
  fromLeftEdge: true,
618314
618603
  children: /* @__PURE__ */ jsx_dev_runtime396.jsxDEV(ThemedText, {
@@ -622711,7 +623000,7 @@ function CompanionFloatingBubble() {
622711
623000
  if (!reaction) {
622712
623001
  return;
622713
623002
  }
622714
- const timer = setInterval(_temp350, TICK_MS2, setTick);
623003
+ const timer = setInterval(_temp349, TICK_MS2, setTick);
622715
623004
  return () => clearInterval(timer);
622716
623005
  };
622717
623006
  t3 = [reaction];
@@ -622747,7 +623036,7 @@ function CompanionFloatingBubble() {
622747
623036
  }
622748
623037
  return t5;
622749
623038
  }
622750
- function _temp350(set3) {
623039
+ function _temp349(set3) {
622751
623040
  return set3(_temp274);
622752
623041
  }
622753
623042
  function _temp274(s_0) {
@@ -628103,7 +628392,7 @@ function BridgeDialog(t0) {
628103
628392
  useRegisterOverlay("bridge-dialog");
628104
628393
  const connected = useAppState(_temp183);
628105
628394
  const sessionActive = useAppState(_temp276);
628106
- const reconnecting = useAppState(_temp351);
628395
+ const reconnecting = useAppState(_temp350);
628107
628396
  const connectUrl = useAppState(_temp437);
628108
628397
  const sessionUrl = useAppState(_temp528);
628109
628398
  const error42 = useAppState(_temp622);
@@ -628531,7 +628820,7 @@ function _temp528(s_3) {
628531
628820
  function _temp437(s_2) {
628532
628821
  return s_2.replBridgeConnectUrl;
628533
628822
  }
628534
- function _temp351(s_1) {
628823
+ function _temp350(s_1) {
628535
628824
  return s_1.replBridgeReconnecting;
628536
628825
  }
628537
628826
  function _temp276(s_0) {
@@ -629261,12 +629550,12 @@ function _temp438(query_0, controller_1, setMatches_0, setTruncated_0, setIsSear
629261
629550
  return;
629262
629551
  }
629263
629552
  if (collected === 0) {
629264
- setMatches_0(_temp352);
629553
+ setMatches_0(_temp351);
629265
629554
  }
629266
629555
  setIsSearching_0(false);
629267
629556
  });
629268
629557
  }
629269
- function _temp352(m_2) {
629558
+ function _temp351(m_2) {
629270
629559
  return m_2.length ? [] : m_2;
629271
629560
  }
629272
629561
  function _temp277() {}
@@ -629511,7 +629800,7 @@ function QuickOpenDialog(t0) {
629511
629800
  if (gen !== queryGenRef.current) {
629512
629801
  return;
629513
629802
  }
629514
- const paths2 = items.filter(_temp187).map(_temp278).filter(_temp353).map(_temp439);
629803
+ const paths2 = items.filter(_temp187).map(_temp278).filter(_temp352).map(_temp439);
629515
629804
  setResults(paths2);
629516
629805
  });
629517
629806
  };
@@ -629702,7 +629991,7 @@ function _temp529(p_3) {
629702
629991
  function _temp439(p_0) {
629703
629992
  return p_0.split(path22.sep).join("/");
629704
629993
  }
629705
- function _temp353(p) {
629994
+ function _temp352(p) {
629706
629995
  return !p.endsWith(path22.sep);
629707
629996
  }
629708
629997
  function _temp278(i_0) {
@@ -632342,7 +632631,7 @@ function BackgroundTaskStatus(t0) {
632342
632631
  const viewingAgentTaskId = useAppState(_temp280);
632343
632632
  let t3;
632344
632633
  if ($2[0] !== tasks2) {
632345
- t3 = Object.values(tasks2 ?? {}).filter(_temp354);
632634
+ t3 = Object.values(tasks2 ?? {}).filter(_temp353);
632346
632635
  $2[0] = tasks2;
632347
632636
  $2[1] = t3;
632348
632637
  } else {
@@ -632627,7 +632916,7 @@ function _temp530(t_0) {
632627
632916
  function _temp440(s_1) {
632628
632917
  return s_1.expandedView;
632629
632918
  }
632630
- function _temp354(t) {
632919
+ function _temp353(t) {
632631
632920
  return isBackgroundTask(t) && true;
632632
632921
  }
632633
632922
  function _temp280(s_0) {
@@ -640991,18 +641280,25 @@ async function initialize3() {
640991
641280
  if (initialized4 || disposed3)
640992
641281
  return;
640993
641282
  initialized4 = true;
641283
+ unregisterCleanup = registerCleanup(async () => {
641284
+ await dispose3();
641285
+ });
640994
641286
  if (!dynamicSkillsCallbackRegistered) {
640995
641287
  dynamicSkillsCallbackRegistered = true;
640996
- onDynamicSkillsLoaded(() => {
640997
- clearCommandMemoizationCaches();
641288
+ unregisterDynamicSkillsCallback = dependencies2.onDynamicSkillsLoaded(() => {
641289
+ if (disposed3)
641290
+ return;
641291
+ dependencies2.clearCommandMemoizationCaches();
640998
641292
  skillsChanged.emit();
640999
641293
  });
641000
641294
  }
641001
641295
  const paths2 = await getWatchablePaths();
641296
+ if (disposed3)
641297
+ return;
641002
641298
  if (paths2.length === 0)
641003
641299
  return;
641004
641300
  logForDebugging(`Watching for changes in skill/command directories: ${paths2.join(", ")}...`);
641005
- watcher5 = esm_default.watch(paths2, {
641301
+ watcher5 = dependencies2.watch(paths2, {
641006
641302
  persistent: true,
641007
641303
  ignoreInitial: true,
641008
641304
  depth: 2,
@@ -641023,9 +641319,6 @@ async function initialize3() {
641023
641319
  watcher5.on("add", handleChange3);
641024
641320
  watcher5.on("change", handleChange3);
641025
641321
  watcher5.on("unlink", handleChange3);
641026
- unregisterCleanup = registerCleanup(async () => {
641027
- await dispose3();
641028
- });
641029
641322
  }
641030
641323
  function dispose3() {
641031
641324
  disposed3 = true;
@@ -641033,6 +641326,11 @@ function dispose3() {
641033
641326
  unregisterCleanup();
641034
641327
  unregisterCleanup = null;
641035
641328
  }
641329
+ if (unregisterDynamicSkillsCallback) {
641330
+ unregisterDynamicSkillsCallback();
641331
+ unregisterDynamicSkillsCallback = null;
641332
+ dynamicSkillsCallbackRegistered = false;
641333
+ }
641036
641334
  let closePromise = Promise.resolve();
641037
641335
  if (watcher5) {
641038
641336
  closePromise = watcher5.close();
@@ -641043,27 +641341,29 @@ function dispose3() {
641043
641341
  reloadTimer = null;
641044
641342
  }
641045
641343
  pendingChangedPaths.clear();
641344
+ lastReloadTime = 0;
641345
+ reloadInProgress = false;
641046
641346
  skillsChanged.clear();
641047
641347
  return closePromise;
641048
641348
  }
641049
641349
  async function getWatchablePaths() {
641050
- const fs5 = getFsImplementation();
641350
+ const fs5 = dependencies2.getFsImplementation();
641051
641351
  const paths2 = [];
641052
- const userSkillsPath = getSkillsPath("userSettings", "skills");
641352
+ const userSkillsPath = dependencies2.getSkillsPath("userSettings", "skills");
641053
641353
  if (userSkillsPath) {
641054
641354
  try {
641055
641355
  await fs5.stat(userSkillsPath);
641056
641356
  paths2.push(userSkillsPath);
641057
641357
  } catch {}
641058
641358
  }
641059
- const userCommandsPath = getSkillsPath("userSettings", "commands");
641359
+ const userCommandsPath = dependencies2.getSkillsPath("userSettings", "commands");
641060
641360
  if (userCommandsPath) {
641061
641361
  try {
641062
641362
  await fs5.stat(userCommandsPath);
641063
641363
  paths2.push(userCommandsPath);
641064
641364
  } catch {}
641065
641365
  }
641066
- const projectSkillsPath = getSkillsPath("projectSettings", "skills");
641366
+ const projectSkillsPath = dependencies2.getSkillsPath("projectSettings", "skills");
641067
641367
  if (projectSkillsPath) {
641068
641368
  try {
641069
641369
  const absolutePath = platformPath2.resolve(projectSkillsPath);
@@ -641071,7 +641371,7 @@ async function getWatchablePaths() {
641071
641371
  paths2.push(absolutePath);
641072
641372
  } catch {}
641073
641373
  }
641074
- const projectCommandsPath = getSkillsPath("projectSettings", "commands");
641374
+ const projectCommandsPath = dependencies2.getSkillsPath("projectSettings", "commands");
641075
641375
  if (projectCommandsPath) {
641076
641376
  try {
641077
641377
  const absolutePath = platformPath2.resolve(projectCommandsPath);
@@ -641089,6 +641389,8 @@ async function getWatchablePaths() {
641089
641389
  return paths2;
641090
641390
  }
641091
641391
  function handleChange3(path24) {
641392
+ if (disposed3)
641393
+ return;
641092
641394
  logForDebugging(`Detected skill change: ${path24}`);
641093
641395
  logEvent("tengu_skill_file_changed", {
641094
641396
  source: "chokidar"
@@ -641096,40 +641398,80 @@ function handleChange3(path24) {
641096
641398
  scheduleReload(path24);
641097
641399
  }
641098
641400
  function scheduleReload(changedPath) {
641401
+ if (disposed3)
641402
+ return;
641099
641403
  pendingChangedPaths.add(changedPath);
641404
+ if (reloadInProgress)
641405
+ return;
641406
+ scheduleReloadTimer();
641407
+ }
641408
+ function scheduleReloadTimer() {
641100
641409
  if (reloadTimer)
641101
641410
  clearTimeout(reloadTimer);
641411
+ const debounceMs = testOverrides2?.reloadDebounce ?? RELOAD_DEBOUNCE_MS;
641412
+ const reloadCooldownMs = testOverrides2?.reloadCooldown ?? RELOAD_COOLDOWN_MS;
641413
+ const cooldownRemaining = lastReloadTime + reloadCooldownMs - Date.now();
641414
+ const delay = Math.max(debounceMs, cooldownRemaining);
641102
641415
  reloadTimer = setTimeout(async () => {
641103
641416
  reloadTimer = null;
641417
+ if (disposed3)
641418
+ return;
641104
641419
  const paths2 = [...pendingChangedPaths];
641105
641420
  pendingChangedPaths.clear();
641106
- const results = await executeConfigChangeHooks("skills", paths2[0]);
641107
- if (hasBlockingResult(results)) {
641108
- logForDebugging(`ConfigChange hook blocked skill reload (${paths2.length} paths)`);
641421
+ if (paths2.length === 0)
641109
641422
  return;
641423
+ reloadInProgress = true;
641424
+ try {
641425
+ const results = await dependencies2.executeConfigChangeHooks("skills", paths2[0]);
641426
+ if (dependencies2.hasBlockingResult(results)) {
641427
+ logForDebugging(`ConfigChange hook blocked skill reload (${paths2.length} paths)`);
641428
+ return;
641429
+ }
641430
+ if (disposed3)
641431
+ return;
641432
+ if (pendingChangedPaths.size > 0) {
641433
+ logForDebugging(`Deferring skill reload because ${pendingChangedPaths.size} newer paths arrived during hooks`);
641434
+ return;
641435
+ }
641436
+ dependencies2.clearCommandsCache();
641437
+ dependencies2.resetSentSkillNames();
641438
+ lastReloadTime = Date.now();
641439
+ skillsChanged.emit();
641440
+ } finally {
641441
+ reloadInProgress = false;
641442
+ if (!disposed3 && pendingChangedPaths.size > 0) {
641443
+ scheduleReloadTimer();
641444
+ }
641110
641445
  }
641111
- clearSkillCaches();
641112
- clearCommandsCache();
641113
- resetSentSkillNames();
641114
- skillsChanged.emit();
641115
- }, testOverrides2?.reloadDebounce ?? RELOAD_DEBOUNCE_MS);
641446
+ }, delay);
641116
641447
  }
641117
641448
  async function resetForTesting2(overrides) {
641118
641449
  if (watcher5) {
641119
641450
  await watcher5.close();
641120
641451
  watcher5 = null;
641121
641452
  }
641453
+ if (unregisterCleanup) {
641454
+ unregisterCleanup();
641455
+ unregisterCleanup = null;
641456
+ }
641457
+ if (unregisterDynamicSkillsCallback) {
641458
+ unregisterDynamicSkillsCallback();
641459
+ unregisterDynamicSkillsCallback = null;
641460
+ dynamicSkillsCallbackRegistered = false;
641461
+ }
641122
641462
  if (reloadTimer) {
641123
641463
  clearTimeout(reloadTimer);
641124
641464
  reloadTimer = null;
641125
641465
  }
641126
641466
  pendingChangedPaths.clear();
641467
+ lastReloadTime = 0;
641468
+ reloadInProgress = false;
641127
641469
  skillsChanged.clear();
641128
641470
  initialized4 = false;
641129
641471
  disposed3 = false;
641130
641472
  testOverrides2 = overrides ?? null;
641131
641473
  }
641132
- 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;
641474
+ 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;
641133
641475
  var init_skillChangeDetector = __esm(() => {
641134
641476
  init_esm2();
641135
641477
  init_state();
@@ -641143,6 +641485,18 @@ var init_skillChangeDetector = __esm(() => {
641143
641485
  USE_POLLING = typeof Bun !== "undefined";
641144
641486
  pendingChangedPaths = new Set;
641145
641487
  skillsChanged = createSignal();
641488
+ defaultDependencies2 = {
641489
+ clearCommandMemoizationCaches,
641490
+ clearCommandsCache,
641491
+ executeConfigChangeHooks,
641492
+ getFsImplementation,
641493
+ getSkillsPath,
641494
+ hasBlockingResult,
641495
+ onDynamicSkillsLoaded,
641496
+ resetSentSkillNames,
641497
+ watch: esm_default.watch.bind(esm_default)
641498
+ };
641499
+ dependencies2 = defaultDependencies2;
641146
641500
  subscribe2 = skillsChanged.subscribe;
641147
641501
  skillChangeDetector = {
641148
641502
  initialize: initialize3,
@@ -642460,6 +642814,34 @@ var init_useInboxPoller = __esm(() => {
642460
642814
  import_react280 = __toESM(require_react(), 1);
642461
642815
  });
642462
642816
 
642817
+ // src/screens/replActiveAgentModel.ts
642818
+ function getActiveSessionAgentModelSelection({
642819
+ agent: agent2,
642820
+ baseMainLoopModel,
642821
+ hasExplicitModelOverride,
642822
+ hasAgentManagedModel
642823
+ }) {
642824
+ if (hasExplicitModelOverride) {
642825
+ return { shouldUpdateModel: false };
642826
+ }
642827
+ if (agent2.model && agent2.model !== "inherit") {
642828
+ return {
642829
+ shouldUpdateModel: true,
642830
+ mainLoopModelForSession: parseUserSpecifiedModel(agent2.model)
642831
+ };
642832
+ }
642833
+ if (!hasAgentManagedModel) {
642834
+ return { shouldUpdateModel: false };
642835
+ }
642836
+ return {
642837
+ shouldUpdateModel: true,
642838
+ mainLoopModelForSession: baseMainLoopModel ?? getDefaultMainLoopModelSetting()
642839
+ };
642840
+ }
642841
+ var init_replActiveAgentModel = __esm(() => {
642842
+ init_model();
642843
+ });
642844
+
642463
642845
  // src/hooks/useTaskListWatcher.ts
642464
642846
  var import_react281;
642465
642847
  var init_useTaskListWatcher = __esm(() => {
@@ -643730,7 +644112,7 @@ function usePostCompactSurvey(messages, isLoading, t0, t1) {
643730
644112
  import_react291.useEffect(t6, t7);
643731
644113
  let t8;
643732
644114
  if ($2[7] !== messages) {
643733
- t8 = new Set(messages.filter(_temp355).map(_temp441));
644115
+ t8 = new Set(messages.filter(_temp354).map(_temp441));
643734
644116
  $2[7] = messages;
643735
644117
  $2[8] = t8;
643736
644118
  } else {
@@ -643809,7 +644191,7 @@ function usePostCompactSurvey(messages, isLoading, t0, t1) {
643809
644191
  function _temp441(msg_0) {
643810
644192
  return msg_0.uuid;
643811
644193
  }
643812
- function _temp355(msg) {
644194
+ function _temp354(msg) {
643813
644195
  return isCompactBoundaryMessage(msg);
643814
644196
  }
643815
644197
  function _temp283(appearanceId_0, selected) {
@@ -646813,7 +647195,7 @@ function useMcpConnectivityStatus(t0) {
646813
647195
  }
646814
647196
  const failedLocalClients = mcpClients.filter(_temp204);
646815
647197
  const failedClaudeAiClients = mcpClients.filter(_temp286);
646816
- const needsAuthLocalServers = mcpClients.filter(_temp356);
647198
+ const needsAuthLocalServers = mcpClients.filter(_temp355);
646817
647199
  const needsAuthClaudeAiServers = mcpClients.filter(_temp442);
646818
647200
  if (failedLocalClients.length === 0 && failedClaudeAiClients.length === 0 && needsAuthLocalServers.length === 0 && needsAuthClaudeAiServers.length === 0) {
646819
647201
  return;
@@ -646935,7 +647317,7 @@ function useMcpConnectivityStatus(t0) {
646935
647317
  function _temp442(client_2) {
646936
647318
  return client_2.type === "needs-auth" && client_2.config.type === "claudeai-proxy" && hasClaudeAiMcpEverConnected(client_2.name);
646937
647319
  }
646938
- function _temp356(client_1) {
647320
+ function _temp355(client_1) {
646939
647321
  return client_1.type === "needs-auth" && client_1.config.type !== "claudeai-proxy";
646940
647322
  }
646941
647323
  function _temp286(client_0) {
@@ -647830,7 +648212,7 @@ function usePluginInstallationStatus() {
647830
648212
  const failedMarketplaces = t12;
647831
648213
  let t22;
647832
648214
  if ($2[3] !== installationStatus.plugins) {
647833
- t22 = installationStatus.plugins.filter(_temp357);
648215
+ t22 = installationStatus.plugins.filter(_temp356);
647834
648216
  $2[3] = installationStatus.plugins;
647835
648217
  $2[4] = t22;
647836
648218
  } else {
@@ -647921,7 +648303,7 @@ function usePluginInstallationStatus() {
647921
648303
  }
647922
648304
  import_react300.useEffect(t1, t2);
647923
648305
  }
647924
- function _temp357(p) {
648306
+ function _temp356(p) {
647925
648307
  return p.status === "failed";
647926
648308
  }
647927
648309
  function _temp289(m) {
@@ -649158,7 +649540,7 @@ function useFastModeNotification() {
649158
649540
  return;
649159
649541
  }
649160
649542
  return onFastModeOverageRejection((message) => {
649161
- setAppState(_temp358);
649543
+ setAppState(_temp357);
649162
649544
  addNotification({
649163
649545
  key: OVERAGE_REJECTED_KEY,
649164
649546
  color: "warning",
@@ -649225,7 +649607,7 @@ function useFastModeNotification() {
649225
649607
  }
649226
649608
  import_react307.useEffect(t4, t5);
649227
649609
  }
649228
- function _temp358(prev_0) {
649610
+ function _temp357(prev_0) {
649229
649611
  return {
649230
649612
  ...prev_0,
649231
649613
  fastMode: false
@@ -651022,6 +651404,8 @@ function REPL({
651022
651404
  onTurnComplete,
651023
651405
  disabled = false,
651024
651406
  mainThreadAgentDefinition: initialMainThreadAgentDefinition,
651407
+ baseMainLoopModel = null,
651408
+ hasExplicitModelOverride = false,
651025
651409
  disableSlashCommands = false,
651026
651410
  taskListId,
651027
651411
  remoteSessionConfig,
@@ -651085,6 +651469,34 @@ function REPL({
651085
651469
  const store = useAppStateStore();
651086
651470
  const terminal = useTerminalNotification();
651087
651471
  const mainLoopModel = useMainLoopModel();
651472
+ const appMainLoopModel = useAppState((s) => s.mainLoopModel);
651473
+ const appMainLoopModelForSession = useAppState((s) => s.mainLoopModelForSession);
651474
+ const initialAgentModelSelection = !hasExplicitModelOverride && initialMainThreadAgentDefinition?.model && initialMainThreadAgentDefinition.model !== "inherit" ? getActiveSessionAgentModelSelection({
651475
+ agent: initialMainThreadAgentDefinition,
651476
+ baseMainLoopModel,
651477
+ hasExplicitModelOverride,
651478
+ hasAgentManagedModel: false
651479
+ }) : undefined;
651480
+ const explicitModelOverrideRef = import_react315.useRef(hasExplicitModelOverride);
651481
+ const baseMainLoopModelRef = import_react315.useRef(baseMainLoopModel);
651482
+ const agentManagedModelRef = import_react315.useRef(initialAgentModelSelection?.shouldUpdateModel ? initialAgentModelSelection.mainLoopModelForSession : undefined);
651483
+ const previousMainLoopModelForSessionRef = import_react315.useRef(appMainLoopModelForSession);
651484
+ const didTrackInitialModelStateRef = import_react315.useRef(false);
651485
+ import_react315.useEffect(() => {
651486
+ const previousMainLoopModelForSession = previousMainLoopModelForSessionRef.current;
651487
+ previousMainLoopModelForSessionRef.current = appMainLoopModelForSession;
651488
+ if (!didTrackInitialModelStateRef.current) {
651489
+ didTrackInitialModelStateRef.current = true;
651490
+ return;
651491
+ }
651492
+ const currentEffectiveModelSetting = appMainLoopModelForSession ?? appMainLoopModel;
651493
+ const clearedAgentManagedSessionModel = previousMainLoopModelForSession !== null && appMainLoopModelForSession === null;
651494
+ if (!clearedAgentManagedSessionModel && currentEffectiveModelSetting === agentManagedModelRef.current)
651495
+ return;
651496
+ explicitModelOverrideRef.current = true;
651497
+ baseMainLoopModelRef.current = currentEffectiveModelSetting;
651498
+ agentManagedModelRef.current = undefined;
651499
+ }, [appMainLoopModel, appMainLoopModelForSession]);
651088
651500
  const [localCommands, setLocalCommands] = import_react315.useState(initialCommands);
651089
651501
  useSkillsChange(isRemoteSession ? undefined : getProjectRoot(), setLocalCommands);
651090
651502
  const proactiveActive = React165.useSyncExternalStore(proactiveModule5?.subscribeToProactiveChanges ?? PROACTIVE_NO_OP_SUBSCRIBE, proactiveModule5?.isProactiveActive ?? PROACTIVE_FALSE);
@@ -652228,6 +652640,31 @@ Error: sandbox required but unavailable: ${reason}
652228
652640
  },
652229
652641
  resume: resume2,
652230
652642
  setConversationId,
652643
+ setActiveSessionAgent: (agent2) => {
652644
+ const modelSelection = getActiveSessionAgentModelSelection({
652645
+ agent: agent2,
652646
+ baseMainLoopModel: baseMainLoopModelRef.current,
652647
+ hasExplicitModelOverride: explicitModelOverrideRef.current,
652648
+ hasAgentManagedModel: agentManagedModelRef.current !== undefined
652649
+ });
652650
+ setMainThreadAgentDefinition(agent2);
652651
+ setMainThreadAgentType(agent2.agentType);
652652
+ saveAgentSetting(agent2.agentType);
652653
+ if (modelSelection.shouldUpdateModel) {
652654
+ agentManagedModelRef.current = modelSelection.mainLoopModelForSession;
652655
+ setMainLoopModelOverride(modelSelection.mainLoopModelForSession);
652656
+ notifySessionMetadataChanged({
652657
+ model: modelSelection.mainLoopModelForSession
652658
+ });
652659
+ }
652660
+ setAppState((prev) => ({
652661
+ ...prev,
652662
+ agent: agent2.agentType,
652663
+ ...modelSelection.shouldUpdateModel ? {
652664
+ mainLoopModelForSession: modelSelection.mainLoopModelForSession
652665
+ } : {}
652666
+ }));
652667
+ },
652231
652668
  requestPrompt,
652232
652669
  contentReplacementState: contentReplacementStateRef.current,
652233
652670
  syncToolResultReplacements
@@ -654350,9 +654787,11 @@ var init_REPL = __esm(() => {
654350
654787
  init_commitAttribution();
654351
654788
  init_sessionStorage();
654352
654789
  init_sessionRestore();
654790
+ init_sessionState();
654353
654791
  init_concurrentSessions();
654354
654792
  init_RemoteAgentTask();
654355
654793
  init_useInboxPoller();
654794
+ init_replActiveAgentModel();
654356
654795
  init_agentSwarmsEnabled();
654357
654796
  init_useTaskListWatcher();
654358
654797
  init_ide();
@@ -655615,7 +656054,7 @@ function WelcomeV2() {
655615
656054
  dimColor: true,
655616
656055
  children: [
655617
656056
  "v",
655618
- "0.14.9",
656057
+ "0.15.1",
655619
656058
  " "
655620
656059
  ]
655621
656060
  }, undefined, true, undefined, this)
@@ -655815,7 +656254,7 @@ function WelcomeV2() {
655815
656254
  dimColor: true,
655816
656255
  children: [
655817
656256
  "v",
655818
- "0.14.9",
656257
+ "0.15.1",
655819
656258
  " "
655820
656259
  ]
655821
656260
  }, undefined, true, undefined, this)
@@ -656041,7 +656480,7 @@ function AppleTerminalWelcomeV2(t0) {
656041
656480
  dimColor: true,
656042
656481
  children: [
656043
656482
  "v",
656044
- "0.14.9",
656483
+ "0.15.1",
656045
656484
  " "
656046
656485
  ]
656047
656486
  }, undefined, true, undefined, this);
@@ -656295,7 +656734,7 @@ function AppleTerminalWelcomeV2(t0) {
656295
656734
  dimColor: true,
656296
656735
  children: [
656297
656736
  "v",
656298
- "0.14.9",
656737
+ "0.15.1",
656299
656738
  " "
656300
656739
  ]
656301
656740
  }, undefined, true, undefined, this);
@@ -657463,9 +657902,9 @@ function _temp531(current) {
657463
657902
  };
657464
657903
  }
657465
657904
  function _temp443(command_0) {
657466
- 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);
657905
+ 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);
657467
657906
  }
657468
- function _temp359(tool_0) {
657907
+ function _temp358(tool_0) {
657469
657908
  return tool_0 === BASH_TOOL_NAME || tool_0.startsWith(BASH_TOOL_NAME + "(");
657470
657909
  }
657471
657910
  function _temp298(command10) {
@@ -658999,6 +659438,8 @@ function ResumeConversation({
658999
659438
  dynamicMcpConfig,
659000
659439
  debug,
659001
659440
  mainThreadAgentDefinition,
659441
+ baseMainLoopModel,
659442
+ hasExplicitModelOverride,
659002
659443
  autoConnectIdeFlag,
659003
659444
  strictMcpConfig = false,
659004
659445
  systemPrompt,
@@ -659220,6 +659661,8 @@ function ResumeConversation({
659220
659661
  systemPrompt,
659221
659662
  appendSystemPrompt,
659222
659663
  mainThreadAgentDefinition: resumeData.mainThreadAgentDefinition,
659664
+ baseMainLoopModel,
659665
+ hasExplicitModelOverride,
659223
659666
  autoConnectIdeFlag,
659224
659667
  disableSlashCommands,
659225
659668
  taskListId,
@@ -659333,7 +659776,7 @@ function CrossProjectMessage(t0) {
659333
659776
  } else {
659334
659777
  t1 = $2[0];
659335
659778
  }
659336
- import_react328.default.useEffect(_temp360, t1);
659779
+ import_react328.default.useEffect(_temp359, t1);
659337
659780
  let t2;
659338
659781
  if ($2[1] === Symbol.for("react.memo_cache_sentinel")) {
659339
659782
  t2 = /* @__PURE__ */ jsx_dev_runtime488.jsxDEV(ThemedText, {
@@ -659399,7 +659842,7 @@ function CrossProjectMessage(t0) {
659399
659842
  }
659400
659843
  return t6;
659401
659844
  }
659402
- function _temp360() {
659845
+ function _temp359() {
659403
659846
  const timeout2 = setTimeout(_temp2101, 100);
659404
659847
  return () => clearTimeout(timeout2);
659405
659848
  }
@@ -673840,7 +674283,7 @@ __export(exports_update, {
673840
674283
  async function update() {
673841
674284
  if (getAPIProvider() !== "firstParty") {
673842
674285
  writeToStdout(source_default.yellow(`Auto-update is not available for third-party provider builds.
673843
- `) + `Current version: ${"0.14.9"}
674286
+ `) + `Current version: ${"0.15.1"}
673844
674287
 
673845
674288
  ` + `To update, reinstall from npm:
673846
674289
  ` + source_default.bold(` npm install -g ${"@makerbi/openclaude"}@latest`) + `
@@ -673851,7 +674294,7 @@ async function update() {
673851
674294
  await gracefulShutdown(0);
673852
674295
  }
673853
674296
  logEvent("tengu_update_check", {});
673854
- writeToStdout(`Current version: ${"0.14.9"}
674297
+ writeToStdout(`Current version: ${"0.15.1"}
673855
674298
  `);
673856
674299
  const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
673857
674300
  writeToStdout(`Checking for updates to ${channel} version...
@@ -673936,8 +674379,8 @@ async function update() {
673936
674379
  writeToStdout(`Claude is managed by Homebrew.
673937
674380
  `);
673938
674381
  const latest = await getLatestVersion(channel);
673939
- if (latest && !gte("0.14.9", latest)) {
673940
- writeToStdout(`Update available: ${"0.14.9"} → ${latest}
674382
+ if (latest && !gte("0.15.1", latest)) {
674383
+ writeToStdout(`Update available: ${"0.15.1"} → ${latest}
673941
674384
  `);
673942
674385
  writeToStdout(`
673943
674386
  `);
@@ -673953,8 +674396,8 @@ async function update() {
673953
674396
  writeToStdout(`Claude is managed by winget.
673954
674397
  `);
673955
674398
  const latest = await getLatestVersion(channel);
673956
- if (latest && !gte("0.14.9", latest)) {
673957
- writeToStdout(`Update available: ${"0.14.9"} → ${latest}
674399
+ if (latest && !gte("0.15.1", latest)) {
674400
+ writeToStdout(`Update available: ${"0.15.1"} → ${latest}
673958
674401
  `);
673959
674402
  writeToStdout(`
673960
674403
  `);
@@ -673970,8 +674413,8 @@ async function update() {
673970
674413
  writeToStdout(`Claude is managed by apk.
673971
674414
  `);
673972
674415
  const latest = await getLatestVersion(channel);
673973
- if (latest && !gte("0.14.9", latest)) {
673974
- writeToStdout(`Update available: ${"0.14.9"} → ${latest}
674416
+ if (latest && !gte("0.15.1", latest)) {
674417
+ writeToStdout(`Update available: ${"0.15.1"} → ${latest}
673975
674418
  `);
673976
674419
  writeToStdout(`
673977
674420
  `);
@@ -674036,11 +674479,11 @@ async function update() {
674036
674479
  `);
674037
674480
  await gracefulShutdown(1);
674038
674481
  }
674039
- if (result.latestVersion === "0.14.9") {
674040
- writeToStdout(source_default.green(`OpenClaude is up to date (${"0.14.9"})`) + `
674482
+ if (result.latestVersion === "0.15.1") {
674483
+ writeToStdout(source_default.green(`OpenClaude is up to date (${"0.15.1"})`) + `
674041
674484
  `);
674042
674485
  } else {
674043
- writeToStdout(source_default.green(`Successfully updated from ${"0.14.9"} to version ${result.latestVersion}`) + `
674486
+ writeToStdout(source_default.green(`Successfully updated from ${"0.15.1"} to version ${result.latestVersion}`) + `
674044
674487
  `);
674045
674488
  await regenerateCompletionCache();
674046
674489
  }
@@ -674100,12 +674543,12 @@ async function update() {
674100
674543
  `);
674101
674544
  await gracefulShutdown(1);
674102
674545
  }
674103
- if (latestVersion === "0.14.9") {
674104
- writeToStdout(source_default.green(`OpenClaude is up to date (${"0.14.9"})`) + `
674546
+ if (latestVersion === "0.15.1") {
674547
+ writeToStdout(source_default.green(`OpenClaude is up to date (${"0.15.1"})`) + `
674105
674548
  `);
674106
674549
  await gracefulShutdown(0);
674107
674550
  }
674108
- writeToStdout(`New version available: ${latestVersion} (current: ${"0.14.9"})
674551
+ writeToStdout(`New version available: ${latestVersion} (current: ${"0.15.1"})
674109
674552
  `);
674110
674553
  writeToStdout(`Installing update...
674111
674554
  `);
@@ -674150,7 +674593,7 @@ async function update() {
674150
674593
  logForDebugging(`update: Installation status: ${status2}`);
674151
674594
  switch (status2) {
674152
674595
  case "success":
674153
- writeToStdout(source_default.green(`Successfully updated from ${"0.14.9"} to version ${latestVersion}`) + `
674596
+ writeToStdout(source_default.green(`Successfully updated from ${"0.15.1"} to version ${latestVersion}`) + `
674154
674597
  `);
674155
674598
  await regenerateCompletionCache();
674156
674599
  break;
@@ -675120,6 +675563,8 @@ ${hint}` : hint;
675120
675563
  if (false) {}
675121
675564
  const userSpecifiedModel = options2.model === "default" ? getDefaultMainLoopModel() : options2.model;
675122
675565
  const userSpecifiedFallbackModel = fallbackModel === "default" ? getDefaultMainLoopModel() : fallbackModel;
675566
+ const hasExplicitModelOverride = userSpecifiedModel !== undefined;
675567
+ const baseMainLoopModel = userSpecifiedModel ?? getUserSpecifiedModelSetting() ?? null;
675123
675568
  const currentCwd2 = worktreeEnabled ? getCwd() : preSetupCwd;
675124
675569
  logForDebugging("[STARTUP] Loading commands and agents...");
675125
675570
  const commandsStart = Date.now();
@@ -675846,6 +676291,8 @@ ${customInstructions}` : customInstructions;
675846
676291
  mcpClients,
675847
676292
  autoConnectIdeFlag: ide2,
675848
676293
  mainThreadAgentDefinition,
676294
+ baseMainLoopModel,
676295
+ hasExplicitModelOverride,
675849
676296
  disableSlashCommands,
675850
676297
  dynamicMcpConfig,
675851
676298
  strictMcpConfig,
@@ -676203,7 +676650,7 @@ Usage: openclaude --remote "your task description"`, () => gracefulShutdown(1));
676203
676650
  pendingHookMessages
676204
676651
  }, renderAndRun);
676205
676652
  }
676206
- }).version("0.14.9 (OpenClaude)", "-v, --version", "Output the version number");
676653
+ }).version("0.15.1 (OpenClaude)", "-v, --version", "Output the version number");
676207
676654
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
676208
676655
  program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
676209
676656
  if (canUserConfigureAdvisor()) {
@@ -676780,7 +677227,7 @@ if (false) {}
676780
677227
  async function main2() {
676781
677228
  const args = process.argv.slice(2);
676782
677229
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
676783
- console.log(`${"0.14.9"} (OpenClaude)`);
677230
+ console.log(`${"0.15.1"} (OpenClaude)`);
676784
677231
  return;
676785
677232
  }
676786
677233
  if (args.includes("--provider")) {
@@ -676933,4 +677380,4 @@ async function main2() {
676933
677380
  }
676934
677381
  main2();
676935
677382
 
676936
- //# debugId=86F0C6D47371392E64756E2164756E21
677383
+ //# debugId=C804D214A872920D64756E2164756E21