@acosmi/sdk-ts 1.1.0 → 1.2.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.
@@ -1,10 +1,53 @@
1
- import { S as ServerMetadata, T as TokenResponse, a as TokenSet, C as ClientRegistration, M as ManagedModel, b as ModelCoefficient, Q as QuotaSummary, c as ModelCapabilities, d as ChatRequest, P as ProviderAdapter, e as ChatResponse, A as AnthropicResponse, f as StreamEvent, g as SourcesEvent, h as StreamSettlement, E as EntitlementBalance, B as BalanceDetail, i as EntitlementItem, j as ConsumeRecordPage, k as ModelByQuotaResponse, l as ModelBucket, m as TokenPackage, n as PayPayload, O as Order, o as OrderStatus, W as WalletStats, p as Transaction, q as SkillStoreQuery, r as SkillStoreItem, s as SkillBrowseResponse, t as SkillBrowseListResponse, u as SkillSummary, v as CertificationStatus, G as GenerateSkillRequest, w as GenerateSkillResult, x as OptimizeSkillRequest, y as OptimizeSkillResult, z as ToolView, N as NotificationList, D as DeviceRegistration, F as NotificationPreference, H as WSEvent } from './index-BI8EgBXu.cjs';
2
- export { I as APIResponse, J as AnthropicContentBlock, K as AnthropicUsage, L as BucketClassCommercial, R as BucketClassGeneric, U as BucketInfo, V as BucketRow, X as BusinessError, Y as ChatContentBlock, Z as ChatMessage, _ as ChatUsage, $ as ConsumeRecord, a0 as EffortConfig, a1 as GeoLoc, a2 as HTTPError, a3 as ModelNotFoundError, a4 as NetworkError, a5 as Notification, a6 as NotificationUnreadCount, a7 as OpenAIChatChoice, a8 as OpenAIChatMessage, a9 as OpenAIChatResponse, aa as OpenAIFunctionCall, ab as OpenAIStreamChoice, ac as OpenAIStreamChunk, ad as OpenAIStreamDelta, ae as OpenAIStreamToolCall, af as OpenAIToolCall, ag as OpenAIUsage, ah as OrderTerminalError, ai as OutputConfig, aj as ProviderFormat, ak as RateLimitError, al as ServerTool, am as ServerToolTypeWebSearch, an as SkillStoreListItem, ao as StreamError, ap as ThinkingConfig, aq as ThinkingHigh, ar as ThinkingHighMinMaxTokens, as as ThinkingMax, at as ThinkingMaxFallbackMaxTokens, au as ThinkingOff, av as ToolListResponse, aw as ToolProvider, ax as WebSearchConfig, ay as WebSearchSource, az as YudaoPageResult, aA as anthropicResponseTextContent, aB as anthropicResponseThinkingContent, aC as anthropicResponseToolUseBlocks, aD as apiResponseBusinessError, aE as apiResponseGetMessage, aF as bucketInfoIsCommercial, aG as bucketRowIsCommercial, aH as getAdapter, aI as getAdapterForModel, aJ as newThinkingConfig, aK as newWebSearchTool, aL as parseNotificationEvent, aM as parseSettlement, aN as parseSourcesEvent, aO as tokenSetIsExpired } from './index-BI8EgBXu.cjs';
1
+ import { M as ManagedModel, I as InputModality, S as ServerMetadata, T as TokenResponse, a as TokenSet, C as ClientRegistration, b as ModelCoefficient, Q as QuotaSummary, c as ModelCapabilities, d as ChatRequest, P as ProviderAdapter, e as ChatResponse, A as AnthropicResponse, f as StreamEvent, g as SourcesEvent, h as StreamSettlement, E as EntitlementBalance, B as BalanceDetail, i as EntitlementItem, j as ConsumeRecordPage, k as ModelByQuotaResponse, l as ModelBucket, m as TokenPackage, n as PayPayload, O as Order, o as OrderStatus, W as WalletStats, p as Transaction, q as SkillStoreQuery, r as SkillStoreItem, s as SkillBrowseResponse, t as SkillBrowseListResponse, u as SkillSummary, v as CertificationStatus, G as GenerateSkillRequest, w as GenerateSkillResult, x as OptimizeSkillRequest, y as OptimizeSkillResult, z as ToolView, N as NotificationList, D as DeviceRegistration, F as NotificationPreference, H as WSEvent } from './index-B2Uuh21R.cjs';
2
+ export { J as APIResponse, K as AnthropicContentBlock, L as AnthropicUsage, R as BucketClassCommercial, U as BucketClassGeneric, V as BucketInfo, X as BucketRow, Y as BusinessError, Z as ChatContentBlock, _ as ChatMessage, $ as ChatUsage, a0 as ConsumeRecord, a1 as EffortConfig, a2 as GeoLoc, a3 as HTTPError, a4 as ModelNotFoundError, a5 as NetworkError, a6 as Notification, a7 as NotificationUnreadCount, a8 as OpenAIChatChoice, a9 as OpenAIChatMessage, aa as OpenAIChatResponse, ab as OpenAIFunctionCall, ac as OpenAIStreamChoice, ad as OpenAIStreamChunk, ae as OpenAIStreamDelta, af as OpenAIStreamToolCall, ag as OpenAIToolCall, ah as OpenAIUsage, ai as OrderTerminalError, aj as OutputConfig, ak as ProviderFormat, al as RateLimitError, am as ServerTool, an as ServerToolTypeWebSearch, ao as SkillStoreListItem, ap as StreamError, aq as ThinkingConfig, ar as ThinkingHigh, as as ThinkingHighMinMaxTokens, at as ThinkingMax, au as ThinkingMaxFallbackMaxTokens, av as ThinkingOff, aw as ToolListResponse, ax as ToolProvider, ay as WebSearchConfig, az as WebSearchSource, aA as YudaoPageResult, aB as anthropicResponseTextContent, aC as anthropicResponseThinkingContent, aD as anthropicResponseToolUseBlocks, aE as apiResponseBusinessError, aF as apiResponseGetMessage, aG as bucketInfoIsCommercial, aH as bucketRowIsCommercial, aI as getAdapter, aJ as getAdapterForModel, aK as newThinkingConfig, aL as newWebSearchTool, aM as parseNotificationEvent, aN as parseSettlement, aO as parseSourcesEvent, aP as tokenSetIsExpired } from './index-B2Uuh21R.cjs';
3
3
  import { M as MinimalSanitizeConfig } from './index-nvLKgCm9.cjs';
4
4
  export { i as sanitize } from './index-nvLKgCm9.cjs';
5
5
  export { AnthropicAdapter } from './adapters/anthropic.cjs';
6
6
  export { OpenAIAdapter } from './adapters/openai.cjs';
7
7
 
8
+ /**
9
+ * 判断 ManagedModel 是否声明支持指定输入模态.
10
+ *
11
+ * 语义:
12
+ * - model 为 null/undefined → false
13
+ * - model.inputModalities 缺失或非数组 → false (保守, 未声明不当支持)
14
+ * - 大小写敏感 (上游契约即小写 'text' | 'image')
15
+ */
16
+ declare function modelSupportsInputModality(model: ManagedModel | null | undefined, modality: InputModality): boolean;
17
+ /** 等价 modelSupportsInputModality(model, 'image') — 调用方常见快捷判定. */
18
+ declare function modelSupportsImageInput(model: ManagedModel | null | undefined): boolean;
19
+ /**
20
+ * 在 catalog 中按 catalog 顺序查找首个支持指定模态的模型.
21
+ *
22
+ * 选择规则:
23
+ * 1. isEnabled !== false (默认开, 显式 false 才剔除)
24
+ * 2. inputModalities 包含指定模态
25
+ * 3. 命中后按 catalog 顺序返回第一个; 未命中返 null
26
+ *
27
+ * 注意: 该 helper 不读 isDefault, 调用方需要 "默认优先" 请用
28
+ * findDesktopVisualUnderstandingModel 或自行排序.
29
+ */
30
+ declare function findFirstModelByInputModality(models: ManagedModel[], modality: InputModality): ManagedModel | null;
31
+ /**
32
+ * 在 catalog 中选出最适合做 "桌面视觉理解 sidecar" 的模型.
33
+ *
34
+ * 设计目的: CrabCode desktop automation 链路里, 主模型不一定多模态;
35
+ * 截图先送 sidecar 解析成结构化 UI 描述, 再喂主模型. 这里选 sidecar 模型
36
+ * 严格走运营标注的 supports_desktop_visual_understanding capability, 不靠
37
+ * 模型名猜.
38
+ *
39
+ * 选择规则 (按用户指定顺序):
40
+ * 1. isEnabled !== false
41
+ * 2. capabilities.supports_desktop_visual_understanding === true
42
+ * 3. inputModalities 包含 'image' (必须真能吃图)
43
+ * 4. 命中集合中优先 isDefault === true; 否则返回 catalog 顺序第一个
44
+ *
45
+ * 全部不满足返 null. 调用方收到 null 应:
46
+ * - 提示用户在管理后台/网关侧开启桌面视觉 sidecar 模型, 或
47
+ * - 降级停掉依赖截图的工作流, 而不是硬选一个非视觉模型送图.
48
+ */
49
+ declare function findDesktopVisualUnderstandingModel(models: ManagedModel[]): ManagedModel | null;
50
+
8
51
  /**
9
52
  * 从 well-known 端点获取 Desktop OAuth 服务元数据。
10
53
  *
@@ -1036,4 +1079,4 @@ declare module '@acosmi/sdk-ts' {
1036
1079
  }
1037
1080
  }
1038
1081
 
1039
- export { type AgentRun, type AgentRunArtifact, type AgentRunArtifactList, type AgentRunArtifactPolicy, type AgentRunCreateRequest, type AgentRunCreateResponse, type AgentRunDownload, type AgentRunErrorPayload, type AgentRunLocalContextPolicy, type AgentRunLocalToolHandler, type AgentRunLocalToolHandlerContext, type AgentRunLocalToolResult, type AgentRunRunOptions, type AgentRunSettlement, type AgentRunStatus, AgentRunStreamError, type AgentRunStreamEvent, type AgentRunStreamOptions, type AgentRunUsage, type AgentRunWithLocalToolsOptions, AgentRunsClient, AnthropicResponse, type AuthorizeResult, BalanceDetail, type BlockMeta, type BugReportResult, type BugView, CertificationStatus, ChatRequest, ChatResponse, Client, ClientRegistration, type Config, ConsumeRecordPage, DefaultRetryPolicy, DeviceRegistration, EntitlementBalance, EntitlementItem, ErrAuthDenied, ErrBrowserOpen, ErrDiscovery, ErrRegistration, ErrSSLProxy, ErrTimeout, ErrTokenExchange, EventAuthURL, EventComplete, EventError, FileTokenStore, type FilterStatus, FilterStatusAdminBypass, FilterStatusDisabledByFlag, FilterStatusFallbackMissingUser, FilterStatusFallbackNoBuckets, FilterStatusFallbackTkdistError, FilterStatusFallbackTkdistSkew, FilterStatusInternalBypass, FilterStatusOK, FilterStatusUnknown, GenerateSkillRequest, GenerateSkillResult, InMemoryTokenStore, LocalStorageTokenStore, type LoginErrCode, type LoginEvent, type LoginEventType, type LoginOptions, ManagedModel, ModelBucket, ModelByQuotaResponse, ModelCapabilities, ModelCoefficient, NotificationList, NotificationPreference, OptimizeSkillRequest, OptimizeSkillResult, Order, OrderStatus, PayPayload, ProviderAdapter, QuotaSummary, type RetryPolicy, type RetryRequestInfo, ScopeAI, ScopeAccount, ScopeEntitlements, ScopeModels, ScopeModelsChat, ScopeProfile, ScopeSkillStore, ScopeSkills, ScopeTokenPackages, ScopeTools, ScopeToolsExecute, ScopeWallet, ScopeWalletReadonly, ServerMetadata, SkillBrowseListResponse, SkillBrowseResponse, SkillStoreItem, SkillStoreQuery, SkillSummary, SourcesEvent, StreamEvent, StreamSettlement, TokenPackage, TokenResponse, TokenSet, type TokenStore, ToolView, Transaction, type WSConfig, WSEvent, WalletStats, allScopes, authorize, buildBetas, commerceScopes, computeBackoff, defaultRetryable, defaultSafeToRetry, discover, effectivePolicy, exchangeCode, extractAnthropicBlockMeta, fileLockDefaults, isSSLError, modelScopes, newFileTokenStore, newTokenSet, refreshToken, register, revokeToken, skillScopes, uniqueMerge };
1082
+ export { type AgentRun, type AgentRunArtifact, type AgentRunArtifactList, type AgentRunArtifactPolicy, type AgentRunCreateRequest, type AgentRunCreateResponse, type AgentRunDownload, type AgentRunErrorPayload, type AgentRunLocalContextPolicy, type AgentRunLocalToolHandler, type AgentRunLocalToolHandlerContext, type AgentRunLocalToolResult, type AgentRunRunOptions, type AgentRunSettlement, type AgentRunStatus, AgentRunStreamError, type AgentRunStreamEvent, type AgentRunStreamOptions, type AgentRunUsage, type AgentRunWithLocalToolsOptions, AgentRunsClient, AnthropicResponse, type AuthorizeResult, BalanceDetail, type BlockMeta, type BugReportResult, type BugView, CertificationStatus, ChatRequest, ChatResponse, Client, ClientRegistration, type Config, ConsumeRecordPage, DefaultRetryPolicy, DeviceRegistration, EntitlementBalance, EntitlementItem, ErrAuthDenied, ErrBrowserOpen, ErrDiscovery, ErrRegistration, ErrSSLProxy, ErrTimeout, ErrTokenExchange, EventAuthURL, EventComplete, EventError, FileTokenStore, type FilterStatus, FilterStatusAdminBypass, FilterStatusDisabledByFlag, FilterStatusFallbackMissingUser, FilterStatusFallbackNoBuckets, FilterStatusFallbackTkdistError, FilterStatusFallbackTkdistSkew, FilterStatusInternalBypass, FilterStatusOK, FilterStatusUnknown, GenerateSkillRequest, GenerateSkillResult, InMemoryTokenStore, InputModality, LocalStorageTokenStore, type LoginErrCode, type LoginEvent, type LoginEventType, type LoginOptions, ManagedModel, ModelBucket, ModelByQuotaResponse, ModelCapabilities, ModelCoefficient, NotificationList, NotificationPreference, OptimizeSkillRequest, OptimizeSkillResult, Order, OrderStatus, PayPayload, ProviderAdapter, QuotaSummary, type RetryPolicy, type RetryRequestInfo, ScopeAI, ScopeAccount, ScopeEntitlements, ScopeModels, ScopeModelsChat, ScopeProfile, ScopeSkillStore, ScopeSkills, ScopeTokenPackages, ScopeTools, ScopeToolsExecute, ScopeWallet, ScopeWalletReadonly, ServerMetadata, SkillBrowseListResponse, SkillBrowseResponse, SkillStoreItem, SkillStoreQuery, SkillSummary, SourcesEvent, StreamEvent, StreamSettlement, TokenPackage, TokenResponse, TokenSet, type TokenStore, ToolView, Transaction, type WSConfig, WSEvent, WalletStats, allScopes, authorize, buildBetas, commerceScopes, computeBackoff, defaultRetryable, defaultSafeToRetry, discover, effectivePolicy, exchangeCode, extractAnthropicBlockMeta, fileLockDefaults, findDesktopVisualUnderstandingModel, findFirstModelByInputModality, isSSLError, modelScopes, modelSupportsImageInput, modelSupportsInputModality, newFileTokenStore, newTokenSet, refreshToken, register, revokeToken, skillScopes, uniqueMerge };
@@ -1,10 +1,53 @@
1
- import { S as ServerMetadata, T as TokenResponse, a as TokenSet, C as ClientRegistration, M as ManagedModel, b as ModelCoefficient, Q as QuotaSummary, c as ModelCapabilities, d as ChatRequest, P as ProviderAdapter, e as ChatResponse, A as AnthropicResponse, f as StreamEvent, g as SourcesEvent, h as StreamSettlement, E as EntitlementBalance, B as BalanceDetail, i as EntitlementItem, j as ConsumeRecordPage, k as ModelByQuotaResponse, l as ModelBucket, m as TokenPackage, n as PayPayload, O as Order, o as OrderStatus, W as WalletStats, p as Transaction, q as SkillStoreQuery, r as SkillStoreItem, s as SkillBrowseResponse, t as SkillBrowseListResponse, u as SkillSummary, v as CertificationStatus, G as GenerateSkillRequest, w as GenerateSkillResult, x as OptimizeSkillRequest, y as OptimizeSkillResult, z as ToolView, N as NotificationList, D as DeviceRegistration, F as NotificationPreference, H as WSEvent } from './index-BI8EgBXu.js';
2
- export { I as APIResponse, J as AnthropicContentBlock, K as AnthropicUsage, L as BucketClassCommercial, R as BucketClassGeneric, U as BucketInfo, V as BucketRow, X as BusinessError, Y as ChatContentBlock, Z as ChatMessage, _ as ChatUsage, $ as ConsumeRecord, a0 as EffortConfig, a1 as GeoLoc, a2 as HTTPError, a3 as ModelNotFoundError, a4 as NetworkError, a5 as Notification, a6 as NotificationUnreadCount, a7 as OpenAIChatChoice, a8 as OpenAIChatMessage, a9 as OpenAIChatResponse, aa as OpenAIFunctionCall, ab as OpenAIStreamChoice, ac as OpenAIStreamChunk, ad as OpenAIStreamDelta, ae as OpenAIStreamToolCall, af as OpenAIToolCall, ag as OpenAIUsage, ah as OrderTerminalError, ai as OutputConfig, aj as ProviderFormat, ak as RateLimitError, al as ServerTool, am as ServerToolTypeWebSearch, an as SkillStoreListItem, ao as StreamError, ap as ThinkingConfig, aq as ThinkingHigh, ar as ThinkingHighMinMaxTokens, as as ThinkingMax, at as ThinkingMaxFallbackMaxTokens, au as ThinkingOff, av as ToolListResponse, aw as ToolProvider, ax as WebSearchConfig, ay as WebSearchSource, az as YudaoPageResult, aA as anthropicResponseTextContent, aB as anthropicResponseThinkingContent, aC as anthropicResponseToolUseBlocks, aD as apiResponseBusinessError, aE as apiResponseGetMessage, aF as bucketInfoIsCommercial, aG as bucketRowIsCommercial, aH as getAdapter, aI as getAdapterForModel, aJ as newThinkingConfig, aK as newWebSearchTool, aL as parseNotificationEvent, aM as parseSettlement, aN as parseSourcesEvent, aO as tokenSetIsExpired } from './index-BI8EgBXu.js';
1
+ import { M as ManagedModel, I as InputModality, S as ServerMetadata, T as TokenResponse, a as TokenSet, C as ClientRegistration, b as ModelCoefficient, Q as QuotaSummary, c as ModelCapabilities, d as ChatRequest, P as ProviderAdapter, e as ChatResponse, A as AnthropicResponse, f as StreamEvent, g as SourcesEvent, h as StreamSettlement, E as EntitlementBalance, B as BalanceDetail, i as EntitlementItem, j as ConsumeRecordPage, k as ModelByQuotaResponse, l as ModelBucket, m as TokenPackage, n as PayPayload, O as Order, o as OrderStatus, W as WalletStats, p as Transaction, q as SkillStoreQuery, r as SkillStoreItem, s as SkillBrowseResponse, t as SkillBrowseListResponse, u as SkillSummary, v as CertificationStatus, G as GenerateSkillRequest, w as GenerateSkillResult, x as OptimizeSkillRequest, y as OptimizeSkillResult, z as ToolView, N as NotificationList, D as DeviceRegistration, F as NotificationPreference, H as WSEvent } from './index-B2Uuh21R.js';
2
+ export { J as APIResponse, K as AnthropicContentBlock, L as AnthropicUsage, R as BucketClassCommercial, U as BucketClassGeneric, V as BucketInfo, X as BucketRow, Y as BusinessError, Z as ChatContentBlock, _ as ChatMessage, $ as ChatUsage, a0 as ConsumeRecord, a1 as EffortConfig, a2 as GeoLoc, a3 as HTTPError, a4 as ModelNotFoundError, a5 as NetworkError, a6 as Notification, a7 as NotificationUnreadCount, a8 as OpenAIChatChoice, a9 as OpenAIChatMessage, aa as OpenAIChatResponse, ab as OpenAIFunctionCall, ac as OpenAIStreamChoice, ad as OpenAIStreamChunk, ae as OpenAIStreamDelta, af as OpenAIStreamToolCall, ag as OpenAIToolCall, ah as OpenAIUsage, ai as OrderTerminalError, aj as OutputConfig, ak as ProviderFormat, al as RateLimitError, am as ServerTool, an as ServerToolTypeWebSearch, ao as SkillStoreListItem, ap as StreamError, aq as ThinkingConfig, ar as ThinkingHigh, as as ThinkingHighMinMaxTokens, at as ThinkingMax, au as ThinkingMaxFallbackMaxTokens, av as ThinkingOff, aw as ToolListResponse, ax as ToolProvider, ay as WebSearchConfig, az as WebSearchSource, aA as YudaoPageResult, aB as anthropicResponseTextContent, aC as anthropicResponseThinkingContent, aD as anthropicResponseToolUseBlocks, aE as apiResponseBusinessError, aF as apiResponseGetMessage, aG as bucketInfoIsCommercial, aH as bucketRowIsCommercial, aI as getAdapter, aJ as getAdapterForModel, aK as newThinkingConfig, aL as newWebSearchTool, aM as parseNotificationEvent, aN as parseSettlement, aO as parseSourcesEvent, aP as tokenSetIsExpired } from './index-B2Uuh21R.js';
3
3
  import { M as MinimalSanitizeConfig } from './index-nvLKgCm9.js';
4
4
  export { i as sanitize } from './index-nvLKgCm9.js';
5
5
  export { AnthropicAdapter } from './adapters/anthropic.js';
6
6
  export { OpenAIAdapter } from './adapters/openai.js';
7
7
 
8
+ /**
9
+ * 判断 ManagedModel 是否声明支持指定输入模态.
10
+ *
11
+ * 语义:
12
+ * - model 为 null/undefined → false
13
+ * - model.inputModalities 缺失或非数组 → false (保守, 未声明不当支持)
14
+ * - 大小写敏感 (上游契约即小写 'text' | 'image')
15
+ */
16
+ declare function modelSupportsInputModality(model: ManagedModel | null | undefined, modality: InputModality): boolean;
17
+ /** 等价 modelSupportsInputModality(model, 'image') — 调用方常见快捷判定. */
18
+ declare function modelSupportsImageInput(model: ManagedModel | null | undefined): boolean;
19
+ /**
20
+ * 在 catalog 中按 catalog 顺序查找首个支持指定模态的模型.
21
+ *
22
+ * 选择规则:
23
+ * 1. isEnabled !== false (默认开, 显式 false 才剔除)
24
+ * 2. inputModalities 包含指定模态
25
+ * 3. 命中后按 catalog 顺序返回第一个; 未命中返 null
26
+ *
27
+ * 注意: 该 helper 不读 isDefault, 调用方需要 "默认优先" 请用
28
+ * findDesktopVisualUnderstandingModel 或自行排序.
29
+ */
30
+ declare function findFirstModelByInputModality(models: ManagedModel[], modality: InputModality): ManagedModel | null;
31
+ /**
32
+ * 在 catalog 中选出最适合做 "桌面视觉理解 sidecar" 的模型.
33
+ *
34
+ * 设计目的: CrabCode desktop automation 链路里, 主模型不一定多模态;
35
+ * 截图先送 sidecar 解析成结构化 UI 描述, 再喂主模型. 这里选 sidecar 模型
36
+ * 严格走运营标注的 supports_desktop_visual_understanding capability, 不靠
37
+ * 模型名猜.
38
+ *
39
+ * 选择规则 (按用户指定顺序):
40
+ * 1. isEnabled !== false
41
+ * 2. capabilities.supports_desktop_visual_understanding === true
42
+ * 3. inputModalities 包含 'image' (必须真能吃图)
43
+ * 4. 命中集合中优先 isDefault === true; 否则返回 catalog 顺序第一个
44
+ *
45
+ * 全部不满足返 null. 调用方收到 null 应:
46
+ * - 提示用户在管理后台/网关侧开启桌面视觉 sidecar 模型, 或
47
+ * - 降级停掉依赖截图的工作流, 而不是硬选一个非视觉模型送图.
48
+ */
49
+ declare function findDesktopVisualUnderstandingModel(models: ManagedModel[]): ManagedModel | null;
50
+
8
51
  /**
9
52
  * 从 well-known 端点获取 Desktop OAuth 服务元数据。
10
53
  *
@@ -1036,4 +1079,4 @@ declare module '@acosmi/sdk-ts' {
1036
1079
  }
1037
1080
  }
1038
1081
 
1039
- export { type AgentRun, type AgentRunArtifact, type AgentRunArtifactList, type AgentRunArtifactPolicy, type AgentRunCreateRequest, type AgentRunCreateResponse, type AgentRunDownload, type AgentRunErrorPayload, type AgentRunLocalContextPolicy, type AgentRunLocalToolHandler, type AgentRunLocalToolHandlerContext, type AgentRunLocalToolResult, type AgentRunRunOptions, type AgentRunSettlement, type AgentRunStatus, AgentRunStreamError, type AgentRunStreamEvent, type AgentRunStreamOptions, type AgentRunUsage, type AgentRunWithLocalToolsOptions, AgentRunsClient, AnthropicResponse, type AuthorizeResult, BalanceDetail, type BlockMeta, type BugReportResult, type BugView, CertificationStatus, ChatRequest, ChatResponse, Client, ClientRegistration, type Config, ConsumeRecordPage, DefaultRetryPolicy, DeviceRegistration, EntitlementBalance, EntitlementItem, ErrAuthDenied, ErrBrowserOpen, ErrDiscovery, ErrRegistration, ErrSSLProxy, ErrTimeout, ErrTokenExchange, EventAuthURL, EventComplete, EventError, FileTokenStore, type FilterStatus, FilterStatusAdminBypass, FilterStatusDisabledByFlag, FilterStatusFallbackMissingUser, FilterStatusFallbackNoBuckets, FilterStatusFallbackTkdistError, FilterStatusFallbackTkdistSkew, FilterStatusInternalBypass, FilterStatusOK, FilterStatusUnknown, GenerateSkillRequest, GenerateSkillResult, InMemoryTokenStore, LocalStorageTokenStore, type LoginErrCode, type LoginEvent, type LoginEventType, type LoginOptions, ManagedModel, ModelBucket, ModelByQuotaResponse, ModelCapabilities, ModelCoefficient, NotificationList, NotificationPreference, OptimizeSkillRequest, OptimizeSkillResult, Order, OrderStatus, PayPayload, ProviderAdapter, QuotaSummary, type RetryPolicy, type RetryRequestInfo, ScopeAI, ScopeAccount, ScopeEntitlements, ScopeModels, ScopeModelsChat, ScopeProfile, ScopeSkillStore, ScopeSkills, ScopeTokenPackages, ScopeTools, ScopeToolsExecute, ScopeWallet, ScopeWalletReadonly, ServerMetadata, SkillBrowseListResponse, SkillBrowseResponse, SkillStoreItem, SkillStoreQuery, SkillSummary, SourcesEvent, StreamEvent, StreamSettlement, TokenPackage, TokenResponse, TokenSet, type TokenStore, ToolView, Transaction, type WSConfig, WSEvent, WalletStats, allScopes, authorize, buildBetas, commerceScopes, computeBackoff, defaultRetryable, defaultSafeToRetry, discover, effectivePolicy, exchangeCode, extractAnthropicBlockMeta, fileLockDefaults, isSSLError, modelScopes, newFileTokenStore, newTokenSet, refreshToken, register, revokeToken, skillScopes, uniqueMerge };
1082
+ export { type AgentRun, type AgentRunArtifact, type AgentRunArtifactList, type AgentRunArtifactPolicy, type AgentRunCreateRequest, type AgentRunCreateResponse, type AgentRunDownload, type AgentRunErrorPayload, type AgentRunLocalContextPolicy, type AgentRunLocalToolHandler, type AgentRunLocalToolHandlerContext, type AgentRunLocalToolResult, type AgentRunRunOptions, type AgentRunSettlement, type AgentRunStatus, AgentRunStreamError, type AgentRunStreamEvent, type AgentRunStreamOptions, type AgentRunUsage, type AgentRunWithLocalToolsOptions, AgentRunsClient, AnthropicResponse, type AuthorizeResult, BalanceDetail, type BlockMeta, type BugReportResult, type BugView, CertificationStatus, ChatRequest, ChatResponse, Client, ClientRegistration, type Config, ConsumeRecordPage, DefaultRetryPolicy, DeviceRegistration, EntitlementBalance, EntitlementItem, ErrAuthDenied, ErrBrowserOpen, ErrDiscovery, ErrRegistration, ErrSSLProxy, ErrTimeout, ErrTokenExchange, EventAuthURL, EventComplete, EventError, FileTokenStore, type FilterStatus, FilterStatusAdminBypass, FilterStatusDisabledByFlag, FilterStatusFallbackMissingUser, FilterStatusFallbackNoBuckets, FilterStatusFallbackTkdistError, FilterStatusFallbackTkdistSkew, FilterStatusInternalBypass, FilterStatusOK, FilterStatusUnknown, GenerateSkillRequest, GenerateSkillResult, InMemoryTokenStore, InputModality, LocalStorageTokenStore, type LoginErrCode, type LoginEvent, type LoginEventType, type LoginOptions, ManagedModel, ModelBucket, ModelByQuotaResponse, ModelCapabilities, ModelCoefficient, NotificationList, NotificationPreference, OptimizeSkillRequest, OptimizeSkillResult, Order, OrderStatus, PayPayload, ProviderAdapter, QuotaSummary, type RetryPolicy, type RetryRequestInfo, ScopeAI, ScopeAccount, ScopeEntitlements, ScopeModels, ScopeModelsChat, ScopeProfile, ScopeSkillStore, ScopeSkills, ScopeTokenPackages, ScopeTools, ScopeToolsExecute, ScopeWallet, ScopeWalletReadonly, ServerMetadata, SkillBrowseListResponse, SkillBrowseResponse, SkillStoreItem, SkillStoreQuery, SkillSummary, SourcesEvent, StreamEvent, StreamSettlement, TokenPackage, TokenResponse, TokenSet, type TokenStore, ToolView, Transaction, type WSConfig, WSEvent, WalletStats, allScopes, authorize, buildBetas, commerceScopes, computeBackoff, defaultRetryable, defaultSafeToRetry, discover, effectivePolicy, exchangeCode, extractAnthropicBlockMeta, fileLockDefaults, findDesktopVisualUnderstandingModel, findFirstModelByInputModality, isSSLError, modelScopes, modelSupportsImageInput, modelSupportsInputModality, newFileTokenStore, newTokenSet, refreshToken, register, revokeToken, skillScopes, uniqueMerge };
@@ -1013,6 +1013,45 @@ var init_adapters = __esm({
1013
1013
 
1014
1014
  // src/index.ts
1015
1015
  init_types();
1016
+
1017
+ // src/model-helpers.ts
1018
+ function modelSupportsInputModality(model, modality) {
1019
+ if (!model) return false;
1020
+ const mods = model.inputModalities;
1021
+ if (!Array.isArray(mods)) return false;
1022
+ return mods.includes(modality);
1023
+ }
1024
+ function modelSupportsImageInput(model) {
1025
+ return modelSupportsInputModality(model, "image");
1026
+ }
1027
+ function findFirstModelByInputModality(models, modality) {
1028
+ if (!Array.isArray(models)) return null;
1029
+ for (const m of models) {
1030
+ if (!m) continue;
1031
+ if (m.isEnabled === false) continue;
1032
+ if (!modelSupportsInputModality(m, modality)) continue;
1033
+ return m;
1034
+ }
1035
+ return null;
1036
+ }
1037
+ function findDesktopVisualUnderstandingModel(models) {
1038
+ if (!Array.isArray(models)) return null;
1039
+ const candidates = [];
1040
+ for (const m of models) {
1041
+ if (!m) continue;
1042
+ if (m.isEnabled === false) continue;
1043
+ if (m.capabilities?.supports_desktop_visual_understanding !== true) continue;
1044
+ if (!modelSupportsInputModality(m, "image")) continue;
1045
+ candidates.push(m);
1046
+ }
1047
+ if (candidates.length === 0) return null;
1048
+ for (const m of candidates) {
1049
+ if (m.isDefault === true) return m;
1050
+ }
1051
+ return candidates[0];
1052
+ }
1053
+
1054
+ // src/index.ts
1016
1055
  init_adapters();
1017
1056
 
1018
1057
  // src/auth.ts
@@ -2588,14 +2627,15 @@ var Client = class _Client {
2588
2627
  null,
2589
2628
  signal
2590
2629
  );
2591
- this.modelCache = result.data;
2630
+ const normalized = normalizeInputModalities(result.data);
2631
+ this.modelCache = normalized;
2592
2632
  this.modelCacheTimeMs = Date.now();
2593
2633
  let status = "";
2594
2634
  if (headers) {
2595
2635
  const h = headers.get("X-Entitlement-Filter-Status");
2596
2636
  if (h) status = h;
2597
2637
  }
2598
- return { models: result.data, status };
2638
+ return { models: normalized, status };
2599
2639
  }
2600
2640
  /** 查询当前用户账户级权益总览 (v0.19+) */
2601
2641
  async getQuotaSummary(signal) {
@@ -3228,9 +3268,24 @@ function zeroModelCapabilities() {
3228
3268
  supports_token_efficient: false,
3229
3269
  supports_redact_thinking: false,
3230
3270
  max_input_tokens: 0,
3231
- max_output_tokens: 0
3271
+ max_output_tokens: 0,
3272
+ supports_desktop_visual_understanding: false
3232
3273
  };
3233
3274
  }
3275
+ function normalizeInputModalities(models) {
3276
+ if (!Array.isArray(models)) return models;
3277
+ for (const m of models) {
3278
+ if (!m || typeof m !== "object") continue;
3279
+ if (Array.isArray(m.inputModalities)) continue;
3280
+ const snake = m.input_modalities;
3281
+ if (Array.isArray(snake)) {
3282
+ m.inputModalities = snake.filter(
3283
+ (v) => v === "text" || v === "image"
3284
+ );
3285
+ }
3286
+ }
3287
+ return models;
3288
+ }
3234
3289
  function withRequestTimeout(ms, parent) {
3235
3290
  const ctl = new AbortController();
3236
3291
  const timer = setTimeout(() => ctl.abort(), ms);
@@ -4576,6 +4631,6 @@ Client.prototype.getBugReport = async function(bugID, signal) {
4576
4631
  return resp.data;
4577
4632
  };
4578
4633
 
4579
- export { AgentRunStreamError, AgentRunsClient, AnthropicAdapter, BucketClassCommercial, BucketClassGeneric, BusinessError, Client, DefaultRetryPolicy, ErrAuthDenied, ErrBrowserOpen, ErrDiscovery, ErrRegistration, ErrSSLProxy, ErrTimeout, ErrTokenExchange, EventAuthURL, EventComplete, EventError, FileTokenStore, FilterStatusAdminBypass, FilterStatusDisabledByFlag, FilterStatusFallbackMissingUser, FilterStatusFallbackNoBuckets, FilterStatusFallbackTkdistError, FilterStatusFallbackTkdistSkew, FilterStatusInternalBypass, FilterStatusOK, FilterStatusUnknown, HTTPError, InMemoryTokenStore, LocalStorageTokenStore, ModelNotFoundError, NetworkError, OpenAIAdapter, OrderTerminalError, ProviderFormat, RateLimitError, ScopeAI, ScopeAccount, ScopeEntitlements, ScopeModels, ScopeModelsChat, ScopeProfile, ScopeSkillStore, ScopeSkills, ScopeTokenPackages, ScopeTools, ScopeToolsExecute, ScopeWallet, ScopeWalletReadonly, ServerToolTypeWebSearch, StreamError, ThinkingHigh, ThinkingHighMinMaxTokens, ThinkingMax, ThinkingMaxFallbackMaxTokens, ThinkingOff, allScopes, anthropicResponseTextContent, anthropicResponseThinkingContent, anthropicResponseToolUseBlocks, apiResponseBusinessError, apiResponseGetMessage, authorize, bucketInfoIsCommercial, bucketRowIsCommercial, buildBetas, commerceScopes, computeBackoff, defaultRetryable, defaultSafeToRetry, discover, effectivePolicy, exchangeCode, extractAnthropicBlockMeta, fileLockDefaults, getAdapter, getAdapterForModel, isSSLError, modelScopes, newFileTokenStore, newThinkingConfig, newTokenSet, newWebSearchTool, parseNotificationEvent, parseSettlement, parseSourcesEvent, refreshToken, register, revokeToken, sanitize_exports as sanitize, skillScopes, tokenSetIsExpired, uniqueMerge };
4634
+ export { AgentRunStreamError, AgentRunsClient, AnthropicAdapter, BucketClassCommercial, BucketClassGeneric, BusinessError, Client, DefaultRetryPolicy, ErrAuthDenied, ErrBrowserOpen, ErrDiscovery, ErrRegistration, ErrSSLProxy, ErrTimeout, ErrTokenExchange, EventAuthURL, EventComplete, EventError, FileTokenStore, FilterStatusAdminBypass, FilterStatusDisabledByFlag, FilterStatusFallbackMissingUser, FilterStatusFallbackNoBuckets, FilterStatusFallbackTkdistError, FilterStatusFallbackTkdistSkew, FilterStatusInternalBypass, FilterStatusOK, FilterStatusUnknown, HTTPError, InMemoryTokenStore, LocalStorageTokenStore, ModelNotFoundError, NetworkError, OpenAIAdapter, OrderTerminalError, ProviderFormat, RateLimitError, ScopeAI, ScopeAccount, ScopeEntitlements, ScopeModels, ScopeModelsChat, ScopeProfile, ScopeSkillStore, ScopeSkills, ScopeTokenPackages, ScopeTools, ScopeToolsExecute, ScopeWallet, ScopeWalletReadonly, ServerToolTypeWebSearch, StreamError, ThinkingHigh, ThinkingHighMinMaxTokens, ThinkingMax, ThinkingMaxFallbackMaxTokens, ThinkingOff, allScopes, anthropicResponseTextContent, anthropicResponseThinkingContent, anthropicResponseToolUseBlocks, apiResponseBusinessError, apiResponseGetMessage, authorize, bucketInfoIsCommercial, bucketRowIsCommercial, buildBetas, commerceScopes, computeBackoff, defaultRetryable, defaultSafeToRetry, discover, effectivePolicy, exchangeCode, extractAnthropicBlockMeta, fileLockDefaults, findDesktopVisualUnderstandingModel, findFirstModelByInputModality, getAdapter, getAdapterForModel, isSSLError, modelScopes, modelSupportsImageInput, modelSupportsInputModality, newFileTokenStore, newThinkingConfig, newTokenSet, newWebSearchTool, parseNotificationEvent, parseSettlement, parseSourcesEvent, refreshToken, register, revokeToken, sanitize_exports as sanitize, skillScopes, tokenSetIsExpired, uniqueMerge };
4580
4635
  //# sourceMappingURL=index.mjs.map
4581
4636
  //# sourceMappingURL=index.mjs.map