aisubs 0.3.5 → 0.3.7
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 +14 -0
- package/dist/auth.d.ts +1 -0
- package/dist/auth.js +20 -10
- package/dist/cli.js +0 -0
- package/dist/compatibility.js +220 -151
- package/dist/dashboard/assets/index-CePTUw7Z.css +2 -0
- package/dist/dashboard/assets/index-Vscu32Dz.js +84 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/dashboard.js +15 -26
- package/dist/http.d.ts +3 -0
- package/dist/http.js +12 -31
- package/dist/providers/chatgpt.js +52 -21
- package/dist/proxy-headers.d.ts +2 -0
- package/dist/proxy-headers.js +35 -0
- package/dist/realtime.js +6 -20
- package/dist/store.js +11 -4
- package/dist/utils.js +1 -1
- package/package.json +7 -3
- package/dist/dashboard/assets/index-BJDbjHnw.css +0 -2
- package/dist/dashboard/assets/index-BbN84qld.js +0 -84
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.7 - 2026-09-16
|
|
4
|
+
|
|
5
|
+
- Improve provider compatibility, proxy handling, and request normalization.
|
|
6
|
+
- Harden dashboard account flows, modal interactions, and stale-load handling.
|
|
7
|
+
- Add regression coverage for compatibility, proxy headers, authentication, and
|
|
8
|
+
dashboard behavior.
|
|
9
|
+
|
|
10
|
+
## 0.3.6 - 2026-09-15
|
|
11
|
+
|
|
12
|
+
- Preserve provider cache controls and cache usage across OpenAI-compatible,
|
|
13
|
+
Anthropic, Responses, and subscription transports.
|
|
14
|
+
- Keep ChatGPT cache routing state scoped to account, session, and turn.
|
|
15
|
+
- Normalize cache reads/writes and reasoning usage without losing native fields.
|
|
16
|
+
|
|
3
17
|
## 0.3.5 - 2026-09-14
|
|
4
18
|
|
|
5
19
|
- Move ChatGPT Responses instructions into the developer input prefix so
|
package/dist/auth.d.ts
CHANGED
package/dist/auth.js
CHANGED
|
@@ -162,14 +162,19 @@ export class SubscriptionAuth {
|
|
|
162
162
|
}
|
|
163
163
|
const epoch = this.advance(scope);
|
|
164
164
|
for (const attempt of this.attempts.values()) {
|
|
165
|
-
if (attempt.scope === scope
|
|
166
|
-
|
|
165
|
+
if (attempt.scope === scope)
|
|
166
|
+
this.cancelAttempt(attempt);
|
|
167
167
|
}
|
|
168
168
|
const abort = new AbortController();
|
|
169
169
|
const providerOptions = { ...options };
|
|
170
170
|
delete providerOptions.account;
|
|
171
171
|
delete providerOptions.replace;
|
|
172
172
|
const login = await adapter.startLogin(abort.signal, providerOptions);
|
|
173
|
+
if (this.generation(scope) !== epoch) {
|
|
174
|
+
abort.abort();
|
|
175
|
+
void login.complete.catch(() => { });
|
|
176
|
+
throw new Error("Login cancelled");
|
|
177
|
+
}
|
|
173
178
|
const id = crypto.randomUUID();
|
|
174
179
|
let record;
|
|
175
180
|
const promise = login.complete
|
|
@@ -199,6 +204,7 @@ export class SubscriptionAuth {
|
|
|
199
204
|
provider,
|
|
200
205
|
accountKey,
|
|
201
206
|
scope,
|
|
207
|
+
generation: epoch,
|
|
202
208
|
state: "pending",
|
|
203
209
|
error: null,
|
|
204
210
|
abort,
|
|
@@ -218,10 +224,7 @@ export class SubscriptionAuth {
|
|
|
218
224
|
return record.error;
|
|
219
225
|
},
|
|
220
226
|
wait: () => record.promise,
|
|
221
|
-
cancel: () =>
|
|
222
|
-
this.advance(scope);
|
|
223
|
-
abort.abort();
|
|
224
|
-
},
|
|
227
|
+
cancel: () => this.cancelAttempt(record),
|
|
225
228
|
};
|
|
226
229
|
}
|
|
227
230
|
expireLoginAttempt(id) {
|
|
@@ -243,10 +246,17 @@ export class SubscriptionAuth {
|
|
|
243
246
|
const attempt = this.attempts.get(id);
|
|
244
247
|
if (!attempt || attempt.state !== "pending")
|
|
245
248
|
return false;
|
|
246
|
-
this.
|
|
247
|
-
attempt.abort.abort();
|
|
249
|
+
this.cancelAttempt(attempt);
|
|
248
250
|
return true;
|
|
249
251
|
}
|
|
252
|
+
cancelAttempt(attempt) {
|
|
253
|
+
if (attempt.state !== "pending")
|
|
254
|
+
return;
|
|
255
|
+
if (this.generation(attempt.scope) === attempt.generation)
|
|
256
|
+
this.advance(attempt.scope);
|
|
257
|
+
attempt.state = "cancelled";
|
|
258
|
+
attempt.abort.abort();
|
|
259
|
+
}
|
|
250
260
|
async status(provider, options = {}) {
|
|
251
261
|
const accountKey = normalizeAccountKey(options.account);
|
|
252
262
|
if (options.validate)
|
|
@@ -277,8 +287,8 @@ export class SubscriptionAuth {
|
|
|
277
287
|
for (const refresh of this.refreshes.get(scope) ?? [])
|
|
278
288
|
refresh.abort();
|
|
279
289
|
for (const attempt of this.attempts.values()) {
|
|
280
|
-
if (attempt.scope === scope
|
|
281
|
-
|
|
290
|
+
if (attempt.scope === scope)
|
|
291
|
+
this.cancelAttempt(attempt);
|
|
282
292
|
}
|
|
283
293
|
await this.store.delete(scope);
|
|
284
294
|
}
|
package/dist/cli.js
CHANGED
|
File without changes
|