@funnycode/myclaude 0.1.118 → 0.1.120
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 +56 -53
- package/dist/myclaude.mjs +56 -53
- 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.120",
|
|
8
|
+
BUILD_TIME: "2026-07-22T22:27:16.931Z",
|
|
9
9
|
PACKAGE_URL: "@funnycode/myclaude",
|
|
10
10
|
NATIVE_PACKAGE_URL: "@funnycode/myclaude",
|
|
11
11
|
VERSION_CHANGELOG: '',
|
|
@@ -117790,7 +117790,7 @@ var package_default;
|
|
|
117790
117790
|
var init_package = __esm(() => {
|
|
117791
117791
|
package_default = {
|
|
117792
117792
|
name: "@funnycode/myclaude",
|
|
117793
|
-
version: "0.1.
|
|
117793
|
+
version: "0.1.120",
|
|
117794
117794
|
private: false,
|
|
117795
117795
|
description: "An open-source AI coding assistant in your terminal - powered by Claude",
|
|
117796
117796
|
license: "MIT",
|
|
@@ -210450,37 +210450,27 @@ function enqueueDumpRequest(agentIdOrSessionId, callback) {
|
|
|
210450
210450
|
dumpRequestQueue.set(agentIdOrSessionId, []);
|
|
210451
210451
|
}
|
|
210452
210452
|
dumpRequestQueue.get(agentIdOrSessionId).push(callback);
|
|
210453
|
-
if (!
|
|
210454
|
-
|
|
210455
|
-
processQueue(agentIdOrSessionId);
|
|
210456
|
-
}
|
|
210457
|
-
}
|
|
210458
|
-
async function processQueue(agentIdOrSessionId) {
|
|
210459
|
-
try {
|
|
210460
|
-
while (true) {
|
|
210453
|
+
if (!processingPromises.has(agentIdOrSessionId)) {
|
|
210454
|
+
const promise2 = (async () => {
|
|
210461
210455
|
while (true) {
|
|
210462
|
-
const
|
|
210463
|
-
if (!
|
|
210456
|
+
const queue = dumpRequestQueue.get(agentIdOrSessionId);
|
|
210457
|
+
if (!queue || queue.length === 0) {
|
|
210464
210458
|
break;
|
|
210465
210459
|
}
|
|
210466
|
-
const
|
|
210460
|
+
const cb = queue.shift();
|
|
210467
210461
|
try {
|
|
210468
|
-
await
|
|
210462
|
+
await cb();
|
|
210469
210463
|
} catch (err2) {
|
|
210470
210464
|
logForDebugging(`dumpPrompts.processQueue: callback threw: ${err2}`, { level: "error" });
|
|
210471
210465
|
}
|
|
210472
210466
|
}
|
|
210473
|
-
|
|
210474
|
-
|
|
210475
|
-
|
|
210476
|
-
|
|
210477
|
-
|
|
210478
|
-
|
|
210479
|
-
|
|
210480
|
-
} catch (err2) {
|
|
210481
|
-
logError2(`processQueue: failed for ${agentIdOrSessionId}`, err2);
|
|
210482
|
-
dumpRequestQueue.delete(agentIdOrSessionId);
|
|
210483
|
-
processingFlags.delete(agentIdOrSessionId);
|
|
210467
|
+
})().catch((err2) => {
|
|
210468
|
+
logError2(`processQueue: failed for ${agentIdOrSessionId}`, err2);
|
|
210469
|
+
dumpRequestQueue.delete(agentIdOrSessionId);
|
|
210470
|
+
}).finally(() => {
|
|
210471
|
+
processingPromises.delete(agentIdOrSessionId);
|
|
210472
|
+
});
|
|
210473
|
+
processingPromises.set(agentIdOrSessionId, promise2);
|
|
210484
210474
|
}
|
|
210485
210475
|
}
|
|
210486
210476
|
function clearDumpState(agentIdOrSessionId) {
|
|
@@ -210677,7 +210667,7 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
|
|
|
210677
210667
|
return response;
|
|
210678
210668
|
};
|
|
210679
210669
|
}
|
|
210680
|
-
var MAX_CACHED_REQUESTS = 5, cachedApiRequests, dumpState, dumpRequestQueue,
|
|
210670
|
+
var MAX_CACHED_REQUESTS = 5, cachedApiRequests, dumpState, dumpRequestQueue, processingPromises;
|
|
210681
210671
|
var init_dumpPrompts = __esm(() => {
|
|
210682
210672
|
init_state();
|
|
210683
210673
|
init_envUtils();
|
|
@@ -210690,7 +210680,7 @@ var init_dumpPrompts = __esm(() => {
|
|
|
210690
210680
|
cachedApiRequests = [];
|
|
210691
210681
|
dumpState = new Map;
|
|
210692
210682
|
dumpRequestQueue = new Map;
|
|
210693
|
-
|
|
210683
|
+
processingPromises = new Map;
|
|
210694
210684
|
});
|
|
210695
210685
|
|
|
210696
210686
|
// src/utils/abortController.ts
|
|
@@ -301616,28 +301606,44 @@ function memoizeWithTTL(fn, ttlMs) {
|
|
|
301616
301606
|
return existing;
|
|
301617
301607
|
}
|
|
301618
301608
|
const refreshPromise = (async () => {
|
|
301609
|
+
let timeoutId = null;
|
|
301619
301610
|
try {
|
|
301611
|
+
const timeoutMs = 1e4;
|
|
301612
|
+
const timeoutPromise = new Promise((_2, reject2) => {
|
|
301613
|
+
timeoutId = setTimeout(() => reject2(new Error(`Refresh timeout after ${timeoutMs}ms for key: ${key2}`)), timeoutMs);
|
|
301614
|
+
});
|
|
301620
301615
|
const now22 = Date.now();
|
|
301621
301616
|
if (lastCachedAt !== 0 && now22 - lastCachedAt < ttlMs) {
|
|
301622
301617
|
return memoized(...args);
|
|
301623
301618
|
}
|
|
301624
301619
|
try {
|
|
301625
|
-
const freshResult = await fn(...args);
|
|
301620
|
+
const freshResult = await Promise.race([fn(...args), timeoutPromise]);
|
|
301626
301621
|
if (freshResult && typeof freshResult === "object" && "success" in freshResult && freshResult.success === true) {
|
|
301627
301622
|
originalClear();
|
|
301628
301623
|
memoized.cache.set(args[0], freshResult);
|
|
301629
301624
|
lastCachedAt = Date.now();
|
|
301630
301625
|
return freshResult;
|
|
301631
301626
|
}
|
|
301632
|
-
|
|
301627
|
+
if (memoized.cache.has(args[0])) {
|
|
301628
|
+
return memoized(...args);
|
|
301629
|
+
}
|
|
301630
|
+
return freshResult;
|
|
301633
301631
|
} catch (error49) {
|
|
301634
|
-
|
|
301632
|
+
if (memoized.cache.has(args[0])) {
|
|
301633
|
+
return memoized(...args);
|
|
301634
|
+
}
|
|
301635
|
+
return { success: false };
|
|
301635
301636
|
}
|
|
301636
301637
|
} finally {
|
|
301637
|
-
|
|
301638
|
+
if (timeoutId) {
|
|
301639
|
+
clearTimeout(timeoutId);
|
|
301640
|
+
}
|
|
301638
301641
|
}
|
|
301639
301642
|
})();
|
|
301640
301643
|
pendingRefreshes.set(key2, refreshPromise);
|
|
301644
|
+
refreshPromise.finally(() => {
|
|
301645
|
+
pendingRefreshes.delete(key2);
|
|
301646
|
+
});
|
|
301641
301647
|
return refreshPromise;
|
|
301642
301648
|
} finally {
|
|
301643
301649
|
release();
|
|
@@ -342885,7 +342891,7 @@ async function appendSessionLogImpl(sessionId, entry, url3, headers) {
|
|
|
342885
342891
|
} else {
|
|
342886
342892
|
let logs2 = null;
|
|
342887
342893
|
try {
|
|
342888
|
-
logs2 = await
|
|
342894
|
+
logs2 = await fetchSessionLogsFromUrl(sessionId, url3, headers);
|
|
342889
342895
|
} catch (fetchError) {
|
|
342890
342896
|
logError2(new Error(`Session 409: fetch failed for session ${sessionId}, entry ${entry.uuid}: ${fetchError instanceof Error ? fetchError.message : String(fetchError)}`));
|
|
342891
342897
|
logForDiagnosticsNoPII("error", "session_persist_409_fetch_fail");
|
|
@@ -343055,7 +343061,7 @@ async function getTeleportEvents(sessionId, accessToken, orgUUID) {
|
|
|
343055
343061
|
}
|
|
343056
343062
|
}
|
|
343057
343063
|
pages++;
|
|
343058
|
-
if (next_cursor == null) {
|
|
343064
|
+
if (next_cursor == null || typeof next_cursor !== "string" || next_cursor === "") {
|
|
343059
343065
|
break;
|
|
343060
343066
|
}
|
|
343061
343067
|
previousCursor = cursor;
|
|
@@ -343068,7 +343074,7 @@ async function getTeleportEvents(sessionId, accessToken, orgUUID) {
|
|
|
343068
343074
|
logForDebugging(`[teleport] Fetched ${all4.length} events over ${pages} page(s) for ${sessionId}`);
|
|
343069
343075
|
return all4;
|
|
343070
343076
|
}
|
|
343071
|
-
async function
|
|
343077
|
+
async function fetchSessionLogsFromUrl(sessionId, url3, headers) {
|
|
343072
343078
|
try {
|
|
343073
343079
|
const response = await axios_default.get(url3, {
|
|
343074
343080
|
headers,
|
|
@@ -343111,9 +343117,6 @@ async function fetchSessionLogsFromUrlRaw(sessionId, url3, headers) {
|
|
|
343111
343117
|
return null;
|
|
343112
343118
|
}
|
|
343113
343119
|
}
|
|
343114
|
-
async function fetchSessionLogsFromUrl(sessionId, url3, headers) {
|
|
343115
|
-
return fetchSessionLogsFromUrlRaw(sessionId, url3, headers);
|
|
343116
|
-
}
|
|
343117
343120
|
function findLastUuid(logs2) {
|
|
343118
343121
|
if (!logs2) {
|
|
343119
343122
|
return;
|
|
@@ -407729,13 +407732,13 @@ var init_AppState = __esm(() => {
|
|
|
407729
407732
|
function useNotifications() {
|
|
407730
407733
|
const store = useAppStateStore();
|
|
407731
407734
|
const setAppState = useSetAppState();
|
|
407732
|
-
const
|
|
407735
|
+
const processQueue = import_react85.useCallback(() => {
|
|
407733
407736
|
setAppState((prev) => {
|
|
407734
407737
|
const next = getNext(prev.notifications.queue);
|
|
407735
407738
|
if (prev.notifications.current !== null || !next) {
|
|
407736
407739
|
return prev;
|
|
407737
407740
|
}
|
|
407738
|
-
currentTimeoutId = setTimeout((setAppState2, nextKey,
|
|
407741
|
+
currentTimeoutId = setTimeout((setAppState2, nextKey, processQueue2) => {
|
|
407739
407742
|
currentTimeoutId = null;
|
|
407740
407743
|
setAppState2((prev2) => {
|
|
407741
407744
|
if (prev2.notifications.current?.key !== nextKey) {
|
|
@@ -407749,8 +407752,8 @@ function useNotifications() {
|
|
|
407749
407752
|
}
|
|
407750
407753
|
};
|
|
407751
407754
|
});
|
|
407752
|
-
|
|
407753
|
-
}, next.timeoutMs ?? DEFAULT_TIMEOUT_MS2, setAppState, next.key,
|
|
407755
|
+
processQueue2();
|
|
407756
|
+
}, next.timeoutMs ?? DEFAULT_TIMEOUT_MS2, setAppState, next.key, processQueue);
|
|
407754
407757
|
return {
|
|
407755
407758
|
...prev,
|
|
407756
407759
|
notifications: {
|
|
@@ -407766,7 +407769,7 @@ function useNotifications() {
|
|
|
407766
407769
|
clearTimeout(currentTimeoutId);
|
|
407767
407770
|
currentTimeoutId = null;
|
|
407768
407771
|
}
|
|
407769
|
-
currentTimeoutId = setTimeout((setAppState2, notif2,
|
|
407772
|
+
currentTimeoutId = setTimeout((setAppState2, notif2, processQueue2) => {
|
|
407770
407773
|
currentTimeoutId = null;
|
|
407771
407774
|
setAppState2((prev) => {
|
|
407772
407775
|
if (prev.notifications.current?.key !== notif2.key) {
|
|
@@ -407780,8 +407783,8 @@ function useNotifications() {
|
|
|
407780
407783
|
}
|
|
407781
407784
|
};
|
|
407782
407785
|
});
|
|
407783
|
-
|
|
407784
|
-
}, notif.timeoutMs ?? DEFAULT_TIMEOUT_MS2, setAppState, notif,
|
|
407786
|
+
processQueue2();
|
|
407787
|
+
}, notif.timeoutMs ?? DEFAULT_TIMEOUT_MS2, setAppState, notif, processQueue);
|
|
407785
407788
|
setAppState((prev) => ({
|
|
407786
407789
|
...prev,
|
|
407787
407790
|
notifications: {
|
|
@@ -407799,7 +407802,7 @@ function useNotifications() {
|
|
|
407799
407802
|
clearTimeout(currentTimeoutId);
|
|
407800
407803
|
currentTimeoutId = null;
|
|
407801
407804
|
}
|
|
407802
|
-
currentTimeoutId = setTimeout((setAppState2, foldedKey,
|
|
407805
|
+
currentTimeoutId = setTimeout((setAppState2, foldedKey, processQueue2) => {
|
|
407803
407806
|
currentTimeoutId = null;
|
|
407804
407807
|
setAppState2((p) => {
|
|
407805
407808
|
if (p.notifications.current?.key !== foldedKey) {
|
|
@@ -407813,8 +407816,8 @@ function useNotifications() {
|
|
|
407813
407816
|
}
|
|
407814
407817
|
};
|
|
407815
407818
|
});
|
|
407816
|
-
|
|
407817
|
-
}, folded.timeoutMs ?? DEFAULT_TIMEOUT_MS2, setAppState, folded.key,
|
|
407819
|
+
processQueue2();
|
|
407820
|
+
}, folded.timeoutMs ?? DEFAULT_TIMEOUT_MS2, setAppState, folded.key, processQueue);
|
|
407818
407821
|
return {
|
|
407819
407822
|
...prev,
|
|
407820
407823
|
notifications: {
|
|
@@ -407854,8 +407857,8 @@ function useNotifications() {
|
|
|
407854
407857
|
}
|
|
407855
407858
|
};
|
|
407856
407859
|
});
|
|
407857
|
-
|
|
407858
|
-
}, [setAppState,
|
|
407860
|
+
processQueue();
|
|
407861
|
+
}, [setAppState, processQueue]);
|
|
407859
407862
|
const removeNotification = import_react85.useCallback((key2) => {
|
|
407860
407863
|
setAppState((prev) => {
|
|
407861
407864
|
const isCurrent = prev.notifications.current?.key === key2;
|
|
@@ -407875,11 +407878,11 @@ function useNotifications() {
|
|
|
407875
407878
|
}
|
|
407876
407879
|
};
|
|
407877
407880
|
});
|
|
407878
|
-
|
|
407879
|
-
}, [setAppState,
|
|
407881
|
+
processQueue();
|
|
407882
|
+
}, [setAppState, processQueue]);
|
|
407880
407883
|
import_react85.useEffect(() => {
|
|
407881
407884
|
if (store.getState().notifications.queue.length > 0) {
|
|
407882
|
-
|
|
407885
|
+
processQueue();
|
|
407883
407886
|
}
|
|
407884
407887
|
}, []);
|
|
407885
407888
|
return {
|
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.120",
|
|
8
|
+
BUILD_TIME: "2026-07-22T22:27:16.931Z",
|
|
9
9
|
PACKAGE_URL: "@funnycode/myclaude",
|
|
10
10
|
NATIVE_PACKAGE_URL: "@funnycode/myclaude",
|
|
11
11
|
VERSION_CHANGELOG: '',
|
|
@@ -117790,7 +117790,7 @@ var package_default;
|
|
|
117790
117790
|
var init_package = __esm(() => {
|
|
117791
117791
|
package_default = {
|
|
117792
117792
|
name: "@funnycode/myclaude",
|
|
117793
|
-
version: "0.1.
|
|
117793
|
+
version: "0.1.120",
|
|
117794
117794
|
private: false,
|
|
117795
117795
|
description: "An open-source AI coding assistant in your terminal - powered by Claude",
|
|
117796
117796
|
license: "MIT",
|
|
@@ -210450,37 +210450,27 @@ function enqueueDumpRequest(agentIdOrSessionId, callback) {
|
|
|
210450
210450
|
dumpRequestQueue.set(agentIdOrSessionId, []);
|
|
210451
210451
|
}
|
|
210452
210452
|
dumpRequestQueue.get(agentIdOrSessionId).push(callback);
|
|
210453
|
-
if (!
|
|
210454
|
-
|
|
210455
|
-
processQueue(agentIdOrSessionId);
|
|
210456
|
-
}
|
|
210457
|
-
}
|
|
210458
|
-
async function processQueue(agentIdOrSessionId) {
|
|
210459
|
-
try {
|
|
210460
|
-
while (true) {
|
|
210453
|
+
if (!processingPromises.has(agentIdOrSessionId)) {
|
|
210454
|
+
const promise2 = (async () => {
|
|
210461
210455
|
while (true) {
|
|
210462
|
-
const
|
|
210463
|
-
if (!
|
|
210456
|
+
const queue = dumpRequestQueue.get(agentIdOrSessionId);
|
|
210457
|
+
if (!queue || queue.length === 0) {
|
|
210464
210458
|
break;
|
|
210465
210459
|
}
|
|
210466
|
-
const
|
|
210460
|
+
const cb = queue.shift();
|
|
210467
210461
|
try {
|
|
210468
|
-
await
|
|
210462
|
+
await cb();
|
|
210469
210463
|
} catch (err2) {
|
|
210470
210464
|
logForDebugging(`dumpPrompts.processQueue: callback threw: ${err2}`, { level: "error" });
|
|
210471
210465
|
}
|
|
210472
210466
|
}
|
|
210473
|
-
|
|
210474
|
-
|
|
210475
|
-
|
|
210476
|
-
|
|
210477
|
-
|
|
210478
|
-
|
|
210479
|
-
|
|
210480
|
-
} catch (err2) {
|
|
210481
|
-
logError2(`processQueue: failed for ${agentIdOrSessionId}`, err2);
|
|
210482
|
-
dumpRequestQueue.delete(agentIdOrSessionId);
|
|
210483
|
-
processingFlags.delete(agentIdOrSessionId);
|
|
210467
|
+
})().catch((err2) => {
|
|
210468
|
+
logError2(`processQueue: failed for ${agentIdOrSessionId}`, err2);
|
|
210469
|
+
dumpRequestQueue.delete(agentIdOrSessionId);
|
|
210470
|
+
}).finally(() => {
|
|
210471
|
+
processingPromises.delete(agentIdOrSessionId);
|
|
210472
|
+
});
|
|
210473
|
+
processingPromises.set(agentIdOrSessionId, promise2);
|
|
210484
210474
|
}
|
|
210485
210475
|
}
|
|
210486
210476
|
function clearDumpState(agentIdOrSessionId) {
|
|
@@ -210677,7 +210667,7 @@ function createDumpPromptsFetch(agentIdOrSessionId) {
|
|
|
210677
210667
|
return response;
|
|
210678
210668
|
};
|
|
210679
210669
|
}
|
|
210680
|
-
var MAX_CACHED_REQUESTS = 5, cachedApiRequests, dumpState, dumpRequestQueue,
|
|
210670
|
+
var MAX_CACHED_REQUESTS = 5, cachedApiRequests, dumpState, dumpRequestQueue, processingPromises;
|
|
210681
210671
|
var init_dumpPrompts = __esm(() => {
|
|
210682
210672
|
init_state();
|
|
210683
210673
|
init_envUtils();
|
|
@@ -210690,7 +210680,7 @@ var init_dumpPrompts = __esm(() => {
|
|
|
210690
210680
|
cachedApiRequests = [];
|
|
210691
210681
|
dumpState = new Map;
|
|
210692
210682
|
dumpRequestQueue = new Map;
|
|
210693
|
-
|
|
210683
|
+
processingPromises = new Map;
|
|
210694
210684
|
});
|
|
210695
210685
|
|
|
210696
210686
|
// src/utils/abortController.ts
|
|
@@ -301616,28 +301606,44 @@ function memoizeWithTTL(fn, ttlMs) {
|
|
|
301616
301606
|
return existing;
|
|
301617
301607
|
}
|
|
301618
301608
|
const refreshPromise = (async () => {
|
|
301609
|
+
let timeoutId = null;
|
|
301619
301610
|
try {
|
|
301611
|
+
const timeoutMs = 1e4;
|
|
301612
|
+
const timeoutPromise = new Promise((_2, reject2) => {
|
|
301613
|
+
timeoutId = setTimeout(() => reject2(new Error(`Refresh timeout after ${timeoutMs}ms for key: ${key2}`)), timeoutMs);
|
|
301614
|
+
});
|
|
301620
301615
|
const now22 = Date.now();
|
|
301621
301616
|
if (lastCachedAt !== 0 && now22 - lastCachedAt < ttlMs) {
|
|
301622
301617
|
return memoized(...args);
|
|
301623
301618
|
}
|
|
301624
301619
|
try {
|
|
301625
|
-
const freshResult = await fn(...args);
|
|
301620
|
+
const freshResult = await Promise.race([fn(...args), timeoutPromise]);
|
|
301626
301621
|
if (freshResult && typeof freshResult === "object" && "success" in freshResult && freshResult.success === true) {
|
|
301627
301622
|
originalClear();
|
|
301628
301623
|
memoized.cache.set(args[0], freshResult);
|
|
301629
301624
|
lastCachedAt = Date.now();
|
|
301630
301625
|
return freshResult;
|
|
301631
301626
|
}
|
|
301632
|
-
|
|
301627
|
+
if (memoized.cache.has(args[0])) {
|
|
301628
|
+
return memoized(...args);
|
|
301629
|
+
}
|
|
301630
|
+
return freshResult;
|
|
301633
301631
|
} catch (error49) {
|
|
301634
|
-
|
|
301632
|
+
if (memoized.cache.has(args[0])) {
|
|
301633
|
+
return memoized(...args);
|
|
301634
|
+
}
|
|
301635
|
+
return { success: false };
|
|
301635
301636
|
}
|
|
301636
301637
|
} finally {
|
|
301637
|
-
|
|
301638
|
+
if (timeoutId) {
|
|
301639
|
+
clearTimeout(timeoutId);
|
|
301640
|
+
}
|
|
301638
301641
|
}
|
|
301639
301642
|
})();
|
|
301640
301643
|
pendingRefreshes.set(key2, refreshPromise);
|
|
301644
|
+
refreshPromise.finally(() => {
|
|
301645
|
+
pendingRefreshes.delete(key2);
|
|
301646
|
+
});
|
|
301641
301647
|
return refreshPromise;
|
|
301642
301648
|
} finally {
|
|
301643
301649
|
release();
|
|
@@ -342885,7 +342891,7 @@ async function appendSessionLogImpl(sessionId, entry, url3, headers) {
|
|
|
342885
342891
|
} else {
|
|
342886
342892
|
let logs2 = null;
|
|
342887
342893
|
try {
|
|
342888
|
-
logs2 = await
|
|
342894
|
+
logs2 = await fetchSessionLogsFromUrl(sessionId, url3, headers);
|
|
342889
342895
|
} catch (fetchError) {
|
|
342890
342896
|
logError2(new Error(`Session 409: fetch failed for session ${sessionId}, entry ${entry.uuid}: ${fetchError instanceof Error ? fetchError.message : String(fetchError)}`));
|
|
342891
342897
|
logForDiagnosticsNoPII("error", "session_persist_409_fetch_fail");
|
|
@@ -343055,7 +343061,7 @@ async function getTeleportEvents(sessionId, accessToken, orgUUID) {
|
|
|
343055
343061
|
}
|
|
343056
343062
|
}
|
|
343057
343063
|
pages++;
|
|
343058
|
-
if (next_cursor == null) {
|
|
343064
|
+
if (next_cursor == null || typeof next_cursor !== "string" || next_cursor === "") {
|
|
343059
343065
|
break;
|
|
343060
343066
|
}
|
|
343061
343067
|
previousCursor = cursor;
|
|
@@ -343068,7 +343074,7 @@ async function getTeleportEvents(sessionId, accessToken, orgUUID) {
|
|
|
343068
343074
|
logForDebugging(`[teleport] Fetched ${all4.length} events over ${pages} page(s) for ${sessionId}`);
|
|
343069
343075
|
return all4;
|
|
343070
343076
|
}
|
|
343071
|
-
async function
|
|
343077
|
+
async function fetchSessionLogsFromUrl(sessionId, url3, headers) {
|
|
343072
343078
|
try {
|
|
343073
343079
|
const response = await axios_default.get(url3, {
|
|
343074
343080
|
headers,
|
|
@@ -343111,9 +343117,6 @@ async function fetchSessionLogsFromUrlRaw(sessionId, url3, headers) {
|
|
|
343111
343117
|
return null;
|
|
343112
343118
|
}
|
|
343113
343119
|
}
|
|
343114
|
-
async function fetchSessionLogsFromUrl(sessionId, url3, headers) {
|
|
343115
|
-
return fetchSessionLogsFromUrlRaw(sessionId, url3, headers);
|
|
343116
|
-
}
|
|
343117
343120
|
function findLastUuid(logs2) {
|
|
343118
343121
|
if (!logs2) {
|
|
343119
343122
|
return;
|
|
@@ -407729,13 +407732,13 @@ var init_AppState = __esm(() => {
|
|
|
407729
407732
|
function useNotifications() {
|
|
407730
407733
|
const store = useAppStateStore();
|
|
407731
407734
|
const setAppState = useSetAppState();
|
|
407732
|
-
const
|
|
407735
|
+
const processQueue = import_react85.useCallback(() => {
|
|
407733
407736
|
setAppState((prev) => {
|
|
407734
407737
|
const next = getNext(prev.notifications.queue);
|
|
407735
407738
|
if (prev.notifications.current !== null || !next) {
|
|
407736
407739
|
return prev;
|
|
407737
407740
|
}
|
|
407738
|
-
currentTimeoutId = setTimeout((setAppState2, nextKey,
|
|
407741
|
+
currentTimeoutId = setTimeout((setAppState2, nextKey, processQueue2) => {
|
|
407739
407742
|
currentTimeoutId = null;
|
|
407740
407743
|
setAppState2((prev2) => {
|
|
407741
407744
|
if (prev2.notifications.current?.key !== nextKey) {
|
|
@@ -407749,8 +407752,8 @@ function useNotifications() {
|
|
|
407749
407752
|
}
|
|
407750
407753
|
};
|
|
407751
407754
|
});
|
|
407752
|
-
|
|
407753
|
-
}, next.timeoutMs ?? DEFAULT_TIMEOUT_MS2, setAppState, next.key,
|
|
407755
|
+
processQueue2();
|
|
407756
|
+
}, next.timeoutMs ?? DEFAULT_TIMEOUT_MS2, setAppState, next.key, processQueue);
|
|
407754
407757
|
return {
|
|
407755
407758
|
...prev,
|
|
407756
407759
|
notifications: {
|
|
@@ -407766,7 +407769,7 @@ function useNotifications() {
|
|
|
407766
407769
|
clearTimeout(currentTimeoutId);
|
|
407767
407770
|
currentTimeoutId = null;
|
|
407768
407771
|
}
|
|
407769
|
-
currentTimeoutId = setTimeout((setAppState2, notif2,
|
|
407772
|
+
currentTimeoutId = setTimeout((setAppState2, notif2, processQueue2) => {
|
|
407770
407773
|
currentTimeoutId = null;
|
|
407771
407774
|
setAppState2((prev) => {
|
|
407772
407775
|
if (prev.notifications.current?.key !== notif2.key) {
|
|
@@ -407780,8 +407783,8 @@ function useNotifications() {
|
|
|
407780
407783
|
}
|
|
407781
407784
|
};
|
|
407782
407785
|
});
|
|
407783
|
-
|
|
407784
|
-
}, notif.timeoutMs ?? DEFAULT_TIMEOUT_MS2, setAppState, notif,
|
|
407786
|
+
processQueue2();
|
|
407787
|
+
}, notif.timeoutMs ?? DEFAULT_TIMEOUT_MS2, setAppState, notif, processQueue);
|
|
407785
407788
|
setAppState((prev) => ({
|
|
407786
407789
|
...prev,
|
|
407787
407790
|
notifications: {
|
|
@@ -407799,7 +407802,7 @@ function useNotifications() {
|
|
|
407799
407802
|
clearTimeout(currentTimeoutId);
|
|
407800
407803
|
currentTimeoutId = null;
|
|
407801
407804
|
}
|
|
407802
|
-
currentTimeoutId = setTimeout((setAppState2, foldedKey,
|
|
407805
|
+
currentTimeoutId = setTimeout((setAppState2, foldedKey, processQueue2) => {
|
|
407803
407806
|
currentTimeoutId = null;
|
|
407804
407807
|
setAppState2((p) => {
|
|
407805
407808
|
if (p.notifications.current?.key !== foldedKey) {
|
|
@@ -407813,8 +407816,8 @@ function useNotifications() {
|
|
|
407813
407816
|
}
|
|
407814
407817
|
};
|
|
407815
407818
|
});
|
|
407816
|
-
|
|
407817
|
-
}, folded.timeoutMs ?? DEFAULT_TIMEOUT_MS2, setAppState, folded.key,
|
|
407819
|
+
processQueue2();
|
|
407820
|
+
}, folded.timeoutMs ?? DEFAULT_TIMEOUT_MS2, setAppState, folded.key, processQueue);
|
|
407818
407821
|
return {
|
|
407819
407822
|
...prev,
|
|
407820
407823
|
notifications: {
|
|
@@ -407854,8 +407857,8 @@ function useNotifications() {
|
|
|
407854
407857
|
}
|
|
407855
407858
|
};
|
|
407856
407859
|
});
|
|
407857
|
-
|
|
407858
|
-
}, [setAppState,
|
|
407860
|
+
processQueue();
|
|
407861
|
+
}, [setAppState, processQueue]);
|
|
407859
407862
|
const removeNotification = import_react85.useCallback((key2) => {
|
|
407860
407863
|
setAppState((prev) => {
|
|
407861
407864
|
const isCurrent = prev.notifications.current?.key === key2;
|
|
@@ -407875,11 +407878,11 @@ function useNotifications() {
|
|
|
407875
407878
|
}
|
|
407876
407879
|
};
|
|
407877
407880
|
});
|
|
407878
|
-
|
|
407879
|
-
}, [setAppState,
|
|
407881
|
+
processQueue();
|
|
407882
|
+
}, [setAppState, processQueue]);
|
|
407880
407883
|
import_react85.useEffect(() => {
|
|
407881
407884
|
if (store.getState().notifications.queue.length > 0) {
|
|
407882
|
-
|
|
407885
|
+
processQueue();
|
|
407883
407886
|
}
|
|
407884
407887
|
}, []);
|
|
407885
407888
|
return {
|