@funnycode/myclaude 0.1.124 → 0.1.148

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/myclaude.js CHANGED
@@ -4,8 +4,8 @@
4
4
  // MACRO - build-time constants (injected by build.ts)
5
5
  // MACRO injected by build script
6
6
  globalThis.MACRO = {
7
- VERSION: "0.1.124",
8
- BUILD_TIME: "2026-07-23T21:22:35.165Z",
7
+ VERSION: "0.1.148",
8
+ BUILD_TIME: "2026-07-27T16:17:07.228Z",
9
9
  PACKAGE_URL: "@funnycode/myclaude",
10
10
  NATIVE_PACKAGE_URL: "@funnycode/myclaude",
11
11
  VERSION_CHANGELOG: '',
@@ -14230,8 +14230,13 @@ var init_fsOperations = __esm(() => {
14230
14230
  let __stack = [];
14231
14231
  try {
14232
14232
  const _ = __using(__stack, slowLogging`fs.isDirEmptySync(${dirPath})`, 0);
14233
- const files = this.readdirSync(dirPath);
14234
- return files.length === 0;
14233
+ const dir = fs4.opendirSync(dirPath);
14234
+ try {
14235
+ const firstEntry = dir.readSync();
14236
+ return firstEntry === null;
14237
+ } finally {
14238
+ dir.closeSync();
14239
+ }
14235
14240
  } catch (_catch) {
14236
14241
  var _err = _catch, _hasErr = 1;
14237
14242
  } finally {
@@ -31338,7 +31343,7 @@ var hasColors, format = (open4, close) => {
31338
31343
  result += string4.slice(lastIndex) + closeCode;
31339
31344
  return result;
31340
31345
  };
31341
- }, reset, bold, dim, italic, underline, overline, inverse, hidden, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright;
31346
+ }, reset, bold, dim, italic, underline, underlineDouble, underlineCurly, underlineDotted, underlineDashed, overline, inverse, hidden, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright, underlineBlack, underlineRed, underlineGreen, underlineYellow, underlineBlue, underlineMagenta, underlineCyan, underlineWhite, underlineGray, underlineRedBright, underlineGreenBright, underlineYellowBright, underlineBlueBright, underlineMagentaBright, underlineCyanBright, underlineWhiteBright;
31342
31347
  var init_base = __esm(() => {
31343
31348
  hasColors = tty2?.WriteStream?.prototype?.hasColors?.() ?? false;
31344
31349
  reset = format(0, 0);
@@ -31346,6 +31351,10 @@ var init_base = __esm(() => {
31346
31351
  dim = format(2, 22);
31347
31352
  italic = format(3, 23);
31348
31353
  underline = format(4, 24);
31354
+ underlineDouble = format("4:2", 24);
31355
+ underlineCurly = format("4:3", 24);
31356
+ underlineDotted = format("4:4", 24);
31357
+ underlineDashed = format("4:5", 24);
31349
31358
  overline = format(53, 55);
31350
31359
  inverse = format(7, 27);
31351
31360
  hidden = format(8, 28);
@@ -31382,6 +31391,22 @@ var init_base = __esm(() => {
31382
31391
  bgMagentaBright = format(105, 49);
31383
31392
  bgCyanBright = format(106, 49);
31384
31393
  bgWhiteBright = format(107, 49);
31394
+ underlineBlack = format("58;5;0", 59);
31395
+ underlineRed = format("58;5;1", 59);
31396
+ underlineGreen = format("58;5;2", 59);
31397
+ underlineYellow = format("58;5;3", 59);
31398
+ underlineBlue = format("58;5;4", 59);
31399
+ underlineMagenta = format("58;5;5", 59);
31400
+ underlineCyan = format("58;5;6", 59);
31401
+ underlineWhite = format("58;5;7", 59);
31402
+ underlineGray = format("58;5;8", 59);
31403
+ underlineRedBright = format("58;5;9", 59);
31404
+ underlineGreenBright = format("58;5;10", 59);
31405
+ underlineYellowBright = format("58;5;11", 59);
31406
+ underlineBlueBright = format("58;5;12", 59);
31407
+ underlineMagentaBright = format("58;5;13", 59);
31408
+ underlineCyanBright = format("58;5;14", 59);
31409
+ underlineWhiteBright = format("58;5;15", 59);
31385
31410
  });
31386
31411
 
31387
31412
  // node_modules/yoctocolors/index.js
@@ -61271,11 +61296,19 @@ function updateSettingsForSource(source, settings) {
61271
61296
  }
61272
61297
  }
61273
61298
  }
61274
- const updatedSettings = mergeWith_default(existingSettings || {}, settings, (_objValue, srcValue, key, object2) => {
61275
- if (srcValue === undefined && object2 && typeof key === "string") {
61276
- delete object2[key];
61277
- return;
61299
+ const srcKeys = Object.keys(settings);
61300
+ const nonUndefinedSettings = {};
61301
+ for (const key of srcKeys) {
61302
+ const value = settings[key];
61303
+ if (value === undefined) {
61304
+ if (existingSettings) {
61305
+ delete existingSettings[key];
61306
+ }
61307
+ } else {
61308
+ nonUndefinedSettings[key] = value;
61278
61309
  }
61310
+ }
61311
+ const updatedSettings = mergeWith_default(existingSettings || {}, nonUndefinedSettings, (_objValue, srcValue, key, object2) => {
61279
61312
  if (Array.isArray(srcValue)) {
61280
61313
  return srcValue;
61281
61314
  }
@@ -88568,7 +88601,7 @@ var require_serde = __commonJS((exports) => {
88568
88601
  return v.replace(/\\"/g, '"');
88569
88602
  });
88570
88603
  };
88571
- var format3 = /^-?\d*(\.\d+)?$/;
88604
+ var format3 = /^-?((0|[1-9]\d*)(\.\d+)?|\.\d+)([eE][+-]?\d+)?$/;
88572
88605
 
88573
88606
  class NumericValue {
88574
88607
  string;
@@ -88577,7 +88610,7 @@ var require_serde = __commonJS((exports) => {
88577
88610
  this.string = string4;
88578
88611
  this.type = type;
88579
88612
  if (!format3.test(string4)) {
88580
- throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`);
88613
+ throw new Error(`@smithy/core/serde - NumericValue string must conform to the Smithy bigDecimal format. Received: "${string4}"`);
88581
88614
  }
88582
88615
  }
88583
88616
  toString() {
@@ -92810,6 +92843,7 @@ var require_retry2 = __commonJS((exports) => {
92810
92843
  var { parseRfc7231DateTime, v4 } = require_serde();
92811
92844
  var isStreamingPayload = (request) => request?.body instanceof Readable6 || typeof ReadableStream !== "undefined" && request?.body instanceof ReadableStream;
92812
92845
  var CLOCK_SKEW_ERROR_CODES = [
92846
+ "AccessDeniedException",
92813
92847
  "AuthFailure",
92814
92848
  "InvalidSignatureException",
92815
92849
  "RequestExpired",
@@ -96914,20 +96948,25 @@ ${toHex(hashedRequest)}`;
96914
96948
 
96915
96949
  // node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js
96916
96950
  var require_httpAuthSchemes = __commonJS((exports) => {
96917
- var { HttpResponse, HttpRequest } = require_protocols();
96918
- var { normalizeProvider, memoizeIdentityProvider, isIdentityExpired, doesIdentityRequireRefresh } = require_dist_cjs3();
96919
- var { ProviderError } = require_config();
96951
+ var { ProviderError, booleanSelector, SelectorType, loadConfig } = require_config();
96920
96952
  var { setCredentialFeature } = require_client3();
96953
+ var { normalizeProvider, memoizeIdentityProvider, isIdentityExpired, doesIdentityRequireRefresh } = require_dist_cjs3();
96921
96954
  var { SignatureV4 } = require_dist_cjs7();
96955
+ var { HttpResponse, HttpRequest } = require_protocols();
96922
96956
  var getDateHeader = (response) => HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined;
96957
+ var getAgeHeader = (response) => HttpResponse.isInstance(response) ? response.headers?.age ?? response.headers?.Age : undefined;
96923
96958
  var getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset);
96924
- var isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 300000;
96925
- var getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => {
96926
- const clockTimeInMs = Date.parse(clockTime);
96927
- if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) {
96928
- return clockTimeInMs - Date.now();
96959
+ var getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset, timeRequestSent, ageHeader) => {
96960
+ if (ageHeader !== undefined) {
96961
+ return currentSystemClockOffset;
96929
96962
  }
96930
- return currentSystemClockOffset;
96963
+ const serverTime = Date.parse(clockTime);
96964
+ const timeResponseReceived = Date.now();
96965
+ if (timeRequestSent !== undefined && timeResponseReceived - timeRequestSent > 900000) {
96966
+ return currentSystemClockOffset;
96967
+ }
96968
+ const candidateSkew = timeRequestSent !== undefined ? serverTime - (timeRequestSent + timeResponseReceived) / 2 : serverTime - timeResponseReceived;
96969
+ return candidateSkew;
96931
96970
  };
96932
96971
  var throwSigningPropertyError = (name, property2) => {
96933
96972
  if (!property2) {
@@ -96969,9 +97008,14 @@ var require_httpAuthSchemes = __commonJS((exports) => {
96969
97008
  signingName = second?.signingName ?? signingName;
96970
97009
  }
96971
97010
  }
96972
- signingProperties._preRequestSystemClockOffset = config2.systemClockOffset;
97011
+ const noSkewCorrection = await config2.disableClockSkewCorrection?.() === true;
97012
+ signingProperties._disableClockSkewCorrection = noSkewCorrection;
97013
+ if (!noSkewCorrection) {
97014
+ signingProperties._preRequestSystemClockOffset = config2.systemClockOffset;
97015
+ signingProperties._requestSentAt = Date.now();
97016
+ }
96973
97017
  const signedRequest = await signer.sign(httpRequest, {
96974
- signingDate: getSkewCorrectedDate(config2.systemClockOffset),
97018
+ signingDate: noSkewCorrection ? new Date : getSkewCorrectedDate(config2.systemClockOffset),
96975
97019
  signingRegion,
96976
97020
  signingService: signingName
96977
97021
  });
@@ -96980,27 +97024,36 @@ var require_httpAuthSchemes = __commonJS((exports) => {
96980
97024
  errorHandler(signingProperties) {
96981
97025
  return (error49) => {
96982
97026
  const errorException = error49;
96983
- const serverTime = errorException.ServerTime ?? getDateHeader(errorException.$response);
96984
- if (serverTime) {
96985
- const config2 = throwSigningPropertyError("config", signingProperties.config);
96986
- const preRequestOffset = signingProperties._preRequestSystemClockOffset;
96987
- const newOffset = getUpdatedSystemClockOffset(serverTime, config2.systemClockOffset);
96988
- const isLocalCorrection = newOffset !== config2.systemClockOffset;
96989
- const isConcurrentCorrection = preRequestOffset !== undefined && preRequestOffset !== newOffset;
96990
- const clockSkewCorrected = isLocalCorrection || isConcurrentCorrection;
96991
- if (clockSkewCorrected && errorException.$metadata) {
97027
+ if (!signingProperties._disableClockSkewCorrection) {
97028
+ const serverTime = errorException.ServerTime ?? getDateHeader(errorException.$response);
97029
+ if (serverTime) {
97030
+ const config2 = throwSigningPropertyError("config", signingProperties.config);
97031
+ const preRequestOffset = signingProperties._preRequestSystemClockOffset;
97032
+ const timeRequestSent = signingProperties._requestSentAt;
97033
+ const ageHeader = getAgeHeader(errorException.$response);
97034
+ const newOffset = getUpdatedSystemClockOffset(serverTime, config2.systemClockOffset, timeRequestSent, ageHeader);
96992
97035
  config2.systemClockOffset = newOffset;
96993
- errorException.$metadata.clockSkewCorrected = true;
97036
+ const skewExceedsThreshold = Math.abs(newOffset) >= 240000;
97037
+ const isLocalCorrection = newOffset !== preRequestOffset;
97038
+ const isConcurrentCorrection = preRequestOffset !== undefined && preRequestOffset !== newOffset;
97039
+ if (skewExceedsThreshold && (isLocalCorrection || isConcurrentCorrection) && errorException.$metadata) {
97040
+ errorException.$metadata.clockSkewCorrected = true;
97041
+ }
96994
97042
  }
96995
97043
  }
96996
97044
  throw error49;
96997
97045
  };
96998
97046
  }
96999
97047
  successHandler(httpResponse, signingProperties) {
97048
+ if (signingProperties._disableClockSkewCorrection) {
97049
+ return;
97050
+ }
97000
97051
  const dateHeader = getDateHeader(httpResponse);
97001
97052
  if (dateHeader) {
97002
97053
  const config2 = throwSigningPropertyError("config", signingProperties.config);
97003
- config2.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config2.systemClockOffset);
97054
+ const timeRequestSent = signingProperties._requestSentAt;
97055
+ const ageHeader = getAgeHeader(httpResponse);
97056
+ config2.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config2.systemClockOffset, timeRequestSent, ageHeader);
97004
97057
  }
97005
97058
  }
97006
97059
  }
@@ -97014,9 +97067,14 @@ var require_httpAuthSchemes = __commonJS((exports) => {
97014
97067
  const { config: config2, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties);
97015
97068
  const configResolvedSigningRegionSet = await config2.sigv4aSigningRegionSet?.();
97016
97069
  const multiRegionOverride = (configResolvedSigningRegionSet ?? signingRegionSet ?? [signingRegion]).join(",");
97017
- signingProperties._preRequestSystemClockOffset = config2.systemClockOffset;
97070
+ const noSkewCorrection = await config2.disableClockSkewCorrection?.() === true;
97071
+ signingProperties._disableClockSkewCorrection = noSkewCorrection;
97072
+ if (!noSkewCorrection) {
97073
+ signingProperties._preRequestSystemClockOffset = config2.systemClockOffset;
97074
+ signingProperties._requestSentAt = Date.now();
97075
+ }
97018
97076
  const signedRequest = await signer.sign(httpRequest, {
97019
- signingDate: getSkewCorrectedDate(config2.systemClockOffset),
97077
+ signingDate: noSkewCorrection ? new Date : getSkewCorrectedDate(config2.systemClockOffset),
97020
97078
  signingRegion: multiRegionOverride,
97021
97079
  signingService: signingName
97022
97080
  });
@@ -97068,7 +97126,7 @@ var require_httpAuthSchemes = __commonJS((exports) => {
97068
97126
  },
97069
97127
  default: undefined
97070
97128
  };
97071
- var resolveAwsSdkSigV4Config = (config2) => {
97129
+ var bindResolveAwsSdkSigV4Config = (defaultDisableClockSkewCorrection) => (config2) => {
97072
97130
  let inputCredentials = config2.credentials;
97073
97131
  let isUserSupplied = !!config2.credentials;
97074
97132
  let resolvedCredentials = undefined;
@@ -97160,11 +97218,11 @@ var require_httpAuthSchemes = __commonJS((exports) => {
97160
97218
  const resolvedConfig = Object.assign(config2, {
97161
97219
  systemClockOffset,
97162
97220
  signingEscapePath,
97163
- signer
97221
+ signer,
97222
+ disableClockSkewCorrection: normalizeProvider(config2.disableClockSkewCorrection ?? defaultDisableClockSkewCorrection)
97164
97223
  });
97165
97224
  return resolvedConfig;
97166
97225
  };
97167
- var resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config;
97168
97226
  function normalizeCredentialProvider(config2, { credentials, credentialDefaultProvider }) {
97169
97227
  let credentialsProvider;
97170
97228
  if (credentials) {
@@ -97196,6 +97254,16 @@ var require_httpAuthSchemes = __commonJS((exports) => {
97196
97254
  fn.configBound = true;
97197
97255
  return fn;
97198
97256
  }
97257
+ var ENV_DISABLE_CLOCK_SKEW_CORRECTION = "AWS_DISABLE_CLOCK_SKEW_CORRECTION";
97258
+ var CONFIG_DISABLE_CLOCK_SKEW_CORRECTION = "disable_clock_skew_correction";
97259
+ var NODE_DISABLE_CLOCK_SKEW_CORRECTION_CONFIG_OPTIONS = {
97260
+ environmentVariableSelector: (env6) => booleanSelector(env6, ENV_DISABLE_CLOCK_SKEW_CORRECTION, SelectorType.ENV),
97261
+ configFileSelector: (profile) => booleanSelector(profile, CONFIG_DISABLE_CLOCK_SKEW_CORRECTION, SelectorType.CONFIG),
97262
+ default: false
97263
+ };
97264
+ var DEFAULT_DISABLE_CLOCK_SKEW_CORRECTION = loadConfig(NODE_DISABLE_CLOCK_SKEW_CORRECTION_CONFIG_OPTIONS);
97265
+ var resolveAwsSdkSigV4Config = bindResolveAwsSdkSigV4Config(DEFAULT_DISABLE_CLOCK_SKEW_CORRECTION);
97266
+ var resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config;
97199
97267
  exports.AWSSDKSigV4Signer = AWSSDKSigV4Signer;
97200
97268
  exports.AwsSdkSigV4ASigner = AwsSdkSigV4ASigner;
97201
97269
  exports.AwsSdkSigV4Signer = AwsSdkSigV4Signer;
@@ -98522,6 +98590,9 @@ var require_dist_cjs8 = __commonJS((exports) => {
98522
98590
  return xmlText += !hasChildren ? "/>" : `>${this.children.map((c5) => c5.toString()).join("")}</${this.name}>`;
98523
98591
  }
98524
98592
  }
98593
+ function writeKey(obj) {
98594
+ Object.defineProperty(obj, "__proto__", { value: undefined, writable: true, enumerable: true, configurable: true });
98595
+ }
98525
98596
  function parseXML(xml) {
98526
98597
  const state = new AwsXmlParser(xml);
98527
98598
  return state.parse();
@@ -98607,7 +98678,7 @@ var require_dist_cjs8 = __commonJS((exports) => {
98607
98678
  tag += p.x[p.i++];
98608
98679
  }
98609
98680
  let hasAttrs = false;
98610
- const attrs = Object.create(null);
98681
+ const attrs = {};
98611
98682
  while (p.i < p.z) {
98612
98683
  p.trim();
98613
98684
  if (">/".includes(p.x[p.i])) {
@@ -98624,6 +98695,9 @@ var require_dist_cjs8 = __commonJS((exports) => {
98624
98695
  }
98625
98696
  ++p.i;
98626
98697
  p.trim();
98698
+ if (name === "__proto__") {
98699
+ writeKey(attrs);
98700
+ }
98627
98701
  attrs[name] = p.readAttrValue();
98628
98702
  hasAttrs = true;
98629
98703
  }
@@ -98636,7 +98710,6 @@ var require_dist_cjs8 = __commonJS((exports) => {
98636
98710
  throw new Error("@aws-sdk XML parse error: expected > at the end of self-closing tag.");
98637
98711
  }
98638
98712
  ++p.i;
98639
- Object.setPrototypeOf(attrs, Object.prototype);
98640
98713
  return { tag, value: hasAttrs ? attrs : "" };
98641
98714
  }
98642
98715
  if (p.x[p.i] !== ">") {
@@ -98689,7 +98762,7 @@ var require_dist_cjs8 = __commonJS((exports) => {
98689
98762
  }
98690
98763
  return { tag, value: text };
98691
98764
  }
98692
- const obj = Object.create(null);
98765
+ const obj = {};
98693
98766
  for (const text of textParts) {
98694
98767
  if (text.trim() === "" && text.includes(`
98695
98768
  `)) {
@@ -98698,6 +98771,9 @@ var require_dist_cjs8 = __commonJS((exports) => {
98698
98771
  obj["#text"] = "#text" in obj ? obj["#text"] + text : text;
98699
98772
  }
98700
98773
  for (const child of childTags) {
98774
+ if (child.tag === "__proto__") {
98775
+ writeKey(obj);
98776
+ }
98701
98777
  if (child.tag in obj) {
98702
98778
  if (Array.isArray(obj[child.tag])) {
98703
98779
  obj[child.tag].push(child.value);
@@ -98709,9 +98785,11 @@ var require_dist_cjs8 = __commonJS((exports) => {
98709
98785
  }
98710
98786
  }
98711
98787
  for (const [k, v] of Object.entries(attrs)) {
98788
+ if (k === "__proto__") {
98789
+ writeKey(obj);
98790
+ }
98712
98791
  obj[k] = v;
98713
98792
  }
98714
- Object.setPrototypeOf(obj, Object.prototype);
98715
98793
  return { tag, value: obj };
98716
98794
  }
98717
98795
  static ENTITIES = {
@@ -99032,11 +99110,17 @@ var require_protocols2 = __commonJS((exports) => {
99032
99110
  if (context?.source) {
99033
99111
  const numericString = context.source;
99034
99112
  if (typeof value === "number") {
99035
- if (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER || numericString !== String(value)) {
99036
- const isFractional = numericString.includes(".");
99037
- if (isFractional) {
99113
+ const inSafeRange = value <= Number.MAX_SAFE_INTEGER && value >= Number.MIN_SAFE_INTEGER;
99114
+ if (!inSafeRange || numericString !== String(value)) {
99115
+ if (inSafeRange && /[eE]/.test(numericString) && String(Number(numericString)) === String(value)) {
99116
+ return value;
99117
+ }
99118
+ if (isFractionalNumeric(numericString)) {
99038
99119
  return new NumericValue(numericString, "bigDecimal");
99039
99120
  } else {
99121
+ if (/[eE]/.test(numericString)) {
99122
+ return BigInt(Number(numericString));
99123
+ }
99040
99124
  return BigInt(numericString);
99041
99125
  }
99042
99126
  }
@@ -99044,22 +99128,104 @@ var require_protocols2 = __commonJS((exports) => {
99044
99128
  }
99045
99129
  return value;
99046
99130
  }
99131
+ function isFractionalNumeric(s) {
99132
+ const dotIndex = s.indexOf(".");
99133
+ if (dotIndex === -1) {
99134
+ return false;
99135
+ }
99136
+ const eIndex = s.search(/[eE]/);
99137
+ if (eIndex === -1) {
99138
+ return true;
99139
+ }
99140
+ const fracDigits = eIndex - dotIndex - 1;
99141
+ const exp = parseInt(s.slice(eIndex + 1), 10);
99142
+ return exp < fracDigits;
99143
+ }
99144
+ var REVIVER_SYMBOL = Symbol.for("@aws-sdk/reviver");
99145
+ function needsReviver(schema) {
99146
+ const ns = NormalizedSchema.of(schema);
99147
+ const raw = ns.getSchema();
99148
+ if (Array.isArray(raw) && ns.isStructSchema()) {
99149
+ if (REVIVER_SYMBOL in raw) {
99150
+ return raw[REVIVER_SYMBOL];
99151
+ }
99152
+ const result = _check2(ns, new Set);
99153
+ raw[REVIVER_SYMBOL] = result;
99154
+ return result;
99155
+ }
99156
+ return _check2(ns, new Set);
99157
+ }
99158
+ function _check2(ns, seen) {
99159
+ const raw = ns.getSchema();
99160
+ if (seen.has(raw)) {
99161
+ return false;
99162
+ }
99163
+ seen.add(raw);
99164
+ if (ns.isBigIntegerSchema() || ns.isBigDecimalSchema()) {
99165
+ return true;
99166
+ }
99167
+ if (ns.isStructSchema()) {
99168
+ for (const [, memberSchema] of ns.structIterator()) {
99169
+ if (_check2(memberSchema, seen)) {
99170
+ return true;
99171
+ }
99172
+ }
99173
+ } else if (ns.isListSchema() || ns.isMapSchema()) {
99174
+ if (_check2(ns.getValueSchema(), seen)) {
99175
+ return true;
99176
+ }
99177
+ } else if (ns.isDocumentSchema()) {
99178
+ return true;
99179
+ }
99180
+ return false;
99181
+ }
99047
99182
  var collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => (context?.utf8Encoder ?? toUtf8)(body));
99048
- var parseJsonBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
99049
- if (encoded.length) {
99183
+ var canParseBuffer;
99184
+ function detectBufferParsing() {
99185
+ if (canParseBuffer === undefined) {
99050
99186
  try {
99051
- return JSON.parse(encoded);
99052
- } catch (e) {
99053
- if (e?.name === "SyntaxError") {
99054
- Object.defineProperty(e, "$responseBodyText", {
99055
- value: encoded
99056
- });
99187
+ if (typeof Buffer !== "function") {
99188
+ canParseBuffer = false;
99189
+ } else {
99190
+ const result = JSON.parse(Buffer.from([123, 125]));
99191
+ canParseBuffer = result !== null && typeof result === "object";
99057
99192
  }
99058
- throw e;
99193
+ } catch {
99194
+ canParseBuffer = false;
99059
99195
  }
99060
99196
  }
99061
- return {};
99062
- });
99197
+ return canParseBuffer;
99198
+ }
99199
+ async function parseJsonBody(streamBody, context, schema) {
99200
+ let parsingInput;
99201
+ if (detectBufferParsing() && typeof streamBody?.[Symbol.asyncIterator] === "function") {
99202
+ const buffer = await collectBody(streamBody, context);
99203
+ if (typeof Buffer === "function") {
99204
+ if (Buffer.isBuffer(buffer)) {
99205
+ parsingInput = buffer;
99206
+ } else {
99207
+ parsingInput = Buffer.from(buffer.buffer, buffer.byteOffset, buffer.byteLength);
99208
+ }
99209
+ }
99210
+ }
99211
+ if (!parsingInput) {
99212
+ parsingInput = await collectBodyString(streamBody, context);
99213
+ }
99214
+ if (parsingInput.length === 0) {
99215
+ return {};
99216
+ }
99217
+ const reviver = schema && needsReviver(schema) ? jsonReviver : undefined;
99218
+ try {
99219
+ return JSON.parse(parsingInput, reviver);
99220
+ } catch (e) {
99221
+ if (e?.name === "SyntaxError") {
99222
+ Object.defineProperty(e, "$responseBodyText", {
99223
+ value: typeof parsingInput === "string" ? parsingInput : parsingInput.toString("utf8")
99224
+ });
99225
+ }
99226
+ throw e;
99227
+ }
99228
+ }
99063
99229
  var parseJsonErrorBody = async (errorBody, context) => {
99064
99230
  const value = await parseJsonBody(errorBody, context);
99065
99231
  value.message = value.message ?? value.Message;
@@ -99112,6 +99278,9 @@ var require_protocols2 = __commonJS((exports) => {
99112
99278
  }
99113
99279
  }
99114
99280
  };
99281
+ function writeKey(obj) {
99282
+ Object.defineProperty(obj, "__proto__", { value: undefined, writable: true, enumerable: true, configurable: true });
99283
+ }
99115
99284
 
99116
99285
  class JsonShapeDeserializer extends SerdeContextConfig {
99117
99286
  settings;
@@ -99120,7 +99289,8 @@ var require_protocols2 = __commonJS((exports) => {
99120
99289
  this.settings = settings;
99121
99290
  }
99122
99291
  async read(schema, data) {
99123
- return this._read(schema, typeof data === "string" ? JSON.parse(data, jsonReviver) : await parseJsonBody(data, this.serdeContext));
99292
+ const reviver = needsReviver(schema) ? jsonReviver : undefined;
99293
+ return this._read(schema, typeof data === "string" ? JSON.parse(data, reviver) : await parseJsonBody(data, this.serdeContext, schema));
99124
99294
  }
99125
99295
  readObject(schema, data) {
99126
99296
  return this._read(schema, data);
@@ -99180,6 +99350,9 @@ var require_protocols2 = __commonJS((exports) => {
99180
99350
  const mapMember = ns.getValueSchema();
99181
99351
  const out = {};
99182
99352
  for (const _k in value) {
99353
+ if (_k === "__proto__") {
99354
+ writeKey(out);
99355
+ }
99183
99356
  out[_k] = this._read(mapMember, value[_k]);
99184
99357
  }
99185
99358
  return out;
@@ -99238,6 +99411,9 @@ var require_protocols2 = __commonJS((exports) => {
99238
99411
  if (isObject5) {
99239
99412
  const out = Array.isArray(value) ? [] : {};
99240
99413
  for (const k in value) {
99414
+ if (k === "__proto__") {
99415
+ writeKey(out);
99416
+ }
99241
99417
  const v = value[k];
99242
99418
  if (v instanceof NumericValue) {
99243
99419
  out[k] = v;
@@ -99361,6 +99537,9 @@ var require_protocols2 = __commonJS((exports) => {
99361
99537
  const { $unknown } = record2;
99362
99538
  if (Array.isArray($unknown)) {
99363
99539
  const [k, v] = $unknown;
99540
+ if (k === "__proto__") {
99541
+ writeKey(out);
99542
+ }
99364
99543
  out[k] = this._write(15, v);
99365
99544
  }
99366
99545
  } else if (typeof record2.__type === "string") {
@@ -99392,6 +99571,9 @@ var require_protocols2 = __commonJS((exports) => {
99392
99571
  for (const _k in value) {
99393
99572
  const _v = value[_k];
99394
99573
  if (sparse || _v != null) {
99574
+ if (_k === "__proto__") {
99575
+ writeKey(out);
99576
+ }
99395
99577
  out[_k] = this._write(mapMember, _v);
99396
99578
  }
99397
99579
  }
@@ -99457,6 +99639,9 @@ var require_protocols2 = __commonJS((exports) => {
99457
99639
  const out = Array.isArray(value) ? [] : {};
99458
99640
  for (const k in value) {
99459
99641
  const v = value[k];
99642
+ if (k === "__proto__") {
99643
+ writeKey(out);
99644
+ }
99460
99645
  if (v instanceof NumericValue) {
99461
99646
  this.useReplacer = true;
99462
99647
  out[k] = v;
@@ -99771,6 +99956,9 @@ var require_protocols2 = __commonJS((exports) => {
99771
99956
  for (const entry of entries) {
99772
99957
  const key = entry[keyProperty];
99773
99958
  const value2 = entry[valueProperty];
99959
+ if (key === "__proto__") {
99960
+ writeKey(buffer);
99961
+ }
99774
99962
  buffer[key] = this.readSchema(memberNs, value2);
99775
99963
  }
99776
99964
  return buffer;
@@ -100674,7 +100862,7 @@ var require_sso_oidc = __commonJS((exports) => {
100674
100862
  Region: { type: "builtInParams", name: "region" },
100675
100863
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
100676
100864
  };
100677
- var version2 = "3.997.33";
100865
+ var version2 = "3.997.34";
100678
100866
  var packageInfo = {
100679
100867
  version: version2
100680
100868
  };
@@ -101571,7 +101759,7 @@ var require_sso = __commonJS((exports) => {
101571
101759
  Region: { type: "builtInParams", name: "region" },
101572
101760
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
101573
101761
  };
101574
- var version2 = "3.997.33";
101762
+ var version2 = "3.997.34";
101575
101763
  var packageInfo = {
101576
101764
  version: version2
101577
101765
  };
@@ -102665,7 +102853,7 @@ var require_sts = __commonJS((exports) => {
102665
102853
  Region: { type: "builtInParams", name: "region" },
102666
102854
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
102667
102855
  };
102668
- var version2 = "3.997.33";
102856
+ var version2 = "3.997.34";
102669
102857
  var packageInfo = {
102670
102858
  version: version2
102671
102859
  };
@@ -103434,7 +103622,7 @@ var require_signin = __commonJS((exports) => {
103434
103622
  Region: { type: "builtInParams", name: "region" },
103435
103623
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
103436
103624
  };
103437
- var version2 = "3.997.33";
103625
+ var version2 = "3.997.34";
103438
103626
  var packageInfo = {
103439
103627
  version: version2
103440
103628
  };
@@ -117799,7 +117987,7 @@ var package_default;
117799
117987
  var init_package = __esm(() => {
117800
117988
  package_default = {
117801
117989
  name: "@funnycode/myclaude",
117802
- version: "0.1.124",
117990
+ version: "0.1.148",
117803
117991
  private: false,
117804
117992
  description: "An open-source AI coding assistant in your terminal - powered by Claude",
117805
117993
  license: "MIT",
@@ -407981,10 +408169,58 @@ function isInputModeCharacter(input) {
407981
408169
 
407982
408170
  // src/projectOnboardingState.ts
407983
408171
  import { join as join105 } from "path";
408172
+ function clearCachedSteps() {
408173
+ cachedSteps = null;
408174
+ cachedClaudeMdMtime = null;
408175
+ cachedDirMtime = null;
408176
+ cachedAt = null;
408177
+ }
408178
+ function isCacheValid() {
408179
+ if (!cachedSteps)
408180
+ return false;
408181
+ const cwd2 = getCwd();
408182
+ const claudeMdPath = join105(cwd2, "CLAUDE.md");
408183
+ const fs13 = getFsImplementation();
408184
+ try {
408185
+ const currentClaudeMdMtime = fs13.existsSync(claudeMdPath) ? getFileModificationTime(claudeMdPath) ?? -1 : -1;
408186
+ if (currentClaudeMdMtime !== cachedClaudeMdMtime)
408187
+ return false;
408188
+ } catch {
408189
+ return false;
408190
+ }
408191
+ try {
408192
+ const currentDirMtime = getFileModificationTime(cwd2) ?? -1;
408193
+ if (currentDirMtime !== cachedDirMtime)
408194
+ return false;
408195
+ } catch {
408196
+ return false;
408197
+ }
408198
+ if (cachedAt !== null && Date.now() - cachedAt > CACHE_MAX_AGE_MS) {
408199
+ return false;
408200
+ }
408201
+ return true;
408202
+ }
407984
408203
  function getSteps() {
407985
- const hasClaudeMd = getFsImplementation().existsSync(join105(getCwd(), "CLAUDE.md"));
407986
- const isWorkspaceDirEmpty = isDirEmpty(getCwd());
407987
- return [
408204
+ if (isCacheValid()) {
408205
+ return cachedSteps;
408206
+ }
408207
+ const cwd2 = getCwd();
408208
+ const fs13 = getFsImplementation();
408209
+ const hasClaudeMd = fs13.existsSync(join105(cwd2, "CLAUDE.md"));
408210
+ const isWorkspaceDirEmpty = isDirEmpty(cwd2);
408211
+ const claudeMdPath = join105(cwd2, "CLAUDE.md");
408212
+ try {
408213
+ cachedClaudeMdMtime = hasClaudeMd ? getFileModificationTime(claudeMdPath) : -1;
408214
+ } catch {
408215
+ cachedClaudeMdMtime = -1;
408216
+ }
408217
+ try {
408218
+ cachedDirMtime = getFileModificationTime(cwd2);
408219
+ } catch {
408220
+ cachedDirMtime = -1;
408221
+ }
408222
+ cachedAt = Date.now();
408223
+ cachedSteps = [
407988
408224
  {
407989
408225
  key: "workspace",
407990
408226
  text: "Ask Claude to create a new app or clone a repository",
@@ -408000,6 +408236,7 @@ function getSteps() {
408000
408236
  isEnabled: !isWorkspaceDirEmpty
408001
408237
  }
408002
408238
  ];
408239
+ return cachedSteps;
408003
408240
  }
408004
408241
  function isProjectOnboardingComplete() {
408005
408242
  return getSteps().filter(({ isCompletable, isEnabled: isEnabled2 }) => isCompletable && isEnabled2).every(({ isComplete }) => isComplete);
@@ -408015,26 +408252,25 @@ function maybeMarkProjectOnboardingComplete() {
408015
408252
  }));
408016
408253
  }
408017
408254
  }
408255
+ function shouldShowProjectOnboarding() {
408256
+ const projectConfig = getCurrentProjectConfig();
408257
+ if (projectConfig.hasCompletedProjectOnboarding || projectConfig.projectOnboardingSeenCount >= 4 || process.env.IS_DEMO) {
408258
+ return false;
408259
+ }
408260
+ return !isProjectOnboardingComplete();
408261
+ }
408018
408262
  function incrementProjectOnboardingSeenCount() {
408019
408263
  saveCurrentProjectConfig((current) => ({
408020
408264
  ...current,
408021
408265
  projectOnboardingSeenCount: current.projectOnboardingSeenCount + 1
408022
408266
  }));
408023
408267
  }
408024
- var shouldShowProjectOnboarding;
408268
+ var cachedSteps = null, cachedClaudeMdMtime = null, cachedDirMtime = null, cachedAt = null, CACHE_MAX_AGE_MS = 30000;
408025
408269
  var init_projectOnboardingState = __esm(() => {
408026
- init_memoize();
408027
408270
  init_config();
408028
408271
  init_cwd2();
408029
408272
  init_file();
408030
408273
  init_fsOperations();
408031
- shouldShowProjectOnboarding = memoize_default(() => {
408032
- const projectConfig = getCurrentProjectConfig();
408033
- if (projectConfig.hasCompletedProjectOnboarding || projectConfig.projectOnboardingSeenCount >= 4 || process.env.IS_DEMO) {
408034
- return false;
408035
- }
408036
- return !isProjectOnboardingComplete();
408037
- });
408038
408274
  });
408039
408275
 
408040
408276
  // src/utils/appleTerminalBackup.ts
@@ -429564,6 +429800,7 @@ var init_init2 = __esm(() => {
429564
429800
  progressMessage: "analyzing your codebase",
429565
429801
  source: "builtin",
429566
429802
  async getPromptForCommand() {
429803
+ clearCachedSteps();
429567
429804
  maybeMarkProjectOnboardingComplete();
429568
429805
  return [
429569
429806
  {
@@ -564208,10 +564445,9 @@ function migrateAutoUpdatesToSettings() {
564208
564445
  try {
564209
564446
  const userSettings = getSettingsForSource("userSettings") || {};
564210
564447
  updateSettingsForSource("userSettings", {
564211
- ...userSettings,
564212
564448
  env: {
564213
564449
  ...userSettings.env,
564214
- DISABLE_AUTOUPDATER: "1"
564450
+ DISABLE_AUTOUPDATER: userSettings.env?.DISABLE_AUTOUPDATER ?? "1"
564215
564451
  }
564216
564452
  });
564217
564453
  logEvent("tengu_migrate_autoupdates_to_settings", {
@@ -564248,9 +564484,12 @@ function migrateBypassPermissionsAcceptedToSettings() {
564248
564484
  }
564249
564485
  try {
564250
564486
  if (!hasSkipDangerousModePermissionPrompt()) {
564251
- updateSettingsForSource("userSettings", {
564252
- skipDangerousModePermissionPrompt: true
564253
- });
564487
+ const userExplicitlyOptedOut = getSettingsForSource("userSettings")?.skipDangerousModePermissionPrompt === false || getSettingsForSource("localSettings")?.skipDangerousModePermissionPrompt === false || getSettingsForSource("flagSettings")?.skipDangerousModePermissionPrompt === false || getSettingsForSource("policySettings")?.skipDangerousModePermissionPrompt === false;
564488
+ if (!userExplicitlyOptedOut) {
564489
+ updateSettingsForSource("userSettings", {
564490
+ skipDangerousModePermissionPrompt: true
564491
+ });
564492
+ }
564254
564493
  }
564255
564494
  logEvent("tengu_migrate_bypass_permissions_accepted", {});
564256
564495
  saveGlobalConfig((current) => {
@@ -564274,8 +564513,8 @@ var init_migrateBypassPermissionsAcceptedToSettings = __esm(() => {
564274
564513
  function migrateEnableAllProjectMcpServersToSettings() {
564275
564514
  const projectConfig = getCurrentProjectConfig();
564276
564515
  const hasEnableAll = projectConfig.enableAllProjectMcpServers !== undefined;
564277
- const hasEnabledServers = projectConfig.enabledMcpjsonServers && projectConfig.enabledMcpjsonServers.length > 0;
564278
- const hasDisabledServers = projectConfig.disabledMcpjsonServers && projectConfig.disabledMcpjsonServers.length > 0;
564516
+ const hasEnabledServers = Array.isArray(projectConfig.enabledMcpjsonServers);
564517
+ const hasDisabledServers = Array.isArray(projectConfig.disabledMcpjsonServers);
564279
564518
  if (!hasEnableAll && !hasEnabledServers && !hasDisabledServers) {
564280
564519
  return;
564281
564520
  }
@@ -564283,50 +564522,77 @@ function migrateEnableAllProjectMcpServersToSettings() {
564283
564522
  const existingSettings = getSettingsForSource("localSettings") || {};
564284
564523
  const updates = {};
564285
564524
  const fieldsToRemove = [];
564286
- if (hasEnableAll && existingSettings.enableAllProjectMcpServers === undefined) {
564525
+ if (hasEnableAll) {
564287
564526
  updates.enableAllProjectMcpServers = projectConfig.enableAllProjectMcpServers;
564288
564527
  fieldsToRemove.push("enableAllProjectMcpServers");
564289
- } else if (hasEnableAll) {
564290
- fieldsToRemove.push("enableAllProjectMcpServers");
564291
564528
  }
564292
- if (hasEnabledServers && projectConfig.enabledMcpjsonServers) {
564293
- const existingEnabledServers = existingSettings.enabledMcpjsonServers || [];
564294
- updates.enabledMcpjsonServers = [
564295
- ...new Set([
564296
- ...existingEnabledServers,
564297
- ...projectConfig.enabledMcpjsonServers
564298
- ])
564299
- ];
564529
+ const existingEnabledServers = Array.isArray(existingSettings.enabledMcpjsonServers) ? [...existingSettings.enabledMcpjsonServers] : [];
564530
+ const existingDisabledServers = Array.isArray(existingSettings.disabledMcpjsonServers) ? [...existingSettings.disabledMcpjsonServers] : [];
564531
+ if (hasEnabledServers) {
564532
+ if (Array.isArray(projectConfig.enabledMcpjsonServers) && projectConfig.enabledMcpjsonServers.length > 0) {
564533
+ const seen = new Set(existingEnabledServers);
564534
+ for (const server of projectConfig.enabledMcpjsonServers) {
564535
+ if (!seen.has(server)) {
564536
+ existingEnabledServers.push(server);
564537
+ seen.add(server);
564538
+ }
564539
+ }
564540
+ }
564300
564541
  fieldsToRemove.push("enabledMcpjsonServers");
564301
564542
  }
564302
- if (hasDisabledServers && projectConfig.disabledMcpjsonServers) {
564303
- const existingDisabledServers = existingSettings.disabledMcpjsonServers || [];
564304
- updates.disabledMcpjsonServers = [
564305
- ...new Set([
564306
- ...existingDisabledServers,
564307
- ...projectConfig.disabledMcpjsonServers
564308
- ])
564309
- ];
564543
+ if (hasDisabledServers) {
564544
+ if (Array.isArray(projectConfig.disabledMcpjsonServers) && projectConfig.disabledMcpjsonServers.length > 0) {
564545
+ const seen = new Set(existingDisabledServers);
564546
+ for (const server of projectConfig.disabledMcpjsonServers) {
564547
+ if (!seen.has(server)) {
564548
+ existingDisabledServers.push(server);
564549
+ seen.add(server);
564550
+ }
564551
+ }
564552
+ }
564310
564553
  fieldsToRemove.push("disabledMcpjsonServers");
564311
564554
  }
564555
+ const enabledSet = new Set(existingEnabledServers);
564556
+ const overlappingServers = existingDisabledServers.filter((server) => enabledSet.has(server));
564557
+ if (overlappingServers.length > 0) {
564558
+ const overlappingSet = new Set(overlappingServers);
564559
+ for (let i3 = existingDisabledServers.length - 1;i3 >= 0; i3--) {
564560
+ if (overlappingSet.has(existingDisabledServers[i3])) {
564561
+ existingDisabledServers.splice(i3, 1);
564562
+ }
564563
+ }
564564
+ logEvent("tengu_migrate_mcp_server_overlap_in_both_lists", {
564565
+ migration: "enableAllProjectMcpServersToSettings",
564566
+ overlappingServers: overlappingServers.join(","),
564567
+ message: "MCP server(s) appear in both enabled and disabled lists. Removed from disabled list to resolve conflict."
564568
+ });
564569
+ }
564570
+ const existingHadEnabledServers = Array.isArray(existingSettings.enabledMcpjsonServers);
564571
+ const existingHadDisabledServers = Array.isArray(existingSettings.disabledMcpjsonServers);
564572
+ if (existingEnabledServers.length > 0 || existingHadEnabledServers) {
564573
+ updates.enabledMcpjsonServers = existingEnabledServers;
564574
+ }
564575
+ if (existingDisabledServers.length > 0 || existingHadDisabledServers) {
564576
+ updates.disabledMcpjsonServers = existingDisabledServers;
564577
+ }
564312
564578
  if (Object.keys(updates).length > 0) {
564313
564579
  updateSettingsForSource("localSettings", updates);
564314
564580
  }
564315
564581
  if (fieldsToRemove.length > 0) {
564316
564582
  saveCurrentProjectConfig((current) => {
564317
- const configWithoutFields = { ...current };
564583
+ const updated = { ...current };
564318
564584
  for (const field of fieldsToRemove) {
564319
- delete configWithoutFields[field];
564585
+ delete updated[field];
564320
564586
  }
564321
- return configWithoutFields;
564587
+ return updated;
564322
564588
  });
564323
564589
  }
564324
- logEvent("tengu_migrate_mcp_approval_fields_success", {
564325
- migratedCount: fieldsToRemove.length
564590
+ logEvent("tengu_migrate_enable_all_project_mcp_servers_to_settings", {
564591
+ migration: "enableAllProjectMcpServersToSettings",
564592
+ fieldsMigrated: fieldsToRemove.join(",")
564326
564593
  });
564327
- } catch (e) {
564328
- logError2(e);
564329
- logEvent("tengu_migrate_mcp_approval_fields_error", {});
564594
+ } catch (error49) {
564595
+ logError2("Failed to migrate MCP server settings", error49);
564330
564596
  }
564331
564597
  }
564332
564598
  var init_migrateEnableAllProjectMcpServersToSettings = __esm(() => {
@@ -564339,6 +564605,7 @@ var init_migrateEnableAllProjectMcpServersToSettings = __esm(() => {
564339
564605
  // src/migrations/migrateFennecToOpus.ts
564340
564606
  var init_migrateFennecToOpus = __esm(() => {
564341
564607
  init_log3();
564608
+ init_providers();
564342
564609
  init_settings2();
564343
564610
  });
564344
564611
 
@@ -564399,9 +564666,9 @@ function migrateReplBridgeEnabledToRemoteControlAtStartup() {
564399
564666
  return prev;
564400
564667
  if (prev.remoteControlAtStartup !== undefined)
564401
564668
  return prev;
564402
- const next = { ...prev, remoteControlAtStartup: Boolean(oldValue) };
564403
- delete next["replBridgeEnabled"];
564404
- return next;
564669
+ const { replBridgeEnabled: _2, ...next } = prev;
564670
+ const newValue = typeof oldValue === "string" ? oldValue === "true" : Boolean(oldValue);
564671
+ return { ...next, remoteControlAtStartup: newValue };
564405
564672
  });
564406
564673
  }
564407
564674
  var init_migrateReplBridgeEnabledToRemoteControlAtStartup = __esm(() => {
@@ -564414,22 +564681,27 @@ function migrateSonnet1mToSonnet45() {
564414
564681
  if (config5.sonnet1m45MigrationComplete) {
564415
564682
  return;
564416
564683
  }
564417
- const model = getSettingsForSource("userSettings")?.model;
564418
- if (model === "sonnet[1m]") {
564419
- updateSettingsForSource("userSettings", {
564420
- model: "sonnet-4-5-20250929[1m]"
564421
- });
564422
- }
564423
- const override = getMainLoopModelOverride();
564424
- if (override === "sonnet[1m]") {
564425
- setMainLoopModelOverride("sonnet-4-5-20250929[1m]");
564684
+ try {
564685
+ const model = getSettingsForSource("userSettings")?.model;
564686
+ if (model === "sonnet[1m]") {
564687
+ updateSettingsForSource("userSettings", {
564688
+ model: "sonnet-4-5-20250929[1m]"
564689
+ });
564690
+ }
564691
+ const override = getMainLoopModelOverride();
564692
+ if (override === "sonnet[1m]") {
564693
+ setMainLoopModelOverride("sonnet-4-5-20250929[1m]");
564694
+ }
564695
+ saveGlobalConfig((current) => ({
564696
+ ...current,
564697
+ sonnet1m45MigrationComplete: true
564698
+ }));
564699
+ } catch (error49) {
564700
+ logError2(new Error(`Failed to migrate sonnet[1m] to sonnet-4-5-20250929[1m]: ${error49}`));
564426
564701
  }
564427
- saveGlobalConfig((current) => ({
564428
- ...current,
564429
- sonnet1m45MigrationComplete: true
564430
- }));
564431
564702
  }
564432
564703
  var init_migrateSonnet1mToSonnet45 = __esm(() => {
564704
+ init_log3();
564433
564705
  init_state();
564434
564706
  init_config();
564435
564707
  init_settings2();
@@ -564440,32 +564712,29 @@ function migrateSonnet45ToSonnet46() {
564440
564712
  if (getAPIProvider() !== "firstParty") {
564441
564713
  return;
564442
564714
  }
564443
- if (!isProSubscriber() && !isMaxSubscriber() && !isTeamPremiumSubscriber()) {
564715
+ const model = getSettingsForSource("userSettings")?.model;
564716
+ if (typeof model !== "string") {
564444
564717
  return;
564445
564718
  }
564446
- const model = getSettingsForSource("userSettings")?.model;
564447
- if (model !== "claude-sonnet-4-5-20250929" && model !== "claude-sonnet-4-5-20250929[1m]" && model !== "sonnet-4-5-20250929" && model !== "sonnet-4-5-20250929[1m]") {
564719
+ const match = model.match(/^(?:claude-)?(sonnet-4-5-20250929)(?:\[(.+?)\])?$/);
564720
+ if (!match) {
564448
564721
  return;
564449
564722
  }
564450
- const has1m = model.endsWith("[1m]");
564723
+ const suffix = match[2] ? `[${match[2]}]` : "";
564451
564724
  updateSettingsForSource("userSettings", {
564452
- model: has1m ? "sonnet[1m]" : "sonnet"
564725
+ model: suffix ? `sonnet${suffix}` : "sonnet"
564453
564726
  });
564454
- const config5 = getGlobalConfig();
564455
- if (config5.numStartups > 1) {
564456
- saveGlobalConfig((current) => ({
564457
- ...current,
564458
- sonnet45To46MigrationTimestamp: Date.now()
564459
- }));
564460
- }
564727
+ saveGlobalConfig((current) => ({
564728
+ ...current,
564729
+ sonnet45To46MigrationTimestamp: Date.now()
564730
+ }));
564461
564731
  logEvent("tengu_sonnet45_to_46_migration", {
564462
564732
  from_model: model,
564463
- has_1m: has1m
564733
+ has_1m: suffix === "[1m]"
564464
564734
  });
564465
564735
  }
564466
564736
  var init_migrateSonnet45ToSonnet46 = __esm(() => {
564467
564737
  init_analytics();
564468
- init_auth();
564469
564738
  init_config();
564470
564739
  init_providers();
564471
564740
  init_settings2();
@@ -564495,8 +564764,8 @@ function resetProToOpusDefault() {
564495
564764
  logEvent("tengu_reset_pro_to_opus_default", { skipped: true });
564496
564765
  return;
564497
564766
  }
564498
- const settings = getSettings_DEPRECATED();
564499
- if (settings?.model === undefined) {
564767
+ const userSettings = getSettingsForSource("userSettings");
564768
+ if (userSettings?.model === undefined) {
564500
564769
  const opusProMigrationTimestamp = Date.now();
564501
564770
  saveGlobalConfig((current) => ({
564502
564771
  ...current,