tabby-ai-assistant 1.0.2 → 1.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabby-ai-assistant",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Tabby终端AI助手插件 - 支持多AI提供商(OpenAI、Anthropic、Minimax、GLM)",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -191,7 +191,13 @@ export function secureCompare(a: any, b: any): boolean {
191
191
 
192
192
  let result = 0;
193
193
  for (let i = 0; i < strA.length; i++) {
194
- result |= strA.charCodeAt(i) ^ strB.charCodeAt(i);
194
+ const codeA = strA.charCodeAt(i);
195
+ const codeB = strB.charCodeAt(i);
196
+ // 确保charCodeAt返回有效值
197
+ if (typeof codeA !== 'number' || typeof codeB !== 'number') {
198
+ return false;
199
+ }
200
+ result |= codeA ^ codeB;
195
201
  }
196
202
 
197
203
  return result === 0;