@funnycode/myclaude 0.1.96 → 0.1.97

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.96",
8
- BUILD_TIME: "2026-07-18T10:50:58.819Z",
7
+ VERSION: "0.1.97",
8
+ BUILD_TIME: "2026-07-18T15:18:43.301Z",
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.96",
117487
+ version: "0.1.97",
117488
117488
  private: false,
117489
117489
  description: "An open-source AI coding assistant in your terminal - powered by Claude",
117490
117490
  license: "MIT",
@@ -210223,10 +210223,12 @@ function initFingerprint(req) {
210223
210223
  async function dumpRequest(body, ts, state, filePath) {
210224
210224
  if (false)
210225
210225
  ;
210226
+ if (process.env.USER_TYPE !== "ant")
210227
+ return;
210226
210228
  try {
210227
210229
  const req = jsonParse(body);
210228
210230
  addApiRequestToCache(req);
210229
- if (process.env.USER_TYPE !== "ant" || process.env.DUMP_PROMPTS !== "1")
210231
+ if (process.env.DUMP_PROMPTS !== "1")
210230
210232
  return;
210231
210233
  logForDebugging("DUMP_PROMPTS is enabled. This will write full API payloads (including system prompts, user messages, and tool definitions) to the filesystem. This is intended for debugging only and should NOT be used in production.", { level: "warn" });
210232
210234
  const entries = [];
@@ -210359,14 +210361,10 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
210359
210361
  jsonStringify({ type: "response", timestamp, data })
210360
210362
  ]);
210361
210363
  } catch (err2) {
210362
- try {
210363
- logForDebugging(`dumpPrompts.response handler error: ${err2}`, { level: "error" });
210364
- } catch {}
210364
+ logError2(`dumpPrompts.response handler error: ${err2}`);
210365
210365
  }
210366
210366
  })().catch((err2) => {
210367
- try {
210368
- logForDebugging(`dumpPrompts.response handler unhandled rejection: ${err2}`, { level: "error" });
210369
- } catch {}
210367
+ logError2(`dumpPrompts.response handler unhandled rejection: ${err2}`);
210370
210368
  });
210371
210369
  }
210372
210370
  return response;
@@ -301142,14 +301140,9 @@ function memoizeWithTTL(fn, ttlMs) {
301142
301140
  const result = await memoized(...args);
301143
301141
  if (result && typeof result === "object" && "success" in result && result.success === true) {
301144
301142
  lastCachedAt = Date.now();
301145
- } else if (result && typeof result === "object" && "success" in result && result.success === false) {
301146
- originalClear();
301147
- lastCachedAt = 0;
301148
- }
301143
+ } else if (result && typeof result === "object" && "success" in result && result.success === false) {}
301149
301144
  return result;
301150
301145
  } catch (error49) {
301151
- originalClear();
301152
- lastCachedAt = -1;
301153
301146
  return { success: false };
301154
301147
  }
301155
301148
  };
@@ -301213,13 +301206,21 @@ async function isQualifiedForGrove() {
301213
301206
  const cachedEntry = globalConfig2.groveConfigCache?.[accountId];
301214
301207
  const now2 = Date.now();
301215
301208
  if (!cachedEntry) {
301216
- logForDebugging("Grove: No cache, fetching config in background (dialog skipped this session)");
301217
- fetchAndStoreGroveConfig(accountId);
301209
+ logForDebugging("Grove: No cache, fetching config synchronously");
301210
+ await fetchAndStoreGroveConfig(accountId);
301211
+ const updatedConfig = getGlobalConfig().groveConfigCache?.[accountId];
301212
+ if (updatedConfig) {
301213
+ return updatedConfig.grove_enabled;
301214
+ }
301218
301215
  return false;
301219
301216
  }
301220
301217
  if (now2 - cachedEntry.timestamp > GROVE_CACHE_EXPIRATION_MS) {
301221
- logForDebugging("Grove: Cache stale, returning cached data and refreshing in background");
301222
- fetchAndStoreGroveConfig(accountId);
301218
+ logForDebugging("Grove: Cache stale, refreshing config");
301219
+ await fetchAndStoreGroveConfig(accountId);
301220
+ const updatedConfig = getGlobalConfig().groveConfigCache?.[accountId];
301221
+ if (updatedConfig) {
301222
+ return updatedConfig.grove_enabled;
301223
+ }
301223
301224
  return cachedEntry.grove_enabled;
301224
301225
  }
301225
301226
  logForDebugging("Grove: Using fresh cached config");
@@ -301235,27 +301236,41 @@ async function fetchAndStoreGroveConfig(accountId) {
301235
301236
  mapRelease();
301236
301237
  const release = await mutex.acquire();
301237
301238
  try {
301238
- const result = await getGroveNoticeConfig();
301239
- if (!result.success) {
301240
- return;
301241
- }
301242
- const groveEnabled = result.data.grove_enabled;
301243
- const cachedEntry = getGlobalConfig().groveConfigCache?.[accountId];
301244
- if (cachedEntry?.grove_enabled === groveEnabled && Date.now() - cachedEntry.timestamp <= GROVE_CACHE_EXPIRATION_MS) {
301245
- return;
301246
- }
301247
- saveGlobalConfig((current) => ({
301248
- ...current,
301249
- groveConfigCache: {
301250
- ...current.groveConfigCache,
301251
- [accountId]: {
301252
- grove_enabled: groveEnabled,
301253
- timestamp: Date.now()
301239
+ let lastError;
301240
+ for (let attempt = 0;attempt < 3; attempt++) {
301241
+ try {
301242
+ const result = await getGroveNoticeConfig();
301243
+ if (!result.success) {
301244
+ if (attempt < 2) {
301245
+ await new Promise((resolve28) => setTimeout(resolve28, 500));
301246
+ continue;
301247
+ }
301248
+ return;
301249
+ }
301250
+ const groveEnabled = result.data.grove_enabled;
301251
+ const cachedEntry = getGlobalConfig().groveConfigCache?.[accountId];
301252
+ if (cachedEntry?.grove_enabled === groveEnabled && Date.now() - cachedEntry.timestamp <= GROVE_CACHE_EXPIRATION_MS) {
301253
+ return;
301254
+ }
301255
+ saveGlobalConfig((current) => ({
301256
+ ...current,
301257
+ groveConfigCache: {
301258
+ ...current.groveConfigCache,
301259
+ [accountId]: {
301260
+ grove_enabled: groveEnabled,
301261
+ timestamp: Date.now()
301262
+ }
301263
+ }
301264
+ }));
301265
+ return;
301266
+ } catch (err2) {
301267
+ lastError = err2 instanceof Error ? err2 : new Error(String(err2));
301268
+ if (attempt < 2) {
301269
+ await new Promise((resolve28) => setTimeout(resolve28, 500));
301254
301270
  }
301255
301271
  }
301256
- }));
301257
- } catch (err2) {
301258
- logForDebugging(`Grove: Failed to fetch and store config: ${err2}`);
301272
+ }
301273
+ logForDebugging(`Grove: Failed to fetch and store config after 3 attempts: ${lastError}`);
301259
301274
  } finally {
301260
301275
  release();
301261
301276
  }
@@ -301348,7 +301363,6 @@ var init_grove = __esm(() => {
301348
301363
  return { success: true, data: response.data };
301349
301364
  } catch (err2) {
301350
301365
  logError2(err2);
301351
- getGroveSettings.cache.clear?.();
301352
301366
  return { success: false };
301353
301367
  }
301354
301368
  }, GROVE_CACHE_EXPIRATION_MS);
@@ -301390,7 +301404,6 @@ var init_grove = __esm(() => {
301390
301404
  if (axios_default.isAxiosError(err2) && err2.code === "ECONNABORTED") {
301391
301405
  logForDebugging(`Grove: API request timed out after ${GROVE_API_TIMEOUT_MS}ms. This may cause the Grove dialog to be suppressed for users with slow connections.`);
301392
301406
  }
301393
- getGroveNoticeConfig.cache.clear?.();
301394
301407
  return { success: false };
301395
301408
  }
301396
301409
  }, GROVE_CACHE_EXPIRATION_MS);
@@ -342434,7 +342447,9 @@ async function getSessionLogs(sessionId, url3) {
342434
342447
  return null;
342435
342448
  }
342436
342449
  const headers = { Authorization: `Bearer ${sessionToken}` };
342437
- const logs2 = await fetchSessionLogsFromUrl(sessionId, url3, headers);
342450
+ const sequential2 = getOrCreateSequential(sessionId);
342451
+ const result = await sequential2(sessionId, url3, headers, true);
342452
+ const logs2 = result;
342438
342453
  if (logs2 && logs2.length > 0) {
342439
342454
  const lastEntry = logs2.at(-1);
342440
342455
  if (lastEntry && "uuid" in lastEntry && lastEntry.uuid) {
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.96",
8
- BUILD_TIME: "2026-07-18T10:50:58.819Z",
7
+ VERSION: "0.1.97",
8
+ BUILD_TIME: "2026-07-18T15:18:43.301Z",
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.96",
117487
+ version: "0.1.97",
117488
117488
  private: false,
117489
117489
  description: "An open-source AI coding assistant in your terminal - powered by Claude",
117490
117490
  license: "MIT",
@@ -210223,10 +210223,12 @@ function initFingerprint(req) {
210223
210223
  async function dumpRequest(body, ts, state, filePath) {
210224
210224
  if (false)
210225
210225
  ;
210226
+ if (process.env.USER_TYPE !== "ant")
210227
+ return;
210226
210228
  try {
210227
210229
  const req = jsonParse(body);
210228
210230
  addApiRequestToCache(req);
210229
- if (process.env.USER_TYPE !== "ant" || process.env.DUMP_PROMPTS !== "1")
210231
+ if (process.env.DUMP_PROMPTS !== "1")
210230
210232
  return;
210231
210233
  logForDebugging("DUMP_PROMPTS is enabled. This will write full API payloads (including system prompts, user messages, and tool definitions) to the filesystem. This is intended for debugging only and should NOT be used in production.", { level: "warn" });
210232
210234
  const entries = [];
@@ -210359,14 +210361,10 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
210359
210361
  jsonStringify({ type: "response", timestamp, data })
210360
210362
  ]);
210361
210363
  } catch (err2) {
210362
- try {
210363
- logForDebugging(`dumpPrompts.response handler error: ${err2}`, { level: "error" });
210364
- } catch {}
210364
+ logError2(`dumpPrompts.response handler error: ${err2}`);
210365
210365
  }
210366
210366
  })().catch((err2) => {
210367
- try {
210368
- logForDebugging(`dumpPrompts.response handler unhandled rejection: ${err2}`, { level: "error" });
210369
- } catch {}
210367
+ logError2(`dumpPrompts.response handler unhandled rejection: ${err2}`);
210370
210368
  });
210371
210369
  }
210372
210370
  return response;
@@ -301142,14 +301140,9 @@ function memoizeWithTTL(fn, ttlMs) {
301142
301140
  const result = await memoized(...args);
301143
301141
  if (result && typeof result === "object" && "success" in result && result.success === true) {
301144
301142
  lastCachedAt = Date.now();
301145
- } else if (result && typeof result === "object" && "success" in result && result.success === false) {
301146
- originalClear();
301147
- lastCachedAt = 0;
301148
- }
301143
+ } else if (result && typeof result === "object" && "success" in result && result.success === false) {}
301149
301144
  return result;
301150
301145
  } catch (error49) {
301151
- originalClear();
301152
- lastCachedAt = -1;
301153
301146
  return { success: false };
301154
301147
  }
301155
301148
  };
@@ -301213,13 +301206,21 @@ async function isQualifiedForGrove() {
301213
301206
  const cachedEntry = globalConfig2.groveConfigCache?.[accountId];
301214
301207
  const now2 = Date.now();
301215
301208
  if (!cachedEntry) {
301216
- logForDebugging("Grove: No cache, fetching config in background (dialog skipped this session)");
301217
- fetchAndStoreGroveConfig(accountId);
301209
+ logForDebugging("Grove: No cache, fetching config synchronously");
301210
+ await fetchAndStoreGroveConfig(accountId);
301211
+ const updatedConfig = getGlobalConfig().groveConfigCache?.[accountId];
301212
+ if (updatedConfig) {
301213
+ return updatedConfig.grove_enabled;
301214
+ }
301218
301215
  return false;
301219
301216
  }
301220
301217
  if (now2 - cachedEntry.timestamp > GROVE_CACHE_EXPIRATION_MS) {
301221
- logForDebugging("Grove: Cache stale, returning cached data and refreshing in background");
301222
- fetchAndStoreGroveConfig(accountId);
301218
+ logForDebugging("Grove: Cache stale, refreshing config");
301219
+ await fetchAndStoreGroveConfig(accountId);
301220
+ const updatedConfig = getGlobalConfig().groveConfigCache?.[accountId];
301221
+ if (updatedConfig) {
301222
+ return updatedConfig.grove_enabled;
301223
+ }
301223
301224
  return cachedEntry.grove_enabled;
301224
301225
  }
301225
301226
  logForDebugging("Grove: Using fresh cached config");
@@ -301235,27 +301236,41 @@ async function fetchAndStoreGroveConfig(accountId) {
301235
301236
  mapRelease();
301236
301237
  const release = await mutex.acquire();
301237
301238
  try {
301238
- const result = await getGroveNoticeConfig();
301239
- if (!result.success) {
301240
- return;
301241
- }
301242
- const groveEnabled = result.data.grove_enabled;
301243
- const cachedEntry = getGlobalConfig().groveConfigCache?.[accountId];
301244
- if (cachedEntry?.grove_enabled === groveEnabled && Date.now() - cachedEntry.timestamp <= GROVE_CACHE_EXPIRATION_MS) {
301245
- return;
301246
- }
301247
- saveGlobalConfig((current) => ({
301248
- ...current,
301249
- groveConfigCache: {
301250
- ...current.groveConfigCache,
301251
- [accountId]: {
301252
- grove_enabled: groveEnabled,
301253
- timestamp: Date.now()
301239
+ let lastError;
301240
+ for (let attempt = 0;attempt < 3; attempt++) {
301241
+ try {
301242
+ const result = await getGroveNoticeConfig();
301243
+ if (!result.success) {
301244
+ if (attempt < 2) {
301245
+ await new Promise((resolve28) => setTimeout(resolve28, 500));
301246
+ continue;
301247
+ }
301248
+ return;
301249
+ }
301250
+ const groveEnabled = result.data.grove_enabled;
301251
+ const cachedEntry = getGlobalConfig().groveConfigCache?.[accountId];
301252
+ if (cachedEntry?.grove_enabled === groveEnabled && Date.now() - cachedEntry.timestamp <= GROVE_CACHE_EXPIRATION_MS) {
301253
+ return;
301254
+ }
301255
+ saveGlobalConfig((current) => ({
301256
+ ...current,
301257
+ groveConfigCache: {
301258
+ ...current.groveConfigCache,
301259
+ [accountId]: {
301260
+ grove_enabled: groveEnabled,
301261
+ timestamp: Date.now()
301262
+ }
301263
+ }
301264
+ }));
301265
+ return;
301266
+ } catch (err2) {
301267
+ lastError = err2 instanceof Error ? err2 : new Error(String(err2));
301268
+ if (attempt < 2) {
301269
+ await new Promise((resolve28) => setTimeout(resolve28, 500));
301254
301270
  }
301255
301271
  }
301256
- }));
301257
- } catch (err2) {
301258
- logForDebugging(`Grove: Failed to fetch and store config: ${err2}`);
301272
+ }
301273
+ logForDebugging(`Grove: Failed to fetch and store config after 3 attempts: ${lastError}`);
301259
301274
  } finally {
301260
301275
  release();
301261
301276
  }
@@ -301348,7 +301363,6 @@ var init_grove = __esm(() => {
301348
301363
  return { success: true, data: response.data };
301349
301364
  } catch (err2) {
301350
301365
  logError2(err2);
301351
- getGroveSettings.cache.clear?.();
301352
301366
  return { success: false };
301353
301367
  }
301354
301368
  }, GROVE_CACHE_EXPIRATION_MS);
@@ -301390,7 +301404,6 @@ var init_grove = __esm(() => {
301390
301404
  if (axios_default.isAxiosError(err2) && err2.code === "ECONNABORTED") {
301391
301405
  logForDebugging(`Grove: API request timed out after ${GROVE_API_TIMEOUT_MS}ms. This may cause the Grove dialog to be suppressed for users with slow connections.`);
301392
301406
  }
301393
- getGroveNoticeConfig.cache.clear?.();
301394
301407
  return { success: false };
301395
301408
  }
301396
301409
  }, GROVE_CACHE_EXPIRATION_MS);
@@ -342434,7 +342447,9 @@ async function getSessionLogs(sessionId, url3) {
342434
342447
  return null;
342435
342448
  }
342436
342449
  const headers = { Authorization: `Bearer ${sessionToken}` };
342437
- const logs2 = await fetchSessionLogsFromUrl(sessionId, url3, headers);
342450
+ const sequential2 = getOrCreateSequential(sessionId);
342451
+ const result = await sequential2(sessionId, url3, headers, true);
342452
+ const logs2 = result;
342438
342453
  if (logs2 && logs2.length > 0) {
342439
342454
  const lastEntry = logs2.at(-1);
342440
342455
  if (lastEntry && "uuid" in lastEntry && lastEntry.uuid) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnycode/myclaude",
3
- "version": "0.1.96",
3
+ "version": "0.1.97",
4
4
  "private": false,
5
5
  "description": "An open-source AI coding assistant in your terminal - powered by Claude",
6
6
  "license": "MIT",