@funnycode/myclaude 0.1.81 → 0.1.83

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.81",
8
- BUILD_TIME: "2026-07-16T06:38:00.106Z",
7
+ VERSION: "0.1.83",
8
+ BUILD_TIME: "2026-07-16T16:39:24.825Z",
9
9
  PACKAGE_URL: "@funnycode/myclaude",
10
10
  NATIVE_PACKAGE_URL: "@funnycode/myclaude",
11
11
  VERSION_CHANGELOG: '',
@@ -40824,12 +40824,9 @@ function hasBinaryExtension(filePath) {
40824
40824
  return BINARY_EXTENSIONS.has(ext);
40825
40825
  }
40826
40826
  function isBinaryContent(buffer) {
40827
- const checkSize = Math.min(buffer.length, BINARY_CHECK_SIZE);
40828
40827
  let nonPrintable = 0;
40829
- for (let i2 = 0;i2 < checkSize; i2++) {
40828
+ for (let i2 = 0;i2 < buffer.length; i2++) {
40830
40829
  const byte = buffer[i2];
40831
- if (byte === undefined)
40832
- break;
40833
40830
  if (byte === 0) {
40834
40831
  return true;
40835
40832
  }
@@ -40837,9 +40834,9 @@ function isBinaryContent(buffer) {
40837
40834
  nonPrintable++;
40838
40835
  }
40839
40836
  }
40840
- return nonPrintable / checkSize > 0.2;
40837
+ return nonPrintable / buffer.length > 0.2;
40841
40838
  }
40842
- var BINARY_EXTENSIONS, BINARY_CHECK_SIZE = 8192;
40839
+ var BINARY_EXTENSIONS;
40843
40840
  var init_files2 = __esm(() => {
40844
40841
  BINARY_EXTENSIONS = new Set([
40845
40842
  ".png",
@@ -117487,7 +117484,7 @@ var package_default;
117487
117484
  var init_package = __esm(() => {
117488
117485
  package_default = {
117489
117486
  name: "@funnycode/myclaude",
117490
- version: "0.1.81",
117487
+ version: "0.1.83",
117491
117488
  private: false,
117492
117489
  description: "An open-source AI coding assistant in your terminal - powered by Claude",
117493
117490
  license: "MIT",
@@ -210160,14 +210157,16 @@ function enqueueDumpRequest(agentIdOrSessionId, callback) {
210160
210157
  dumpRequestQueue.set(agentIdOrSessionId, []);
210161
210158
  }
210162
210159
  dumpRequestQueue.get(agentIdOrSessionId).push(callback);
210163
- if (dumpRequestQueue.get(agentIdOrSessionId).length === 1) {
210160
+ if (!processingQueues.has(agentIdOrSessionId)) {
210164
210161
  processQueue(agentIdOrSessionId);
210165
210162
  }
210166
210163
  }
210167
210164
  function processQueue(agentIdOrSessionId) {
210165
+ processingQueues.add(agentIdOrSessionId);
210168
210166
  const queue = dumpRequestQueue.get(agentIdOrSessionId);
210169
210167
  if (!queue || queue.length === 0) {
210170
210168
  dumpRequestQueue.delete(agentIdOrSessionId);
210169
+ processingQueues.delete(agentIdOrSessionId);
210171
210170
  return;
210172
210171
  }
210173
210172
  const callback = queue.shift();
@@ -210176,6 +210175,7 @@ function processQueue(agentIdOrSessionId) {
210176
210175
  setImmediate(() => processQueue(agentIdOrSessionId));
210177
210176
  } else {
210178
210177
  dumpRequestQueue.delete(agentIdOrSessionId);
210178
+ processingQueues.delete(agentIdOrSessionId);
210179
210179
  }
210180
210180
  }
210181
210181
  function clearDumpState(agentIdOrSessionId) {
@@ -210227,10 +210227,20 @@ function dumpRequest(body, ts, state, filePath) {
210227
210227
  const entries = [];
210228
210228
  const messages = req.messages ?? [];
210229
210229
  const fingerprint = initFingerprint(req);
210230
- if (!state.initialized || fingerprint !== state.lastInitFingerprint) {
210230
+ let initDataStr;
210231
+ let initDataHash;
210232
+ const shouldWriteInitData = !state.initialized || fingerprint !== state.lastInitFingerprint;
210233
+ if (shouldWriteInitData) {
210231
210234
  const { messages: _2, ...initData } = req;
210232
- const initDataStr = jsonStringify(initData);
210233
- const initDataHash = hashString3(initDataStr);
210235
+ initDataStr = jsonStringify(initData);
210236
+ initDataHash = hashString3(initDataStr);
210237
+ }
210238
+ for (const msg of messages.slice(state.messageCountSeen)) {
210239
+ if (msg.role === "user") {
210240
+ entries.push(jsonStringify({ type: "message", timestamp: ts, data: msg }));
210241
+ }
210242
+ }
210243
+ if (shouldWriteInitData) {
210234
210244
  state.lastInitFingerprint = fingerprint;
210235
210245
  if (!state.initialized) {
210236
210246
  state.initialized = true;
@@ -210241,11 +210251,6 @@ function dumpRequest(body, ts, state, filePath) {
210241
210251
  entries.push(`{"type":"system_update","timestamp":"${ts}","data":${initDataStr}}`);
210242
210252
  }
210243
210253
  }
210244
- for (const msg of messages.slice(state.messageCountSeen)) {
210245
- if (msg.role === "user") {
210246
- entries.push(jsonStringify({ type: "message", timestamp: ts, data: msg }));
210247
- }
210248
- }
210249
210254
  state.messageCountSeen = messages.length;
210250
210255
  appendToFile(filePath, entries);
210251
210256
  } catch (err2) {
@@ -210319,7 +210324,7 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
210319
210324
  return response;
210320
210325
  };
210321
210326
  }
210322
- var MAX_CACHED_REQUESTS = 5, cachedApiRequests, dumpState, dumpRequestQueue;
210327
+ var MAX_CACHED_REQUESTS = 5, cachedApiRequests, dumpState, dumpRequestQueue, processingQueues;
210323
210328
  var init_dumpPrompts = __esm(() => {
210324
210329
  init_state();
210325
210330
  init_envUtils();
@@ -210328,6 +210333,7 @@ var init_dumpPrompts = __esm(() => {
210328
210333
  cachedApiRequests = [];
210329
210334
  dumpState = new Map;
210330
210335
  dumpRequestQueue = new Map;
210336
+ processingQueues = new Set;
210331
210337
  });
210332
210338
 
210333
210339
  // src/utils/abortController.ts
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.81",
8
- BUILD_TIME: "2026-07-16T06:38:00.106Z",
7
+ VERSION: "0.1.83",
8
+ BUILD_TIME: "2026-07-16T16:39:24.825Z",
9
9
  PACKAGE_URL: "@funnycode/myclaude",
10
10
  NATIVE_PACKAGE_URL: "@funnycode/myclaude",
11
11
  VERSION_CHANGELOG: '',
@@ -40824,12 +40824,9 @@ function hasBinaryExtension(filePath) {
40824
40824
  return BINARY_EXTENSIONS.has(ext);
40825
40825
  }
40826
40826
  function isBinaryContent(buffer) {
40827
- const checkSize = Math.min(buffer.length, BINARY_CHECK_SIZE);
40828
40827
  let nonPrintable = 0;
40829
- for (let i2 = 0;i2 < checkSize; i2++) {
40828
+ for (let i2 = 0;i2 < buffer.length; i2++) {
40830
40829
  const byte = buffer[i2];
40831
- if (byte === undefined)
40832
- break;
40833
40830
  if (byte === 0) {
40834
40831
  return true;
40835
40832
  }
@@ -40837,9 +40834,9 @@ function isBinaryContent(buffer) {
40837
40834
  nonPrintable++;
40838
40835
  }
40839
40836
  }
40840
- return nonPrintable / checkSize > 0.2;
40837
+ return nonPrintable / buffer.length > 0.2;
40841
40838
  }
40842
- var BINARY_EXTENSIONS, BINARY_CHECK_SIZE = 8192;
40839
+ var BINARY_EXTENSIONS;
40843
40840
  var init_files2 = __esm(() => {
40844
40841
  BINARY_EXTENSIONS = new Set([
40845
40842
  ".png",
@@ -117487,7 +117484,7 @@ var package_default;
117487
117484
  var init_package = __esm(() => {
117488
117485
  package_default = {
117489
117486
  name: "@funnycode/myclaude",
117490
- version: "0.1.81",
117487
+ version: "0.1.83",
117491
117488
  private: false,
117492
117489
  description: "An open-source AI coding assistant in your terminal - powered by Claude",
117493
117490
  license: "MIT",
@@ -210160,14 +210157,16 @@ function enqueueDumpRequest(agentIdOrSessionId, callback) {
210160
210157
  dumpRequestQueue.set(agentIdOrSessionId, []);
210161
210158
  }
210162
210159
  dumpRequestQueue.get(agentIdOrSessionId).push(callback);
210163
- if (dumpRequestQueue.get(agentIdOrSessionId).length === 1) {
210160
+ if (!processingQueues.has(agentIdOrSessionId)) {
210164
210161
  processQueue(agentIdOrSessionId);
210165
210162
  }
210166
210163
  }
210167
210164
  function processQueue(agentIdOrSessionId) {
210165
+ processingQueues.add(agentIdOrSessionId);
210168
210166
  const queue = dumpRequestQueue.get(agentIdOrSessionId);
210169
210167
  if (!queue || queue.length === 0) {
210170
210168
  dumpRequestQueue.delete(agentIdOrSessionId);
210169
+ processingQueues.delete(agentIdOrSessionId);
210171
210170
  return;
210172
210171
  }
210173
210172
  const callback = queue.shift();
@@ -210176,6 +210175,7 @@ function processQueue(agentIdOrSessionId) {
210176
210175
  setImmediate(() => processQueue(agentIdOrSessionId));
210177
210176
  } else {
210178
210177
  dumpRequestQueue.delete(agentIdOrSessionId);
210178
+ processingQueues.delete(agentIdOrSessionId);
210179
210179
  }
210180
210180
  }
210181
210181
  function clearDumpState(agentIdOrSessionId) {
@@ -210227,10 +210227,20 @@ function dumpRequest(body, ts, state, filePath) {
210227
210227
  const entries = [];
210228
210228
  const messages = req.messages ?? [];
210229
210229
  const fingerprint = initFingerprint(req);
210230
- if (!state.initialized || fingerprint !== state.lastInitFingerprint) {
210230
+ let initDataStr;
210231
+ let initDataHash;
210232
+ const shouldWriteInitData = !state.initialized || fingerprint !== state.lastInitFingerprint;
210233
+ if (shouldWriteInitData) {
210231
210234
  const { messages: _2, ...initData } = req;
210232
- const initDataStr = jsonStringify(initData);
210233
- const initDataHash = hashString3(initDataStr);
210235
+ initDataStr = jsonStringify(initData);
210236
+ initDataHash = hashString3(initDataStr);
210237
+ }
210238
+ for (const msg of messages.slice(state.messageCountSeen)) {
210239
+ if (msg.role === "user") {
210240
+ entries.push(jsonStringify({ type: "message", timestamp: ts, data: msg }));
210241
+ }
210242
+ }
210243
+ if (shouldWriteInitData) {
210234
210244
  state.lastInitFingerprint = fingerprint;
210235
210245
  if (!state.initialized) {
210236
210246
  state.initialized = true;
@@ -210241,11 +210251,6 @@ function dumpRequest(body, ts, state, filePath) {
210241
210251
  entries.push(`{"type":"system_update","timestamp":"${ts}","data":${initDataStr}}`);
210242
210252
  }
210243
210253
  }
210244
- for (const msg of messages.slice(state.messageCountSeen)) {
210245
- if (msg.role === "user") {
210246
- entries.push(jsonStringify({ type: "message", timestamp: ts, data: msg }));
210247
- }
210248
- }
210249
210254
  state.messageCountSeen = messages.length;
210250
210255
  appendToFile(filePath, entries);
210251
210256
  } catch (err2) {
@@ -210319,7 +210324,7 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
210319
210324
  return response;
210320
210325
  };
210321
210326
  }
210322
- var MAX_CACHED_REQUESTS = 5, cachedApiRequests, dumpState, dumpRequestQueue;
210327
+ var MAX_CACHED_REQUESTS = 5, cachedApiRequests, dumpState, dumpRequestQueue, processingQueues;
210323
210328
  var init_dumpPrompts = __esm(() => {
210324
210329
  init_state();
210325
210330
  init_envUtils();
@@ -210328,6 +210333,7 @@ var init_dumpPrompts = __esm(() => {
210328
210333
  cachedApiRequests = [];
210329
210334
  dumpState = new Map;
210330
210335
  dumpRequestQueue = new Map;
210336
+ processingQueues = new Set;
210331
210337
  });
210332
210338
 
210333
210339
  // src/utils/abortController.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnycode/myclaude",
3
- "version": "0.1.81",
3
+ "version": "0.1.83",
4
4
  "private": false,
5
5
  "description": "An open-source AI coding assistant in your terminal - powered by Claude",
6
6
  "license": "MIT",