dsh-codex-subscription 0.3.0 → 0.3.6

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/AGENTS.md CHANGED
@@ -6,7 +6,7 @@ Use this guide when a user asks an Agent to install, update, verify, or remove
6
6
  ## Safety
7
7
 
8
8
  - Confirm the target DSH profile; use `web` only when it is the user's target.
9
- - Use the pinned `v0.3.0` release assets for a first install, never a moving branch.
9
+ - Use the pinned `v0.3.6` release assets for a first install, never a moving branch.
10
10
  - Never print OAuth credentials, account IDs, authorization callbacks, or the
11
11
  credential store.
12
12
  - Do not start, stop, or restart DSH without explicit permission.
@@ -51,7 +51,7 @@ the user which installation is the target.
51
51
  Download the fixed release asset to a visible file, then invoke the requested action:
52
52
 
53
53
  ```powershell
54
- curl.exe -fL https://github.com/WSL043/dsh-codex-subscription/releases/download/v0.3.0/dsh-codex.ps1 -o "$env:TEMP\dsh-codex.ps1"
54
+ curl.exe -fL https://github.com/WSL043/dsh-codex-subscription/releases/download/v0.3.6/dsh-codex.ps1 -o "$env:TEMP\dsh-codex.ps1"
55
55
  powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$env:TEMP\dsh-codex.ps1" Install
56
56
  ```
57
57
 
@@ -59,7 +59,7 @@ If `curl.exe` is unavailable, download the same pinned asset without executing
59
59
  remote text in memory:
60
60
 
61
61
  ```powershell
62
- Invoke-WebRequest -UseBasicParsing -Uri 'https://github.com/WSL043/dsh-codex-subscription/releases/download/v0.3.0/dsh-codex.ps1' -OutFile "$env:TEMP\dsh-codex.ps1"
62
+ Invoke-WebRequest -UseBasicParsing -Uri 'https://github.com/WSL043/dsh-codex-subscription/releases/download/v0.3.6/dsh-codex.ps1' -OutFile "$env:TEMP\dsh-codex.ps1"
63
63
  powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$env:TEMP\dsh-codex.ps1" Install
64
64
  ```
65
65
 
@@ -93,7 +93,7 @@ When `dsh`, Node.js, and pnpm are already available, install the pinned npm
93
93
  package directly:
94
94
 
95
95
  ```sh
96
- dsh plugin --profile web add dsh-codex-subscription@0.3.0
96
+ dsh plugin --profile web add dsh-codex-subscription@0.3.6
97
97
  ```
98
98
 
99
99
  Update with `dsh plugin --profile web update dsh-codex-subscription`. When
package/README.en.md CHANGED
@@ -13,7 +13,7 @@ tools, permissions, image generation, search choice, and quota stay in one place
13
13
 
14
14
  [Agent install](#let-an-agent-install-it-recommended) · [Windows install](#manual-windows-install) · [Update or uninstall](#update-and-uninstall)
15
15
 
16
- ![Codex subscription settings in DeepSeek Harness](docs/assets/settings-en.png)
16
+ ![Codex subscription settings in DeepSeek Harness](https://github.com/WSL043/dsh-codex-subscription/releases/latest/download/settings-en.png)
17
17
 
18
18
  Settings shows sign-in, search source, and the separate standard Codex and Spark
19
19
  quota returned by the service.
@@ -108,7 +108,7 @@ subscription search when wanted.
108
108
 
109
109
  ## How quota is shown
110
110
 
111
- ![Codex quota inside the composer](docs/assets/composer-quota-en.png)
111
+ ![Codex quota inside the composer](https://github.com/WSL043/dsh-codex-subscription/releases/latest/download/composer-quota-en.png)
112
112
 
113
113
  - Settings always shows the detailed quota returned by the backend. The compact percentage is Beta and off by default;
114
114
  - When enabled, it appears inside the composer before the model name and only while a Codex model is selected;
package/README.md CHANGED
@@ -5,14 +5,12 @@
5
5
  [![License: MIT](https://img.shields.io/badge/license-MIT-111111.svg)](LICENSE)
6
6
  [![GitHub stars](https://img.shields.io/github/stars/WSL043/dsh-codex-subscription?style=flat&logo=github&label=stars)](https://github.com/WSL043/dsh-codex-subscription/stargazers)
7
7
 
8
- [English](README.en.md)
9
-
10
8
  在 DeepSeek Harness 中直接登录 ChatGPT 并使用 Codex 订阅,不需要 OpenAI API Key,
11
9
  也不依赖 Codex CLI。保留 DSH 原有的会话、工具和权限,还能生成图片、切换联网搜索来源并查看额度。
12
10
 
13
- [交给 Agent 安装](#交给-agent推荐) · [Windows 手动安装](#windows-手动安装) · [更新与卸载](#更新与卸载)
11
+ [交给 Agent 安装](#交给-agent推荐) · [Windows 手动安装](#windows-手动安装) · [更新与卸载](#更新与卸载) · [English](#english)
14
12
 
15
- ![DeepSeek Harness 的 Codex 订阅设置](docs/assets/settings.png)
13
+ ![DeepSeek Harness 的 Codex 订阅设置](https://github.com/WSL043/dsh-codex-subscription/releases/latest/download/settings.png)
16
14
 
17
15
  设置页会显示登录状态、搜索来源,以及服务端实际返回的普通 Codex 与 Spark 独立额度。
18
16
 
@@ -97,7 +95,7 @@ Codex 订阅搜索复用同一份 ChatGPT 登录,不需要 OpenAI API Key。
97
95
 
98
96
  ## 额度如何显示
99
97
 
100
- ![输入框内的 Codex 剩余额度](docs/assets/composer-quota-en.png)
98
+ ![输入框内的 Codex 剩余额度](https://github.com/WSL043/dsh-codex-subscription/releases/latest/download/composer-quota-en.png)
101
99
 
102
100
  - 设置页始终展示服务端返回的详细额度;快捷百分比是 Beta 功能,默认关闭;
103
101
  - 开启后,百分比会显示在输入框内、模型名称左侧,只在选择 Codex 模型时出现;
@@ -167,4 +165,29 @@ DSH 插件相关交流也可以前往
167
165
  [DeepSeek Harness Discussions](https://github.com/deepseek-ai/deepseek-harness/discussions)。
168
166
  敏感问题请先阅读 [SECURITY.md](SECURITY.md)。
169
167
 
168
+ ## English
169
+
170
+ Use your ChatGPT / Codex subscription directly in DeepSeek Harness without an
171
+ OpenAI API key or Codex CLI. The plugin supports Codex image generation, lets
172
+ you choose DSH or Codex subscription search, and shows the quota returned by the
173
+ service.
174
+
175
+ **Agent install:** send this
176
+ [installation guide](https://raw.githubusercontent.com/WSL043/dsh-codex-subscription/main/AGENTS.md)
177
+ to your Agent.
178
+
179
+ **Windows install:** open PowerShell and run these two lines:
180
+
181
+ ```powershell
182
+ curl.exe -fL https://github.com/WSL043/dsh-codex-subscription/releases/latest/download/dsh-codex.ps1 -o "$env:TEMP\dsh-codex.ps1"
183
+ powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$env:TEMP\dsh-codex.ps1" Install
184
+ ```
185
+
186
+ DSH-Portable is supported without a separate Node.js or pnpm installation.
187
+ After the first install, use `dsh-codex update` to update and
188
+ `dsh-codex uninstall` to remove it. Open **Settings -> Codex**, sign in with a
189
+ ChatGPT account that has Codex access, choose a search source, and select a Codex
190
+ model. For full usage and troubleshooting, see the
191
+ [English documentation](https://github.com/WSL043/dsh-codex-subscription/blob/main/README.en.md).
192
+
170
193
  [MIT](LICENSE)
package/dsh-codex.ps1 CHANGED
@@ -32,8 +32,8 @@ if ($Managed -and -not $PSBoundParameters.ContainsKey('Action')) {
32
32
 
33
33
  $PackageName = 'dsh-codex-subscription'
34
34
  $LegacyPackageName = '@wsl043/dsh-codex-subscription'
35
- $PackageVersion = '0.3.0'
36
- $PackageSpec = 'https://github.com/WSL043/dsh-codex-subscription/releases/download/v0.3.0/dsh-codex-subscription.tgz'
35
+ $PackageVersion = '0.3.6'
36
+ $PackageSpec = 'https://github.com/WSL043/dsh-codex-subscription/releases/download/v0.3.6/dsh-codex-subscription.tgz'
37
37
  $PnpmVersion = '11.19.0'
38
38
  $PnpmUrl = 'https://registry.npmjs.org/pnpm/-/pnpm-11.19.0.tgz'
39
39
  $PnpmSha512 = '7881F3ED590D472C4A955E2B88B2121791116066DCC88CBCA3849EC9B60F1BBAA6D2CCB221FA91DA4E1C65BEF2BCBE379365AEA7AC539C7BF86DEDC3A1B22DCE'
@@ -71,8 +71,12 @@ function Invoke-LatestManager {
71
71
  param([Parameter(Mandatory = $true)][string] $InstalledCommandRoot)
72
72
 
73
73
  Write-Host 'Checking the latest immutable release...'
74
- $releaseResponse = Invoke-WebRequest -UseBasicParsing -Uri $ReleaseApi -Headers @{
74
+ $releaseSeparator = if ($ReleaseApi.Contains('?')) { '&' } else { '?' }
75
+ $releaseUri = $ReleaseApi + $releaseSeparator + 'cache_bust=' + [DateTime]::UtcNow.Ticks
76
+ $releaseResponse = Invoke-WebRequest -UseBasicParsing -Uri $releaseUri -Headers @{
75
77
  Accept = 'application/vnd.github+json'
78
+ 'Cache-Control' = 'no-cache'
79
+ Pragma = 'no-cache'
76
80
  'User-Agent' = 'dsh-codex'
77
81
  }
78
82
  try {
@@ -599,7 +603,7 @@ function Invoke-DshCommand {
599
603
  if ($LASTEXITCODE -ne 0) { throw "dsh failed with exit code $LASTEXITCODE." }
600
604
  }
601
605
 
602
- function Get-InstalledPackageNames {
606
+ function Get-InstalledPackages {
603
607
  param([Parameter(Mandatory = $true)] $Target)
604
608
 
605
609
  $json = Invoke-DshCommand -Target $Target -Arguments @(
@@ -618,7 +622,17 @@ function Get-InstalledPackageNames {
618
622
  $dependenciesProperty = $project.PSObject.Properties['dependencies']
619
623
  if ($null -eq $dependenciesProperty -or $null -eq $dependenciesProperty.Value) { continue }
620
624
  foreach ($property in $dependenciesProperty.Value.PSObject.Properties) {
621
- Write-Output ([string] $property.Name)
625
+ $version = $null
626
+ if ($null -ne $property.Value) {
627
+ $versionProperty = $property.Value.PSObject.Properties['version']
628
+ if ($null -ne $versionProperty -and $null -ne $versionProperty.Value) {
629
+ $version = [string] $versionProperty.Value
630
+ }
631
+ }
632
+ Write-Output ([pscustomobject]@{
633
+ Name = [string] $property.Name
634
+ Version = $version
635
+ })
622
636
  }
623
637
  }
624
638
  }
@@ -686,9 +700,10 @@ try {
686
700
  $env:npm_config_store_dir = $pnpmStore
687
701
  }
688
702
 
689
- $installedBefore = @(Get-InstalledPackageNames -Target $target)
690
- $hadPackage = $installedBefore -contains $PackageName
691
- $hadLegacyPackage = $installedBefore -contains $LegacyPackageName
703
+ $installedBefore = @(Get-InstalledPackages -Target $target)
704
+ $installedBeforeNames = @($installedBefore | ForEach-Object { $_.Name })
705
+ $hadPackage = $installedBeforeNames -contains $PackageName
706
+ $hadLegacyPackage = $installedBeforeNames -contains $LegacyPackageName
692
707
 
693
708
  if ($Action -eq 'Uninstall') {
694
709
  if ($hadPackage) {
@@ -726,9 +741,10 @@ try {
726
741
  $config = Invoke-DshCommand -Target $target -Arguments @('--profile', $Profile, '--dump-config') -Capture
727
742
  $entryCount = ([regex]::Matches($config, '(?<![A-Za-z0-9_-])codex-subscription(?![A-Za-z0-9_-])')).Count
728
743
  $legacyEntryCount = ([regex]::Matches($config, '(?<![A-Za-z0-9_-])wsl043-codex-subscription(?![A-Za-z0-9_-])')).Count
729
- $installedAfter = @(Get-InstalledPackageNames -Target $target)
744
+ $installedAfter = @(Get-InstalledPackages -Target $target)
745
+ $installedAfterNames = @($installedAfter | ForEach-Object { $_.Name })
730
746
  if ($Action -eq 'Uninstall') {
731
- if (($installedAfter -contains $PackageName) -or ($installedAfter -contains $LegacyPackageName)) {
747
+ if (($installedAfterNames -contains $PackageName) -or ($installedAfterNames -contains $LegacyPackageName)) {
732
748
  throw 'The plugin package is still present after uninstall.'
733
749
  }
734
750
  if ($entryCount -ne 0 -or $legacyEntryCount -ne 0) {
@@ -737,8 +753,13 @@ try {
737
753
  Remove-ManagerCommand -Directory $managerCommandRoot
738
754
  Write-Host 'Uninstalled. The DSH profile and saved credentials were kept.'
739
755
  } else {
740
- if (-not ($installedAfter -contains $PackageName)) { throw 'The installed package did not appear in the DSH plugin list.' }
741
- if ($installedAfter -contains $LegacyPackageName) { throw 'The legacy package is still present after migration.' }
756
+ $installedPackage = @($installedAfter | Where-Object { $_.Name -eq $PackageName } | Select-Object -First 1)
757
+ if ($installedPackage.Count -eq 0) { throw 'The installed package did not appear in the DSH plugin list.' }
758
+ if ($installedPackage[0].Version -ne $PackageVersion) {
759
+ $foundVersion = if ($installedPackage[0].Version) { $installedPackage[0].Version } else { 'unknown' }
760
+ throw "DSH did not install the requested package version: expected $PackageVersion, found $foundVersion."
761
+ }
762
+ if ($installedAfterNames -contains $LegacyPackageName) { throw 'The legacy package is still present after migration.' }
742
763
  if ($entryCount -ne 1) { throw "Expected one plugin profile entry, found $entryCount." }
743
764
  if ($legacyEntryCount -ne 0) { throw 'The legacy plugin profile entry is still present after migration.' }
744
765
  Install-ManagerCommand -Directory $managerCommandRoot
package/lib/index.js CHANGED
@@ -540,7 +540,7 @@ function createCodexSearchProvider(options) {
540
540
  accept: "application/json",
541
541
  "content-type": "application/json",
542
542
  originator: "pi",
543
- "user-agent": "dsh-codex-subscription/0.3.0"
543
+ "user-agent": "dsh-codex-subscription/0.3.6"
544
544
  },
545
545
  body: JSON.stringify({
546
546
  id,
@@ -929,7 +929,7 @@ function createCodexUsageReader(options) {
929
929
  "chatgpt-account-id": accountId,
930
930
  accept: "application/json",
931
931
  "cache-control": "no-store",
932
- "user-agent": "dsh-codex-subscription/0.3.0"
932
+ "user-agent": "dsh-codex-subscription/0.3.6"
933
933
  },
934
934
  signal: requestSignal(signal, timeoutMs)
935
935
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-codex-subscription",
3
- "version": "0.3.0",
3
+ "version": "0.3.6",
4
4
  "packageManager": "pnpm@11.19.0",
5
5
  "description": "ChatGPT and Codex subscriptions for DeepSeek Harness with OAuth login, image generation, quota, and subscription web search",
6
6
  "type": "module",
@@ -73,7 +73,7 @@
73
73
  "bugs": {
74
74
  "url": "https://github.com/WSL043/dsh-codex-subscription/issues"
75
75
  },
76
- "homepage": "https://github.com/WSL043/dsh-codex-subscription#readme",
76
+ "homepage": "https://github.com/WSL043/dsh-codex-subscription",
77
77
  "engines": {
78
78
  "node": "^22.19.0 || >=24.0.0"
79
79
  },