dsh-codex-subscription 0.3.0 → 0.3.1

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.1` 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.1/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.1/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.1
97
97
  ```
98
98
 
99
99
  Update with `dsh plugin --profile web update dsh-codex-subscription`. When
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.1'
36
+ $PackageSpec = 'https://github.com/WSL043/dsh-codex-subscription/releases/download/v0.3.1/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.1"
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.1"
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.1",
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",