@juspay/neurolink 12.12.4 → 12.12.5
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/CHANGELOG.md +2 -2
- package/dist/auth/tokenStore.d.ts +9 -1
- package/dist/auth/tokenStore.js +29 -0
- package/dist/browser/neurolink.min.js +399 -398
- package/dist/cli/commands/proxy.js +65 -80
- package/dist/proxy/claudeFormat.d.ts +2 -2
- package/dist/proxy/claudeFormat.js +2 -2
- package/dist/proxy/codexFallback.d.ts +7 -1
- package/dist/proxy/codexFallback.js +181 -0
- package/dist/proxy/rollingProxyServer.js +10 -4
- package/dist/proxy/rollingWorkerProcess.js +8 -2
- package/dist/proxy/rollingWorkerProtocol.d.ts +2 -0
- package/dist/proxy/rollingWorkerProtocol.js +2 -0
- package/dist/proxy/rollingWorkerSupervisor.d.ts +5 -0
- package/dist/proxy/rollingWorkerSupervisor.js +75 -14
- package/dist/server/routes/claudeProxyRoutes.js +236 -61
- package/dist/server/routes/codexProxyRoutes.js +33 -6
- package/dist/types/cli.d.ts +2 -1
- package/dist/types/codex.d.ts +5 -0
- package/dist/types/proxy.d.ts +10 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
## [12.12.
|
|
1
|
+
## [12.12.5](https://github.com/juspay/neurolink/compare/v12.12.4...v12.12.5) (2026-09-05)
|
|
2
2
|
|
|
3
3
|
### Bug Fixes
|
|
4
4
|
|
|
5
|
-
- **(proxy):** preserve
|
|
5
|
+
- **(proxy):** reduce fallback latency and preserve streams under load ([e30c5a0](https://github.com/juspay/neurolink/commit/e30c5a05108f6260bc9732f939dcf3f97e75d121))
|
|
6
6
|
|
|
7
7
|
## [11.2.3](https://github.com/juspay/neurolink/compare/v11.2.2...v11.2.3) (2026-08-19)
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* - Automatic token refresh via configurable refresher functions
|
|
13
13
|
* - Cross-platform support (Unix/macOS/Windows)
|
|
14
14
|
*/
|
|
15
|
-
import type { StoredOAuthTokens, TokenRefresher } from "../types/index.js";
|
|
15
|
+
import type { TokenStorageData, StoredOAuthTokens, TokenRefresher } from "../types/index.js";
|
|
16
16
|
/**
|
|
17
17
|
* Secure token storage for OAuth tokens with multi-provider support
|
|
18
18
|
*
|
|
@@ -59,6 +59,7 @@ export declare class TokenStore {
|
|
|
59
59
|
private readonly tokenRefreshers;
|
|
60
60
|
private readonly inFlightRefreshes;
|
|
61
61
|
private readonly _mutex;
|
|
62
|
+
private snapshotRead;
|
|
62
63
|
/**
|
|
63
64
|
* Creates a new TokenStore instance
|
|
64
65
|
*
|
|
@@ -98,6 +99,13 @@ export declare class TokenStore {
|
|
|
98
99
|
loadTokens(provider: string): Promise<StoredOAuthTokens | null>;
|
|
99
100
|
/** Reads tokens without updating access metadata or rewriting the store. */
|
|
100
101
|
peekTokens(provider: string): Promise<StoredOAuthTokens | null>;
|
|
102
|
+
/**
|
|
103
|
+
* Read one coherent account inventory without updating access timestamps.
|
|
104
|
+
* Concurrent readers share only the in-flight read, never a TTL cache, so
|
|
105
|
+
* the next request observes account edits made by another process. Each
|
|
106
|
+
* caller receives its own copy, including disabled state and credentials.
|
|
107
|
+
*/
|
|
108
|
+
getProviderSnapshot(): Promise<TokenStorageData["providers"]>;
|
|
101
109
|
/**
|
|
102
110
|
* Internal load without mutex — callers must already hold the mutex.
|
|
103
111
|
*/
|
package/dist/auth/tokenStore.js
CHANGED
|
@@ -71,6 +71,7 @@ export class TokenStore {
|
|
|
71
71
|
tokenRefreshers = new Map();
|
|
72
72
|
inFlightRefreshes = new Map();
|
|
73
73
|
_mutex = new AsyncMutex();
|
|
74
|
+
snapshotRead;
|
|
74
75
|
/**
|
|
75
76
|
* Creates a new TokenStore instance
|
|
76
77
|
*
|
|
@@ -229,6 +230,34 @@ export class TokenStore {
|
|
|
229
230
|
}
|
|
230
231
|
});
|
|
231
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* Read one coherent account inventory without updating access timestamps.
|
|
235
|
+
* Concurrent readers share only the in-flight read, never a TTL cache, so
|
|
236
|
+
* the next request observes account edits made by another process. Each
|
|
237
|
+
* caller receives its own copy, including disabled state and credentials.
|
|
238
|
+
*/
|
|
239
|
+
async getProviderSnapshot() {
|
|
240
|
+
this.snapshotRead ??= this._mutex
|
|
241
|
+
.runExclusive(async () => {
|
|
242
|
+
try {
|
|
243
|
+
return (await this.loadStorageData()).providers;
|
|
244
|
+
}
|
|
245
|
+
catch (error) {
|
|
246
|
+
if (error instanceof TokenStoreError && error.code === "NOT_FOUND") {
|
|
247
|
+
return {};
|
|
248
|
+
}
|
|
249
|
+
throw error;
|
|
250
|
+
}
|
|
251
|
+
})
|
|
252
|
+
.finally(() => {
|
|
253
|
+
this.snapshotRead = undefined;
|
|
254
|
+
});
|
|
255
|
+
const providers = await this.snapshotRead;
|
|
256
|
+
return Object.fromEntries(Object.entries(providers).map(([key, value]) => [
|
|
257
|
+
key,
|
|
258
|
+
{ ...value, tokens: { ...value.tokens } },
|
|
259
|
+
]));
|
|
260
|
+
}
|
|
232
261
|
/**
|
|
233
262
|
* Internal load without mutex — callers must already hold the mutex.
|
|
234
263
|
*/
|