@funnycode/myclaude 0.1.101 → 0.1.103
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 +47 -15
- package/dist/myclaude.mjs +47 -15
- 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.103",
|
|
8
|
+
BUILD_TIME: "2026-07-19T11:40:36.817Z",
|
|
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.
|
|
117487
|
+
version: "0.1.103",
|
|
117488
117488
|
private: false,
|
|
117489
117489
|
description: "An open-source AI coding assistant in your terminal - powered by Claude",
|
|
117490
117490
|
license: "MIT",
|
|
@@ -210174,13 +210174,18 @@ async function processQueue(agentIdOrSessionId) {
|
|
|
210174
210174
|
await callback();
|
|
210175
210175
|
}
|
|
210176
210176
|
} finally {
|
|
210177
|
-
processingFlags.delete(agentIdOrSessionId);
|
|
210178
210177
|
const queue = dumpRequestQueue.get(agentIdOrSessionId);
|
|
210179
210178
|
if (queue && queue.length > 0) {
|
|
210180
|
-
|
|
210181
|
-
|
|
210179
|
+
try {
|
|
210180
|
+
await processQueue(agentIdOrSessionId);
|
|
210181
|
+
} catch (err2) {
|
|
210182
|
+
logError2(`processQueue: recursive call failed for ${agentIdOrSessionId}`, err2);
|
|
210183
|
+
dumpRequestQueue.delete(agentIdOrSessionId);
|
|
210184
|
+
processingFlags.delete(agentIdOrSessionId);
|
|
210185
|
+
}
|
|
210182
210186
|
} else {
|
|
210183
210187
|
dumpRequestQueue.delete(agentIdOrSessionId);
|
|
210188
|
+
processingFlags.delete(agentIdOrSessionId);
|
|
210184
210189
|
}
|
|
210185
210190
|
}
|
|
210186
210191
|
}
|
|
@@ -210286,10 +210291,12 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
|
|
|
210286
210291
|
dumpState.set(agentIdOrSessionId, state);
|
|
210287
210292
|
let timestamp;
|
|
210288
210293
|
if (init2?.method === "POST" && init2.body) {
|
|
210289
|
-
|
|
210290
|
-
|
|
210291
|
-
|
|
210292
|
-
|
|
210294
|
+
if (process.env.USER_TYPE === "ant") {
|
|
210295
|
+
timestamp = new Date().toISOString();
|
|
210296
|
+
enqueueDumpRequest(agentIdOrSessionId, async () => {
|
|
210297
|
+
await dumpRequest(init2.body, timestamp, state, filePath);
|
|
210298
|
+
});
|
|
210299
|
+
}
|
|
210293
210300
|
}
|
|
210294
210301
|
const response = await globalThis.fetch(input, init2);
|
|
210295
210302
|
if (timestamp && response.ok && true && process.env.USER_TYPE === "ant" && process.env.DUMP_PROMPTS === "1") {
|
|
@@ -210301,20 +210308,34 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
|
|
|
210301
210308
|
if (isStreaming && cloned.body) {
|
|
210302
210309
|
const reader = cloned.body.getReader();
|
|
210303
210310
|
const decoder = new TextDecoder;
|
|
210304
|
-
|
|
210311
|
+
const bufferChunks = [];
|
|
210312
|
+
let bufferLength = 0;
|
|
210313
|
+
const MAX_BUFFER_SIZE2 = 10 * 1024 * 1024;
|
|
210305
210314
|
const chunkEntries = [];
|
|
210306
210315
|
try {
|
|
210307
210316
|
while (true) {
|
|
210308
210317
|
const { done, value } = await reader.read();
|
|
210309
210318
|
if (done)
|
|
210310
210319
|
break;
|
|
210311
|
-
|
|
210312
|
-
|
|
210320
|
+
const decoded = decoder.decode(value, { stream: true });
|
|
210321
|
+
bufferChunks.push(decoded);
|
|
210322
|
+
bufferLength += decoded.length;
|
|
210323
|
+
if (bufferLength > MAX_BUFFER_SIZE2) {
|
|
210324
|
+
logForDebugging("dumpPrompts: buffer exceeded max size, skipping event", { level: "warn" });
|
|
210325
|
+
bufferChunks.length = 0;
|
|
210326
|
+
bufferLength = 0;
|
|
210327
|
+
continue;
|
|
210328
|
+
}
|
|
210329
|
+
const buffer2 = bufferChunks.join("");
|
|
210330
|
+
const lastDoubleNewline = buffer2.lastIndexOf(`
|
|
210313
210331
|
|
|
210314
210332
|
`);
|
|
210315
210333
|
if (lastDoubleNewline !== -1) {
|
|
210316
|
-
const completeEvents =
|
|
210317
|
-
|
|
210334
|
+
const completeEvents = buffer2.slice(0, lastDoubleNewline);
|
|
210335
|
+
const incomplete = buffer2.slice(lastDoubleNewline + 2);
|
|
210336
|
+
bufferChunks.length = 0;
|
|
210337
|
+
bufferChunks.push(incomplete);
|
|
210338
|
+
bufferLength = incomplete.length;
|
|
210318
210339
|
for (const event of completeEvents.split(`
|
|
210319
210340
|
|
|
210320
210341
|
`)) {
|
|
@@ -210339,6 +210360,7 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
|
|
|
210339
210360
|
} finally {
|
|
210340
210361
|
reader.releaseLock();
|
|
210341
210362
|
}
|
|
210363
|
+
const buffer = bufferChunks.join("");
|
|
210342
210364
|
if (buffer.trim()) {
|
|
210343
210365
|
for (const event of buffer.split(`
|
|
210344
210366
|
|
|
@@ -342433,6 +342455,16 @@ async function appendSessionLogImpl(sessionId, entry, url3, headers) {
|
|
|
342433
342455
|
logForDiagnosticsNoPII("error", "session_persist_fail_bad_token");
|
|
342434
342456
|
return false;
|
|
342435
342457
|
}
|
|
342458
|
+
if (response.status === 403) {
|
|
342459
|
+
logForDebugging("Forbidden - session token lacks permission");
|
|
342460
|
+
logForDiagnosticsNoPII("error", "session_persist_fail_forbidden");
|
|
342461
|
+
return false;
|
|
342462
|
+
}
|
|
342463
|
+
if (response.status === 404) {
|
|
342464
|
+
logForDebugging("Session not found");
|
|
342465
|
+
logForDiagnosticsNoPII("error", "session_persist_fail_not_found");
|
|
342466
|
+
return false;
|
|
342467
|
+
}
|
|
342436
342468
|
logForDebugging(`Failed to persist session log: ${response.status} ${response.statusText}`);
|
|
342437
342469
|
logForDiagnosticsNoPII("error", "session_persist_fail_status", {
|
|
342438
342470
|
status: response.status,
|
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.103",
|
|
8
|
+
BUILD_TIME: "2026-07-19T11:40:36.817Z",
|
|
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.
|
|
117487
|
+
version: "0.1.103",
|
|
117488
117488
|
private: false,
|
|
117489
117489
|
description: "An open-source AI coding assistant in your terminal - powered by Claude",
|
|
117490
117490
|
license: "MIT",
|
|
@@ -210174,13 +210174,18 @@ async function processQueue(agentIdOrSessionId) {
|
|
|
210174
210174
|
await callback();
|
|
210175
210175
|
}
|
|
210176
210176
|
} finally {
|
|
210177
|
-
processingFlags.delete(agentIdOrSessionId);
|
|
210178
210177
|
const queue = dumpRequestQueue.get(agentIdOrSessionId);
|
|
210179
210178
|
if (queue && queue.length > 0) {
|
|
210180
|
-
|
|
210181
|
-
|
|
210179
|
+
try {
|
|
210180
|
+
await processQueue(agentIdOrSessionId);
|
|
210181
|
+
} catch (err2) {
|
|
210182
|
+
logError2(`processQueue: recursive call failed for ${agentIdOrSessionId}`, err2);
|
|
210183
|
+
dumpRequestQueue.delete(agentIdOrSessionId);
|
|
210184
|
+
processingFlags.delete(agentIdOrSessionId);
|
|
210185
|
+
}
|
|
210182
210186
|
} else {
|
|
210183
210187
|
dumpRequestQueue.delete(agentIdOrSessionId);
|
|
210188
|
+
processingFlags.delete(agentIdOrSessionId);
|
|
210184
210189
|
}
|
|
210185
210190
|
}
|
|
210186
210191
|
}
|
|
@@ -210286,10 +210291,12 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
|
|
|
210286
210291
|
dumpState.set(agentIdOrSessionId, state);
|
|
210287
210292
|
let timestamp;
|
|
210288
210293
|
if (init2?.method === "POST" && init2.body) {
|
|
210289
|
-
|
|
210290
|
-
|
|
210291
|
-
|
|
210292
|
-
|
|
210294
|
+
if (process.env.USER_TYPE === "ant") {
|
|
210295
|
+
timestamp = new Date().toISOString();
|
|
210296
|
+
enqueueDumpRequest(agentIdOrSessionId, async () => {
|
|
210297
|
+
await dumpRequest(init2.body, timestamp, state, filePath);
|
|
210298
|
+
});
|
|
210299
|
+
}
|
|
210293
210300
|
}
|
|
210294
210301
|
const response = await globalThis.fetch(input, init2);
|
|
210295
210302
|
if (timestamp && response.ok && true && process.env.USER_TYPE === "ant" && process.env.DUMP_PROMPTS === "1") {
|
|
@@ -210301,20 +210308,34 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
|
|
|
210301
210308
|
if (isStreaming && cloned.body) {
|
|
210302
210309
|
const reader = cloned.body.getReader();
|
|
210303
210310
|
const decoder = new TextDecoder;
|
|
210304
|
-
|
|
210311
|
+
const bufferChunks = [];
|
|
210312
|
+
let bufferLength = 0;
|
|
210313
|
+
const MAX_BUFFER_SIZE2 = 10 * 1024 * 1024;
|
|
210305
210314
|
const chunkEntries = [];
|
|
210306
210315
|
try {
|
|
210307
210316
|
while (true) {
|
|
210308
210317
|
const { done, value } = await reader.read();
|
|
210309
210318
|
if (done)
|
|
210310
210319
|
break;
|
|
210311
|
-
|
|
210312
|
-
|
|
210320
|
+
const decoded = decoder.decode(value, { stream: true });
|
|
210321
|
+
bufferChunks.push(decoded);
|
|
210322
|
+
bufferLength += decoded.length;
|
|
210323
|
+
if (bufferLength > MAX_BUFFER_SIZE2) {
|
|
210324
|
+
logForDebugging("dumpPrompts: buffer exceeded max size, skipping event", { level: "warn" });
|
|
210325
|
+
bufferChunks.length = 0;
|
|
210326
|
+
bufferLength = 0;
|
|
210327
|
+
continue;
|
|
210328
|
+
}
|
|
210329
|
+
const buffer2 = bufferChunks.join("");
|
|
210330
|
+
const lastDoubleNewline = buffer2.lastIndexOf(`
|
|
210313
210331
|
|
|
210314
210332
|
`);
|
|
210315
210333
|
if (lastDoubleNewline !== -1) {
|
|
210316
|
-
const completeEvents =
|
|
210317
|
-
|
|
210334
|
+
const completeEvents = buffer2.slice(0, lastDoubleNewline);
|
|
210335
|
+
const incomplete = buffer2.slice(lastDoubleNewline + 2);
|
|
210336
|
+
bufferChunks.length = 0;
|
|
210337
|
+
bufferChunks.push(incomplete);
|
|
210338
|
+
bufferLength = incomplete.length;
|
|
210318
210339
|
for (const event of completeEvents.split(`
|
|
210319
210340
|
|
|
210320
210341
|
`)) {
|
|
@@ -210339,6 +210360,7 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
|
|
|
210339
210360
|
} finally {
|
|
210340
210361
|
reader.releaseLock();
|
|
210341
210362
|
}
|
|
210363
|
+
const buffer = bufferChunks.join("");
|
|
210342
210364
|
if (buffer.trim()) {
|
|
210343
210365
|
for (const event of buffer.split(`
|
|
210344
210366
|
|
|
@@ -342433,6 +342455,16 @@ async function appendSessionLogImpl(sessionId, entry, url3, headers) {
|
|
|
342433
342455
|
logForDiagnosticsNoPII("error", "session_persist_fail_bad_token");
|
|
342434
342456
|
return false;
|
|
342435
342457
|
}
|
|
342458
|
+
if (response.status === 403) {
|
|
342459
|
+
logForDebugging("Forbidden - session token lacks permission");
|
|
342460
|
+
logForDiagnosticsNoPII("error", "session_persist_fail_forbidden");
|
|
342461
|
+
return false;
|
|
342462
|
+
}
|
|
342463
|
+
if (response.status === 404) {
|
|
342464
|
+
logForDebugging("Session not found");
|
|
342465
|
+
logForDiagnosticsNoPII("error", "session_persist_fail_not_found");
|
|
342466
|
+
return false;
|
|
342467
|
+
}
|
|
342436
342468
|
logForDebugging(`Failed to persist session log: ${response.status} ${response.statusText}`);
|
|
342437
342469
|
logForDiagnosticsNoPII("error", "session_persist_fail_status", {
|
|
342438
342470
|
status: response.status,
|