@funnycode/myclaude 0.1.122 → 0.1.124

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.122",
8
- BUILD_TIME: "2026-07-23T10:48:04.401Z",
7
+ VERSION: "0.1.124",
8
+ BUILD_TIME: "2026-07-23T21:22:35.165Z",
9
9
  PACKAGE_URL: "@funnycode/myclaude",
10
10
  NATIVE_PACKAGE_URL: "@funnycode/myclaude",
11
11
  VERSION_CHANGELOG: '',
@@ -38380,6 +38380,7 @@ var init_log3 = __esm(() => {
38380
38380
  function sequential(fn) {
38381
38381
  const queue = [];
38382
38382
  let processing = false;
38383
+ let depth = 0;
38383
38384
  async function processQueue() {
38384
38385
  if (processing)
38385
38386
  return;
@@ -38401,10 +38402,18 @@ function sequential(fn) {
38401
38402
  }
38402
38403
  }
38403
38404
  return function(...args) {
38404
- return new Promise((resolve5, reject) => {
38405
- queue.push({ args, resolve: resolve5, reject, context: this });
38406
- processQueue();
38407
- });
38405
+ depth++;
38406
+ try {
38407
+ if (depth > 1) {
38408
+ return fn.apply(this, args);
38409
+ }
38410
+ return new Promise((resolve5, reject) => {
38411
+ queue.push({ args, resolve: resolve5, reject, context: this });
38412
+ processQueue();
38413
+ });
38414
+ } finally {
38415
+ depth--;
38416
+ }
38408
38417
  };
38409
38418
  }
38410
38419
 
@@ -97364,7 +97373,7 @@ var require_cbor = __commonJS((exports) => {
97364
97373
  }
97365
97374
  function decodeMap(at, to) {
97366
97375
  const mapDataLength = decodeCount(at, to);
97367
- if (mapDataLength < 15) {
97376
+ if (mapDataLength < 25) {
97368
97377
  return decodeMapSmall(at, to, mapDataLength);
97369
97378
  }
97370
97379
  return decodeMapLarge(at, to, mapDataLength);
@@ -117790,7 +117799,7 @@ var package_default;
117790
117799
  var init_package = __esm(() => {
117791
117800
  package_default = {
117792
117801
  name: "@funnycode/myclaude",
117793
- version: "0.1.122",
117802
+ version: "0.1.124",
117794
117803
  private: false,
117795
117804
  description: "An open-source AI coding assistant in your terminal - powered by Claude",
117796
117805
  license: "MIT",
@@ -210839,13 +210848,27 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
210839
210848
  }
210840
210849
  if (incomplete.length > MAX_BUFFER_SIZE2) {
210841
210850
  logForDebugging("dumpPrompts: incomplete buffer exceeds max size, truncating", { level: "warn" });
210842
- incomplete = incomplete.slice(-MAX_BUFFER_SIZE2);
210851
+ const truncateStart = incomplete.length - MAX_BUFFER_SIZE2;
210852
+ const lastNewline = incomplete.lastIndexOf(`
210853
+ `, truncateStart);
210854
+ if (lastNewline !== -1 && lastNewline > truncateStart - 1000) {
210855
+ incomplete = incomplete.slice(lastNewline + 1);
210856
+ } else {
210857
+ incomplete = incomplete.slice(-MAX_BUFFER_SIZE2);
210858
+ }
210843
210859
  }
210844
210860
  } else {
210845
210861
  incomplete = combined;
210846
210862
  if (incomplete.length > MAX_BUFFER_SIZE2) {
210847
210863
  logForDebugging("dumpPrompts: buffer exceeded max size, truncating", { level: "warn" });
210848
- incomplete = incomplete.slice(-MAX_BUFFER_SIZE2);
210864
+ const truncateStart = incomplete.length - MAX_BUFFER_SIZE2;
210865
+ const lastNewline = incomplete.lastIndexOf(`
210866
+ `, truncateStart);
210867
+ if (lastNewline !== -1 && lastNewline > truncateStart - 1000) {
210868
+ incomplete = incomplete.slice(lastNewline + 1);
210869
+ } else {
210870
+ incomplete = incomplete.slice(-MAX_BUFFER_SIZE2);
210871
+ }
210849
210872
  }
210850
210873
  }
210851
210874
  }
@@ -301593,74 +301616,43 @@ function memoizeWithTTL(fn, ttlMs) {
301593
301616
  let lastCachedAt = 0;
301594
301617
  const memoized = memoize_default(fn);
301595
301618
  const originalClear = memoized.cache.clear.bind(memoized.cache);
301596
- const pendingRefreshes = new Map;
301597
- const keyMutexes = new Map;
301619
+ let pendingRefresh = null;
301598
301620
  const wrapped = async (...args) => {
301599
301621
  const now2 = Date.now();
301600
301622
  const cacheExpired = lastCachedAt === 0 || now2 - lastCachedAt >= ttlMs;
301601
301623
  if (cacheExpired) {
301602
- const key2 = String(args[0] ?? "_default");
301603
- let keyMutex = keyMutexes.get(key2);
301604
- if (!keyMutex) {
301605
- keyMutex = new Mutex;
301606
- keyMutexes.set(key2, keyMutex);
301624
+ if (pendingRefresh) {
301625
+ return pendingRefresh;
301607
301626
  }
301608
- const release = await keyMutex.acquire();
301609
- try {
301610
- const existing = pendingRefreshes.get(key2);
301611
- if (existing) {
301612
- return existing;
301613
- }
301614
- const refreshPromise = (async () => {
301615
- let timeoutId = null;
301616
- try {
301617
- const timeoutMs = GROVE_API_TIMEOUT_MS * 3;
301618
- const timeoutPromise = new Promise((_2, reject2) => {
301619
- timeoutId = setTimeout(() => reject2(new Error(`Refresh timeout after ${timeoutMs}ms for key: ${key2}`)), timeoutMs);
301620
- });
301621
- const now22 = Date.now();
301622
- if (lastCachedAt !== 0 && now22 - lastCachedAt < ttlMs) {
301623
- return memoized(...args);
301624
- }
301625
- try {
301626
- const freshResult = await Promise.race([fn(...args), timeoutPromise]);
301627
- if (freshResult && typeof freshResult === "object" && "success" in freshResult && freshResult.success === true) {
301628
- memoized.cache.delete(args[0]);
301629
- memoized.cache.set(args[0], freshResult);
301630
- lastCachedAt = Date.now();
301631
- return freshResult;
301632
- }
301633
- if (memoized.cache.has(args[0])) {
301634
- return memoized(...args);
301635
- }
301636
- return freshResult;
301637
- } catch (error49) {
301638
- if (memoized.cache.has(args[0])) {
301639
- return memoized(...args);
301640
- }
301641
- return { success: false };
301642
- }
301643
- } finally {
301644
- if (timeoutId) {
301645
- clearTimeout(timeoutId);
301646
- }
301627
+ pendingRefresh = (async () => {
301628
+ try {
301629
+ const freshResult = await fn(...args);
301630
+ if (freshResult && typeof freshResult === "object" && "success" in freshResult && freshResult.success === true) {
301631
+ memoized.cache.delete(args[0]);
301632
+ memoized.cache.set(args[0], freshResult);
301633
+ lastCachedAt = Date.now();
301634
+ return freshResult;
301647
301635
  }
301648
- })();
301649
- pendingRefreshes.set(key2, refreshPromise);
301650
- refreshPromise.finally(() => {
301651
- pendingRefreshes.delete(key2);
301652
- });
301653
- return refreshPromise;
301654
- } finally {
301655
- release();
301656
- keyMutexes.delete(key2);
301657
- }
301636
+ if (memoized.cache.has(args[0])) {
301637
+ return memoized.cache.get(args[0]);
301638
+ }
301639
+ return freshResult;
301640
+ } catch (error49) {
301641
+ if (memoized.cache.has(args[0])) {
301642
+ return memoized.cache.get(args[0]);
301643
+ }
301644
+ return { success: false };
301645
+ } finally {
301646
+ pendingRefresh = null;
301647
+ }
301648
+ })();
301649
+ return pendingRefresh;
301658
301650
  }
301659
301651
  try {
301660
301652
  const result = await memoized(...args);
301661
301653
  if (result && typeof result === "object" && "success" in result && result.success === true) {
301662
301654
  lastCachedAt = Date.now();
301663
- } else if (result && typeof result === "object" && "success" in result && result.success === false) {}
301655
+ }
301664
301656
  return result;
301665
301657
  } catch (error49) {
301666
301658
  logError2(error49);
@@ -301671,7 +301663,7 @@ function memoizeWithTTL(fn, ttlMs) {
301671
301663
  clear: () => {
301672
301664
  originalClear();
301673
301665
  lastCachedAt = 0;
301674
- keyMutexes.clear();
301666
+ pendingRefresh = null;
301675
301667
  }
301676
301668
  };
301677
301669
  return wrapped;
@@ -342897,7 +342889,8 @@ async function appendSessionLogImpl(sessionId, entry, url3, headers) {
342897
342889
  } else {
342898
342890
  let logs2 = null;
342899
342891
  try {
342900
- logs2 = await fetchSessionLogsFromUrl(sessionId, url3, headers);
342892
+ const sequential2 = getOrCreateSequential(sessionId);
342893
+ logs2 = await sequential2(sessionId, url3, headers, true);
342901
342894
  } catch (fetchError) {
342902
342895
  logError2(new Error(`Session 409: fetch failed for session ${sessionId}, entry ${entry.uuid}: ${fetchError instanceof Error ? fetchError.message : String(fetchError)}`));
342903
342896
  logForDiagnosticsNoPII("error", "session_persist_409_fetch_fail");
@@ -564225,7 +564218,6 @@ function migrateAutoUpdatesToSettings() {
564225
564218
  was_user_preference: true,
564226
564219
  already_had_env_var: !!userSettings.env?.DISABLE_AUTOUPDATER
564227
564220
  });
564228
- process.env.DISABLE_AUTOUPDATER = "1";
564229
564221
  saveGlobalConfig((current) => {
564230
564222
  const {
564231
564223
  autoUpdates: _2,
@@ -564346,6 +564338,7 @@ var init_migrateEnableAllProjectMcpServersToSettings = __esm(() => {
564346
564338
 
564347
564339
  // src/migrations/migrateFennecToOpus.ts
564348
564340
  var init_migrateFennecToOpus = __esm(() => {
564341
+ init_log3();
564349
564342
  init_settings2();
564350
564343
  });
564351
564344
 
package/dist/myclaude.mjs 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.122",
8
- BUILD_TIME: "2026-07-23T10:48:04.401Z",
7
+ VERSION: "0.1.124",
8
+ BUILD_TIME: "2026-07-23T21:22:35.165Z",
9
9
  PACKAGE_URL: "@funnycode/myclaude",
10
10
  NATIVE_PACKAGE_URL: "@funnycode/myclaude",
11
11
  VERSION_CHANGELOG: '',
@@ -38380,6 +38380,7 @@ var init_log3 = __esm(() => {
38380
38380
  function sequential(fn) {
38381
38381
  const queue = [];
38382
38382
  let processing = false;
38383
+ let depth = 0;
38383
38384
  async function processQueue() {
38384
38385
  if (processing)
38385
38386
  return;
@@ -38401,10 +38402,18 @@ function sequential(fn) {
38401
38402
  }
38402
38403
  }
38403
38404
  return function(...args) {
38404
- return new Promise((resolve5, reject) => {
38405
- queue.push({ args, resolve: resolve5, reject, context: this });
38406
- processQueue();
38407
- });
38405
+ depth++;
38406
+ try {
38407
+ if (depth > 1) {
38408
+ return fn.apply(this, args);
38409
+ }
38410
+ return new Promise((resolve5, reject) => {
38411
+ queue.push({ args, resolve: resolve5, reject, context: this });
38412
+ processQueue();
38413
+ });
38414
+ } finally {
38415
+ depth--;
38416
+ }
38408
38417
  };
38409
38418
  }
38410
38419
 
@@ -97364,7 +97373,7 @@ var require_cbor = __commonJS((exports) => {
97364
97373
  }
97365
97374
  function decodeMap(at, to) {
97366
97375
  const mapDataLength = decodeCount(at, to);
97367
- if (mapDataLength < 15) {
97376
+ if (mapDataLength < 25) {
97368
97377
  return decodeMapSmall(at, to, mapDataLength);
97369
97378
  }
97370
97379
  return decodeMapLarge(at, to, mapDataLength);
@@ -117790,7 +117799,7 @@ var package_default;
117790
117799
  var init_package = __esm(() => {
117791
117800
  package_default = {
117792
117801
  name: "@funnycode/myclaude",
117793
- version: "0.1.122",
117802
+ version: "0.1.124",
117794
117803
  private: false,
117795
117804
  description: "An open-source AI coding assistant in your terminal - powered by Claude",
117796
117805
  license: "MIT",
@@ -210839,13 +210848,27 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
210839
210848
  }
210840
210849
  if (incomplete.length > MAX_BUFFER_SIZE2) {
210841
210850
  logForDebugging("dumpPrompts: incomplete buffer exceeds max size, truncating", { level: "warn" });
210842
- incomplete = incomplete.slice(-MAX_BUFFER_SIZE2);
210851
+ const truncateStart = incomplete.length - MAX_BUFFER_SIZE2;
210852
+ const lastNewline = incomplete.lastIndexOf(`
210853
+ `, truncateStart);
210854
+ if (lastNewline !== -1 && lastNewline > truncateStart - 1000) {
210855
+ incomplete = incomplete.slice(lastNewline + 1);
210856
+ } else {
210857
+ incomplete = incomplete.slice(-MAX_BUFFER_SIZE2);
210858
+ }
210843
210859
  }
210844
210860
  } else {
210845
210861
  incomplete = combined;
210846
210862
  if (incomplete.length > MAX_BUFFER_SIZE2) {
210847
210863
  logForDebugging("dumpPrompts: buffer exceeded max size, truncating", { level: "warn" });
210848
- incomplete = incomplete.slice(-MAX_BUFFER_SIZE2);
210864
+ const truncateStart = incomplete.length - MAX_BUFFER_SIZE2;
210865
+ const lastNewline = incomplete.lastIndexOf(`
210866
+ `, truncateStart);
210867
+ if (lastNewline !== -1 && lastNewline > truncateStart - 1000) {
210868
+ incomplete = incomplete.slice(lastNewline + 1);
210869
+ } else {
210870
+ incomplete = incomplete.slice(-MAX_BUFFER_SIZE2);
210871
+ }
210849
210872
  }
210850
210873
  }
210851
210874
  }
@@ -301593,74 +301616,43 @@ function memoizeWithTTL(fn, ttlMs) {
301593
301616
  let lastCachedAt = 0;
301594
301617
  const memoized = memoize_default(fn);
301595
301618
  const originalClear = memoized.cache.clear.bind(memoized.cache);
301596
- const pendingRefreshes = new Map;
301597
- const keyMutexes = new Map;
301619
+ let pendingRefresh = null;
301598
301620
  const wrapped = async (...args) => {
301599
301621
  const now2 = Date.now();
301600
301622
  const cacheExpired = lastCachedAt === 0 || now2 - lastCachedAt >= ttlMs;
301601
301623
  if (cacheExpired) {
301602
- const key2 = String(args[0] ?? "_default");
301603
- let keyMutex = keyMutexes.get(key2);
301604
- if (!keyMutex) {
301605
- keyMutex = new Mutex;
301606
- keyMutexes.set(key2, keyMutex);
301624
+ if (pendingRefresh) {
301625
+ return pendingRefresh;
301607
301626
  }
301608
- const release = await keyMutex.acquire();
301609
- try {
301610
- const existing = pendingRefreshes.get(key2);
301611
- if (existing) {
301612
- return existing;
301613
- }
301614
- const refreshPromise = (async () => {
301615
- let timeoutId = null;
301616
- try {
301617
- const timeoutMs = GROVE_API_TIMEOUT_MS * 3;
301618
- const timeoutPromise = new Promise((_2, reject2) => {
301619
- timeoutId = setTimeout(() => reject2(new Error(`Refresh timeout after ${timeoutMs}ms for key: ${key2}`)), timeoutMs);
301620
- });
301621
- const now22 = Date.now();
301622
- if (lastCachedAt !== 0 && now22 - lastCachedAt < ttlMs) {
301623
- return memoized(...args);
301624
- }
301625
- try {
301626
- const freshResult = await Promise.race([fn(...args), timeoutPromise]);
301627
- if (freshResult && typeof freshResult === "object" && "success" in freshResult && freshResult.success === true) {
301628
- memoized.cache.delete(args[0]);
301629
- memoized.cache.set(args[0], freshResult);
301630
- lastCachedAt = Date.now();
301631
- return freshResult;
301632
- }
301633
- if (memoized.cache.has(args[0])) {
301634
- return memoized(...args);
301635
- }
301636
- return freshResult;
301637
- } catch (error49) {
301638
- if (memoized.cache.has(args[0])) {
301639
- return memoized(...args);
301640
- }
301641
- return { success: false };
301642
- }
301643
- } finally {
301644
- if (timeoutId) {
301645
- clearTimeout(timeoutId);
301646
- }
301627
+ pendingRefresh = (async () => {
301628
+ try {
301629
+ const freshResult = await fn(...args);
301630
+ if (freshResult && typeof freshResult === "object" && "success" in freshResult && freshResult.success === true) {
301631
+ memoized.cache.delete(args[0]);
301632
+ memoized.cache.set(args[0], freshResult);
301633
+ lastCachedAt = Date.now();
301634
+ return freshResult;
301647
301635
  }
301648
- })();
301649
- pendingRefreshes.set(key2, refreshPromise);
301650
- refreshPromise.finally(() => {
301651
- pendingRefreshes.delete(key2);
301652
- });
301653
- return refreshPromise;
301654
- } finally {
301655
- release();
301656
- keyMutexes.delete(key2);
301657
- }
301636
+ if (memoized.cache.has(args[0])) {
301637
+ return memoized.cache.get(args[0]);
301638
+ }
301639
+ return freshResult;
301640
+ } catch (error49) {
301641
+ if (memoized.cache.has(args[0])) {
301642
+ return memoized.cache.get(args[0]);
301643
+ }
301644
+ return { success: false };
301645
+ } finally {
301646
+ pendingRefresh = null;
301647
+ }
301648
+ })();
301649
+ return pendingRefresh;
301658
301650
  }
301659
301651
  try {
301660
301652
  const result = await memoized(...args);
301661
301653
  if (result && typeof result === "object" && "success" in result && result.success === true) {
301662
301654
  lastCachedAt = Date.now();
301663
- } else if (result && typeof result === "object" && "success" in result && result.success === false) {}
301655
+ }
301664
301656
  return result;
301665
301657
  } catch (error49) {
301666
301658
  logError2(error49);
@@ -301671,7 +301663,7 @@ function memoizeWithTTL(fn, ttlMs) {
301671
301663
  clear: () => {
301672
301664
  originalClear();
301673
301665
  lastCachedAt = 0;
301674
- keyMutexes.clear();
301666
+ pendingRefresh = null;
301675
301667
  }
301676
301668
  };
301677
301669
  return wrapped;
@@ -342897,7 +342889,8 @@ async function appendSessionLogImpl(sessionId, entry, url3, headers) {
342897
342889
  } else {
342898
342890
  let logs2 = null;
342899
342891
  try {
342900
- logs2 = await fetchSessionLogsFromUrl(sessionId, url3, headers);
342892
+ const sequential2 = getOrCreateSequential(sessionId);
342893
+ logs2 = await sequential2(sessionId, url3, headers, true);
342901
342894
  } catch (fetchError) {
342902
342895
  logError2(new Error(`Session 409: fetch failed for session ${sessionId}, entry ${entry.uuid}: ${fetchError instanceof Error ? fetchError.message : String(fetchError)}`));
342903
342896
  logForDiagnosticsNoPII("error", "session_persist_409_fetch_fail");
@@ -564225,7 +564218,6 @@ function migrateAutoUpdatesToSettings() {
564225
564218
  was_user_preference: true,
564226
564219
  already_had_env_var: !!userSettings.env?.DISABLE_AUTOUPDATER
564227
564220
  });
564228
- process.env.DISABLE_AUTOUPDATER = "1";
564229
564221
  saveGlobalConfig((current) => {
564230
564222
  const {
564231
564223
  autoUpdates: _2,
@@ -564346,6 +564338,7 @@ var init_migrateEnableAllProjectMcpServersToSettings = __esm(() => {
564346
564338
 
564347
564339
  // src/migrations/migrateFennecToOpus.ts
564348
564340
  var init_migrateFennecToOpus = __esm(() => {
564341
+ init_log3();
564349
564342
  init_settings2();
564350
564343
  });
564351
564344
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnycode/myclaude",
3
- "version": "0.1.122",
3
+ "version": "0.1.124",
4
4
  "private": false,
5
5
  "description": "An open-source AI coding assistant in your terminal - powered by Claude",
6
6
  "license": "MIT",