@funnycode/myclaude 0.1.103 → 0.1.105
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 +32 -19
- package/dist/myclaude.mjs +32 -19
- package/package.json +1 -1
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.
|
|
8
|
-
BUILD_TIME: "2026-07-
|
|
7
|
+
VERSION: "0.1.105",
|
|
8
|
+
BUILD_TIME: "2026-07-19T17:13:00.724Z",
|
|
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 reentrantCount = 0;
|
|
38383
38384
|
async function processQueue() {
|
|
38384
38385
|
if (processing)
|
|
38385
38386
|
return;
|
|
@@ -38389,10 +38390,13 @@ function sequential(fn) {
|
|
|
38389
38390
|
while (queue.length > 0) {
|
|
38390
38391
|
const { args, resolve: resolve5, reject, context } = queue.shift();
|
|
38391
38392
|
try {
|
|
38393
|
+
reentrantCount++;
|
|
38392
38394
|
const result = await fn.apply(context, args);
|
|
38393
38395
|
resolve5(result);
|
|
38394
38396
|
} catch (error49) {
|
|
38395
38397
|
reject(error49);
|
|
38398
|
+
} finally {
|
|
38399
|
+
reentrantCount--;
|
|
38396
38400
|
}
|
|
38397
38401
|
}
|
|
38398
38402
|
processing = false;
|
|
@@ -38401,6 +38405,9 @@ function sequential(fn) {
|
|
|
38401
38405
|
}
|
|
38402
38406
|
}
|
|
38403
38407
|
return function(...args) {
|
|
38408
|
+
if (reentrantCount > 0) {
|
|
38409
|
+
return fn.apply(this, args);
|
|
38410
|
+
}
|
|
38404
38411
|
return new Promise((resolve5, reject) => {
|
|
38405
38412
|
queue.push({ args, resolve: resolve5, reject, context: this });
|
|
38406
38413
|
processQueue();
|
|
@@ -117484,7 +117491,7 @@ var package_default;
|
|
|
117484
117491
|
var init_package = __esm(() => {
|
|
117485
117492
|
package_default = {
|
|
117486
117493
|
name: "@funnycode/myclaude",
|
|
117487
|
-
version: "0.1.
|
|
117494
|
+
version: "0.1.105",
|
|
117488
117495
|
private: false,
|
|
117489
117496
|
description: "An open-source AI coding assistant in your terminal - powered by Claude",
|
|
117490
117497
|
license: "MIT",
|
|
@@ -210166,27 +210173,29 @@ function enqueueDumpRequest(agentIdOrSessionId, callback) {
|
|
|
210166
210173
|
async function processQueue(agentIdOrSessionId) {
|
|
210167
210174
|
try {
|
|
210168
210175
|
while (true) {
|
|
210176
|
+
while (true) {
|
|
210177
|
+
const queue2 = dumpRequestQueue.get(agentIdOrSessionId);
|
|
210178
|
+
if (!queue2 || queue2.length === 0) {
|
|
210179
|
+
break;
|
|
210180
|
+
}
|
|
210181
|
+
const callback = queue2.shift();
|
|
210182
|
+
try {
|
|
210183
|
+
await callback();
|
|
210184
|
+
} catch (err2) {
|
|
210185
|
+
logForDebugging(`dumpPrompts.processQueue: callback threw: ${err2}`, { level: "error" });
|
|
210186
|
+
}
|
|
210187
|
+
}
|
|
210169
210188
|
const queue = dumpRequestQueue.get(agentIdOrSessionId);
|
|
210170
210189
|
if (!queue || queue.length === 0) {
|
|
210171
|
-
break;
|
|
210172
|
-
}
|
|
210173
|
-
const callback = queue.shift();
|
|
210174
|
-
await callback();
|
|
210175
|
-
}
|
|
210176
|
-
} finally {
|
|
210177
|
-
const queue = dumpRequestQueue.get(agentIdOrSessionId);
|
|
210178
|
-
if (queue && queue.length > 0) {
|
|
210179
|
-
try {
|
|
210180
|
-
await processQueue(agentIdOrSessionId);
|
|
210181
|
-
} catch (err2) {
|
|
210182
|
-
logError2(`processQueue: recursive call failed for ${agentIdOrSessionId}`, err2);
|
|
210183
210190
|
dumpRequestQueue.delete(agentIdOrSessionId);
|
|
210184
210191
|
processingFlags.delete(agentIdOrSessionId);
|
|
210192
|
+
return;
|
|
210185
210193
|
}
|
|
210186
|
-
} else {
|
|
210187
|
-
dumpRequestQueue.delete(agentIdOrSessionId);
|
|
210188
|
-
processingFlags.delete(agentIdOrSessionId);
|
|
210189
210194
|
}
|
|
210195
|
+
} catch (err2) {
|
|
210196
|
+
logError2(`processQueue: failed for ${agentIdOrSessionId}`, err2);
|
|
210197
|
+
dumpRequestQueue.delete(agentIdOrSessionId);
|
|
210198
|
+
processingFlags.delete(agentIdOrSessionId);
|
|
210190
210199
|
}
|
|
210191
210200
|
}
|
|
210192
210201
|
function clearDumpState(agentIdOrSessionId) {
|
|
@@ -301159,16 +301168,19 @@ function memoizeWithTTL(fn, ttlMs) {
|
|
|
301159
301168
|
const memoized = memoize_default(fn);
|
|
301160
301169
|
const originalClear = memoized.cache.clear.bind(memoized.cache);
|
|
301161
301170
|
const refreshMutexes = new Map;
|
|
301171
|
+
const refreshMapMutex = new Mutex;
|
|
301162
301172
|
const wrapped = async (...args) => {
|
|
301163
301173
|
const now2 = Date.now();
|
|
301164
301174
|
const cacheExpired = lastCachedAt !== 0 && now2 - lastCachedAt >= ttlMs;
|
|
301165
301175
|
if (cacheExpired) {
|
|
301166
301176
|
const key2 = String(args[0] ?? "_default");
|
|
301177
|
+
const mapRelease = await refreshMapMutex.acquire();
|
|
301167
301178
|
let mutex = refreshMutexes.get(key2);
|
|
301168
301179
|
if (!mutex) {
|
|
301169
301180
|
mutex = new Mutex;
|
|
301170
301181
|
refreshMutexes.set(key2, mutex);
|
|
301171
301182
|
}
|
|
301183
|
+
mapRelease();
|
|
301172
301184
|
const release = await mutex.acquire();
|
|
301173
301185
|
try {
|
|
301174
301186
|
const now22 = Date.now();
|
|
@@ -342433,7 +342445,8 @@ async function appendSessionLogImpl(sessionId, entry, url3, headers) {
|
|
|
342433
342445
|
} else {
|
|
342434
342446
|
let logs2 = null;
|
|
342435
342447
|
try {
|
|
342436
|
-
|
|
342448
|
+
const sequentialWrapper = getOrCreateSequential(sessionId);
|
|
342449
|
+
logs2 = await sequentialWrapper(sessionId, url3, headers, true);
|
|
342437
342450
|
} catch (fetchError) {
|
|
342438
342451
|
logError2(new Error(`Session 409: fetch failed for session ${sessionId}, entry ${entry.uuid}: ${fetchError instanceof Error ? fetchError.message : String(fetchError)}`));
|
|
342439
342452
|
logForDiagnosticsNoPII("error", "session_persist_409_fetch_fail");
|
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.
|
|
8
|
-
BUILD_TIME: "2026-07-
|
|
7
|
+
VERSION: "0.1.105",
|
|
8
|
+
BUILD_TIME: "2026-07-19T17:13:00.724Z",
|
|
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 reentrantCount = 0;
|
|
38383
38384
|
async function processQueue() {
|
|
38384
38385
|
if (processing)
|
|
38385
38386
|
return;
|
|
@@ -38389,10 +38390,13 @@ function sequential(fn) {
|
|
|
38389
38390
|
while (queue.length > 0) {
|
|
38390
38391
|
const { args, resolve: resolve5, reject, context } = queue.shift();
|
|
38391
38392
|
try {
|
|
38393
|
+
reentrantCount++;
|
|
38392
38394
|
const result = await fn.apply(context, args);
|
|
38393
38395
|
resolve5(result);
|
|
38394
38396
|
} catch (error49) {
|
|
38395
38397
|
reject(error49);
|
|
38398
|
+
} finally {
|
|
38399
|
+
reentrantCount--;
|
|
38396
38400
|
}
|
|
38397
38401
|
}
|
|
38398
38402
|
processing = false;
|
|
@@ -38401,6 +38405,9 @@ function sequential(fn) {
|
|
|
38401
38405
|
}
|
|
38402
38406
|
}
|
|
38403
38407
|
return function(...args) {
|
|
38408
|
+
if (reentrantCount > 0) {
|
|
38409
|
+
return fn.apply(this, args);
|
|
38410
|
+
}
|
|
38404
38411
|
return new Promise((resolve5, reject) => {
|
|
38405
38412
|
queue.push({ args, resolve: resolve5, reject, context: this });
|
|
38406
38413
|
processQueue();
|
|
@@ -117484,7 +117491,7 @@ var package_default;
|
|
|
117484
117491
|
var init_package = __esm(() => {
|
|
117485
117492
|
package_default = {
|
|
117486
117493
|
name: "@funnycode/myclaude",
|
|
117487
|
-
version: "0.1.
|
|
117494
|
+
version: "0.1.105",
|
|
117488
117495
|
private: false,
|
|
117489
117496
|
description: "An open-source AI coding assistant in your terminal - powered by Claude",
|
|
117490
117497
|
license: "MIT",
|
|
@@ -210166,27 +210173,29 @@ function enqueueDumpRequest(agentIdOrSessionId, callback) {
|
|
|
210166
210173
|
async function processQueue(agentIdOrSessionId) {
|
|
210167
210174
|
try {
|
|
210168
210175
|
while (true) {
|
|
210176
|
+
while (true) {
|
|
210177
|
+
const queue2 = dumpRequestQueue.get(agentIdOrSessionId);
|
|
210178
|
+
if (!queue2 || queue2.length === 0) {
|
|
210179
|
+
break;
|
|
210180
|
+
}
|
|
210181
|
+
const callback = queue2.shift();
|
|
210182
|
+
try {
|
|
210183
|
+
await callback();
|
|
210184
|
+
} catch (err2) {
|
|
210185
|
+
logForDebugging(`dumpPrompts.processQueue: callback threw: ${err2}`, { level: "error" });
|
|
210186
|
+
}
|
|
210187
|
+
}
|
|
210169
210188
|
const queue = dumpRequestQueue.get(agentIdOrSessionId);
|
|
210170
210189
|
if (!queue || queue.length === 0) {
|
|
210171
|
-
break;
|
|
210172
|
-
}
|
|
210173
|
-
const callback = queue.shift();
|
|
210174
|
-
await callback();
|
|
210175
|
-
}
|
|
210176
|
-
} finally {
|
|
210177
|
-
const queue = dumpRequestQueue.get(agentIdOrSessionId);
|
|
210178
|
-
if (queue && queue.length > 0) {
|
|
210179
|
-
try {
|
|
210180
|
-
await processQueue(agentIdOrSessionId);
|
|
210181
|
-
} catch (err2) {
|
|
210182
|
-
logError2(`processQueue: recursive call failed for ${agentIdOrSessionId}`, err2);
|
|
210183
210190
|
dumpRequestQueue.delete(agentIdOrSessionId);
|
|
210184
210191
|
processingFlags.delete(agentIdOrSessionId);
|
|
210192
|
+
return;
|
|
210185
210193
|
}
|
|
210186
|
-
} else {
|
|
210187
|
-
dumpRequestQueue.delete(agentIdOrSessionId);
|
|
210188
|
-
processingFlags.delete(agentIdOrSessionId);
|
|
210189
210194
|
}
|
|
210195
|
+
} catch (err2) {
|
|
210196
|
+
logError2(`processQueue: failed for ${agentIdOrSessionId}`, err2);
|
|
210197
|
+
dumpRequestQueue.delete(agentIdOrSessionId);
|
|
210198
|
+
processingFlags.delete(agentIdOrSessionId);
|
|
210190
210199
|
}
|
|
210191
210200
|
}
|
|
210192
210201
|
function clearDumpState(agentIdOrSessionId) {
|
|
@@ -301159,16 +301168,19 @@ function memoizeWithTTL(fn, ttlMs) {
|
|
|
301159
301168
|
const memoized = memoize_default(fn);
|
|
301160
301169
|
const originalClear = memoized.cache.clear.bind(memoized.cache);
|
|
301161
301170
|
const refreshMutexes = new Map;
|
|
301171
|
+
const refreshMapMutex = new Mutex;
|
|
301162
301172
|
const wrapped = async (...args) => {
|
|
301163
301173
|
const now2 = Date.now();
|
|
301164
301174
|
const cacheExpired = lastCachedAt !== 0 && now2 - lastCachedAt >= ttlMs;
|
|
301165
301175
|
if (cacheExpired) {
|
|
301166
301176
|
const key2 = String(args[0] ?? "_default");
|
|
301177
|
+
const mapRelease = await refreshMapMutex.acquire();
|
|
301167
301178
|
let mutex = refreshMutexes.get(key2);
|
|
301168
301179
|
if (!mutex) {
|
|
301169
301180
|
mutex = new Mutex;
|
|
301170
301181
|
refreshMutexes.set(key2, mutex);
|
|
301171
301182
|
}
|
|
301183
|
+
mapRelease();
|
|
301172
301184
|
const release = await mutex.acquire();
|
|
301173
301185
|
try {
|
|
301174
301186
|
const now22 = Date.now();
|
|
@@ -342433,7 +342445,8 @@ async function appendSessionLogImpl(sessionId, entry, url3, headers) {
|
|
|
342433
342445
|
} else {
|
|
342434
342446
|
let logs2 = null;
|
|
342435
342447
|
try {
|
|
342436
|
-
|
|
342448
|
+
const sequentialWrapper = getOrCreateSequential(sessionId);
|
|
342449
|
+
logs2 = await sequentialWrapper(sessionId, url3, headers, true);
|
|
342437
342450
|
} catch (fetchError) {
|
|
342438
342451
|
logError2(new Error(`Session 409: fetch failed for session ${sessionId}, entry ${entry.uuid}: ${fetchError instanceof Error ? fetchError.message : String(fetchError)}`));
|
|
342439
342452
|
logForDiagnosticsNoPII("error", "session_persist_409_fetch_fail");
|