@funnycode/myclaude 0.1.86 → 0.1.88

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.86",
8
- BUILD_TIME: "2026-07-17T00:07:06.766Z",
7
+ VERSION: "0.1.88",
8
+ BUILD_TIME: "2026-07-17T10:35:59.798Z",
9
9
  PACKAGE_URL: "@funnycode/myclaude",
10
10
  NATIVE_PACKAGE_URL: "@funnycode/myclaude",
11
11
  VERSION_CHANGELOG: '',
@@ -117484,7 +117484,7 @@ var package_default;
117484
117484
  var init_package = __esm(() => {
117485
117485
  package_default = {
117486
117486
  name: "@funnycode/myclaude",
117487
- version: "0.1.86",
117487
+ version: "0.1.88",
117488
117488
  private: false,
117489
117489
  description: "An open-source AI coding assistant in your terminal - powered by Claude",
117490
117490
  license: "MIT",
@@ -210190,8 +210190,7 @@ function addApiRequestToCache(requestData) {
210190
210190
  const metadata = {
210191
210191
  timestamp: new Date().toISOString(),
210192
210192
  request: {
210193
- model: requestData.model,
210194
- requestHash: hashString3(JSON.stringify(requestData))
210193
+ model: requestData.model
210195
210194
  }
210196
210195
  };
210197
210196
  cachedApiRequests.push(metadata);
@@ -300877,6 +300876,30 @@ var init_gracefulShutdown = __esm(() => {
300877
300876
  });
300878
300877
 
300879
300878
  // src/services/api/grove.ts
300879
+ function memoizeWithTTL(fn, ttlMs) {
300880
+ let lastCachedAt = 0;
300881
+ const memoized = memoize_default(fn);
300882
+ const originalClear = memoized.cache.clear.bind(memoized.cache);
300883
+ const wrapped = async (...args) => {
300884
+ const now2 = Date.now();
300885
+ if (lastCachedAt !== 0 && now2 - lastCachedAt >= ttlMs) {
300886
+ originalClear();
300887
+ lastCachedAt = 0;
300888
+ }
300889
+ const result = await memoized(...args);
300890
+ if (result && typeof result === "object" && "success" in result && result.success === true) {
300891
+ lastCachedAt = Date.now();
300892
+ }
300893
+ return result;
300894
+ };
300895
+ wrapped.cache = {
300896
+ clear: () => {
300897
+ originalClear();
300898
+ lastCachedAt = 0;
300899
+ }
300900
+ };
300901
+ return wrapped;
300902
+ }
300880
300903
  async function markGroveNoticeViewed() {
300881
300904
  try {
300882
300905
  await withOAuth401Retry(() => {
@@ -301043,7 +301066,7 @@ var init_grove = __esm(() => {
301043
301066
  init_log3();
301044
301067
  groveConfigLocks = new Map;
301045
301068
  GROVE_CACHE_EXPIRATION_MS = 24 * 60 * 60 * 1000;
301046
- getGroveSettings = memoize_default(async () => {
301069
+ getGroveSettings = memoizeWithTTL(async () => {
301047
301070
  if (isEssentialTrafficOnly()) {
301048
301071
  return { success: false };
301049
301072
  }
@@ -301066,8 +301089,8 @@ var init_grove = __esm(() => {
301066
301089
  getGroveSettings.cache.clear?.();
301067
301090
  return { success: false };
301068
301091
  }
301069
- });
301070
- getGroveNoticeConfig = memoize_default(async () => {
301092
+ }, GROVE_CACHE_EXPIRATION_MS);
301093
+ getGroveNoticeConfig = memoizeWithTTL(async () => {
301071
301094
  if (isEssentialTrafficOnly()) {
301072
301095
  return { success: false };
301073
301096
  }
@@ -301101,11 +301124,11 @@ var init_grove = __esm(() => {
301101
301124
  }
301102
301125
  };
301103
301126
  } catch (err2) {
301104
- logForDebugging(`Failed to fetch Grove notice config: ${err2}`);
301127
+ logError2(err2);
301105
301128
  getGroveNoticeConfig.cache.clear?.();
301106
301129
  return { success: false };
301107
301130
  }
301108
- });
301131
+ }, GROVE_CACHE_EXPIRATION_MS);
301109
301132
  });
301110
301133
 
301111
301134
  // src/services/policyLimits/index.ts
@@ -342038,6 +342061,14 @@ function getOrCreateSequentialAppend(sessionId) {
342038
342061
  }
342039
342062
  return sequentialAppend;
342040
342063
  }
342064
+ function getOrCreateSequentialFetch(sessionId) {
342065
+ let sequentialFetch = sequentialFetchBySession.get(sessionId);
342066
+ if (!sequentialFetch) {
342067
+ sequentialFetch = sequential(async (sid, url3, headers) => await fetchSessionLogsFromUrl(sid, url3, headers));
342068
+ sequentialFetchBySession.set(sessionId, sequentialFetch);
342069
+ }
342070
+ return sequentialFetch;
342071
+ }
342041
342072
  async function appendSessionLogImpl(sessionId, entry, url3, headers) {
342042
342073
  for (let attempt = 1;attempt <= MAX_RETRIES; attempt++) {
342043
342074
  try {
@@ -342067,7 +342098,8 @@ async function appendSessionLogImpl(sessionId, entry, url3, headers) {
342067
342098
  lastUuidMap.set(sessionId, serverLastUuid);
342068
342099
  logForDebugging(`Session 409: adopting server lastUuid=${serverLastUuid} from header, retrying entry ${entry.uuid}`);
342069
342100
  } else {
342070
- const logs2 = await fetchSessionLogsFromUrl(sessionId, url3, headers);
342101
+ const sequentialFetch = getOrCreateSequentialFetch(sessionId);
342102
+ const logs2 = await sequentialFetch(sessionId, url3, headers);
342071
342103
  const adoptedUuid = findLastUuid(logs2);
342072
342104
  if (adoptedUuid) {
342073
342105
  lastUuidMap.set(sessionId, adoptedUuid);
@@ -342162,9 +342194,14 @@ async function getTeleportEvents(sessionId, accessToken, orgUUID) {
342162
342194
  logForDebugging(`[teleport] Fetching events from: ${baseUrl}`);
342163
342195
  const all4 = [];
342164
342196
  let cursor;
342197
+ let previousCursor;
342165
342198
  let pages = 0;
342166
342199
  const maxPages = 100;
342167
342200
  while (pages < maxPages) {
342201
+ if (pages > 0 && cursor === previousCursor) {
342202
+ logForDebugging(`[teleport] Cursor stalled (unchanged from page ${pages}); treating as end-of-stream`);
342203
+ break;
342204
+ }
342168
342205
  const params = { limit: 1000 };
342169
342206
  if (cursor !== undefined) {
342170
342207
  params.cursor = cursor;
@@ -342212,6 +342249,7 @@ async function getTeleportEvents(sessionId, accessToken, orgUUID) {
342212
342249
  if (next_cursor == null) {
342213
342250
  break;
342214
342251
  }
342252
+ previousCursor = cursor;
342215
342253
  cursor = next_cursor;
342216
342254
  }
342217
342255
  if (pages >= maxPages) {
@@ -342280,8 +342318,9 @@ function findLastUuid(logs2) {
342280
342318
  function clearAllSessions() {
342281
342319
  lastUuidMap.clear();
342282
342320
  sequentialAppendBySession.clear();
342321
+ sequentialFetchBySession.clear();
342283
342322
  }
342284
- var lastUuidMap, MAX_RETRIES = 10, BASE_DELAY_MS2 = 500, sequentialAppendBySession;
342323
+ var lastUuidMap, MAX_RETRIES = 10, BASE_DELAY_MS2 = 500, sequentialAppendBySession, sequentialFetchBySession;
342285
342324
  var init_sessionIngress = __esm(() => {
342286
342325
  init_axios2();
342287
342326
  init_oauth();
@@ -342294,6 +342333,7 @@ var init_sessionIngress = __esm(() => {
342294
342333
  init_api2();
342295
342334
  lastUuidMap = new Map;
342296
342335
  sequentialAppendBySession = new Map;
342336
+ sequentialFetchBySession = new Map;
342297
342337
  });
342298
342338
 
342299
342339
  // src/utils/fileHistory.ts
@@ -453556,14 +453596,14 @@ function getCachedRemainingPasses() {
453556
453596
  return cachedEntry?.remaining_passes ?? null;
453557
453597
  }
453558
453598
  async function fetchAndStorePassesEligibility() {
453559
- if (fetchInProgress) {
453560
- logForDebugging("Passes: Reusing in-flight eligibility fetch");
453561
- return fetchInProgress;
453562
- }
453563
453599
  const orgId = getOauthAccountInfo()?.organizationUuid;
453564
453600
  if (!orgId) {
453565
453601
  return null;
453566
453602
  }
453603
+ if (fetchInProgress) {
453604
+ logForDebugging("Passes: Reusing in-flight eligibility fetch");
453605
+ return fetchInProgress;
453606
+ }
453567
453607
  fetchInProgress = (async () => {
453568
453608
  try {
453569
453609
  const response = await fetchReferralEligibility();
@@ -453620,7 +453660,7 @@ async function prefetchPassesEligibility() {
453620
453660
  if (isEssentialTrafficOnly()) {
453621
453661
  return;
453622
453662
  }
453623
- getCachedOrFetchPassesEligibility();
453663
+ getCachedOrFetchPassesEligibility().catch(() => {});
453624
453664
  }
453625
453665
  var CACHE_EXPIRATION_MS, fetchInProgress = null, CURRENCY_SYMBOLS;
453626
453666
  var init_referral = __esm(() => {
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.86",
8
- BUILD_TIME: "2026-07-17T00:07:06.766Z",
7
+ VERSION: "0.1.88",
8
+ BUILD_TIME: "2026-07-17T10:35:59.798Z",
9
9
  PACKAGE_URL: "@funnycode/myclaude",
10
10
  NATIVE_PACKAGE_URL: "@funnycode/myclaude",
11
11
  VERSION_CHANGELOG: '',
@@ -117484,7 +117484,7 @@ var package_default;
117484
117484
  var init_package = __esm(() => {
117485
117485
  package_default = {
117486
117486
  name: "@funnycode/myclaude",
117487
- version: "0.1.86",
117487
+ version: "0.1.88",
117488
117488
  private: false,
117489
117489
  description: "An open-source AI coding assistant in your terminal - powered by Claude",
117490
117490
  license: "MIT",
@@ -210190,8 +210190,7 @@ function addApiRequestToCache(requestData) {
210190
210190
  const metadata = {
210191
210191
  timestamp: new Date().toISOString(),
210192
210192
  request: {
210193
- model: requestData.model,
210194
- requestHash: hashString3(JSON.stringify(requestData))
210193
+ model: requestData.model
210195
210194
  }
210196
210195
  };
210197
210196
  cachedApiRequests.push(metadata);
@@ -300877,6 +300876,30 @@ var init_gracefulShutdown = __esm(() => {
300877
300876
  });
300878
300877
 
300879
300878
  // src/services/api/grove.ts
300879
+ function memoizeWithTTL(fn, ttlMs) {
300880
+ let lastCachedAt = 0;
300881
+ const memoized = memoize_default(fn);
300882
+ const originalClear = memoized.cache.clear.bind(memoized.cache);
300883
+ const wrapped = async (...args) => {
300884
+ const now2 = Date.now();
300885
+ if (lastCachedAt !== 0 && now2 - lastCachedAt >= ttlMs) {
300886
+ originalClear();
300887
+ lastCachedAt = 0;
300888
+ }
300889
+ const result = await memoized(...args);
300890
+ if (result && typeof result === "object" && "success" in result && result.success === true) {
300891
+ lastCachedAt = Date.now();
300892
+ }
300893
+ return result;
300894
+ };
300895
+ wrapped.cache = {
300896
+ clear: () => {
300897
+ originalClear();
300898
+ lastCachedAt = 0;
300899
+ }
300900
+ };
300901
+ return wrapped;
300902
+ }
300880
300903
  async function markGroveNoticeViewed() {
300881
300904
  try {
300882
300905
  await withOAuth401Retry(() => {
@@ -301043,7 +301066,7 @@ var init_grove = __esm(() => {
301043
301066
  init_log3();
301044
301067
  groveConfigLocks = new Map;
301045
301068
  GROVE_CACHE_EXPIRATION_MS = 24 * 60 * 60 * 1000;
301046
- getGroveSettings = memoize_default(async () => {
301069
+ getGroveSettings = memoizeWithTTL(async () => {
301047
301070
  if (isEssentialTrafficOnly()) {
301048
301071
  return { success: false };
301049
301072
  }
@@ -301066,8 +301089,8 @@ var init_grove = __esm(() => {
301066
301089
  getGroveSettings.cache.clear?.();
301067
301090
  return { success: false };
301068
301091
  }
301069
- });
301070
- getGroveNoticeConfig = memoize_default(async () => {
301092
+ }, GROVE_CACHE_EXPIRATION_MS);
301093
+ getGroveNoticeConfig = memoizeWithTTL(async () => {
301071
301094
  if (isEssentialTrafficOnly()) {
301072
301095
  return { success: false };
301073
301096
  }
@@ -301101,11 +301124,11 @@ var init_grove = __esm(() => {
301101
301124
  }
301102
301125
  };
301103
301126
  } catch (err2) {
301104
- logForDebugging(`Failed to fetch Grove notice config: ${err2}`);
301127
+ logError2(err2);
301105
301128
  getGroveNoticeConfig.cache.clear?.();
301106
301129
  return { success: false };
301107
301130
  }
301108
- });
301131
+ }, GROVE_CACHE_EXPIRATION_MS);
301109
301132
  });
301110
301133
 
301111
301134
  // src/services/policyLimits/index.ts
@@ -342038,6 +342061,14 @@ function getOrCreateSequentialAppend(sessionId) {
342038
342061
  }
342039
342062
  return sequentialAppend;
342040
342063
  }
342064
+ function getOrCreateSequentialFetch(sessionId) {
342065
+ let sequentialFetch = sequentialFetchBySession.get(sessionId);
342066
+ if (!sequentialFetch) {
342067
+ sequentialFetch = sequential(async (sid, url3, headers) => await fetchSessionLogsFromUrl(sid, url3, headers));
342068
+ sequentialFetchBySession.set(sessionId, sequentialFetch);
342069
+ }
342070
+ return sequentialFetch;
342071
+ }
342041
342072
  async function appendSessionLogImpl(sessionId, entry, url3, headers) {
342042
342073
  for (let attempt = 1;attempt <= MAX_RETRIES; attempt++) {
342043
342074
  try {
@@ -342067,7 +342098,8 @@ async function appendSessionLogImpl(sessionId, entry, url3, headers) {
342067
342098
  lastUuidMap.set(sessionId, serverLastUuid);
342068
342099
  logForDebugging(`Session 409: adopting server lastUuid=${serverLastUuid} from header, retrying entry ${entry.uuid}`);
342069
342100
  } else {
342070
- const logs2 = await fetchSessionLogsFromUrl(sessionId, url3, headers);
342101
+ const sequentialFetch = getOrCreateSequentialFetch(sessionId);
342102
+ const logs2 = await sequentialFetch(sessionId, url3, headers);
342071
342103
  const adoptedUuid = findLastUuid(logs2);
342072
342104
  if (adoptedUuid) {
342073
342105
  lastUuidMap.set(sessionId, adoptedUuid);
@@ -342162,9 +342194,14 @@ async function getTeleportEvents(sessionId, accessToken, orgUUID) {
342162
342194
  logForDebugging(`[teleport] Fetching events from: ${baseUrl}`);
342163
342195
  const all4 = [];
342164
342196
  let cursor;
342197
+ let previousCursor;
342165
342198
  let pages = 0;
342166
342199
  const maxPages = 100;
342167
342200
  while (pages < maxPages) {
342201
+ if (pages > 0 && cursor === previousCursor) {
342202
+ logForDebugging(`[teleport] Cursor stalled (unchanged from page ${pages}); treating as end-of-stream`);
342203
+ break;
342204
+ }
342168
342205
  const params = { limit: 1000 };
342169
342206
  if (cursor !== undefined) {
342170
342207
  params.cursor = cursor;
@@ -342212,6 +342249,7 @@ async function getTeleportEvents(sessionId, accessToken, orgUUID) {
342212
342249
  if (next_cursor == null) {
342213
342250
  break;
342214
342251
  }
342252
+ previousCursor = cursor;
342215
342253
  cursor = next_cursor;
342216
342254
  }
342217
342255
  if (pages >= maxPages) {
@@ -342280,8 +342318,9 @@ function findLastUuid(logs2) {
342280
342318
  function clearAllSessions() {
342281
342319
  lastUuidMap.clear();
342282
342320
  sequentialAppendBySession.clear();
342321
+ sequentialFetchBySession.clear();
342283
342322
  }
342284
- var lastUuidMap, MAX_RETRIES = 10, BASE_DELAY_MS2 = 500, sequentialAppendBySession;
342323
+ var lastUuidMap, MAX_RETRIES = 10, BASE_DELAY_MS2 = 500, sequentialAppendBySession, sequentialFetchBySession;
342285
342324
  var init_sessionIngress = __esm(() => {
342286
342325
  init_axios2();
342287
342326
  init_oauth();
@@ -342294,6 +342333,7 @@ var init_sessionIngress = __esm(() => {
342294
342333
  init_api2();
342295
342334
  lastUuidMap = new Map;
342296
342335
  sequentialAppendBySession = new Map;
342336
+ sequentialFetchBySession = new Map;
342297
342337
  });
342298
342338
 
342299
342339
  // src/utils/fileHistory.ts
@@ -453556,14 +453596,14 @@ function getCachedRemainingPasses() {
453556
453596
  return cachedEntry?.remaining_passes ?? null;
453557
453597
  }
453558
453598
  async function fetchAndStorePassesEligibility() {
453559
- if (fetchInProgress) {
453560
- logForDebugging("Passes: Reusing in-flight eligibility fetch");
453561
- return fetchInProgress;
453562
- }
453563
453599
  const orgId = getOauthAccountInfo()?.organizationUuid;
453564
453600
  if (!orgId) {
453565
453601
  return null;
453566
453602
  }
453603
+ if (fetchInProgress) {
453604
+ logForDebugging("Passes: Reusing in-flight eligibility fetch");
453605
+ return fetchInProgress;
453606
+ }
453567
453607
  fetchInProgress = (async () => {
453568
453608
  try {
453569
453609
  const response = await fetchReferralEligibility();
@@ -453620,7 +453660,7 @@ async function prefetchPassesEligibility() {
453620
453660
  if (isEssentialTrafficOnly()) {
453621
453661
  return;
453622
453662
  }
453623
- getCachedOrFetchPassesEligibility();
453663
+ getCachedOrFetchPassesEligibility().catch(() => {});
453624
453664
  }
453625
453665
  var CACHE_EXPIRATION_MS, fetchInProgress = null, CURRENCY_SYMBOLS;
453626
453666
  var init_referral = __esm(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnycode/myclaude",
3
- "version": "0.1.86",
3
+ "version": "0.1.88",
4
4
  "private": false,
5
5
  "description": "An open-source AI coding assistant in your terminal - powered by Claude",
6
6
  "license": "MIT",