pi-ccswitch-auto-switch 0.3.13 → 0.3.14

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 (3) hide show
  1. package/index.ts +1 -1
  2. package/package.json +1 -1
  3. package/runner.mjs +2 -1
package/index.ts CHANGED
@@ -17,7 +17,7 @@ const roundLimitMs = (): number => {
17
17
  return Number.isFinite(override) && override > 0 ? override : ROUND_LIMIT_DEFAULT
18
18
  }
19
19
  const RPC_PROTOCOL_VERSION = 1
20
- const EXTENSION_VERSION = '0.3.13'
20
+ const EXTENSION_VERSION = '0.3.14'
21
21
  // 同端点(BaseURL 相同)连续失败达到该次数即隔离该端点,避免同一个平台的多个模型逐个试错耗尽本轮切换
22
22
  const ENDPOINT_FAIL_THRESHOLD = 3
23
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-ccswitch-auto-switch",
3
- "version": "0.3.13",
3
+ "version": "0.3.14",
4
4
  "description": "Provider-first automatic model failover extension for Pi and CC Switch",
5
5
  "license": "MIT",
6
6
  "keywords": [
package/runner.mjs CHANGED
@@ -376,5 +376,6 @@ export async function main(argv = process.argv.slice(2)) {
376
376
  }
377
377
  }
378
378
 
379
- const invoked = process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)
379
+ const invokedPath = process.argv[1] && await realpath(resolve(process.argv[1])).catch(() => undefined)
380
+ const invoked = invokedPath === fileURLToPath(import.meta.url)
380
381
  if (invoked) main().then(code => { process.exitCode = code })