@funnycode/myclaude 0.1.105 → 0.1.107
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 +86 -28
- package/dist/myclaude.mjs +86 -28
- 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.107",
|
|
8
|
+
BUILD_TIME: "2026-07-19T21:12:38.783Z",
|
|
9
9
|
PACKAGE_URL: "@funnycode/myclaude",
|
|
10
10
|
NATIVE_PACKAGE_URL: "@funnycode/myclaude",
|
|
11
11
|
VERSION_CHANGELOG: '',
|
|
@@ -117491,7 +117491,7 @@ var package_default;
|
|
|
117491
117491
|
var init_package = __esm(() => {
|
|
117492
117492
|
package_default = {
|
|
117493
117493
|
name: "@funnycode/myclaude",
|
|
117494
|
-
version: "0.1.
|
|
117494
|
+
version: "0.1.107",
|
|
117495
117495
|
private: false,
|
|
117496
117496
|
description: "An open-source AI coding assistant in your terminal - powered by Claude",
|
|
117497
117497
|
license: "MIT",
|
|
@@ -210330,9 +210330,56 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
|
|
|
210330
210330
|
bufferChunks.push(decoded);
|
|
210331
210331
|
bufferLength += decoded.length;
|
|
210332
210332
|
if (bufferLength > MAX_BUFFER_SIZE2) {
|
|
210333
|
-
logForDebugging("dumpPrompts: buffer exceeded max size,
|
|
210334
|
-
|
|
210335
|
-
|
|
210333
|
+
logForDebugging("dumpPrompts: buffer exceeded max size, extracting complete events", { level: "warn" });
|
|
210334
|
+
const fullBuffer = bufferChunks.join("");
|
|
210335
|
+
const lastDoubleNewline2 = fullBuffer.lastIndexOf(`
|
|
210336
|
+
|
|
210337
|
+
`);
|
|
210338
|
+
if (lastDoubleNewline2 !== -1) {
|
|
210339
|
+
const completeEvents = fullBuffer.slice(0, lastDoubleNewline2);
|
|
210340
|
+
const incomplete = fullBuffer.slice(lastDoubleNewline2 + 2);
|
|
210341
|
+
for (const event of completeEvents.split(`
|
|
210342
|
+
|
|
210343
|
+
`)) {
|
|
210344
|
+
let dataLines = [];
|
|
210345
|
+
for (const line of event.split(`
|
|
210346
|
+
`)) {
|
|
210347
|
+
if (line.startsWith("data: ") && line !== "data: [DONE]") {
|
|
210348
|
+
dataLines.push(line.slice(6));
|
|
210349
|
+
}
|
|
210350
|
+
}
|
|
210351
|
+
if (dataLines.length > 0) {
|
|
210352
|
+
try {
|
|
210353
|
+
const chunk = jsonParse(dataLines.join(`
|
|
210354
|
+
`));
|
|
210355
|
+
chunkEntries.push(jsonStringify({ type: "chunk", timestamp, data: chunk }));
|
|
210356
|
+
if (chunkEntries.length >= 50) {
|
|
210357
|
+
await appendToFile(filePath, chunkEntries);
|
|
210358
|
+
chunkEntries.length = 0;
|
|
210359
|
+
}
|
|
210360
|
+
} catch (err2) {
|
|
210361
|
+
logForDebugging(`dumpPrompts.SSE parse error: ${err2}`, { level: "error" });
|
|
210362
|
+
}
|
|
210363
|
+
}
|
|
210364
|
+
}
|
|
210365
|
+
bufferChunks.length = 0;
|
|
210366
|
+
bufferChunks.push(incomplete);
|
|
210367
|
+
bufferLength = incomplete.length;
|
|
210368
|
+
if (bufferLength > MAX_BUFFER_SIZE2) {
|
|
210369
|
+
logForDebugging("dumpPrompts: incomplete buffer still exceeds max size, truncating", { level: "warn" });
|
|
210370
|
+
const truncated = incomplete.slice(-MAX_BUFFER_SIZE2);
|
|
210371
|
+
bufferChunks.length = 0;
|
|
210372
|
+
bufferChunks.push(truncated);
|
|
210373
|
+
bufferLength = truncated.length;
|
|
210374
|
+
}
|
|
210375
|
+
} else {
|
|
210376
|
+
logForDebugging("dumpPrompts: no complete events, truncating buffer", { level: "warn" });
|
|
210377
|
+
const fullBuffer2 = bufferChunks.join("");
|
|
210378
|
+
const truncated = fullBuffer2.slice(-MAX_BUFFER_SIZE2);
|
|
210379
|
+
bufferChunks.length = 0;
|
|
210380
|
+
bufferChunks.push(truncated);
|
|
210381
|
+
bufferLength = truncated.length;
|
|
210382
|
+
}
|
|
210336
210383
|
continue;
|
|
210337
210384
|
}
|
|
210338
210385
|
const buffer2 = bufferChunks.join("");
|
|
@@ -210348,19 +210395,24 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
|
|
|
210348
210395
|
for (const event of completeEvents.split(`
|
|
210349
210396
|
|
|
210350
210397
|
`)) {
|
|
210398
|
+
let dataLines = [];
|
|
210351
210399
|
for (const line of event.split(`
|
|
210352
210400
|
`)) {
|
|
210353
210401
|
if (line.startsWith("data: ") && line !== "data: [DONE]") {
|
|
210354
|
-
|
|
210355
|
-
|
|
210356
|
-
|
|
210357
|
-
|
|
210358
|
-
|
|
210359
|
-
|
|
210360
|
-
|
|
210361
|
-
|
|
210362
|
-
|
|
210402
|
+
dataLines.push(line.slice(6));
|
|
210403
|
+
}
|
|
210404
|
+
}
|
|
210405
|
+
if (dataLines.length > 0) {
|
|
210406
|
+
try {
|
|
210407
|
+
const chunk = jsonParse(dataLines.join(`
|
|
210408
|
+
`));
|
|
210409
|
+
chunkEntries.push(jsonStringify({ type: "chunk", timestamp, data: chunk }));
|
|
210410
|
+
if (chunkEntries.length >= 50) {
|
|
210411
|
+
await appendToFile(filePath, chunkEntries);
|
|
210412
|
+
chunkEntries.length = 0;
|
|
210363
210413
|
}
|
|
210414
|
+
} catch (err2) {
|
|
210415
|
+
logForDebugging(`dumpPrompts.SSE parse error: ${err2}`, { level: "error" });
|
|
210364
210416
|
}
|
|
210365
210417
|
}
|
|
210366
210418
|
}
|
|
@@ -210374,15 +210426,20 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
|
|
|
210374
210426
|
for (const event of buffer.split(`
|
|
210375
210427
|
|
|
210376
210428
|
`)) {
|
|
210429
|
+
let dataLines = [];
|
|
210377
210430
|
for (const line of event.split(`
|
|
210378
210431
|
`)) {
|
|
210379
210432
|
if (line.startsWith("data: ") && line !== "data: [DONE]") {
|
|
210380
|
-
|
|
210381
|
-
|
|
210382
|
-
|
|
210383
|
-
|
|
210384
|
-
|
|
210385
|
-
|
|
210433
|
+
dataLines.push(line.slice(6));
|
|
210434
|
+
}
|
|
210435
|
+
}
|
|
210436
|
+
if (dataLines.length > 0) {
|
|
210437
|
+
try {
|
|
210438
|
+
const chunk = jsonParse(dataLines.join(`
|
|
210439
|
+
`));
|
|
210440
|
+
chunkEntries.push(jsonStringify({ type: "chunk", timestamp, data: chunk }));
|
|
210441
|
+
} catch (err2) {
|
|
210442
|
+
logForDebugging(`dumpPrompts.SSE parse error: ${err2}`, { level: "error" });
|
|
210386
210443
|
}
|
|
210387
210444
|
}
|
|
210388
210445
|
}
|
|
@@ -210390,13 +210447,12 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
|
|
|
210390
210447
|
if (chunkEntries.length > 0) {
|
|
210391
210448
|
await appendToFile(filePath, chunkEntries);
|
|
210392
210449
|
}
|
|
210393
|
-
data = { stream: true, chunks: [] };
|
|
210394
210450
|
} else {
|
|
210395
210451
|
data = await cloned.json();
|
|
210452
|
+
await appendToFile(filePath, [
|
|
210453
|
+
jsonStringify({ type: "response", timestamp, data })
|
|
210454
|
+
]);
|
|
210396
210455
|
}
|
|
210397
|
-
await appendToFile(filePath, [
|
|
210398
|
-
jsonStringify({ type: "response", timestamp, data })
|
|
210399
|
-
]);
|
|
210400
210456
|
} catch (err2) {
|
|
210401
210457
|
logError2(`dumpPrompts.response handler error: ${err2}`);
|
|
210402
210458
|
}
|
|
@@ -301207,9 +301263,12 @@ function memoizeWithTTL(fn, ttlMs) {
|
|
|
301207
301263
|
const result = await memoized(...args);
|
|
301208
301264
|
if (result && typeof result === "object" && "success" in result && result.success === true) {
|
|
301209
301265
|
lastCachedAt = Date.now();
|
|
301210
|
-
} else if (result && typeof result === "object" && "success" in result && result.success === false) {
|
|
301266
|
+
} else if (result && typeof result === "object" && "success" in result && result.success === false) {
|
|
301267
|
+
lastCachedAt = Date.now();
|
|
301268
|
+
}
|
|
301211
301269
|
return result;
|
|
301212
301270
|
} catch (error49) {
|
|
301271
|
+
lastCachedAt = Date.now();
|
|
301213
301272
|
return { success: false };
|
|
301214
301273
|
}
|
|
301215
301274
|
};
|
|
@@ -342445,8 +342504,7 @@ async function appendSessionLogImpl(sessionId, entry, url3, headers) {
|
|
|
342445
342504
|
} else {
|
|
342446
342505
|
let logs2 = null;
|
|
342447
342506
|
try {
|
|
342448
|
-
|
|
342449
|
-
logs2 = await sequentialWrapper(sessionId, url3, headers, true);
|
|
342507
|
+
logs2 = await fetchSessionLogsFromUrl(sessionId, url3, headers);
|
|
342450
342508
|
} catch (fetchError) {
|
|
342451
342509
|
logError2(new Error(`Session 409: fetch failed for session ${sessionId}, entry ${entry.uuid}: ${fetchError instanceof Error ? fetchError.message : String(fetchError)}`));
|
|
342452
342510
|
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.107",
|
|
8
|
+
BUILD_TIME: "2026-07-19T21:12:38.783Z",
|
|
9
9
|
PACKAGE_URL: "@funnycode/myclaude",
|
|
10
10
|
NATIVE_PACKAGE_URL: "@funnycode/myclaude",
|
|
11
11
|
VERSION_CHANGELOG: '',
|
|
@@ -117491,7 +117491,7 @@ var package_default;
|
|
|
117491
117491
|
var init_package = __esm(() => {
|
|
117492
117492
|
package_default = {
|
|
117493
117493
|
name: "@funnycode/myclaude",
|
|
117494
|
-
version: "0.1.
|
|
117494
|
+
version: "0.1.107",
|
|
117495
117495
|
private: false,
|
|
117496
117496
|
description: "An open-source AI coding assistant in your terminal - powered by Claude",
|
|
117497
117497
|
license: "MIT",
|
|
@@ -210330,9 +210330,56 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
|
|
|
210330
210330
|
bufferChunks.push(decoded);
|
|
210331
210331
|
bufferLength += decoded.length;
|
|
210332
210332
|
if (bufferLength > MAX_BUFFER_SIZE2) {
|
|
210333
|
-
logForDebugging("dumpPrompts: buffer exceeded max size,
|
|
210334
|
-
|
|
210335
|
-
|
|
210333
|
+
logForDebugging("dumpPrompts: buffer exceeded max size, extracting complete events", { level: "warn" });
|
|
210334
|
+
const fullBuffer = bufferChunks.join("");
|
|
210335
|
+
const lastDoubleNewline2 = fullBuffer.lastIndexOf(`
|
|
210336
|
+
|
|
210337
|
+
`);
|
|
210338
|
+
if (lastDoubleNewline2 !== -1) {
|
|
210339
|
+
const completeEvents = fullBuffer.slice(0, lastDoubleNewline2);
|
|
210340
|
+
const incomplete = fullBuffer.slice(lastDoubleNewline2 + 2);
|
|
210341
|
+
for (const event of completeEvents.split(`
|
|
210342
|
+
|
|
210343
|
+
`)) {
|
|
210344
|
+
let dataLines = [];
|
|
210345
|
+
for (const line of event.split(`
|
|
210346
|
+
`)) {
|
|
210347
|
+
if (line.startsWith("data: ") && line !== "data: [DONE]") {
|
|
210348
|
+
dataLines.push(line.slice(6));
|
|
210349
|
+
}
|
|
210350
|
+
}
|
|
210351
|
+
if (dataLines.length > 0) {
|
|
210352
|
+
try {
|
|
210353
|
+
const chunk = jsonParse(dataLines.join(`
|
|
210354
|
+
`));
|
|
210355
|
+
chunkEntries.push(jsonStringify({ type: "chunk", timestamp, data: chunk }));
|
|
210356
|
+
if (chunkEntries.length >= 50) {
|
|
210357
|
+
await appendToFile(filePath, chunkEntries);
|
|
210358
|
+
chunkEntries.length = 0;
|
|
210359
|
+
}
|
|
210360
|
+
} catch (err2) {
|
|
210361
|
+
logForDebugging(`dumpPrompts.SSE parse error: ${err2}`, { level: "error" });
|
|
210362
|
+
}
|
|
210363
|
+
}
|
|
210364
|
+
}
|
|
210365
|
+
bufferChunks.length = 0;
|
|
210366
|
+
bufferChunks.push(incomplete);
|
|
210367
|
+
bufferLength = incomplete.length;
|
|
210368
|
+
if (bufferLength > MAX_BUFFER_SIZE2) {
|
|
210369
|
+
logForDebugging("dumpPrompts: incomplete buffer still exceeds max size, truncating", { level: "warn" });
|
|
210370
|
+
const truncated = incomplete.slice(-MAX_BUFFER_SIZE2);
|
|
210371
|
+
bufferChunks.length = 0;
|
|
210372
|
+
bufferChunks.push(truncated);
|
|
210373
|
+
bufferLength = truncated.length;
|
|
210374
|
+
}
|
|
210375
|
+
} else {
|
|
210376
|
+
logForDebugging("dumpPrompts: no complete events, truncating buffer", { level: "warn" });
|
|
210377
|
+
const fullBuffer2 = bufferChunks.join("");
|
|
210378
|
+
const truncated = fullBuffer2.slice(-MAX_BUFFER_SIZE2);
|
|
210379
|
+
bufferChunks.length = 0;
|
|
210380
|
+
bufferChunks.push(truncated);
|
|
210381
|
+
bufferLength = truncated.length;
|
|
210382
|
+
}
|
|
210336
210383
|
continue;
|
|
210337
210384
|
}
|
|
210338
210385
|
const buffer2 = bufferChunks.join("");
|
|
@@ -210348,19 +210395,24 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
|
|
|
210348
210395
|
for (const event of completeEvents.split(`
|
|
210349
210396
|
|
|
210350
210397
|
`)) {
|
|
210398
|
+
let dataLines = [];
|
|
210351
210399
|
for (const line of event.split(`
|
|
210352
210400
|
`)) {
|
|
210353
210401
|
if (line.startsWith("data: ") && line !== "data: [DONE]") {
|
|
210354
|
-
|
|
210355
|
-
|
|
210356
|
-
|
|
210357
|
-
|
|
210358
|
-
|
|
210359
|
-
|
|
210360
|
-
|
|
210361
|
-
|
|
210362
|
-
|
|
210402
|
+
dataLines.push(line.slice(6));
|
|
210403
|
+
}
|
|
210404
|
+
}
|
|
210405
|
+
if (dataLines.length > 0) {
|
|
210406
|
+
try {
|
|
210407
|
+
const chunk = jsonParse(dataLines.join(`
|
|
210408
|
+
`));
|
|
210409
|
+
chunkEntries.push(jsonStringify({ type: "chunk", timestamp, data: chunk }));
|
|
210410
|
+
if (chunkEntries.length >= 50) {
|
|
210411
|
+
await appendToFile(filePath, chunkEntries);
|
|
210412
|
+
chunkEntries.length = 0;
|
|
210363
210413
|
}
|
|
210414
|
+
} catch (err2) {
|
|
210415
|
+
logForDebugging(`dumpPrompts.SSE parse error: ${err2}`, { level: "error" });
|
|
210364
210416
|
}
|
|
210365
210417
|
}
|
|
210366
210418
|
}
|
|
@@ -210374,15 +210426,20 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
|
|
|
210374
210426
|
for (const event of buffer.split(`
|
|
210375
210427
|
|
|
210376
210428
|
`)) {
|
|
210429
|
+
let dataLines = [];
|
|
210377
210430
|
for (const line of event.split(`
|
|
210378
210431
|
`)) {
|
|
210379
210432
|
if (line.startsWith("data: ") && line !== "data: [DONE]") {
|
|
210380
|
-
|
|
210381
|
-
|
|
210382
|
-
|
|
210383
|
-
|
|
210384
|
-
|
|
210385
|
-
|
|
210433
|
+
dataLines.push(line.slice(6));
|
|
210434
|
+
}
|
|
210435
|
+
}
|
|
210436
|
+
if (dataLines.length > 0) {
|
|
210437
|
+
try {
|
|
210438
|
+
const chunk = jsonParse(dataLines.join(`
|
|
210439
|
+
`));
|
|
210440
|
+
chunkEntries.push(jsonStringify({ type: "chunk", timestamp, data: chunk }));
|
|
210441
|
+
} catch (err2) {
|
|
210442
|
+
logForDebugging(`dumpPrompts.SSE parse error: ${err2}`, { level: "error" });
|
|
210386
210443
|
}
|
|
210387
210444
|
}
|
|
210388
210445
|
}
|
|
@@ -210390,13 +210447,12 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
|
|
|
210390
210447
|
if (chunkEntries.length > 0) {
|
|
210391
210448
|
await appendToFile(filePath, chunkEntries);
|
|
210392
210449
|
}
|
|
210393
|
-
data = { stream: true, chunks: [] };
|
|
210394
210450
|
} else {
|
|
210395
210451
|
data = await cloned.json();
|
|
210452
|
+
await appendToFile(filePath, [
|
|
210453
|
+
jsonStringify({ type: "response", timestamp, data })
|
|
210454
|
+
]);
|
|
210396
210455
|
}
|
|
210397
|
-
await appendToFile(filePath, [
|
|
210398
|
-
jsonStringify({ type: "response", timestamp, data })
|
|
210399
|
-
]);
|
|
210400
210456
|
} catch (err2) {
|
|
210401
210457
|
logError2(`dumpPrompts.response handler error: ${err2}`);
|
|
210402
210458
|
}
|
|
@@ -301207,9 +301263,12 @@ function memoizeWithTTL(fn, ttlMs) {
|
|
|
301207
301263
|
const result = await memoized(...args);
|
|
301208
301264
|
if (result && typeof result === "object" && "success" in result && result.success === true) {
|
|
301209
301265
|
lastCachedAt = Date.now();
|
|
301210
|
-
} else if (result && typeof result === "object" && "success" in result && result.success === false) {
|
|
301266
|
+
} else if (result && typeof result === "object" && "success" in result && result.success === false) {
|
|
301267
|
+
lastCachedAt = Date.now();
|
|
301268
|
+
}
|
|
301211
301269
|
return result;
|
|
301212
301270
|
} catch (error49) {
|
|
301271
|
+
lastCachedAt = Date.now();
|
|
301213
301272
|
return { success: false };
|
|
301214
301273
|
}
|
|
301215
301274
|
};
|
|
@@ -342445,8 +342504,7 @@ async function appendSessionLogImpl(sessionId, entry, url3, headers) {
|
|
|
342445
342504
|
} else {
|
|
342446
342505
|
let logs2 = null;
|
|
342447
342506
|
try {
|
|
342448
|
-
|
|
342449
|
-
logs2 = await sequentialWrapper(sessionId, url3, headers, true);
|
|
342507
|
+
logs2 = await fetchSessionLogsFromUrl(sessionId, url3, headers);
|
|
342450
342508
|
} catch (fetchError) {
|
|
342451
342509
|
logError2(new Error(`Session 409: fetch failed for session ${sessionId}, entry ${entry.uuid}: ${fetchError instanceof Error ? fetchError.message : String(fetchError)}`));
|
|
342452
342510
|
logForDiagnosticsNoPII("error", "session_persist_409_fetch_fail");
|