@makerbi/openclaude 0.14.9 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/cli.mjs +820 -405
  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;
18866
18969
  }
18970
+ const plaintextResult = removeCodexFromPlainTextStorage();
18971
+ if (!plaintextResult.success) {
18972
+ return plaintextResult;
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-27T07:41:16.072Z",
232307
232492
  deploymentEnvironment: env2.detectDeploymentEnvironment(),
232308
232493
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
232309
232494
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -243316,6 +243501,10 @@ function modelSupportsThinking(model2) {
243316
243501
  if (descriptorSupportsThinking !== undefined) {
243317
243502
  return descriptorSupportsThinking;
243318
243503
  }
243504
+ const routeId = resolveActiveRouteIdFromEnv(process.env);
243505
+ if (routeId === "ollama") {
243506
+ return false;
243507
+ }
243319
243508
  }
243320
243509
  return canonical.includes("sonnet-4") || canonical.includes("opus-4");
243321
243510
  }
@@ -243344,6 +243533,9 @@ function shouldEnableThinkingByDefault() {
243344
243533
  }
243345
243534
  return true;
243346
243535
  }
243536
+ function shouldUseThinkingForModel(model2, thinkingConfig) {
243537
+ return thinkingConfig.type !== "disabled" && !isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_THINKING) && modelSupportsThinking(model2);
243538
+ }
243347
243539
  var RAINBOW_COLORS, RAINBOW_SHIMMER_COLORS;
243348
243540
  var init_thinking = __esm(() => {
243349
243541
  init_growthbook();
@@ -243353,6 +243545,7 @@ var init_thinking = __esm(() => {
243353
243545
  init_modelSupportOverrides();
243354
243546
  init_providers();
243355
243547
  init_settings2();
243548
+ init_envUtils();
243356
243549
  RAINBOW_COLORS = [
243357
243550
  "rainbow_red",
243358
243551
  "rainbow_orange",
@@ -314881,12 +315074,23 @@ function getAgentModel(agentModel, parentModel, toolSpecifiedModel, permissionMo
314881
315074
  }
314882
315075
  return resolvedModel;
314883
315076
  };
314884
- if (toolSpecifiedModel) {
314885
- if (aliasMatchesParentTier(toolSpecifiedModel, parentModel)) {
315077
+ const trimmedToolSpecifiedModel = toolSpecifiedModel?.trim();
315078
+ if (trimmedToolSpecifiedModel) {
315079
+ if (trimmedToolSpecifiedModel.toLowerCase() === "inherit") {
315080
+ return getRuntimeMainLoopModel({
315081
+ permissionMode: permissionMode ?? "default",
315082
+ mainLoopModel: parentModel,
315083
+ exceeds200kTokens: false
315084
+ });
315085
+ }
315086
+ if (aliasMatchesParentTier(trimmedToolSpecifiedModel, parentModel)) {
315087
+ assertToolSpecifiedModelAllowed(trimmedToolSpecifiedModel, parentModel);
314886
315088
  return parentModel;
314887
315089
  }
314888
- const model3 = parseUserSpecifiedModel(toolSpecifiedModel);
314889
- return applyParentRegionPrefix(model3, toolSpecifiedModel);
315090
+ const model3 = parseUserSpecifiedModel(trimmedToolSpecifiedModel);
315091
+ const effectiveModel = applyParentRegionPrefix(model3, trimmedToolSpecifiedModel);
315092
+ assertToolSpecifiedModelAllowed(trimmedToolSpecifiedModel, effectiveModel);
315093
+ return effectiveModel;
314890
315094
  }
314891
315095
  const agentModelWithExp = agentModel ?? getDefaultSubagentModel();
314892
315096
  if ((agentModelWithExp === "haiku" || agentModelWithExp === "sonnet") && !checkIsClaudeNativeProvider()) {
@@ -314922,6 +315126,12 @@ function aliasMatchesParentTier(alias, parentModel) {
314922
315126
  return false;
314923
315127
  }
314924
315128
  }
315129
+ function assertToolSpecifiedModelAllowed(requestedModel, effectiveModel) {
315130
+ if (isModelAllowed(requestedModel) || effectiveModel !== requestedModel && isModelAllowed(effectiveModel)) {
315131
+ return;
315132
+ }
315133
+ throw new Error(`Model '${requestedModel}' is not available. Your organization restricts model selection.`);
315134
+ }
314925
315135
  function checkIsClaudeNativeProvider() {
314926
315136
  const provider = getAPIProvider();
314927
315137
  return provider === "bedrock" || provider === "vertex" || provider === "foundry" || provider === "firstParty" && isFirstPartyAnthropicBaseUrl();
@@ -314962,6 +315172,7 @@ var init_agent = __esm(() => {
314962
315172
  init_stringUtils();
314963
315173
  init_aliases();
314964
315174
  init_bedrock2();
315175
+ init_modelAllowlist();
314965
315176
  init_model();
314966
315177
  init_providers();
314967
315178
  AGENT_MODEL_OPTIONS = [...MODEL_ALIASES, "inherit"];
@@ -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 {
@@ -367178,6 +367392,7 @@ async function updateSymlink(symlinkPath, targetPath) {
367178
367392
  await rename2(symlinkPath, oldFileName);
367179
367393
  try {
367180
367394
  await copyFile2(targetPath, symlinkPath);
367395
+ await chmod5(symlinkPath, 493);
367181
367396
  try {
367182
367397
  await unlink7(oldFileName);
367183
367398
  } catch {}
@@ -367194,6 +367409,7 @@ async function updateSymlink(symlinkPath, targetPath) {
367194
367409
  } else {
367195
367410
  try {
367196
367411
  await copyFile2(targetPath, symlinkPath);
367412
+ await chmod5(symlinkPath, 493);
367197
367413
  } catch (e) {
367198
367414
  if (isENOENT(e)) {
367199
367415
  throw new Error(`Source file does not exist: ${targetPath}`);
@@ -370526,6 +370742,7 @@ function useCodexOAuthFlow(options2) {
370526
370742
  if (!saved.success) {
370527
370743
  throw new Error(saved.warning ?? "Codex OAuth succeeded, but credentials could not be saved securely.");
370528
370744
  }
370745
+ return { warning: saved.warning };
370529
370746
  };
370530
370747
  await onAuthenticated(tokens, persistCredentials);
370531
370748
  }).catch((error42) => {
@@ -371341,12 +371558,16 @@ function ProviderManager({ mode, onDone }) {
371341
371558
  function clearStartupProviderOverrideFromUserSettings() {
371342
371559
  return clearStartupProviderOverrides();
371343
371560
  }
371561
+ function formatWarningsForMessage(warnings) {
371562
+ const joined = warnings.join("; ");
371563
+ return /[.!?]$/.test(joined.trim()) ? joined : `${joined}.`;
371564
+ }
371344
371565
  function buildCodexOAuthActivationMessage(options2) {
371345
371566
  if (options2.activationWarning) {
371346
- return `${options2.prefix}. Saved for next startup. Warning: ${options2.warnings.join("; ")}.`;
371567
+ return `${options2.prefix}. Saved for next startup. Warning: ${formatWarningsForMessage(options2.warnings)}`;
371347
371568
  }
371348
371569
  if (options2.warnings.length > 0) {
371349
- return `${options2.prefix}. OpenClaude switched to it for this session with warnings: ${options2.warnings.join("; ")}.`;
371570
+ return `${options2.prefix}. OpenClaude switched to it for this session with warnings: ${formatWarningsForMessage(options2.warnings)}`;
371350
371571
  }
371351
371572
  return `${options2.prefix}. OpenClaude switched to it for this session.`;
371352
371573
  }
@@ -372565,13 +372786,17 @@ function ProviderManager({ mode, onDone }) {
372565
372786
  returnToMenu();
372566
372787
  return;
372567
372788
  }
372568
- persistCredentials({ profileId: saved.id });
372789
+ const persistenceResult = persistCredentials({
372790
+ profileId: saved.id
372791
+ });
372792
+ const storageWarning = persistenceResult && typeof persistenceResult === "object" ? persistenceResult.warning : null;
372569
372793
  const settingsOverrideError = clearStartupProviderOverrideFromUserSettings();
372570
372794
  const activationWarning = await activateCodexOAuthSession(tokens);
372571
372795
  setHasStoredCodexOAuthCredentials(true);
372572
372796
  setStoredCodexOAuthProfileId(saved.id);
372573
372797
  refreshProfiles();
372574
372798
  const warnings = [
372799
+ storageWarning,
372575
372800
  activationWarning,
372576
372801
  settingsOverrideError ? `could not clear startup provider override (${settingsOverrideError})` : null
372577
372802
  ].filter((warning) => Boolean(warning));
@@ -406308,6 +406533,7 @@ function getDisableExtglobCommand(shellPath) {
406308
406533
  }
406309
406534
  async function createBashShellProvider(shellPath, options2) {
406310
406535
  let currentSandboxTmpDir;
406536
+ const skipSnapshot = options2?.skipSnapshot === true;
406311
406537
  const snapshotPromise = options2?.skipSnapshot ? Promise.resolve(undefined) : createAndSaveSnapshot(shellPath).catch((error42) => {
406312
406538
  logForDebugging(`Failed to create shell snapshot: ${error42}`);
406313
406539
  return;
@@ -406363,7 +406589,7 @@ async function createBashShellProvider(shellPath, options2) {
406363
406589
  return { commandString, cwdFilePath };
406364
406590
  },
406365
406591
  getSpawnArgs(commandString) {
406366
- const skipLoginShell = lastSnapshotFilePath !== undefined;
406592
+ const skipLoginShell = skipSnapshot || lastSnapshotFilePath !== undefined;
406367
406593
  if (skipLoginShell) {
406368
406594
  logForDebugging("Spawning shell without login (-l flag skipped)");
406369
406595
  }
@@ -406548,6 +406774,9 @@ async function findSuitableShell() {
406548
406774
  logForDebugging(`CLAUDE_CODE_SHELL="${shellOverride}" is not a valid bash/zsh path, falling back to detection`);
406549
406775
  }
406550
406776
  }
406777
+ if (getPlatform() === "windows") {
406778
+ return findGitBashPath();
406779
+ }
406551
406780
  const env_shell = process.env.SHELL;
406552
406781
  const isEnvShellSupported = env_shell && (env_shell.includes("bash") || env_shell.includes("zsh"));
406553
406782
  const preferBash = env_shell?.includes("bash");
@@ -406579,7 +406808,9 @@ async function findSuitableShell() {
406579
406808
  }
406580
406809
  async function getShellConfigImpl() {
406581
406810
  const binShell = await findSuitableShell();
406582
- const provider = await createBashShellProvider(binShell);
406811
+ const provider = await createBashShellProvider(binShell, {
406812
+ skipSnapshot: false
406813
+ });
406583
406814
  return { provider };
406584
406815
  }
406585
406816
  async function exec3(command, abortSignal, shellType, options2) {
@@ -460387,7 +460618,7 @@ var init_AgentTool = __esm(() => {
460387
460618
  description: exports_external.string().describe("A short (3-5 word) description of the task"),
460388
460619
  prompt: exports_external.string().describe("The task for the agent to perform"),
460389
460620
  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."),
460621
+ model: exports_external.string().trim().min(1, "Model cannot be empty").optional().describe("Optional model override for this agent. Accepts aliases such as sonnet, opus, haiku, inherit, or a provider-supported model ID. Takes precedence over the agent definition's model frontmatter. If omitted, uses the agent definition's model, or inherits from the parent."),
460391
460622
  run_in_background: exports_external.boolean().optional().describe("Set to true to run this agent in the background. You will be notified when it completes.")
460392
460623
  }));
460393
460624
  fullInputSchema2 = lazySchema(() => {
@@ -460494,6 +460725,8 @@ var init_AgentTool = __esm(() => {
460494
460725
  if (agentDef?.color) {
460495
460726
  setAgentColor(subagent_type, agentDef.color);
460496
460727
  }
460728
+ const rawTeammateModel = model2 ?? agentDef?.model;
460729
+ const resolvedTeammateModel = rawTeammateModel === undefined ? undefined : getAgentModel(agentDef?.model, toolUseContext.options.mainLoopModel, model2, permissionMode);
460497
460730
  const result = await spawnTeammate({
460498
460731
  name,
460499
460732
  prompt,
@@ -460501,7 +460734,7 @@ var init_AgentTool = __esm(() => {
460501
460734
  team_name: teamName,
460502
460735
  use_splitpane: true,
460503
460736
  plan_mode_required: spawnMode === "plan",
460504
- model: model2 ?? agentDef?.model,
460737
+ model: resolvedTeammateModel,
460505
460738
  agent_type: subagent_type,
460506
460739
  invokingRequestId: assistantMessage2?.requestId
460507
460740
  }, toolUseContext);
@@ -464145,6 +464378,16 @@ function getAttributionTexts() {
464145
464378
  }
464146
464379
  return { commit: "", pr: "" };
464147
464380
  }
464381
+ const settings = getInitialSettings();
464382
+ if (settings.attribution) {
464383
+ return {
464384
+ commit: settings.attribution.commit ?? "",
464385
+ pr: settings.attribution.pr ?? ""
464386
+ };
464387
+ }
464388
+ if (settings.includeCoAuthoredBy !== true) {
464389
+ return { commit: "", pr: "" };
464390
+ }
464148
464391
  const model2 = getMainLoopModel();
464149
464392
  const apiProvider = getAPIProvider();
464150
464393
  const modelName = getDefaultCommitCoAuthorName({
@@ -464152,20 +464395,9 @@ function getAttributionTexts() {
464152
464395
  apiProvider,
464153
464396
  isInternalRepo: isInternalModelRepoCached()
464154
464397
  });
464155
- const defaultAttribution = "\uD83E\uDD16 Generated with [OpenClaude](https://github.com/AndersonBY/openclaude)";
464156
464398
  const coAuthorEmail = getDefaultCommitCoAuthorEmail(apiProvider);
464157
464399
  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 };
464400
+ return { commit: defaultCommit, pr: DEFAULT_PR_ATTRIBUTION };
464169
464401
  }
464170
464402
  function isTerminalOutput(content) {
464171
464403
  for (const tag2 of TERMINAL_OUTPUT_TAGS) {
@@ -464276,13 +464508,15 @@ async function getEnhancedPRAttribution(getAppState) {
464276
464508
  return "";
464277
464509
  }
464278
464510
  const settings = getInitialSettings();
464279
- if (settings.attribution?.pr) {
464511
+ if (settings.attribution?.pr !== undefined) {
464280
464512
  return settings.attribution.pr;
464281
464513
  }
464282
- if (settings.includeCoAuthoredBy === false) {
464514
+ if (settings.attribution) {
464515
+ return "";
464516
+ }
464517
+ if (settings.includeCoAuthoredBy !== true) {
464283
464518
  return "";
464284
464519
  }
464285
- const defaultAttribution = "\uD83E\uDD16 Generated with [OpenClaude](https://github.com/AndersonBY/openclaude)";
464286
464520
  const appState = getAppState();
464287
464521
  logForDebugging(`PR Attribution: appState.attribution exists: ${!!appState.attribution}`);
464288
464522
  if (appState.attribution) {
@@ -464302,7 +464536,7 @@ async function getEnhancedPRAttribution(getAppState) {
464302
464536
  const shortModelName = isInternal ? rawModelName : sanitizeModelName(rawModelName);
464303
464537
  if (claudePercent === 0 && promptCount === 0 && memoryAccessCount === 0) {
464304
464538
  logForDebugging("PR Attribution: returning default (no data)");
464305
- return defaultAttribution;
464539
+ return DEFAULT_PR_ATTRIBUTION;
464306
464540
  }
464307
464541
  const memSuffix = memoryAccessCount > 0 ? `, ${memoryAccessCount} ${memoryAccessCount === 1 ? "memory" : "memories"} recalled` : "";
464308
464542
  const summary = `\uD83E\uDD16 Generated with [OpenClaude](https://github.com/AndersonBY/openclaude) (${claudePercent}% ${promptCount}-shotted by ${shortModelName}${memSuffix})`;
@@ -464310,7 +464544,7 @@ async function getEnhancedPRAttribution(getAppState) {
464310
464544
  logForDebugging(`PR Attribution: returning summary: ${summary}`);
464311
464545
  return summary;
464312
464546
  }
464313
- var MEMORY_ACCESS_TOOL_NAMES;
464547
+ var DEFAULT_PR_ATTRIBUTION = "\uD83E\uDD16 Generated with [OpenClaude](https://github.com/AndersonBY/openclaude)", MEMORY_ACCESS_TOOL_NAMES;
464314
464548
  var init_attribution = __esm(() => {
464315
464549
  init_state();
464316
464550
  init_envUtils();
@@ -471799,7 +472033,7 @@ function getAnthropicEnvMetadata() {
471799
472033
  function getBuildAgeMinutes() {
471800
472034
  if (false)
471801
472035
  ;
471802
- const buildTime = new Date("2026-05-26T10:36:27.285Z").getTime();
472036
+ const buildTime = new Date("2026-05-27T07:41:16.072Z").getTime();
471803
472037
  if (isNaN(buildTime))
471804
472038
  return;
471805
472039
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -498284,7 +498518,7 @@ ${USAGE}` };
498284
498518
  return { type: "text", value: error42 };
498285
498519
  return {
498286
498520
  type: "text",
498287
- value: "Commit attribution reset to the OpenClaude default."
498521
+ value: "Commit attribution reset to the privacy-preserving default."
498288
498522
  };
498289
498523
  }
498290
498524
  case "set-attribution":
@@ -499938,7 +500172,7 @@ function buildPrimarySection() {
499938
500172
  }, undefined, false, undefined, this);
499939
500173
  return [{
499940
500174
  label: "Version",
499941
- value: "0.14.9"
500175
+ value: "0.15.0"
499942
500176
  }, {
499943
500177
  label: "Session name",
499944
500178
  value: nameValue
@@ -514833,7 +515067,7 @@ function getReleaseTagUrl(version2 = publicBuildVersion) {
514833
515067
  return `${OPENCLAUDE_RELEASES_URL}/tag/v${normalizePublicVersion(version2)}`;
514834
515068
  }
514835
515069
  function getPublicBuildVersion() {
514836
- return "0.14.9";
515070
+ return "0.15.0";
514837
515071
  }
514838
515072
  var import_semver9, OPENCLAUDE_RELEASES_URL = "https://github.com/AndersonBY/openclaude/releases", fallbackBuildVersion, publicBuildVersion;
514839
515073
  var init_version = __esm(() => {
@@ -538928,15 +539162,15 @@ var require_filter_parse = __commonJS((exports, module) => {
538928
539162
  }
538929
539163
  return byteWidth;
538930
539164
  }
538931
- var Filter = module.exports = function(bitmapInfo, dependencies) {
539165
+ var Filter = module.exports = function(bitmapInfo, dependencies2) {
538932
539166
  let width = bitmapInfo.width;
538933
539167
  let height = bitmapInfo.height;
538934
539168
  let interlace = bitmapInfo.interlace;
538935
539169
  let bpp = bitmapInfo.bpp;
538936
539170
  let depth = bitmapInfo.depth;
538937
- this.read = dependencies.read;
538938
- this.write = dependencies.write;
538939
- this.complete = dependencies.complete;
539171
+ this.read = dependencies2.read;
539172
+ this.write = dependencies2.write;
539173
+ this.complete = dependencies2.complete;
538940
539174
  this._imageIndex = 0;
538941
539175
  this._images = [];
538942
539176
  if (interlace) {
@@ -539143,7 +539377,7 @@ var require_crc = __commonJS((exports, module) => {
539143
539377
  var require_parser5 = __commonJS((exports, module) => {
539144
539378
  var constants5 = require_constants11();
539145
539379
  var CrcCalculator = require_crc();
539146
- var Parser2 = module.exports = function(options2, dependencies) {
539380
+ var Parser2 = module.exports = function(options2, dependencies2) {
539147
539381
  this._options = options2;
539148
539382
  options2.checkCRC = options2.checkCRC !== false;
539149
539383
  this._hasIHDR = false;
@@ -539158,17 +539392,17 @@ var require_parser5 = __commonJS((exports, module) => {
539158
539392
  this._chunks[constants5.TYPE_PLTE] = this._handlePLTE.bind(this);
539159
539393
  this._chunks[constants5.TYPE_tRNS] = this._handleTRNS.bind(this);
539160
539394
  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() {};
539395
+ this.read = dependencies2.read;
539396
+ this.error = dependencies2.error;
539397
+ this.metadata = dependencies2.metadata;
539398
+ this.gamma = dependencies2.gamma;
539399
+ this.transColor = dependencies2.transColor;
539400
+ this.palette = dependencies2.palette;
539401
+ this.parsed = dependencies2.parsed;
539402
+ this.inflateData = dependencies2.inflateData;
539403
+ this.finished = dependencies2.finished;
539404
+ this.simpleTransparency = dependencies2.simpleTransparency;
539405
+ this.headersFinished = dependencies2.headersFinished || function() {};
539172
539406
  };
539173
539407
  Parser2.prototype.start = function() {
539174
539408
  this.read(constants5.PNG_SIGNATURE.length, this._parseSignature.bind(this));
@@ -566759,7 +566993,8 @@ function AgentsList(t0) {
566759
566993
  onBack,
566760
566994
  onSelect,
566761
566995
  onCreateNew,
566762
- changes
566996
+ changes,
566997
+ activeAgentName
566763
566998
  } = t0;
566764
566999
  const [selectedAgent, setSelectedAgent] = React105.useState(null);
566765
567000
  const [isCreateNewSelected, setIsCreateNewSelected] = React105.useState(true);
@@ -566793,81 +567028,83 @@ function AgentsList(t0) {
566793
567028
  t2 = $2[3];
566794
567029
  }
566795
567030
  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;
567031
+ const renderAgent = (agent_0) => {
567032
+ const isSelected = !isCreateNewSelected && selectedAgent?.agentType === agent_0.agentType && selectedAgent?.source === agent_0.source;
567033
+ const isActive = agent_0.agentType === activeAgentName && !agent_0.overriddenBy;
567034
+ const {
567035
+ isOverridden,
567036
+ overriddenBy
567037
+ } = getOverrideInfo(agent_0);
567038
+ const dimmed = agent_0.source === "built-in" || isOverridden;
567039
+ const textColor = isSelected ? "suggestion" : undefined;
567040
+ const resolvedModel = resolveAgentModelDisplay(agent_0);
567041
+ return /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedBox_default, {
567042
+ children: [
567043
+ /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567044
+ dimColor: dimmed && !isSelected,
567045
+ color: textColor,
567046
+ children: isSelected ? `${figures_default.pointer} ` : " "
567047
+ }, undefined, false, undefined, this),
567048
+ /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567049
+ dimColor: dimmed && !isSelected,
567050
+ color: textColor,
567051
+ children: agent_0.agentType
567052
+ }, undefined, false, undefined, this),
567053
+ resolvedModel && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567054
+ dimColor: true,
567055
+ color: textColor,
567056
+ children: [
567057
+ " · ",
567058
+ resolvedModel
567059
+ ]
567060
+ }, undefined, true, undefined, this),
567061
+ agent_0.memory && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567062
+ dimColor: true,
567063
+ color: textColor,
567064
+ children: [
567065
+ " · ",
567066
+ agent_0.memory,
567067
+ " memory"
567068
+ ]
567069
+ }, undefined, true, undefined, this),
567070
+ isActive && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567071
+ color: "success",
567072
+ children: [
567073
+ " ",
567074
+ figures_default.tick,
567075
+ " active"
567076
+ ]
567077
+ }, undefined, true, undefined, this),
567078
+ overriddenBy && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567079
+ dimColor: !isSelected,
567080
+ color: isSelected ? "warning" : undefined,
567081
+ children: [
567082
+ " ",
567083
+ figures_default.warning,
567084
+ " shadowed by ",
567085
+ getOverrideSourceLabel(overriddenBy)
567086
+ ]
567087
+ }, undefined, true, undefined, this)
567088
+ ]
567089
+ }, `${agent_0.agentType}-${agent_0.source}`, true, undefined, this);
567090
+ };
566858
567091
  let t4;
566859
567092
  if ($2[8] !== sortedAgents || $2[9] !== source) {
566860
567093
  bb0: {
566861
567094
  const nonBuiltIn = sortedAgents.filter(_temp263);
566862
567095
  if (source === "all") {
566863
- t4 = AGENT_SOURCE_GROUPS.filter(_temp339).flatMap((t52) => {
567096
+ t4 = AGENT_SOURCE_GROUPS.flatMap((t52) => {
566864
567097
  const {
566865
567098
  source: groupSource
566866
567099
  } = t52;
566867
- return nonBuiltIn.filter((a_0) => a_0.source === groupSource);
567100
+ return sortedAgents.filter((a_0) => a_0.source === groupSource);
566868
567101
  });
566869
567102
  break bb0;
566870
567103
  }
567104
+ if (source === "built-in") {
567105
+ t4 = sortedAgents;
567106
+ break bb0;
567107
+ }
566871
567108
  t4 = nonBuiltIn;
566872
567109
  }
566873
567110
  $2[8] = sortedAgents;
@@ -567102,29 +567339,30 @@ function AgentsList(t0) {
567102
567339
  } else {
567103
567340
  t27 = $2[64];
567104
567341
  }
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
- }
567342
+ const t28 = /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedBox_default, {
567343
+ flexDirection: "column",
567344
+ gap: 1,
567345
+ tabIndex: 0,
567346
+ autoFocus: true,
567347
+ onKeyDown: handleKeyDown,
567348
+ children: [
567349
+ /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567350
+ dimColor: true,
567351
+ children: [
567352
+ "Current session agent: ",
567353
+ /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567354
+ bold: true,
567355
+ children: activeAgentName ?? "none"
567356
+ }, undefined, false, undefined, this)
567357
+ ]
567358
+ }, undefined, true, undefined, this),
567359
+ t233,
567360
+ t242,
567361
+ t25,
567362
+ t26,
567363
+ t27
567364
+ ]
567365
+ }, undefined, true, undefined, this);
567128
567366
  let t29;
567129
567367
  if ($2[69] !== onBack || $2[70] !== sourceTitle || $2[71] !== t28) {
567130
567368
  t29 = /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(Dialog, {
@@ -567157,19 +567395,27 @@ function AgentsList(t0) {
567157
567395
  t18 = `${t232} agents`;
567158
567396
  t19 = onBack;
567159
567397
  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, {
567398
+ t21 = /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(jsx_dev_runtime318.Fragment, {
567399
+ children: [
567400
+ /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567164
567401
  dimColor: true,
567165
- children: changes[changes.length - 1]
567402
+ children: [
567403
+ "Current session agent: ",
567404
+ /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567405
+ bold: true,
567406
+ children: activeAgentName ?? "none"
567407
+ }, undefined, false, undefined, this)
567408
+ ]
567409
+ }, undefined, true, undefined, this),
567410
+ changes && changes.length > 0 && /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedBox_default, {
567411
+ marginTop: 1,
567412
+ children: /* @__PURE__ */ jsx_dev_runtime318.jsxDEV(ThemedText, {
567413
+ dimColor: true,
567414
+ children: changes[changes.length - 1]
567415
+ }, undefined, false, undefined, this)
567166
567416
  }, undefined, false, undefined, this)
567167
- }, undefined, false, undefined, this);
567168
- $2[75] = changes;
567169
- $2[76] = t21;
567170
- } else {
567171
- t21 = $2[76];
567172
- }
567417
+ ]
567418
+ }, undefined, true, undefined, this);
567173
567419
  T0 = ThemedBox_default;
567174
567420
  t11 = "column";
567175
567421
  t12 = 0;
@@ -567357,9 +567603,6 @@ function _temp522(a_3) {
567357
567603
  function _temp430(a_2) {
567358
567604
  return a_2.source === "built-in";
567359
567605
  }
567360
- function _temp339(g) {
567361
- return g.source !== "built-in";
567362
- }
567363
567606
  function _temp263(a2) {
567364
567607
  return a2.source !== "built-in";
567365
567608
  }
@@ -567467,7 +567710,7 @@ function WizardProvider(t0) {
567467
567710
  }
567468
567711
  } else {
567469
567712
  if (currentStepIndex > 0) {
567470
- setCurrentStepIndex(_temp340);
567713
+ setCurrentStepIndex(_temp339);
567471
567714
  } else {
567472
567715
  if (onCancel) {
567473
567716
  onCancel();
@@ -567581,7 +567824,7 @@ function WizardProvider(t0) {
567581
567824
  }
567582
567825
  return t14;
567583
567826
  }
567584
- function _temp340(prev_2) {
567827
+ function _temp339(prev_2) {
567585
567828
  return prev_2 - 1;
567586
567829
  }
567587
567830
  function _temp264(prev_1) {
@@ -568257,7 +568500,7 @@ function ConfirmStep(t0) {
568257
568500
  color: "error",
568258
568501
  children: "Errors:"
568259
568502
  }, undefined, false, undefined, this),
568260
- validation.errors.map(_temp341)
568503
+ validation.errors.map(_temp340)
568261
568504
  ]
568262
568505
  }, undefined, true, undefined, this);
568263
568506
  $2[4] = agent2;
@@ -568425,7 +568668,7 @@ function ConfirmStep(t0) {
568425
568668
  }
568426
568669
  return t25;
568427
568670
  }
568428
- function _temp341(err2, i_0) {
568671
+ function _temp340(err2, i_0) {
568429
568672
  return /* @__PURE__ */ jsx_dev_runtime323.jsxDEV(ThemedText, {
568430
568673
  color: "error",
568431
568674
  children: [
@@ -570057,11 +570300,13 @@ function AgentsMenu(t0) {
570057
570300
  const $2 = import_react_compiler_runtime252.c(157);
570058
570301
  const {
570059
570302
  tools,
570060
- onExit: onExit2
570303
+ onExit: onExit2,
570304
+ onSetActiveAgent,
570305
+ initialModeState
570061
570306
  } = t0;
570062
570307
  let t1;
570063
570308
  if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
570064
- t1 = {
570309
+ t1 = initialModeState ?? {
570065
570310
  mode: "list-agents",
570066
570311
  source: "all"
570067
570312
  };
@@ -570072,7 +570317,8 @@ function AgentsMenu(t0) {
570072
570317
  const [modeState, setModeState] = import_react182.useState(t1);
570073
570318
  const agentDefinitions = useAppState(_temp147);
570074
570319
  const mcpTools = useAppState(_temp266);
570075
- const toolPermissionContext = useAppState(_temp342);
570320
+ const toolPermissionContext = useAppState(_temp341);
570321
+ const activeAgentName = useAppState((s) => s.agent);
570076
570322
  const setAppState = useSetAppState();
570077
570323
  const {
570078
570324
  allAgents,
@@ -570275,25 +570521,15 @@ ${changes.join(`
570275
570521
  } else {
570276
570522
  t17 = $2[39];
570277
570523
  }
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
- }
570524
+ const t18 = /* @__PURE__ */ jsx_dev_runtime335.jsxDEV(AgentsList, {
570525
+ source: modeState.source,
570526
+ agents: resolvedAgents,
570527
+ onBack: t15,
570528
+ onSelect: t16,
570529
+ onCreateNew: t17,
570530
+ changes,
570531
+ activeAgentName
570532
+ }, undefined, false, undefined, this);
570297
570533
  let t19;
570298
570534
  if ($2[46] === Symbol.for("react.memo_cache_sentinel")) {
570299
570535
  t19 = /* @__PURE__ */ jsx_dev_runtime335.jsxDEV(AgentNavigationFooter, {}, undefined, false, undefined, this);
@@ -570346,16 +570582,16 @@ ${changes.join(`
570346
570582
  case "agent-menu": {
570347
570583
  let t13;
570348
570584
  if ($2[53] !== allAgents || $2[54] !== modeState.agent.agentType || $2[55] !== modeState.agent.source) {
570349
- let t142;
570585
+ let t14;
570350
570586
  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;
570587
+ t14 = (a_9) => a_9.agentType === modeState.agent.agentType && a_9.source === modeState.agent.source;
570352
570588
  $2[57] = modeState.agent.agentType;
570353
570589
  $2[58] = modeState.agent.source;
570354
- $2[59] = t142;
570590
+ $2[59] = t14;
570355
570591
  } else {
570356
- t142 = $2[59];
570592
+ t14 = $2[59];
570357
570593
  }
570358
- t13 = allAgents.find(t142);
570594
+ t13 = allAgents.find(t14);
570359
570595
  $2[53] = allAgents;
570360
570596
  $2[54] = modeState.agent.agentType;
570361
570597
  $2[55] = modeState.agent.source;
@@ -570366,90 +570602,71 @@ ${changes.join(`
570366
570602
  const freshAgent_1 = t13;
570367
570603
  const agentToUse = freshAgent_1 || modeState.agent;
570368
570604
  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
- }
570605
+ const isActiveAgent = agentToUse.agentType === activeAgentName;
570606
+ const sessionAgentToUse = agents.find((a_10) => a_10.agentType === agentToUse.agentType) ?? agentToUse;
570607
+ const editableItems = isEditable ? [{
570608
+ label: "Edit agent",
570609
+ value: "edit"
570610
+ }, {
570611
+ label: "Delete agent",
570612
+ value: "delete"
570613
+ }] : [];
570614
+ const activeAgentItems = isActiveAgent ? [{
570615
+ label: "Active agent",
570616
+ value: "active-agent",
570617
+ disabled: true
570618
+ }] : onSetActiveAgent ? [{
570619
+ label: "Set as active agent",
570620
+ value: "set-active"
570621
+ }] : [];
570622
+ const menuItems = [{
570623
+ label: "View agent",
570624
+ value: "view"
570625
+ }, ...activeAgentItems, ...editableItems, {
570626
+ label: "Back",
570627
+ value: "back"
570628
+ }];
570629
+ const handleMenuSelect = (value_0) => {
570630
+ bb129:
570631
+ switch (value_0) {
570632
+ case "view": {
570633
+ setModeState({
570634
+ mode: "view-agent",
570635
+ agent: agentToUse,
570636
+ previousMode: modeState.previousMode
570637
+ });
570638
+ break bb129;
570639
+ }
570640
+ case "set-active": {
570641
+ onSetActiveAgent?.(sessionAgentToUse);
570642
+ setChanges((prev) => [...prev, `Active session agent set to: ${source_default.bold(sessionAgentToUse.agentType)}`]);
570643
+ setModeState({
570644
+ mode: "list-agents",
570645
+ source: "all"
570646
+ });
570647
+ break bb129;
570444
570648
  }
570445
- };
570446
- $2[66] = agentToUse;
570447
- $2[67] = modeState;
570448
- $2[68] = t18;
570449
- } else {
570450
- t18 = $2[68];
570451
- }
570452
- const handleMenuSelect = t18;
570649
+ case "edit": {
570650
+ setModeState({
570651
+ mode: "edit-agent",
570652
+ agent: agentToUse,
570653
+ previousMode: modeState
570654
+ });
570655
+ break bb129;
570656
+ }
570657
+ case "delete": {
570658
+ setModeState({
570659
+ mode: "delete-confirm",
570660
+ agent: agentToUse,
570661
+ previousMode: modeState
570662
+ });
570663
+ break bb129;
570664
+ }
570665
+ case "back": {
570666
+ setModeState(modeState.previousMode);
570667
+ }
570668
+ }
570669
+ };
570453
570670
  let t19;
570454
570671
  if ($2[69] !== modeState.previousMode) {
570455
570672
  t19 = () => setModeState(modeState.previousMode);
@@ -570921,7 +571138,7 @@ function _temp523(a_0) {
570921
571138
  function _temp431(a2) {
570922
571139
  return a2.source === "built-in";
570923
571140
  }
570924
- function _temp342(s_1) {
571141
+ function _temp341(s_1) {
570925
571142
  return s_1.toolPermissionContext;
570926
571143
  }
570927
571144
  function _temp266(s_0) {
@@ -570965,7 +571182,8 @@ async function call60(onDone, context2) {
570965
571182
  const tools = getTools(permissionContext);
570966
571183
  return /* @__PURE__ */ jsx_dev_runtime336.jsxDEV(AgentsMenu, {
570967
571184
  tools,
570968
- onExit: onDone
571185
+ onExit: onDone,
571186
+ onSetActiveAgent: context2.setActiveSessionAgent
570969
571187
  }, undefined, false, undefined, this);
570970
571188
  }
570971
571189
  var jsx_dev_runtime336;
@@ -571846,7 +572064,7 @@ var init_bridge_kick = __esm(() => {
571846
572064
  var call66 = async () => {
571847
572065
  return {
571848
572066
  type: "text",
571849
- value: `${"99.0.0"} (built ${"2026-05-26T10:36:27.285Z"})`
572067
+ value: `${"99.0.0"} (built ${"2026-05-27T07:41:16.072Z"})`
571850
572068
  };
571851
572069
  }, version2, version_default;
571852
572070
  var init_version2 = __esm(() => {
@@ -572608,7 +572826,7 @@ function SandboxDependenciesTab(t0) {
572608
572826
  const bwrapMissing = t3;
572609
572827
  let t4;
572610
572828
  if ($2[5] !== depCheck.errors) {
572611
- t4 = depCheck.errors.some(_temp343);
572829
+ t4 = depCheck.errors.some(_temp342);
572612
572830
  $2[5] = depCheck.errors;
572613
572831
  $2[6] = t4;
572614
572832
  } else {
@@ -572826,7 +573044,7 @@ function _temp524(err2) {
572826
573044
  function _temp432(e_2) {
572827
573045
  return !e_2.includes("ripgrep") && !e_2.includes("bwrap") && !e_2.includes("socat");
572828
573046
  }
572829
- function _temp343(e_1) {
573047
+ function _temp342(e_1) {
572830
573048
  return e_1.includes("socat");
572831
573049
  }
572832
573050
  function _temp267(e_0) {
@@ -573941,7 +574159,7 @@ function ClaudeInChromeMenu(t0) {
573941
574159
  bb22:
573942
574160
  switch (action2) {
573943
574161
  case "install-extension": {
573944
- setSelectKey(_temp344);
574162
+ setSelectKey(_temp343);
573945
574163
  setShowInstallHint(true);
573946
574164
  openUrl(CHROME_EXTENSION_URL);
573947
574165
  break bb22;
@@ -574245,7 +574463,7 @@ function _temp525(k) {
574245
574463
  function _temp433(k_0) {
574246
574464
  return k_0 + 1;
574247
574465
  }
574248
- function _temp344(k_1) {
574466
+ function _temp343(k_1) {
574249
574467
  return k_1 + 1;
574250
574468
  }
574251
574469
  function _temp268(c6) {
@@ -575471,6 +575689,7 @@ async function streamRenderedMessages(messages, tools, sink, {
575471
575689
  screen: "prompt",
575472
575690
  streamingToolUses: [],
575473
575691
  showAllInTranscript: true,
575692
+ hideLogo: true,
575474
575693
  isLoading: false,
575475
575694
  renderRange: range
575476
575695
  }, undefined, false, undefined, this)
@@ -576361,6 +576580,7 @@ var init_openaiModelDiscovery = __esm(() => {
576361
576580
  var exports_model2 = {};
576362
576581
  __export(exports_model2, {
576363
576582
  shouldAutoRefreshRouteCatalog: () => shouldAutoRefreshRouteCatalog,
576583
+ mergeActiveProfileModelOptions: () => mergeActiveProfileModelOptions,
576364
576584
  call: () => call74
576365
576585
  });
576366
576586
  function renderModelLabel(model2) {
@@ -576376,6 +576596,37 @@ function haveSameModelOptions(left, right) {
576376
576596
  return other2 !== undefined && option.value === other2.value && option.label === other2.label && option.description === other2.description && option.descriptionForModel === other2.descriptionForModel;
576377
576597
  });
576378
576598
  }
576599
+ function mergeActiveProfileModelOptions(routeId, routeOptions) {
576600
+ const activeProfile = getActiveProviderProfile();
576601
+ if (!activeProfile) {
576602
+ return routeOptions;
576603
+ }
576604
+ const profileEnvApplied = process.env.CLAUDE_CODE_PROVIDER_PROFILE_ENV_APPLIED === "1" && process.env.CLAUDE_CODE_PROVIDER_PROFILE_ENV_APPLIED_ID === activeProfile.id;
576605
+ const activeProfileRouteId = resolveRouteIdFromBaseUrl(activeProfile.baseUrl) ?? resolveProfileRoute(activeProfile.provider).routeId;
576606
+ if (!profileEnvApplied || activeProfileRouteId !== routeId) {
576607
+ return routeOptions;
576608
+ }
576609
+ const profileOptions = getProfileModelOptions(activeProfile);
576610
+ if (profileOptions.length === 0) {
576611
+ return routeOptions;
576612
+ }
576613
+ const routeOptionsByValue = new Map(routeOptions.flatMap((option) => {
576614
+ const value = typeof option.value === "string" ? option.value.trim().toLowerCase() : "";
576615
+ return value ? [[value, option]] : [];
576616
+ }));
576617
+ const merged = [];
576618
+ const seen = new Set;
576619
+ for (const option of profileOptions) {
576620
+ const value = typeof option.value === "string" ? option.value.trim() : "";
576621
+ const key = value.toLowerCase();
576622
+ if (!value || seen.has(key)) {
576623
+ continue;
576624
+ }
576625
+ seen.add(key);
576626
+ merged.push(routeOptionsByValue.get(key) ?? option);
576627
+ }
576628
+ return merged;
576629
+ }
576379
576630
  function getActiveRouteId() {
576380
576631
  const activeProfile = getActiveProviderProfile();
576381
576632
  return resolveActiveRouteIdFromEnv(process.env, {
@@ -576429,11 +576680,12 @@ async function loadDescriptorDiscoveryContext(routeId) {
576429
576680
  if (staticEntries.length === 0) {
576430
576681
  return null;
576431
576682
  }
576683
+ const routeOptions2 = buildRouteCatalogModelOptions(routeLabel, staticEntries, routeDefaultModel);
576432
576684
  return {
576433
576685
  kind: "descriptor",
576434
576686
  autoRefresh: false,
576435
576687
  canRefresh,
576436
- optionsOverride: buildRouteCatalogModelOptions(routeLabel, staticEntries, routeDefaultModel),
576688
+ optionsOverride: mergeActiveProfileModelOptions(routeId, routeOptions2),
576437
576689
  routeId,
576438
576690
  routeDefaultModel,
576439
576691
  routeLabel
@@ -576463,12 +576715,13 @@ async function loadDescriptorDiscoveryContext(routeId) {
576463
576715
  tone: "info"
576464
576716
  };
576465
576717
  }
576718
+ const routeOptions = buildRouteCatalogModelOptions(routeLabel, mergedEntries, routeDefaultModel);
576466
576719
  return {
576467
576720
  kind: "descriptor",
576468
576721
  autoRefresh,
576469
576722
  canRefresh,
576470
576723
  discoveryState,
576471
- optionsOverride: buildRouteCatalogModelOptions(routeLabel, mergedEntries, routeDefaultModel),
576724
+ optionsOverride: mergeActiveProfileModelOptions(routeId, routeOptions),
576472
576725
  routeId,
576473
576726
  routeDefaultModel,
576474
576727
  routeLabel
@@ -576614,7 +576867,7 @@ function ModelPickerWrapper({
576614
576867
  ...getOpenAIDiscoveryRequestOptions(discoveryContext.routeId),
576615
576868
  forceRefresh: true
576616
576869
  });
576617
- const nextOptions = buildRouteCatalogModelOptions(discoveryContext.routeLabel, result?.models ?? [], discoveryContext.routeDefaultModel);
576870
+ const nextOptions = mergeActiveProfileModelOptions(discoveryContext.routeId, buildRouteCatalogModelOptions(discoveryContext.routeLabel, result?.models ?? [], discoveryContext.routeDefaultModel));
576618
576871
  const changed = !haveSameModelOptions(optionsOverride ?? [], nextOptions);
576619
576872
  setOptionsOverride(nextOptions);
576620
576873
  setDiscoveryState(descriptorDiscoveryStateForResult({
@@ -576790,7 +577043,7 @@ async function refreshModelsAndSummarize() {
576790
577043
  ...getOpenAIDiscoveryRequestOptions(discoveryContext.routeId),
576791
577044
  forceRefresh: true
576792
577045
  });
576793
- const nextOptions = buildRouteCatalogModelOptions(discoveryContext.routeLabel, result?.models ?? [], discoveryContext.routeDefaultModel);
577046
+ const nextOptions = mergeActiveProfileModelOptions(discoveryContext.routeId, buildRouteCatalogModelOptions(discoveryContext.routeLabel, result?.models ?? [], discoveryContext.routeDefaultModel));
576794
577047
  const changed = !haveSameModelOptions(discoveryContext.optionsOverride, nextOptions);
576795
577048
  return descriptorDiscoveryStateForResult({
576796
577049
  changed,
@@ -576864,6 +577117,7 @@ var init_model2 = __esm(() => {
576864
577117
  init_discoveryCache();
576865
577118
  init_discoveryService();
576866
577119
  init_routeMetadata();
577120
+ init_profileResolver();
576867
577121
  init_providerConfig();
576868
577122
  init_AppState();
576869
577123
  init_extraUsage();
@@ -596584,15 +596838,15 @@ ${deferredToolList}
596584
596838
  }
596585
596839
  }
596586
596840
  const maxOutputTokens2 = retryContext?.maxTokensOverride || options2.maxOutputTokensOverride || getMaxOutputTokensForModel(options2.model);
596587
- const hasThinking = thinkingConfig.type !== "disabled" && !isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_THINKING);
596841
+ const hasThinking = shouldUseThinkingForModel(retryContext.model, thinkingConfig);
596588
596842
  let thinking = undefined;
596589
- if (hasThinking && modelSupportsThinking(options2.model)) {
596590
- if (!isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING) && modelSupportsAdaptiveThinking(options2.model)) {
596843
+ if (hasThinking) {
596844
+ if (!isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING) && modelSupportsAdaptiveThinking(retryContext.model)) {
596591
596845
  thinking = {
596592
596846
  type: "adaptive"
596593
596847
  };
596594
596848
  } else {
596595
- let thinkingBudget = getMaxThinkingTokensForModel(options2.model);
596849
+ let thinkingBudget = getMaxThinkingTokensForModel(retryContext.model);
596596
596850
  if (thinkingConfig.type === "enabled" && thinkingConfig.budgetTokens !== undefined) {
596597
596851
  thinkingBudget = thinkingConfig.budgetTokens;
596598
596852
  }
@@ -599357,6 +599611,9 @@ function preconnectAnthropicApi() {
599357
599611
  if (fired)
599358
599612
  return;
599359
599613
  fired = true;
599614
+ if (isEnvTruthy(process.env.CLAUDE_CODE_USE_OPENAI) || isEnvTruthy(process.env.CLAUDE_CODE_USE_GEMINI) || isEnvTruthy(process.env.CLAUDE_CODE_USE_GITHUB) || isEnvTruthy(process.env.CLAUDE_CODE_USE_MISTRAL)) {
599615
+ return;
599616
+ }
599360
599617
  if (getAPIProvider() !== "firstParty") {
599361
599618
  return;
599362
599619
  }
@@ -602177,8 +602434,8 @@ var init_types15 = __esm(() => {
602177
602434
  attribution: exports_external.object({
602178
602435
  commit: exports_external.string().optional().describe("Attribution text for git commits, including any trailers. " + "Empty string hides attribution."),
602179
602436
  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)"),
602437
+ }).optional().describe("Customize attribution text for commits and PRs. " + "Unspecified fields are off by default; set a non-empty string to opt in."),
602438
+ includeCoAuthoredBy: exports_external.boolean().optional().describe("Deprecated: Use attribution instead. " + "Whether to include Claude's co-authored by attribution in commits and PRs (defaults to false)"),
602182
602439
  includeGitInstructions: exports_external.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),
602183
602440
  permissions: PermissionsSchema().optional().describe("Tool usage permissions configuration"),
602184
602441
  model: exports_external.string().optional().describe("Override the default model used by Claude Code"),
@@ -604304,7 +604561,7 @@ function printStartupScreen(modelOverride) {
604304
604561
  const sLen = ` ● ${sL} Ready — type /help to begin`.length;
604305
604562
  out.push(boxRow(sRow, W2, sLen, BORDER));
604306
604563
  out.push(`${ansiRgb(...BORDER)}╚${"═".repeat(W2 - 2)}╝${RESET2}`);
604307
- out.push(` ${DIM2}${ansiRgb(...DIMCOL)}openclaude ${RESET2}${ansiRgb(...ACCENT)}v${"0.14.9"}${RESET2}`);
604564
+ out.push(` ${DIM2}${ansiRgb(...DIMCOL)}openclaude ${RESET2}${ansiRgb(...ACCENT)}v${"0.15.0"}${RESET2}`);
604308
604565
  out.push("");
604309
604566
  process.stdout.write(out.join(`
604310
604567
  `) + `
@@ -609076,7 +609333,7 @@ function QuestionNavigationBar(t0) {
609076
609333
  }
609077
609334
  const tabHeaders = questions.map(_temp157);
609078
609335
  const idealWidths = tabHeaders.map(_temp269);
609079
- const totalIdealWidth = idealWidths.reduce(_temp345, 0);
609336
+ const totalIdealWidth = idealWidths.reduce(_temp344, 0);
609080
609337
  if (totalIdealWidth <= availableForTabs) {
609081
609338
  t2 = tabHeaders;
609082
609339
  break bb0;
@@ -609244,7 +609501,7 @@ function QuestionNavigationBar(t0) {
609244
609501
  }
609245
609502
  return t7;
609246
609503
  }
609247
- function _temp345(sum, w) {
609504
+ function _temp344(sum, w) {
609248
609505
  return sum + w;
609249
609506
  }
609250
609507
  function _temp269(header_0) {
@@ -609835,7 +610092,7 @@ function QuestionView(t0) {
609835
610092
  t7 = $2[17];
609836
610093
  }
609837
610094
  const options2 = t7;
609838
- const hasAnyPreview = !question.multiSelect && question.options.some(_temp346);
610095
+ const hasAnyPreview = !question.multiSelect && question.options.some(_temp345);
609839
610096
  if (hasAnyPreview) {
609840
610097
  let t82;
609841
610098
  if ($2[30] !== answers || $2[31] !== currentQuestionIndex || $2[32] !== hideSubmitTab || $2[33] !== minContentHeight || $2[34] !== minContentWidth || $2[35] !== onAnswer || $2[36] !== onCancel || $2[37] !== onFinishPlanInterview || $2[38] !== onRespondToClaude || $2[39] !== onTabNext || $2[40] !== onTabPrev || $2[41] !== onTextInputFocus || $2[42] !== onUpdateQuestionState || $2[43] !== question || $2[44] !== questionStates || $2[45] !== questions) {
@@ -610224,7 +610481,7 @@ function QuestionView(t0) {
610224
610481
  function _temp434(v) {
610225
610482
  return v !== "__other__";
610226
610483
  }
610227
- function _temp346(opt_0) {
610484
+ function _temp345(opt_0) {
610228
610485
  return opt_0.preview;
610229
610486
  }
610230
610487
  function _temp270(opt) {
@@ -610922,7 +611179,7 @@ function AskUserQuestionPermissionRequestBody(t0) {
610922
611179
  const onRemoveImage = t8;
610923
611180
  let t9;
610924
611181
  if ($2[18] !== pastedContentsByQuestion) {
610925
- t9 = Object.values(pastedContentsByQuestion).flatMap(_temp271).filter(_temp347);
611182
+ t9 = Object.values(pastedContentsByQuestion).flatMap(_temp271).filter(_temp346);
610926
611183
  $2[18] = pastedContentsByQuestion;
610927
611184
  $2[19] = t9;
610928
611185
  } else {
@@ -611363,7 +611620,7 @@ function _temp526(c_0) {
611363
611620
  function _temp435(s) {
611364
611621
  return s.toolPermissionContext.mode;
611365
611622
  }
611366
- function _temp347(c6) {
611623
+ function _temp346(c6) {
611367
611624
  return c6.type === "image";
611368
611625
  }
611369
611626
  function _temp271(contents) {
@@ -612599,7 +612856,7 @@ function SuggestionDisplay(t0) {
612599
612856
  }, undefined, false, undefined, this),
612600
612857
  /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(ThemedBox_default, {
612601
612858
  flexDirection: "column",
612602
- children: directories.map(_temp348)
612859
+ children: directories.map(_temp347)
612603
612860
  }, undefined, false, undefined, this)
612604
612861
  ]
612605
612862
  }, undefined, true, undefined, this),
@@ -612635,7 +612892,7 @@ function SuggestionDisplay(t0) {
612635
612892
  }
612636
612893
  return t1;
612637
612894
  }
612638
- function _temp348(dir, index_0) {
612895
+ function _temp347(dir, index_0) {
612639
612896
  return /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(ThemedText, {
612640
612897
  children: [
612641
612898
  figures_default.bullet,
@@ -618271,7 +618528,7 @@ function NotebookEditToolDiffInner(t0) {
618271
618528
  firstLine: new_source.split(`
618272
618529
  `)[0] ?? null,
618273
618530
  fileContent: oldSource
618274
- }, _.newStart, false, undefined, this)), _temp349) : /* @__PURE__ */ jsx_dev_runtime396.jsxDEV(HighlightedCode, {
618531
+ }, _.newStart, false, undefined, this)), _temp348) : /* @__PURE__ */ jsx_dev_runtime396.jsxDEV(HighlightedCode, {
618275
618532
  code: new_source,
618276
618533
  filePath: cell_type === "markdown" ? "file.md" : notebook_path
618277
618534
  }, undefined, false, undefined, this);
@@ -618308,7 +618565,7 @@ function NotebookEditToolDiffInner(t0) {
618308
618565
  }
618309
618566
  return t10;
618310
618567
  }
618311
- function _temp349(i3) {
618568
+ function _temp348(i3) {
618312
618569
  return /* @__PURE__ */ jsx_dev_runtime396.jsxDEV(NoSelect, {
618313
618570
  fromLeftEdge: true,
618314
618571
  children: /* @__PURE__ */ jsx_dev_runtime396.jsxDEV(ThemedText, {
@@ -622711,7 +622968,7 @@ function CompanionFloatingBubble() {
622711
622968
  if (!reaction) {
622712
622969
  return;
622713
622970
  }
622714
- const timer = setInterval(_temp350, TICK_MS2, setTick);
622971
+ const timer = setInterval(_temp349, TICK_MS2, setTick);
622715
622972
  return () => clearInterval(timer);
622716
622973
  };
622717
622974
  t3 = [reaction];
@@ -622747,7 +623004,7 @@ function CompanionFloatingBubble() {
622747
623004
  }
622748
623005
  return t5;
622749
623006
  }
622750
- function _temp350(set3) {
623007
+ function _temp349(set3) {
622751
623008
  return set3(_temp274);
622752
623009
  }
622753
623010
  function _temp274(s_0) {
@@ -628103,7 +628360,7 @@ function BridgeDialog(t0) {
628103
628360
  useRegisterOverlay("bridge-dialog");
628104
628361
  const connected = useAppState(_temp183);
628105
628362
  const sessionActive = useAppState(_temp276);
628106
- const reconnecting = useAppState(_temp351);
628363
+ const reconnecting = useAppState(_temp350);
628107
628364
  const connectUrl = useAppState(_temp437);
628108
628365
  const sessionUrl = useAppState(_temp528);
628109
628366
  const error42 = useAppState(_temp622);
@@ -628531,7 +628788,7 @@ function _temp528(s_3) {
628531
628788
  function _temp437(s_2) {
628532
628789
  return s_2.replBridgeConnectUrl;
628533
628790
  }
628534
- function _temp351(s_1) {
628791
+ function _temp350(s_1) {
628535
628792
  return s_1.replBridgeReconnecting;
628536
628793
  }
628537
628794
  function _temp276(s_0) {
@@ -629261,12 +629518,12 @@ function _temp438(query_0, controller_1, setMatches_0, setTruncated_0, setIsSear
629261
629518
  return;
629262
629519
  }
629263
629520
  if (collected === 0) {
629264
- setMatches_0(_temp352);
629521
+ setMatches_0(_temp351);
629265
629522
  }
629266
629523
  setIsSearching_0(false);
629267
629524
  });
629268
629525
  }
629269
- function _temp352(m_2) {
629526
+ function _temp351(m_2) {
629270
629527
  return m_2.length ? [] : m_2;
629271
629528
  }
629272
629529
  function _temp277() {}
@@ -629511,7 +629768,7 @@ function QuickOpenDialog(t0) {
629511
629768
  if (gen !== queryGenRef.current) {
629512
629769
  return;
629513
629770
  }
629514
- const paths2 = items.filter(_temp187).map(_temp278).filter(_temp353).map(_temp439);
629771
+ const paths2 = items.filter(_temp187).map(_temp278).filter(_temp352).map(_temp439);
629515
629772
  setResults(paths2);
629516
629773
  });
629517
629774
  };
@@ -629702,7 +629959,7 @@ function _temp529(p_3) {
629702
629959
  function _temp439(p_0) {
629703
629960
  return p_0.split(path22.sep).join("/");
629704
629961
  }
629705
- function _temp353(p) {
629962
+ function _temp352(p) {
629706
629963
  return !p.endsWith(path22.sep);
629707
629964
  }
629708
629965
  function _temp278(i_0) {
@@ -632342,7 +632599,7 @@ function BackgroundTaskStatus(t0) {
632342
632599
  const viewingAgentTaskId = useAppState(_temp280);
632343
632600
  let t3;
632344
632601
  if ($2[0] !== tasks2) {
632345
- t3 = Object.values(tasks2 ?? {}).filter(_temp354);
632602
+ t3 = Object.values(tasks2 ?? {}).filter(_temp353);
632346
632603
  $2[0] = tasks2;
632347
632604
  $2[1] = t3;
632348
632605
  } else {
@@ -632627,7 +632884,7 @@ function _temp530(t_0) {
632627
632884
  function _temp440(s_1) {
632628
632885
  return s_1.expandedView;
632629
632886
  }
632630
- function _temp354(t) {
632887
+ function _temp353(t) {
632631
632888
  return isBackgroundTask(t) && true;
632632
632889
  }
632633
632890
  function _temp280(s_0) {
@@ -640991,18 +641248,25 @@ async function initialize3() {
640991
641248
  if (initialized4 || disposed3)
640992
641249
  return;
640993
641250
  initialized4 = true;
641251
+ unregisterCleanup = registerCleanup(async () => {
641252
+ await dispose3();
641253
+ });
640994
641254
  if (!dynamicSkillsCallbackRegistered) {
640995
641255
  dynamicSkillsCallbackRegistered = true;
640996
- onDynamicSkillsLoaded(() => {
640997
- clearCommandMemoizationCaches();
641256
+ unregisterDynamicSkillsCallback = dependencies2.onDynamicSkillsLoaded(() => {
641257
+ if (disposed3)
641258
+ return;
641259
+ dependencies2.clearCommandMemoizationCaches();
640998
641260
  skillsChanged.emit();
640999
641261
  });
641000
641262
  }
641001
641263
  const paths2 = await getWatchablePaths();
641264
+ if (disposed3)
641265
+ return;
641002
641266
  if (paths2.length === 0)
641003
641267
  return;
641004
641268
  logForDebugging(`Watching for changes in skill/command directories: ${paths2.join(", ")}...`);
641005
- watcher5 = esm_default.watch(paths2, {
641269
+ watcher5 = dependencies2.watch(paths2, {
641006
641270
  persistent: true,
641007
641271
  ignoreInitial: true,
641008
641272
  depth: 2,
@@ -641023,9 +641287,6 @@ async function initialize3() {
641023
641287
  watcher5.on("add", handleChange3);
641024
641288
  watcher5.on("change", handleChange3);
641025
641289
  watcher5.on("unlink", handleChange3);
641026
- unregisterCleanup = registerCleanup(async () => {
641027
- await dispose3();
641028
- });
641029
641290
  }
641030
641291
  function dispose3() {
641031
641292
  disposed3 = true;
@@ -641033,6 +641294,11 @@ function dispose3() {
641033
641294
  unregisterCleanup();
641034
641295
  unregisterCleanup = null;
641035
641296
  }
641297
+ if (unregisterDynamicSkillsCallback) {
641298
+ unregisterDynamicSkillsCallback();
641299
+ unregisterDynamicSkillsCallback = null;
641300
+ dynamicSkillsCallbackRegistered = false;
641301
+ }
641036
641302
  let closePromise = Promise.resolve();
641037
641303
  if (watcher5) {
641038
641304
  closePromise = watcher5.close();
@@ -641043,27 +641309,29 @@ function dispose3() {
641043
641309
  reloadTimer = null;
641044
641310
  }
641045
641311
  pendingChangedPaths.clear();
641312
+ lastReloadTime = 0;
641313
+ reloadInProgress = false;
641046
641314
  skillsChanged.clear();
641047
641315
  return closePromise;
641048
641316
  }
641049
641317
  async function getWatchablePaths() {
641050
- const fs5 = getFsImplementation();
641318
+ const fs5 = dependencies2.getFsImplementation();
641051
641319
  const paths2 = [];
641052
- const userSkillsPath = getSkillsPath("userSettings", "skills");
641320
+ const userSkillsPath = dependencies2.getSkillsPath("userSettings", "skills");
641053
641321
  if (userSkillsPath) {
641054
641322
  try {
641055
641323
  await fs5.stat(userSkillsPath);
641056
641324
  paths2.push(userSkillsPath);
641057
641325
  } catch {}
641058
641326
  }
641059
- const userCommandsPath = getSkillsPath("userSettings", "commands");
641327
+ const userCommandsPath = dependencies2.getSkillsPath("userSettings", "commands");
641060
641328
  if (userCommandsPath) {
641061
641329
  try {
641062
641330
  await fs5.stat(userCommandsPath);
641063
641331
  paths2.push(userCommandsPath);
641064
641332
  } catch {}
641065
641333
  }
641066
- const projectSkillsPath = getSkillsPath("projectSettings", "skills");
641334
+ const projectSkillsPath = dependencies2.getSkillsPath("projectSettings", "skills");
641067
641335
  if (projectSkillsPath) {
641068
641336
  try {
641069
641337
  const absolutePath = platformPath2.resolve(projectSkillsPath);
@@ -641071,7 +641339,7 @@ async function getWatchablePaths() {
641071
641339
  paths2.push(absolutePath);
641072
641340
  } catch {}
641073
641341
  }
641074
- const projectCommandsPath = getSkillsPath("projectSettings", "commands");
641342
+ const projectCommandsPath = dependencies2.getSkillsPath("projectSettings", "commands");
641075
641343
  if (projectCommandsPath) {
641076
641344
  try {
641077
641345
  const absolutePath = platformPath2.resolve(projectCommandsPath);
@@ -641089,6 +641357,8 @@ async function getWatchablePaths() {
641089
641357
  return paths2;
641090
641358
  }
641091
641359
  function handleChange3(path24) {
641360
+ if (disposed3)
641361
+ return;
641092
641362
  logForDebugging(`Detected skill change: ${path24}`);
641093
641363
  logEvent("tengu_skill_file_changed", {
641094
641364
  source: "chokidar"
@@ -641096,40 +641366,80 @@ function handleChange3(path24) {
641096
641366
  scheduleReload(path24);
641097
641367
  }
641098
641368
  function scheduleReload(changedPath) {
641369
+ if (disposed3)
641370
+ return;
641099
641371
  pendingChangedPaths.add(changedPath);
641372
+ if (reloadInProgress)
641373
+ return;
641374
+ scheduleReloadTimer();
641375
+ }
641376
+ function scheduleReloadTimer() {
641100
641377
  if (reloadTimer)
641101
641378
  clearTimeout(reloadTimer);
641379
+ const debounceMs = testOverrides2?.reloadDebounce ?? RELOAD_DEBOUNCE_MS;
641380
+ const reloadCooldownMs = testOverrides2?.reloadCooldown ?? RELOAD_COOLDOWN_MS;
641381
+ const cooldownRemaining = lastReloadTime + reloadCooldownMs - Date.now();
641382
+ const delay = Math.max(debounceMs, cooldownRemaining);
641102
641383
  reloadTimer = setTimeout(async () => {
641103
641384
  reloadTimer = null;
641385
+ if (disposed3)
641386
+ return;
641104
641387
  const paths2 = [...pendingChangedPaths];
641105
641388
  pendingChangedPaths.clear();
641106
- const results = await executeConfigChangeHooks("skills", paths2[0]);
641107
- if (hasBlockingResult(results)) {
641108
- logForDebugging(`ConfigChange hook blocked skill reload (${paths2.length} paths)`);
641389
+ if (paths2.length === 0)
641109
641390
  return;
641391
+ reloadInProgress = true;
641392
+ try {
641393
+ const results = await dependencies2.executeConfigChangeHooks("skills", paths2[0]);
641394
+ if (dependencies2.hasBlockingResult(results)) {
641395
+ logForDebugging(`ConfigChange hook blocked skill reload (${paths2.length} paths)`);
641396
+ return;
641397
+ }
641398
+ if (disposed3)
641399
+ return;
641400
+ if (pendingChangedPaths.size > 0) {
641401
+ logForDebugging(`Deferring skill reload because ${pendingChangedPaths.size} newer paths arrived during hooks`);
641402
+ return;
641403
+ }
641404
+ dependencies2.clearCommandsCache();
641405
+ dependencies2.resetSentSkillNames();
641406
+ lastReloadTime = Date.now();
641407
+ skillsChanged.emit();
641408
+ } finally {
641409
+ reloadInProgress = false;
641410
+ if (!disposed3 && pendingChangedPaths.size > 0) {
641411
+ scheduleReloadTimer();
641412
+ }
641110
641413
  }
641111
- clearSkillCaches();
641112
- clearCommandsCache();
641113
- resetSentSkillNames();
641114
- skillsChanged.emit();
641115
- }, testOverrides2?.reloadDebounce ?? RELOAD_DEBOUNCE_MS);
641414
+ }, delay);
641116
641415
  }
641117
641416
  async function resetForTesting2(overrides) {
641118
641417
  if (watcher5) {
641119
641418
  await watcher5.close();
641120
641419
  watcher5 = null;
641121
641420
  }
641421
+ if (unregisterCleanup) {
641422
+ unregisterCleanup();
641423
+ unregisterCleanup = null;
641424
+ }
641425
+ if (unregisterDynamicSkillsCallback) {
641426
+ unregisterDynamicSkillsCallback();
641427
+ unregisterDynamicSkillsCallback = null;
641428
+ dynamicSkillsCallbackRegistered = false;
641429
+ }
641122
641430
  if (reloadTimer) {
641123
641431
  clearTimeout(reloadTimer);
641124
641432
  reloadTimer = null;
641125
641433
  }
641126
641434
  pendingChangedPaths.clear();
641435
+ lastReloadTime = 0;
641436
+ reloadInProgress = false;
641127
641437
  skillsChanged.clear();
641128
641438
  initialized4 = false;
641129
641439
  disposed3 = false;
641130
641440
  testOverrides2 = overrides ?? null;
641131
641441
  }
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;
641442
+ var FILE_STABILITY_THRESHOLD_MS3 = 1000, FILE_STABILITY_POLL_INTERVAL_MS3 = 500, RELOAD_DEBOUNCE_MS = 3000, RELOAD_COOLDOWN_MS = 5000, POLLING_INTERVAL_MS3 = 2000, USE_POLLING, watcher5 = null, reloadTimer = null, pendingChangedPaths, lastReloadTime = 0, reloadInProgress = false, initialized4 = false, disposed3 = false, dynamicSkillsCallbackRegistered = false, unregisterDynamicSkillsCallback = null, unregisterCleanup = null, skillsChanged, testOverrides2 = null, defaultDependencies2, dependencies2, subscribe2, skillChangeDetector;
641133
641443
  var init_skillChangeDetector = __esm(() => {
641134
641444
  init_esm2();
641135
641445
  init_state();
@@ -641143,6 +641453,18 @@ var init_skillChangeDetector = __esm(() => {
641143
641453
  USE_POLLING = typeof Bun !== "undefined";
641144
641454
  pendingChangedPaths = new Set;
641145
641455
  skillsChanged = createSignal();
641456
+ defaultDependencies2 = {
641457
+ clearCommandMemoizationCaches,
641458
+ clearCommandsCache,
641459
+ executeConfigChangeHooks,
641460
+ getFsImplementation,
641461
+ getSkillsPath,
641462
+ hasBlockingResult,
641463
+ onDynamicSkillsLoaded,
641464
+ resetSentSkillNames,
641465
+ watch: esm_default.watch.bind(esm_default)
641466
+ };
641467
+ dependencies2 = defaultDependencies2;
641146
641468
  subscribe2 = skillsChanged.subscribe;
641147
641469
  skillChangeDetector = {
641148
641470
  initialize: initialize3,
@@ -642460,6 +642782,34 @@ var init_useInboxPoller = __esm(() => {
642460
642782
  import_react280 = __toESM(require_react(), 1);
642461
642783
  });
642462
642784
 
642785
+ // src/screens/replActiveAgentModel.ts
642786
+ function getActiveSessionAgentModelSelection({
642787
+ agent: agent2,
642788
+ baseMainLoopModel,
642789
+ hasExplicitModelOverride,
642790
+ hasAgentManagedModel
642791
+ }) {
642792
+ if (hasExplicitModelOverride) {
642793
+ return { shouldUpdateModel: false };
642794
+ }
642795
+ if (agent2.model && agent2.model !== "inherit") {
642796
+ return {
642797
+ shouldUpdateModel: true,
642798
+ mainLoopModelForSession: parseUserSpecifiedModel(agent2.model)
642799
+ };
642800
+ }
642801
+ if (!hasAgentManagedModel) {
642802
+ return { shouldUpdateModel: false };
642803
+ }
642804
+ return {
642805
+ shouldUpdateModel: true,
642806
+ mainLoopModelForSession: baseMainLoopModel ?? getDefaultMainLoopModelSetting()
642807
+ };
642808
+ }
642809
+ var init_replActiveAgentModel = __esm(() => {
642810
+ init_model();
642811
+ });
642812
+
642463
642813
  // src/hooks/useTaskListWatcher.ts
642464
642814
  var import_react281;
642465
642815
  var init_useTaskListWatcher = __esm(() => {
@@ -643730,7 +644080,7 @@ function usePostCompactSurvey(messages, isLoading, t0, t1) {
643730
644080
  import_react291.useEffect(t6, t7);
643731
644081
  let t8;
643732
644082
  if ($2[7] !== messages) {
643733
- t8 = new Set(messages.filter(_temp355).map(_temp441));
644083
+ t8 = new Set(messages.filter(_temp354).map(_temp441));
643734
644084
  $2[7] = messages;
643735
644085
  $2[8] = t8;
643736
644086
  } else {
@@ -643809,7 +644159,7 @@ function usePostCompactSurvey(messages, isLoading, t0, t1) {
643809
644159
  function _temp441(msg_0) {
643810
644160
  return msg_0.uuid;
643811
644161
  }
643812
- function _temp355(msg) {
644162
+ function _temp354(msg) {
643813
644163
  return isCompactBoundaryMessage(msg);
643814
644164
  }
643815
644165
  function _temp283(appearanceId_0, selected) {
@@ -646813,7 +647163,7 @@ function useMcpConnectivityStatus(t0) {
646813
647163
  }
646814
647164
  const failedLocalClients = mcpClients.filter(_temp204);
646815
647165
  const failedClaudeAiClients = mcpClients.filter(_temp286);
646816
- const needsAuthLocalServers = mcpClients.filter(_temp356);
647166
+ const needsAuthLocalServers = mcpClients.filter(_temp355);
646817
647167
  const needsAuthClaudeAiServers = mcpClients.filter(_temp442);
646818
647168
  if (failedLocalClients.length === 0 && failedClaudeAiClients.length === 0 && needsAuthLocalServers.length === 0 && needsAuthClaudeAiServers.length === 0) {
646819
647169
  return;
@@ -646935,7 +647285,7 @@ function useMcpConnectivityStatus(t0) {
646935
647285
  function _temp442(client_2) {
646936
647286
  return client_2.type === "needs-auth" && client_2.config.type === "claudeai-proxy" && hasClaudeAiMcpEverConnected(client_2.name);
646937
647287
  }
646938
- function _temp356(client_1) {
647288
+ function _temp355(client_1) {
646939
647289
  return client_1.type === "needs-auth" && client_1.config.type !== "claudeai-proxy";
646940
647290
  }
646941
647291
  function _temp286(client_0) {
@@ -647830,7 +648180,7 @@ function usePluginInstallationStatus() {
647830
648180
  const failedMarketplaces = t12;
647831
648181
  let t22;
647832
648182
  if ($2[3] !== installationStatus.plugins) {
647833
- t22 = installationStatus.plugins.filter(_temp357);
648183
+ t22 = installationStatus.plugins.filter(_temp356);
647834
648184
  $2[3] = installationStatus.plugins;
647835
648185
  $2[4] = t22;
647836
648186
  } else {
@@ -647921,7 +648271,7 @@ function usePluginInstallationStatus() {
647921
648271
  }
647922
648272
  import_react300.useEffect(t1, t2);
647923
648273
  }
647924
- function _temp357(p) {
648274
+ function _temp356(p) {
647925
648275
  return p.status === "failed";
647926
648276
  }
647927
648277
  function _temp289(m) {
@@ -649158,7 +649508,7 @@ function useFastModeNotification() {
649158
649508
  return;
649159
649509
  }
649160
649510
  return onFastModeOverageRejection((message) => {
649161
- setAppState(_temp358);
649511
+ setAppState(_temp357);
649162
649512
  addNotification({
649163
649513
  key: OVERAGE_REJECTED_KEY,
649164
649514
  color: "warning",
@@ -649225,7 +649575,7 @@ function useFastModeNotification() {
649225
649575
  }
649226
649576
  import_react307.useEffect(t4, t5);
649227
649577
  }
649228
- function _temp358(prev_0) {
649578
+ function _temp357(prev_0) {
649229
649579
  return {
649230
649580
  ...prev_0,
649231
649581
  fastMode: false
@@ -651022,6 +651372,8 @@ function REPL({
651022
651372
  onTurnComplete,
651023
651373
  disabled = false,
651024
651374
  mainThreadAgentDefinition: initialMainThreadAgentDefinition,
651375
+ baseMainLoopModel = null,
651376
+ hasExplicitModelOverride = false,
651025
651377
  disableSlashCommands = false,
651026
651378
  taskListId,
651027
651379
  remoteSessionConfig,
@@ -651085,6 +651437,34 @@ function REPL({
651085
651437
  const store = useAppStateStore();
651086
651438
  const terminal = useTerminalNotification();
651087
651439
  const mainLoopModel = useMainLoopModel();
651440
+ const appMainLoopModel = useAppState((s) => s.mainLoopModel);
651441
+ const appMainLoopModelForSession = useAppState((s) => s.mainLoopModelForSession);
651442
+ const initialAgentModelSelection = !hasExplicitModelOverride && initialMainThreadAgentDefinition?.model && initialMainThreadAgentDefinition.model !== "inherit" ? getActiveSessionAgentModelSelection({
651443
+ agent: initialMainThreadAgentDefinition,
651444
+ baseMainLoopModel,
651445
+ hasExplicitModelOverride,
651446
+ hasAgentManagedModel: false
651447
+ }) : undefined;
651448
+ const explicitModelOverrideRef = import_react315.useRef(hasExplicitModelOverride);
651449
+ const baseMainLoopModelRef = import_react315.useRef(baseMainLoopModel);
651450
+ const agentManagedModelRef = import_react315.useRef(initialAgentModelSelection?.shouldUpdateModel ? initialAgentModelSelection.mainLoopModelForSession : undefined);
651451
+ const previousMainLoopModelForSessionRef = import_react315.useRef(appMainLoopModelForSession);
651452
+ const didTrackInitialModelStateRef = import_react315.useRef(false);
651453
+ import_react315.useEffect(() => {
651454
+ const previousMainLoopModelForSession = previousMainLoopModelForSessionRef.current;
651455
+ previousMainLoopModelForSessionRef.current = appMainLoopModelForSession;
651456
+ if (!didTrackInitialModelStateRef.current) {
651457
+ didTrackInitialModelStateRef.current = true;
651458
+ return;
651459
+ }
651460
+ const currentEffectiveModelSetting = appMainLoopModelForSession ?? appMainLoopModel;
651461
+ const clearedAgentManagedSessionModel = previousMainLoopModelForSession !== null && appMainLoopModelForSession === null;
651462
+ if (!clearedAgentManagedSessionModel && currentEffectiveModelSetting === agentManagedModelRef.current)
651463
+ return;
651464
+ explicitModelOverrideRef.current = true;
651465
+ baseMainLoopModelRef.current = currentEffectiveModelSetting;
651466
+ agentManagedModelRef.current = undefined;
651467
+ }, [appMainLoopModel, appMainLoopModelForSession]);
651088
651468
  const [localCommands, setLocalCommands] = import_react315.useState(initialCommands);
651089
651469
  useSkillsChange(isRemoteSession ? undefined : getProjectRoot(), setLocalCommands);
651090
651470
  const proactiveActive = React165.useSyncExternalStore(proactiveModule5?.subscribeToProactiveChanges ?? PROACTIVE_NO_OP_SUBSCRIBE, proactiveModule5?.isProactiveActive ?? PROACTIVE_FALSE);
@@ -652228,6 +652608,31 @@ Error: sandbox required but unavailable: ${reason}
652228
652608
  },
652229
652609
  resume: resume2,
652230
652610
  setConversationId,
652611
+ setActiveSessionAgent: (agent2) => {
652612
+ const modelSelection = getActiveSessionAgentModelSelection({
652613
+ agent: agent2,
652614
+ baseMainLoopModel: baseMainLoopModelRef.current,
652615
+ hasExplicitModelOverride: explicitModelOverrideRef.current,
652616
+ hasAgentManagedModel: agentManagedModelRef.current !== undefined
652617
+ });
652618
+ setMainThreadAgentDefinition(agent2);
652619
+ setMainThreadAgentType(agent2.agentType);
652620
+ saveAgentSetting(agent2.agentType);
652621
+ if (modelSelection.shouldUpdateModel) {
652622
+ agentManagedModelRef.current = modelSelection.mainLoopModelForSession;
652623
+ setMainLoopModelOverride(modelSelection.mainLoopModelForSession);
652624
+ notifySessionMetadataChanged({
652625
+ model: modelSelection.mainLoopModelForSession
652626
+ });
652627
+ }
652628
+ setAppState((prev) => ({
652629
+ ...prev,
652630
+ agent: agent2.agentType,
652631
+ ...modelSelection.shouldUpdateModel ? {
652632
+ mainLoopModelForSession: modelSelection.mainLoopModelForSession
652633
+ } : {}
652634
+ }));
652635
+ },
652231
652636
  requestPrompt,
652232
652637
  contentReplacementState: contentReplacementStateRef.current,
652233
652638
  syncToolResultReplacements
@@ -654350,9 +654755,11 @@ var init_REPL = __esm(() => {
654350
654755
  init_commitAttribution();
654351
654756
  init_sessionStorage();
654352
654757
  init_sessionRestore();
654758
+ init_sessionState();
654353
654759
  init_concurrentSessions();
654354
654760
  init_RemoteAgentTask();
654355
654761
  init_useInboxPoller();
654762
+ init_replActiveAgentModel();
654356
654763
  init_agentSwarmsEnabled();
654357
654764
  init_useTaskListWatcher();
654358
654765
  init_ide();
@@ -655615,7 +656022,7 @@ function WelcomeV2() {
655615
656022
  dimColor: true,
655616
656023
  children: [
655617
656024
  "v",
655618
- "0.14.9",
656025
+ "0.15.0",
655619
656026
  " "
655620
656027
  ]
655621
656028
  }, undefined, true, undefined, this)
@@ -655815,7 +656222,7 @@ function WelcomeV2() {
655815
656222
  dimColor: true,
655816
656223
  children: [
655817
656224
  "v",
655818
- "0.14.9",
656225
+ "0.15.0",
655819
656226
  " "
655820
656227
  ]
655821
656228
  }, undefined, true, undefined, this)
@@ -656041,7 +656448,7 @@ function AppleTerminalWelcomeV2(t0) {
656041
656448
  dimColor: true,
656042
656449
  children: [
656043
656450
  "v",
656044
- "0.14.9",
656451
+ "0.15.0",
656045
656452
  " "
656046
656453
  ]
656047
656454
  }, undefined, true, undefined, this);
@@ -656295,7 +656702,7 @@ function AppleTerminalWelcomeV2(t0) {
656295
656702
  dimColor: true,
656296
656703
  children: [
656297
656704
  "v",
656298
- "0.14.9",
656705
+ "0.15.0",
656299
656706
  " "
656300
656707
  ]
656301
656708
  }, undefined, true, undefined, this);
@@ -657463,9 +657870,9 @@ function _temp531(current) {
657463
657870
  };
657464
657871
  }
657465
657872
  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);
657873
+ return command_0.type === "prompt" && (command_0.loadedFrom === "skills" || command_0.loadedFrom === "plugin") && (command_0.source === "projectSettings" || command_0.source === "localSettings" || command_0.source === "plugin") && command_0.allowedTools?.some(_temp358);
657467
657874
  }
657468
- function _temp359(tool_0) {
657875
+ function _temp358(tool_0) {
657469
657876
  return tool_0 === BASH_TOOL_NAME || tool_0.startsWith(BASH_TOOL_NAME + "(");
657470
657877
  }
657471
657878
  function _temp298(command10) {
@@ -658999,6 +659406,8 @@ function ResumeConversation({
658999
659406
  dynamicMcpConfig,
659000
659407
  debug,
659001
659408
  mainThreadAgentDefinition,
659409
+ baseMainLoopModel,
659410
+ hasExplicitModelOverride,
659002
659411
  autoConnectIdeFlag,
659003
659412
  strictMcpConfig = false,
659004
659413
  systemPrompt,
@@ -659220,6 +659629,8 @@ function ResumeConversation({
659220
659629
  systemPrompt,
659221
659630
  appendSystemPrompt,
659222
659631
  mainThreadAgentDefinition: resumeData.mainThreadAgentDefinition,
659632
+ baseMainLoopModel,
659633
+ hasExplicitModelOverride,
659223
659634
  autoConnectIdeFlag,
659224
659635
  disableSlashCommands,
659225
659636
  taskListId,
@@ -659333,7 +659744,7 @@ function CrossProjectMessage(t0) {
659333
659744
  } else {
659334
659745
  t1 = $2[0];
659335
659746
  }
659336
- import_react328.default.useEffect(_temp360, t1);
659747
+ import_react328.default.useEffect(_temp359, t1);
659337
659748
  let t2;
659338
659749
  if ($2[1] === Symbol.for("react.memo_cache_sentinel")) {
659339
659750
  t2 = /* @__PURE__ */ jsx_dev_runtime488.jsxDEV(ThemedText, {
@@ -659399,7 +659810,7 @@ function CrossProjectMessage(t0) {
659399
659810
  }
659400
659811
  return t6;
659401
659812
  }
659402
- function _temp360() {
659813
+ function _temp359() {
659403
659814
  const timeout2 = setTimeout(_temp2101, 100);
659404
659815
  return () => clearTimeout(timeout2);
659405
659816
  }
@@ -673840,7 +674251,7 @@ __export(exports_update, {
673840
674251
  async function update() {
673841
674252
  if (getAPIProvider() !== "firstParty") {
673842
674253
  writeToStdout(source_default.yellow(`Auto-update is not available for third-party provider builds.
673843
- `) + `Current version: ${"0.14.9"}
674254
+ `) + `Current version: ${"0.15.0"}
673844
674255
 
673845
674256
  ` + `To update, reinstall from npm:
673846
674257
  ` + source_default.bold(` npm install -g ${"@makerbi/openclaude"}@latest`) + `
@@ -673851,7 +674262,7 @@ async function update() {
673851
674262
  await gracefulShutdown(0);
673852
674263
  }
673853
674264
  logEvent("tengu_update_check", {});
673854
- writeToStdout(`Current version: ${"0.14.9"}
674265
+ writeToStdout(`Current version: ${"0.15.0"}
673855
674266
  `);
673856
674267
  const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
673857
674268
  writeToStdout(`Checking for updates to ${channel} version...
@@ -673936,8 +674347,8 @@ async function update() {
673936
674347
  writeToStdout(`Claude is managed by Homebrew.
673937
674348
  `);
673938
674349
  const latest = await getLatestVersion(channel);
673939
- if (latest && !gte("0.14.9", latest)) {
673940
- writeToStdout(`Update available: ${"0.14.9"} → ${latest}
674350
+ if (latest && !gte("0.15.0", latest)) {
674351
+ writeToStdout(`Update available: ${"0.15.0"} → ${latest}
673941
674352
  `);
673942
674353
  writeToStdout(`
673943
674354
  `);
@@ -673953,8 +674364,8 @@ async function update() {
673953
674364
  writeToStdout(`Claude is managed by winget.
673954
674365
  `);
673955
674366
  const latest = await getLatestVersion(channel);
673956
- if (latest && !gte("0.14.9", latest)) {
673957
- writeToStdout(`Update available: ${"0.14.9"} → ${latest}
674367
+ if (latest && !gte("0.15.0", latest)) {
674368
+ writeToStdout(`Update available: ${"0.15.0"} → ${latest}
673958
674369
  `);
673959
674370
  writeToStdout(`
673960
674371
  `);
@@ -673970,8 +674381,8 @@ async function update() {
673970
674381
  writeToStdout(`Claude is managed by apk.
673971
674382
  `);
673972
674383
  const latest = await getLatestVersion(channel);
673973
- if (latest && !gte("0.14.9", latest)) {
673974
- writeToStdout(`Update available: ${"0.14.9"} → ${latest}
674384
+ if (latest && !gte("0.15.0", latest)) {
674385
+ writeToStdout(`Update available: ${"0.15.0"} → ${latest}
673975
674386
  `);
673976
674387
  writeToStdout(`
673977
674388
  `);
@@ -674036,11 +674447,11 @@ async function update() {
674036
674447
  `);
674037
674448
  await gracefulShutdown(1);
674038
674449
  }
674039
- if (result.latestVersion === "0.14.9") {
674040
- writeToStdout(source_default.green(`OpenClaude is up to date (${"0.14.9"})`) + `
674450
+ if (result.latestVersion === "0.15.0") {
674451
+ writeToStdout(source_default.green(`OpenClaude is up to date (${"0.15.0"})`) + `
674041
674452
  `);
674042
674453
  } else {
674043
- writeToStdout(source_default.green(`Successfully updated from ${"0.14.9"} to version ${result.latestVersion}`) + `
674454
+ writeToStdout(source_default.green(`Successfully updated from ${"0.15.0"} to version ${result.latestVersion}`) + `
674044
674455
  `);
674045
674456
  await regenerateCompletionCache();
674046
674457
  }
@@ -674100,12 +674511,12 @@ async function update() {
674100
674511
  `);
674101
674512
  await gracefulShutdown(1);
674102
674513
  }
674103
- if (latestVersion === "0.14.9") {
674104
- writeToStdout(source_default.green(`OpenClaude is up to date (${"0.14.9"})`) + `
674514
+ if (latestVersion === "0.15.0") {
674515
+ writeToStdout(source_default.green(`OpenClaude is up to date (${"0.15.0"})`) + `
674105
674516
  `);
674106
674517
  await gracefulShutdown(0);
674107
674518
  }
674108
- writeToStdout(`New version available: ${latestVersion} (current: ${"0.14.9"})
674519
+ writeToStdout(`New version available: ${latestVersion} (current: ${"0.15.0"})
674109
674520
  `);
674110
674521
  writeToStdout(`Installing update...
674111
674522
  `);
@@ -674150,7 +674561,7 @@ async function update() {
674150
674561
  logForDebugging(`update: Installation status: ${status2}`);
674151
674562
  switch (status2) {
674152
674563
  case "success":
674153
- writeToStdout(source_default.green(`Successfully updated from ${"0.14.9"} to version ${latestVersion}`) + `
674564
+ writeToStdout(source_default.green(`Successfully updated from ${"0.15.0"} to version ${latestVersion}`) + `
674154
674565
  `);
674155
674566
  await regenerateCompletionCache();
674156
674567
  break;
@@ -675120,6 +675531,8 @@ ${hint}` : hint;
675120
675531
  if (false) {}
675121
675532
  const userSpecifiedModel = options2.model === "default" ? getDefaultMainLoopModel() : options2.model;
675122
675533
  const userSpecifiedFallbackModel = fallbackModel === "default" ? getDefaultMainLoopModel() : fallbackModel;
675534
+ const hasExplicitModelOverride = userSpecifiedModel !== undefined;
675535
+ const baseMainLoopModel = userSpecifiedModel ?? getUserSpecifiedModelSetting() ?? null;
675123
675536
  const currentCwd2 = worktreeEnabled ? getCwd() : preSetupCwd;
675124
675537
  logForDebugging("[STARTUP] Loading commands and agents...");
675125
675538
  const commandsStart = Date.now();
@@ -675846,6 +676259,8 @@ ${customInstructions}` : customInstructions;
675846
676259
  mcpClients,
675847
676260
  autoConnectIdeFlag: ide2,
675848
676261
  mainThreadAgentDefinition,
676262
+ baseMainLoopModel,
676263
+ hasExplicitModelOverride,
675849
676264
  disableSlashCommands,
675850
676265
  dynamicMcpConfig,
675851
676266
  strictMcpConfig,
@@ -676203,7 +676618,7 @@ Usage: openclaude --remote "your task description"`, () => gracefulShutdown(1));
676203
676618
  pendingHookMessages
676204
676619
  }, renderAndRun);
676205
676620
  }
676206
- }).version("0.14.9 (OpenClaude)", "-v, --version", "Output the version number");
676621
+ }).version("0.15.0 (OpenClaude)", "-v, --version", "Output the version number");
676207
676622
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
676208
676623
  program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
676209
676624
  if (canUserConfigureAdvisor()) {
@@ -676780,7 +677195,7 @@ if (false) {}
676780
677195
  async function main2() {
676781
677196
  const args = process.argv.slice(2);
676782
677197
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
676783
- console.log(`${"0.14.9"} (OpenClaude)`);
677198
+ console.log(`${"0.15.0"} (OpenClaude)`);
676784
677199
  return;
676785
677200
  }
676786
677201
  if (args.includes("--provider")) {
@@ -676933,4 +677348,4 @@ async function main2() {
676933
677348
  }
676934
677349
  main2();
676935
677350
 
676936
- //# debugId=86F0C6D47371392E64756E2164756E21
677351
+ //# debugId=7A5287DBF0759A3864756E2164756E21