dsh-codex-subscription 3.2.18 → 3.2.20
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/README.de.md +23 -98
- package/README.en.md +24 -99
- package/README.es.md +23 -98
- package/README.fr.md +23 -98
- package/README.ja.md +23 -98
- package/README.md +23 -98
- package/README.pt.md +23 -98
- package/README.ru.md +23 -98
- package/README.zh-CN.md +23 -98
- package/lib/client.js +2 -2
- package/lib/index.js +28 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -11779,7 +11779,7 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
|
|
|
11779
11779
|
}
|
|
11780
11780
|
//#endregion
|
|
11781
11781
|
//#region src/version.js
|
|
11782
|
-
const PACKAGE_VERSION = "3.2.
|
|
11782
|
+
const PACKAGE_VERSION = "3.2.20";
|
|
11783
11783
|
//#endregion
|
|
11784
11784
|
//#region src/client-recovery.js
|
|
11785
11785
|
async function recoveryCall(rpc, endpoint, payload = {}, timeoutMs = endpoint === "usage" || endpoint.startsWith("usage/") ? 3e4 : 1e4) {
|
|
@@ -12799,7 +12799,7 @@ a.codexVoiceCall{display:flex;align-items:center;justify-content:center;box-sizi
|
|
|
12799
12799
|
unwatchConflict = void 0;
|
|
12800
12800
|
}
|
|
12801
12801
|
const state = preference.getSnapshot();
|
|
12802
|
-
const custom = others.every(native) && (state.composerModelPicker === "legacy" || state.composerModelPicker === "auto"
|
|
12802
|
+
const custom = others.every(native) && !state.composerModelPickerConflict && (state.composerModelPicker === "legacy" || state.composerModelPicker === "auto");
|
|
12803
12803
|
if (state.status === "ready" && custom && !supportsOptions && !others.some((entry) => priorityOf(entry) === priority)) dispose ??= slots.register({
|
|
12804
12804
|
name: slot,
|
|
12805
12805
|
priority,
|
package/lib/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { basename, dirname, isAbsolute, join, posix, relative, resolve, sep, win
|
|
|
8
8
|
import { request } from "node:https";
|
|
9
9
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
10
10
|
import { promisify } from "node:util";
|
|
11
|
+
import { zstdDecompress } from "node:zlib";
|
|
11
12
|
import { HttpsProxyAgent } from "https-proxy-agent";
|
|
12
13
|
import WebSocket from "ws";
|
|
13
14
|
import { ProxyAgent, getGlobalDispatcher } from "undici";
|
|
@@ -1201,6 +1202,7 @@ function safeAttempt(value = {}) {
|
|
|
1201
1202
|
...choices.has(value.requestedTransport) ? { requestedTransport: value.requestedTransport } : {},
|
|
1202
1203
|
...typeof value.model === "string" && /^gpt-[a-z0-9][a-z0-9.-]{0,63}$/u.test(value.model) ? { model: value.model } : {},
|
|
1203
1204
|
...fetchPaths.has(value.fetchPath) ? { fetchPath: value.fetchPath } : {},
|
|
1205
|
+
...value.requestCompression === "zstd-decoded" ? { requestCompression: value.requestCompression } : {},
|
|
1204
1206
|
...value.failure === "context-overflow" ? { failure: value.failure } : {},
|
|
1205
1207
|
...Number.isInteger(value.httpStatus) && value.httpStatus >= 100 && value.httpStatus <= 599 ? { httpStatus: value.httpStatus } : {},
|
|
1206
1208
|
...typeof value.cloudCompactionRequested === "boolean" ? { cloudCompactionRequested: value.cloudCompactionRequested } : {},
|
|
@@ -1485,6 +1487,7 @@ const diagnosticLog = createDiagnosticLog();
|
|
|
1485
1487
|
//#endregion
|
|
1486
1488
|
//#region src/oauth-network.js
|
|
1487
1489
|
const execFileAsync = promisify(execFile);
|
|
1490
|
+
const decompressZstd = promisify(zstdDecompress);
|
|
1488
1491
|
const CODEX_AUTH_HOST = "auth.openai.com";
|
|
1489
1492
|
const CODEX_SUBSCRIPTION_HOST = "chatgpt.com";
|
|
1490
1493
|
const CODEX_MODEL_SSE_PATH = "/backend-api/codex/responses";
|
|
@@ -1701,6 +1704,22 @@ function fetchThroughProxy(input, init, proxyUrl, tls = {}) {
|
|
|
1701
1704
|
request$1.end();
|
|
1702
1705
|
});
|
|
1703
1706
|
}
|
|
1707
|
+
async function uncompressedModelRequest(input, init) {
|
|
1708
|
+
const headers = new Headers(init?.headers ?? (input instanceof Request ? input.headers : void 0));
|
|
1709
|
+
if ((init?.method ?? (input instanceof Request ? input.method : "GET")).toUpperCase() !== "POST" || headers.get("content-encoding")?.trim().toLowerCase() !== "zstd") return init;
|
|
1710
|
+
const signal = init?.signal ?? input?.signal;
|
|
1711
|
+
signal?.throwIfAborted();
|
|
1712
|
+
const compressed = init?.body ?? (input instanceof Request ? await input.clone().arrayBuffer() : void 0);
|
|
1713
|
+
const body = await decompressZstd(compressed);
|
|
1714
|
+
signal?.throwIfAborted();
|
|
1715
|
+
headers.delete("content-encoding");
|
|
1716
|
+
headers.delete("content-length");
|
|
1717
|
+
return {
|
|
1718
|
+
...init,
|
|
1719
|
+
headers,
|
|
1720
|
+
body
|
|
1721
|
+
};
|
|
1722
|
+
}
|
|
1704
1723
|
async function fetchInCodexScope(scope, fetchBeforeScope, input, init) {
|
|
1705
1724
|
if (scope === void 0) return fetchBeforeScope(input, init);
|
|
1706
1725
|
const { options: scopedOptions, allowedHosts, resolved } = scope;
|
|
@@ -1732,6 +1751,11 @@ async function fetchInCodexScope(scope, fetchBeforeScope, input, init) {
|
|
|
1732
1751
|
} catch {}
|
|
1733
1752
|
let response;
|
|
1734
1753
|
try {
|
|
1754
|
+
if (scopedOptions.requestFetch && target.origin === `https://${CODEX_SUBSCRIPTION_HOST}` && target.pathname === CODEX_MODEL_SSE_PATH) {
|
|
1755
|
+
const decoded = await uncompressedModelRequest(input, init);
|
|
1756
|
+
if (decoded !== init) scopedOptions.onModelRequestCompression?.("zstd-decoded");
|
|
1757
|
+
init = decoded;
|
|
1758
|
+
}
|
|
1735
1759
|
if (dedicatedProxy && !route.url) throw new TypeError("Invalid DSH_CODEX_SSE_PROXY. Use an HTTP or HTTPS CONNECT proxy.");
|
|
1736
1760
|
if (hostModelFetch) if (!route.url || init?.dispatcher) response = await fetchBeforeScope(input, init);
|
|
1737
1761
|
else {
|
|
@@ -3092,6 +3116,9 @@ function openaiCodexSubscriptionProvider({ resolveSpeedMode = () => void 0, reso
|
|
|
3092
3116
|
onModelFetchPath(fetchPath) {
|
|
3093
3117
|
attempt.configure({ fetchPath });
|
|
3094
3118
|
},
|
|
3119
|
+
onModelRequestCompression(requestCompression) {
|
|
3120
|
+
attempt.configure({ requestCompression });
|
|
3121
|
+
},
|
|
3095
3122
|
onModelHttpStatus(status) {
|
|
3096
3123
|
attempt.response(status);
|
|
3097
3124
|
},
|
|
@@ -4889,7 +4916,7 @@ function inheritedOriginalImageRef(session, assetId) {
|
|
|
4889
4916
|
}
|
|
4890
4917
|
//#endregion
|
|
4891
4918
|
//#region src/version.js
|
|
4892
|
-
const PACKAGE_VERSION = "3.2.
|
|
4919
|
+
const PACKAGE_VERSION = "3.2.20";
|
|
4893
4920
|
const USER_AGENT = `dsh-codex-subscription/${PACKAGE_VERSION}`;
|
|
4894
4921
|
//#endregion
|
|
4895
4922
|
//#region src/image-original-store.js
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-codex-subscription",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.20",
|
|
4
4
|
"description": "Use ChatGPT and Codex subscriptions in DeepSeek Harness with OAuth, quota, safe resets, web search, images and Fast mode, and control DSH from the ChatGPT mobile app (Beta)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|