bailian-cli-core 1.6.1 → 1.7.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.
- package/dist/index.d.mts +578 -272
- package/dist/index.mjs +19 -18
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -38,6 +38,10 @@ declare class BailianError extends Error {
|
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
+
/** Invalid usage: unknown command, bad/unknown flag, missing required, failed validation. */
|
|
42
|
+
declare class UsageError extends BailianError {
|
|
43
|
+
constructor(message: string, hint?: string);
|
|
44
|
+
}
|
|
41
45
|
//#endregion
|
|
42
46
|
//#region src/errors/api.d.ts
|
|
43
47
|
interface ApiErrorBody {
|
|
@@ -93,6 +97,14 @@ interface ChatTool {
|
|
|
93
97
|
parameters: Record<string, unknown>;
|
|
94
98
|
};
|
|
95
99
|
}
|
|
100
|
+
interface ChatResponseFormat {
|
|
101
|
+
type: "json_object" | "json_schema";
|
|
102
|
+
json_schema?: {
|
|
103
|
+
name: string;
|
|
104
|
+
schema?: Record<string, unknown>;
|
|
105
|
+
strict?: boolean;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
96
108
|
interface ChatRequest {
|
|
97
109
|
model: string;
|
|
98
110
|
messages: ChatMessage[];
|
|
@@ -117,6 +129,7 @@ interface ChatRequest {
|
|
|
117
129
|
stream_options?: {
|
|
118
130
|
include_usage?: boolean;
|
|
119
131
|
};
|
|
132
|
+
response_format?: ChatResponseFormat;
|
|
120
133
|
}
|
|
121
134
|
interface ChatChoice {
|
|
122
135
|
index: number;
|
|
@@ -182,6 +195,47 @@ interface StreamChunk {
|
|
|
182
195
|
total_tokens: number;
|
|
183
196
|
};
|
|
184
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* Request body for `tongyi-intent-detect-v3` via the DashScope-native
|
|
200
|
+
* text-generation endpoint. Uses `{ model, input, parameters }` shape —
|
|
201
|
+
* NOT the OpenAI `{ model, messages }` shape.
|
|
202
|
+
*/
|
|
203
|
+
interface DashScopeIntentDetectRequest {
|
|
204
|
+
model: string;
|
|
205
|
+
input: {
|
|
206
|
+
messages: Array<{
|
|
207
|
+
role: "system" | "user" | "assistant";
|
|
208
|
+
content: string;
|
|
209
|
+
}>;
|
|
210
|
+
};
|
|
211
|
+
parameters?: {
|
|
212
|
+
result_format?: "message";
|
|
213
|
+
max_tokens?: number;
|
|
214
|
+
temperature?: number;
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Response envelope from the DashScope-native text-generation endpoint with
|
|
219
|
+
* `result_format: "message"`. The model's output lives under `output.choices`,
|
|
220
|
+
* mirroring the OpenAI shape but nested one level deeper.
|
|
221
|
+
*/
|
|
222
|
+
interface DashScopeIntentDetectResponse {
|
|
223
|
+
output: {
|
|
224
|
+
choices?: Array<{
|
|
225
|
+
finish_reason: string;
|
|
226
|
+
message: {
|
|
227
|
+
role: string;
|
|
228
|
+
content: string;
|
|
229
|
+
};
|
|
230
|
+
}>;
|
|
231
|
+
};
|
|
232
|
+
usage?: {
|
|
233
|
+
total_tokens?: number;
|
|
234
|
+
input_tokens?: number;
|
|
235
|
+
output_tokens?: number;
|
|
236
|
+
};
|
|
237
|
+
request_id: string;
|
|
238
|
+
}
|
|
185
239
|
interface DashScopeImageRequest {
|
|
186
240
|
model: string;
|
|
187
241
|
input: {
|
|
@@ -412,38 +466,6 @@ interface UserProfileResponse {
|
|
|
412
466
|
attributes: ProfileAttribute[];
|
|
413
467
|
};
|
|
414
468
|
}
|
|
415
|
-
interface KnowledgeRetrieveRequest {
|
|
416
|
-
IndexId: string;
|
|
417
|
-
Query: string;
|
|
418
|
-
DenseSimilarityTopK?: number;
|
|
419
|
-
SparseSimilarityTopK?: number;
|
|
420
|
-
EnableReranking?: boolean;
|
|
421
|
-
EnableRewrite?: boolean;
|
|
422
|
-
RerankTopN?: number;
|
|
423
|
-
TopK?: number;
|
|
424
|
-
Rerank?: Array<{
|
|
425
|
-
ModelName?: string;
|
|
426
|
-
RerankMode?: string;
|
|
427
|
-
RerankInstruct?: string;
|
|
428
|
-
}>;
|
|
429
|
-
RerankTopN_legacy?: number;
|
|
430
|
-
SearchFilters?: Array<{
|
|
431
|
-
Key: string;
|
|
432
|
-
Value: string;
|
|
433
|
-
Operator: string;
|
|
434
|
-
}>;
|
|
435
|
-
}
|
|
436
|
-
interface KnowledgeRetrieveResponse {
|
|
437
|
-
Success: boolean;
|
|
438
|
-
RequestId: string;
|
|
439
|
-
Data: {
|
|
440
|
-
Nodes: Array<{
|
|
441
|
-
Text: string;
|
|
442
|
-
Score: number;
|
|
443
|
-
Metadata: Record<string, unknown>;
|
|
444
|
-
}>;
|
|
445
|
-
};
|
|
446
|
-
}
|
|
447
469
|
interface DashScopeKnowledgeRetrieveRequest {
|
|
448
470
|
index_id: string;
|
|
449
471
|
query: string;
|
|
@@ -666,11 +688,6 @@ interface DashScopeTaskResponse {
|
|
|
666
688
|
request_id: string;
|
|
667
689
|
}
|
|
668
690
|
//#endregion
|
|
669
|
-
//#region src/auth/credentials.d.ts
|
|
670
|
-
declare function loadApiKeyFromConfig(): string | null;
|
|
671
|
-
declare function saveApiKeyToConfig(apiKey: string): Promise<void>;
|
|
672
|
-
declare function clearApiKey(): Promise<void>;
|
|
673
|
-
//#endregion
|
|
674
691
|
//#region src/config/schema.d.ts
|
|
675
692
|
declare const REGIONS: {
|
|
676
693
|
readonly cn: "https://dashscope.aliyuncs.com";
|
|
@@ -688,7 +705,17 @@ interface ConfigFile {
|
|
|
688
705
|
api_key?: string;
|
|
689
706
|
/** OAuth-style token from `bl auth login --console` callback; sent as `Authorization: Bearer …` */
|
|
690
707
|
access_token?: string;
|
|
708
|
+
/** Alibaba Cloud OpenAPI AccessKey ID from `bl auth login --open-api`. */
|
|
709
|
+
access_key_id?: string;
|
|
710
|
+
/** Alibaba Cloud OpenAPI AccessKey secret from `bl auth login --open-api`. */
|
|
711
|
+
access_key_secret?: string;
|
|
691
712
|
base_url?: string;
|
|
713
|
+
/**
|
|
714
|
+
* Dedicated base URL for the intent-detect model (tongyi-intent-detect-v3).
|
|
715
|
+
* Allows pointing the intent API at a different region/workspace than the
|
|
716
|
+
* main chat endpoint. Falls back to `base_url` when not set.
|
|
717
|
+
*/
|
|
718
|
+
intent_detect_base_url?: string;
|
|
692
719
|
output?: "text" | "json";
|
|
693
720
|
output_dir?: string;
|
|
694
721
|
timeout?: number;
|
|
@@ -697,8 +724,6 @@ interface ConfigFile {
|
|
|
697
724
|
default_image_model?: string;
|
|
698
725
|
default_speech_model?: string;
|
|
699
726
|
default_omni_model?: string;
|
|
700
|
-
access_key_id?: string;
|
|
701
|
-
access_key_secret?: string;
|
|
702
727
|
workspace_id?: string;
|
|
703
728
|
console_site?: "domestic" | "international";
|
|
704
729
|
console_region?: string;
|
|
@@ -706,22 +731,32 @@ interface ConfigFile {
|
|
|
706
731
|
telemetry?: boolean;
|
|
707
732
|
}
|
|
708
733
|
declare function parseConfigFile(raw: unknown): ConfigFile;
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
/** npm package name for self-update
|
|
715
|
-
npmPackage
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
734
|
+
/** 静态产品身份,createCli 注入一次(bl/rag 各异,故注入而非模块常量)。 */
|
|
735
|
+
interface Identity {
|
|
736
|
+
/** Product binary name, e.g. "bl", "rag". */
|
|
737
|
+
binName: string;
|
|
738
|
+
version: string;
|
|
739
|
+
/** npm package name for self-update, e.g. "bailian-cli". */
|
|
740
|
+
npmPackage: string;
|
|
741
|
+
/** User-Agent / telemetry client name. */
|
|
742
|
+
clientName: string;
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* 命令唯一会读的配置面(flag/env/file 解析后的有效值)。
|
|
746
|
+
* 不含身份(Identity)、不含秘密(credential);console 三元组为 dry-run 展示保留,
|
|
747
|
+
* 真实调用走 ConsoleCredential(同链解析,受控重叠)。
|
|
748
|
+
*/
|
|
749
|
+
interface Settings {
|
|
722
750
|
configPath?: string;
|
|
723
|
-
baseUrl
|
|
751
|
+
/** Dedicated base URL for intent-detect model; falls back to the model baseUrl at call site. */
|
|
752
|
+
intentDetectBaseUrl?: string;
|
|
724
753
|
output: "text" | "json";
|
|
754
|
+
/**
|
|
755
|
+
* Whether `output` came from an explicit source (flag/env/file) rather than
|
|
756
|
+
* the default. Commands whose default format differs from the global default
|
|
757
|
+
* (e.g. `advisor recommend` defaults to json) branch on this.
|
|
758
|
+
*/
|
|
759
|
+
outputExplicit: boolean;
|
|
725
760
|
outputDir?: string;
|
|
726
761
|
timeout: number;
|
|
727
762
|
defaultTextModel?: string;
|
|
@@ -729,100 +764,93 @@ interface Config {
|
|
|
729
764
|
defaultImageModel?: string;
|
|
730
765
|
defaultSpeechModel?: string;
|
|
731
766
|
defaultOmniModel?: string;
|
|
732
|
-
accessKeyId?: string;
|
|
733
|
-
accessKeySecret?: string;
|
|
734
767
|
workspaceId?: string;
|
|
735
|
-
consoleSite?: "domestic" | "international";
|
|
736
768
|
consoleRegion?: string;
|
|
769
|
+
consoleSite?: "domestic" | "international";
|
|
737
770
|
consoleSwitchAgent?: number;
|
|
738
771
|
verbose: boolean;
|
|
739
772
|
quiet: boolean;
|
|
740
|
-
noColor: boolean;
|
|
741
|
-
yes: boolean;
|
|
742
773
|
dryRun: boolean;
|
|
743
|
-
nonInteractive: boolean;
|
|
744
|
-
async: boolean;
|
|
745
774
|
telemetry: boolean;
|
|
746
775
|
}
|
|
747
776
|
//#endregion
|
|
748
|
-
//#region src/
|
|
749
|
-
type AuthMethod = "api-key" | "access-token";
|
|
750
|
-
interface ResolvedCredential {
|
|
751
|
-
token: string;
|
|
752
|
-
method: AuthMethod;
|
|
753
|
-
source: string;
|
|
754
|
-
}
|
|
755
|
-
//#endregion
|
|
756
|
-
//#region src/auth/resolver.d.ts
|
|
757
|
-
declare function resolveCredential(config: Config): Promise<ResolvedCredential>;
|
|
777
|
+
//#region src/config/store.d.ts
|
|
758
778
|
/**
|
|
759
|
-
*
|
|
760
|
-
*
|
|
761
|
-
* `access_token` even when `api_key` is also present in config.
|
|
779
|
+
* config 命令族的持久化能力面(lint 限定 commands/config/** 使用)。
|
|
780
|
+
* 读写都直达磁盘(非 dispatch 时的快照),与现有 config set/show 的行为一致。
|
|
762
781
|
*/
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
782
|
+
interface ConfigStore {
|
|
783
|
+
read(): ConfigFile;
|
|
784
|
+
/** 合并写入;patch 里值为 undefined 的键会被删除。 */
|
|
785
|
+
write(patch: Partial<ConfigFile>): Promise<void>;
|
|
786
|
+
/** 删除指定键。 */
|
|
787
|
+
unset(keys: (keyof ConfigFile)[]): Promise<void>;
|
|
788
|
+
path: string;
|
|
789
|
+
}
|
|
790
|
+
declare function makeConfigStore(): ConfigStore;
|
|
766
791
|
//#endregion
|
|
767
|
-
//#region src/
|
|
768
|
-
/**
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
792
|
+
//#region src/auth/types.d.ts
|
|
793
|
+
/** Where a resolved credential came from (shown by `bl auth status`). */
|
|
794
|
+
type CredentialSource = "flag" | "env" | "config";
|
|
795
|
+
/** Credential for the **model domain** (DashScope data plane). Always an API key. */
|
|
796
|
+
interface ApiKeyCredential {
|
|
797
|
+
token: string;
|
|
798
|
+
/** Base URL to send this key's requests to. */
|
|
799
|
+
baseUrl: string;
|
|
800
|
+
source: CredentialSource;
|
|
801
|
+
}
|
|
802
|
+
/** Credential for the **console domain** (Bailian console gateway). An access token + region/site. */
|
|
803
|
+
interface ConsoleCredential {
|
|
804
|
+
token: string;
|
|
805
|
+
region: string;
|
|
806
|
+
site: "domestic" | "international";
|
|
807
|
+
switchAgent?: number;
|
|
808
|
+
source: CredentialSource;
|
|
809
|
+
}
|
|
810
|
+
/** Credential for Alibaba Cloud OpenAPI calls signed with AK/SK. */
|
|
811
|
+
interface OpenApiCredential {
|
|
777
812
|
accessKeyId: string;
|
|
778
813
|
accessKeySecret: string;
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
814
|
+
source: CredentialSource;
|
|
815
|
+
}
|
|
816
|
+
/** Full auth snapshot for display (`bl auth status`) — what would resolve per domain. */
|
|
817
|
+
interface AuthState {
|
|
818
|
+
apiKey?: ApiKeyCredential;
|
|
819
|
+
console?: ConsoleCredential;
|
|
820
|
+
openapi?: OpenApiCredential;
|
|
785
821
|
}
|
|
786
|
-
declare function signRequest(cfg: AkSignConfig): Record<string, string>;
|
|
787
|
-
//#endregion
|
|
788
|
-
//#region src/client/endpoints.d.ts
|
|
789
|
-
declare function chatEndpoint(baseUrl: string): string;
|
|
790
|
-
declare function imageEndpoint(baseUrl: string): string;
|
|
791
|
-
declare function imageSyncEndpoint(baseUrl: string): string;
|
|
792
|
-
declare function videoGenerateEndpoint(baseUrl: string): string;
|
|
793
|
-
declare function taskEndpoint(baseUrl: string, taskId: string): string;
|
|
794
|
-
declare function appCompletionEndpoint(baseUrl: string, appId: string): string;
|
|
795
|
-
declare function memoryAddEndpoint(baseUrl: string): string;
|
|
796
|
-
declare function memorySearchEndpoint(baseUrl: string): string;
|
|
797
|
-
declare function memoryListEndpoint(baseUrl: string): string;
|
|
798
|
-
declare function memoryNodeEndpoint(baseUrl: string, nodeId: string): string;
|
|
799
|
-
declare function speechSynthesizeEndpoint(baseUrl: string): string;
|
|
800
|
-
declare function speechRecognizeEndpoint(baseUrl: string): string;
|
|
801
|
-
declare function profileSchemaEndpoint(baseUrl: string): string;
|
|
802
|
-
declare function userProfileEndpoint(baseUrl: string, schemaId: string): string;
|
|
803
|
-
declare function knowledgeRetrieveEndpoint(baseUrl: string): string;
|
|
804
|
-
declare function knowledgeSearchEndpoint(workspaceId: string): string;
|
|
805
|
-
declare function knowledgeChatEndpoint(workspaceId: string): string;
|
|
806
|
-
declare function mcpWebSearchEndpoint(baseUrl: string): string;
|
|
807
822
|
//#endregion
|
|
808
|
-
//#region src/
|
|
823
|
+
//#region src/auth/store.d.ts
|
|
824
|
+
/** 登录允许落盘的键:凭证本体 + 登录回调携带的连接/作用域字段。 */
|
|
825
|
+
type AuthPersistPatch = Pick<ConfigFile, "api_key" | "access_token" | "access_key_id" | "access_key_secret" | "base_url" | "console_site" | "console_region" | "console_switch_agent" | "workspace_id">;
|
|
809
826
|
/**
|
|
810
|
-
*
|
|
811
|
-
*
|
|
812
|
-
* Centralises the `x-dashscope-source-config` header so every fetch call
|
|
813
|
-
* (both via the central http client and the bypass paths) uses the
|
|
814
|
-
* same values from a single source of truth.
|
|
827
|
+
* auth 命令族的凭证能力面(lint 限定 commands/auth/** 使用)。
|
|
828
|
+
* 登录产生的全部落盘走 login,不放宽 configStore 的边界。
|
|
815
829
|
*/
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
830
|
+
interface AuthStore {
|
|
831
|
+
/** 各域"将会解析出"的凭证快照(auth status 用)。 */
|
|
832
|
+
describe(): AuthState;
|
|
833
|
+
/** 磁盘上当前是否存有各域凭证(区别于 describe:只看 file,不含 flag/env 源)。 */
|
|
834
|
+
stored(): {
|
|
835
|
+
apiKey: boolean;
|
|
836
|
+
console: boolean;
|
|
837
|
+
openapi: boolean;
|
|
838
|
+
};
|
|
839
|
+
/** model 域 baseUrl 链(flag > env > file > 默认);验证 API key 等无凭证场景用。 */
|
|
840
|
+
resolveBaseUrl(): string;
|
|
841
|
+
/** 登录落盘:合并写入,undefined 键忽略。 */
|
|
842
|
+
login(patch: AuthPersistPatch): Promise<void>;
|
|
843
|
+
/** 清凭证:console/openapi 只删对应域;all 清全部登录凭证。返回是否有变更。 */
|
|
844
|
+
logout(scope: "console" | "openapi" | "all"): Promise<boolean>;
|
|
845
|
+
}
|
|
846
|
+
declare function makeAuthStore(sources: ResolutionSources): AuthStore;
|
|
824
847
|
//#endregion
|
|
825
848
|
//#region src/client/http.d.ts
|
|
849
|
+
/** 传输层依赖:UA 用 identity,timeout/verbose 用 settings。凭证由调用方(Client)注头。 */
|
|
850
|
+
interface HttpDeps {
|
|
851
|
+
identity: Identity;
|
|
852
|
+
settings: Settings;
|
|
853
|
+
}
|
|
826
854
|
interface RequestOpts {
|
|
827
855
|
url: string;
|
|
828
856
|
method?: string;
|
|
@@ -830,12 +858,29 @@ interface RequestOpts {
|
|
|
830
858
|
headers?: Record<string, string>;
|
|
831
859
|
timeout?: number;
|
|
832
860
|
stream?: boolean;
|
|
833
|
-
noAuth?: boolean;
|
|
834
861
|
async?: boolean;
|
|
835
862
|
signal?: AbortSignal;
|
|
836
863
|
}
|
|
837
|
-
declare function request(
|
|
838
|
-
declare function requestJson<T>(
|
|
864
|
+
declare function request(deps: HttpDeps, opts: RequestOpts): Promise<Response>;
|
|
865
|
+
declare function requestJson<T>(deps: HttpDeps, opts: RequestOpts): Promise<T>;
|
|
866
|
+
//#endregion
|
|
867
|
+
//#region src/client/acs.d.ts
|
|
868
|
+
type AcsQueryParams = Record<string, string | string[] | undefined>;
|
|
869
|
+
interface AcsSignConfig {
|
|
870
|
+
accessKeyId: string;
|
|
871
|
+
accessKeySecret: string;
|
|
872
|
+
action: string;
|
|
873
|
+
version: string;
|
|
874
|
+
body: string;
|
|
875
|
+
host: string;
|
|
876
|
+
pathname: string;
|
|
877
|
+
method?: string;
|
|
878
|
+
/** ACS3 canonical query string (sorted, encoded, no leading `?`). */
|
|
879
|
+
queryString?: string;
|
|
880
|
+
}
|
|
881
|
+
/** Build ACS3 canonical query string from OpenAPI query parameters. */
|
|
882
|
+
declare function buildAcsCanonicalQuery(params: AcsQueryParams): string;
|
|
883
|
+
declare function signAcsRequest(cfg: AcsSignConfig): Record<string, string>;
|
|
839
884
|
//#endregion
|
|
840
885
|
//#region src/client/mcp.d.ts
|
|
841
886
|
interface McpTool {
|
|
@@ -857,14 +902,14 @@ interface McpToolResult {
|
|
|
857
902
|
* The path is `/api/v1/mcps/<serverCode>/mcp`; the `serverCode` is taken
|
|
858
903
|
* verbatim from `bl mcp list` (e.g. `WebSearch`, `market-cmapi00073529`).
|
|
859
904
|
*/
|
|
860
|
-
declare function
|
|
905
|
+
declare function bailianMcpPath(serverCode: string): string;
|
|
861
906
|
declare class McpClient {
|
|
862
907
|
private url;
|
|
863
908
|
private sessionId;
|
|
864
909
|
private nextId;
|
|
865
|
-
private
|
|
910
|
+
private deps;
|
|
866
911
|
private authToken;
|
|
867
|
-
constructor(
|
|
912
|
+
constructor(deps: HttpDeps, url: string, authToken?: string);
|
|
868
913
|
/** Initialize the MCP session. Must be called before any other method. */
|
|
869
914
|
initialize(): Promise<void>;
|
|
870
915
|
listTools(): Promise<McpTool[]>;
|
|
@@ -874,6 +919,329 @@ declare class McpClient {
|
|
|
874
919
|
private send;
|
|
875
920
|
}
|
|
876
921
|
//#endregion
|
|
922
|
+
//#region src/client/client.d.ts
|
|
923
|
+
/** Client 的结构化依赖:身份 + 有效配置 + 各域凭证(按命令的 auth 注入)。 */
|
|
924
|
+
interface ClientDeps {
|
|
925
|
+
identity: Identity;
|
|
926
|
+
settings: Settings;
|
|
927
|
+
/** Model 域 base URL(凭证无关链解析,resolveModelBaseUrl;有 apiCred 时两者一致)。 */
|
|
928
|
+
baseUrl: string;
|
|
929
|
+
apiCred?: ApiKeyCredential;
|
|
930
|
+
consoleCred?: ConsoleCredential;
|
|
931
|
+
openApiCred?: OpenApiCredential;
|
|
932
|
+
}
|
|
933
|
+
/** Like {@link RequestOpts} but with a `path` (credential baseUrl prepended) or an absolute URL. */
|
|
934
|
+
interface ClientRequestOpts extends Omit<RequestOpts, "url" | "noAuth"> {
|
|
935
|
+
path: string;
|
|
936
|
+
}
|
|
937
|
+
interface ClientOpenApiQueryOpts {
|
|
938
|
+
host: string;
|
|
939
|
+
path: string;
|
|
940
|
+
action: string;
|
|
941
|
+
version: string;
|
|
942
|
+
method: "GET" | "POST";
|
|
943
|
+
queryParams: AcsQueryParams;
|
|
944
|
+
}
|
|
945
|
+
interface OpenApiResponse {
|
|
946
|
+
Success?: boolean;
|
|
947
|
+
Code?: string;
|
|
948
|
+
Message?: string;
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* A command's network surface: call its methods to reach the API — the
|
|
952
|
+
* credential and base URL are already baked in, so commands never handle tokens
|
|
953
|
+
* or baseUrl. Model methods (`request`/`requestJson`/`mcp`) need an api key;
|
|
954
|
+
* `uploadFile` only needs one for local files, and passes URLs through without
|
|
955
|
+
* credentials. `console` needs a console token; calling one without its
|
|
956
|
+
* credential throws.
|
|
957
|
+
*/
|
|
958
|
+
declare class Client {
|
|
959
|
+
private readonly deps;
|
|
960
|
+
constructor(deps: ClientDeps);
|
|
961
|
+
private get http();
|
|
962
|
+
private requireApi;
|
|
963
|
+
private requireOpenApi;
|
|
964
|
+
/** Model-domain base URL. Readable without a key (e.g. dry-run preview); real requests still need one. */
|
|
965
|
+
get baseUrl(): string;
|
|
966
|
+
/** Full URL for a model-domain {@link path}; build request/display URLs only through this. */
|
|
967
|
+
url(path: string): string;
|
|
968
|
+
private toOpts;
|
|
969
|
+
request(opts: ClientRequestOpts): Promise<Response>;
|
|
970
|
+
requestJson<T>(opts: ClientRequestOpts): Promise<T>;
|
|
971
|
+
/** Resolve a file arg: upload a local path to OSS (returns oss:// URL), or pass a URL through. */
|
|
972
|
+
uploadFile(source: string, model: string, opts?: {
|
|
973
|
+
signal?: AbortSignal;
|
|
974
|
+
}): Promise<string>;
|
|
975
|
+
/** Open an MCP client. Accepts a path (prepended with the model baseUrl) or an absolute URL. */
|
|
976
|
+
mcp(pathOrUrl: string): McpClient;
|
|
977
|
+
console<T>(api: string, data: Record<string, unknown>): Promise<T>;
|
|
978
|
+
openApiQueryJson<T extends OpenApiResponse>(opts: ClientOpenApiQueryOpts): Promise<T>;
|
|
979
|
+
}
|
|
980
|
+
//#endregion
|
|
981
|
+
//#region src/types/command.d.ts
|
|
982
|
+
/** A presence flag: `--quiet`. No value; absent → false. */
|
|
983
|
+
interface SwitchFlag {
|
|
984
|
+
type: "switch";
|
|
985
|
+
description: string;
|
|
986
|
+
}
|
|
987
|
+
/** A value flag: `--prompt <text>`, `--n <count>`, `--watermark true|false`. */
|
|
988
|
+
interface ValueFlag {
|
|
989
|
+
type: "string" | "number" | "boolean" | "array";
|
|
990
|
+
description: string;
|
|
991
|
+
valueHint: string;
|
|
992
|
+
required?: boolean;
|
|
993
|
+
/**
|
|
994
|
+
* Restrict to a fixed set of values. The parser rejects anything else and the
|
|
995
|
+
* parsed type narrows to the union. Declare with `as const` so the literals
|
|
996
|
+
* survive inference: `choices: ["mp3", "wav"] as const`.
|
|
997
|
+
*/
|
|
998
|
+
choices?: readonly string[];
|
|
999
|
+
}
|
|
1000
|
+
type FlagDef = SwitchFlag | ValueFlag;
|
|
1001
|
+
type FlagsDef = Record<string, FlagDef>;
|
|
1002
|
+
type ParsedValue<F extends FlagDef> = F extends SwitchFlag ? boolean : F extends {
|
|
1003
|
+
type: "number";
|
|
1004
|
+
} ? number : F extends {
|
|
1005
|
+
type: "boolean";
|
|
1006
|
+
} ? boolean : F extends {
|
|
1007
|
+
choices: readonly (infer C extends string)[];
|
|
1008
|
+
} ? F extends {
|
|
1009
|
+
type: "array";
|
|
1010
|
+
} ? C[] : C : F extends {
|
|
1011
|
+
type: "array";
|
|
1012
|
+
} ? string[] : string;
|
|
1013
|
+
/** Switches and `required` value flags are present; other value flags optional. */
|
|
1014
|
+
type IsRequired<F extends FlagDef> = F extends SwitchFlag ? true : F extends {
|
|
1015
|
+
required: true;
|
|
1016
|
+
} ? true : false;
|
|
1017
|
+
/**
|
|
1018
|
+
* Map a FlagsDef to the parsed flags object type. Required flags (switches +
|
|
1019
|
+
* `required: true`) are required properties; optional value flags are `?`.
|
|
1020
|
+
*/
|
|
1021
|
+
type ParsedFlags<F extends FlagsDef> = { [K in keyof F as IsRequired<F[K]> extends true ? K : never]: ParsedValue<F[K]> } & { [K in keyof F as IsRequired<F[K]> extends true ? never : K]?: ParsedValue<F[K]> };
|
|
1022
|
+
type AuthRequirement = "apiKey" | "console" | "openapi" | "none";
|
|
1023
|
+
/** 所有命令都可用的全局 flag。 */
|
|
1024
|
+
declare const GLOBAL_FLAGS: {
|
|
1025
|
+
output: {
|
|
1026
|
+
type: "string";
|
|
1027
|
+
valueHint: string;
|
|
1028
|
+
description: string;
|
|
1029
|
+
};
|
|
1030
|
+
timeout: {
|
|
1031
|
+
type: "number";
|
|
1032
|
+
valueHint: string;
|
|
1033
|
+
description: string;
|
|
1034
|
+
};
|
|
1035
|
+
quiet: {
|
|
1036
|
+
type: "switch";
|
|
1037
|
+
description: string;
|
|
1038
|
+
};
|
|
1039
|
+
verbose: {
|
|
1040
|
+
type: "switch";
|
|
1041
|
+
description: string;
|
|
1042
|
+
};
|
|
1043
|
+
dryRun: {
|
|
1044
|
+
type: "switch";
|
|
1045
|
+
description: string;
|
|
1046
|
+
};
|
|
1047
|
+
help: {
|
|
1048
|
+
type: "switch";
|
|
1049
|
+
description: string;
|
|
1050
|
+
};
|
|
1051
|
+
version: {
|
|
1052
|
+
type: "switch";
|
|
1053
|
+
description: string;
|
|
1054
|
+
};
|
|
1055
|
+
};
|
|
1056
|
+
/** Command-scoped flag for commands that support parallel API calls. */
|
|
1057
|
+
declare const CONCURRENT_FLAG: {
|
|
1058
|
+
concurrent: {
|
|
1059
|
+
type: "number";
|
|
1060
|
+
valueHint: string;
|
|
1061
|
+
description: string;
|
|
1062
|
+
};
|
|
1063
|
+
};
|
|
1064
|
+
/** Command-scoped flag for task-based commands that can return without polling. */
|
|
1065
|
+
declare const ASYNC_FLAG: {
|
|
1066
|
+
async: {
|
|
1067
|
+
type: "switch";
|
|
1068
|
+
description: string;
|
|
1069
|
+
};
|
|
1070
|
+
};
|
|
1071
|
+
/** Model 域凭证/连接 flag,`auth: "apiKey"` 命令可见。 */
|
|
1072
|
+
declare const MODEL_AUTH_FLAGS: {
|
|
1073
|
+
apiKey: {
|
|
1074
|
+
type: "string";
|
|
1075
|
+
valueHint: string;
|
|
1076
|
+
description: string;
|
|
1077
|
+
};
|
|
1078
|
+
baseUrl: {
|
|
1079
|
+
type: "string";
|
|
1080
|
+
valueHint: string;
|
|
1081
|
+
description: string;
|
|
1082
|
+
};
|
|
1083
|
+
};
|
|
1084
|
+
/** Console 域目标/作用域 flag,`auth: "console"` 命令可见。 */
|
|
1085
|
+
declare const CONSOLE_AUTH_FLAGS: {
|
|
1086
|
+
consoleRegion: {
|
|
1087
|
+
type: "string";
|
|
1088
|
+
valueHint: string;
|
|
1089
|
+
description: string;
|
|
1090
|
+
};
|
|
1091
|
+
consoleSite: {
|
|
1092
|
+
type: "string";
|
|
1093
|
+
valueHint: string;
|
|
1094
|
+
description: string;
|
|
1095
|
+
};
|
|
1096
|
+
consoleSwitchAgent: {
|
|
1097
|
+
type: "number";
|
|
1098
|
+
valueHint: string;
|
|
1099
|
+
description: string;
|
|
1100
|
+
};
|
|
1101
|
+
workspaceId: {
|
|
1102
|
+
type: "string";
|
|
1103
|
+
valueHint: string;
|
|
1104
|
+
description: string;
|
|
1105
|
+
};
|
|
1106
|
+
};
|
|
1107
|
+
/** Alibaba Cloud OpenAPI AK/SK credential flags, visible to `auth: "openapi"` commands. */
|
|
1108
|
+
declare const OPENAPI_AUTH_FLAGS: {
|
|
1109
|
+
accessKeyId: {
|
|
1110
|
+
type: "string";
|
|
1111
|
+
valueHint: string;
|
|
1112
|
+
description: string;
|
|
1113
|
+
};
|
|
1114
|
+
accessKeySecret: {
|
|
1115
|
+
type: "string";
|
|
1116
|
+
valueHint: string;
|
|
1117
|
+
description: string;
|
|
1118
|
+
};
|
|
1119
|
+
};
|
|
1120
|
+
/** sources 里可能出现的全部 flag(全局 + 凭证域)。 */
|
|
1121
|
+
type SourceFlags = ParsedFlags<typeof GLOBAL_FLAGS & typeof MODEL_AUTH_FLAGS & typeof CONSOLE_AUTH_FLAGS & typeof OPENAPI_AUTH_FLAGS>;
|
|
1122
|
+
/** 该命令可见的凭证域 flag 定义。 */
|
|
1123
|
+
declare function credentialFlagDefs(cmd: {
|
|
1124
|
+
auth: AuthRequirement;
|
|
1125
|
+
}): FlagsDef;
|
|
1126
|
+
/**
|
|
1127
|
+
* What a command's `run` receives: `client` for all network calls (its
|
|
1128
|
+
* credential is already injected per the command's `auth`), `settings` for the
|
|
1129
|
+
* resolved configuration surface, `identity` for product identity, and `flags`
|
|
1130
|
+
* for parsed arguments. Never handle tokens or baseUrl.
|
|
1131
|
+
*/
|
|
1132
|
+
interface CommandContext<F extends FlagsDef = FlagsDef> {
|
|
1133
|
+
/** 静态产品身份(binName/version/npmPackage/clientName)。 */
|
|
1134
|
+
identity: Identity;
|
|
1135
|
+
/** flag/env/file 解析后的有效配置面。 */
|
|
1136
|
+
settings: Settings;
|
|
1137
|
+
/** 只含本命令声明的 flag;全局 flag 经 settings 读。 */
|
|
1138
|
+
flags: ParsedFlags<F>;
|
|
1139
|
+
/** Network surface; the credential for the command's `auth` is pre-injected. */
|
|
1140
|
+
client: Client;
|
|
1141
|
+
/** 惰性访问器,lint 限定 commands/config/** 使用。 */
|
|
1142
|
+
configStore(): ConfigStore;
|
|
1143
|
+
/** 惰性访问器,lint 限定 commands/auth/** 使用。 */
|
|
1144
|
+
authStore(): AuthStore;
|
|
1145
|
+
}
|
|
1146
|
+
/**
|
|
1147
|
+
* A command. Generic over its flags `F` so `run`/`validate` receive precisely
|
|
1148
|
+
* typed flags (`ParsedFlags<F>` = 命令自有 flag). Stored heterogeneously as
|
|
1149
|
+
* {@link AnyCommand}; the precise typing lives at the `defineCommand` call site.
|
|
1150
|
+
*/
|
|
1151
|
+
interface Command<F extends FlagsDef = FlagsDef> {
|
|
1152
|
+
description: string;
|
|
1153
|
+
/** Credential this command requires. See {@link AuthRequirement}. */
|
|
1154
|
+
auth: AuthRequirement;
|
|
1155
|
+
/** Usage line arg portion, e.g. "--prompt <text> [flags]". Manually written. */
|
|
1156
|
+
usageArgs?: string;
|
|
1157
|
+
/** Example arg strings (without the `<bin> <path>` prefix). */
|
|
1158
|
+
exampleArgs?: string[];
|
|
1159
|
+
notes?: string[];
|
|
1160
|
+
flags?: F;
|
|
1161
|
+
/**
|
|
1162
|
+
* Cross-flag validation, after parsing and before run. Return an error message
|
|
1163
|
+
* → UsageError; undefined to pass. Single-flag `required` is enforced by the
|
|
1164
|
+
* parser — use this for rules spanning flags or depending on a flag's *value*.
|
|
1165
|
+
*/
|
|
1166
|
+
validate?: (flags: ParsedFlags<F>) => string | undefined;
|
|
1167
|
+
run: (ctx: CommandContext<F>) => Promise<void>;
|
|
1168
|
+
}
|
|
1169
|
+
/** Type-erased command for heterogeneous storage (registry / context). */
|
|
1170
|
+
type AnyCommand = Command<any>;
|
|
1171
|
+
/** Identity wrapper whose only job is to infer `F` from `spec.flags`. */
|
|
1172
|
+
declare function defineCommand<F extends FlagsDef>(spec: Command<F>): Command<F>;
|
|
1173
|
+
//#endregion
|
|
1174
|
+
//#region src/config/loader.d.ts
|
|
1175
|
+
declare function readConfigFile(): ConfigFile;
|
|
1176
|
+
declare function writeConfigFile(data: Record<string, unknown>): Promise<void>;
|
|
1177
|
+
/**
|
|
1178
|
+
* 解析的三个来源,dispatch 边界一次构建。flags 收 Partial:ParsedFlags 里 switch 是
|
|
1179
|
+
* 必填 boolean,收 Partial 让 pipeline 等无 flag 场景传 {} 即可。
|
|
1180
|
+
*/
|
|
1181
|
+
interface ResolutionSources {
|
|
1182
|
+
flags: Partial<SourceFlags>;
|
|
1183
|
+
file: ConfigFile;
|
|
1184
|
+
env: NodeJS.ProcessEnv;
|
|
1185
|
+
}
|
|
1186
|
+
declare function buildSources(flags: Partial<SourceFlags>): ResolutionSources;
|
|
1187
|
+
/**
|
|
1188
|
+
* 纯解析 sources → Settings(命令唯一会读的配置面)。不含身份、baseUrl、鉴权。
|
|
1189
|
+
* 各字段链序 flag > env > file > 默认;锁定表 tests/config-priority.test.ts。
|
|
1190
|
+
*/
|
|
1191
|
+
declare function buildSettings(s: ResolutionSources): Settings;
|
|
1192
|
+
//#endregion
|
|
1193
|
+
//#region src/auth/resolver.d.ts
|
|
1194
|
+
/** Model-domain baseUrl(flag > env > file > cn)——无需 key 也可解析;login 验证等用。 */
|
|
1195
|
+
declare function resolveModelBaseUrl(s: ResolutionSources): string;
|
|
1196
|
+
/**
|
|
1197
|
+
* Model-domain credential from sources. Priority: `--api-key` flag >
|
|
1198
|
+
* `DASHSCOPE_API_KEY` env > config.json `api_key`. baseUrl: flag > env > file > cn.
|
|
1199
|
+
*/
|
|
1200
|
+
declare function resolveApiKey(s: ResolutionSources): ApiKeyCredential;
|
|
1201
|
+
/** Console-domain credential from sources — access token + 连接目标(flag > file > 默认)。 */
|
|
1202
|
+
declare function resolveConsole(s: ResolutionSources): ConsoleCredential;
|
|
1203
|
+
/** Alibaba Cloud OpenAPI AK/SK credential. Priority: flags > env > config. */
|
|
1204
|
+
declare function resolveOpenApi(s: ResolutionSources): OpenApiCredential;
|
|
1205
|
+
/** Full auth snapshot from sources — what would resolve per domain (or undefined). */
|
|
1206
|
+
declare function describeAuthState(s: ResolutionSources): AuthState;
|
|
1207
|
+
//#endregion
|
|
1208
|
+
//#region src/client/endpoints.d.ts
|
|
1209
|
+
declare function chatPath(): string;
|
|
1210
|
+
declare function imagePath(): string;
|
|
1211
|
+
declare function imageSyncPath(): string;
|
|
1212
|
+
declare function videoGeneratePath(): string;
|
|
1213
|
+
declare function taskPath(taskId: string): string;
|
|
1214
|
+
declare function appCompletionPath(appId: string): string;
|
|
1215
|
+
declare function memoryAddPath(): string;
|
|
1216
|
+
declare function memorySearchPath(): string;
|
|
1217
|
+
declare function memoryListPath(): string;
|
|
1218
|
+
declare function memoryNodePath(nodeId: string): string;
|
|
1219
|
+
declare function speechSynthesizePath(): string;
|
|
1220
|
+
declare function speechRecognizePath(): string;
|
|
1221
|
+
declare function profileSchemaPath(): string;
|
|
1222
|
+
declare function userProfilePath(schemaId: string): string;
|
|
1223
|
+
declare function knowledgeRetrievePath(): string;
|
|
1224
|
+
declare function knowledgeSearchEndpoint(workspaceId: string): string;
|
|
1225
|
+
declare function knowledgeChatEndpoint(workspaceId: string): string;
|
|
1226
|
+
declare function mcpWebSearchPath(): string;
|
|
1227
|
+
//#endregion
|
|
1228
|
+
//#region src/client/headers.d.ts
|
|
1229
|
+
/**
|
|
1230
|
+
* Shared HTTP request headers for all outgoing requests.
|
|
1231
|
+
*
|
|
1232
|
+
* Centralises the `x-dashscope-source-config` header so every fetch call
|
|
1233
|
+
* (both via the central http client and the bypass paths) uses the
|
|
1234
|
+
* same values from a single source of truth.
|
|
1235
|
+
*/
|
|
1236
|
+
declare const CHANNEL = "bailian-cli";
|
|
1237
|
+
declare const TAGS: {
|
|
1238
|
+
t1: string;
|
|
1239
|
+
t2: string;
|
|
1240
|
+
};
|
|
1241
|
+
declare const SOURCE_CONFIG: string;
|
|
1242
|
+
/** Standard tracking headers required on every outbound request. */
|
|
1243
|
+
declare function trackingHeaders(): Record<string, string>;
|
|
1244
|
+
//#endregion
|
|
877
1245
|
//#region src/client/stream.d.ts
|
|
878
1246
|
interface ServerSentEvent {
|
|
879
1247
|
event?: string;
|
|
@@ -884,8 +1252,11 @@ declare function parseSSE(response: Response): AsyncGenerator<ServerSentEvent>;
|
|
|
884
1252
|
//#endregion
|
|
885
1253
|
//#region src/console/gateway.d.ts
|
|
886
1254
|
type ConsoleSite = "domestic" | "international";
|
|
887
|
-
/**
|
|
888
|
-
|
|
1255
|
+
/**
|
|
1256
|
+
* Resolved console gateway settings (same defaults as {@link callConsoleGateway}).
|
|
1257
|
+
* 参数只需 settings 的 console 三元组;dry-run 展示分支直接传 settings。
|
|
1258
|
+
*/
|
|
1259
|
+
declare function effectiveConsoleGatewayConfig(config: Pick<Settings, "consoleRegion" | "consoleSite" | "consoleSwitchAgent">): {
|
|
889
1260
|
consoleRegion: string;
|
|
890
1261
|
consoleSite: ConsoleSite;
|
|
891
1262
|
consoleSwitchAgent?: number;
|
|
@@ -894,23 +1265,19 @@ interface ConsoleGatewayRequest {
|
|
|
894
1265
|
/** Console API name, e.g. zeldaEasy.broadscope-bailian.freeTrial.queryFreeTierQuota */
|
|
895
1266
|
api: string;
|
|
896
1267
|
data: Record<string, unknown>;
|
|
897
|
-
/** Console region (e.g. cn-beijing, ap-southeast-1). Falls back to config.consoleRegion, then "cn-beijing". */
|
|
898
|
-
region?: string;
|
|
899
|
-
/** Console site. Falls back to config.consoleSite, then "domestic". */
|
|
900
|
-
site?: ConsoleSite;
|
|
901
|
-
/** Switch-agent UID for delegated access. Falls back to config.consoleSwitchAgent. */
|
|
902
|
-
switchAgent?: number;
|
|
903
1268
|
}
|
|
904
1269
|
/**
|
|
905
1270
|
* Invoke a Bailian **console** OpenAPI via the CLI gateway (`/cli/api.json`).
|
|
906
|
-
*
|
|
907
|
-
*
|
|
908
|
-
* public console APIs that don't require a login session.
|
|
909
|
-
*
|
|
910
|
-
* Gateway URL and action are resolved from `region + site` via {@link REGION_GATEWAYS}.
|
|
911
|
-
* Each parameter falls back to the corresponding config value, then to a hardcoded default.
|
|
1271
|
+
* 目标(region/site/switchAgent)与 token 均由调用方解析后传入:Client.console 传
|
|
1272
|
+
* ConsoleCredential;公共目录类 API(如 advisor 的模型目录)可不带 token 匿名调用。
|
|
912
1273
|
*/
|
|
913
|
-
|
|
1274
|
+
interface ConsoleGatewayTarget {
|
|
1275
|
+
region: string;
|
|
1276
|
+
site: ConsoleSite;
|
|
1277
|
+
switchAgent?: number;
|
|
1278
|
+
token?: string;
|
|
1279
|
+
}
|
|
1280
|
+
declare function callConsoleGateway(target: ConsoleGatewayTarget, timeoutSec: number, {
|
|
914
1281
|
api,
|
|
915
1282
|
data
|
|
916
1283
|
}: ConsoleGatewayRequest): Promise<unknown>;
|
|
@@ -927,32 +1294,8 @@ interface ModelListResult {
|
|
|
927
1294
|
total: number;
|
|
928
1295
|
models: Record<string, unknown>[];
|
|
929
1296
|
}
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
//#region src/types/flags.d.ts
|
|
933
|
-
interface GlobalFlags {
|
|
934
|
-
apiKey?: string;
|
|
935
|
-
baseUrl?: string;
|
|
936
|
-
output?: string;
|
|
937
|
-
quiet: boolean;
|
|
938
|
-
verbose: boolean;
|
|
939
|
-
timeout?: number;
|
|
940
|
-
noColor: boolean;
|
|
941
|
-
yes: boolean;
|
|
942
|
-
dryRun: boolean;
|
|
943
|
-
help: boolean;
|
|
944
|
-
nonInteractive: boolean;
|
|
945
|
-
async: boolean;
|
|
946
|
-
consoleRegion?: string;
|
|
947
|
-
consoleSite?: string;
|
|
948
|
-
consoleSwitchAgent?: number;
|
|
949
|
-
[key: string]: unknown;
|
|
950
|
-
}
|
|
951
|
-
//#endregion
|
|
952
|
-
//#region src/config/loader.d.ts
|
|
953
|
-
declare function readConfigFile(): ConfigFile;
|
|
954
|
-
declare function writeConfigFile(data: Record<string, unknown>): Promise<void>;
|
|
955
|
-
declare function loadConfig(flags: GlobalFlags): Config;
|
|
1297
|
+
/** Page the console model-list API. `call` makes the gateway request (e.g. `client.console`). */
|
|
1298
|
+
declare function fetchModelList(call: (api: string, data: Record<string, unknown>) => Promise<unknown>, params?: ModelListParams): Promise<ModelListResult>;
|
|
956
1299
|
//#endregion
|
|
957
1300
|
//#region src/config/paths.d.ts
|
|
958
1301
|
declare function getConfigDir(): string;
|
|
@@ -1108,7 +1451,7 @@ interface DatasetUploadParams {
|
|
|
1108
1451
|
* `Response`'s helper to avoid the buffer doubling. Fall back to readFileSync
|
|
1109
1452
|
* for small files where streaming overhead isn't worth it.
|
|
1110
1453
|
*/
|
|
1111
|
-
declare function uploadDataset(
|
|
1454
|
+
declare function uploadDataset(client: Client, params: DatasetUploadParams): Promise<DatasetFile>;
|
|
1112
1455
|
interface DatasetListParams {
|
|
1113
1456
|
pageNo?: number;
|
|
1114
1457
|
pageSize?: number;
|
|
@@ -1116,11 +1459,11 @@ interface DatasetListParams {
|
|
|
1116
1459
|
signal?: AbortSignal;
|
|
1117
1460
|
}
|
|
1118
1461
|
/** GET /api/v1/files */
|
|
1119
|
-
declare function listDatasets(
|
|
1462
|
+
declare function listDatasets(client: Client, params?: DatasetListParams): Promise<DatasetListResponse>;
|
|
1120
1463
|
/** GET /api/v1/files/{file_id} */
|
|
1121
|
-
declare function getDataset(
|
|
1464
|
+
declare function getDataset(client: Client, fileId: string, signal?: AbortSignal): Promise<DatasetGetResponse>;
|
|
1122
1465
|
/** DELETE /api/v1/files/{file_id} */
|
|
1123
|
-
declare function deleteDataset(
|
|
1466
|
+
declare function deleteDataset(client: Client, fileId: string, signal?: AbortSignal): Promise<DatasetDeleteResponse>;
|
|
1124
1467
|
//#endregion
|
|
1125
1468
|
//#region src/dataset/validate/types.d.ts
|
|
1126
1469
|
/**
|
|
@@ -1433,7 +1776,7 @@ interface GetFineTuneResponse {
|
|
|
1433
1776
|
//#endregion
|
|
1434
1777
|
//#region src/finetune/api.d.ts
|
|
1435
1778
|
/** POST /api/v1/fine-tunes */
|
|
1436
|
-
declare function createFineTune(
|
|
1779
|
+
declare function createFineTune(client: Client, body: CreateFineTuneRequest, signal?: AbortSignal): Promise<CreateFineTuneResponse>;
|
|
1437
1780
|
interface ListFineTunesParams {
|
|
1438
1781
|
pageNo?: number;
|
|
1439
1782
|
pageSize?: number;
|
|
@@ -1441,22 +1784,22 @@ interface ListFineTunesParams {
|
|
|
1441
1784
|
signal?: AbortSignal;
|
|
1442
1785
|
}
|
|
1443
1786
|
/** GET /api/v1/fine-tunes */
|
|
1444
|
-
declare function listFineTunes(
|
|
1787
|
+
declare function listFineTunes(client: Client, params?: ListFineTunesParams): Promise<ListFineTunesResponse>;
|
|
1445
1788
|
/** GET /api/v1/fine-tunes/{job_id} */
|
|
1446
|
-
declare function getFineTune(
|
|
1789
|
+
declare function getFineTune(client: Client, jobId: string, signal?: AbortSignal): Promise<GetFineTuneResponse>;
|
|
1447
1790
|
/** POST /api/v1/fine-tunes/{job_id}/cancel */
|
|
1448
|
-
declare function cancelFineTune(
|
|
1791
|
+
declare function cancelFineTune(client: Client, jobId: string, signal?: AbortSignal): Promise<CancelFineTuneResponse>;
|
|
1449
1792
|
/** DELETE /api/v1/fine-tunes/{job_id} */
|
|
1450
|
-
declare function deleteFineTune(
|
|
1793
|
+
declare function deleteFineTune(client: Client, jobId: string, signal?: AbortSignal): Promise<DeleteFineTuneResponse>;
|
|
1451
1794
|
interface GetFineTuneLogsParams {
|
|
1452
1795
|
pageNo?: number;
|
|
1453
1796
|
pageSize?: number;
|
|
1454
1797
|
signal?: AbortSignal;
|
|
1455
1798
|
}
|
|
1456
1799
|
/** GET /api/v1/fine-tunes/{job_id}/logs */
|
|
1457
|
-
declare function getFineTuneLogs(
|
|
1800
|
+
declare function getFineTuneLogs(client: Client, jobId: string, params?: GetFineTuneLogsParams): Promise<GetFineTuneLogsResponse>;
|
|
1458
1801
|
/** GET /api/v1/fine-tunes/{job_id}/checkpoints */
|
|
1459
|
-
declare function listCheckpoints(
|
|
1802
|
+
declare function listCheckpoints(client: Client, jobId: string, signal?: AbortSignal): Promise<ListCheckpointsResponse>;
|
|
1460
1803
|
/**
|
|
1461
1804
|
* GET /api/v1/fine-tunes/{job_id}/export/{checkpoint}?model_name={name}
|
|
1462
1805
|
*
|
|
@@ -1464,7 +1807,7 @@ declare function listCheckpoints(config: Config, jobId: string, signal?: AbortSi
|
|
|
1464
1807
|
* `bl deploy create` can target it. The platform may auto-export the best
|
|
1465
1808
|
* checkpoint on SUCCEEDED, but explicit export is the canonical path.
|
|
1466
1809
|
*/
|
|
1467
|
-
declare function exportCheckpoint(
|
|
1810
|
+
declare function exportCheckpoint(client: Client, jobId: string, checkpoint: string, modelName: string, signal?: AbortSignal): Promise<ExportCheckpointResponse>;
|
|
1468
1811
|
//#endregion
|
|
1469
1812
|
//#region src/finetune/capability.d.ts
|
|
1470
1813
|
/**
|
|
@@ -1562,7 +1905,7 @@ declare function listSupportedTrainingTypes(model: ModelCapability | undefined |
|
|
|
1562
1905
|
* server's `name` filter is a substring match, so we additionally require an
|
|
1563
1906
|
* exact `model` equality to avoid e.g. `qwen3-8b` matching `qwen3-8b-v2`).
|
|
1564
1907
|
*/
|
|
1565
|
-
declare function fetchModelCapability(
|
|
1908
|
+
declare function fetchModelCapability(settings: Settings, modelName: string): Promise<ModelCapability | null>;
|
|
1566
1909
|
//#endregion
|
|
1567
1910
|
//#region src/finetune/preflight.d.ts
|
|
1568
1911
|
/** Stable issue code for "too few training samples for the batch size". */
|
|
@@ -1843,7 +2186,7 @@ interface UpdateDeploymentResponse {
|
|
|
1843
2186
|
//#endregion
|
|
1844
2187
|
//#region src/deploy/api.d.ts
|
|
1845
2188
|
/** POST /api/v1/deployments */
|
|
1846
|
-
declare function createDeployment(
|
|
2189
|
+
declare function createDeployment(client: Client, body: CreateDeploymentRequest, signal?: AbortSignal): Promise<CreateDeploymentResponse>;
|
|
1847
2190
|
interface ListDeploymentsParams {
|
|
1848
2191
|
pageNo?: number;
|
|
1849
2192
|
pageSize?: number;
|
|
@@ -1851,11 +2194,11 @@ interface ListDeploymentsParams {
|
|
|
1851
2194
|
signal?: AbortSignal;
|
|
1852
2195
|
}
|
|
1853
2196
|
/** GET /api/v1/deployments */
|
|
1854
|
-
declare function listDeployments(
|
|
2197
|
+
declare function listDeployments(client: Client, params?: ListDeploymentsParams): Promise<ListDeploymentsResponse>;
|
|
1855
2198
|
/** GET /api/v1/deployments/{deployed_model} */
|
|
1856
|
-
declare function getDeployment(
|
|
2199
|
+
declare function getDeployment(client: Client, deployedModel: string, signal?: AbortSignal): Promise<GetDeploymentResponse>;
|
|
1857
2200
|
/** DELETE /api/v1/deployments/{deployed_model} */
|
|
1858
|
-
declare function deleteDeployment(
|
|
2201
|
+
declare function deleteDeployment(client: Client, deployedModel: string, signal?: AbortSignal): Promise<DeleteDeploymentResponse>;
|
|
1859
2202
|
interface ListDeployableModelsParams {
|
|
1860
2203
|
pageNo?: number;
|
|
1861
2204
|
pageSize?: number;
|
|
@@ -1866,57 +2209,15 @@ interface ListDeployableModelsParams {
|
|
|
1866
2209
|
signal?: AbortSignal;
|
|
1867
2210
|
}
|
|
1868
2211
|
/** GET /api/v1/deployments/models */
|
|
1869
|
-
declare function listDeployableModels(
|
|
2212
|
+
declare function listDeployableModels(client: Client, params?: ListDeployableModelsParams): Promise<ListDeployableModelsResponse>;
|
|
1870
2213
|
/** PUT /api/v1/deployments/{deployed_model}/scale */
|
|
1871
|
-
declare function scaleDeployment(
|
|
2214
|
+
declare function scaleDeployment(client: Client, deployedModel: string, body: ScaleDeploymentRequest, signal?: AbortSignal): Promise<ScaleDeploymentResponse>;
|
|
1872
2215
|
/**
|
|
1873
2216
|
* PUT /api/v1/deployments/{deployed_model}/update
|
|
1874
2217
|
*
|
|
1875
2218
|
* Update rate limits. At least one of `rpm_limit` / `tpm_limit` must be set.
|
|
1876
2219
|
*/
|
|
1877
|
-
declare function updateDeployment(
|
|
1878
|
-
//#endregion
|
|
1879
|
-
//#region src/types/command.d.ts
|
|
1880
|
-
interface OptionDef {
|
|
1881
|
-
flag: string;
|
|
1882
|
-
description: string;
|
|
1883
|
-
type?: "string" | "number" | "boolean" | "array";
|
|
1884
|
-
required?: boolean;
|
|
1885
|
-
}
|
|
1886
|
-
interface Command {
|
|
1887
|
-
description: string;
|
|
1888
|
-
/**
|
|
1889
|
-
* Argument portion of the usage line, WITHOUT the `<bin> <path>` prefix
|
|
1890
|
-
* (e.g. "--index-id <id> --query <text> [flags]"). The runtime prepends the
|
|
1891
|
-
* product binary name and the command's actual path when rendering help, so
|
|
1892
|
-
* the same command renders correctly under any product (bl / rag / …).
|
|
1893
|
-
*/
|
|
1894
|
-
usageArgs?: string;
|
|
1895
|
-
options?: OptionDef[];
|
|
1896
|
-
/**
|
|
1897
|
-
* Example argument strings, each WITHOUT the `<bin> <path>` prefix
|
|
1898
|
-
* (e.g. '--index-id idx_xxx --query "..."'). The runtime prepends
|
|
1899
|
-
* `<bin> <path>` per product when rendering help.
|
|
1900
|
-
*/
|
|
1901
|
-
exampleArgs?: string[];
|
|
1902
|
-
skipDefaultApiKeySetup?: boolean;
|
|
1903
|
-
notes?: string[];
|
|
1904
|
-
execute: (config: Config, flags: GlobalFlags) => Promise<void>;
|
|
1905
|
-
}
|
|
1906
|
-
interface CommandSpec {
|
|
1907
|
-
description: string;
|
|
1908
|
-
/** See {@link Command.usageArgs} — argument portion only, no `<bin> <path>` prefix. */
|
|
1909
|
-
usageArgs?: string;
|
|
1910
|
-
options?: OptionDef[];
|
|
1911
|
-
/** See {@link Command.exampleArgs} — argument strings only, no `<bin> <path>` prefix. */
|
|
1912
|
-
exampleArgs?: string[];
|
|
1913
|
-
skipDefaultApiKeySetup?: boolean;
|
|
1914
|
-
notes?: string[];
|
|
1915
|
-
run: (config: Config, flags: GlobalFlags) => Promise<void>;
|
|
1916
|
-
}
|
|
1917
|
-
declare function defineCommand(spec: CommandSpec): Command;
|
|
1918
|
-
/** Global flags shared by all commands — drives the parser's type resolution. */
|
|
1919
|
-
declare const GLOBAL_OPTIONS: OptionDef[];
|
|
2220
|
+
declare function updateDeployment(client: Client, deployedModel: string, body: UpdateDeploymentRequest, signal?: AbortSignal): Promise<UpdateDeploymentResponse>;
|
|
1920
2221
|
//#endregion
|
|
1921
2222
|
//#region src/utils/filename.d.ts
|
|
1922
2223
|
declare function generateFilename(prefix: string, prompt: string): string;
|
|
@@ -1933,7 +2234,7 @@ declare function generateFilename(prefix: string, prompt: string): string;
|
|
|
1933
2234
|
* Optionally appends a subdirectory (e.g. 'images', 'videos', 'speech').
|
|
1934
2235
|
* Creates the directory if it doesn't exist.
|
|
1935
2236
|
*/
|
|
1936
|
-
declare function resolveOutputDir(
|
|
2237
|
+
declare function resolveOutputDir(settings: Settings, options?: {
|
|
1937
2238
|
flagDir?: string;
|
|
1938
2239
|
subDir?: string;
|
|
1939
2240
|
}): string;
|
|
@@ -1941,33 +2242,6 @@ declare function resolveOutputDir(config: Config, options?: {
|
|
|
1941
2242
|
//#region src/utils/token.d.ts
|
|
1942
2243
|
declare function maskToken(token: string): string;
|
|
1943
2244
|
//#endregion
|
|
1944
|
-
//#region src/utils/env.d.ts
|
|
1945
|
-
/**
|
|
1946
|
-
* Environment detection utilities for bailian-cli.
|
|
1947
|
-
*
|
|
1948
|
-
* Used to determine whether the CLI is running in an interactive terminal
|
|
1949
|
-
* (human user) or in a non-interactive environment (CI, agent, pipe, etc.),
|
|
1950
|
-
* so commands can adjust their behavior accordingly.
|
|
1951
|
-
*/
|
|
1952
|
-
/**
|
|
1953
|
-
* Detects whether the current environment is interactive.
|
|
1954
|
-
*
|
|
1955
|
-
* Returns false when:
|
|
1956
|
-
* - stdout or stdin is not a TTY
|
|
1957
|
-
* - The --non-interactive flag was explicitly set
|
|
1958
|
-
* - The process is running in a known CI environment (CI env var present)
|
|
1959
|
-
*
|
|
1960
|
-
* Returns true when stdout and stdin are both TTYs and --non-interactive
|
|
1961
|
-
* was not passed.
|
|
1962
|
-
*/
|
|
1963
|
-
declare function isInteractive(options?: {
|
|
1964
|
-
nonInteractive?: boolean;
|
|
1965
|
-
}): boolean;
|
|
1966
|
-
/**
|
|
1967
|
-
* Detects whether the current process is running in a CI environment.
|
|
1968
|
-
*/
|
|
1969
|
-
declare function isCI(): boolean;
|
|
1970
|
-
//#endregion
|
|
1971
2245
|
//#region src/utils/object.d.ts
|
|
1972
2246
|
/**
|
|
1973
2247
|
* Generic object-cleaning utilities.
|
|
@@ -2007,7 +2281,7 @@ interface TrackingEvent {
|
|
|
2007
2281
|
cliVersion: string;
|
|
2008
2282
|
nodeVersion: string;
|
|
2009
2283
|
os: string;
|
|
2010
|
-
authMethod?:
|
|
2284
|
+
authMethod?: AuthRequirement;
|
|
2011
2285
|
params?: Record<string, unknown>;
|
|
2012
2286
|
}
|
|
2013
2287
|
declare function createTrackingEvent(opts: {
|
|
@@ -2020,7 +2294,7 @@ declare function createTrackingEvent(opts: {
|
|
|
2020
2294
|
requestId?: string;
|
|
2021
2295
|
};
|
|
2022
2296
|
cliVersion: string;
|
|
2023
|
-
authMethod?:
|
|
2297
|
+
authMethod?: AuthRequirement;
|
|
2024
2298
|
params?: Record<string, unknown>;
|
|
2025
2299
|
}): TrackingEvent;
|
|
2026
2300
|
//#endregion
|
|
@@ -2040,7 +2314,13 @@ declare function localSink(event: TrackingEvent): Promise<void>;
|
|
|
2040
2314
|
declare function remoteSink(event: TrackingEvent): Promise<void>;
|
|
2041
2315
|
//#endregion
|
|
2042
2316
|
//#region src/telemetry/tracker.d.ts
|
|
2043
|
-
|
|
2317
|
+
/** 遥测只记录命令声明的鉴权域,不接触具体凭证能力。 */
|
|
2318
|
+
interface TrackingDeps {
|
|
2319
|
+
identity: Identity;
|
|
2320
|
+
settings: Settings;
|
|
2321
|
+
authMethod?: AuthRequirement;
|
|
2322
|
+
}
|
|
2323
|
+
declare function trackCommandExecution(deps: TrackingDeps, commandPath: string[], flags: Record<string, unknown>, fn: () => Promise<void>): Promise<void>;
|
|
2044
2324
|
//#endregion
|
|
2045
2325
|
//#region src/advisor/types.d.ts
|
|
2046
2326
|
type Modality = "Text" | "Image" | "Video" | "Audio";
|
|
@@ -2120,6 +2400,13 @@ interface IntentProfile {
|
|
|
2120
2400
|
segments?: IntentSegment[];
|
|
2121
2401
|
taskSummary: string;
|
|
2122
2402
|
scenarioHints: string[];
|
|
2403
|
+
/**
|
|
2404
|
+
* LLM-refined, self-contained English description of the need, optimized for
|
|
2405
|
+
* semantic matching against model descriptions. Used as the embedding query
|
|
2406
|
+
* for soft-track recall. Empty when intent analysis degrades (recall then
|
|
2407
|
+
* falls back to the raw user query).
|
|
2408
|
+
*/
|
|
2409
|
+
semanticQuery: string;
|
|
2123
2410
|
inputModality: Modality[];
|
|
2124
2411
|
outputModality: Modality[];
|
|
2125
2412
|
requiredCapabilities: Capability[];
|
|
@@ -2197,21 +2484,40 @@ type RecommendResult = SingleResult | PipelineResult;
|
|
|
2197
2484
|
interface GetModelsOptions {
|
|
2198
2485
|
onPrepareStart?: () => void;
|
|
2199
2486
|
}
|
|
2200
|
-
declare function getModels(
|
|
2487
|
+
declare function getModels(settings: Settings, options?: GetModelsOptions): Promise<ModelProfile[]>;
|
|
2488
|
+
//#endregion
|
|
2489
|
+
//#region src/advisor/constants/scoring.d.ts
|
|
2490
|
+
declare const SEMANTIC_TOP_K = 20;
|
|
2201
2491
|
//#endregion
|
|
2202
2492
|
//#region src/advisor/intent.d.ts
|
|
2203
|
-
|
|
2493
|
+
/**
|
|
2494
|
+
* Analyze the user's input to produce an IntentProfile.
|
|
2495
|
+
*
|
|
2496
|
+
* Two LLM calls run in parallel:
|
|
2497
|
+
* 1. `tongyi-intent-detect-v3` (DashScope native) -- fast mode/targets/excludes/complexity
|
|
2498
|
+
* 2. `qwen3.6-flash` -- rich field extraction (taskSummary, modalities, budget, etc.)
|
|
2499
|
+
*
|
|
2500
|
+
* detect-v3 takes priority for mode/targets/excludes/complexity;
|
|
2501
|
+
* the extraction model fills everything else.
|
|
2502
|
+
*/
|
|
2503
|
+
declare function analyzeIntent(client: Client, input: string, opts?: {
|
|
2504
|
+
intentDetectBaseUrl?: string;
|
|
2505
|
+
}): Promise<IntentProfile>;
|
|
2204
2506
|
//#endregion
|
|
2205
2507
|
//#region src/advisor/recall.d.ts
|
|
2206
2508
|
interface ScoredCandidate {
|
|
2207
2509
|
model: ModelProfile;
|
|
2208
2510
|
score: number;
|
|
2511
|
+
/** Normalized [0,1] preference-satisfaction score (capability/feature/context/quality). */
|
|
2512
|
+
hardScore?: number;
|
|
2513
|
+
/** Cosine similarity [0,1] between the semantic query and the model embedding. */
|
|
2514
|
+
softScore?: number;
|
|
2209
2515
|
}
|
|
2210
2516
|
declare function recallCandidates(models: ModelProfile[], intent: IntentProfile): ScoredCandidate[];
|
|
2211
2517
|
//#endregion
|
|
2212
2518
|
//#region src/advisor/recall-semantic.d.ts
|
|
2213
2519
|
declare function isSemanticAvailable(): boolean;
|
|
2214
|
-
declare function recallSemantic(
|
|
2520
|
+
declare function recallSemantic(client: Client, models: ModelProfile[], query: string, topK: number, intent?: IntentProfile): Promise<ScoredCandidate[]>;
|
|
2215
2521
|
//#endregion
|
|
2216
2522
|
//#region src/advisor/recommend.d.ts
|
|
2217
2523
|
interface RecommendOptions {
|
|
@@ -2220,7 +2526,7 @@ interface RecommendOptions {
|
|
|
2220
2526
|
enableThinking?: boolean;
|
|
2221
2527
|
}
|
|
2222
2528
|
declare function buildDocLink(docUrl?: string): string | undefined;
|
|
2223
|
-
declare function rankModels(
|
|
2529
|
+
declare function rankModels(client: Client, candidates: ScoredCandidate[], intent: IntentProfile, userInput: string, top: number, options?: RecommendOptions): Promise<RecommendResult>;
|
|
2224
2530
|
//#endregion
|
|
2225
2531
|
//#region src/advisor/sources/types.d.ts
|
|
2226
2532
|
interface ModelSource {
|
|
@@ -2229,4 +2535,4 @@ interface ModelSource {
|
|
|
2229
2535
|
load(): Promise<ModelProfile[]>;
|
|
2230
2536
|
}
|
|
2231
2537
|
//#endregion
|
|
2232
|
-
export {
|
|
2538
|
+
export { ASYNC_FLAG, AcsQueryParams, AcsSignConfig, AnyCommand, type ApiErrorBody, ApiKeyCredential, AppCompletionRequest, AppCompletionResponse, AppStreamChunk, AuthPersistPatch, AuthRequirement, AuthState, AuthStore, BAILIAN_HOST, BailianError, BatchSizeGateInput, BatchSizeGateResult, Budget, Budgets, CHANNEL, CONCURRENT_FLAG, CONSOLE_AUTH_FLAGS, CancelFineTuneResponse, Capabilities, Capability, ChatChoice, ChatMessage, ChatMessageContent, ChatRequest, ChatResponse, ChatResponseFormat, ChatTool, Client, ClientOpenApiQueryOpts, ClientRequestOpts, Command, Complexities, Complexity, ConfigFile, ConfigStore, ConsoleCredential, ConsoleGatewayRequest, ConsoleSite, ContextNeed, ContextNeeds, CreateDeploymentRequest, CreateDeploymentResponse, CreateFineTuneRequest, CreateFineTuneResponse, CredentialSource, DEFAULT_TRAINING_TYPE, DOCS_HOSTS, DashScopeASRRequest, DashScopeASRTaskResult, DashScopeAsyncResponse, DashScopeImageRequest, DashScopeImageSyncResponse, DashScopeIntentDetectRequest, DashScopeIntentDetectResponse, DashScopeKnowledgeRetrieveRequest, DashScopeKnowledgeRetrieveResponse, DashScopeTTSRequest, DashScopeTTSResponse, DashScopeTTSStreamChunk, DashScopeTaskResponse, DashScopeVideoEditRequest, DashScopeVideoRefRequest, DashScopeVideoRequest, DatasetDeleteResponse, DatasetFile, DatasetGetResponse, DatasetListParams, DatasetListResponse, DatasetSchema, DatasetUploadParams, DatasetUploadResponse, DeleteDeploymentResponse, DeleteFineTuneResponse, DeployableModel, DeployableTemplate, Deployment, ExitCode, ExportCheckpointResponse, Feature, Features, FineTuneCheckpoint, FineTuneHyperParameters, FineTuneJob, FineTuneLogEntry, FlagDef, FlagsDef, GLOBAL_FLAGS, GetDeploymentResponse, GetFineTuneLogsParams, GetFineTuneLogsResponse, GetFineTuneResponse, GetModelsOptions, INSUFFICIENT_SAMPLES_CODE, Identity, IntentProfile, IntentSegment, KnowledgeChatContentPart, KnowledgeChatMessage, KnowledgeChatRequest, KnowledgeChatStreamChunk, KnowledgeSearchRequest, KnowledgeSearchResponse, ListCheckpointsResponse, ListDeployableModelsParams, ListDeployableModelsResponse, ListDeploymentsParams, ListDeploymentsResponse, ListFineTunesParams, ListFineTunesResponse, MAX_DATASET_BYTES, MODEL_AUTH_FLAGS, McpClient, McpTool, McpToolResult, MemoryAddRequest, MemoryAddResponse, MemoryMessage, MemoryNode, MemoryNodeListResponse, MemoryNodeUpdateRequest, MemorySearchRequest, MemorySearchResponse, Modalities, Modality, ModelCapability, ModelCategories, ModelCategory, ModelListParams, ModelListResult, ModelPreference, ModelPrice, ModelProfile, ModelSource, OPENAPI_AUTH_FLAGS, OpenApiCredential, OutputFormat, ParsedFlags, PipelineResult, PipelineStep, PreferenceMode, ProfileAttribute, ProfileSchemaCreateRequest, ProfileSchemaCreateResponse, PtuCapacity, QpmLimit, QualityPreference, QualityPreferences, REGIONS, RecommendOptions, RecommendResult, RecommendedModel, Region, RequestOpts, ResolutionSources, SEMANTIC_TOP_K, SOURCE_CONFIG, ScaleDeploymentRequest, ScaleDeploymentResponse, ScoredCandidate, ServerSentEvent, Settings, SingleResult, SourceFlags, StreamChoice, StreamChunk, TAGS, TRAINING_TYPES_CLI, TRAINING_TYPE_MAP, TrackingEvent, TrainingTypeCli, UpdateDeploymentRequest, UpdateDeploymentResponse, UsageError, UserProfileResponse, ValidateOpts, ValidationIssue, ValidationResult, ValidationSeverity, ValidationStats, ValidatorSpec, analyzeIntent, appCompletionPath, bailianMcpPath, buildAcsCanonicalQuery, buildDocLink, buildSettings, buildSources, callConsoleGateway, cancelFineTune, chatPath, createDeployment, createFineTune, createTrackingEvent, credentialFlagDefs, defineCommand, deleteDataset, deleteDeployment, deleteFineTune, describeAuthState, detectOutputFormat, effectiveConsoleGatewayConfig, ensureConfigDir, exportCheckpoint, fetchModelCapability, fetchModelList, flushTelemetry, formatErrorJson, formatIssue, formatJson, formatOutput, formatText, generateFilename, getConfigDir, getConfigPath, getCredentialsPath, getDataset, getDeployment, getFineTune, getFineTuneLogs, getModels, imagePath, imageSyncPath, isLocalFile, isSemanticAvailable, isTrainingTypeCli, knowledgeChatEndpoint, knowledgeRetrievePath, knowledgeSearchEndpoint, listCheckpoints, listDatasets, listDeployableModels, listDeployments, listFineTunes, listSupportedFormats, listSupportedTrainingTypes, localSink, makeAuthStore, makeConfigStore, mapApiError, maskToken, mcpWebSearchPath, memoryAddPath, memoryListPath, memoryNodePath, memorySearchPath, modelSupportsTrainingType, parseBooleanValue, parseConfigFile, parseDatasetSchemaFlag, parseOptionalBooleanValue, parseSSE, pickValidator, preflightBatchSizeGate, profileSchemaPath, rankModels, readConfigFile, recallCandidates, recallSemantic, registerValidator, remoteSink, request, requestJson, resolveApiKey, resolveBooleanFlag, resolveConsole, resolveFileUrl, resolveModelBaseUrl, resolveOpenApi, resolveOutputDir, resolveWatermark, scaleDeployment, signAcsRequest, speechRecognizePath, speechSynthesizePath, stripUndefined, taskPath, toServerTrainingType, trackCommandExecution, trackingHeaders, trainingTypeMethodVariant, updateDeployment, uploadDataset, uploadFile, userProfilePath, validateDataset, videoGeneratePath, writeConfigFile };
|