@acosmi/sdk-ts 2.19.5 → 2.20.0

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.
@@ -256,8 +256,25 @@ interface ManagedModel {
256
256
  defaultToolIds?: string[];
257
257
  /** 该模型对当前用户档位是否被限制策略锁定 (limit_policy allowedModels 不含)。true=展示但置灰+升级引导。enforced 关/解析失败=false。 */
258
258
  locked?: boolean;
259
- /** 是否属于"免费会员可用"分区 (FREE 档 allowedModels 内)。与当前用户档位无关 (仅分类)。 */
259
+ /**
260
+ * 是否属于"免费会员可用"分区 (PLAN:FREE 档 allowedModels 内)。与当前用户档位无关 (仅分类)。
261
+ *
262
+ * **语义不变, 但不再是展示分区的依据**: 订阅双池之后, 「哪些模型先扣精选免费池」由
263
+ * {@link ManagedModel.freePoolEligible} 表达, 与 FREE 档的 allowedModels 是两套独立的集合
264
+ * (两者可以不一致: 某模型可以 `freePoolEligible: true` 而 `freeTier: false`, 反之亦然)。
265
+ * 新代码不要再用本字段分区或打"精选"角标。字段保留只为老客户端零破坏 (方案 D-14)。
266
+ */
260
267
  freeTier?: boolean;
268
+ /**
269
+ * [订阅双池 P5 / D-14] 该模型当前是否有资格先扣**精选免费池 F** (池类 FREE, 或仍在限免期内的 PROMO_FREE)。
270
+ * 网关随 `effective-model-policy` 的 `freePoolModels` 投影下发, 与 {@link QuotaSummaryFreePool.eligibleModels}
271
+ * 同源。用于模型选择器的「精选」角标。
272
+ *
273
+ * **缺席 = 老网关 (还没有双池), 不是 `false`**: `true` = 有资格; `false` = 明确没有 (走付费池 P);
274
+ * `undefined` = 网关不知道这件事。展示端只在 `=== true` 时画角标, 绝不在 `!== false` 时画。
275
+ * 限免到期是随时间翻转的: 同一模型今天 `true`、截止后 `false`, 不要缓存跨过 `promo_until`。
276
+ */
277
+ freePoolEligible?: boolean;
261
278
  /**
262
279
  * 上游 gateway 为此模型启用的请求格式列表
263
280
  * 取值: "anthropic" | "openai"
@@ -357,11 +374,65 @@ interface QuotaSummarySubscriptionPool {
357
374
  expiresAt?: string;
358
375
  /** 网关下发的单位标识 */
359
376
  unit: string;
377
+ /**
378
+ * [W-RESET-CARD-WEEKLY-QUOTA-20260920 D-13] 池里由**加油包**贡献的剩余额度 (微 Credits)。
379
+ *
380
+ * 网关由 alive 的 COMMERCIAL 桶中 `sourceType === 'booster_pack'` 的那些行求和派生。
381
+ *
382
+ * **缺席 = 老网关, 或此刻一个加油包都没有 —— 两种都不可当 0 读。** 展示端的合同是
383
+ * 「三个 booster* 字段齐全才渲染副行」, 少一个就整条不画; 把缺席当 0 渲染, 等于在老网关上
384
+ * 向用户断言「你没有加油包」, 而真相是客户端不知道。
385
+ */
386
+ boosterRemaining?: number;
387
+ /**
388
+ * [W-RESET-CARD-WEEKLY-QUOTA-20260920 D-13] 上述 alive 加油包桶的**个数** (一行 = 一个加油包)。
389
+ * 缺席语义同 boosterRemaining。
390
+ */
391
+ boosterCount?: number;
392
+ /**
393
+ * [W-RESET-CARD-WEEKLY-QUOTA-20260920 D-13] 上述 alive 加油包中最早的到期时刻 (ISO-8601)。
394
+ *
395
+ * 缺席有第三种可能: 加油包确实存在、但全是永久桶 (不参与到期选举) —— 与 expiresAt 同口径。
396
+ * 所以它缺席时仍可能有 boosterRemaining / boosterCount, 展示端据此决定要不要说「最早 X 到期」。
397
+ */
398
+ boosterNextExpiresAt?: string;
399
+ }
400
+ /**
401
+ * 精选免费池视图 — QuotaSummary.freePool 的形状 (订阅双池 P5 / D-14, SDK 2.20.0 起)。
402
+ *
403
+ * 付费合同里随每个订阅周期一起发放的**精选免费池 F**: 只能被池类为 FREE / 限免中的 PROMO_FREE 的模型
404
+ * 先扣, 用完后同一请求自动溢出扣付费池 P ({@link QuotaSummarySubscriptionPool}, 语义不变)。
405
+ * quota / used / remaining 的单位与 subscriptionPool 一致, 为**微 Credits** (÷1000 = Credits)。
406
+ *
407
+ * **和 `freeTotalEtu` / `freeBuckets` 不是一回事**: 后者是 GENERIC (注册赠送 / 邀请奖励 / 试用)
408
+ * 桶合计, 与订阅合同无关; `freePool` 是付费合同自带的那一半额度。两者不可相加, 也不可互相替代。
409
+ */
410
+ interface QuotaSummaryFreePool {
411
+ /** 池总额度 (微 Credits) */
412
+ quota: number;
413
+ /** 已用额度 (微 Credits) */
414
+ used: number;
415
+ /** 剩余额度 (微 Credits) */
416
+ remaining: number;
417
+ /** 到期时间 (ISO-8601); 网关未下发时缺失, 口径同 {@link QuotaSummarySubscriptionPool.expiresAt} */
418
+ expiresAt?: string;
419
+ /** 恒为 `'MICRO_CREDIT'` */
420
+ unit: 'MICRO_CREDIT';
421
+ /**
422
+ * 当前有资格扣本池的模型 id 集合 = 池类 FREE ∪ 仍在限免期的 PROMO_FREE (如 `deepseek-flash`)。
423
+ * **可以是空数组**: `[]` = 网关明确说「此刻没有任何模型有资格」, 与字段缺席不是一回事。
424
+ */
425
+ eligibleModels: string[];
360
426
  }
427
+ /** 计量口径: `OFFICIAL_CNY` = 1 Credit = ¥0.000001 官方价 (新合同); `COST_CNY` = 成本口径 (老合同)。 */
428
+ type QuotaSummaryCreditUnit = 'OFFICIAL_CNY' | 'COST_CNY';
361
429
  /**
362
430
  * GET /api/v4/entitlements/quota-summary 返回体, 调用 client.getQuotaSummary 获取.
363
431
  *
364
432
  * 设计目的: 个人中心钱包栏一次性展示"我还有多少免费 + 多少付费"+ 各自最近到期时间.
433
+ *
434
+ * 注意「免费」一词有两层含义: `freeTotalEtu` / `freeBuckets` 是 GENERIC 赠送桶 (与合同无关);
435
+ * 订阅合同自带的精选免费池是 {@link QuotaSummary.freePool}。
365
436
  */
366
437
  interface QuotaSummary {
367
438
  /** GENERIC (免费/赠送) alive 桶 tokenRemaining 求和 */
@@ -388,6 +459,22 @@ interface QuotaSummary {
388
459
  * (÷1000 = Credits)。缺席 = 老网关, 或当前没有 alive 付费桶 —— 两种都不可当 0 处理。
389
460
  */
390
461
  subscriptionPool?: QuotaSummarySubscriptionPool;
462
+ /**
463
+ * [订阅双池 P5 / D-14, 2.20.0] 精选免费池 F。`subscriptionPool` 的语义**不变**, 恒为付费池 P。
464
+ *
465
+ * **缺席 = 老合同 (没有 F), 或老网关 (还不认识 F) —— 两种都不可当 0 读**: 把缺席画成
466
+ * 「精选额度 0 / 已用满」是在向老合同用户断言一件不存在的事。展示端只在 `freePool !== undefined`
467
+ * 时画第二条进度条。
468
+ */
469
+ freePool?: QuotaSummaryFreePool;
470
+ /**
471
+ * [订阅双池 P5 / D-14, 2.20.0] 本响应里所有 Credit 数值的计量口径, 让客户端把 Credits 换算成 ¥ 时能标注口径。
472
+ * `OFFICIAL_CNY` = 新合同 (1 Credit = ¥0.000001 官方价); `COST_CNY` = 老合同 (成本口径)。
473
+ *
474
+ * **缺席 = 老网关, 不能当任一取值读**; 尤其不能默认成 `OFFICIAL_CNY` 去乘 ¥ 单价。
475
+ * 类型是闭集, 但网关将来新增口径时旧版 SDK 会原样透出未知字符串 —— 消费端对未知值应按「不换算」处理。
476
+ */
477
+ creditUnit?: QuotaSummaryCreditUnit;
391
478
  }
392
479
  /**
393
480
  * GET /api/v4/entitlements/window-reset/summary 返回体, 调用 client.getWindowResetSummary 获取.
@@ -683,4 +770,4 @@ interface ProviderAdapter {
683
770
  };
684
771
  }
685
772
 
686
- export { classifySourcesEvent as $, type StreamSettlement as A, BucketClassCommercial as B, type ChatContentBlock as C, ThinkingHigh as D, type EffortConfig as E, ThinkingHighMinMaxTokens as F, type GeoLoc as G, ThinkingLow as H, type ImageGenerationRequest as I, ThinkingMax as J, ThinkingMaxFallbackMaxTokens as K, ThinkingOff as L, type ManagedModel as M, type VideoTaskResponse as N, type OutputConfig as O, type ProviderAdapter as P, type QuotaSummary as Q, type RerankDocument as R, type ServerTool as S, type ThinkingConfig as T, type WebSearchSource as U, type VideoGenerationRequest as V, type WebSearchConfig as W, type WindowLimitStatus as X, type WindowResetSummary as Y, bucketInfoIsCommercial as Z, bucketRowIsCommercial as _, BucketClassGeneric as a, newThinkingConfig as a0, newWebSearchTool as a1, parseSettlement as a2, parseSourcesEvent as a3, type BucketInfo as b, type BucketRow as c, type ChatMessage as d, type ChatRequest as e, type ChatResponse as f, type ChatUsage as g, type EmbeddingData as h, type EmbeddingRequest as i, type EmbeddingResponse as j, type ImageGenerationResponse as k, type InputModality as l, type InputModalityTag as m, type ModelCapabilities as n, type MultimodalContent as o, ProviderFormat as p, type QuotaSummarySubscriptionPool as q, type RerankQuery as r, type RerankRequest as s, type RerankResponse as t, type RerankResult as u, ServerToolTypeWebSearch as v, type SourcesEvent as w, type SourcesEventIssueCode as x, type SourcesEventParseResult as y, type StreamEvent as z };
773
+ export { bucketInfoIsCommercial as $, type SourcesEventParseResult as A, BucketClassCommercial as B, type ChatContentBlock as C, type StreamEvent as D, type EffortConfig as E, type StreamSettlement as F, type GeoLoc as G, ThinkingHigh as H, type ImageGenerationRequest as I, ThinkingHighMinMaxTokens as J, ThinkingLow as K, ThinkingMax as L, type ManagedModel as M, ThinkingMaxFallbackMaxTokens as N, type OutputConfig as O, type ProviderAdapter as P, type QuotaSummary as Q, type RerankDocument as R, type ServerTool as S, type ThinkingConfig as T, ThinkingOff as U, type VideoGenerationRequest as V, type VideoTaskResponse as W, type WebSearchConfig as X, type WebSearchSource as Y, type WindowLimitStatus as Z, type WindowResetSummary as _, BucketClassGeneric as a, bucketRowIsCommercial as a0, classifySourcesEvent as a1, newThinkingConfig as a2, newWebSearchTool as a3, parseSettlement as a4, parseSourcesEvent as a5, type BucketInfo as b, type BucketRow as c, type ChatMessage as d, type ChatRequest as e, type ChatResponse as f, type ChatUsage as g, type EmbeddingData as h, type EmbeddingRequest as i, type EmbeddingResponse as j, type ImageGenerationResponse as k, type InputModality as l, type InputModalityTag as m, type ModelCapabilities as n, type MultimodalContent as o, ProviderFormat as p, type QuotaSummaryCreditUnit as q, type QuotaSummaryFreePool as r, type QuotaSummarySubscriptionPool as s, type RerankQuery as t, type RerankRequest as u, type RerankResponse as v, type RerankResult as w, ServerToolTypeWebSearch as x, type SourcesEvent as y, type SourcesEventIssueCode as z };
@@ -256,8 +256,25 @@ interface ManagedModel {
256
256
  defaultToolIds?: string[];
257
257
  /** 该模型对当前用户档位是否被限制策略锁定 (limit_policy allowedModels 不含)。true=展示但置灰+升级引导。enforced 关/解析失败=false。 */
258
258
  locked?: boolean;
259
- /** 是否属于"免费会员可用"分区 (FREE 档 allowedModels 内)。与当前用户档位无关 (仅分类)。 */
259
+ /**
260
+ * 是否属于"免费会员可用"分区 (PLAN:FREE 档 allowedModels 内)。与当前用户档位无关 (仅分类)。
261
+ *
262
+ * **语义不变, 但不再是展示分区的依据**: 订阅双池之后, 「哪些模型先扣精选免费池」由
263
+ * {@link ManagedModel.freePoolEligible} 表达, 与 FREE 档的 allowedModels 是两套独立的集合
264
+ * (两者可以不一致: 某模型可以 `freePoolEligible: true` 而 `freeTier: false`, 反之亦然)。
265
+ * 新代码不要再用本字段分区或打"精选"角标。字段保留只为老客户端零破坏 (方案 D-14)。
266
+ */
260
267
  freeTier?: boolean;
268
+ /**
269
+ * [订阅双池 P5 / D-14] 该模型当前是否有资格先扣**精选免费池 F** (池类 FREE, 或仍在限免期内的 PROMO_FREE)。
270
+ * 网关随 `effective-model-policy` 的 `freePoolModels` 投影下发, 与 {@link QuotaSummaryFreePool.eligibleModels}
271
+ * 同源。用于模型选择器的「精选」角标。
272
+ *
273
+ * **缺席 = 老网关 (还没有双池), 不是 `false`**: `true` = 有资格; `false` = 明确没有 (走付费池 P);
274
+ * `undefined` = 网关不知道这件事。展示端只在 `=== true` 时画角标, 绝不在 `!== false` 时画。
275
+ * 限免到期是随时间翻转的: 同一模型今天 `true`、截止后 `false`, 不要缓存跨过 `promo_until`。
276
+ */
277
+ freePoolEligible?: boolean;
261
278
  /**
262
279
  * 上游 gateway 为此模型启用的请求格式列表
263
280
  * 取值: "anthropic" | "openai"
@@ -357,11 +374,65 @@ interface QuotaSummarySubscriptionPool {
357
374
  expiresAt?: string;
358
375
  /** 网关下发的单位标识 */
359
376
  unit: string;
377
+ /**
378
+ * [W-RESET-CARD-WEEKLY-QUOTA-20260920 D-13] 池里由**加油包**贡献的剩余额度 (微 Credits)。
379
+ *
380
+ * 网关由 alive 的 COMMERCIAL 桶中 `sourceType === 'booster_pack'` 的那些行求和派生。
381
+ *
382
+ * **缺席 = 老网关, 或此刻一个加油包都没有 —— 两种都不可当 0 读。** 展示端的合同是
383
+ * 「三个 booster* 字段齐全才渲染副行」, 少一个就整条不画; 把缺席当 0 渲染, 等于在老网关上
384
+ * 向用户断言「你没有加油包」, 而真相是客户端不知道。
385
+ */
386
+ boosterRemaining?: number;
387
+ /**
388
+ * [W-RESET-CARD-WEEKLY-QUOTA-20260920 D-13] 上述 alive 加油包桶的**个数** (一行 = 一个加油包)。
389
+ * 缺席语义同 boosterRemaining。
390
+ */
391
+ boosterCount?: number;
392
+ /**
393
+ * [W-RESET-CARD-WEEKLY-QUOTA-20260920 D-13] 上述 alive 加油包中最早的到期时刻 (ISO-8601)。
394
+ *
395
+ * 缺席有第三种可能: 加油包确实存在、但全是永久桶 (不参与到期选举) —— 与 expiresAt 同口径。
396
+ * 所以它缺席时仍可能有 boosterRemaining / boosterCount, 展示端据此决定要不要说「最早 X 到期」。
397
+ */
398
+ boosterNextExpiresAt?: string;
399
+ }
400
+ /**
401
+ * 精选免费池视图 — QuotaSummary.freePool 的形状 (订阅双池 P5 / D-14, SDK 2.20.0 起)。
402
+ *
403
+ * 付费合同里随每个订阅周期一起发放的**精选免费池 F**: 只能被池类为 FREE / 限免中的 PROMO_FREE 的模型
404
+ * 先扣, 用完后同一请求自动溢出扣付费池 P ({@link QuotaSummarySubscriptionPool}, 语义不变)。
405
+ * quota / used / remaining 的单位与 subscriptionPool 一致, 为**微 Credits** (÷1000 = Credits)。
406
+ *
407
+ * **和 `freeTotalEtu` / `freeBuckets` 不是一回事**: 后者是 GENERIC (注册赠送 / 邀请奖励 / 试用)
408
+ * 桶合计, 与订阅合同无关; `freePool` 是付费合同自带的那一半额度。两者不可相加, 也不可互相替代。
409
+ */
410
+ interface QuotaSummaryFreePool {
411
+ /** 池总额度 (微 Credits) */
412
+ quota: number;
413
+ /** 已用额度 (微 Credits) */
414
+ used: number;
415
+ /** 剩余额度 (微 Credits) */
416
+ remaining: number;
417
+ /** 到期时间 (ISO-8601); 网关未下发时缺失, 口径同 {@link QuotaSummarySubscriptionPool.expiresAt} */
418
+ expiresAt?: string;
419
+ /** 恒为 `'MICRO_CREDIT'` */
420
+ unit: 'MICRO_CREDIT';
421
+ /**
422
+ * 当前有资格扣本池的模型 id 集合 = 池类 FREE ∪ 仍在限免期的 PROMO_FREE (如 `deepseek-flash`)。
423
+ * **可以是空数组**: `[]` = 网关明确说「此刻没有任何模型有资格」, 与字段缺席不是一回事。
424
+ */
425
+ eligibleModels: string[];
360
426
  }
427
+ /** 计量口径: `OFFICIAL_CNY` = 1 Credit = ¥0.000001 官方价 (新合同); `COST_CNY` = 成本口径 (老合同)。 */
428
+ type QuotaSummaryCreditUnit = 'OFFICIAL_CNY' | 'COST_CNY';
361
429
  /**
362
430
  * GET /api/v4/entitlements/quota-summary 返回体, 调用 client.getQuotaSummary 获取.
363
431
  *
364
432
  * 设计目的: 个人中心钱包栏一次性展示"我还有多少免费 + 多少付费"+ 各自最近到期时间.
433
+ *
434
+ * 注意「免费」一词有两层含义: `freeTotalEtu` / `freeBuckets` 是 GENERIC 赠送桶 (与合同无关);
435
+ * 订阅合同自带的精选免费池是 {@link QuotaSummary.freePool}。
365
436
  */
366
437
  interface QuotaSummary {
367
438
  /** GENERIC (免费/赠送) alive 桶 tokenRemaining 求和 */
@@ -388,6 +459,22 @@ interface QuotaSummary {
388
459
  * (÷1000 = Credits)。缺席 = 老网关, 或当前没有 alive 付费桶 —— 两种都不可当 0 处理。
389
460
  */
390
461
  subscriptionPool?: QuotaSummarySubscriptionPool;
462
+ /**
463
+ * [订阅双池 P5 / D-14, 2.20.0] 精选免费池 F。`subscriptionPool` 的语义**不变**, 恒为付费池 P。
464
+ *
465
+ * **缺席 = 老合同 (没有 F), 或老网关 (还不认识 F) —— 两种都不可当 0 读**: 把缺席画成
466
+ * 「精选额度 0 / 已用满」是在向老合同用户断言一件不存在的事。展示端只在 `freePool !== undefined`
467
+ * 时画第二条进度条。
468
+ */
469
+ freePool?: QuotaSummaryFreePool;
470
+ /**
471
+ * [订阅双池 P5 / D-14, 2.20.0] 本响应里所有 Credit 数值的计量口径, 让客户端把 Credits 换算成 ¥ 时能标注口径。
472
+ * `OFFICIAL_CNY` = 新合同 (1 Credit = ¥0.000001 官方价); `COST_CNY` = 老合同 (成本口径)。
473
+ *
474
+ * **缺席 = 老网关, 不能当任一取值读**; 尤其不能默认成 `OFFICIAL_CNY` 去乘 ¥ 单价。
475
+ * 类型是闭集, 但网关将来新增口径时旧版 SDK 会原样透出未知字符串 —— 消费端对未知值应按「不换算」处理。
476
+ */
477
+ creditUnit?: QuotaSummaryCreditUnit;
391
478
  }
392
479
  /**
393
480
  * GET /api/v4/entitlements/window-reset/summary 返回体, 调用 client.getWindowResetSummary 获取.
@@ -683,4 +770,4 @@ interface ProviderAdapter {
683
770
  };
684
771
  }
685
772
 
686
- export { classifySourcesEvent as $, type StreamSettlement as A, BucketClassCommercial as B, type ChatContentBlock as C, ThinkingHigh as D, type EffortConfig as E, ThinkingHighMinMaxTokens as F, type GeoLoc as G, ThinkingLow as H, type ImageGenerationRequest as I, ThinkingMax as J, ThinkingMaxFallbackMaxTokens as K, ThinkingOff as L, type ManagedModel as M, type VideoTaskResponse as N, type OutputConfig as O, type ProviderAdapter as P, type QuotaSummary as Q, type RerankDocument as R, type ServerTool as S, type ThinkingConfig as T, type WebSearchSource as U, type VideoGenerationRequest as V, type WebSearchConfig as W, type WindowLimitStatus as X, type WindowResetSummary as Y, bucketInfoIsCommercial as Z, bucketRowIsCommercial as _, BucketClassGeneric as a, newThinkingConfig as a0, newWebSearchTool as a1, parseSettlement as a2, parseSourcesEvent as a3, type BucketInfo as b, type BucketRow as c, type ChatMessage as d, type ChatRequest as e, type ChatResponse as f, type ChatUsage as g, type EmbeddingData as h, type EmbeddingRequest as i, type EmbeddingResponse as j, type ImageGenerationResponse as k, type InputModality as l, type InputModalityTag as m, type ModelCapabilities as n, type MultimodalContent as o, ProviderFormat as p, type QuotaSummarySubscriptionPool as q, type RerankQuery as r, type RerankRequest as s, type RerankResponse as t, type RerankResult as u, ServerToolTypeWebSearch as v, type SourcesEvent as w, type SourcesEventIssueCode as x, type SourcesEventParseResult as y, type StreamEvent as z };
773
+ export { bucketInfoIsCommercial as $, type SourcesEventParseResult as A, BucketClassCommercial as B, type ChatContentBlock as C, type StreamEvent as D, type EffortConfig as E, type StreamSettlement as F, type GeoLoc as G, ThinkingHigh as H, type ImageGenerationRequest as I, ThinkingHighMinMaxTokens as J, ThinkingLow as K, ThinkingMax as L, type ManagedModel as M, ThinkingMaxFallbackMaxTokens as N, type OutputConfig as O, type ProviderAdapter as P, type QuotaSummary as Q, type RerankDocument as R, type ServerTool as S, type ThinkingConfig as T, ThinkingOff as U, type VideoGenerationRequest as V, type VideoTaskResponse as W, type WebSearchConfig as X, type WebSearchSource as Y, type WindowLimitStatus as Z, type WindowResetSummary as _, BucketClassGeneric as a, bucketRowIsCommercial as a0, classifySourcesEvent as a1, newThinkingConfig as a2, newWebSearchTool as a3, parseSettlement as a4, parseSourcesEvent as a5, type BucketInfo as b, type BucketRow as c, type ChatMessage as d, type ChatRequest as e, type ChatResponse as f, type ChatUsage as g, type EmbeddingData as h, type EmbeddingRequest as i, type EmbeddingResponse as j, type ImageGenerationResponse as k, type InputModality as l, type InputModalityTag as m, type ModelCapabilities as n, type MultimodalContent as o, ProviderFormat as p, type QuotaSummaryCreditUnit as q, type QuotaSummaryFreePool as r, type QuotaSummarySubscriptionPool as s, type RerankQuery as t, type RerankRequest as u, type RerankResponse as v, type RerankResult as w, ServerToolTypeWebSearch as x, type SourcesEvent as y, type SourcesEventIssueCode as z };
@@ -2254,7 +2254,8 @@ ${Date.now()}
2254
2254
  release = async () => {
2255
2255
  try {
2256
2256
  await fs.unlink(lockPath);
2257
- } catch {
2257
+ } catch (e) {
2258
+ warnLockCleanupFailed("release", lockPath, e);
2258
2259
  }
2259
2260
  };
2260
2261
  break;
@@ -2271,7 +2272,8 @@ ${Date.now()}
2271
2272
  if (stale) {
2272
2273
  try {
2273
2274
  await fs.unlink(lockPath);
2274
- } catch {
2275
+ } catch (e2) {
2276
+ warnLockCleanupFailed("stale-break", lockPath, e2);
2275
2277
  }
2276
2278
  continue;
2277
2279
  }
@@ -2374,6 +2376,12 @@ ${Date.now()}
2374
2376
  });
2375
2377
  }
2376
2378
  };
2379
+ function warnLockCleanupFailed(stage, lockPath, e) {
2380
+ if (isNotExistError(e)) return;
2381
+ console.warn(
2382
+ `[acosmi-sdk] warning: unlink token file lock (${stage}) failed: ${lockPath}: ${e instanceof Error ? e.message : String(e)}`
2383
+ );
2384
+ }
2377
2385
  function isNotExistError(e) {
2378
2386
  if (typeof e === "object" && e !== null && "code" in e) {
2379
2387
  return e.code === "ENOENT";