qlogicagent 2.10.2 → 2.10.4

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.
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Provides: ProviderDef + LLMTransport + ProviderRegistry + LLMClient factory
5
5
  */
6
- export type { ProviderDef, ModelInfo, TransportType, AuthType, MediaCapability, MediaCapabilities, VideoCapabilities, ImageCapabilities, MusicCapabilities, TtsCapabilities, ThreeDCapabilities, SttCapabilities, EmbeddingCapabilities, VideoUnderstandingCapabilities, ImageUnderstandingCapabilities, VoiceCloneCapabilities, RerankCapabilities, DocumentParsingCapabilities, RealtimeAudioCapabilities, VideoOperation, ImageOperation, MusicOperation, TtsOperation, ThreeDOperation } from "./provider-def.js";
6
+ export type { ProviderDef, ModelInfo, TransportType, AuthType, MediaCapability, MediaCapabilities, VideoCapabilities, ImageCapabilities, MusicCapabilities, TtsCapabilities, ThreeDCapabilities, SttCapabilities, EmbeddingCapabilities, VideoUnderstandingCapabilities, ImageUnderstandingCapabilities, VoiceCloneCapabilities, RerankCapabilities, DocumentParsingCapabilities, RealtimeAudioCapabilities, VideoOperation, ImageOperation, MusicOperation, TtsOperation, ThreeDOperation, ProviderVariantKind, ProviderBillingChannelKind, ProviderVariantCapability } from "./provider-def.js";
7
7
  export type { LLMTransport, LLMRequest, LLMChunk, AccumulatedToolCall, } from "./transport.js";
8
8
  export { accumulateToolCalls } from "./transport.js";
9
9
  export type { ChatMessage, ChatMessageRole, ThinkingBlock, ToolCallMessage, ToolDefinition } from "./wire-types.js";
@@ -17,6 +17,7 @@ export type { ProviderToolAPI, WebSearchResult, ReaderResult, TokenizerResult, M
17
17
  export { ProviderRegistry } from "./provider-registry.js";
18
18
  export { BUILTIN_PROVIDERS } from "./builtin-providers.js";
19
19
  export { ModelCatalog } from "./model-catalog.js";
20
+ export { ProviderVariantResolver, type ProviderVariantResolverInput, type ProviderVariantResolution, type RequestedProviderProtocol } from "./provider-variant-resolver.js";
20
21
  export type { LLMClientConfig, LLMClient } from "./llm-client.js";
21
22
  export { createLLMClient } from "./llm-client.js";
22
23
  export { OpenAIChatTransport } from "./transports/openai-chat.js";
@@ -12,6 +12,9 @@
12
12
  export type TransportType = "openai-chat" | "openai-responses" | "anthropic-messages" | "volcengine-responses" | "gemini-generatecontent";
13
13
  export type AuthType = "bearer" | "x-api-key" | "none";
14
14
  export type MediaCapability = "image" | "video" | "music" | "music_realtime" | "tts" | "3d" | "stt" | "embedding" | "video_understanding" | "image_understanding" | "voice_clone" | "rerank" | "document_parsing" | "realtime_audio" | "realtime_video";
15
+ export type ProviderVariantKind = "standard" | "openai-compatible" | "anthropic-compatible" | "coding-plan" | "media-plan" | "realtime";
16
+ export type ProviderBillingChannelKind = "paygo" | "plan" | "discount" | "official";
17
+ export type ProviderVariantCapability = "thinking" | "reasoning_split" | "tool_stream" | "builtin_tools" | "vision" | "media" | "coding" | "realtime";
15
18
  export type VideoOperation = "text2video" | "img2video" | "video2video" | "edit" | "merge" | "upscale";
16
19
  export type ImageOperation = "text2image" | "img2img" | "inpainting" | "outpainting";
17
20
  export type MusicOperation = "text2music" | "cover" | "realtime";
@@ -159,6 +162,12 @@ export interface ProviderDef {
159
162
  * Defaults to provider id if unset.
160
163
  */
161
164
  group?: string;
165
+ /** Technical protocol variant kind for resolver ranking. */
166
+ variantKind?: ProviderVariantKind;
167
+ /** Channel type hint only; commercial cost selection is owned by llmrouter. */
168
+ billingChannelKind?: ProviderBillingChannelKind;
169
+ /** Provider-level capability hints used by ProviderVariantResolver. */
170
+ capabilities?: ProviderVariantCapability[];
162
171
  /** Env var names for API key (priority order) */
163
172
  apiKeyEnvVars: string[];
164
173
  /** Auth header style */
@@ -0,0 +1,35 @@
1
+ import type { ModelInfo, ProviderBillingChannelKind, ProviderDef, ProviderVariantCapability, ProviderVariantKind, TransportType } from "./provider-def.js";
2
+ import type { ProviderRegistry } from "./provider-registry.js";
3
+ export type RequestedProviderProtocol = TransportType | "openai" | "anthropic";
4
+ export interface ProviderVariantResolverInput {
5
+ publicModel: string;
6
+ requestedProtocol?: RequestedProviderProtocol;
7
+ capabilities?: ProviderVariantCapability[];
8
+ purpose?: string;
9
+ userPreference?: {
10
+ providerIds?: string[];
11
+ preferProviderId?: string;
12
+ preferVariantKind?: ProviderVariantKind;
13
+ };
14
+ }
15
+ export interface ProviderVariantResolution {
16
+ provider: string;
17
+ group: string;
18
+ publicModel: string;
19
+ nativeModelId: string;
20
+ displayName: string;
21
+ transport: TransportType;
22
+ variantKind: ProviderVariantKind;
23
+ billingChannelKind: ProviderBillingChannelKind;
24
+ capabilities: ProviderVariantCapability[];
25
+ score: number;
26
+ reasons: string[];
27
+ providerDef: ProviderDef;
28
+ modelInfo: ModelInfo;
29
+ }
30
+ export declare class ProviderVariantResolver {
31
+ private readonly registry;
32
+ constructor(registry: Pick<ProviderRegistry, "listProviders" | "listModels">);
33
+ resolve(input: ProviderVariantResolverInput): ProviderVariantResolution[];
34
+ resolveBest(input: ProviderVariantResolverInput): ProviderVariantResolution | undefined;
35
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * MiniMax Media Transport 鈥?Music + Video Generation.
2
+ * MiniMax Media Transport 鈥?Music + Video + TTS Generation.
3
3
  *
4
4
  * Music: POST /v1/music_generation (sync or async poll)
5
5
  * Video: POST /v1/video_generation (4 modes: text, image, first-last-frame, subject-ref)
@@ -21,6 +21,7 @@ export declare class MiniMaxMediaTransport implements AsyncMediaTransport {
21
21
  private timeoutMs;
22
22
  constructor(config: MiniMaxMediaConfig);
23
23
  generate(request: MediaRequest, apiKey: string, signal?: AbortSignal): Promise<MediaResult>;
24
+ private generateTTS;
24
25
  private generateMusic;
25
26
  private pollTask;
26
27
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Qwen (DashScope) Media Transport 鈥?TTS + Video Generation.
2
+ * Qwen (DashScope) Media Transport.
3
3
  *
4
4
  * DashScope async task API pattern:
5
5
  * Submit: POST /api/v1/services/aigc/<service>/generation (X-DashScope-Async: enable)
@@ -9,7 +9,11 @@
9
9
  * Docs: https://help.aliyun.com/zh/model-studio/developer-reference/
10
10
  *
11
11
  * Video models: wan2.7-t2v (text-to-video), wan2.7-i2v (image-to-video)
12
- * TTS models: qwen3-tts-voicedesign, cosyvoice-v2
12
+ * TTS endpoints:
13
+ * Qwen3-TTS: /api/v1/services/aigc/multimodal-generation/generation
14
+ * CosyVoice: /api/v1/services/audio/tts/SpeechSynthesizer
15
+ * Rerank: /api/v1/services/rerank/text-rerank/text-rerank
16
+ * Embedding: /compatible-mode/v1/embeddings
13
17
  */
14
18
  import type { AsyncMediaTransport, MediaRequest, MediaResult, MediaType } from "../media-transport.js";
15
19
  export interface QwenMediaConfig {
@@ -23,6 +27,11 @@ export declare class QwenMediaTransport implements AsyncMediaTransport {
23
27
  private timeoutMs;
24
28
  constructor(config: QwenMediaConfig);
25
29
  generate(request: MediaRequest, apiKey: string, signal?: AbortSignal): Promise<MediaResult>;
30
+ private generateTTS;
31
+ private generateQwenTTS;
32
+ private generateCosyVoiceTTS;
33
+ private generateEmbedding;
34
+ private generateRerank;
26
35
  private pollTask;
27
36
  private generateVideo;
28
37
  /**
@@ -22,6 +22,7 @@ export declare class VolcengineMediaTransport implements AsyncMediaTransport {
22
22
  private timeoutMs;
23
23
  constructor(config: VolcengineMediaConfig);
24
24
  generate(request: MediaRequest, apiKey: string, signal?: AbortSignal): Promise<MediaResult>;
25
+ private generateEmbedding;
25
26
  /**
26
27
  * Check if this transport can handle a given operation.
27
28
  * Video edit/merge/upscale are routed through the same video endpoint.
@@ -76,7 +76,7 @@ export declare class ZhipuMediaTransport implements AsyncMediaTransport {
76
76
  status: string;
77
77
  }>>;
78
78
  /**
79
- * Delete a cloned voice 鈥?DELETE /voice/{voice_id}
79
+ * Delete a cloned voice 鈥?POST /voice/delete
80
80
  */
81
81
  deleteVoice(voiceId: string, apiKey: string, signal?: AbortSignal): Promise<void>;
82
82
  }
@@ -54,6 +54,8 @@ export interface ResolvedModel {
54
54
  export declare const ALL_PURPOSES: ModelPurpose[];
55
55
  export declare class ModelRegistry {
56
56
  private keyPool;
57
+ private coreProviderRegistry;
58
+ private providerVariantResolver;
57
59
  private models;
58
60
  private modelEnabledOverrides;
59
61
  private bindings;
@@ -107,12 +109,17 @@ export declare class ModelRegistry {
107
109
  getTunable<T = unknown>(key: string): T | undefined;
108
110
  getModelInfo(providerId: string, modelId: string): ModelInfo | undefined;
109
111
  getProviderDefaultModel(providerId: string): string | undefined;
112
+ hasConfiguredKeyForProviderVariant(providerId: string): boolean;
113
+ hasAvailableKeyForProviderVariant(providerId: string): boolean;
110
114
  listProviderDefs(): ProviderDef[];
111
115
  resolveProviderApiKey(providerId: string): string | undefined;
112
116
  onChange(callback: RegistryChangeCallback): () => void;
113
117
  getKeyForProvider(providerId: string): string | null;
114
118
  snapshotProviderKeys(): Record<string, string>;
115
119
  private getProviderBaseUrl;
120
+ private acquireKeyForProviderVariant;
121
+ private resolveTechnicalVariant;
122
+ private providerVariantKeyCandidates;
116
123
  private loadModelState;
117
124
  private exportModelState;
118
125
  private emitChange;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qlogicagent",
3
- "version": "2.10.2",
3
+ "version": "2.10.4",
4
4
  "description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",