dsh-codex-subscription 1.13.0 → 1.14.0
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/DIRECTORY.md +1 -1
- package/README.en.md +34 -25
- package/README.md +34 -23
- package/THIRD_PARTY_NOTICES.md +1 -0
- package/lib/client.js +788 -322
- package/lib/index.js +14 -3
- package/package.json +1 -2
- package/AGENTS.md +0 -93
package/lib/index.js
CHANGED
|
@@ -40,7 +40,8 @@ function decodeJwtPayload(access) {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
function emailFromAccessToken(access) {
|
|
43
|
-
|
|
43
|
+
const payload = decodeJwtPayload(access);
|
|
44
|
+
return normalizeAccountEmail(payload?.["https://api.openai.com/profile"]?.email ?? payload?.email);
|
|
44
45
|
}
|
|
45
46
|
/** Normalize the one non-secret account attribute that may cross the UI boundary. */
|
|
46
47
|
function sanitizeOAuthCredential(value) {
|
|
@@ -1302,7 +1303,7 @@ function openaiCodexSubscriptionProvider({ resolveSpeedMode = () => void 0, reso
|
|
|
1302
1303
|
}
|
|
1303
1304
|
//#endregion
|
|
1304
1305
|
//#region src/version.js
|
|
1305
|
-
const PACKAGE_VERSION = "1.
|
|
1306
|
+
const PACKAGE_VERSION = "1.14.0";
|
|
1306
1307
|
const USER_AGENT = `dsh-codex-subscription/${PACKAGE_VERSION}`;
|
|
1307
1308
|
//#endregion
|
|
1308
1309
|
//#region src/model-catalog.js
|
|
@@ -1733,9 +1734,10 @@ async function editImages(values, attachments, signal) {
|
|
|
1733
1734
|
return images;
|
|
1734
1735
|
}
|
|
1735
1736
|
function imageContent(value) {
|
|
1737
|
+
const label = typeof value.size === "string" && value.size.length > 0 ? `Generated a ${value.size} image.` : "Generated an image.";
|
|
1736
1738
|
return [{
|
|
1737
1739
|
type: "text",
|
|
1738
|
-
text:
|
|
1740
|
+
text: value.localPath === void 0 ? label : `${label}\nOriginal PNG saved on the DSH host at: ${JSON.stringify(value.localPath)}. Read this file or copy it to the workspace with a .png extension; this host path is not a browser URL.`
|
|
1739
1741
|
}, {
|
|
1740
1742
|
type: "image",
|
|
1741
1743
|
attachment: imageReference(value.image)
|
|
@@ -1812,6 +1814,11 @@ function imageOutputSchema() {
|
|
|
1812
1814
|
}
|
|
1813
1815
|
},
|
|
1814
1816
|
background: { type: "string" },
|
|
1817
|
+
localPath: {
|
|
1818
|
+
type: "string",
|
|
1819
|
+
required: true,
|
|
1820
|
+
description: "Absolute path to the original PNG on the DSH host."
|
|
1821
|
+
},
|
|
1815
1822
|
quality: { type: "string" },
|
|
1816
1823
|
size: { type: "string" }
|
|
1817
1824
|
}
|
|
@@ -1972,6 +1979,7 @@ function createCodexImageTool(options) {
|
|
|
1972
1979
|
const result = {
|
|
1973
1980
|
image: imageReference(ref),
|
|
1974
1981
|
original,
|
|
1982
|
+
localPath: options.originalImages.originalPath(original.assetId),
|
|
1975
1983
|
...metadata.background === void 0 ? {} : { background: metadata.background },
|
|
1976
1984
|
...metadata.quality === void 0 ? {} : { quality: metadata.quality },
|
|
1977
1985
|
...metadata.size === void 0 ? {} : { size: metadata.size }
|
|
@@ -2044,6 +2052,9 @@ var OriginalImageStore = class {
|
|
|
2044
2052
|
if (!ORIGINAL_IMAGE_ID_PATTERN.test(assetId)) throw new TypeError("invalid original image asset id");
|
|
2045
2053
|
return join(this.root, assetId.slice(4, 6), assetId);
|
|
2046
2054
|
}
|
|
2055
|
+
originalPath(assetId) {
|
|
2056
|
+
return join(this.directory(assetId), "original");
|
|
2057
|
+
}
|
|
2047
2058
|
async save(sessionId, data, name = "codex-generated-original.png") {
|
|
2048
2059
|
if (!validSessionId(sessionId) || !(data instanceof Uint8Array) || data.byteLength === 0 || data.byteLength > 48 * 1024 * 1024) throw new TypeError("invalid original image input");
|
|
2049
2060
|
const { width, height } = pngDimensions(data);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-codex-subscription",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "Use ChatGPT and Codex subscriptions in DeepSeek Harness with OAuth, quota, safe resets, web search, images, and Fast mode",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"README.en.md",
|
|
18
18
|
"README.zh-CN.md",
|
|
19
19
|
"DIRECTORY.md",
|
|
20
|
-
"AGENTS.md",
|
|
21
20
|
"compatibility.json",
|
|
22
21
|
"LICENSE",
|
|
23
22
|
"SECURITY.md",
|
package/AGENTS.md
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# Agent installation guide
|
|
2
|
-
|
|
3
|
-
Use this guide when a user asks an Agent to install, update, verify, or remove
|
|
4
|
-
`dsh-codex-subscription` in a selected DeepSeek Harness profile.
|
|
5
|
-
|
|
6
|
-
## Safety
|
|
7
|
-
|
|
8
|
-
- Confirm the target DSH installation and profile. Use `web` only when it is the user's target.
|
|
9
|
-
- Use the exact `1.13.0` package below; do not install a moving branch.
|
|
10
|
-
- Never print OAuth credentials, account IDs, authorization callbacks, or credential-store contents.
|
|
11
|
-
- Preserve the DSH profile, unrelated plugins, sessions, and saved sign-in.
|
|
12
|
-
- Do not start, stop, or restart DSH without explicit permission.
|
|
13
|
-
- If more than one DSH installation exists, ask which one is the target before changing it.
|
|
14
|
-
|
|
15
|
-
## Locate DSH
|
|
16
|
-
|
|
17
|
-
On Windows, check the standard DSH and official npm entry points without recursively scanning disks:
|
|
18
|
-
|
|
19
|
-
```powershell
|
|
20
|
-
Get-Command dsh -ErrorAction SilentlyContinue
|
|
21
|
-
Get-Command npx -ErrorAction SilentlyContinue
|
|
22
|
-
Get-CimInstance Win32_Process -Filter "Name = 'node.exe'" |
|
|
23
|
-
Where-Object { $_.CommandLine -match '@deepseek-ai[\\/]dsh[\\/]lib[\\/]bin\.js' } |
|
|
24
|
-
Select-Object ExecutablePath, CommandLine
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
DSH-Portable exposes the same standard `dsh plugin` contract. Missing system pnpm is normal; do not
|
|
28
|
-
install it globally for this plugin. If several targets remain possible, stop and ask the user which one
|
|
29
|
-
to change.
|
|
30
|
-
|
|
31
|
-
## Install or update
|
|
32
|
-
|
|
33
|
-
For an official DSH installation run through npm, keep the complete `npx` prefix because the official
|
|
34
|
-
run command does not create a global `dsh` command:
|
|
35
|
-
|
|
36
|
-
```sh
|
|
37
|
-
npx -y @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add dsh-codex-subscription@1.13.0
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
With an existing global `dsh` command:
|
|
41
|
-
|
|
42
|
-
```sh
|
|
43
|
-
dsh plugin --profile web add dsh-codex-subscription@1.13.0
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Use the same `add` command to update or repair. This is the complete package-changing operation.
|
|
47
|
-
Do not download pnpm, create a second package store, save profile snapshots, add a resident manager,
|
|
48
|
-
or restart DSH automatically. The DSH CLI owns package resolution, locking, and profile composition.
|
|
49
|
-
|
|
50
|
-
## Verify
|
|
51
|
-
|
|
52
|
-
Use the same executable selected above:
|
|
53
|
-
|
|
54
|
-
```sh
|
|
55
|
-
dsh plugin --profile web list dsh-codex-subscription --depth 0
|
|
56
|
-
dsh --profile web --dump-config
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
For the official npm route, run the same checks with `npx -y @deepseek-ai/dsh@0.1.2-rc.1` in place of `dsh`.
|
|
60
|
-
|
|
61
|
-
1. `dsh-codex-subscription` version `1.13.0` appears exactly once.
|
|
62
|
-
2. `codex-subscription` appears exactly once in the composed config.
|
|
63
|
-
3. No unrelated plugin or profile was changed and DSH was not restarted.
|
|
64
|
-
|
|
65
|
-
With permission to restart DSH, open **Settings -> Codex** and verify the settings page loads. Confirm
|
|
66
|
-
that search offers **Auto**, **DSH default**, and **Codex subscription**, the composer quota switch defaults
|
|
67
|
-
to off, and `codex_image_generate` is available. Do not consume quota merely to test installation unless
|
|
68
|
-
the user explicitly asks for a live model, search, or image-generation check.
|
|
69
|
-
|
|
70
|
-
## Uninstall
|
|
71
|
-
|
|
72
|
-
```sh
|
|
73
|
-
dsh plugin --profile web remove dsh-codex-subscription
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
For the official npm route:
|
|
77
|
-
|
|
78
|
-
```sh
|
|
79
|
-
npx -y @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web remove dsh-codex-subscription
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Uninstall removes only this plugin. It must preserve the profile, sessions, other plugins, and saved
|
|
83
|
-
ChatGPT sign-in. Signing out is a separate action and requires explicit permission.
|
|
84
|
-
|
|
85
|
-
## Failure handling
|
|
86
|
-
|
|
87
|
-
Distinguish command discovery, network, HTTP/TLS, package-manager, profile-lock, version, and peer
|
|
88
|
-
dependency failures. Do not disable TLS validation, delete a lock owned by a live process, install a
|
|
89
|
-
second package manager, wipe a profile, expose credentials, or switch to another paid route.
|
|
90
|
-
|
|
91
|
-
On failure, report the sanitized command error, DSH version, selected profile, requested plugin version,
|
|
92
|
-
installation mode, what changed, and what remains unverified. A successful CLI exit is not live UI
|
|
93
|
-
acceptance.
|