claude-scionos 4.1.6 → 4.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/routerlab.js +6 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-scionos",
3
- "version": "4.1.6",
3
+ "version": "4.1.7",
4
4
  "description": "RouterLab launcher, strategy proxy and secure token wrapper for Claude Code CLI",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/src/routerlab.js CHANGED
@@ -207,6 +207,10 @@ function hasNonEmptyWindowsTokenFile(tokenFile) {
207
207
  }
208
208
  }
209
209
 
210
+ function encodeTokenForPowerShell(token) {
211
+ return Buffer.from(token, 'utf8').toString('base64');
212
+ }
213
+
210
214
  function getServiceStrategies(serviceValue = DEFAULT_SERVICE) {
211
215
  const service = getServiceConfig(serviceValue);
212
216
  if (!service?.strategyValues?.length) {
@@ -442,14 +446,14 @@ function storeToken(token, serviceValue = DEFAULT_SERVICE) {
442
446
 
443
447
  if (process.platform === 'win32') {
444
448
  const tokenFile = getWindowsTokenFile(service.value);
449
+ const encodedToken = encodeTokenForPowerShell(token);
445
450
  fs.mkdirSync(path.dirname(tokenFile), {recursive: true});
446
451
  runPowerShell(
447
- '$token = [Console]::In.ReadToEnd(); if ([string]::IsNullOrEmpty($token)) { throw "Token input is empty" }; $secure = ConvertTo-SecureString $token -AsPlainText -Force; $encrypted = ConvertFrom-SecureString $secure; Set-Content -Path $env:SCIONOS_TOKEN_FILE -Value $encrypted -NoNewline',
452
+ `$token = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('${encodedToken}')); if ([string]::IsNullOrEmpty($token)) { throw "Token input is empty" }; $secure = ConvertTo-SecureString $token -AsPlainText -Force; $encrypted = ConvertFrom-SecureString $secure; Set-Content -Path $env:SCIONOS_TOKEN_FILE -Value $encrypted -NoNewline`,
448
453
  {
449
454
  env: {
450
455
  SCIONOS_TOKEN_FILE: tokenFile,
451
456
  },
452
- input: token,
453
457
  },
454
458
  );
455
459