bailian-cli-core 1.28.0 → 2.0.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 +413 -382
- package/dist/index.mjs +18 -18
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/errors/codes.d.ts
|
|
2
|
-
declare const ExitCode: {
|
|
2
|
+
export declare const ExitCode: {
|
|
3
3
|
readonly SUCCESS: 0;
|
|
4
4
|
readonly GENERAL: 1;
|
|
5
5
|
readonly USAGE: 2;
|
|
@@ -10,7 +10,7 @@ declare const ExitCode: {
|
|
|
10
10
|
readonly CONFIRMATION_REQUIRED: 7;
|
|
11
11
|
readonly CONTENT_FILTER: 10;
|
|
12
12
|
};
|
|
13
|
-
type ExitCode = (typeof ExitCode)[keyof typeof ExitCode];
|
|
13
|
+
export type ExitCode = (typeof ExitCode)[keyof typeof ExitCode];
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/errors/base.d.ts
|
|
16
16
|
interface ApiErrorContext {
|
|
@@ -23,7 +23,7 @@ interface BailianErrorOptions {
|
|
|
23
23
|
api?: ApiErrorContext;
|
|
24
24
|
rawResponse?: string;
|
|
25
25
|
}
|
|
26
|
-
declare class BailianError extends Error {
|
|
26
|
+
export declare class BailianError extends Error {
|
|
27
27
|
readonly exitCode: ExitCode;
|
|
28
28
|
readonly hint?: string;
|
|
29
29
|
readonly api?: ApiErrorContext;
|
|
@@ -31,18 +31,18 @@ declare class BailianError extends Error {
|
|
|
31
31
|
constructor(message: string, exitCode?: ExitCode, hint?: string, options?: BailianErrorOptions);
|
|
32
32
|
toJSON(): {
|
|
33
33
|
error: {
|
|
34
|
+
cause?: Record<string, unknown> | undefined;
|
|
35
|
+
request_id?: string | undefined;
|
|
36
|
+
api_code?: string | undefined;
|
|
37
|
+
http_status?: number | undefined;
|
|
38
|
+
hint?: string | undefined;
|
|
34
39
|
code: ExitCode;
|
|
35
40
|
message: string;
|
|
36
|
-
hint?: string | undefined;
|
|
37
|
-
http_status?: number | undefined;
|
|
38
|
-
api_code?: string | undefined;
|
|
39
|
-
request_id?: string | undefined;
|
|
40
|
-
cause?: Record<string, unknown> | undefined;
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
/** Invalid usage: unknown command, bad/unknown flag, missing required, failed validation. */
|
|
45
|
-
declare class UsageError extends BailianError {
|
|
45
|
+
export declare class UsageError extends BailianError {
|
|
46
46
|
constructor(message: string, hint?: string);
|
|
47
47
|
}
|
|
48
48
|
//#endregion
|
|
@@ -58,7 +58,7 @@ interface ApiErrorBody {
|
|
|
58
58
|
request_id?: string;
|
|
59
59
|
requestID?: string;
|
|
60
60
|
}
|
|
61
|
-
declare function mapApiError(status: number, body: ApiErrorBody, _url?: string): BailianError;
|
|
61
|
+
export declare function mapApiError(status: number, body: ApiErrorBody, _url?: string): BailianError;
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/types/api.d.ts
|
|
64
64
|
interface ChatMessage {
|
|
@@ -241,11 +241,13 @@ interface DashScopeImageRequest {
|
|
|
241
241
|
}>;
|
|
242
242
|
}>;
|
|
243
243
|
} | {
|
|
244
|
-
prompt: string;
|
|
244
|
+
prompt: string;
|
|
245
|
+
/** Required by image2image models such as wan2.5-i2i-preview. */
|
|
245
246
|
images?: string[];
|
|
246
247
|
negative_prompt?: string;
|
|
247
248
|
} | {
|
|
248
|
-
/** Required by wanx*-imageedit models. */
|
|
249
|
+
/** Required by wanx*-imageedit models. */
|
|
250
|
+
function: string;
|
|
249
251
|
prompt: string;
|
|
250
252
|
base_image_url: string;
|
|
251
253
|
mask_image_url?: string;
|
|
@@ -550,7 +552,8 @@ interface KnowledgeChatRequest {
|
|
|
550
552
|
};
|
|
551
553
|
parameters: {
|
|
552
554
|
agent_options: {
|
|
553
|
-
agent_id: string;
|
|
555
|
+
agent_id: string;
|
|
556
|
+
/** "beta" targets the debug draft; a numeric version targets that published version; defaults to the latest published version */
|
|
554
557
|
agent_version?: string;
|
|
555
558
|
user?: {
|
|
556
559
|
user_id?: string;
|
|
@@ -631,16 +634,20 @@ interface DashScopeASRRequest {
|
|
|
631
634
|
model: string;
|
|
632
635
|
input: {
|
|
633
636
|
file_urls?: string[];
|
|
634
|
-
file_url?: string;
|
|
637
|
+
file_url?: string;
|
|
638
|
+
/** Context enhancement for async filetrans (array of chat-style messages). */
|
|
635
639
|
context?: AsrContextMessage[];
|
|
636
640
|
};
|
|
637
641
|
parameters?: {
|
|
638
|
-
channel_id?: number[];
|
|
639
|
-
|
|
642
|
+
channel_id?: number[];
|
|
643
|
+
/** Classic async models (fun-asr / paraformer / qwen-audio filetrans, etc.) */
|
|
644
|
+
language_hints?: string[];
|
|
645
|
+
/** qwen3-asr-flash-filetrans* uses singular `language` */
|
|
640
646
|
language?: string;
|
|
641
647
|
diarization_enabled?: boolean;
|
|
642
648
|
speaker_count?: number;
|
|
643
|
-
vocabulary_id?: string;
|
|
649
|
+
vocabulary_id?: string;
|
|
650
|
+
/** Instant hot words (word → weight); takes effect on Qwen-Audio-3.0-ASR-Flash series. */
|
|
644
651
|
vocabulary?: Record<string, number>;
|
|
645
652
|
};
|
|
646
653
|
}
|
|
@@ -654,8 +661,10 @@ interface DashScopeASRTranscriptionItem {
|
|
|
654
661
|
interface DashScopeASRTaskResult {
|
|
655
662
|
output: {
|
|
656
663
|
task_id: string;
|
|
657
|
-
task_status: "PENDING" | "RUNNING" | "SUCCEEDED" | "FAILED" | "UNKNOWN";
|
|
658
|
-
|
|
664
|
+
task_status: "PENDING" | "RUNNING" | "SUCCEEDED" | "FAILED" | "UNKNOWN";
|
|
665
|
+
/** Multi-file async results (fun-asr / paraformer / qwen-audio filetrans, etc.) */
|
|
666
|
+
results?: DashScopeASRTranscriptionItem[];
|
|
667
|
+
/** Singular result returned by qwen3-asr-flash-filetrans* on success */
|
|
659
668
|
result?: {
|
|
660
669
|
transcription_url?: string;
|
|
661
670
|
};
|
|
@@ -1041,21 +1050,21 @@ interface RagOssImportData {
|
|
|
1041
1050
|
type RagOssImportResponse = RagConnectorResponse<RagOssImportData>;
|
|
1042
1051
|
//#endregion
|
|
1043
1052
|
//#region src/config/schema.d.ts
|
|
1044
|
-
declare const REGIONS: {
|
|
1053
|
+
export declare const REGIONS: {
|
|
1045
1054
|
readonly cn: "https://dashscope.aliyuncs.com";
|
|
1046
1055
|
readonly us: "https://dashscope-us.aliyuncs.com";
|
|
1047
1056
|
readonly intl: "https://dashscope-intl.aliyuncs.com";
|
|
1048
1057
|
};
|
|
1049
|
-
declare const DOCS_HOSTS: {
|
|
1058
|
+
export declare const DOCS_HOSTS: {
|
|
1050
1059
|
readonly cn: "https://help.aliyun.com/zh/model-studio";
|
|
1051
1060
|
readonly us: "https://help.aliyun.com/zh/model-studio";
|
|
1052
1061
|
readonly intl: "https://help.aliyun.com/zh/model-studio";
|
|
1053
1062
|
};
|
|
1054
|
-
declare const BAILIAN_HOST = "https://bailian.cn-beijing.aliyuncs.com";
|
|
1063
|
+
export declare const BAILIAN_HOST = "https://bailian.cn-beijing.aliyuncs.com";
|
|
1055
1064
|
type Region = keyof typeof REGIONS;
|
|
1056
|
-
declare const SUPPORTED_LANGUAGES: readonly ["en-US", "zh-CN"];
|
|
1065
|
+
export declare const SUPPORTED_LANGUAGES: readonly ["en-US", "zh-CN"];
|
|
1057
1066
|
type Language = (typeof SUPPORTED_LANGUAGES)[number];
|
|
1058
|
-
declare const DEFAULT_LANGUAGE: Language;
|
|
1067
|
+
export declare const DEFAULT_LANGUAGE: Language;
|
|
1059
1068
|
interface ConfigFile {
|
|
1060
1069
|
language?: Language;
|
|
1061
1070
|
api_key?: string;
|
|
@@ -1088,15 +1097,15 @@ interface ConfigFile {
|
|
|
1088
1097
|
console_switch_agent?: number;
|
|
1089
1098
|
telemetry?: boolean;
|
|
1090
1099
|
}
|
|
1091
|
-
declare const CONFIG_FILE_KEYS: readonly ["language", "api_key", "access_token", "access_key_id", "access_key_secret", "security_token", "base_url", "output", "output_dir", "timeout", "watermark", "default_text_model", "default_video_model", "default_image_to_video_model", "default_reference_to_video_model", "default_image_model", "default_speech_model", "default_speech_recognition_model", "default_omni_model", "api_key_capabilities", "workspace_id", "console_site", "console_region", "console_switch_agent", "telemetry"];
|
|
1092
|
-
declare const API_KEY_CAPABILITY_PATTERN: RegExp;
|
|
1093
|
-
declare function isApiKeyCapability(value: string): boolean;
|
|
1100
|
+
export declare const CONFIG_FILE_KEYS: readonly ["language", "api_key", "access_token", "access_key_id", "access_key_secret", "security_token", "base_url", "output", "output_dir", "timeout", "watermark", "default_text_model", "default_video_model", "default_image_to_video_model", "default_reference_to_video_model", "default_image_model", "default_speech_model", "default_speech_recognition_model", "default_omni_model", "api_key_capabilities", "workspace_id", "console_site", "console_region", "console_switch_agent", "telemetry"];
|
|
1101
|
+
export declare const API_KEY_CAPABILITY_PATTERN: RegExp;
|
|
1102
|
+
export declare function isApiKeyCapability(value: string): boolean;
|
|
1094
1103
|
/**
|
|
1095
1104
|
* Normalize a persisted capability allowlist. Absence keeps the policy disabled;
|
|
1096
1105
|
* a present malformed value fails closed to an empty allowlist.
|
|
1097
1106
|
*/
|
|
1098
|
-
declare function normalizeApiKeyCapabilities(value: unknown): string[] | undefined;
|
|
1099
|
-
declare function parseConfigFile(raw: unknown): ConfigFile;
|
|
1107
|
+
export declare function normalizeApiKeyCapabilities(value: unknown): string[] | undefined;
|
|
1108
|
+
export declare function parseConfigFile(raw: unknown): ConfigFile;
|
|
1100
1109
|
/** 静态产品身份,createCli 注入一次(bl/rag 各异,故注入而非模块常量)。 */
|
|
1101
1110
|
interface Identity {
|
|
1102
1111
|
/** Product binary name, e.g. "bl", "rag". */
|
|
@@ -1162,7 +1171,7 @@ interface ConfigStore {
|
|
|
1162
1171
|
validateActivation(name?: unknown): string;
|
|
1163
1172
|
path: string;
|
|
1164
1173
|
}
|
|
1165
|
-
declare function makeConfigStore(configName?: string): ConfigStore;
|
|
1174
|
+
export declare function makeConfigStore(configName?: string): ConfigStore;
|
|
1166
1175
|
//#endregion
|
|
1167
1176
|
//#region src/auth/types.d.ts
|
|
1168
1177
|
/** Where a resolved credential came from (shown by `bl auth status`). */
|
|
@@ -1223,7 +1232,7 @@ interface AuthStore {
|
|
|
1223
1232
|
/** 实际写入的 config.json 路径(不受命名配置影响,一直是同一个文件)。 */
|
|
1224
1233
|
path: string;
|
|
1225
1234
|
}
|
|
1226
|
-
declare function makeAuthStore(sources: ResolutionSources): AuthStore;
|
|
1235
|
+
export declare function makeAuthStore(sources: ResolutionSources): AuthStore;
|
|
1227
1236
|
//#endregion
|
|
1228
1237
|
//#region src/client/http.d.ts
|
|
1229
1238
|
/** 传输层依赖:UA 用 identity,timeout/verbose 用 settings。凭证由调用方(Client)注头。 */
|
|
@@ -1241,8 +1250,8 @@ interface RequestOpts {
|
|
|
1241
1250
|
async?: boolean;
|
|
1242
1251
|
signal?: AbortSignal;
|
|
1243
1252
|
}
|
|
1244
|
-
declare function request(deps: HttpDeps, opts: RequestOpts): Promise<Response>;
|
|
1245
|
-
declare function requestJson<T>(deps: HttpDeps, opts: RequestOpts): Promise<T>;
|
|
1253
|
+
export declare function request(deps: HttpDeps, opts: RequestOpts): Promise<Response>;
|
|
1254
|
+
export declare function requestJson<T>(deps: HttpDeps, opts: RequestOpts): Promise<T>;
|
|
1246
1255
|
//#endregion
|
|
1247
1256
|
//#region src/client/acs.d.ts
|
|
1248
1257
|
type AcsQueryParams = Record<string, string | string[] | undefined | number>;
|
|
@@ -1260,8 +1269,8 @@ interface AcsSignConfig {
|
|
|
1260
1269
|
queryString?: string;
|
|
1261
1270
|
}
|
|
1262
1271
|
/** Build ACS3 canonical query string from OpenAPI query parameters. */
|
|
1263
|
-
declare function buildAcsCanonicalQuery(params: AcsQueryParams): string;
|
|
1264
|
-
declare function signAcsRequest(cfg: AcsSignConfig): Record<string, string>;
|
|
1272
|
+
export declare function buildAcsCanonicalQuery(params: AcsQueryParams): string;
|
|
1273
|
+
export declare function signAcsRequest(cfg: AcsSignConfig): Record<string, string>;
|
|
1265
1274
|
//#endregion
|
|
1266
1275
|
//#region src/client/mcp.d.ts
|
|
1267
1276
|
interface McpTool {
|
|
@@ -1283,18 +1292,18 @@ interface McpToolResult {
|
|
|
1283
1292
|
* The path is `/api/v1/mcps/<serverCode>/mcp`; the `serverCode` is taken
|
|
1284
1293
|
* verbatim from `bl mcp list` (e.g. `WebSearch`, `market-cmapi00073529`).
|
|
1285
1294
|
*/
|
|
1286
|
-
declare function bailianMcpPath(serverCode: string): string;
|
|
1295
|
+
export declare function bailianMcpPath(serverCode: string): string;
|
|
1287
1296
|
/** Classic SSE path: `/api/v1/mcps/<serverCode>/sse`. */
|
|
1288
|
-
declare function bailianMcpSsePath(serverCode: string): string;
|
|
1297
|
+
export declare function bailianMcpSsePath(serverCode: string): string;
|
|
1289
1298
|
/**
|
|
1290
1299
|
* True when Streamable HTTP is unsupported and classic SSE fallback should be tried.
|
|
1291
1300
|
* Anchored to HTTP wrapper text only (not JSON-RPC / nested copies). Bailian 404 excluded.
|
|
1292
1301
|
*/
|
|
1293
|
-
declare function isStreamableHttpUnsupported(error: unknown): boolean;
|
|
1302
|
+
export declare function isStreamableHttpUnsupported(error: unknown): boolean;
|
|
1294
1303
|
/**
|
|
1295
1304
|
* SSE fallback for `--url` (official backwards-compat: same URL, HTTP 405/404 then GET SSE).
|
|
1296
1305
|
*/
|
|
1297
|
-
declare function isUrlOverrideSseFallbackCandidate(error: unknown): boolean;
|
|
1306
|
+
export declare function isUrlOverrideSseFallbackCandidate(error: unknown): boolean;
|
|
1298
1307
|
type McpConnectedClient = {
|
|
1299
1308
|
initialize(): Promise<void>;
|
|
1300
1309
|
listTools(): Promise<McpTool[]>;
|
|
@@ -1303,8 +1312,10 @@ type McpConnectedClient = {
|
|
|
1303
1312
|
};
|
|
1304
1313
|
type ConnectBailianMcpOptions = {
|
|
1305
1314
|
deps: HttpDeps;
|
|
1306
|
-
authToken: string | undefined;
|
|
1307
|
-
|
|
1315
|
+
authToken: string | undefined;
|
|
1316
|
+
/** Full Streamable HTTP URL (/mcp). */
|
|
1317
|
+
httpUrl: string;
|
|
1318
|
+
/** Full classic SSE URL (/sse). */
|
|
1308
1319
|
sseUrl: string;
|
|
1309
1320
|
serverCode: string;
|
|
1310
1321
|
/**
|
|
@@ -1318,11 +1329,11 @@ type ConnectBailianMcpOptions = {
|
|
|
1318
1329
|
* `--url` uses the same URL for Streamable then classic SSE (official backwards-compat).
|
|
1319
1330
|
* For WebSearch, rethrow the original error so commands can attach a re-activate hint.
|
|
1320
1331
|
*/
|
|
1321
|
-
declare function connectBailianMcpWithFallback(options: ConnectBailianMcpOptions): Promise<{
|
|
1332
|
+
export declare function connectBailianMcpWithFallback(options: ConnectBailianMcpOptions): Promise<{
|
|
1322
1333
|
client: McpConnectedClient;
|
|
1323
1334
|
url: string;
|
|
1324
1335
|
}>;
|
|
1325
|
-
declare class McpClient {
|
|
1336
|
+
export declare class McpClient {
|
|
1326
1337
|
private url;
|
|
1327
1338
|
private sessionId;
|
|
1328
1339
|
private nextId;
|
|
@@ -1335,6 +1346,9 @@ declare class McpClient {
|
|
|
1335
1346
|
callTool(name: string, args: Record<string, unknown>): Promise<McpToolResult>;
|
|
1336
1347
|
private rpc;
|
|
1337
1348
|
private notify;
|
|
1349
|
+
/**
|
|
1350
|
+
* Read a JSON-RPC response by Content-Type: application/json or text/event-stream.
|
|
1351
|
+
*/
|
|
1338
1352
|
private readJsonRpcResponse;
|
|
1339
1353
|
private readJsonRpcFromSse;
|
|
1340
1354
|
private send;
|
|
@@ -1388,7 +1402,7 @@ interface OpenApiResponse {
|
|
|
1388
1402
|
* credentials. `console` needs a console token; calling one without its
|
|
1389
1403
|
* credential throws.
|
|
1390
1404
|
*/
|
|
1391
|
-
declare class Client {
|
|
1405
|
+
export declare class Client {
|
|
1392
1406
|
private readonly deps;
|
|
1393
1407
|
constructor(deps: ClientDeps);
|
|
1394
1408
|
private get http();
|
|
@@ -1405,6 +1419,11 @@ declare class Client {
|
|
|
1405
1419
|
* resolved (authStage tolerates that only under dry-run).
|
|
1406
1420
|
*/
|
|
1407
1421
|
exportApiCredential(): ApiKeyCredential | undefined;
|
|
1422
|
+
/**
|
|
1423
|
+
* Headers for registering a Bailian MCP endpoint in an external Agent.
|
|
1424
|
+
* Credential resolution and channel attribution remain owned by the client.
|
|
1425
|
+
*/
|
|
1426
|
+
bailianMcpRegistrationHeaders(): Record<string, string>;
|
|
1408
1427
|
/**
|
|
1409
1428
|
* Full URL for a model-domain path. Services may supply a lazy default origin,
|
|
1410
1429
|
* evaluated only when no flag/env/profile base URL was configured.
|
|
@@ -1507,10 +1526,10 @@ type IsRequired<F extends FlagDef> = F extends SwitchFlag ? true : F extends {
|
|
|
1507
1526
|
* Map a FlagsDef to the parsed flags object type. Required flags (switches +
|
|
1508
1527
|
* `required: true`) are required properties; optional value flags are `?`.
|
|
1509
1528
|
*/
|
|
1510
|
-
type ParsedFlags<F extends FlagsDef> = { [K in keyof F as IsRequired<F[K]> extends true ? K : never]: ParsedValue<F[K]
|
|
1529
|
+
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]>; };
|
|
1511
1530
|
type AuthRequirement = "apiKey" | "console" | "openapi" | "none";
|
|
1512
1531
|
/** 所有命令都可用的全局 flag。 */
|
|
1513
|
-
declare const GLOBAL_FLAGS: {
|
|
1532
|
+
export declare const GLOBAL_FLAGS: {
|
|
1514
1533
|
output: {
|
|
1515
1534
|
type: "string";
|
|
1516
1535
|
valueHint: string;
|
|
@@ -1572,7 +1591,7 @@ declare const GLOBAL_FLAGS: {
|
|
|
1572
1591
|
};
|
|
1573
1592
|
};
|
|
1574
1593
|
/** Command-scoped flag for commands that support parallel API calls. */
|
|
1575
|
-
declare const CONCURRENT_FLAG: {
|
|
1594
|
+
export declare const CONCURRENT_FLAG: {
|
|
1576
1595
|
concurrent: {
|
|
1577
1596
|
type: "number";
|
|
1578
1597
|
valueHint: string;
|
|
@@ -1583,7 +1602,7 @@ declare const CONCURRENT_FLAG: {
|
|
|
1583
1602
|
};
|
|
1584
1603
|
};
|
|
1585
1604
|
/** Command-scoped flag for task-based commands that can return without polling. */
|
|
1586
|
-
declare const ASYNC_FLAG: {
|
|
1605
|
+
export declare const ASYNC_FLAG: {
|
|
1587
1606
|
async: {
|
|
1588
1607
|
type: "switch";
|
|
1589
1608
|
description: {
|
|
@@ -1593,7 +1612,7 @@ declare const ASYNC_FLAG: {
|
|
|
1593
1612
|
};
|
|
1594
1613
|
};
|
|
1595
1614
|
/** Model 域凭证/连接 flag,`auth: "apiKey"` 命令可见。 */
|
|
1596
|
-
declare const MODEL_AUTH_FLAGS: {
|
|
1615
|
+
export declare const MODEL_AUTH_FLAGS: {
|
|
1597
1616
|
apiKey: {
|
|
1598
1617
|
type: "string";
|
|
1599
1618
|
valueHint: string;
|
|
@@ -1612,7 +1631,7 @@ declare const MODEL_AUTH_FLAGS: {
|
|
|
1612
1631
|
};
|
|
1613
1632
|
};
|
|
1614
1633
|
/** Console 域目标/作用域 flag,`auth: "console"` 命令可见。 */
|
|
1615
|
-
declare const CONSOLE_AUTH_FLAGS: {
|
|
1634
|
+
export declare const CONSOLE_AUTH_FLAGS: {
|
|
1616
1635
|
consoleRegion: {
|
|
1617
1636
|
type: "string";
|
|
1618
1637
|
valueHint: string;
|
|
@@ -1647,7 +1666,7 @@ declare const CONSOLE_AUTH_FLAGS: {
|
|
|
1647
1666
|
};
|
|
1648
1667
|
};
|
|
1649
1668
|
/** Alibaba Cloud OpenAPI AK/SK credential flags, visible to `auth: "openapi"` commands. */
|
|
1650
|
-
declare const OPENAPI_AUTH_FLAGS: {
|
|
1669
|
+
export declare const OPENAPI_AUTH_FLAGS: {
|
|
1651
1670
|
accessKeyId: {
|
|
1652
1671
|
type: "string";
|
|
1653
1672
|
valueHint: string;
|
|
@@ -1676,7 +1695,7 @@ declare const OPENAPI_AUTH_FLAGS: {
|
|
|
1676
1695
|
/** sources 里可能出现的全部 flag(全局 + 凭证域)。 */
|
|
1677
1696
|
type SourceFlags = ParsedFlags<typeof GLOBAL_FLAGS & typeof MODEL_AUTH_FLAGS & typeof CONSOLE_AUTH_FLAGS & typeof OPENAPI_AUTH_FLAGS>;
|
|
1678
1697
|
/** 该命令可见的凭证域 flag 定义。 */
|
|
1679
|
-
declare function credentialFlagDefs(cmd: {
|
|
1698
|
+
export declare function credentialFlagDefs(cmd: {
|
|
1680
1699
|
auth: AuthRequirement;
|
|
1681
1700
|
}): FlagsDef;
|
|
1682
1701
|
/**
|
|
@@ -1750,17 +1769,17 @@ interface Command<F extends FlagsDef = FlagsDef> {
|
|
|
1750
1769
|
/** Type-erased command for heterogeneous storage (registry / context). */
|
|
1751
1770
|
type AnyCommand = Command<any>;
|
|
1752
1771
|
/** Identity wrapper whose only job is to infer `F` from `spec.flags`. */
|
|
1753
|
-
declare function defineCommand<F extends FlagsDef>(spec: Command<F>): Command<F>;
|
|
1772
|
+
export declare function defineCommand<F extends FlagsDef>(spec: Command<F>): Command<F>;
|
|
1754
1773
|
//#endregion
|
|
1755
1774
|
//#region src/config/loader.d.ts
|
|
1756
1775
|
/**
|
|
1757
1776
|
* 校验并规范化 `--config <name>`:`undefined`/""/"default" 都视为未指定(等价顶层默认配置)。
|
|
1758
1777
|
* 合法命名只允许字母、数字、`-`/`_`,且不能与 `ConfigFile` 顶层字段同名(避免写入时与默认配置字段歧义)。
|
|
1759
1778
|
*/
|
|
1760
|
-
declare function normalizeConfigName(name?: unknown): string | undefined;
|
|
1761
|
-
declare function readConfigFile(configName?: string): ConfigFile;
|
|
1779
|
+
export declare function normalizeConfigName(name?: unknown): string | undefined;
|
|
1780
|
+
export declare function readConfigFile(configName?: string): ConfigFile;
|
|
1762
1781
|
/** 写入所选 Profile;登录流程可在同一次原子写入中将显式 Profile 设为激活项。 */
|
|
1763
|
-
declare function writeConfigFile(data: Record<string, unknown>, configName?: string, options?: {
|
|
1782
|
+
export declare function writeConfigFile(data: Record<string, unknown>, configName?: string, options?: {
|
|
1764
1783
|
activate?: boolean;
|
|
1765
1784
|
}): Promise<void>;
|
|
1766
1785
|
/** 全量配置快照:顶层默认配置 + 各命名 profile。 */
|
|
@@ -1776,13 +1795,13 @@ interface ConfigProfiles {
|
|
|
1776
1795
|
* 读取全部 profile:顶层默认配置与各命名 block。
|
|
1777
1796
|
* 命名 block = raw 中不属于 `CONFIG_FILE_KEYS`、且值为普通对象的项。
|
|
1778
1797
|
*/
|
|
1779
|
-
declare function readConfigProfiles(): ConfigProfiles;
|
|
1798
|
+
export declare function readConfigProfiles(): ConfigProfiles;
|
|
1780
1799
|
/** 校验激活目标并返回规范化展示名;不写配置。 */
|
|
1781
|
-
declare function validateConfigProfileActivation(name?: unknown): string;
|
|
1800
|
+
export declare function validateConfigProfileActivation(name?: unknown): string;
|
|
1782
1801
|
/** 将已存在的命名 Profile(或 default)设为持久化激活项。 */
|
|
1783
|
-
declare function activateConfigProfile(name?: unknown): Promise<string>;
|
|
1802
|
+
export declare function activateConfigProfile(name?: unknown): Promise<string>;
|
|
1784
1803
|
/** 删除一个命名 profile block;存在才删并回写,返回是否有变更。 */
|
|
1785
|
-
declare function deleteConfigProfile(name?: unknown): Promise<boolean>;
|
|
1804
|
+
export declare function deleteConfigProfile(name?: unknown): Promise<boolean>;
|
|
1786
1805
|
/**
|
|
1787
1806
|
* 解析的三个来源,dispatch 边界一次构建。flags 收 Partial:ParsedFlags 里 switch 是
|
|
1788
1807
|
* 必填 boolean,收 Partial 让 pipeline 等无 flag 场景传 {} 即可。
|
|
@@ -1806,36 +1825,36 @@ interface ApiKeyResolutionSourceSelection {
|
|
|
1806
1825
|
* persisted Profile capability list enables fallback. An explicit flag or
|
|
1807
1826
|
* environment API connection override bypasses it entirely.
|
|
1808
1827
|
*/
|
|
1809
|
-
declare function selectApiKeyResolutionSources(sources: ResolutionSources, capability: string): ApiKeyResolutionSourceSelection;
|
|
1810
|
-
declare function buildSources(flags: Partial<SourceFlags>): ResolutionSources;
|
|
1828
|
+
export declare function selectApiKeyResolutionSources(sources: ResolutionSources, capability: string): ApiKeyResolutionSourceSelection;
|
|
1829
|
+
export declare function buildSources(flags: Partial<SourceFlags>): ResolutionSources;
|
|
1811
1830
|
/**
|
|
1812
1831
|
* 纯解析 sources → Settings(命令唯一会读的配置面)。不含身份、baseUrl、鉴权。
|
|
1813
1832
|
* 各字段链序 flag > env > file > 默认;锁定表 tests/config-priority.test.ts。
|
|
1814
1833
|
*/
|
|
1815
|
-
declare function buildSettings(s: ResolutionSources): Settings;
|
|
1834
|
+
export declare function buildSettings(s: ResolutionSources): Settings;
|
|
1816
1835
|
//#endregion
|
|
1817
1836
|
//#region src/auth/resolver.d.ts
|
|
1818
1837
|
/** Preserve whether the shared base URL chain selected a configured origin or its default. */
|
|
1819
|
-
declare function resolveModelBaseUrlState(sources: ResolutionSources, fallback?: string): {
|
|
1838
|
+
export declare function resolveModelBaseUrlState(sources: ResolutionSources, fallback?: string): {
|
|
1820
1839
|
baseUrl: string;
|
|
1821
1840
|
baseUrlIsDefault: boolean;
|
|
1822
1841
|
};
|
|
1823
1842
|
/** Model-domain baseUrl(flag > env > config file > fallback);无需 key 也可解析。 */
|
|
1824
|
-
declare function resolveModelBaseUrl(s: ResolutionSources, fallback?: string): string;
|
|
1843
|
+
export declare function resolveModelBaseUrl(s: ResolutionSources, fallback?: string): string;
|
|
1825
1844
|
/**
|
|
1826
1845
|
* Model-domain credential from sources. Priority: `--api-key` flag >
|
|
1827
1846
|
* `DASHSCOPE_API_KEY` env > config.json `api_key`. baseUrl: flag > env > file > cn.
|
|
1828
1847
|
*/
|
|
1829
|
-
declare function resolveApiKey(s: ResolutionSources): ApiKeyCredential;
|
|
1848
|
+
export declare function resolveApiKey(s: ResolutionSources): ApiKeyCredential;
|
|
1830
1849
|
/** Console-domain credential from sources — access token + 连接目标(flag > file > 默认)。 */
|
|
1831
|
-
declare function resolveConsole(s: ResolutionSources): ConsoleCredential;
|
|
1850
|
+
export declare function resolveConsole(s: ResolutionSources): ConsoleCredential;
|
|
1832
1851
|
/** Alibaba Cloud OpenAPI AK/SK credential. Priority: flags > env > config. */
|
|
1833
|
-
declare function resolveOpenApi(s: ResolutionSources): OpenApiCredential;
|
|
1852
|
+
export declare function resolveOpenApi(s: ResolutionSources): OpenApiCredential;
|
|
1834
1853
|
/** Full auth snapshot from sources — what would resolve per domain (or undefined). */
|
|
1835
|
-
declare function describeAuthState(s: ResolutionSources): AuthState;
|
|
1854
|
+
export declare function describeAuthState(s: ResolutionSources): AuthState;
|
|
1836
1855
|
//#endregion
|
|
1837
1856
|
//#region src/auth/refresh-token.d.ts
|
|
1838
|
-
declare function generateCLIAccessToken(opts: {
|
|
1857
|
+
export declare function generateCLIAccessToken(opts: {
|
|
1839
1858
|
identity: Identity;
|
|
1840
1859
|
settings: Settings;
|
|
1841
1860
|
baseUrl: string;
|
|
@@ -1847,70 +1866,70 @@ declare function generateCLIAccessToken(opts: {
|
|
|
1847
1866
|
* Try to refresh the console access_token using stored AK/SK.
|
|
1848
1867
|
* Returns the new token on success, or null if AK/SK are not available.
|
|
1849
1868
|
*/
|
|
1850
|
-
declare function refreshAccessToken(opts: {
|
|
1869
|
+
export declare function refreshAccessToken(opts: {
|
|
1851
1870
|
identity: Identity;
|
|
1852
1871
|
settings: Settings;
|
|
1853
1872
|
baseUrl: string;
|
|
1854
1873
|
}): Promise<string | null>;
|
|
1855
1874
|
//#endregion
|
|
1856
1875
|
//#region src/client/endpoints.d.ts
|
|
1857
|
-
declare function chatPath(): string;
|
|
1858
|
-
declare function responsesPath(): string;
|
|
1876
|
+
export declare function chatPath(): string;
|
|
1877
|
+
export declare function responsesPath(): string;
|
|
1859
1878
|
/** Async image API used by wan2.6-t2i / wan2.6-image (T2I) and similar message-format models. */
|
|
1860
|
-
declare function imagePath(): string;
|
|
1879
|
+
export declare function imagePath(): string;
|
|
1861
1880
|
/** Sync multimodal API (qwen-image / wan2.7-image / z-image generate; also wan2.6-image edit). */
|
|
1862
|
-
declare function imageSyncPath(): string;
|
|
1881
|
+
export declare function imageSyncPath(): string;
|
|
1863
1882
|
/** Legacy async text-to-image API (wan2.5/2.2/2.1-t2i, wanx-*-t2i). */
|
|
1864
|
-
declare function imageText2ImagePath(): string;
|
|
1883
|
+
export declare function imageText2ImagePath(): string;
|
|
1865
1884
|
/** Legacy async image-to-image / edit API (wan2.5-i2i, *imageedit*). */
|
|
1866
|
-
declare function image2ImagePath(): string;
|
|
1867
|
-
declare function videoGeneratePath(): string;
|
|
1885
|
+
export declare function image2ImagePath(): string;
|
|
1886
|
+
export declare function videoGeneratePath(): string;
|
|
1868
1887
|
/** POST /api/v1/services/aigc/image2video/video-synthesis — kf2v (first+last frame). */
|
|
1869
|
-
declare function image2videoPath(): string;
|
|
1870
|
-
declare function taskPath(taskId: string): string;
|
|
1871
|
-
declare function modelsLimitsPath(): string;
|
|
1872
|
-
declare function modelsPermissionsPath(): string;
|
|
1873
|
-
declare function appCompletionPath(appId: string): string;
|
|
1874
|
-
declare function memoryAddPath(): string;
|
|
1875
|
-
declare function memorySearchPath(): string;
|
|
1876
|
-
declare function memoryListPath(): string;
|
|
1877
|
-
declare function memoryNodePath(nodeId: string): string;
|
|
1878
|
-
declare function speechSynthesizePath(): string;
|
|
1879
|
-
declare function speechRecognizePath(): string;
|
|
1880
|
-
declare function speechVocabularyPath(): string;
|
|
1881
|
-
declare function profileSchemaPath(): string;
|
|
1882
|
-
declare function userProfilePath(schemaId: string): string;
|
|
1883
|
-
declare function knowledgeRetrievePath(): string;
|
|
1884
|
-
declare function knowledgeSearchEndpoint(workspaceId: string): string;
|
|
1885
|
-
declare function knowledgeChatEndpoint(workspaceId: string): string;
|
|
1888
|
+
export declare function image2videoPath(): string;
|
|
1889
|
+
export declare function taskPath(taskId: string): string;
|
|
1890
|
+
export declare function modelsLimitsPath(): string;
|
|
1891
|
+
export declare function modelsPermissionsPath(): string;
|
|
1892
|
+
export declare function appCompletionPath(appId: string): string;
|
|
1893
|
+
export declare function memoryAddPath(): string;
|
|
1894
|
+
export declare function memorySearchPath(): string;
|
|
1895
|
+
export declare function memoryListPath(): string;
|
|
1896
|
+
export declare function memoryNodePath(nodeId: string): string;
|
|
1897
|
+
export declare function speechSynthesizePath(): string;
|
|
1898
|
+
export declare function speechRecognizePath(): string;
|
|
1899
|
+
export declare function speechVocabularyPath(): string;
|
|
1900
|
+
export declare function profileSchemaPath(): string;
|
|
1901
|
+
export declare function userProfilePath(schemaId: string): string;
|
|
1902
|
+
export declare function knowledgeRetrievePath(): string;
|
|
1903
|
+
export declare function knowledgeSearchEndpoint(workspaceId: string): string;
|
|
1904
|
+
export declare function knowledgeChatEndpoint(workspaceId: string): string;
|
|
1886
1905
|
/** Per-workspace AgentStudio host (same shape as {@link ragEndpoint}'s host). */
|
|
1887
|
-
declare function agentStudioHost(workspaceId: string): string;
|
|
1906
|
+
export declare function agentStudioHost(workspaceId: string): string;
|
|
1888
1907
|
/** GET protection overview — fixed to the last 24 hours, no request params. */
|
|
1889
|
-
declare function securityOverviewEndpoint(host: string): string;
|
|
1908
|
+
export declare function securityOverviewEndpoint(host: string): string;
|
|
1890
1909
|
/** GET alert list (agent_logs); filters / pagination go in the query string. */
|
|
1891
|
-
declare function securityAgentLogsEndpoint(host: string): string;
|
|
1892
|
-
declare function mcpWebSearchPath(): string;
|
|
1893
|
-
declare function ragEndpoint(workspaceId: string, path: string): string;
|
|
1910
|
+
export declare function securityAgentLogsEndpoint(host: string): string;
|
|
1911
|
+
export declare function mcpWebSearchPath(): string;
|
|
1912
|
+
export declare function ragEndpoint(workspaceId: string, path: string): string;
|
|
1894
1913
|
/** AgentStudio workspace files; template uploads send source=sandbox_template. */
|
|
1895
|
-
declare function agentStudioFilesPath(): string;
|
|
1914
|
+
export declare function agentStudioFilesPath(): string;
|
|
1896
1915
|
/** Default Sandbox origin when no shared base URL was configured (cn-beijing only). */
|
|
1897
|
-
declare function sandboxBaseUrl(workspaceId: string): string;
|
|
1916
|
+
export declare function sandboxBaseUrl(workspaceId: string): string;
|
|
1898
1917
|
/** Sandbox service prefix, appended to the selected origin just like AgentStudio SDK paths. */
|
|
1899
|
-
declare function sandboxApiPath(path: string): string;
|
|
1918
|
+
export declare function sandboxApiPath(path: string): string;
|
|
1900
1919
|
/** Build the default workspace-scoped absolute Sandbox control-plane URL. */
|
|
1901
|
-
declare function sandboxEndpoint(workspaceId: string, path: string): string;
|
|
1902
|
-
declare const SANDBOX_PATHS: {
|
|
1920
|
+
export declare function sandboxEndpoint(workspaceId: string, path: string): string;
|
|
1921
|
+
export declare const SANDBOX_PATHS: {
|
|
1903
1922
|
readonly sandboxes: "/sandboxes";
|
|
1904
1923
|
readonly sandboxList: "/v2/sandboxes";
|
|
1905
1924
|
readonly templates: "/templates";
|
|
1906
1925
|
readonly templateCreate: "/v3/templates";
|
|
1907
1926
|
readonly templateList: "/v2/templates";
|
|
1908
1927
|
};
|
|
1909
|
-
declare function sandboxInstancePath(sandboxId: string): string;
|
|
1910
|
-
declare function sandboxInstanceActionPath(sandboxId: string, action: "connect" | "pause" | "resume"): string;
|
|
1911
|
-
declare function sandboxTemplatePath(templateId: string): string;
|
|
1912
|
-
declare function sandboxTemplateBuildStatusPath(templateId: string, buildId: string): string;
|
|
1913
|
-
declare const RAG_PATHS: {
|
|
1928
|
+
export declare function sandboxInstancePath(sandboxId: string): string;
|
|
1929
|
+
export declare function sandboxInstanceActionPath(sandboxId: string, action: "connect" | "pause" | "resume"): string;
|
|
1930
|
+
export declare function sandboxTemplatePath(templateId: string): string;
|
|
1931
|
+
export declare function sandboxTemplateBuildStatusPath(templateId: string, buildId: string): string;
|
|
1932
|
+
export declare const RAG_PATHS: {
|
|
1914
1933
|
readonly indexList: "/api/v1/indices/rag/index/list";
|
|
1915
1934
|
readonly indexCreateV2: "/api/v1/indices/rag/index/create_v2";
|
|
1916
1935
|
readonly indexUpdate: "/api/v1/indices/rag/index/update";
|
|
@@ -1982,18 +2001,18 @@ interface ImageApiRoute {
|
|
|
1982
2001
|
promptExtendDefault?: boolean;
|
|
1983
2002
|
}
|
|
1984
2003
|
/** True when the model family can use sync multimodal for generate. */
|
|
1985
|
-
declare function isSyncMultimodalImageModel(model: string): boolean;
|
|
2004
|
+
export declare function isSyncMultimodalImageModel(model: string): boolean;
|
|
1986
2005
|
/** wan2.5 / wan2.2 / wan2.1 / wanx text-to-image models use the legacy prompt API. */
|
|
1987
|
-
declare function isLegacyText2ImageModel(model: string): boolean;
|
|
2006
|
+
export declare function isLegacyText2ImageModel(model: string): boolean;
|
|
1988
2007
|
/** wan2.5-i2i uses the legacy image2image prompt+images API. */
|
|
1989
|
-
declare function isLegacyImage2ImageModel(model: string): boolean;
|
|
2008
|
+
export declare function isLegacyImage2ImageModel(model: string): boolean;
|
|
1990
2009
|
/** wanx*-imageedit uses function + base_image_url (not prompt+images). */
|
|
1991
|
-
declare function isWanxFunctionImageEditModel(model: string): boolean;
|
|
1992
|
-
declare function resolveImageSizeProfile(model: string): ImageSizeProfile;
|
|
2010
|
+
export declare function isWanxFunctionImageEditModel(model: string): boolean;
|
|
2011
|
+
export declare function resolveImageSizeProfile(model: string): ImageSizeProfile;
|
|
1993
2012
|
/** Official / CLI defaults for prompt_extend when the flag is omitted. */
|
|
1994
|
-
declare function resolvePromptExtendDefault(model: string): boolean | undefined;
|
|
1995
|
-
declare function resolveImageGenerateApi(model: string): ImageApiRoute;
|
|
1996
|
-
declare function resolveImageEditApi(model: string): ImageApiRoute;
|
|
2013
|
+
export declare function resolvePromptExtendDefault(model: string): boolean | undefined;
|
|
2014
|
+
export declare function resolveImageGenerateApi(model: string): ImageApiRoute;
|
|
2015
|
+
export declare function resolveImageEditApi(model: string): ImageApiRoute;
|
|
1997
2016
|
//#endregion
|
|
1998
2017
|
//#region src/client/asr-routes.d.ts
|
|
1999
2018
|
/**
|
|
@@ -2040,9 +2059,9 @@ interface AsrApiRoute {
|
|
|
2040
2059
|
* Resolve which DashScope ASR API a model should use for file recognition.
|
|
2041
2060
|
* Unknown models default to async-filetrans (preserves existing CLI behavior).
|
|
2042
2061
|
*/
|
|
2043
|
-
declare function resolveAsrApi(model: string): AsrApiRoute;
|
|
2062
|
+
export declare function resolveAsrApi(model: string): AsrApiRoute;
|
|
2044
2063
|
/** Infer audio container hint for input-audio Flash `parameters.format`. */
|
|
2045
|
-
declare function inferAudioFormatHint(audioUrl: string): string;
|
|
2064
|
+
export declare function inferAudioFormatHint(audioUrl: string): string;
|
|
2046
2065
|
interface BuildAsrFlashRequestOpts {
|
|
2047
2066
|
model: string;
|
|
2048
2067
|
audioUrl: string;
|
|
@@ -2056,29 +2075,29 @@ interface BuildAsrFlashRequestOpts {
|
|
|
2056
2075
|
flashFamily: AsrFlashFamily;
|
|
2057
2076
|
}
|
|
2058
2077
|
/** Wrap plain text as a single user context message for ASR. */
|
|
2059
|
-
declare function buildAsrContextMessages(text: string): AsrContextMessage[];
|
|
2078
|
+
export declare function buildAsrContextMessages(text: string): AsrContextMessage[];
|
|
2060
2079
|
/**
|
|
2061
2080
|
* Build language fields for async ASR routes.
|
|
2062
2081
|
* qwen3-asr-flash-filetrans* → `language`; other async models → `language_hints`.
|
|
2063
2082
|
*/
|
|
2064
|
-
declare function buildAsyncAsrLanguageFields(languageStyle: "language_hints" | "language", language?: string): {
|
|
2083
|
+
export declare function buildAsyncAsrLanguageFields(languageStyle: "language_hints" | "language", language?: string): {
|
|
2065
2084
|
language_hints?: string[];
|
|
2066
2085
|
language?: string;
|
|
2067
2086
|
};
|
|
2068
2087
|
/** Build a sync multimodal ASR request body for Flash models. */
|
|
2069
|
-
declare function buildAsrFlashRequest(opts: BuildAsrFlashRequestOpts): Record<string, unknown>;
|
|
2088
|
+
export declare function buildAsrFlashRequest(opts: BuildAsrFlashRequestOpts): Record<string, unknown>;
|
|
2070
2089
|
/**
|
|
2071
2090
|
* Extract recognition text from a sync Flash ASR response.
|
|
2072
2091
|
* Qwen3 uses choices[].message.content; input-audio Flash uses output.text /
|
|
2073
2092
|
* output.sentence.text / output.output.sentence.text.
|
|
2074
2093
|
*/
|
|
2075
|
-
declare function extractAsrFlashText(response: Record<string, unknown>, flashFamily: AsrFlashFamily): string;
|
|
2094
|
+
export declare function extractAsrFlashText(response: Record<string, unknown>, flashFamily: AsrFlashFamily): string;
|
|
2076
2095
|
/**
|
|
2077
2096
|
* Normalize async ASR task transcription items:
|
|
2078
2097
|
* - classic models: `output.results[]`
|
|
2079
2098
|
* - qwen3-asr-flash-filetrans*: `output.result.transcription_url`
|
|
2080
2099
|
*/
|
|
2081
|
-
declare function collectAsrTranscriptionItems(output: {
|
|
2100
|
+
export declare function collectAsrTranscriptionItems(output: {
|
|
2082
2101
|
results?: Array<{
|
|
2083
2102
|
file_url?: string;
|
|
2084
2103
|
transcription_url?: string;
|
|
@@ -2098,13 +2117,15 @@ declare function collectAsrTranscriptionItems(output: {
|
|
|
2098
2117
|
}>;
|
|
2099
2118
|
//#endregion
|
|
2100
2119
|
//#region src/client/headers.d.ts
|
|
2101
|
-
declare const CHANNEL = "bailian-cli";
|
|
2120
|
+
export declare const CHANNEL = "bailian-cli";
|
|
2102
2121
|
/** Static source identifier advertised to the DashScope/Bailian OpenAPI gateway. */
|
|
2103
|
-
declare const OPEN_API_SOURCE = "BailianCLI";
|
|
2122
|
+
export declare const OPEN_API_SOURCE = "BailianCLI";
|
|
2123
|
+
/** Marketplace / service attribution header (HTTP names are case-insensitive). */
|
|
2124
|
+
export declare const DASHSCOPE_SERVICE_HEADER = "X-Dashscope-Service";
|
|
2104
2125
|
type TrackingIdentity = Pick<Identity, "binName" | "version">;
|
|
2105
|
-
declare function sourceConfig(identity: TrackingIdentity): string;
|
|
2126
|
+
export declare function sourceConfig(identity: TrackingIdentity): string;
|
|
2106
2127
|
/** Tracking headers for Bailian/DashScope API requests. */
|
|
2107
|
-
declare function trackingHeaders(identity: TrackingIdentity): Record<string, string>;
|
|
2128
|
+
export declare function trackingHeaders(identity: TrackingIdentity): Record<string, string>;
|
|
2108
2129
|
//#endregion
|
|
2109
2130
|
//#region src/client/security.d.ts
|
|
2110
2131
|
/**
|
|
@@ -2113,7 +2134,7 @@ declare function trackingHeaders(identity: TrackingIdentity): Record<string, str
|
|
|
2113
2134
|
* the DashScope gateway is the default and is ignored; any other origin
|
|
2114
2135
|
* (pre-release / private / mock) is treated as an explicit host override.
|
|
2115
2136
|
*/
|
|
2116
|
-
declare function isDashScopeGateway(origin: string): boolean;
|
|
2137
|
+
export declare function isDashScopeGateway(origin: string): boolean;
|
|
2117
2138
|
/**
|
|
2118
2139
|
* Parse an Agent Security Center response body and return the business payload.
|
|
2119
2140
|
*
|
|
@@ -2130,7 +2151,7 @@ declare function isDashScopeGateway(origin: string): boolean;
|
|
|
2130
2151
|
* that has not migrated keeps working. A failed or unrecognized shape throws
|
|
2131
2152
|
* with the raw body attached (surfaced by --output json) for diagnosis.
|
|
2132
2153
|
*/
|
|
2133
|
-
declare function parseSecurityBody<T>(raw: string, contentType?: string | null): T | null;
|
|
2154
|
+
export declare function parseSecurityBody<T>(raw: string, contentType?: string | null): T | null;
|
|
2134
2155
|
/**
|
|
2135
2156
|
* GET a Security Center endpoint and unwrap its envelope.
|
|
2136
2157
|
*
|
|
@@ -2140,7 +2161,7 @@ declare function parseSecurityBody<T>(raw: string, contentType?: string | null):
|
|
|
2140
2161
|
* through the Client transport; only HTTP 200 bodies reach parseSecurityBody.
|
|
2141
2162
|
* Returns null when the server reports success with no payload.
|
|
2142
2163
|
*/
|
|
2143
|
-
declare function securityGet<T>(client: Client, url: string): Promise<T | null>;
|
|
2164
|
+
export declare function securityGet<T>(client: Client, url: string): Promise<T | null>;
|
|
2144
2165
|
//#endregion
|
|
2145
2166
|
//#region src/client/instrumented-fetch.d.ts
|
|
2146
2167
|
/**
|
|
@@ -2156,7 +2177,7 @@ type FetchImplementation = (input: string | URL | Request, init?: RequestInit) =
|
|
|
2156
2177
|
* error mapping, so the caller's response semantics (status handling, SSE,
|
|
2157
2178
|
* conflict detection) stay intact.
|
|
2158
2179
|
*/
|
|
2159
|
-
declare function createInstrumentedFetch(deps: HttpDeps): FetchImplementation;
|
|
2180
|
+
export declare function createInstrumentedFetch(deps: HttpDeps): FetchImplementation;
|
|
2160
2181
|
//#endregion
|
|
2161
2182
|
//#region src/client/bailian-control.d.ts
|
|
2162
2183
|
/** Shared inputs for every BailianControl OpenAPI call (AK/SK passed explicitly). */
|
|
@@ -2179,16 +2200,16 @@ interface CreateUserReqDTO {
|
|
|
2179
2200
|
* signed with Alibaba Cloud AK/SK. Mirrors {@link generateCLIAccessToken}: the
|
|
2180
2201
|
* caller passes AK/SK explicitly, so this needs no stored credential.
|
|
2181
2202
|
*/
|
|
2182
|
-
declare function createBailianControlUser(opts: BailianControlAuth & {
|
|
2203
|
+
export declare function createBailianControlUser(opts: BailianControlAuth & {
|
|
2183
2204
|
reqDTO: CreateUserReqDTO;
|
|
2184
2205
|
}): Promise<OpenApiResponse>;
|
|
2185
2206
|
/** List workspaces (used to resolve the agent id for permission changes). */
|
|
2186
|
-
declare function listBailianControlWorkspaces(opts: BailianControlAuth): Promise<OpenApiResponse>;
|
|
2207
|
+
export declare function listBailianControlWorkspaces(opts: BailianControlAuth): Promise<OpenApiResponse>;
|
|
2187
2208
|
/**
|
|
2188
2209
|
* Authorize a user's servicer permissions via `ResetPolicies4Agent`. The single
|
|
2189
2210
|
* `data` param carries the console payload re-encoded as a JSON string.
|
|
2190
2211
|
*/
|
|
2191
|
-
declare function resetBailianControlPolicies4Agent(opts: BailianControlAuth & {
|
|
2212
|
+
export declare function resetBailianControlPolicies4Agent(opts: BailianControlAuth & {
|
|
2192
2213
|
outerKey: string;
|
|
2193
2214
|
agentId: number;
|
|
2194
2215
|
policyIndexList?: number[];
|
|
@@ -2200,7 +2221,7 @@ interface ServerSentEvent {
|
|
|
2200
2221
|
data: string;
|
|
2201
2222
|
id?: string;
|
|
2202
2223
|
}
|
|
2203
|
-
declare function parseSSE(response: Response): AsyncGenerator<ServerSentEvent>;
|
|
2224
|
+
export declare function parseSSE(response: Response): AsyncGenerator<ServerSentEvent>;
|
|
2204
2225
|
//#endregion
|
|
2205
2226
|
//#region src/console/gateway.d.ts
|
|
2206
2227
|
type ConsoleSite = "domestic" | "international";
|
|
@@ -2208,7 +2229,7 @@ type ConsoleSite = "domestic" | "international";
|
|
|
2208
2229
|
* Resolved console gateway settings (same defaults as {@link callConsoleGateway}).
|
|
2209
2230
|
* 参数只需 settings 的 console 三元组;dry-run 展示分支直接传 settings。
|
|
2210
2231
|
*/
|
|
2211
|
-
declare function effectiveConsoleGatewayConfig(config: Pick<Settings, "consoleRegion" | "consoleSite" | "consoleSwitchAgent">): {
|
|
2232
|
+
export declare function effectiveConsoleGatewayConfig(config: Pick<Settings, "consoleRegion" | "consoleSite" | "consoleSwitchAgent">): {
|
|
2212
2233
|
consoleRegion: string;
|
|
2213
2234
|
consoleSite: ConsoleSite;
|
|
2214
2235
|
consoleSwitchAgent?: number;
|
|
@@ -2224,7 +2245,7 @@ type ConsoleCall = (api: string, data: Record<string, unknown>) => Promise<unkno
|
|
|
2224
2245
|
* Build an anonymous (token-less) gateway caller for public catalog APIs such
|
|
2225
2246
|
* as `listFoundationModels` — no console login required.
|
|
2226
2247
|
*/
|
|
2227
|
-
declare function anonymousConsoleCall(config: Pick<Settings, "consoleRegion" | "consoleSite" | "consoleSwitchAgent" | "timeout">): ConsoleCall;
|
|
2248
|
+
export declare function anonymousConsoleCall(config: Pick<Settings, "consoleRegion" | "consoleSite" | "consoleSwitchAgent" | "timeout">): ConsoleCall;
|
|
2228
2249
|
/**
|
|
2229
2250
|
* Invoke a Bailian **console** OpenAPI via the CLI gateway (`/cli/api.json`).
|
|
2230
2251
|
* 目标(region/site/switchAgent)与 token 均由调用方解析后传入:Client.console 传
|
|
@@ -2236,16 +2257,13 @@ interface ConsoleGatewayTarget {
|
|
|
2236
2257
|
switchAgent?: number;
|
|
2237
2258
|
token?: string;
|
|
2238
2259
|
}
|
|
2239
|
-
declare function callConsoleGateway(target: ConsoleGatewayTarget, timeoutSec: number, {
|
|
2240
|
-
api,
|
|
2241
|
-
data
|
|
2242
|
-
}: ConsoleGatewayRequest, settings?: Pick<Settings, "verbose">): Promise<unknown>;
|
|
2260
|
+
export declare function callConsoleGateway(target: ConsoleGatewayTarget, timeoutSec: number, { api, data }: ConsoleGatewayRequest, settings?: Pick<Settings, "verbose">): Promise<unknown>;
|
|
2243
2261
|
//#endregion
|
|
2244
2262
|
//#region src/console/models.d.ts
|
|
2245
|
-
declare const MODEL_LIST_API = "zeldaHttp.dashscopeModel./zelda/api/v1/modelCenter/listFoundationModels";
|
|
2246
|
-
declare const PREDICT_CONFIG_API = "zeldaEasy.bmp.modelPredictRpcService.getPredictParamConfig";
|
|
2263
|
+
export declare const MODEL_LIST_API = "zeldaHttp.dashscopeModel./zelda/api/v1/modelCenter/listFoundationModels";
|
|
2264
|
+
export declare const PREDICT_CONFIG_API = "zeldaEasy.bmp.modelPredictRpcService.getPredictParamConfig";
|
|
2247
2265
|
/** Unwrap the DataV2 double-envelope that console gateway returns. */
|
|
2248
|
-
declare function unwrapResponse(result: Record<string, unknown>): Record<string, unknown>;
|
|
2266
|
+
export declare function unwrapResponse(result: Record<string, unknown>): Record<string, unknown>;
|
|
2249
2267
|
interface ModelListParams {
|
|
2250
2268
|
pageNo?: number;
|
|
2251
2269
|
pageSize?: number;
|
|
@@ -2258,15 +2276,15 @@ interface ModelListResult {
|
|
|
2258
2276
|
models: Record<string, unknown>[];
|
|
2259
2277
|
}
|
|
2260
2278
|
/** Page the console model-list API. `call` makes the gateway request (e.g. `client.console`). */
|
|
2261
|
-
declare function fetchModelList(call: ConsoleCall, params?: ModelListParams): Promise<ModelListResult>;
|
|
2279
|
+
export declare function fetchModelList(call: ConsoleCall, params?: ModelListParams): Promise<ModelListResult>;
|
|
2262
2280
|
/** Page through every model-list page and return all raw model items. */
|
|
2263
|
-
declare function fetchModelListAll(call: ConsoleCall, params?: Omit<ModelListParams, "pageNo">): Promise<Record<string, unknown>[]>;
|
|
2281
|
+
export declare function fetchModelListAll(call: ConsoleCall, params?: Omit<ModelListParams, "pageNo">): Promise<Record<string, unknown>[]>;
|
|
2264
2282
|
/**
|
|
2265
2283
|
* Look up a single model by exact id. The server's `name` filter is a
|
|
2266
2284
|
* substring match, so an exact `model` equality check narrows the result
|
|
2267
2285
|
* (e.g. avoids `qwen3-8b` matching `qwen3-8b-v2`).
|
|
2268
2286
|
*/
|
|
2269
|
-
declare function findModelByName(call: ConsoleCall, modelName: string): Promise<Record<string, unknown> | null>;
|
|
2287
|
+
export declare function findModelByName(call: ConsoleCall, modelName: string): Promise<Record<string, unknown> | null>;
|
|
2270
2288
|
interface ModelPriceInfo {
|
|
2271
2289
|
type?: string;
|
|
2272
2290
|
priceUnit?: string;
|
|
@@ -2340,16 +2358,16 @@ interface ModelGroupResult {
|
|
|
2340
2358
|
groups: ModelGroup[];
|
|
2341
2359
|
}
|
|
2342
2360
|
/** Fetch model families with optional filters and query flags. */
|
|
2343
|
-
declare function fetchModelGroups(call: ConsoleCall, params?: ModelGroupParams): Promise<ModelGroupResult>;
|
|
2361
|
+
export declare function fetchModelGroups(call: ConsoleCall, params?: ModelGroupParams): Promise<ModelGroupResult>;
|
|
2344
2362
|
/** Flatten family groups into their individual model items. */
|
|
2345
|
-
declare function flattenModelGroups(groups: ModelGroup[]): ModelGroupItem[];
|
|
2363
|
+
export declare function flattenModelGroups(groups: ModelGroup[]): ModelGroupItem[];
|
|
2346
2364
|
/**
|
|
2347
2365
|
* Fetch every model item in the catalog. The first page yields `total`; the
|
|
2348
2366
|
* remaining pages are fetched concurrently because ranking needs the whole set.
|
|
2349
2367
|
*/
|
|
2350
|
-
declare function fetchModelGroupsAll(call: ConsoleCall, params?: Omit<ModelGroupParams, "pageNo">): Promise<ModelGroupItem[]>;
|
|
2368
|
+
export declare function fetchModelGroupsAll(call: ConsoleCall, params?: Omit<ModelGroupParams, "pageNo">): Promise<ModelGroupItem[]>;
|
|
2351
2369
|
/** Fetch a single model family with all detail flags enabled. */
|
|
2352
|
-
declare function fetchModelDetail(call: ConsoleCall, modelKey: string): Promise<ModelGroup | null>;
|
|
2370
|
+
export declare function fetchModelDetail(call: ConsoleCall, modelKey: string): Promise<ModelGroup | null>;
|
|
2353
2371
|
interface PredictConfigEntry {
|
|
2354
2372
|
name: string;
|
|
2355
2373
|
key: string;
|
|
@@ -2358,13 +2376,13 @@ interface PredictConfigEntry {
|
|
|
2358
2376
|
range?: unknown;
|
|
2359
2377
|
}
|
|
2360
2378
|
/** Fetch the input parameter schema for a specific model. */
|
|
2361
|
-
declare function fetchPredictConfig(call: ConsoleCall, modelId: string): Promise<PredictConfigEntry[] | null>;
|
|
2379
|
+
export declare function fetchPredictConfig(call: ConsoleCall, modelId: string): Promise<PredictConfigEntry[] | null>;
|
|
2362
2380
|
//#endregion
|
|
2363
2381
|
//#region src/config/paths.d.ts
|
|
2364
|
-
declare function getConfigDir(): string;
|
|
2365
|
-
declare function getConfigPath(): string;
|
|
2366
|
-
declare function getCredentialsPath(): string;
|
|
2367
|
-
declare function ensureConfigDir(): Promise<void>;
|
|
2382
|
+
export declare function getConfigDir(): string;
|
|
2383
|
+
export declare function getConfigPath(): string;
|
|
2384
|
+
export declare function getCredentialsPath(): string;
|
|
2385
|
+
export declare function ensureConfigDir(): Promise<void>;
|
|
2368
2386
|
//#endregion
|
|
2369
2387
|
//#region src/config/profile-presets.d.ts
|
|
2370
2388
|
interface ModelProfilePreset {
|
|
@@ -2380,9 +2398,9 @@ interface ModelProfilePreset {
|
|
|
2380
2398
|
}
|
|
2381
2399
|
type ApiKeyLoginKind = "token-plan" | "ordinary" | "unknown";
|
|
2382
2400
|
/** Defaults materialized when logging into a well-known model profile. */
|
|
2383
|
-
declare function getModelProfilePreset(configName?: string): ModelProfilePreset | undefined;
|
|
2401
|
+
export declare function getModelProfilePreset(configName?: string): ModelProfilePreset | undefined;
|
|
2384
2402
|
/** Classify only the key formats that affect automatic Profile routing. */
|
|
2385
|
-
declare function getApiKeyLoginKind(apiKey: string): ApiKeyLoginKind;
|
|
2403
|
+
export declare function getApiKeyLoginKind(apiKey: string): ApiKeyLoginKind;
|
|
2386
2404
|
//#endregion
|
|
2387
2405
|
//#region src/config/model-base-url.d.ts
|
|
2388
2406
|
/**
|
|
@@ -2390,19 +2408,19 @@ declare function getApiKeyLoginKind(apiKey: string): ApiKeyLoginKind;
|
|
|
2390
2408
|
* CLI endpoints append their own API paths, so user-provided paths, query
|
|
2391
2409
|
* parameters, and fragments must not remain in the stored or resolved base URL.
|
|
2392
2410
|
*/
|
|
2393
|
-
declare function normalizeModelBaseUrl(input: string): string;
|
|
2411
|
+
export declare function normalizeModelBaseUrl(input: string): string;
|
|
2394
2412
|
//#endregion
|
|
2395
2413
|
//#region src/output/formatter.d.ts
|
|
2396
2414
|
type OutputFormat = "text" | "json";
|
|
2397
|
-
declare function detectOutputFormat(flagValue?: string): OutputFormat;
|
|
2398
|
-
declare function formatOutput(data: unknown, format: OutputFormat): string;
|
|
2415
|
+
export declare function detectOutputFormat(flagValue?: string): OutputFormat;
|
|
2416
|
+
export declare function formatOutput(data: unknown, format: OutputFormat): string;
|
|
2399
2417
|
//#endregion
|
|
2400
2418
|
//#region src/output/json.d.ts
|
|
2401
|
-
declare function formatJson(data: unknown): string;
|
|
2402
|
-
declare function formatErrorJson(code: number, message: string, hint?: string): string;
|
|
2419
|
+
export declare function formatJson(data: unknown): string;
|
|
2420
|
+
export declare function formatErrorJson(code: number, message: string, hint?: string): string;
|
|
2403
2421
|
//#endregion
|
|
2404
2422
|
//#region src/output/text.d.ts
|
|
2405
|
-
declare function formatText(data: unknown): string;
|
|
2423
|
+
export declare function formatText(data: unknown): string;
|
|
2406
2424
|
//#endregion
|
|
2407
2425
|
//#region src/files/upload.d.ts
|
|
2408
2426
|
interface UploadOptions {
|
|
@@ -2413,23 +2431,23 @@ interface UploadOptions {
|
|
|
2413
2431
|
signal?: AbortSignal;
|
|
2414
2432
|
}
|
|
2415
2433
|
/** Encode a local image as a Data URI. */
|
|
2416
|
-
declare function imageFileToDataUri(filePath: string): string;
|
|
2434
|
+
export declare function imageFileToDataUri(filePath: string): string;
|
|
2417
2435
|
/** Keep dry-run output readable and avoid echoing the complete inline image. */
|
|
2418
|
-
declare function redactDataUri(input: string): string;
|
|
2436
|
+
export declare function redactDataUri(input: string): string;
|
|
2419
2437
|
/**
|
|
2420
2438
|
* Upload a local file to DashScope temporary storage and return the oss:// URL.
|
|
2421
2439
|
* The URL is valid for 48 hours.
|
|
2422
2440
|
*/
|
|
2423
|
-
declare function uploadFile(opts: UploadOptions): Promise<string>;
|
|
2441
|
+
export declare function uploadFile(opts: UploadOptions): Promise<string>;
|
|
2424
2442
|
/**
|
|
2425
2443
|
* Check if a string looks like a local file path (not a URL).
|
|
2426
2444
|
*/
|
|
2427
|
-
declare function isLocalFile(input: string): boolean;
|
|
2445
|
+
export declare function isLocalFile(input: string): boolean;
|
|
2428
2446
|
/**
|
|
2429
2447
|
* Resolve a file argument: if it's a local path, upload it and return the oss:// URL.
|
|
2430
2448
|
* If it's already a URL, return as-is.
|
|
2431
2449
|
*/
|
|
2432
|
-
declare function resolveFileUrl(input: string, apiKey: string, model: string, opts: {
|
|
2450
|
+
export declare function resolveFileUrl(input: string, apiKey: string, model: string, opts: {
|
|
2433
2451
|
identity: TrackingIdentity;
|
|
2434
2452
|
signal?: AbortSignal;
|
|
2435
2453
|
}): Promise<string>;
|
|
@@ -2444,7 +2462,7 @@ declare function resolveFileUrl(input: string, apiKey: string, model: string, op
|
|
|
2444
2462
|
* purposes can be plugged in without schema changes.
|
|
2445
2463
|
*/
|
|
2446
2464
|
/** A single uploaded dataset file as returned by the platform. */
|
|
2447
|
-
interface DatasetFile {
|
|
2465
|
+
export interface DatasetFile {
|
|
2448
2466
|
/** File ID — the only stable handle for downstream consumers. */
|
|
2449
2467
|
file_id: string;
|
|
2450
2468
|
/** Original filename uploaded by the user. */
|
|
@@ -2463,7 +2481,7 @@ interface DatasetFile {
|
|
|
2463
2481
|
gmt_create?: string;
|
|
2464
2482
|
}
|
|
2465
2483
|
/** GET /api/v1/files response. */
|
|
2466
|
-
interface DatasetListResponse {
|
|
2484
|
+
export interface DatasetListResponse {
|
|
2467
2485
|
request_id?: string;
|
|
2468
2486
|
data?: {
|
|
2469
2487
|
files?: DatasetFile[];
|
|
@@ -2473,7 +2491,7 @@ interface DatasetListResponse {
|
|
|
2473
2491
|
};
|
|
2474
2492
|
}
|
|
2475
2493
|
/** GET /api/v1/files/{file_id} response. */
|
|
2476
|
-
interface DatasetGetResponse {
|
|
2494
|
+
export interface DatasetGetResponse {
|
|
2477
2495
|
request_id?: string;
|
|
2478
2496
|
data?: DatasetFile;
|
|
2479
2497
|
}
|
|
@@ -2485,7 +2503,7 @@ interface DatasetGetResponse {
|
|
|
2485
2503
|
* it landed. On business-level failure (HTTP 200 + `data.failed_uploads`)
|
|
2486
2504
|
* `id` is absent and `data.failed_uploads[]` carries the platform's reason.
|
|
2487
2505
|
*/
|
|
2488
|
-
interface DatasetUploadResponse {
|
|
2506
|
+
export interface DatasetUploadResponse {
|
|
2489
2507
|
request_id?: string;
|
|
2490
2508
|
/** File ID — the handle returned to callers (e.g. `file-ft-…`). */
|
|
2491
2509
|
id?: string;
|
|
@@ -2516,7 +2534,7 @@ interface DatasetUploadResponse {
|
|
|
2516
2534
|
};
|
|
2517
2535
|
}
|
|
2518
2536
|
/** DELETE /api/v1/files/{file_id} response. */
|
|
2519
|
-
interface DatasetDeleteResponse {
|
|
2537
|
+
export interface DatasetDeleteResponse {
|
|
2520
2538
|
request_id?: string;
|
|
2521
2539
|
data?: {
|
|
2522
2540
|
deleted?: boolean;
|
|
@@ -2525,7 +2543,7 @@ interface DatasetDeleteResponse {
|
|
|
2525
2543
|
}
|
|
2526
2544
|
//#endregion
|
|
2527
2545
|
//#region src/dataset/api.d.ts
|
|
2528
|
-
interface DatasetUploadParams {
|
|
2546
|
+
export interface DatasetUploadParams {
|
|
2529
2547
|
filePath: string;
|
|
2530
2548
|
/**
|
|
2531
2549
|
* Purpose tag forwarded to the platform. Defaults to "fine-tune" because
|
|
@@ -2546,21 +2564,21 @@ interface DatasetUploadParams {
|
|
|
2546
2564
|
* `Response`'s helper to avoid the buffer doubling. Fall back to readFileSync
|
|
2547
2565
|
* for small files where streaming overhead isn't worth it.
|
|
2548
2566
|
*/
|
|
2549
|
-
declare function uploadDataset(client: Client, params: DatasetUploadParams): Promise<DatasetFile & {
|
|
2567
|
+
export declare function uploadDataset(client: Client, params: DatasetUploadParams): Promise<DatasetFile & {
|
|
2550
2568
|
request_id?: string;
|
|
2551
2569
|
}>;
|
|
2552
|
-
interface DatasetListParams {
|
|
2570
|
+
export interface DatasetListParams {
|
|
2553
2571
|
pageNo?: number;
|
|
2554
2572
|
pageSize?: number;
|
|
2555
2573
|
purpose?: string;
|
|
2556
2574
|
signal?: AbortSignal;
|
|
2557
2575
|
}
|
|
2558
2576
|
/** GET /api/v1/files */
|
|
2559
|
-
declare function listDatasets(client: Client, params?: DatasetListParams): Promise<DatasetListResponse>;
|
|
2577
|
+
export declare function listDatasets(client: Client, params?: DatasetListParams): Promise<DatasetListResponse>;
|
|
2560
2578
|
/** GET /api/v1/files/{file_id} */
|
|
2561
|
-
declare function getDataset(client: Client, fileId: string, signal?: AbortSignal): Promise<DatasetGetResponse>;
|
|
2579
|
+
export declare function getDataset(client: Client, fileId: string, signal?: AbortSignal): Promise<DatasetGetResponse>;
|
|
2562
2580
|
/** DELETE /api/v1/files/{file_id} */
|
|
2563
|
-
declare function deleteDataset(client: Client, fileId: string, signal?: AbortSignal): Promise<DatasetDeleteResponse>;
|
|
2581
|
+
export declare function deleteDataset(client: Client, fileId: string, signal?: AbortSignal): Promise<DatasetDeleteResponse>;
|
|
2564
2582
|
//#endregion
|
|
2565
2583
|
//#region src/dataset/validate/types.d.ts
|
|
2566
2584
|
/**
|
|
@@ -2714,20 +2732,20 @@ interface TrainingProfile {
|
|
|
2714
2732
|
* Throws USAGE if the file extension is not `.jsonl` or `.zip`, or if the
|
|
2715
2733
|
* content cannot be parsed.
|
|
2716
2734
|
*/
|
|
2717
|
-
declare function detectModality(filePath: string): Promise<DataModality>;
|
|
2735
|
+
export declare function detectModality(filePath: string): Promise<DataModality>;
|
|
2718
2736
|
//#endregion
|
|
2719
2737
|
//#region src/dataset/validate/registry.d.ts
|
|
2720
2738
|
/** Lookup the validator that handles a given file extension. */
|
|
2721
|
-
declare function pickValidator(filePath: string): ValidatorSpec;
|
|
2739
|
+
export declare function pickValidator(filePath: string): ValidatorSpec;
|
|
2722
2740
|
/** Allow tests / future plugins to inject extra validators. Idempotent. */
|
|
2723
|
-
declare function registerValidator(spec: ValidatorSpec): void;
|
|
2741
|
+
export declare function registerValidator(spec: ValidatorSpec): void;
|
|
2724
2742
|
/**
|
|
2725
2743
|
* Top-level entry point. Applies common pre-flight (existence/size/extension)
|
|
2726
2744
|
* then defers to the format-specific validator.
|
|
2727
2745
|
*/
|
|
2728
|
-
declare function validateDataset(filePath: string, opts?: ValidateOpts): Promise<ValidationResult>;
|
|
2746
|
+
export declare function validateDataset(filePath: string, opts?: ValidateOpts): Promise<ValidationResult>;
|
|
2729
2747
|
/** Read-only view of the active registry — handy for tests / `--help`. */
|
|
2730
|
-
declare function listSupportedFormats(): {
|
|
2748
|
+
export declare function listSupportedFormats(): {
|
|
2731
2749
|
format: string;
|
|
2732
2750
|
extensions: string[];
|
|
2733
2751
|
}[];
|
|
@@ -2738,25 +2756,25 @@ declare function listSupportedFormats(): {
|
|
|
2738
2756
|
* `bl dataset upload` enforces this client-side so users learn early.
|
|
2739
2757
|
* CPT uses 300MB (see MAX_CPT_BYTES); API general upload is also 300MB.
|
|
2740
2758
|
*/
|
|
2741
|
-
declare const MAX_DATASET_BYTES: number;
|
|
2759
|
+
export declare const MAX_DATASET_BYTES: number;
|
|
2742
2760
|
/**
|
|
2743
2761
|
* CPT text dataset size cap — 300 MB per the platform docs.
|
|
2744
2762
|
* CPT requires at least 50M tokens; larger files are expected.
|
|
2745
2763
|
*/
|
|
2746
|
-
declare const MAX_CPT_BYTES: number;
|
|
2764
|
+
export declare const MAX_CPT_BYTES: number;
|
|
2747
2765
|
/**
|
|
2748
2766
|
* Image / video ZIP size cap — 2 GB per the platform docs. Used by
|
|
2749
2767
|
* `bl dataset upload` for media schemas and by the `sft-lora` training
|
|
2750
2768
|
* profile for image / video validation.
|
|
2751
2769
|
*/
|
|
2752
|
-
declare const MAX_MEDIA_ZIP_BYTES: number;
|
|
2770
|
+
export declare const MAX_MEDIA_ZIP_BYTES: number;
|
|
2753
2771
|
/**
|
|
2754
2772
|
* Parse a `--schema` CLI value into a `DatasetSchema` (or `undefined` for
|
|
2755
2773
|
* auto-detect). Single source of truth for the schema vocabulary so `dataset
|
|
2756
2774
|
* validate`, `dataset upload`, and any future caller agree on accepted values
|
|
2757
2775
|
* and error wording. Throws USAGE for anything unrecognized.
|
|
2758
2776
|
*/
|
|
2759
|
-
declare function parseDatasetSchemaFlag(value: string | undefined): DatasetSchema | undefined;
|
|
2777
|
+
export declare function parseDatasetSchemaFlag(value: string | undefined): DatasetSchema | undefined;
|
|
2760
2778
|
//#endregion
|
|
2761
2779
|
//#region src/dataset/validate/format.d.ts
|
|
2762
2780
|
/**
|
|
@@ -2766,7 +2784,7 @@ declare function parseDatasetSchemaFlag(value: string | undefined): DatasetSchem
|
|
|
2766
2784
|
* (`dataset validate`, `dataset upload`, `finetune create`) so the error
|
|
2767
2785
|
* presentation stays consistent regardless of which command ran the validator.
|
|
2768
2786
|
*/
|
|
2769
|
-
declare function formatIssue(issue: ValidationIssue): string;
|
|
2787
|
+
export declare function formatIssue(issue: ValidationIssue): string;
|
|
2770
2788
|
//#endregion
|
|
2771
2789
|
//#region src/finetune/types.d.ts
|
|
2772
2790
|
/**
|
|
@@ -2776,7 +2794,7 @@ declare function formatIssue(issue: ValidationIssue): string;
|
|
|
2776
2794
|
* preserved verbatim — callers decide how to surface fields).
|
|
2777
2795
|
*/
|
|
2778
2796
|
/** Hyper-parameters honored by text/thinking/vision SFT models. */
|
|
2779
|
-
interface FineTuneHyperParameters {
|
|
2797
|
+
export interface FineTuneHyperParameters {
|
|
2780
2798
|
/** Number of training epochs. */
|
|
2781
2799
|
n_epochs?: number;
|
|
2782
2800
|
batch_size?: number;
|
|
@@ -2790,7 +2808,7 @@ interface FineTuneHyperParameters {
|
|
|
2790
2808
|
[k: string]: unknown;
|
|
2791
2809
|
}
|
|
2792
2810
|
/** POST /api/v1/fine-tunes request body. */
|
|
2793
|
-
interface CreateFineTuneRequest {
|
|
2811
|
+
export interface CreateFineTuneRequest {
|
|
2794
2812
|
/** Base model ID, or a previously fine-tuned model ID for continued training. */
|
|
2795
2813
|
model: string;
|
|
2796
2814
|
training_file_ids: string[];
|
|
@@ -2814,11 +2832,11 @@ interface CreateFineTuneRequest {
|
|
|
2814
2832
|
finetuned_output_suffix?: string;
|
|
2815
2833
|
}
|
|
2816
2834
|
/** GET /api/v1/fine-tunes/{id}/logs response. */
|
|
2817
|
-
interface FineTuneLogEntry {
|
|
2835
|
+
export interface FineTuneLogEntry {
|
|
2818
2836
|
/** Server-defined log line — schema varies; preserve as-is. */
|
|
2819
2837
|
[k: string]: unknown;
|
|
2820
2838
|
}
|
|
2821
|
-
interface GetFineTuneLogsResponse {
|
|
2839
|
+
export interface GetFineTuneLogsResponse {
|
|
2822
2840
|
request_id?: string;
|
|
2823
2841
|
output?: {
|
|
2824
2842
|
logs?: Array<FineTuneLogEntry | string>;
|
|
@@ -2836,7 +2854,7 @@ interface GetFineTuneLogsResponse {
|
|
|
2836
2854
|
};
|
|
2837
2855
|
}
|
|
2838
2856
|
/** A single checkpoint as returned by the platform. */
|
|
2839
|
-
interface FineTuneCheckpoint {
|
|
2857
|
+
export interface FineTuneCheckpoint {
|
|
2840
2858
|
checkpoint?: string;
|
|
2841
2859
|
checkpoint_id?: string;
|
|
2842
2860
|
full_name?: string;
|
|
@@ -2860,7 +2878,7 @@ interface FineTuneCheckpoint {
|
|
|
2860
2878
|
* `{ checkpoints: [...] }`). The wrapped form is preserved as a fallback for
|
|
2861
2879
|
* older deployments.
|
|
2862
2880
|
*/
|
|
2863
|
-
interface ListCheckpointsResponse {
|
|
2881
|
+
export interface ListCheckpointsResponse {
|
|
2864
2882
|
request_id?: string;
|
|
2865
2883
|
output?: FineTuneCheckpoint[] | {
|
|
2866
2884
|
checkpoints?: FineTuneCheckpoint[];
|
|
@@ -2874,10 +2892,11 @@ interface ListCheckpointsResponse {
|
|
|
2874
2892
|
};
|
|
2875
2893
|
}
|
|
2876
2894
|
/** GET /api/v1/fine-tunes/{job_id}/export/{checkpoint}?model_name= response. */
|
|
2877
|
-
interface ExportCheckpointResponse {
|
|
2895
|
+
export interface ExportCheckpointResponse {
|
|
2878
2896
|
request_id?: string;
|
|
2879
2897
|
output?: {
|
|
2880
|
-
/** Resulting deployable model name. */
|
|
2898
|
+
/** Resulting deployable model name. */
|
|
2899
|
+
model_name?: string;
|
|
2881
2900
|
[k: string]: unknown;
|
|
2882
2901
|
};
|
|
2883
2902
|
data?: {
|
|
@@ -2886,13 +2905,13 @@ interface ExportCheckpointResponse {
|
|
|
2886
2905
|
};
|
|
2887
2906
|
}
|
|
2888
2907
|
/** POST /api/v1/fine-tunes/{id}/cancel response. */
|
|
2889
|
-
interface CancelFineTuneResponse {
|
|
2908
|
+
export interface CancelFineTuneResponse {
|
|
2890
2909
|
request_id?: string;
|
|
2891
2910
|
output?: FineTuneJob;
|
|
2892
2911
|
data?: FineTuneJob;
|
|
2893
2912
|
}
|
|
2894
2913
|
/** DELETE /api/v1/fine-tunes/{id} response. */
|
|
2895
|
-
interface DeleteFineTuneResponse {
|
|
2914
|
+
export interface DeleteFineTuneResponse {
|
|
2896
2915
|
request_id?: string;
|
|
2897
2916
|
output?: {
|
|
2898
2917
|
deleted?: boolean;
|
|
@@ -2906,7 +2925,7 @@ interface DeleteFineTuneResponse {
|
|
|
2906
2925
|
};
|
|
2907
2926
|
}
|
|
2908
2927
|
/** A single fine-tune job record as returned by the platform. */
|
|
2909
|
-
interface FineTuneJob {
|
|
2928
|
+
export interface FineTuneJob {
|
|
2910
2929
|
job_id?: string;
|
|
2911
2930
|
job_name?: string;
|
|
2912
2931
|
model?: string;
|
|
@@ -2930,7 +2949,7 @@ interface FineTuneJob {
|
|
|
2930
2949
|
[k: string]: unknown;
|
|
2931
2950
|
}
|
|
2932
2951
|
/** POST /api/v1/fine-tunes response. */
|
|
2933
|
-
interface CreateFineTuneResponse {
|
|
2952
|
+
export interface CreateFineTuneResponse {
|
|
2934
2953
|
request_id?: string;
|
|
2935
2954
|
/** Modern DashScope shape. */
|
|
2936
2955
|
output?: FineTuneJob;
|
|
@@ -2938,7 +2957,7 @@ interface CreateFineTuneResponse {
|
|
|
2938
2957
|
data?: FineTuneJob;
|
|
2939
2958
|
}
|
|
2940
2959
|
/** GET /api/v1/fine-tunes response. */
|
|
2941
|
-
interface ListFineTunesResponse {
|
|
2960
|
+
export interface ListFineTunesResponse {
|
|
2942
2961
|
request_id?: string;
|
|
2943
2962
|
output?: {
|
|
2944
2963
|
jobs?: FineTuneJob[];
|
|
@@ -2954,7 +2973,7 @@ interface ListFineTunesResponse {
|
|
|
2954
2973
|
};
|
|
2955
2974
|
}
|
|
2956
2975
|
/** GET /api/v1/fine-tunes/{job_id} response. */
|
|
2957
|
-
interface GetFineTuneResponse {
|
|
2976
|
+
export interface GetFineTuneResponse {
|
|
2958
2977
|
request_id?: string;
|
|
2959
2978
|
output?: FineTuneJob;
|
|
2960
2979
|
data?: FineTuneJob;
|
|
@@ -2962,8 +2981,8 @@ interface GetFineTuneResponse {
|
|
|
2962
2981
|
//#endregion
|
|
2963
2982
|
//#region src/finetune/api.d.ts
|
|
2964
2983
|
/** POST /api/v1/fine-tunes */
|
|
2965
|
-
declare function createFineTune(client: Client, body: CreateFineTuneRequest, signal?: AbortSignal): Promise<CreateFineTuneResponse>;
|
|
2966
|
-
interface ListFineTunesParams {
|
|
2984
|
+
export declare function createFineTune(client: Client, body: CreateFineTuneRequest, signal?: AbortSignal): Promise<CreateFineTuneResponse>;
|
|
2985
|
+
export interface ListFineTunesParams {
|
|
2967
2986
|
pageNo?: number;
|
|
2968
2987
|
pageSize?: number;
|
|
2969
2988
|
status?: string;
|
|
@@ -2972,22 +2991,22 @@ interface ListFineTunesParams {
|
|
|
2972
2991
|
signal?: AbortSignal;
|
|
2973
2992
|
}
|
|
2974
2993
|
/** GET /api/v1/fine-tunes */
|
|
2975
|
-
declare function listFineTunes(client: Client, params?: ListFineTunesParams): Promise<ListFineTunesResponse>;
|
|
2994
|
+
export declare function listFineTunes(client: Client, params?: ListFineTunesParams): Promise<ListFineTunesResponse>;
|
|
2976
2995
|
/** GET /api/v1/fine-tunes/{job_id} */
|
|
2977
|
-
declare function getFineTune(client: Client, jobId: string, signal?: AbortSignal): Promise<GetFineTuneResponse>;
|
|
2996
|
+
export declare function getFineTune(client: Client, jobId: string, signal?: AbortSignal): Promise<GetFineTuneResponse>;
|
|
2978
2997
|
/** POST /api/v1/fine-tunes/{job_id}/cancel */
|
|
2979
|
-
declare function cancelFineTune(client: Client, jobId: string, signal?: AbortSignal): Promise<CancelFineTuneResponse>;
|
|
2998
|
+
export declare function cancelFineTune(client: Client, jobId: string, signal?: AbortSignal): Promise<CancelFineTuneResponse>;
|
|
2980
2999
|
/** DELETE /api/v1/fine-tunes/{job_id} */
|
|
2981
|
-
declare function deleteFineTune(client: Client, jobId: string, signal?: AbortSignal): Promise<DeleteFineTuneResponse>;
|
|
2982
|
-
interface GetFineTuneLogsParams {
|
|
3000
|
+
export declare function deleteFineTune(client: Client, jobId: string, signal?: AbortSignal): Promise<DeleteFineTuneResponse>;
|
|
3001
|
+
export interface GetFineTuneLogsParams {
|
|
2983
3002
|
pageNo?: number;
|
|
2984
3003
|
pageSize?: number;
|
|
2985
3004
|
signal?: AbortSignal;
|
|
2986
3005
|
}
|
|
2987
3006
|
/** GET /api/v1/fine-tunes/{job_id}/logs */
|
|
2988
|
-
declare function getFineTuneLogs(client: Client, jobId: string, params?: GetFineTuneLogsParams): Promise<GetFineTuneLogsResponse>;
|
|
3007
|
+
export declare function getFineTuneLogs(client: Client, jobId: string, params?: GetFineTuneLogsParams): Promise<GetFineTuneLogsResponse>;
|
|
2989
3008
|
/** GET /api/v1/fine-tunes/{job_id}/checkpoints */
|
|
2990
|
-
declare function listCheckpoints(client: Client, jobId: string, signal?: AbortSignal): Promise<ListCheckpointsResponse>;
|
|
3009
|
+
export declare function listCheckpoints(client: Client, jobId: string, signal?: AbortSignal): Promise<ListCheckpointsResponse>;
|
|
2991
3010
|
/**
|
|
2992
3011
|
* GET /api/v1/fine-tunes/{job_id}/export/{checkpoint}?model_name={name}
|
|
2993
3012
|
*
|
|
@@ -2995,7 +3014,7 @@ declare function listCheckpoints(client: Client, jobId: string, signal?: AbortSi
|
|
|
2995
3014
|
* `deploy <modality> create` can target it. The platform may auto-export the best
|
|
2996
3015
|
* checkpoint on SUCCEEDED, but explicit export is the canonical path.
|
|
2997
3016
|
*/
|
|
2998
|
-
declare function exportCheckpoint(client: Client, jobId: string, checkpoint: string, modelName: string, signal?: AbortSignal): Promise<ExportCheckpointResponse>;
|
|
3017
|
+
export declare function exportCheckpoint(client: Client, jobId: string, checkpoint: string, modelName: string, signal?: AbortSignal): Promise<ExportCheckpointResponse>;
|
|
2999
3018
|
//#endregion
|
|
3000
3019
|
//#region src/finetune/capability.d.ts
|
|
3001
3020
|
/**
|
|
@@ -3011,7 +3030,7 @@ declare function exportCheckpoint(client: Client, jobId: string, checkpoint: str
|
|
|
3011
3030
|
* the interface boundary (request body), so the rest of the CLI never sees the
|
|
3012
3031
|
* raw server strings (`efficient_sft`, `dpo_full`, ...).
|
|
3013
3032
|
*/
|
|
3014
|
-
declare const TRAINING_TYPE_MAP: {
|
|
3033
|
+
export declare const TRAINING_TYPE_MAP: {
|
|
3015
3034
|
readonly sft: {
|
|
3016
3035
|
readonly server: "sft";
|
|
3017
3036
|
readonly method: "sft";
|
|
@@ -3038,11 +3057,11 @@ declare const TRAINING_TYPE_MAP: {
|
|
|
3038
3057
|
readonly variant: "full";
|
|
3039
3058
|
};
|
|
3040
3059
|
};
|
|
3041
|
-
type TrainingTypeCli = keyof typeof TRAINING_TYPE_MAP;
|
|
3060
|
+
export type TrainingTypeCli = keyof typeof TRAINING_TYPE_MAP;
|
|
3042
3061
|
/** All accepted CLI training-type values (for whitelisting / help text). */
|
|
3043
|
-
declare const TRAINING_TYPES_CLI: readonly TrainingTypeCli[];
|
|
3062
|
+
export declare const TRAINING_TYPES_CLI: readonly TrainingTypeCli[];
|
|
3044
3063
|
/** Default training type when `--training-type` is omitted. */
|
|
3045
|
-
declare const DEFAULT_TRAINING_TYPE: TrainingTypeCli;
|
|
3064
|
+
export declare const DEFAULT_TRAINING_TYPE: TrainingTypeCli;
|
|
3046
3065
|
/** Subset of `supports` relevant to training capability. */
|
|
3047
3066
|
interface ModelSupports {
|
|
3048
3067
|
sft?: boolean;
|
|
@@ -3054,16 +3073,16 @@ interface ModelSupports {
|
|
|
3054
3073
|
* A model record's training-capability fields. The full listFoundationModels
|
|
3055
3074
|
* item carries many more fields; only these are consulted here.
|
|
3056
3075
|
*/
|
|
3057
|
-
interface ModelCapability {
|
|
3076
|
+
export interface ModelCapability {
|
|
3058
3077
|
model?: string;
|
|
3059
3078
|
supports?: ModelSupports;
|
|
3060
3079
|
trainingTypes?: Record<string, string[]>;
|
|
3061
3080
|
[key: string]: unknown;
|
|
3062
3081
|
}
|
|
3063
3082
|
/** True when `value` is one of the accepted CLI training types. */
|
|
3064
|
-
declare function isTrainingTypeCli(value: string): value is TrainingTypeCli;
|
|
3083
|
+
export declare function isTrainingTypeCli(value: string): value is TrainingTypeCli;
|
|
3065
3084
|
/** The (method, variant) pair a CLI training type resolves to. */
|
|
3066
|
-
declare function trainingTypeMethodVariant(value: TrainingTypeCli): {
|
|
3085
|
+
export declare function trainingTypeMethodVariant(value: TrainingTypeCli): {
|
|
3067
3086
|
method: string;
|
|
3068
3087
|
variant: string;
|
|
3069
3088
|
};
|
|
@@ -3075,13 +3094,13 @@ declare function trainingTypeMethodVariant(value: TrainingTypeCli): {
|
|
|
3075
3094
|
* 2. `trainingTypes.<method>` includes the corresponding variant
|
|
3076
3095
|
* (`full` for the bare name, `lora` for the `-lora` suffix).
|
|
3077
3096
|
*/
|
|
3078
|
-
declare function modelSupportsTrainingType(model: ModelCapability | undefined | null, value: TrainingTypeCli): boolean;
|
|
3097
|
+
export declare function modelSupportsTrainingType(model: ModelCapability | undefined | null, value: TrainingTypeCli): boolean;
|
|
3079
3098
|
/**
|
|
3080
3099
|
* Every CLI training type a model supports, in canonical order
|
|
3081
3100
|
* (sft, sft-lora, dpo, dpo-lora, cpt). Empty when the model carries no
|
|
3082
3101
|
* capability metadata or supports none.
|
|
3083
3102
|
*/
|
|
3084
|
-
declare function listSupportedTrainingTypes(model: ModelCapability | undefined | null): TrainingTypeCli[];
|
|
3103
|
+
export declare function listSupportedTrainingTypes(model: ModelCapability | undefined | null): TrainingTypeCli[];
|
|
3085
3104
|
/**
|
|
3086
3105
|
* Fetch a single model's foundation metadata by name (console gateway
|
|
3087
3106
|
* `listFoundationModels` with a `name` filter). No console login required —
|
|
@@ -3091,12 +3110,12 @@ declare function listSupportedTrainingTypes(model: ModelCapability | undefined |
|
|
|
3091
3110
|
* server's `name` filter is a substring match, so we additionally require an
|
|
3092
3111
|
* exact `model` equality to avoid e.g. `qwen3-8b` matching `qwen3-8b-v2`).
|
|
3093
3112
|
*/
|
|
3094
|
-
declare function fetchModelCapability(settings: Settings, modelName: string): Promise<ModelCapability | null>;
|
|
3113
|
+
export declare function fetchModelCapability(settings: Settings, modelName: string): Promise<ModelCapability | null>;
|
|
3095
3114
|
//#endregion
|
|
3096
3115
|
//#region src/finetune/preflight.d.ts
|
|
3097
3116
|
/** Stable issue code for "too few training samples for the batch size". */
|
|
3098
|
-
declare const INSUFFICIENT_SAMPLES_CODE = "INSUFFICIENT_SAMPLES";
|
|
3099
|
-
interface BatchSizeGateInput {
|
|
3117
|
+
export declare const INSUFFICIENT_SAMPLES_CODE = "INSUFFICIENT_SAMPLES";
|
|
3118
|
+
export interface BatchSizeGateInput {
|
|
3100
3119
|
/**
|
|
3101
3120
|
* Total training-sample count across all `--datasets` files. Sourced from
|
|
3102
3121
|
* `validateDataset`'s `stats.totalRecords` (summed per file). The gate only
|
|
@@ -3112,7 +3131,7 @@ interface BatchSizeGateInput {
|
|
|
3112
3131
|
*/
|
|
3113
3132
|
batchSize: number;
|
|
3114
3133
|
}
|
|
3115
|
-
interface BatchSizeGateResult {
|
|
3134
|
+
export interface BatchSizeGateResult {
|
|
3116
3135
|
ok: boolean;
|
|
3117
3136
|
/** Present when `!ok`, in the same shape `validateDataset` issues use. */
|
|
3118
3137
|
issue?: ValidationIssue;
|
|
@@ -3133,25 +3152,25 @@ interface BatchSizeGateResult {
|
|
|
3133
3152
|
* may still fail on the platform; that's an acceptable false negative for a
|
|
3134
3153
|
* pre-check, and the hint nudges users to leave margin for the split.
|
|
3135
3154
|
*/
|
|
3136
|
-
declare function preflightBatchSizeGate(input: BatchSizeGateInput): BatchSizeGateResult;
|
|
3155
|
+
export declare function preflightBatchSizeGate(input: BatchSizeGateInput): BatchSizeGateResult;
|
|
3137
3156
|
//#endregion
|
|
3138
3157
|
//#region src/finetune/profiles/registry.d.ts
|
|
3139
3158
|
/** Look up a profile by its CLI training-type name. Throws USAGE if unknown. */
|
|
3140
|
-
declare function getProfile(clientTrainingType: string): TrainingProfile;
|
|
3159
|
+
export declare function getProfile(clientTrainingType: string): TrainingProfile;
|
|
3141
3160
|
/** All registered CLI training-type names (for help text / whitelisting). */
|
|
3142
|
-
declare function listTrainingTypes(): string[];
|
|
3161
|
+
export declare function listTrainingTypes(): string[];
|
|
3143
3162
|
//#endregion
|
|
3144
3163
|
//#region src/finetune/price.d.ts
|
|
3145
|
-
declare const TRAINING_MODEL_PRICE_API = "zeldaEasy.broadscope-platform.modelCenter.getModelPrice";
|
|
3146
|
-
declare const CALC_DATASETS_TOKENS_API = "zeldaEasy.broadscope-platform.modelInstance.calculateDatasetsTotalTokens";
|
|
3147
|
-
declare const ESTIMATE_FINETUNE_TOKENS_API = "zeldaEasy.broadscope-platform.modelInstance.estimateFinetuneTokens";
|
|
3148
|
-
interface TrainingModelPrice {
|
|
3164
|
+
export declare const TRAINING_MODEL_PRICE_API = "zeldaEasy.broadscope-platform.modelCenter.getModelPrice";
|
|
3165
|
+
export declare const CALC_DATASETS_TOKENS_API = "zeldaEasy.broadscope-platform.modelInstance.calculateDatasetsTotalTokens";
|
|
3166
|
+
export declare const ESTIMATE_FINETUNE_TOKENS_API = "zeldaEasy.broadscope-platform.modelInstance.estimateFinetuneTokens";
|
|
3167
|
+
export interface TrainingModelPrice {
|
|
3149
3168
|
price?: string;
|
|
3150
3169
|
priceUnit?: string;
|
|
3151
3170
|
modelId?: string;
|
|
3152
3171
|
[key: string]: unknown;
|
|
3153
3172
|
}
|
|
3154
|
-
interface TokenEstimate {
|
|
3173
|
+
export interface TokenEstimate {
|
|
3155
3174
|
estimatedDatasetConsumedTokensMinPerEpoch?: number;
|
|
3156
3175
|
estimatedDatasetConsumedTokensMaxPerEpoch?: number;
|
|
3157
3176
|
estimatedMixedConsumedTokensMinPerEpoch?: number;
|
|
@@ -3162,12 +3181,12 @@ interface TokenEstimate {
|
|
|
3162
3181
|
* Training unit price for a model. `price` is denominated in `priceUnit`
|
|
3163
3182
|
* (typically "千Token" — yuan per 1000 tokens).
|
|
3164
3183
|
*/
|
|
3165
|
-
declare function fetchTrainingModelPrice(client: Client, modelId: string): Promise<TrainingModelPrice>;
|
|
3184
|
+
export declare function fetchTrainingModelPrice(client: Client, modelId: string): Promise<TrainingModelPrice>;
|
|
3166
3185
|
/**
|
|
3167
3186
|
* Estimate training tokens for SFT / DPO jobs.
|
|
3168
3187
|
* Returns a per-epoch min/max range; multiply by `n_epochs` for the total.
|
|
3169
3188
|
*/
|
|
3170
|
-
declare function estimateSftDpoTokens(client: Client, datasetIds: string[], hyperParams: {
|
|
3189
|
+
export declare function estimateSftDpoTokens(client: Client, datasetIds: string[], hyperParams: {
|
|
3171
3190
|
nEpochs: number;
|
|
3172
3191
|
batchSize: number;
|
|
3173
3192
|
maxLength: number;
|
|
@@ -3181,7 +3200,7 @@ declare function estimateSftDpoTokens(client: Client, datasetIds: string[], hype
|
|
|
3181
3200
|
* `n_epochs` / `max_length` materially affect the estimate; the remaining
|
|
3182
3201
|
* hyper-parameters are fixed defaults.
|
|
3183
3202
|
*/
|
|
3184
|
-
declare function estimateCptTokens(client: Client, model: string, datasetIdsCsv: string, nEpochs: number): Promise<TokenEstimate>;
|
|
3203
|
+
export declare function estimateCptTokens(client: Client, model: string, datasetIdsCsv: string, nEpochs: number): Promise<TokenEstimate>;
|
|
3185
3204
|
//#endregion
|
|
3186
3205
|
//#region src/deploy/types.d.ts
|
|
3187
3206
|
/**
|
|
@@ -3191,7 +3210,7 @@ declare function estimateCptTokens(client: Client, model: string, datasetIdsCsv:
|
|
|
3191
3210
|
* preserved verbatim — callers decide how to surface fields).
|
|
3192
3211
|
*/
|
|
3193
3212
|
/** A single deployment record as returned by the platform. */
|
|
3194
|
-
interface Deployment {
|
|
3213
|
+
export interface Deployment {
|
|
3195
3214
|
/** Unique deployed-model identifier — used as the `model` parameter when invoking the deployed model. */
|
|
3196
3215
|
deployed_model?: string;
|
|
3197
3216
|
/** Human-friendly display name set at creation time. */
|
|
@@ -3229,7 +3248,7 @@ interface Deployment {
|
|
|
3229
3248
|
[k: string]: unknown;
|
|
3230
3249
|
}
|
|
3231
3250
|
/** A single deployable model record (GET /deployments/models). */
|
|
3232
|
-
interface DeployableModel {
|
|
3251
|
+
export interface DeployableModel {
|
|
3233
3252
|
model_name?: string;
|
|
3234
3253
|
base_model?: string;
|
|
3235
3254
|
/** custom | public | base | … */
|
|
@@ -3258,7 +3277,7 @@ interface DeployableModel {
|
|
|
3258
3277
|
[k: string]: unknown;
|
|
3259
3278
|
}
|
|
3260
3279
|
/** A single deployment template (only used by `plan=mu` base models). */
|
|
3261
|
-
interface DeployableTemplate {
|
|
3280
|
+
export interface DeployableTemplate {
|
|
3262
3281
|
template_id?: string;
|
|
3263
3282
|
template_name?: string;
|
|
3264
3283
|
template_desc?: string;
|
|
@@ -3292,7 +3311,7 @@ interface DeployableTemplate {
|
|
|
3292
3311
|
[k: string]: unknown;
|
|
3293
3312
|
}
|
|
3294
3313
|
/** POST /api/v1/deployments request body. */
|
|
3295
|
-
interface CreateDeploymentRequest {
|
|
3314
|
+
export interface CreateDeploymentRequest {
|
|
3296
3315
|
/** Required. The catalog or fine-tuned model identifier. */
|
|
3297
3316
|
model_name: string;
|
|
3298
3317
|
/** Required. Display name shown in the console. */
|
|
@@ -3326,13 +3345,13 @@ interface CreateDeploymentRequest {
|
|
|
3326
3345
|
* - use_input_prompt=true: honor the caller's prompt.
|
|
3327
3346
|
* `lora_prompt_default` is the default trigger-word phrase appended for the LoRA.
|
|
3328
3347
|
*/
|
|
3329
|
-
interface AigcConfig {
|
|
3348
|
+
export interface AigcConfig {
|
|
3330
3349
|
use_input_prompt?: boolean;
|
|
3331
3350
|
prompt?: string;
|
|
3332
3351
|
lora_prompt_default?: string;
|
|
3333
3352
|
}
|
|
3334
3353
|
/** PTU throughput limits — only used when `plan === "ptu"`. */
|
|
3335
|
-
interface PtuCapacity {
|
|
3354
|
+
export interface PtuCapacity {
|
|
3336
3355
|
/** Max input tokens per minute (all models). */
|
|
3337
3356
|
input_tpm?: number;
|
|
3338
3357
|
/** Max output tokens per minute (all models). */
|
|
@@ -3341,13 +3360,13 @@ interface PtuCapacity {
|
|
|
3341
3360
|
thinking_output_tpm?: number;
|
|
3342
3361
|
}
|
|
3343
3362
|
/** POST /api/v1/deployments response. */
|
|
3344
|
-
interface CreateDeploymentResponse {
|
|
3363
|
+
export interface CreateDeploymentResponse {
|
|
3345
3364
|
request_id?: string;
|
|
3346
3365
|
output?: Deployment;
|
|
3347
3366
|
data?: Deployment;
|
|
3348
3367
|
}
|
|
3349
3368
|
/** GET /api/v1/deployments response. */
|
|
3350
|
-
interface ListDeploymentsResponse {
|
|
3369
|
+
export interface ListDeploymentsResponse {
|
|
3351
3370
|
request_id?: string;
|
|
3352
3371
|
output?: {
|
|
3353
3372
|
deployments?: Deployment[];
|
|
@@ -3365,13 +3384,13 @@ interface ListDeploymentsResponse {
|
|
|
3365
3384
|
};
|
|
3366
3385
|
}
|
|
3367
3386
|
/** GET /api/v1/deployments/{deployed_model} response. */
|
|
3368
|
-
interface GetDeploymentResponse {
|
|
3387
|
+
export interface GetDeploymentResponse {
|
|
3369
3388
|
request_id?: string;
|
|
3370
3389
|
output?: Deployment;
|
|
3371
3390
|
data?: Deployment;
|
|
3372
3391
|
}
|
|
3373
3392
|
/** DELETE /api/v1/deployments/{deployed_model} response. */
|
|
3374
|
-
interface DeleteDeploymentResponse {
|
|
3393
|
+
export interface DeleteDeploymentResponse {
|
|
3375
3394
|
request_id?: string;
|
|
3376
3395
|
output?: {
|
|
3377
3396
|
deleted?: boolean;
|
|
@@ -3385,7 +3404,7 @@ interface DeleteDeploymentResponse {
|
|
|
3385
3404
|
};
|
|
3386
3405
|
}
|
|
3387
3406
|
/** GET /api/v1/deployments/models response. */
|
|
3388
|
-
interface ListDeployableModelsResponse {
|
|
3407
|
+
export interface ListDeployableModelsResponse {
|
|
3389
3408
|
request_id?: string;
|
|
3390
3409
|
output?: {
|
|
3391
3410
|
models?: DeployableModel[];
|
|
@@ -3403,7 +3422,7 @@ interface ListDeployableModelsResponse {
|
|
|
3403
3422
|
};
|
|
3404
3423
|
}
|
|
3405
3424
|
/** PUT /api/v1/deployments/{deployed_model}/scale request body. */
|
|
3406
|
-
interface ScaleDeploymentRequest {
|
|
3425
|
+
export interface ScaleDeploymentRequest {
|
|
3407
3426
|
/** New capacity in plan units. Server-side constraint: integer multiple of `base_capacity`, < 1000. */
|
|
3408
3427
|
capacity?: number;
|
|
3409
3428
|
/** PTU-only token-rate adjustments. */
|
|
@@ -3412,7 +3431,7 @@ interface ScaleDeploymentRequest {
|
|
|
3412
3431
|
[k: string]: unknown;
|
|
3413
3432
|
}
|
|
3414
3433
|
/** PUT /api/v1/deployments/{deployed_model}/scale response. */
|
|
3415
|
-
interface ScaleDeploymentResponse {
|
|
3434
|
+
export interface ScaleDeploymentResponse {
|
|
3416
3435
|
request_id?: string;
|
|
3417
3436
|
output?: Deployment;
|
|
3418
3437
|
data?: Deployment;
|
|
@@ -3424,13 +3443,13 @@ interface ScaleDeploymentResponse {
|
|
|
3424
3443
|
* - rpm_limit: requests per minute
|
|
3425
3444
|
* - tpm_limit: tokens per minute
|
|
3426
3445
|
*/
|
|
3427
|
-
interface UpdateDeploymentRequest {
|
|
3446
|
+
export interface UpdateDeploymentRequest {
|
|
3428
3447
|
rpm_limit?: number;
|
|
3429
3448
|
tpm_limit?: number;
|
|
3430
3449
|
[k: string]: unknown;
|
|
3431
3450
|
}
|
|
3432
3451
|
/** PUT /api/v1/deployments/{deployed_model} response. */
|
|
3433
|
-
interface UpdateDeploymentResponse {
|
|
3452
|
+
export interface UpdateDeploymentResponse {
|
|
3434
3453
|
request_id?: string;
|
|
3435
3454
|
output?: Deployment;
|
|
3436
3455
|
data?: Deployment;
|
|
@@ -3438,20 +3457,20 @@ interface UpdateDeploymentResponse {
|
|
|
3438
3457
|
//#endregion
|
|
3439
3458
|
//#region src/deploy/api.d.ts
|
|
3440
3459
|
/** POST /api/v1/deployments */
|
|
3441
|
-
declare function createDeployment(client: Client, body: CreateDeploymentRequest, signal?: AbortSignal): Promise<CreateDeploymentResponse>;
|
|
3442
|
-
interface ListDeploymentsParams {
|
|
3460
|
+
export declare function createDeployment(client: Client, body: CreateDeploymentRequest, signal?: AbortSignal): Promise<CreateDeploymentResponse>;
|
|
3461
|
+
export interface ListDeploymentsParams {
|
|
3443
3462
|
pageNo?: number;
|
|
3444
3463
|
pageSize?: number;
|
|
3445
3464
|
status?: string;
|
|
3446
3465
|
signal?: AbortSignal;
|
|
3447
3466
|
}
|
|
3448
3467
|
/** GET /api/v1/deployments */
|
|
3449
|
-
declare function listDeployments(client: Client, params?: ListDeploymentsParams): Promise<ListDeploymentsResponse>;
|
|
3468
|
+
export declare function listDeployments(client: Client, params?: ListDeploymentsParams): Promise<ListDeploymentsResponse>;
|
|
3450
3469
|
/** GET /api/v1/deployments/{deployed_model} */
|
|
3451
|
-
declare function getDeployment(client: Client, deployedModel: string, signal?: AbortSignal): Promise<GetDeploymentResponse>;
|
|
3470
|
+
export declare function getDeployment(client: Client, deployedModel: string, signal?: AbortSignal): Promise<GetDeploymentResponse>;
|
|
3452
3471
|
/** DELETE /api/v1/deployments/{deployed_model} */
|
|
3453
|
-
declare function deleteDeployment(client: Client, deployedModel: string, signal?: AbortSignal): Promise<DeleteDeploymentResponse>;
|
|
3454
|
-
interface ListDeployableModelsParams {
|
|
3472
|
+
export declare function deleteDeployment(client: Client, deployedModel: string, signal?: AbortSignal): Promise<DeleteDeploymentResponse>;
|
|
3473
|
+
export interface ListDeployableModelsParams {
|
|
3455
3474
|
pageNo?: number;
|
|
3456
3475
|
pageSize?: number;
|
|
3457
3476
|
/** Catalog version filter, e.g. "v1.0". */
|
|
@@ -3461,15 +3480,15 @@ interface ListDeployableModelsParams {
|
|
|
3461
3480
|
signal?: AbortSignal;
|
|
3462
3481
|
}
|
|
3463
3482
|
/** GET /api/v1/deployments/models */
|
|
3464
|
-
declare function listDeployableModels(client: Client, params?: ListDeployableModelsParams): Promise<ListDeployableModelsResponse>;
|
|
3483
|
+
export declare function listDeployableModels(client: Client, params?: ListDeployableModelsParams): Promise<ListDeployableModelsResponse>;
|
|
3465
3484
|
/** PUT /api/v1/deployments/{deployed_model}/scale */
|
|
3466
|
-
declare function scaleDeployment(client: Client, deployedModel: string, body: ScaleDeploymentRequest, signal?: AbortSignal): Promise<ScaleDeploymentResponse>;
|
|
3485
|
+
export declare function scaleDeployment(client: Client, deployedModel: string, body: ScaleDeploymentRequest, signal?: AbortSignal): Promise<ScaleDeploymentResponse>;
|
|
3467
3486
|
/**
|
|
3468
3487
|
* PUT /api/v1/deployments/{deployed_model}/update
|
|
3469
3488
|
*
|
|
3470
3489
|
* Update rate limits. At least one of `rpm_limit` / `tpm_limit` must be set.
|
|
3471
3490
|
*/
|
|
3472
|
-
declare function updateDeployment(client: Client, deployedModel: string, body: UpdateDeploymentRequest, signal?: AbortSignal): Promise<UpdateDeploymentResponse>;
|
|
3491
|
+
export declare function updateDeployment(client: Client, deployedModel: string, body: UpdateDeploymentRequest, signal?: AbortSignal): Promise<UpdateDeploymentResponse>;
|
|
3473
3492
|
//#endregion
|
|
3474
3493
|
//#region src/deploy/constants.d.ts
|
|
3475
3494
|
/**
|
|
@@ -3478,16 +3497,19 @@ declare function updateDeployment(client: Client, deployedModel: string, body: U
|
|
|
3478
3497
|
* string for these server-contract values.
|
|
3479
3498
|
*/
|
|
3480
3499
|
/** Billing plan (`--plan` value, matches the server's deployment plan). */
|
|
3481
|
-
declare const DEPLOY_PLAN: {
|
|
3482
|
-
/** Token-billed; the CLI default. */
|
|
3483
|
-
readonly
|
|
3500
|
+
export declare const DEPLOY_PLAN: {
|
|
3501
|
+
/** Token-billed; the CLI default. */
|
|
3502
|
+
readonly LORA: "lora";
|
|
3503
|
+
/** Token-billed, provisioned throughput. */
|
|
3504
|
+
readonly PTU: "ptu";
|
|
3505
|
+
/** Model-unit-billed. */
|
|
3484
3506
|
readonly MU: "mu";
|
|
3485
3507
|
};
|
|
3486
|
-
type DeployPlan = (typeof DEPLOY_PLAN)[keyof typeof DEPLOY_PLAN];
|
|
3508
|
+
export type DeployPlan = (typeof DEPLOY_PLAN)[keyof typeof DEPLOY_PLAN];
|
|
3487
3509
|
/** CLI default plan when `--plan` is omitted. */
|
|
3488
|
-
declare const DEFAULT_DEPLOY_PLAN: DeployPlan;
|
|
3510
|
+
export declare const DEFAULT_DEPLOY_PLAN: DeployPlan;
|
|
3489
3511
|
/** Deployment target modality — fixes the default plan when `--plan` is omitted. */
|
|
3490
|
-
type DeployModality = "text" | "audio" | "image";
|
|
3512
|
+
export type DeployModality = "text" | "audio" | "image";
|
|
3491
3513
|
/**
|
|
3492
3514
|
* Default plan per modality when `--plan` is omitted.
|
|
3493
3515
|
*
|
|
@@ -3498,25 +3520,27 @@ type DeployModality = "text" | "audio" | "image";
|
|
|
3498
3520
|
* speech-synthesis guide fixes `plan: "mu"` and requires deploy_spec /
|
|
3499
3521
|
* capacity / billing_method (all auto-picked by the mu strategy).
|
|
3500
3522
|
*/
|
|
3501
|
-
declare function defaultDeployPlan(modality: DeployModality): DeployPlan;
|
|
3523
|
+
export declare function defaultDeployPlan(modality: DeployModality): DeployPlan;
|
|
3502
3524
|
/** Billing method (`billing_method`, plan=mu only). */
|
|
3503
|
-
declare const BILLING_METHOD: {
|
|
3504
|
-
/** Post-paid (currently the only server-supported value). */
|
|
3525
|
+
export declare const BILLING_METHOD: {
|
|
3526
|
+
/** Post-paid (currently the only server-supported value). */
|
|
3527
|
+
readonly POST_PAY: "POST_PAY";
|
|
3528
|
+
/** Pre-paid. */
|
|
3505
3529
|
readonly PRE_PAY: "PRE_PAY";
|
|
3506
3530
|
};
|
|
3507
|
-
type BillingMethod = (typeof BILLING_METHOD)[keyof typeof BILLING_METHOD];
|
|
3531
|
+
export type BillingMethod = (typeof BILLING_METHOD)[keyof typeof BILLING_METHOD];
|
|
3508
3532
|
/** Default billing method for plan=mu when `--billing-method` is omitted. */
|
|
3509
|
-
declare const DEFAULT_BILLING_METHOD: BillingMethod;
|
|
3533
|
+
export declare const DEFAULT_BILLING_METHOD: BillingMethod;
|
|
3510
3534
|
/** Template charge type (`charge_type`) returned by the deployable-models catalog. */
|
|
3511
|
-
declare const CHARGE_TYPE: {
|
|
3535
|
+
export declare const CHARGE_TYPE: {
|
|
3512
3536
|
readonly POST_PAID: "post_paid";
|
|
3513
3537
|
readonly PRE_PAID: "pre_paid";
|
|
3514
3538
|
};
|
|
3515
|
-
type ChargeType = (typeof CHARGE_TYPE)[keyof typeof CHARGE_TYPE];
|
|
3539
|
+
export type ChargeType = (typeof CHARGE_TYPE)[keyof typeof CHARGE_TYPE];
|
|
3516
3540
|
//#endregion
|
|
3517
3541
|
//#region src/deploy/plans.d.ts
|
|
3518
3542
|
/** Plan-relevant subset of `deploy <modality> create` flags (parsed flags satisfy this shape). */
|
|
3519
|
-
interface CreatePlanFlags {
|
|
3543
|
+
export interface CreatePlanFlags {
|
|
3520
3544
|
plan?: string;
|
|
3521
3545
|
deploySpec?: string;
|
|
3522
3546
|
capacity?: number;
|
|
@@ -3525,7 +3549,7 @@ interface CreatePlanFlags {
|
|
|
3525
3549
|
outputTpm?: number;
|
|
3526
3550
|
thinkingOutputTpm?: number;
|
|
3527
3551
|
}
|
|
3528
|
-
interface PlanContext {
|
|
3552
|
+
export interface PlanContext {
|
|
3529
3553
|
client: Client;
|
|
3530
3554
|
/** True in --dry-run: strategies must skip side-effecting catalog lookups. */
|
|
3531
3555
|
dryRun: boolean;
|
|
@@ -3537,14 +3561,14 @@ interface PlanContext {
|
|
|
3537
3561
|
/** Console display name (`--name`). */
|
|
3538
3562
|
name: string;
|
|
3539
3563
|
}
|
|
3540
|
-
interface PlanResolved {
|
|
3564
|
+
export interface PlanResolved {
|
|
3541
3565
|
/**
|
|
3542
3566
|
* Plan-specific fields to merge into the request body. The shared envelope
|
|
3543
3567
|
* (`{model_name, name, plan}`) is added by the caller.
|
|
3544
3568
|
*/
|
|
3545
3569
|
body: Record<string, unknown>;
|
|
3546
3570
|
}
|
|
3547
|
-
interface PlanStrategy {
|
|
3571
|
+
export interface PlanStrategy {
|
|
3548
3572
|
/** Plan id, matches `--plan` CLI value. */
|
|
3549
3573
|
name: string;
|
|
3550
3574
|
/** Returns an error message when required flags are missing; undefined to pass. */
|
|
@@ -3561,15 +3585,15 @@ interface PlanStrategy {
|
|
|
3561
3585
|
* accepted by the create endpoint, so the dispatcher in the command will
|
|
3562
3586
|
* reject anything outside this table with a clear USAGE error.
|
|
3563
3587
|
*/
|
|
3564
|
-
declare const STRATEGIES: Record<string, PlanStrategy>;
|
|
3588
|
+
export declare const STRATEGIES: Record<string, PlanStrategy>;
|
|
3565
3589
|
/** Throws USAGE if `plan` is not in the strategy table. */
|
|
3566
|
-
declare function pickPlanStrategy(plan: string): PlanStrategy;
|
|
3590
|
+
export declare function pickPlanStrategy(plan: string): PlanStrategy;
|
|
3567
3591
|
//#endregion
|
|
3568
3592
|
//#region src/deploy/lifecycle.d.ts
|
|
3569
|
-
declare const DEPLOY_START_API = "zeldaEasy.broadscope-platform.modelInstance.startModelService";
|
|
3570
|
-
declare const DEPLOY_STOP_API = "zeldaEasy.broadscope-platform.modelInstance.stopModelService";
|
|
3571
|
-
declare const DEPLOY_LIST_INDEPENDENT_API = "zeldaEasy.broadscope-platform.modelInstance.listIndependentDeployedModel";
|
|
3572
|
-
interface ModelServiceEntry {
|
|
3593
|
+
export declare const DEPLOY_START_API = "zeldaEasy.broadscope-platform.modelInstance.startModelService";
|
|
3594
|
+
export declare const DEPLOY_STOP_API = "zeldaEasy.broadscope-platform.modelInstance.stopModelService";
|
|
3595
|
+
export declare const DEPLOY_LIST_INDEPENDENT_API = "zeldaEasy.broadscope-platform.modelInstance.listIndependentDeployedModel";
|
|
3596
|
+
export interface ModelServiceEntry {
|
|
3573
3597
|
modelServiceId?: string;
|
|
3574
3598
|
deployedModel?: string;
|
|
3575
3599
|
deployed_model?: string;
|
|
@@ -3580,24 +3604,24 @@ interface ModelServiceEntry {
|
|
|
3580
3604
|
[key: string]: unknown;
|
|
3581
3605
|
}
|
|
3582
3606
|
/** Start (bring online) a stopped deployment. */
|
|
3583
|
-
declare function startModelService(client: Client, modelServiceId: string): Promise<Record<string, unknown>>;
|
|
3607
|
+
export declare function startModelService(client: Client, modelServiceId: string): Promise<Record<string, unknown>>;
|
|
3584
3608
|
/** Stop (take offline) a running deployment. Stops billing for mu/ptu plans. */
|
|
3585
|
-
declare function stopModelService(client: Client, modelServiceId: string): Promise<Record<string, unknown>>;
|
|
3609
|
+
export declare function stopModelService(client: Client, modelServiceId: string): Promise<Record<string, unknown>>;
|
|
3586
3610
|
/**
|
|
3587
3611
|
* List independently deployed models (console domain).
|
|
3588
3612
|
* Used for precheck status verification and ID mapping.
|
|
3589
3613
|
* Paginates internally to return all entries.
|
|
3590
3614
|
*/
|
|
3591
|
-
declare function listIndependentDeployedModels(client: Client): Promise<ModelServiceEntry[]>;
|
|
3615
|
+
export declare function listIndependentDeployedModels(client: Client): Promise<ModelServiceEntry[]>;
|
|
3592
3616
|
/**
|
|
3593
3617
|
* Find a deployment entry by its identifier in the console-domain list.
|
|
3594
3618
|
* Matches against `modelServiceId`, `deployedModel`, or `deployed_model`.
|
|
3595
3619
|
*/
|
|
3596
|
-
declare function findDeploymentEntry(entries: ModelServiceEntry[], deployedModel: string): ModelServiceEntry | undefined;
|
|
3620
|
+
export declare function findDeploymentEntry(entries: ModelServiceEntry[], deployedModel: string): ModelServiceEntry | undefined;
|
|
3597
3621
|
//#endregion
|
|
3598
3622
|
//#region src/speech/vocabulary.d.ts
|
|
3599
3623
|
/** Fixed model id for the hot-word customization endpoint. */
|
|
3600
|
-
declare const SPEECH_BIASING_MODEL = "speech-biasing";
|
|
3624
|
+
export declare const SPEECH_BIASING_MODEL = "speech-biasing";
|
|
3601
3625
|
interface VocabularyEntry {
|
|
3602
3626
|
text: string;
|
|
3603
3627
|
weight: number;
|
|
@@ -3622,47 +3646,47 @@ interface VocabularyRequest {
|
|
|
3622
3646
|
input: Record<string, unknown>;
|
|
3623
3647
|
}
|
|
3624
3648
|
/** Shared request body builder for dry-run and live calls. */
|
|
3625
|
-
declare function buildVocabularyRequest(action: string, input: Record<string, unknown>): VocabularyRequest;
|
|
3626
|
-
declare function createVocabulary(client: Client, params: {
|
|
3649
|
+
export declare function buildVocabularyRequest(action: string, input: Record<string, unknown>): VocabularyRequest;
|
|
3650
|
+
export declare function createVocabulary(client: Client, params: {
|
|
3627
3651
|
targetModel: string;
|
|
3628
3652
|
prefix: string;
|
|
3629
3653
|
vocabulary: VocabularyEntry[];
|
|
3630
3654
|
}, signal?: AbortSignal): Promise<VocabularyEnvelope<{
|
|
3631
3655
|
vocabulary_id?: string;
|
|
3632
3656
|
}>>;
|
|
3633
|
-
declare function listVocabularies(client: Client, params?: {
|
|
3657
|
+
export declare function listVocabularies(client: Client, params?: {
|
|
3634
3658
|
prefix?: string;
|
|
3635
3659
|
pageIndex?: number;
|
|
3636
3660
|
pageSize?: number;
|
|
3637
3661
|
}, signal?: AbortSignal): Promise<VocabularyEnvelope<{
|
|
3638
3662
|
vocabulary_list?: VocabularyListItem[];
|
|
3639
3663
|
}>>;
|
|
3640
|
-
declare function queryVocabulary(client: Client, vocabularyId: string, signal?: AbortSignal): Promise<VocabularyEnvelope<{
|
|
3664
|
+
export declare function queryVocabulary(client: Client, vocabularyId: string, signal?: AbortSignal): Promise<VocabularyEnvelope<{
|
|
3641
3665
|
gmt_create?: string;
|
|
3642
3666
|
gmt_modified?: string;
|
|
3643
3667
|
status?: string;
|
|
3644
3668
|
target_model?: string;
|
|
3645
3669
|
vocabulary?: VocabularyEntry[];
|
|
3646
3670
|
}>>;
|
|
3647
|
-
declare function updateVocabulary(client: Client, vocabularyId: string, vocabulary: VocabularyEntry[], signal?: AbortSignal): Promise<VocabularyEnvelope<Record<string, never>>>;
|
|
3648
|
-
declare function deleteVocabulary(client: Client, vocabularyId: string, signal?: AbortSignal): Promise<VocabularyEnvelope<Record<string, never>>>;
|
|
3671
|
+
export declare function updateVocabulary(client: Client, vocabularyId: string, vocabulary: VocabularyEntry[], signal?: AbortSignal): Promise<VocabularyEnvelope<Record<string, never>>>;
|
|
3672
|
+
export declare function deleteVocabulary(client: Client, vocabularyId: string, signal?: AbortSignal): Promise<VocabularyEnvelope<Record<string, never>>>;
|
|
3649
3673
|
//#endregion
|
|
3650
3674
|
//#region src/speech/vocabulary-input.d.ts
|
|
3651
3675
|
/**
|
|
3652
3676
|
* Instant hot words for `recognize --vocabulary`.
|
|
3653
3677
|
* The API field is a flat word→weight object, so an array is a usage error here.
|
|
3654
3678
|
*/
|
|
3655
|
-
declare function parseInstantVocabulary(raw: string): Record<string, number>;
|
|
3679
|
+
export declare function parseInstantVocabulary(raw: string): Record<string, number>;
|
|
3656
3680
|
/**
|
|
3657
3681
|
* Vocabulary create/update --words.
|
|
3658
3682
|
* Accepts the same word→weight object as recognize, or the API entry array
|
|
3659
3683
|
* when per-entry lang is needed. Array form ignores the optional lang param.
|
|
3660
3684
|
*/
|
|
3661
|
-
declare function parseVocabularyEntries(raw: string, lang?: string): VocabularyEntry[];
|
|
3685
|
+
export declare function parseVocabularyEntries(raw: string, lang?: string): VocabularyEntry[];
|
|
3662
3686
|
//#endregion
|
|
3663
3687
|
//#region src/types/command-pack.d.ts
|
|
3664
3688
|
/** Current Command Pack protocol version understood by this release. */
|
|
3665
|
-
declare const COMMAND_PACK_API_VERSION: 1;
|
|
3689
|
+
export declare const COMMAND_PACK_API_VERSION: 1;
|
|
3666
3690
|
/** `package.json#bailianCli` metadata for a Command Pack package. */
|
|
3667
3691
|
interface CommandPackMeta {
|
|
3668
3692
|
type: "command-pack";
|
|
@@ -3772,7 +3796,7 @@ interface SecurityAlertList {
|
|
|
3772
3796
|
}
|
|
3773
3797
|
//#endregion
|
|
3774
3798
|
//#region src/utils/filename.d.ts
|
|
3775
|
-
declare function generateFilename(prefix: string, prompt: string): string;
|
|
3799
|
+
export declare function generateFilename(prefix: string, prompt: string): string;
|
|
3776
3800
|
//#endregion
|
|
3777
3801
|
//#region src/utils/output-dir.d.ts
|
|
3778
3802
|
/**
|
|
@@ -3786,13 +3810,13 @@ declare function generateFilename(prefix: string, prompt: string): string;
|
|
|
3786
3810
|
* Optionally appends a subdirectory (e.g. 'images', 'videos', 'speech').
|
|
3787
3811
|
* Creates the directory if it doesn't exist.
|
|
3788
3812
|
*/
|
|
3789
|
-
declare function resolveOutputDir(settings: Settings, options?: {
|
|
3813
|
+
export declare function resolveOutputDir(settings: Settings, options?: {
|
|
3790
3814
|
flagDir?: string;
|
|
3791
3815
|
subDir?: string;
|
|
3792
3816
|
}): string;
|
|
3793
3817
|
//#endregion
|
|
3794
3818
|
//#region src/utils/token.d.ts
|
|
3795
|
-
declare function maskToken(token: string): string;
|
|
3819
|
+
export declare function maskToken(token: string): string;
|
|
3796
3820
|
//#endregion
|
|
3797
3821
|
//#region src/utils/object.d.ts
|
|
3798
3822
|
/**
|
|
@@ -3807,29 +3831,29 @@ declare function maskToken(token: string): string;
|
|
|
3807
3831
|
* stripUndefined(params); // { a: 1 }
|
|
3808
3832
|
* ```
|
|
3809
3833
|
*/
|
|
3810
|
-
declare function stripUndefined<T extends Record<string, unknown>>(obj: T): T;
|
|
3834
|
+
export declare function stripUndefined<T extends Record<string, unknown>>(obj: T): T;
|
|
3811
3835
|
//#endregion
|
|
3812
3836
|
//#region src/utils/fs.d.ts
|
|
3813
|
-
declare function readTextFromPathOrStdin(path: string): string;
|
|
3837
|
+
export declare function readTextFromPathOrStdin(path: string): string;
|
|
3814
3838
|
//#endregion
|
|
3815
3839
|
//#region src/utils/concurrency.d.ts
|
|
3816
3840
|
/**
|
|
3817
3841
|
* Run async task factories with a bounded concurrency pool.
|
|
3818
3842
|
* Returns results in the same order as the input tasks array.
|
|
3819
3843
|
*/
|
|
3820
|
-
declare function runWithConcurrency<T>(tasks: Array<() => Promise<T>>, limit: number): Promise<T[]>;
|
|
3844
|
+
export declare function runWithConcurrency<T>(tasks: Array<() => Promise<T>>, limit: number): Promise<T[]>;
|
|
3821
3845
|
//#endregion
|
|
3822
3846
|
//#region src/utils/boolean-flag.d.ts
|
|
3823
3847
|
/** Parse true/false from CLI flags (e.g. `--watermark <bool>`). */
|
|
3824
|
-
declare function parseBooleanValue(value: unknown, label?: string): boolean;
|
|
3825
|
-
declare function parseOptionalBooleanValue(value: unknown, label?: string): boolean | undefined;
|
|
3848
|
+
export declare function parseBooleanValue(value: unknown, label?: string): boolean;
|
|
3849
|
+
export declare function parseOptionalBooleanValue(value: unknown, label?: string): boolean | undefined;
|
|
3826
3850
|
/**
|
|
3827
3851
|
* Resolve a tri-state boolean CLI flag (`--name <bool>`).
|
|
3828
3852
|
* Returns `defaultWhenUnset` when the flag is omitted.
|
|
3829
3853
|
*/
|
|
3830
|
-
declare function resolveBooleanFlag(flagValue: unknown, defaultWhenUnset: boolean | undefined, label?: string): boolean | undefined;
|
|
3854
|
+
export declare function resolveBooleanFlag(flagValue: unknown, defaultWhenUnset: boolean | undefined, label?: string): boolean | undefined;
|
|
3831
3855
|
/** Resolve `--watermark`; command flag overrides config, then defaults to true. */
|
|
3832
|
-
declare function resolveWatermark(flagValue: unknown, configuredValue?: boolean): boolean;
|
|
3856
|
+
export declare function resolveWatermark(flagValue: unknown, configuredValue?: boolean): boolean;
|
|
3833
3857
|
//#endregion
|
|
3834
3858
|
//#region src/telemetry/event.d.ts
|
|
3835
3859
|
interface TrackingEvent {
|
|
@@ -3847,7 +3871,7 @@ interface TrackingEvent {
|
|
|
3847
3871
|
authMethod?: AuthRequirement;
|
|
3848
3872
|
params?: Record<string, unknown>;
|
|
3849
3873
|
}
|
|
3850
|
-
declare function createTrackingEvent(opts: {
|
|
3874
|
+
export declare function createTrackingEvent(opts: {
|
|
3851
3875
|
command: string;
|
|
3852
3876
|
durationMs: number;
|
|
3853
3877
|
success: boolean;
|
|
@@ -3873,9 +3897,9 @@ declare function createTrackingEvent(opts: {
|
|
|
3873
3897
|
* 埋点永远不应阻塞 CLI:调用方应传入较短的超时(例如 1000ms),并始终与超时
|
|
3874
3898
|
* race。错误与超时一律静默吞掉。
|
|
3875
3899
|
*/
|
|
3876
|
-
declare function flushTelemetry(timeoutMs?: number): Promise<void>;
|
|
3877
|
-
declare function localSink(event: TrackingEvent): Promise<void>;
|
|
3878
|
-
declare function remoteSink(event: TrackingEvent): Promise<void>;
|
|
3900
|
+
export declare function flushTelemetry(timeoutMs?: number): Promise<void>;
|
|
3901
|
+
export declare function localSink(event: TrackingEvent): Promise<void>;
|
|
3902
|
+
export declare function remoteSink(event: TrackingEvent): Promise<void>;
|
|
3879
3903
|
//#endregion
|
|
3880
3904
|
//#region src/telemetry/tracker.d.ts
|
|
3881
3905
|
/** 遥测只记录命令声明的鉴权域,不接触具体凭证能力。 */
|
|
@@ -3884,7 +3908,7 @@ interface TrackingDeps {
|
|
|
3884
3908
|
settings: Settings;
|
|
3885
3909
|
authMethod?: AuthRequirement;
|
|
3886
3910
|
}
|
|
3887
|
-
declare function trackCommandExecution(deps: TrackingDeps, commandPath: string[], flags: Record<string, unknown>, fn: () => Promise<void>): Promise<void>;
|
|
3911
|
+
export declare function trackCommandExecution(deps: TrackingDeps, commandPath: string[], flags: Record<string, unknown>, fn: () => Promise<void>): Promise<void>;
|
|
3888
3912
|
//#endregion
|
|
3889
3913
|
//#region src/advisor/types.d.ts
|
|
3890
3914
|
type Modality = "Text" | "Image" | "Video" | "Audio";
|
|
@@ -3901,32 +3925,32 @@ interface ModelPreference {
|
|
|
3901
3925
|
targets?: string[];
|
|
3902
3926
|
excludes?: string[];
|
|
3903
3927
|
}
|
|
3904
|
-
declare const Modalities: {
|
|
3928
|
+
export declare const Modalities: {
|
|
3905
3929
|
readonly Text: "Text";
|
|
3906
3930
|
readonly Image: "Image";
|
|
3907
3931
|
readonly Video: "Video";
|
|
3908
3932
|
readonly Audio: "Audio";
|
|
3909
3933
|
};
|
|
3910
|
-
declare const Complexities: {
|
|
3934
|
+
export declare const Complexities: {
|
|
3911
3935
|
readonly Single: "single";
|
|
3912
3936
|
readonly Pipeline: "pipeline";
|
|
3913
3937
|
};
|
|
3914
|
-
declare const Budgets: {
|
|
3938
|
+
export declare const Budgets: {
|
|
3915
3939
|
readonly Low: "low";
|
|
3916
3940
|
readonly Medium: "medium";
|
|
3917
3941
|
readonly High: "high";
|
|
3918
3942
|
};
|
|
3919
|
-
declare const ContextNeeds: {
|
|
3943
|
+
export declare const ContextNeeds: {
|
|
3920
3944
|
readonly Standard: "standard";
|
|
3921
3945
|
readonly Large: "large";
|
|
3922
3946
|
readonly ExtraLarge: "extra-large";
|
|
3923
3947
|
};
|
|
3924
|
-
declare const QualityPreferences: {
|
|
3948
|
+
export declare const QualityPreferences: {
|
|
3925
3949
|
readonly Flagship: "flagship";
|
|
3926
3950
|
readonly Balanced: "balanced";
|
|
3927
3951
|
readonly CostOptimized: "cost-optimized";
|
|
3928
3952
|
};
|
|
3929
|
-
declare const Capabilities: {
|
|
3953
|
+
export declare const Capabilities: {
|
|
3930
3954
|
readonly TG: "TG";
|
|
3931
3955
|
readonly Reasoning: "Reasoning";
|
|
3932
3956
|
readonly VU: "VU";
|
|
@@ -3943,13 +3967,13 @@ declare const Capabilities: {
|
|
|
3943
3967
|
readonly TR: "TR";
|
|
3944
3968
|
readonly ThreeDGeneration: "3D-generation";
|
|
3945
3969
|
};
|
|
3946
|
-
declare const Features: {
|
|
3970
|
+
export declare const Features: {
|
|
3947
3971
|
readonly FunctionCalling: "function-calling";
|
|
3948
3972
|
readonly WebSearch: "web-search";
|
|
3949
3973
|
readonly StructuredOutputs: "structured-outputs";
|
|
3950
3974
|
readonly PrefixCompletion: "prefix-completion";
|
|
3951
3975
|
};
|
|
3952
|
-
declare const ModelCategories: {
|
|
3976
|
+
export declare const ModelCategories: {
|
|
3953
3977
|
readonly Flagship: "Flagship";
|
|
3954
3978
|
readonly CostOptimized: "Cost-optimized";
|
|
3955
3979
|
};
|
|
@@ -4048,10 +4072,10 @@ type RecommendResult = SingleResult | PipelineResult;
|
|
|
4048
4072
|
interface GetModelsOptions {
|
|
4049
4073
|
onPrepareStart?: () => void;
|
|
4050
4074
|
}
|
|
4051
|
-
declare function getModels(settings: Settings, options?: GetModelsOptions): Promise<ModelProfile[]>;
|
|
4075
|
+
export declare function getModels(settings: Settings, options?: GetModelsOptions): Promise<ModelProfile[]>;
|
|
4052
4076
|
//#endregion
|
|
4053
4077
|
//#region src/advisor/constants/scoring.d.ts
|
|
4054
|
-
declare const SEMANTIC_TOP_K = 20;
|
|
4078
|
+
export declare const SEMANTIC_TOP_K = 20;
|
|
4055
4079
|
//#endregion
|
|
4056
4080
|
//#region src/advisor/intent.d.ts
|
|
4057
4081
|
/**
|
|
@@ -4063,7 +4087,7 @@ declare const SEMANTIC_TOP_K = 20;
|
|
|
4063
4087
|
*
|
|
4064
4088
|
* On failure, degrades gracefully to DEFAULT_INTENT with confidence 0.
|
|
4065
4089
|
*/
|
|
4066
|
-
declare function analyzeIntent(client: Client, input: string): Promise<IntentProfile>;
|
|
4090
|
+
export declare function analyzeIntent(client: Client, input: string): Promise<IntentProfile>;
|
|
4067
4091
|
//#endregion
|
|
4068
4092
|
//#region src/advisor/recall.d.ts
|
|
4069
4093
|
interface ScoredCandidate {
|
|
@@ -4074,11 +4098,11 @@ interface ScoredCandidate {
|
|
|
4074
4098
|
/** Cosine similarity [0,1] between the semantic query and the model embedding. */
|
|
4075
4099
|
softScore?: number;
|
|
4076
4100
|
}
|
|
4077
|
-
declare function recallCandidates(models: ModelProfile[], intent: IntentProfile): ScoredCandidate[];
|
|
4101
|
+
export declare function recallCandidates(models: ModelProfile[], intent: IntentProfile): ScoredCandidate[];
|
|
4078
4102
|
//#endregion
|
|
4079
4103
|
//#region src/advisor/recall-semantic.d.ts
|
|
4080
|
-
declare function isSemanticAvailable(): boolean;
|
|
4081
|
-
declare function recallSemantic(client: Client, models: ModelProfile[], query: string, topK: number, intent?: IntentProfile): Promise<ScoredCandidate[]>;
|
|
4104
|
+
export declare function isSemanticAvailable(): boolean;
|
|
4105
|
+
export declare function recallSemantic(client: Client, models: ModelProfile[], query: string, topK: number, intent?: IntentProfile): Promise<ScoredCandidate[]>;
|
|
4082
4106
|
//#endregion
|
|
4083
4107
|
//#region src/advisor/recommend.d.ts
|
|
4084
4108
|
interface RecommendOptions {
|
|
@@ -4086,15 +4110,15 @@ interface RecommendOptions {
|
|
|
4086
4110
|
onContentStart?: () => void;
|
|
4087
4111
|
enableThinking?: boolean;
|
|
4088
4112
|
}
|
|
4089
|
-
declare function buildDocLink(docUrl?: string): string | undefined;
|
|
4090
|
-
declare function rankModels(client: Client, candidates: ScoredCandidate[], intent: IntentProfile, userInput: string, top: number, options?: RecommendOptions): Promise<RecommendResult>;
|
|
4113
|
+
export declare function buildDocLink(docUrl?: string): string | undefined;
|
|
4114
|
+
export declare function rankModels(client: Client, candidates: ScoredCandidate[], intent: IntentProfile, userInput: string, top: number, options?: RecommendOptions): Promise<RecommendResult>;
|
|
4091
4115
|
//#endregion
|
|
4092
4116
|
//#region src/advisor/sync.d.ts
|
|
4093
4117
|
/**
|
|
4094
4118
|
* Check and sync Wiki data. Runs silently; never throws.
|
|
4095
4119
|
* @returns Whether data was actually updated (for testing/debugging)
|
|
4096
4120
|
*/
|
|
4097
|
-
declare function maybeSyncWikiData(): Promise<boolean>;
|
|
4121
|
+
export declare function maybeSyncWikiData(): Promise<boolean>;
|
|
4098
4122
|
//#endregion
|
|
4099
4123
|
//#region src/advisor/sources/types.d.ts
|
|
4100
4124
|
interface ModelSource {
|
|
@@ -4107,7 +4131,7 @@ interface ModelSource {
|
|
|
4107
4131
|
/** How the CLI was installed on this machine. */
|
|
4108
4132
|
type InstallMethod = "binary" | "npm" | "brew" | "winget" | "unknown";
|
|
4109
4133
|
/** Product that currently ships standalone binary artifacts (`bl` / `bailian`). */
|
|
4110
|
-
declare const BINARY_PRODUCT_CLIENT_NAME = "bailian-cli";
|
|
4134
|
+
export declare const BINARY_PRODUCT_CLIENT_NAME = "bailian-cli";
|
|
4111
4135
|
type InstallMethodIdentity = {
|
|
4112
4136
|
clientName: string;
|
|
4113
4137
|
};
|
|
@@ -4117,9 +4141,9 @@ type InstallMethodIdentity = {
|
|
|
4117
4141
|
*
|
|
4118
4142
|
* Binary entrypoints set `BAILIAN_COMPILED=1` before other code runs.
|
|
4119
4143
|
*/
|
|
4120
|
-
declare function isCompiledBinary(): boolean;
|
|
4144
|
+
export declare function isCompiledBinary(): boolean;
|
|
4121
4145
|
/** Infer install method when no marker file / env override is present. */
|
|
4122
|
-
declare function detectInstallMethod(): InstallMethod;
|
|
4146
|
+
export declare function detectInstallMethod(): InstallMethod;
|
|
4123
4147
|
/**
|
|
4124
4148
|
* Read the persisted install method, falling back to detection.
|
|
4125
4149
|
*
|
|
@@ -4127,13 +4151,13 @@ declare function detectInstallMethod(): InstallMethod;
|
|
|
4127
4151
|
* Legacy `~/.bailian/install-method` is only consulted for `bailian-cli`
|
|
4128
4152
|
* so other products (e.g. kscli) are not polluted by a shared binary marker.
|
|
4129
4153
|
*/
|
|
4130
|
-
declare function getInstallMethod(identity?: InstallMethodIdentity): InstallMethod;
|
|
4154
|
+
export declare function getInstallMethod(identity?: InstallMethodIdentity): InstallMethod;
|
|
4131
4155
|
/**
|
|
4132
4156
|
* Install method for update / auto-update routing.
|
|
4133
4157
|
* Only `bailian-cli` may follow the binary channel; other products always use npm
|
|
4134
4158
|
* even if env or a mistaken marker claims `binary`.
|
|
4135
4159
|
*/
|
|
4136
|
-
declare function getUpdateInstallMethod(identity: {
|
|
4160
|
+
export declare function getUpdateInstallMethod(identity: {
|
|
4137
4161
|
clientName: string;
|
|
4138
4162
|
npmPackage: string;
|
|
4139
4163
|
}): InstallMethod;
|
|
@@ -4141,7 +4165,7 @@ declare function getUpdateInstallMethod(identity: {
|
|
|
4141
4165
|
* Persist install method under `~/.bailian/install-method.<clientName>` (best-effort).
|
|
4142
4166
|
* For `bailian-cli`, also write the legacy `install-method` file for older readers.
|
|
4143
4167
|
*/
|
|
4144
|
-
declare function writeInstallMethodSync(method: InstallMethod, identity?: InstallMethodIdentity): void;
|
|
4168
|
+
export declare function writeInstallMethodSync(method: InstallMethod, identity?: InstallMethodIdentity): void;
|
|
4145
4169
|
//#endregion
|
|
4146
4170
|
//#region src/install/cdn.d.ts
|
|
4147
4171
|
/**
|
|
@@ -4164,13 +4188,13 @@ declare function writeInstallMethodSync(method: InstallMethod, identity?: Instal
|
|
|
4164
4188
|
*
|
|
4165
4189
|
* Override with `BAILIAN_CLI_CDN`.
|
|
4166
4190
|
*/
|
|
4167
|
-
declare const DEFAULT_CLI_CDN_BASE = "https://bailian-wiki.oss-cn-hangzhou.aliyuncs.com/release";
|
|
4191
|
+
export declare const DEFAULT_CLI_CDN_BASE = "https://bailian-wiki.oss-cn-hangzhou.aliyuncs.com/release";
|
|
4168
4192
|
/** GitHub Releases base — used when writing manifests attached to gh release assets. */
|
|
4169
|
-
declare const GITHUB_RELEASES_BASE = "https://github.com/modelstudioai/cli/releases";
|
|
4193
|
+
export declare const GITHUB_RELEASES_BASE = "https://github.com/modelstudioai/cli/releases";
|
|
4170
4194
|
/** User-facing install entry (docs / update hints); asset downloads still use getCliCdnBase(). */
|
|
4171
|
-
declare const DEFAULT_INSTALL_SCRIPT_URL = "https://bailian.aliyun.com/cli/install.sh";
|
|
4172
|
-
declare const DEFAULT_INSTALL_PS1_URL = "https://bailian.aliyun.com/cli/install.ps1";
|
|
4173
|
-
declare function getCliCdnBase(): string;
|
|
4195
|
+
export declare const DEFAULT_INSTALL_SCRIPT_URL = "https://bailian.aliyun.com/cli/install.sh";
|
|
4196
|
+
export declare const DEFAULT_INSTALL_PS1_URL = "https://bailian.aliyun.com/cli/install.ps1";
|
|
4197
|
+
export declare function getCliCdnBase(): string;
|
|
4174
4198
|
/**
|
|
4175
4199
|
* Rolling manifest URL at the CDN base root.
|
|
4176
4200
|
* Stable (`latest` / `stable` / empty) → `manifest.json`.
|
|
@@ -4178,31 +4202,31 @@ declare function getCliCdnBase(): string;
|
|
|
4178
4202
|
* Other names still map to `{channel}.json` for backward compatibility only.
|
|
4179
4203
|
* All share the same rolling-manifest shape from binary-build.
|
|
4180
4204
|
*/
|
|
4181
|
-
declare function channelManifestUrl(channel?: string): string;
|
|
4205
|
+
export declare function channelManifestUrl(channel?: string): string;
|
|
4182
4206
|
/** Immutable per-version asset: `{base}/v{version}/{fileName}`. */
|
|
4183
|
-
declare function releaseAssetUrl(version: string, fileName: string): string;
|
|
4207
|
+
export declare function releaseAssetUrl(version: string, fileName: string): string;
|
|
4184
4208
|
/** Platform triple used in asset names: `bl-<ver>-<os>-<arch>[.exe]`. */
|
|
4185
|
-
declare function detectBinaryPlatform(): {
|
|
4209
|
+
export declare function detectBinaryPlatform(): {
|
|
4186
4210
|
os: string;
|
|
4187
4211
|
arch: string;
|
|
4188
4212
|
fileSuffix: string;
|
|
4189
4213
|
};
|
|
4190
4214
|
/** Release download asset: `bl-<ver>-<os>-<arch>.zip`. */
|
|
4191
|
-
declare function binaryAssetFileName(version: string, os: string, arch: string, _exe?: boolean): string;
|
|
4215
|
+
export declare function binaryAssetFileName(version: string, os: string, arch: string, _exe?: boolean): string;
|
|
4192
4216
|
/**
|
|
4193
4217
|
* Unix install.sh archive: `bl-<ver>-<os>-<arch>.tar.gz`.
|
|
4194
4218
|
* Windows has no tar.gz (PowerShell Expand-Archive uses zip).
|
|
4195
4219
|
*/
|
|
4196
|
-
declare function binaryTarFileName(version: string, os: string, arch: string): string | undefined;
|
|
4220
|
+
export declare function binaryTarFileName(version: string, os: string, arch: string): string | undefined;
|
|
4197
4221
|
/** Uncompressed binary name inside the zip. */
|
|
4198
|
-
declare function binaryInnerFileName(version: string, os: string, arch: string, exe?: boolean): string;
|
|
4222
|
+
export declare function binaryInnerFileName(version: string, os: string, arch: string, exe?: boolean): string;
|
|
4199
4223
|
//#endregion
|
|
4200
4224
|
//#region src/install/unzip-asset.d.ts
|
|
4201
4225
|
/**
|
|
4202
4226
|
* Extract `entryName` (or the first non-directory entry) from `zipPath` to `destPath`.
|
|
4203
4227
|
* Returns the archive entry basename that was extracted.
|
|
4204
4228
|
*/
|
|
4205
|
-
declare function extractZipEntryToFile(zipPath: string, destPath: string, entryName?: string): Promise<string>;
|
|
4229
|
+
export declare function extractZipEntryToFile(zipPath: string, destPath: string, entryName?: string): Promise<string>;
|
|
4206
4230
|
//#endregion
|
|
4207
4231
|
//#region src/skills/types.d.ts
|
|
4208
4232
|
/**
|
|
@@ -4276,18 +4300,18 @@ interface SkillStatusRow {
|
|
|
4276
4300
|
}
|
|
4277
4301
|
//#endregion
|
|
4278
4302
|
//#region src/skills/registry.d.ts
|
|
4279
|
-
declare function getSkillRegistryBaseUrl(): string;
|
|
4303
|
+
export declare function getSkillRegistryBaseUrl(): string;
|
|
4280
4304
|
/**
|
|
4281
4305
|
* Fetch the remote skill index. No local caching — the diff comparison is always
|
|
4282
4306
|
* "live remote index vs local skill-lock.json".
|
|
4283
4307
|
* Silent background channels (advisor sync) may pass a tighter timeout and attempts=1
|
|
4284
4308
|
* than the interactive defaults.
|
|
4285
4309
|
*/
|
|
4286
|
-
declare function fetchSkillsIndex(timeoutMs?: number, attempts?: number): Promise<SkillsIndex>;
|
|
4310
|
+
export declare function fetchSkillsIndex(timeoutMs?: number, attempts?: number): Promise<SkillsIndex>;
|
|
4287
4311
|
/** Resolve which file to download for a skill: content-addressed object, else legacy fixed key */
|
|
4288
|
-
declare function resolveAssetFileName(entry?: SkillIndexEntry): string;
|
|
4312
|
+
export declare function resolveAssetFileName(entry?: SkillIndexEntry): string;
|
|
4289
4313
|
/** Download the tar.br archive for a single skill (one skill = one GET) */
|
|
4290
|
-
declare function downloadSkillAsset(name: string, entry?: SkillIndexEntry, attempts?: number): Promise<Buffer>;
|
|
4314
|
+
export declare function downloadSkillAsset(name: string, entry?: SkillIndexEntry, attempts?: number): Promise<Buffer>;
|
|
4291
4315
|
//#endregion
|
|
4292
4316
|
//#region src/skills/lock.d.ts
|
|
4293
4317
|
/**
|
|
@@ -4297,23 +4321,23 @@ declare function downloadSkillAsset(name: string, entry?: SkillIndexEntry, attem
|
|
|
4297
4321
|
* caches the remote index — list/update diffs are always "live remote index vs lock".
|
|
4298
4322
|
* Paths follow the config.json directory logic (BAILIAN_CONFIG_DIR can redirect everything).
|
|
4299
4323
|
*/
|
|
4300
|
-
declare function getSkillsDir(): string;
|
|
4301
|
-
declare function getSkillLockPath(): string;
|
|
4302
|
-
declare function emptySkillLock(): SkillLockFile;
|
|
4324
|
+
export declare function getSkillsDir(): string;
|
|
4325
|
+
export declare function getSkillLockPath(): string;
|
|
4326
|
+
export declare function emptySkillLock(): SkillLockFile;
|
|
4303
4327
|
/**
|
|
4304
4328
|
* Read installation records. Returns an empty lock when the file is absent (first install),
|
|
4305
4329
|
* corrupted, or has an unrecognized version — an empty lock is a valid initial state, not an
|
|
4306
4330
|
* error; subsequent install actions will rebuild correct records.
|
|
4307
4331
|
*/
|
|
4308
|
-
declare function readSkillLock(): SkillLockFile;
|
|
4309
|
-
declare function writeSkillLock(lock: SkillLockFile): void;
|
|
4332
|
+
export declare function readSkillLock(): SkillLockFile;
|
|
4333
|
+
export declare function writeSkillLock(lock: SkillLockFile): void;
|
|
4310
4334
|
/**
|
|
4311
4335
|
* Merge-update a single skill's installation record (read-modify-write).
|
|
4312
4336
|
* Shallow-merges with the existing entry: fields not provided in patch (typically links —
|
|
4313
4337
|
* agent fan-out records) are preserved, preventing "install-only, no fan-out" sync channels
|
|
4314
4338
|
* like postinstall/advisor from overwriting link records established by bl skill add.
|
|
4315
4339
|
*/
|
|
4316
|
-
declare function upsertSkillLockEntry(name: string, patch: SkillLockEntry): void;
|
|
4340
|
+
export declare function upsertSkillLockEntry(name: string, patch: SkillLockEntry): void;
|
|
4317
4341
|
//#endregion
|
|
4318
4342
|
//#region src/skills/sanitize.d.ts
|
|
4319
4343
|
/**
|
|
@@ -4325,16 +4349,16 @@ declare function upsertSkillLockEntry(name: string, patch: SkillLockEntry): void
|
|
|
4325
4349
|
* `bl skill` uses this as an "equivalence check": if the sanitized name differs from the original,
|
|
4326
4350
|
* installation is rejected outright (the publisher already has an isomorphic allowlist; this is client-side defense-in-depth).
|
|
4327
4351
|
*/
|
|
4328
|
-
declare function sanitizeSkillName(name: string): string;
|
|
4352
|
+
export declare function sanitizeSkillName(name: string): string;
|
|
4329
4353
|
/** Whether the skill name is already a safe directory name (unchanged after sanitization) */
|
|
4330
|
-
declare function isSafeSkillName(name: string): boolean;
|
|
4354
|
+
export declare function isSafeSkillName(name: string): boolean;
|
|
4331
4355
|
//#endregion
|
|
4332
4356
|
//#region src/skills/names.d.ts
|
|
4333
4357
|
/**
|
|
4334
4358
|
* Parse --name: `all` or a comma-separated list of skill names (deduplicated, trimmed).
|
|
4335
4359
|
* `all` cannot be mixed with specific names.
|
|
4336
4360
|
*/
|
|
4337
|
-
declare function parseSkillNames(raw: string | undefined, defaultAll: boolean): string[] | "all";
|
|
4361
|
+
export declare function parseSkillNames(raw: string | undefined, defaultAll: boolean): string[] | "all";
|
|
4338
4362
|
//#endregion
|
|
4339
4363
|
//#region src/skills/validate.d.ts
|
|
4340
4364
|
/**
|
|
@@ -4349,25 +4373,25 @@ interface SkillMeta {
|
|
|
4349
4373
|
name: string;
|
|
4350
4374
|
description: string;
|
|
4351
4375
|
}
|
|
4352
|
-
declare function validateSkillDir(dir: string, skillName: string): SkillMeta;
|
|
4376
|
+
export declare function validateSkillDir(dir: string, skillName: string): SkillMeta;
|
|
4353
4377
|
//#endregion
|
|
4354
4378
|
//#region src/skills/extract.d.ts
|
|
4355
4379
|
/** tar 条目路径必须是相对路径且不含 ..,防止 tar-slip 逃逸解包目录 */
|
|
4356
|
-
declare function isSafeEntryName(name: string): boolean;
|
|
4380
|
+
export declare function isSafeEntryName(name: string): boolean;
|
|
4357
4381
|
/** Brotli decompress + tar-stream extract into destDir (per-entry path safety check). */
|
|
4358
|
-
declare function extractTarBr(tarBrBuffer: Buffer, destDir: string): Promise<void>;
|
|
4382
|
+
export declare function extractTarBr(tarBrBuffer: Buffer, destDir: string): Promise<void>;
|
|
4359
4383
|
/**
|
|
4360
4384
|
* Recompute the publisher's deterministic content hash over an extracted directory:
|
|
4361
4385
|
* regular files sorted by "/"-separated relative path (code-unit order, same as the
|
|
4362
4386
|
* publisher's byte-order sort for ASCII paths), sha256 accumulating relPath + bytes.
|
|
4363
4387
|
* Symmetric with computeContentHash in FC skills-publish.mjs.
|
|
4364
4388
|
*/
|
|
4365
|
-
declare function computeDirContentHash(dir: string): string;
|
|
4389
|
+
export declare function computeDirContentHash(dir: string): string;
|
|
4366
4390
|
/**
|
|
4367
4391
|
* Atomic swap: replace destDir with the extracted content from tmpDir.
|
|
4368
4392
|
* tmpDir must be on the same volume as destDir (same parent) for renameSync to be atomic.
|
|
4369
4393
|
*/
|
|
4370
|
-
declare function atomicSwap(tmpDir: string, destDir: string): void;
|
|
4394
|
+
export declare function atomicSwap(tmpDir: string, destDir: string): void;
|
|
4371
4395
|
//#endregion
|
|
4372
4396
|
//#region src/skills/agents.d.ts
|
|
4373
4397
|
/**
|
|
@@ -4394,8 +4418,8 @@ interface AgentTarget {
|
|
|
4394
4418
|
* project-only). Shared-dir agents (Cline/Warp/Zed/Kimi/… read ~/.agents/skills; Amp/Replit
|
|
4395
4419
|
* read $XDG_CONFIG_HOME/agents/skills) are folded into the universal pseudo-agents' detectDirs.
|
|
4396
4420
|
*/
|
|
4397
|
-
declare function getAgentTargets(): AgentTarget[];
|
|
4398
|
-
declare function detectInstalledAgents(): AgentTarget[];
|
|
4421
|
+
export declare function getAgentTargets(): AgentTarget[];
|
|
4422
|
+
export declare function detectInstalledAgents(): AgentTarget[];
|
|
4399
4423
|
interface LinkResult {
|
|
4400
4424
|
agent: string;
|
|
4401
4425
|
path: string;
|
|
@@ -4409,7 +4433,7 @@ interface LinkResult {
|
|
|
4409
4433
|
* any other existing files/dirs are always skipped (never delete user content).
|
|
4410
4434
|
* Falls back to copy when symlink fails (e.g. Windows without Developer Mode).
|
|
4411
4435
|
*/
|
|
4412
|
-
declare function linkSkillToAgents(name: string, agents?: AgentTarget[], recordedLinks?: string[]): LinkResult[];
|
|
4436
|
+
export declare function linkSkillToAgents(name: string, agents?: AgentTarget[], recordedLinks?: string[]): LinkResult[];
|
|
4413
4437
|
/**
|
|
4414
4438
|
* Fan-out workflow: link to agents AND compute the next lock ledger in one step.
|
|
4415
4439
|
* Shared by bl skill add/update (fresh install and self-healing) and advisor wiki sync,
|
|
@@ -4431,14 +4455,21 @@ interface FanoutOutcome {
|
|
|
4431
4455
|
* - recorded paths confirmed foreign this run (unmanaged skip) are dropped — the user
|
|
4432
4456
|
* replaced our artifact, and keeping the record would let remove delete user content.
|
|
4433
4457
|
*/
|
|
4434
|
-
declare function fanOutSkillToAgents(name: string, agents?: AgentTarget[], recordedLinks?: string[]): FanoutOutcome;
|
|
4458
|
+
export declare function fanOutSkillToAgents(name: string, agents?: AgentTarget[], recordedLinks?: string[]): FanoutOutcome;
|
|
4459
|
+
/**
|
|
4460
|
+
* Collect paths that unlinkSkillFromAgents would reclaim (read-only).
|
|
4461
|
+
* Same candidate set and eligibility rules as the mutating unlink: managed
|
|
4462
|
+
* symlinks anywhere under the agent registry (including historical links not
|
|
4463
|
+
* in lock), plus recorded copy-fallback directories.
|
|
4464
|
+
*/
|
|
4465
|
+
export declare function planUnlinkSkillFromAgents(name: string, recordedLinks?: string[]): string[];
|
|
4435
4466
|
/**
|
|
4436
4467
|
* Reclaim fan-out artifacts for a skill across all agent dirs.
|
|
4437
4468
|
* Symlinks pointing to canonical are removed (including historical links not in lock,
|
|
4438
4469
|
* via defensive scan of the full registry); real directories are only removed if recorded
|
|
4439
4470
|
* in lock (copy-fallback artifacts). A single failure does not block the rest.
|
|
4440
4471
|
*/
|
|
4441
|
-
declare function unlinkSkillFromAgents(name: string, recordedLinks?: string[]): string[];
|
|
4472
|
+
export declare function unlinkSkillFromAgents(name: string, recordedLinks?: string[]): string[];
|
|
4442
4473
|
//#endregion
|
|
4443
4474
|
//#region src/skills/installer.d.ts
|
|
4444
4475
|
/**
|
|
@@ -4452,17 +4483,17 @@ interface InstalledSkill {
|
|
|
4452
4483
|
meta: SkillMeta;
|
|
4453
4484
|
}
|
|
4454
4485
|
/** Install from an in-memory tar.br archive (the download-and-onwards half of installSkill; test-friendly) */
|
|
4455
|
-
declare function installSkillFromBuffer(name: string, tarBrBuffer: Buffer, expectedContentHash?: string): Promise<InstalledSkill>;
|
|
4486
|
+
export declare function installSkillFromBuffer(name: string, tarBrBuffer: Buffer, expectedContentHash?: string): Promise<InstalledSkill>;
|
|
4456
4487
|
/** Install a single skill by index entry (download + validate + write to disk) */
|
|
4457
|
-
declare function installSkill(name: string, entry: SkillIndexEntry, downloadAttempts?: number): Promise<InstalledSkill>;
|
|
4488
|
+
export declare function installSkill(name: string, entry: SkillIndexEntry, downloadAttempts?: number): Promise<InstalledSkill>;
|
|
4458
4489
|
/** Remove the skill directory under canonical; returns whether it was actually deleted (dir absent → false) */
|
|
4459
|
-
declare function removeSkillDir(name: string): boolean;
|
|
4490
|
+
export declare function removeSkillDir(name: string): boolean;
|
|
4460
4491
|
/**
|
|
4461
4492
|
* Build a skill-lock entry from an index entry + effective fan-out link paths.
|
|
4462
4493
|
* Single source of truth for the "installation fact" shape shared by bl skill add/update,
|
|
4463
4494
|
* advisor wiki sync, and any future install channel.
|
|
4464
4495
|
*/
|
|
4465
|
-
declare function buildSkillLockEntry(entry: SkillIndexEntry, links: string[]): SkillLockEntry;
|
|
4496
|
+
export declare function buildSkillLockEntry(entry: SkillIndexEntry, links: string[]): SkillLockEntry;
|
|
4466
4497
|
interface SkillInstallRecord {
|
|
4467
4498
|
/** Ready-to-persist lock entry (links = effective fan-out paths) */
|
|
4468
4499
|
lockEntry: SkillLockEntry;
|
|
@@ -4478,14 +4509,14 @@ interface SkillInstallRecord {
|
|
|
4478
4509
|
* downloadAttempts = registry fetch attempts (undefined → interactive default; silent
|
|
4479
4510
|
* background channels pass 1 to fail fast instead of stalling the host command).
|
|
4480
4511
|
*/
|
|
4481
|
-
declare function installSkillWithFanout(name: string, entry: SkillIndexEntry, agents?: AgentTarget[], recordedLinks?: string[], downloadAttempts?: number): Promise<SkillInstallRecord>;
|
|
4512
|
+
export declare function installSkillWithFanout(name: string, entry: SkillIndexEntry, agents?: AgentTarget[], recordedLinks?: string[], downloadAttempts?: number): Promise<SkillInstallRecord>;
|
|
4482
4513
|
//#endregion
|
|
4483
4514
|
//#region src/skills/status.d.ts
|
|
4484
4515
|
/**
|
|
4485
4516
|
* Three-way reconciliation for list: remote index (live) × skill-lock.json (installation facts) × disk (ground truth).
|
|
4486
4517
|
*/
|
|
4487
4518
|
/** Scan skill directories under canonical (skipping hidden entries, tmp/backup remnants, and plain files) */
|
|
4488
|
-
declare function listSkillDirsOnDisk(): string[];
|
|
4489
|
-
declare function computeSkillStatuses(index: SkillsIndex, lock: SkillLockFile, diskNames: string[]): SkillStatusRow[];
|
|
4519
|
+
export declare function listSkillDirsOnDisk(): string[];
|
|
4520
|
+
export declare function computeSkillStatuses(index: SkillsIndex, lock: SkillLockFile, diskNames: string[]): SkillStatusRow[];
|
|
4490
4521
|
//#endregion
|
|
4491
|
-
export { API_KEY_CAPABILITY_PATTERN, ASYNC_FLAG, AcsQueryParams, AcsSignConfig, AgentTarget, AigcConfig, AnyCommand, type ApiErrorBody, ApiKeyCredential, ApiKeyLoginKind, ApiKeyResolutionSourceSelection, AppCompletionRequest, AppCompletionResponse, AppStreamChunk, AsrApiKind, AsrApiRoute, AsrContextMessage, AsrFlashFamily, AuthPersistPatch, AuthRequirement, AuthState, AuthStore, BAILIAN_HOST, BILLING_METHOD, BINARY_PRODUCT_CLIENT_NAME, BailianControlAuth, BailianError, BatchSizeGateInput, BatchSizeGateResult, BillingMethod, Budget, Budgets, BuildAsrFlashRequestOpts, CALC_DATASETS_TOKENS_API, CHANNEL, CHARGE_TYPE, COMMAND_PACK_API_VERSION, CONCURRENT_FLAG, CONFIG_FILE_KEYS, CONSOLE_AUTH_FLAGS, CancelFineTuneResponse, Capabilities, Capability, ChargeType, ChatChoice, ChatMessage, ChatMessageContent, ChatRequest, ChatResponse, ChatResponseFormat, ChatTool, Client, ClientOpenApiJsonOpts, ClientOpenApiQueryOpts, ClientRequestOpts, Command, CommandContext, CommandPack, CommandPackApiKeyContext, CommandPackCommand, CommandPackContext, CommandPackCredentials, CommandPackErrorOptions, CommandPackErrors, CommandPackManager, CommandPackMeta, CommandPackMutationResult, CommandPackOutput, CommandPackOutputOptions, CommandPackReport, CommandRisk, CommandRiskLevel, Complexities, Complexity, ConfigFile, ConfigProfiles, ConfigStore, ConnectBailianMcpOptions, ConsoleCall, ConsoleCredential, ConsoleGatewayRequest, ConsoleGatewayTarget, ConsoleSite, ContextNeed, ContextNeeds, CreateDeploymentRequest, CreateDeploymentResponse, CreateFineTuneRequest, CreateFineTuneResponse, CreatePlanFlags, CreateUserReqDTO, CredentialSource, DEFAULT_BILLING_METHOD, DEFAULT_CLI_CDN_BASE, DEFAULT_DEPLOY_PLAN, DEFAULT_INSTALL_PS1_URL, DEFAULT_INSTALL_SCRIPT_URL, DEFAULT_LANGUAGE, DEFAULT_TRAINING_TYPE, DEPLOY_LIST_INDEPENDENT_API, DEPLOY_PLAN, DEPLOY_START_API, DEPLOY_STOP_API, DOCS_HOSTS, DashScopeASRRequest, DashScopeASRTaskResult, DashScopeASRTranscriptionItem, DashScopeAsyncResponse, DashScopeImageRequest, DashScopeImageSyncResponse, DashScopeKnowledgeRetrieveRequest, DashScopeKnowledgeRetrieveResponse, DashScopeTTSRequest, DashScopeTTSResponse, DashScopeTTSStreamChunk, DashScopeTaskResponse, DashScopeVideoEditRequest, DashScopeVideoRefRequest, DashScopeVideoRequest, type DataModality, DatasetDeleteResponse, DatasetFile, DatasetGetResponse, DatasetListParams, DatasetListResponse, DatasetSchema, DatasetUploadParams, DatasetUploadResponse, DeleteDeploymentResponse, DeleteFineTuneResponse, DeployModality, DeployPlan, DeployableModel, DeployableTemplate, Deployment, ESTIMATE_FINETUNE_TOKENS_API, ExitCode, ExportCheckpointResponse, FanoutOutcome, Feature, Features, FetchImplementation, FineTuneCheckpoint, FineTuneHyperParameters, FineTuneJob, FineTuneLogEntry, FlagDef, FlagsDef, GITHUB_RELEASES_BASE, GLOBAL_FLAGS, GetDeploymentResponse, GetFineTuneLogsParams, GetFineTuneLogsResponse, GetFineTuneResponse, GetModelsOptions, HttpDeps, INSUFFICIENT_SAMPLES_CODE, Identity, ImageApiKind, ImageApiRoute, ImageInputStyle, ImageSizeProfile, InstallMethod, InstallMethodIdentity, InstalledSkill, IntentProfile, IntentSegment, KnowledgeChatContentPart, KnowledgeChatMessage, KnowledgeChatRequest, KnowledgeChatStreamChunk, KnowledgeSearchRequest, KnowledgeSearchResponse, Language, LinkResult, ListCheckpointsResponse, ListDeployableModelsParams, ListDeployableModelsResponse, ListDeploymentsParams, ListDeploymentsResponse, ListFineTunesParams, ListFineTunesResponse, LocalizedText, MAX_CPT_BYTES, MAX_DATASET_BYTES, MAX_MEDIA_ZIP_BYTES, MODEL_AUTH_FLAGS, MODEL_LIST_API, McpClient, McpConnectedClient, McpTool, McpToolResult, MemoryAddRequest, MemoryAddResponse, MemoryMessage, MemoryNode, MemoryNodeListResponse, MemoryNodeUpdateRequest, MemorySearchRequest, MemorySearchResponse, Modalities, Modality, ModelCapability, ModelCategories, ModelCategory, ModelGroup, ModelGroupItem, ModelGroupParams, ModelGroupResult, ModelListParams, ModelListResult, ModelOfflineInfo, ModelOfflineNotice, ModelPreference, ModelPrice, ModelPriceInfo, ModelProfile, ModelSampleCodeV2, ModelSampleSnippet, ModelServiceEntry, ModelSource, OPENAPI_AUTH_FLAGS, OPEN_API_SOURCE, OpenApiCredential, OutputFormat, PREDICT_CONFIG_API, ParsedFlags, PipelineResult, PipelineStep, PlanContext, PlanResolved, PlanStrategy, PredictConfigEntry, PreferenceMode, ProfileAttribute, ProfileSchemaCreateRequest, ProfileSchemaCreateResponse, PtuCapacity, QpmLimit, QualityPreference, QualityPreferences, RAG_PATHS, REGIONS, RagAddCategoryData, RagAddCategoryResponse, RagAddConnectorResponse, RagAddFileData, RagAddFileResponse, RagAgentConfig, RagAgentDetail, RagAgentGetData, RagAgentGetResponse, RagAgentListData, RagAgentListResponse, RagAgentMutationData, RagAgentMutationResponse, RagAgentRow, RagBatchUpdateTagResponse, RagCategory, RagChunkListData, RagChunkListResponse, RagChunkNode, RagChunkNodeMetadata, RagConnectorInfo, RagConnectorResponse, RagCreateIndexV2Data, RagCreateIndexV2Response, RagDataCenterFile, RagDeleteFileData, RagDeleteFileResponse, RagDescribeFileResponse, RagGetConnectorResponse, RagIndexFileRow, RagIndexFilesData, RagIndexFilesResponse, RagIndexJobDoc, RagIndexJobStatusData, RagIndexJobStatusResponse, RagIndexListData, RagIndexListResponse, RagIndexRow, RagJobCreateData, RagJobCreateResponse, RagListCategoryData, RagListCategoryResponse, RagListFileData, RagListFileResponse, RagMonitorData, RagMonitorResponse, RagMutationResponse, RagOssImportData, RagOssImportFileResult, RagOssImportResponse, RagQpsMonitorData, RagResponse, RagStorageMonitorData, RagUploadLeaseData, RagUploadLeaseParam, RagUploadLeaseResponse, RecommendOptions, RecommendResult, RecommendedModel, Region, RequestOpts, ResolutionSources, ResponsesOutputContent, ResponsesOutputItem, ResponsesRequest, ResponsesResponse, ResponsesStreamEvent, SANDBOX_PATHS, SEMANTIC_TOP_K, SPEECH_BIASING_MODEL, STRATEGIES, SUPPORTED_LANGUAGES, ScaleDeploymentRequest, ScaleDeploymentResponse, ScoredCandidate, SecurityAlert, SecurityAlertList, SecurityOverview, SecurityRiskLevel, SecurityScanStat, SecurityToggle, ServerSentEvent, Settings, SingleResult, SkillIndexEntry, SkillInstallRecord, SkillLockEntry, SkillLockFile, SkillMeta, SkillStatus, SkillStatusRow, SkillsIndex, SourceFlags, StreamChoice, StreamChunk, TRAINING_MODEL_PRICE_API, TRAINING_TYPES_CLI, TRAINING_TYPE_MAP, TokenEstimate, TrackingEvent, TrackingIdentity, TrainingModelPrice, type TrainingProfile, TrainingTypeCli, UpdateDeploymentRequest, UpdateDeploymentResponse, UsageError, UserProfileResponse, ValidateOpts, ValidationIssue, ValidationResult, ValidationSeverity, ValidationStats, ValidatorSpec, VocabularyEntry, VocabularyEnvelope, VocabularyListItem, VocabularyRequest, activateConfigProfile, agentStudioFilesPath, agentStudioHost, analyzeIntent, anonymousConsoleCall, appCompletionPath, atomicSwap, bailianMcpPath, bailianMcpSsePath, binaryAssetFileName, binaryInnerFileName, binaryTarFileName, buildAcsCanonicalQuery, buildAsrContextMessages, buildAsrFlashRequest, buildAsyncAsrLanguageFields, buildDocLink, buildSettings, buildSkillLockEntry, buildSources, buildVocabularyRequest, callConsoleGateway, cancelFineTune, channelManifestUrl, chatPath, collectAsrTranscriptionItems, computeDirContentHash, computeSkillStatuses, connectBailianMcpWithFallback, createBailianControlUser, createDeployment, createFineTune, createInstrumentedFetch, createTrackingEvent, createVocabulary, credentialFlagDefs, defaultDeployPlan, defineCommand, deleteConfigProfile, deleteDataset, deleteDeployment, deleteFineTune, deleteVocabulary, describeAuthState, detectBinaryPlatform, detectInstallMethod, detectInstalledAgents, detectModality, detectOutputFormat, downloadSkillAsset, effectiveConsoleGatewayConfig, emptySkillLock, ensureConfigDir, estimateCptTokens, estimateSftDpoTokens, exportCheckpoint, extractAsrFlashText, extractTarBr, extractZipEntryToFile, fanOutSkillToAgents, fetchModelCapability, fetchModelDetail, fetchModelGroups, fetchModelGroupsAll, fetchModelList, fetchModelListAll, fetchPredictConfig, fetchSkillsIndex, fetchTrainingModelPrice, findDeploymentEntry, findModelByName, flattenModelGroups, flushTelemetry, formatErrorJson, formatIssue, formatJson, formatOutput, formatText, generateCLIAccessToken, generateFilename, getAgentTargets, getApiKeyLoginKind, getCliCdnBase, getConfigDir, getConfigPath, getCredentialsPath, getDataset, getDeployment, getFineTune, getFineTuneLogs, getInstallMethod, getModelProfilePreset, getModels, getProfile, getSkillLockPath, getSkillRegistryBaseUrl, getSkillsDir, getUpdateInstallMethod, image2ImagePath, image2videoPath, imageFileToDataUri, imagePath, imageSyncPath, imageText2ImagePath, inferAudioFormatHint, installSkill, installSkillFromBuffer, installSkillWithFanout, isApiKeyCapability, isCompiledBinary, isDashScopeGateway, isLegacyImage2ImageModel, isLegacyText2ImageModel, isLocalFile, isSafeEntryName, isSafeSkillName, isSemanticAvailable, isStreamableHttpUnsupported, isSyncMultimodalImageModel, isTrainingTypeCli, isUrlOverrideSseFallbackCandidate, isWanxFunctionImageEditModel, knowledgeChatEndpoint, knowledgeRetrievePath, knowledgeSearchEndpoint, linkSkillToAgents, listBailianControlWorkspaces, listCheckpoints, listDatasets, listDeployableModels, listDeployments, listFineTunes, listIndependentDeployedModels, listSkillDirsOnDisk, listSupportedFormats, listSupportedTrainingTypes, listTrainingTypes, listVocabularies, localSink, makeAuthStore, makeConfigStore, mapApiError, maskToken, maybeSyncWikiData, mcpWebSearchPath, memoryAddPath, memoryListPath, memoryNodePath, memorySearchPath, modelSupportsTrainingType, modelsLimitsPath, modelsPermissionsPath, normalizeApiKeyCapabilities, normalizeConfigName, normalizeModelBaseUrl, parseBooleanValue, parseConfigFile, parseDatasetSchemaFlag, parseInstantVocabulary, parseOptionalBooleanValue, parseSSE, parseSecurityBody, parseSkillNames, parseVocabularyEntries, pickPlanStrategy, pickValidator, preflightBatchSizeGate, profileSchemaPath, queryVocabulary, ragEndpoint, rankModels, readConfigFile, readConfigProfiles, readSkillLock, readTextFromPathOrStdin, recallCandidates, recallSemantic, redactDataUri, refreshAccessToken, registerValidator, releaseAssetUrl, remoteSink, removeSkillDir, request, requestJson, resetBailianControlPolicies4Agent, resolveApiKey, resolveAsrApi, resolveAssetFileName, resolveBooleanFlag, resolveConsole, resolveFileUrl, resolveImageEditApi, resolveImageGenerateApi, resolveImageSizeProfile, resolveModelBaseUrl, resolveModelBaseUrlState, resolveOpenApi, resolveOutputDir, resolvePromptExtendDefault, resolveWatermark, responsesPath, runWithConcurrency, sandboxApiPath, sandboxBaseUrl, sandboxEndpoint, sandboxInstanceActionPath, sandboxInstancePath, sandboxTemplateBuildStatusPath, sandboxTemplatePath, sanitizeSkillName, scaleDeployment, securityAgentLogsEndpoint, securityGet, securityOverviewEndpoint, selectApiKeyResolutionSources, signAcsRequest, sourceConfig, speechRecognizePath, speechSynthesizePath, speechVocabularyPath, startModelService, stopModelService, stripUndefined, taskPath, trackCommandExecution, trackingHeaders, trainingTypeMethodVariant, unlinkSkillFromAgents, unwrapResponse, updateDeployment, updateVocabulary, uploadDataset, uploadFile, upsertSkillLockEntry, userProfilePath, validateConfigProfileActivation, validateDataset, validateSkillDir, videoGeneratePath, writeConfigFile, writeInstallMethodSync, writeSkillLock };
|
|
4522
|
+
export type { AcsQueryParams, AcsSignConfig, AgentTarget, AnyCommand, ApiErrorBody, ApiKeyCredential, ApiKeyLoginKind, ApiKeyResolutionSourceSelection, AppCompletionRequest, AppCompletionResponse, AppStreamChunk, AsrApiKind, AsrApiRoute, AsrContextMessage, AsrFlashFamily, AuthPersistPatch, AuthRequirement, AuthState, AuthStore, BailianControlAuth, Budget, BuildAsrFlashRequestOpts, Capability, ChatChoice, ChatMessage, ChatMessageContent, ChatRequest, ChatResponse, ChatResponseFormat, ChatTool, ClientOpenApiJsonOpts, ClientOpenApiQueryOpts, ClientRequestOpts, Command, CommandContext, CommandPack, CommandPackApiKeyContext, CommandPackCommand, CommandPackContext, CommandPackCredentials, CommandPackErrorOptions, CommandPackErrors, CommandPackManager, CommandPackMeta, CommandPackMutationResult, CommandPackOutput, CommandPackOutputOptions, CommandPackReport, CommandRisk, CommandRiskLevel, Complexity, ConfigFile, ConfigProfiles, ConfigStore, ConnectBailianMcpOptions, ConsoleCall, ConsoleCredential, ConsoleGatewayRequest, ConsoleGatewayTarget, ConsoleSite, ContextNeed, CreateUserReqDTO, CredentialSource, DashScopeASRRequest, DashScopeASRTaskResult, DashScopeASRTranscriptionItem, DashScopeAsyncResponse, DashScopeImageRequest, DashScopeImageSyncResponse, DashScopeKnowledgeRetrieveRequest, DashScopeKnowledgeRetrieveResponse, DashScopeTTSRequest, DashScopeTTSResponse, DashScopeTTSStreamChunk, DashScopeTaskResponse, DashScopeVideoEditRequest, DashScopeVideoRefRequest, DashScopeVideoRequest, DataModality, DatasetSchema, FanoutOutcome, Feature, FetchImplementation, FlagDef, FlagsDef, GetModelsOptions, HttpDeps, Identity, ImageApiKind, ImageApiRoute, ImageInputStyle, ImageSizeProfile, InstallMethod, InstallMethodIdentity, InstalledSkill, IntentProfile, IntentSegment, KnowledgeChatContentPart, KnowledgeChatMessage, KnowledgeChatRequest, KnowledgeChatStreamChunk, KnowledgeSearchRequest, KnowledgeSearchResponse, Language, LinkResult, LocalizedText, McpConnectedClient, McpTool, McpToolResult, MemoryAddRequest, MemoryAddResponse, MemoryMessage, MemoryNode, MemoryNodeListResponse, MemoryNodeUpdateRequest, MemorySearchRequest, MemorySearchResponse, Modality, ModelCategory, ModelGroup, ModelGroupItem, ModelGroupParams, ModelGroupResult, ModelListParams, ModelListResult, ModelOfflineInfo, ModelOfflineNotice, ModelPreference, ModelPrice, ModelPriceInfo, ModelProfile, ModelSampleCodeV2, ModelSampleSnippet, ModelSource, OpenApiCredential, OutputFormat, ParsedFlags, PipelineResult, PipelineStep, PredictConfigEntry, PreferenceMode, ProfileAttribute, ProfileSchemaCreateRequest, ProfileSchemaCreateResponse, QpmLimit, QualityPreference, RagAddCategoryData, RagAddCategoryResponse, RagAddConnectorResponse, RagAddFileData, RagAddFileResponse, RagAgentConfig, RagAgentDetail, RagAgentGetData, RagAgentGetResponse, RagAgentListData, RagAgentListResponse, RagAgentMutationData, RagAgentMutationResponse, RagAgentRow, RagBatchUpdateTagResponse, RagCategory, RagChunkListData, RagChunkListResponse, RagChunkNode, RagChunkNodeMetadata, RagConnectorInfo, RagConnectorResponse, RagCreateIndexV2Data, RagCreateIndexV2Response, RagDataCenterFile, RagDeleteFileData, RagDeleteFileResponse, RagDescribeFileResponse, RagGetConnectorResponse, RagIndexFileRow, RagIndexFilesData, RagIndexFilesResponse, RagIndexJobDoc, RagIndexJobStatusData, RagIndexJobStatusResponse, RagIndexListData, RagIndexListResponse, RagIndexRow, RagJobCreateData, RagJobCreateResponse, RagListCategoryData, RagListCategoryResponse, RagListFileData, RagListFileResponse, RagMonitorData, RagMonitorResponse, RagMutationResponse, RagOssImportData, RagOssImportFileResult, RagOssImportResponse, RagQpsMonitorData, RagResponse, RagStorageMonitorData, RagUploadLeaseData, RagUploadLeaseParam, RagUploadLeaseResponse, RecommendOptions, RecommendResult, RecommendedModel, Region, RequestOpts, ResolutionSources, ResponsesOutputContent, ResponsesOutputItem, ResponsesRequest, ResponsesResponse, ResponsesStreamEvent, ScoredCandidate, SecurityAlert, SecurityAlertList, SecurityOverview, SecurityRiskLevel, SecurityScanStat, SecurityToggle, ServerSentEvent, Settings, SingleResult, SkillIndexEntry, SkillInstallRecord, SkillLockEntry, SkillLockFile, SkillMeta, SkillStatus, SkillStatusRow, SkillsIndex, SourceFlags, StreamChoice, StreamChunk, TrackingEvent, TrackingIdentity, TrainingProfile, UserProfileResponse, ValidateOpts, ValidationIssue, ValidationResult, ValidationSeverity, ValidationStats, ValidatorSpec, VocabularyEntry, VocabularyEnvelope, VocabularyListItem, VocabularyRequest };
|