bailian-cli-core 1.28.0 → 2.0.1
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 +644 -408
- package/dist/index.mjs +31 -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,83 @@ 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
|
|
1885
|
-
declare function
|
|
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 workspaceMaaSBaseUrl(workspaceId: string): string;
|
|
1904
|
+
export declare function knowledgeSearchEndpoint(workspaceId: string): string;
|
|
1905
|
+
export declare function knowledgeChatEndpoint(workspaceId: string): string;
|
|
1886
1906
|
/** Per-workspace AgentStudio host (same shape as {@link ragEndpoint}'s host). */
|
|
1887
|
-
declare function agentStudioHost(workspaceId: string): string;
|
|
1907
|
+
export declare function agentStudioHost(workspaceId: string): string;
|
|
1888
1908
|
/** GET protection overview — fixed to the last 24 hours, no request params. */
|
|
1889
|
-
declare function securityOverviewEndpoint(host: string): string;
|
|
1909
|
+
export declare function securityOverviewEndpoint(host: string): string;
|
|
1890
1910
|
/** 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
|
-
|
|
1911
|
+
export declare function securityAgentLogsEndpoint(host: string): string;
|
|
1912
|
+
export declare function mcpWebSearchPath(): string;
|
|
1913
|
+
/** GET /api/v1/deployments/{deployed_model}/capacity-instances */
|
|
1914
|
+
export declare function deploymentCapacityInstancesPath(code: string): string;
|
|
1915
|
+
/** GET /api/v1/deployments/{deployed_model}/capacity-instances/{instance_id} */
|
|
1916
|
+
export declare function deploymentCapacityInstancePath(code: string, id: string): string;
|
|
1917
|
+
/** PUT /api/v1/deployments/{deployed_model}/capacity-instances/{instance_id}/scale */
|
|
1918
|
+
export declare function deploymentCapacityInstanceScalePath(code: string, id: string): string;
|
|
1919
|
+
/** PUT /api/v1/deployments/{deployed_model}/capacity-instances/{instance_id}/renew */
|
|
1920
|
+
export declare function deploymentCapacityInstanceRenewPath(code: string, id: string): string;
|
|
1921
|
+
/** PUT /api/v1/deployments/{deployed_model}/update-overflowstrategy */
|
|
1922
|
+
export declare function deploymentOverflowPath(code: string): string;
|
|
1923
|
+
/** GET /api/v1/deployments/{deployed_model}/capacity-operations/{operation_id} */
|
|
1924
|
+
export declare function deploymentCapacityOperationPath(code: string, id: string): string;
|
|
1925
|
+
export declare function ragEndpoint(workspaceId: string, path: string): string;
|
|
1894
1926
|
/** AgentStudio workspace files; template uploads send source=sandbox_template. */
|
|
1895
|
-
declare function agentStudioFilesPath(): string;
|
|
1927
|
+
export declare function agentStudioFilesPath(): string;
|
|
1896
1928
|
/** Default Sandbox origin when no shared base URL was configured (cn-beijing only). */
|
|
1897
|
-
declare function sandboxBaseUrl(workspaceId: string): string;
|
|
1929
|
+
export declare function sandboxBaseUrl(workspaceId: string): string;
|
|
1898
1930
|
/** Sandbox service prefix, appended to the selected origin just like AgentStudio SDK paths. */
|
|
1899
|
-
declare function sandboxApiPath(path: string): string;
|
|
1931
|
+
export declare function sandboxApiPath(path: string): string;
|
|
1900
1932
|
/** Build the default workspace-scoped absolute Sandbox control-plane URL. */
|
|
1901
|
-
declare function sandboxEndpoint(workspaceId: string, path: string): string;
|
|
1902
|
-
declare const SANDBOX_PATHS: {
|
|
1933
|
+
export declare function sandboxEndpoint(workspaceId: string, path: string): string;
|
|
1934
|
+
export declare const SANDBOX_PATHS: {
|
|
1903
1935
|
readonly sandboxes: "/sandboxes";
|
|
1904
1936
|
readonly sandboxList: "/v2/sandboxes";
|
|
1905
1937
|
readonly templates: "/templates";
|
|
1906
1938
|
readonly templateCreate: "/v3/templates";
|
|
1907
1939
|
readonly templateList: "/v2/templates";
|
|
1908
1940
|
};
|
|
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: {
|
|
1941
|
+
export declare function sandboxInstancePath(sandboxId: string): string;
|
|
1942
|
+
export declare function sandboxInstanceActionPath(sandboxId: string, action: "connect" | "pause" | "resume"): string;
|
|
1943
|
+
export declare function sandboxTemplatePath(templateId: string): string;
|
|
1944
|
+
export declare function sandboxTemplateBuildStatusPath(templateId: string, buildId: string): string;
|
|
1945
|
+
export declare const RAG_PATHS: {
|
|
1914
1946
|
readonly indexList: "/api/v1/indices/rag/index/list";
|
|
1915
1947
|
readonly indexCreateV2: "/api/v1/indices/rag/index/create_v2";
|
|
1916
1948
|
readonly indexUpdate: "/api/v1/indices/rag/index/update";
|
|
@@ -1982,18 +2014,18 @@ interface ImageApiRoute {
|
|
|
1982
2014
|
promptExtendDefault?: boolean;
|
|
1983
2015
|
}
|
|
1984
2016
|
/** True when the model family can use sync multimodal for generate. */
|
|
1985
|
-
declare function isSyncMultimodalImageModel(model: string): boolean;
|
|
2017
|
+
export declare function isSyncMultimodalImageModel(model: string): boolean;
|
|
1986
2018
|
/** wan2.5 / wan2.2 / wan2.1 / wanx text-to-image models use the legacy prompt API. */
|
|
1987
|
-
declare function isLegacyText2ImageModel(model: string): boolean;
|
|
2019
|
+
export declare function isLegacyText2ImageModel(model: string): boolean;
|
|
1988
2020
|
/** wan2.5-i2i uses the legacy image2image prompt+images API. */
|
|
1989
|
-
declare function isLegacyImage2ImageModel(model: string): boolean;
|
|
2021
|
+
export declare function isLegacyImage2ImageModel(model: string): boolean;
|
|
1990
2022
|
/** wanx*-imageedit uses function + base_image_url (not prompt+images). */
|
|
1991
|
-
declare function isWanxFunctionImageEditModel(model: string): boolean;
|
|
1992
|
-
declare function resolveImageSizeProfile(model: string): ImageSizeProfile;
|
|
2023
|
+
export declare function isWanxFunctionImageEditModel(model: string): boolean;
|
|
2024
|
+
export declare function resolveImageSizeProfile(model: string): ImageSizeProfile;
|
|
1993
2025
|
/** 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;
|
|
2026
|
+
export declare function resolvePromptExtendDefault(model: string): boolean | undefined;
|
|
2027
|
+
export declare function resolveImageGenerateApi(model: string): ImageApiRoute;
|
|
2028
|
+
export declare function resolveImageEditApi(model: string): ImageApiRoute;
|
|
1997
2029
|
//#endregion
|
|
1998
2030
|
//#region src/client/asr-routes.d.ts
|
|
1999
2031
|
/**
|
|
@@ -2040,9 +2072,9 @@ interface AsrApiRoute {
|
|
|
2040
2072
|
* Resolve which DashScope ASR API a model should use for file recognition.
|
|
2041
2073
|
* Unknown models default to async-filetrans (preserves existing CLI behavior).
|
|
2042
2074
|
*/
|
|
2043
|
-
declare function resolveAsrApi(model: string): AsrApiRoute;
|
|
2075
|
+
export declare function resolveAsrApi(model: string): AsrApiRoute;
|
|
2044
2076
|
/** Infer audio container hint for input-audio Flash `parameters.format`. */
|
|
2045
|
-
declare function inferAudioFormatHint(audioUrl: string): string;
|
|
2077
|
+
export declare function inferAudioFormatHint(audioUrl: string): string;
|
|
2046
2078
|
interface BuildAsrFlashRequestOpts {
|
|
2047
2079
|
model: string;
|
|
2048
2080
|
audioUrl: string;
|
|
@@ -2056,29 +2088,29 @@ interface BuildAsrFlashRequestOpts {
|
|
|
2056
2088
|
flashFamily: AsrFlashFamily;
|
|
2057
2089
|
}
|
|
2058
2090
|
/** Wrap plain text as a single user context message for ASR. */
|
|
2059
|
-
declare function buildAsrContextMessages(text: string): AsrContextMessage[];
|
|
2091
|
+
export declare function buildAsrContextMessages(text: string): AsrContextMessage[];
|
|
2060
2092
|
/**
|
|
2061
2093
|
* Build language fields for async ASR routes.
|
|
2062
2094
|
* qwen3-asr-flash-filetrans* → `language`; other async models → `language_hints`.
|
|
2063
2095
|
*/
|
|
2064
|
-
declare function buildAsyncAsrLanguageFields(languageStyle: "language_hints" | "language", language?: string): {
|
|
2096
|
+
export declare function buildAsyncAsrLanguageFields(languageStyle: "language_hints" | "language", language?: string): {
|
|
2065
2097
|
language_hints?: string[];
|
|
2066
2098
|
language?: string;
|
|
2067
2099
|
};
|
|
2068
2100
|
/** Build a sync multimodal ASR request body for Flash models. */
|
|
2069
|
-
declare function buildAsrFlashRequest(opts: BuildAsrFlashRequestOpts): Record<string, unknown>;
|
|
2101
|
+
export declare function buildAsrFlashRequest(opts: BuildAsrFlashRequestOpts): Record<string, unknown>;
|
|
2070
2102
|
/**
|
|
2071
2103
|
* Extract recognition text from a sync Flash ASR response.
|
|
2072
2104
|
* Qwen3 uses choices[].message.content; input-audio Flash uses output.text /
|
|
2073
2105
|
* output.sentence.text / output.output.sentence.text.
|
|
2074
2106
|
*/
|
|
2075
|
-
declare function extractAsrFlashText(response: Record<string, unknown>, flashFamily: AsrFlashFamily): string;
|
|
2107
|
+
export declare function extractAsrFlashText(response: Record<string, unknown>, flashFamily: AsrFlashFamily): string;
|
|
2076
2108
|
/**
|
|
2077
2109
|
* Normalize async ASR task transcription items:
|
|
2078
2110
|
* - classic models: `output.results[]`
|
|
2079
2111
|
* - qwen3-asr-flash-filetrans*: `output.result.transcription_url`
|
|
2080
2112
|
*/
|
|
2081
|
-
declare function collectAsrTranscriptionItems(output: {
|
|
2113
|
+
export declare function collectAsrTranscriptionItems(output: {
|
|
2082
2114
|
results?: Array<{
|
|
2083
2115
|
file_url?: string;
|
|
2084
2116
|
transcription_url?: string;
|
|
@@ -2098,13 +2130,15 @@ declare function collectAsrTranscriptionItems(output: {
|
|
|
2098
2130
|
}>;
|
|
2099
2131
|
//#endregion
|
|
2100
2132
|
//#region src/client/headers.d.ts
|
|
2101
|
-
declare const CHANNEL = "bailian-cli";
|
|
2133
|
+
export declare const CHANNEL = "bailian-cli";
|
|
2102
2134
|
/** Static source identifier advertised to the DashScope/Bailian OpenAPI gateway. */
|
|
2103
|
-
declare const OPEN_API_SOURCE = "BailianCLI";
|
|
2135
|
+
export declare const OPEN_API_SOURCE = "BailianCLI";
|
|
2136
|
+
/** Marketplace / service attribution header (HTTP names are case-insensitive). */
|
|
2137
|
+
export declare const DASHSCOPE_SERVICE_HEADER = "X-Dashscope-Service";
|
|
2104
2138
|
type TrackingIdentity = Pick<Identity, "binName" | "version">;
|
|
2105
|
-
declare function sourceConfig(identity: TrackingIdentity): string;
|
|
2139
|
+
export declare function sourceConfig(identity: TrackingIdentity): string;
|
|
2106
2140
|
/** Tracking headers for Bailian/DashScope API requests. */
|
|
2107
|
-
declare function trackingHeaders(identity: TrackingIdentity): Record<string, string>;
|
|
2141
|
+
export declare function trackingHeaders(identity: TrackingIdentity): Record<string, string>;
|
|
2108
2142
|
//#endregion
|
|
2109
2143
|
//#region src/client/security.d.ts
|
|
2110
2144
|
/**
|
|
@@ -2113,7 +2147,7 @@ declare function trackingHeaders(identity: TrackingIdentity): Record<string, str
|
|
|
2113
2147
|
* the DashScope gateway is the default and is ignored; any other origin
|
|
2114
2148
|
* (pre-release / private / mock) is treated as an explicit host override.
|
|
2115
2149
|
*/
|
|
2116
|
-
declare function isDashScopeGateway(origin: string): boolean;
|
|
2150
|
+
export declare function isDashScopeGateway(origin: string): boolean;
|
|
2117
2151
|
/**
|
|
2118
2152
|
* Parse an Agent Security Center response body and return the business payload.
|
|
2119
2153
|
*
|
|
@@ -2130,7 +2164,7 @@ declare function isDashScopeGateway(origin: string): boolean;
|
|
|
2130
2164
|
* that has not migrated keeps working. A failed or unrecognized shape throws
|
|
2131
2165
|
* with the raw body attached (surfaced by --output json) for diagnosis.
|
|
2132
2166
|
*/
|
|
2133
|
-
declare function parseSecurityBody<T>(raw: string, contentType?: string | null): T | null;
|
|
2167
|
+
export declare function parseSecurityBody<T>(raw: string, contentType?: string | null): T | null;
|
|
2134
2168
|
/**
|
|
2135
2169
|
* GET a Security Center endpoint and unwrap its envelope.
|
|
2136
2170
|
*
|
|
@@ -2140,7 +2174,7 @@ declare function parseSecurityBody<T>(raw: string, contentType?: string | null):
|
|
|
2140
2174
|
* through the Client transport; only HTTP 200 bodies reach parseSecurityBody.
|
|
2141
2175
|
* Returns null when the server reports success with no payload.
|
|
2142
2176
|
*/
|
|
2143
|
-
declare function securityGet<T>(client: Client, url: string): Promise<T | null>;
|
|
2177
|
+
export declare function securityGet<T>(client: Client, url: string): Promise<T | null>;
|
|
2144
2178
|
//#endregion
|
|
2145
2179
|
//#region src/client/instrumented-fetch.d.ts
|
|
2146
2180
|
/**
|
|
@@ -2156,7 +2190,7 @@ type FetchImplementation = (input: string | URL | Request, init?: RequestInit) =
|
|
|
2156
2190
|
* error mapping, so the caller's response semantics (status handling, SSE,
|
|
2157
2191
|
* conflict detection) stay intact.
|
|
2158
2192
|
*/
|
|
2159
|
-
declare function createInstrumentedFetch(deps: HttpDeps): FetchImplementation;
|
|
2193
|
+
export declare function createInstrumentedFetch(deps: HttpDeps): FetchImplementation;
|
|
2160
2194
|
//#endregion
|
|
2161
2195
|
//#region src/client/bailian-control.d.ts
|
|
2162
2196
|
/** Shared inputs for every BailianControl OpenAPI call (AK/SK passed explicitly). */
|
|
@@ -2179,16 +2213,16 @@ interface CreateUserReqDTO {
|
|
|
2179
2213
|
* signed with Alibaba Cloud AK/SK. Mirrors {@link generateCLIAccessToken}: the
|
|
2180
2214
|
* caller passes AK/SK explicitly, so this needs no stored credential.
|
|
2181
2215
|
*/
|
|
2182
|
-
declare function createBailianControlUser(opts: BailianControlAuth & {
|
|
2216
|
+
export declare function createBailianControlUser(opts: BailianControlAuth & {
|
|
2183
2217
|
reqDTO: CreateUserReqDTO;
|
|
2184
2218
|
}): Promise<OpenApiResponse>;
|
|
2185
2219
|
/** List workspaces (used to resolve the agent id for permission changes). */
|
|
2186
|
-
declare function listBailianControlWorkspaces(opts: BailianControlAuth): Promise<OpenApiResponse>;
|
|
2220
|
+
export declare function listBailianControlWorkspaces(opts: BailianControlAuth): Promise<OpenApiResponse>;
|
|
2187
2221
|
/**
|
|
2188
2222
|
* Authorize a user's servicer permissions via `ResetPolicies4Agent`. The single
|
|
2189
2223
|
* `data` param carries the console payload re-encoded as a JSON string.
|
|
2190
2224
|
*/
|
|
2191
|
-
declare function resetBailianControlPolicies4Agent(opts: BailianControlAuth & {
|
|
2225
|
+
export declare function resetBailianControlPolicies4Agent(opts: BailianControlAuth & {
|
|
2192
2226
|
outerKey: string;
|
|
2193
2227
|
agentId: number;
|
|
2194
2228
|
policyIndexList?: number[];
|
|
@@ -2200,7 +2234,7 @@ interface ServerSentEvent {
|
|
|
2200
2234
|
data: string;
|
|
2201
2235
|
id?: string;
|
|
2202
2236
|
}
|
|
2203
|
-
declare function parseSSE(response: Response): AsyncGenerator<ServerSentEvent>;
|
|
2237
|
+
export declare function parseSSE(response: Response): AsyncGenerator<ServerSentEvent>;
|
|
2204
2238
|
//#endregion
|
|
2205
2239
|
//#region src/console/gateway.d.ts
|
|
2206
2240
|
type ConsoleSite = "domestic" | "international";
|
|
@@ -2208,7 +2242,7 @@ type ConsoleSite = "domestic" | "international";
|
|
|
2208
2242
|
* Resolved console gateway settings (same defaults as {@link callConsoleGateway}).
|
|
2209
2243
|
* 参数只需 settings 的 console 三元组;dry-run 展示分支直接传 settings。
|
|
2210
2244
|
*/
|
|
2211
|
-
declare function effectiveConsoleGatewayConfig(config: Pick<Settings, "consoleRegion" | "consoleSite" | "consoleSwitchAgent">): {
|
|
2245
|
+
export declare function effectiveConsoleGatewayConfig(config: Pick<Settings, "consoleRegion" | "consoleSite" | "consoleSwitchAgent">): {
|
|
2212
2246
|
consoleRegion: string;
|
|
2213
2247
|
consoleSite: ConsoleSite;
|
|
2214
2248
|
consoleSwitchAgent?: number;
|
|
@@ -2224,7 +2258,7 @@ type ConsoleCall = (api: string, data: Record<string, unknown>) => Promise<unkno
|
|
|
2224
2258
|
* Build an anonymous (token-less) gateway caller for public catalog APIs such
|
|
2225
2259
|
* as `listFoundationModels` — no console login required.
|
|
2226
2260
|
*/
|
|
2227
|
-
declare function anonymousConsoleCall(config: Pick<Settings, "consoleRegion" | "consoleSite" | "consoleSwitchAgent" | "timeout">): ConsoleCall;
|
|
2261
|
+
export declare function anonymousConsoleCall(config: Pick<Settings, "consoleRegion" | "consoleSite" | "consoleSwitchAgent" | "timeout">): ConsoleCall;
|
|
2228
2262
|
/**
|
|
2229
2263
|
* Invoke a Bailian **console** OpenAPI via the CLI gateway (`/cli/api.json`).
|
|
2230
2264
|
* 目标(region/site/switchAgent)与 token 均由调用方解析后传入:Client.console 传
|
|
@@ -2236,16 +2270,13 @@ interface ConsoleGatewayTarget {
|
|
|
2236
2270
|
switchAgent?: number;
|
|
2237
2271
|
token?: string;
|
|
2238
2272
|
}
|
|
2239
|
-
declare function callConsoleGateway(target: ConsoleGatewayTarget, timeoutSec: number, {
|
|
2240
|
-
api,
|
|
2241
|
-
data
|
|
2242
|
-
}: ConsoleGatewayRequest, settings?: Pick<Settings, "verbose">): Promise<unknown>;
|
|
2273
|
+
export declare function callConsoleGateway(target: ConsoleGatewayTarget, timeoutSec: number, { api, data }: ConsoleGatewayRequest, settings?: Pick<Settings, "verbose">): Promise<unknown>;
|
|
2243
2274
|
//#endregion
|
|
2244
2275
|
//#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";
|
|
2276
|
+
export declare const MODEL_LIST_API = "zeldaHttp.dashscopeModel./zelda/api/v1/modelCenter/listFoundationModels";
|
|
2277
|
+
export declare const PREDICT_CONFIG_API = "zeldaEasy.bmp.modelPredictRpcService.getPredictParamConfig";
|
|
2247
2278
|
/** Unwrap the DataV2 double-envelope that console gateway returns. */
|
|
2248
|
-
declare function unwrapResponse(result: Record<string, unknown>): Record<string, unknown>;
|
|
2279
|
+
export declare function unwrapResponse(result: Record<string, unknown>): Record<string, unknown>;
|
|
2249
2280
|
interface ModelListParams {
|
|
2250
2281
|
pageNo?: number;
|
|
2251
2282
|
pageSize?: number;
|
|
@@ -2258,15 +2289,15 @@ interface ModelListResult {
|
|
|
2258
2289
|
models: Record<string, unknown>[];
|
|
2259
2290
|
}
|
|
2260
2291
|
/** 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>;
|
|
2292
|
+
export declare function fetchModelList(call: ConsoleCall, params?: ModelListParams): Promise<ModelListResult>;
|
|
2262
2293
|
/** 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>[]>;
|
|
2294
|
+
export declare function fetchModelListAll(call: ConsoleCall, params?: Omit<ModelListParams, "pageNo">): Promise<Record<string, unknown>[]>;
|
|
2264
2295
|
/**
|
|
2265
2296
|
* Look up a single model by exact id. The server's `name` filter is a
|
|
2266
2297
|
* substring match, so an exact `model` equality check narrows the result
|
|
2267
2298
|
* (e.g. avoids `qwen3-8b` matching `qwen3-8b-v2`).
|
|
2268
2299
|
*/
|
|
2269
|
-
declare function findModelByName(call: ConsoleCall, modelName: string): Promise<Record<string, unknown> | null>;
|
|
2300
|
+
export declare function findModelByName(call: ConsoleCall, modelName: string): Promise<Record<string, unknown> | null>;
|
|
2270
2301
|
interface ModelPriceInfo {
|
|
2271
2302
|
type?: string;
|
|
2272
2303
|
priceUnit?: string;
|
|
@@ -2340,16 +2371,16 @@ interface ModelGroupResult {
|
|
|
2340
2371
|
groups: ModelGroup[];
|
|
2341
2372
|
}
|
|
2342
2373
|
/** Fetch model families with optional filters and query flags. */
|
|
2343
|
-
declare function fetchModelGroups(call: ConsoleCall, params?: ModelGroupParams): Promise<ModelGroupResult>;
|
|
2374
|
+
export declare function fetchModelGroups(call: ConsoleCall, params?: ModelGroupParams): Promise<ModelGroupResult>;
|
|
2344
2375
|
/** Flatten family groups into their individual model items. */
|
|
2345
|
-
declare function flattenModelGroups(groups: ModelGroup[]): ModelGroupItem[];
|
|
2376
|
+
export declare function flattenModelGroups(groups: ModelGroup[]): ModelGroupItem[];
|
|
2346
2377
|
/**
|
|
2347
2378
|
* Fetch every model item in the catalog. The first page yields `total`; the
|
|
2348
2379
|
* remaining pages are fetched concurrently because ranking needs the whole set.
|
|
2349
2380
|
*/
|
|
2350
|
-
declare function fetchModelGroupsAll(call: ConsoleCall, params?: Omit<ModelGroupParams, "pageNo">): Promise<ModelGroupItem[]>;
|
|
2381
|
+
export declare function fetchModelGroupsAll(call: ConsoleCall, params?: Omit<ModelGroupParams, "pageNo">): Promise<ModelGroupItem[]>;
|
|
2351
2382
|
/** Fetch a single model family with all detail flags enabled. */
|
|
2352
|
-
declare function fetchModelDetail(call: ConsoleCall, modelKey: string): Promise<ModelGroup | null>;
|
|
2383
|
+
export declare function fetchModelDetail(call: ConsoleCall, modelKey: string): Promise<ModelGroup | null>;
|
|
2353
2384
|
interface PredictConfigEntry {
|
|
2354
2385
|
name: string;
|
|
2355
2386
|
key: string;
|
|
@@ -2358,13 +2389,13 @@ interface PredictConfigEntry {
|
|
|
2358
2389
|
range?: unknown;
|
|
2359
2390
|
}
|
|
2360
2391
|
/** Fetch the input parameter schema for a specific model. */
|
|
2361
|
-
declare function fetchPredictConfig(call: ConsoleCall, modelId: string): Promise<PredictConfigEntry[] | null>;
|
|
2392
|
+
export declare function fetchPredictConfig(call: ConsoleCall, modelId: string): Promise<PredictConfigEntry[] | null>;
|
|
2362
2393
|
//#endregion
|
|
2363
2394
|
//#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>;
|
|
2395
|
+
export declare function getConfigDir(): string;
|
|
2396
|
+
export declare function getConfigPath(): string;
|
|
2397
|
+
export declare function getCredentialsPath(): string;
|
|
2398
|
+
export declare function ensureConfigDir(): Promise<void>;
|
|
2368
2399
|
//#endregion
|
|
2369
2400
|
//#region src/config/profile-presets.d.ts
|
|
2370
2401
|
interface ModelProfilePreset {
|
|
@@ -2380,9 +2411,9 @@ interface ModelProfilePreset {
|
|
|
2380
2411
|
}
|
|
2381
2412
|
type ApiKeyLoginKind = "token-plan" | "ordinary" | "unknown";
|
|
2382
2413
|
/** Defaults materialized when logging into a well-known model profile. */
|
|
2383
|
-
declare function getModelProfilePreset(configName?: string): ModelProfilePreset | undefined;
|
|
2414
|
+
export declare function getModelProfilePreset(configName?: string): ModelProfilePreset | undefined;
|
|
2384
2415
|
/** Classify only the key formats that affect automatic Profile routing. */
|
|
2385
|
-
declare function getApiKeyLoginKind(apiKey: string): ApiKeyLoginKind;
|
|
2416
|
+
export declare function getApiKeyLoginKind(apiKey: string): ApiKeyLoginKind;
|
|
2386
2417
|
//#endregion
|
|
2387
2418
|
//#region src/config/model-base-url.d.ts
|
|
2388
2419
|
/**
|
|
@@ -2390,19 +2421,19 @@ declare function getApiKeyLoginKind(apiKey: string): ApiKeyLoginKind;
|
|
|
2390
2421
|
* CLI endpoints append their own API paths, so user-provided paths, query
|
|
2391
2422
|
* parameters, and fragments must not remain in the stored or resolved base URL.
|
|
2392
2423
|
*/
|
|
2393
|
-
declare function normalizeModelBaseUrl(input: string): string;
|
|
2424
|
+
export declare function normalizeModelBaseUrl(input: string): string;
|
|
2394
2425
|
//#endregion
|
|
2395
2426
|
//#region src/output/formatter.d.ts
|
|
2396
2427
|
type OutputFormat = "text" | "json";
|
|
2397
|
-
declare function detectOutputFormat(flagValue?: string): OutputFormat;
|
|
2398
|
-
declare function formatOutput(data: unknown, format: OutputFormat): string;
|
|
2428
|
+
export declare function detectOutputFormat(flagValue?: string): OutputFormat;
|
|
2429
|
+
export declare function formatOutput(data: unknown, format: OutputFormat): string;
|
|
2399
2430
|
//#endregion
|
|
2400
2431
|
//#region src/output/json.d.ts
|
|
2401
|
-
declare function formatJson(data: unknown): string;
|
|
2402
|
-
declare function formatErrorJson(code: number, message: string, hint?: string): string;
|
|
2432
|
+
export declare function formatJson(data: unknown): string;
|
|
2433
|
+
export declare function formatErrorJson(code: number, message: string, hint?: string): string;
|
|
2403
2434
|
//#endregion
|
|
2404
2435
|
//#region src/output/text.d.ts
|
|
2405
|
-
declare function formatText(data: unknown): string;
|
|
2436
|
+
export declare function formatText(data: unknown): string;
|
|
2406
2437
|
//#endregion
|
|
2407
2438
|
//#region src/files/upload.d.ts
|
|
2408
2439
|
interface UploadOptions {
|
|
@@ -2413,23 +2444,23 @@ interface UploadOptions {
|
|
|
2413
2444
|
signal?: AbortSignal;
|
|
2414
2445
|
}
|
|
2415
2446
|
/** Encode a local image as a Data URI. */
|
|
2416
|
-
declare function imageFileToDataUri(filePath: string): string;
|
|
2447
|
+
export declare function imageFileToDataUri(filePath: string): string;
|
|
2417
2448
|
/** Keep dry-run output readable and avoid echoing the complete inline image. */
|
|
2418
|
-
declare function redactDataUri(input: string): string;
|
|
2449
|
+
export declare function redactDataUri(input: string): string;
|
|
2419
2450
|
/**
|
|
2420
2451
|
* Upload a local file to DashScope temporary storage and return the oss:// URL.
|
|
2421
2452
|
* The URL is valid for 48 hours.
|
|
2422
2453
|
*/
|
|
2423
|
-
declare function uploadFile(opts: UploadOptions): Promise<string>;
|
|
2454
|
+
export declare function uploadFile(opts: UploadOptions): Promise<string>;
|
|
2424
2455
|
/**
|
|
2425
2456
|
* Check if a string looks like a local file path (not a URL).
|
|
2426
2457
|
*/
|
|
2427
|
-
declare function isLocalFile(input: string): boolean;
|
|
2458
|
+
export declare function isLocalFile(input: string): boolean;
|
|
2428
2459
|
/**
|
|
2429
2460
|
* Resolve a file argument: if it's a local path, upload it and return the oss:// URL.
|
|
2430
2461
|
* If it's already a URL, return as-is.
|
|
2431
2462
|
*/
|
|
2432
|
-
declare function resolveFileUrl(input: string, apiKey: string, model: string, opts: {
|
|
2463
|
+
export declare function resolveFileUrl(input: string, apiKey: string, model: string, opts: {
|
|
2433
2464
|
identity: TrackingIdentity;
|
|
2434
2465
|
signal?: AbortSignal;
|
|
2435
2466
|
}): Promise<string>;
|
|
@@ -2444,7 +2475,7 @@ declare function resolveFileUrl(input: string, apiKey: string, model: string, op
|
|
|
2444
2475
|
* purposes can be plugged in without schema changes.
|
|
2445
2476
|
*/
|
|
2446
2477
|
/** A single uploaded dataset file as returned by the platform. */
|
|
2447
|
-
interface DatasetFile {
|
|
2478
|
+
export interface DatasetFile {
|
|
2448
2479
|
/** File ID — the only stable handle for downstream consumers. */
|
|
2449
2480
|
file_id: string;
|
|
2450
2481
|
/** Original filename uploaded by the user. */
|
|
@@ -2463,7 +2494,7 @@ interface DatasetFile {
|
|
|
2463
2494
|
gmt_create?: string;
|
|
2464
2495
|
}
|
|
2465
2496
|
/** GET /api/v1/files response. */
|
|
2466
|
-
interface DatasetListResponse {
|
|
2497
|
+
export interface DatasetListResponse {
|
|
2467
2498
|
request_id?: string;
|
|
2468
2499
|
data?: {
|
|
2469
2500
|
files?: DatasetFile[];
|
|
@@ -2473,7 +2504,7 @@ interface DatasetListResponse {
|
|
|
2473
2504
|
};
|
|
2474
2505
|
}
|
|
2475
2506
|
/** GET /api/v1/files/{file_id} response. */
|
|
2476
|
-
interface DatasetGetResponse {
|
|
2507
|
+
export interface DatasetGetResponse {
|
|
2477
2508
|
request_id?: string;
|
|
2478
2509
|
data?: DatasetFile;
|
|
2479
2510
|
}
|
|
@@ -2485,7 +2516,7 @@ interface DatasetGetResponse {
|
|
|
2485
2516
|
* it landed. On business-level failure (HTTP 200 + `data.failed_uploads`)
|
|
2486
2517
|
* `id` is absent and `data.failed_uploads[]` carries the platform's reason.
|
|
2487
2518
|
*/
|
|
2488
|
-
interface DatasetUploadResponse {
|
|
2519
|
+
export interface DatasetUploadResponse {
|
|
2489
2520
|
request_id?: string;
|
|
2490
2521
|
/** File ID — the handle returned to callers (e.g. `file-ft-…`). */
|
|
2491
2522
|
id?: string;
|
|
@@ -2516,7 +2547,7 @@ interface DatasetUploadResponse {
|
|
|
2516
2547
|
};
|
|
2517
2548
|
}
|
|
2518
2549
|
/** DELETE /api/v1/files/{file_id} response. */
|
|
2519
|
-
interface DatasetDeleteResponse {
|
|
2550
|
+
export interface DatasetDeleteResponse {
|
|
2520
2551
|
request_id?: string;
|
|
2521
2552
|
data?: {
|
|
2522
2553
|
deleted?: boolean;
|
|
@@ -2525,7 +2556,7 @@ interface DatasetDeleteResponse {
|
|
|
2525
2556
|
}
|
|
2526
2557
|
//#endregion
|
|
2527
2558
|
//#region src/dataset/api.d.ts
|
|
2528
|
-
interface DatasetUploadParams {
|
|
2559
|
+
export interface DatasetUploadParams {
|
|
2529
2560
|
filePath: string;
|
|
2530
2561
|
/**
|
|
2531
2562
|
* Purpose tag forwarded to the platform. Defaults to "fine-tune" because
|
|
@@ -2546,21 +2577,21 @@ interface DatasetUploadParams {
|
|
|
2546
2577
|
* `Response`'s helper to avoid the buffer doubling. Fall back to readFileSync
|
|
2547
2578
|
* for small files where streaming overhead isn't worth it.
|
|
2548
2579
|
*/
|
|
2549
|
-
declare function uploadDataset(client: Client, params: DatasetUploadParams): Promise<DatasetFile & {
|
|
2580
|
+
export declare function uploadDataset(client: Client, params: DatasetUploadParams): Promise<DatasetFile & {
|
|
2550
2581
|
request_id?: string;
|
|
2551
2582
|
}>;
|
|
2552
|
-
interface DatasetListParams {
|
|
2583
|
+
export interface DatasetListParams {
|
|
2553
2584
|
pageNo?: number;
|
|
2554
2585
|
pageSize?: number;
|
|
2555
2586
|
purpose?: string;
|
|
2556
2587
|
signal?: AbortSignal;
|
|
2557
2588
|
}
|
|
2558
2589
|
/** GET /api/v1/files */
|
|
2559
|
-
declare function listDatasets(client: Client, params?: DatasetListParams): Promise<DatasetListResponse>;
|
|
2590
|
+
export declare function listDatasets(client: Client, params?: DatasetListParams): Promise<DatasetListResponse>;
|
|
2560
2591
|
/** GET /api/v1/files/{file_id} */
|
|
2561
|
-
declare function getDataset(client: Client, fileId: string, signal?: AbortSignal): Promise<DatasetGetResponse>;
|
|
2592
|
+
export declare function getDataset(client: Client, fileId: string, signal?: AbortSignal): Promise<DatasetGetResponse>;
|
|
2562
2593
|
/** DELETE /api/v1/files/{file_id} */
|
|
2563
|
-
declare function deleteDataset(client: Client, fileId: string, signal?: AbortSignal): Promise<DatasetDeleteResponse>;
|
|
2594
|
+
export declare function deleteDataset(client: Client, fileId: string, signal?: AbortSignal): Promise<DatasetDeleteResponse>;
|
|
2564
2595
|
//#endregion
|
|
2565
2596
|
//#region src/dataset/validate/types.d.ts
|
|
2566
2597
|
/**
|
|
@@ -2714,20 +2745,20 @@ interface TrainingProfile {
|
|
|
2714
2745
|
* Throws USAGE if the file extension is not `.jsonl` or `.zip`, or if the
|
|
2715
2746
|
* content cannot be parsed.
|
|
2716
2747
|
*/
|
|
2717
|
-
declare function detectModality(filePath: string): Promise<DataModality>;
|
|
2748
|
+
export declare function detectModality(filePath: string): Promise<DataModality>;
|
|
2718
2749
|
//#endregion
|
|
2719
2750
|
//#region src/dataset/validate/registry.d.ts
|
|
2720
2751
|
/** Lookup the validator that handles a given file extension. */
|
|
2721
|
-
declare function pickValidator(filePath: string): ValidatorSpec;
|
|
2752
|
+
export declare function pickValidator(filePath: string): ValidatorSpec;
|
|
2722
2753
|
/** Allow tests / future plugins to inject extra validators. Idempotent. */
|
|
2723
|
-
declare function registerValidator(spec: ValidatorSpec): void;
|
|
2754
|
+
export declare function registerValidator(spec: ValidatorSpec): void;
|
|
2724
2755
|
/**
|
|
2725
2756
|
* Top-level entry point. Applies common pre-flight (existence/size/extension)
|
|
2726
2757
|
* then defers to the format-specific validator.
|
|
2727
2758
|
*/
|
|
2728
|
-
declare function validateDataset(filePath: string, opts?: ValidateOpts): Promise<ValidationResult>;
|
|
2759
|
+
export declare function validateDataset(filePath: string, opts?: ValidateOpts): Promise<ValidationResult>;
|
|
2729
2760
|
/** Read-only view of the active registry — handy for tests / `--help`. */
|
|
2730
|
-
declare function listSupportedFormats(): {
|
|
2761
|
+
export declare function listSupportedFormats(): {
|
|
2731
2762
|
format: string;
|
|
2732
2763
|
extensions: string[];
|
|
2733
2764
|
}[];
|
|
@@ -2738,25 +2769,25 @@ declare function listSupportedFormats(): {
|
|
|
2738
2769
|
* `bl dataset upload` enforces this client-side so users learn early.
|
|
2739
2770
|
* CPT uses 300MB (see MAX_CPT_BYTES); API general upload is also 300MB.
|
|
2740
2771
|
*/
|
|
2741
|
-
declare const MAX_DATASET_BYTES: number;
|
|
2772
|
+
export declare const MAX_DATASET_BYTES: number;
|
|
2742
2773
|
/**
|
|
2743
2774
|
* CPT text dataset size cap — 300 MB per the platform docs.
|
|
2744
2775
|
* CPT requires at least 50M tokens; larger files are expected.
|
|
2745
2776
|
*/
|
|
2746
|
-
declare const MAX_CPT_BYTES: number;
|
|
2777
|
+
export declare const MAX_CPT_BYTES: number;
|
|
2747
2778
|
/**
|
|
2748
2779
|
* Image / video ZIP size cap — 2 GB per the platform docs. Used by
|
|
2749
2780
|
* `bl dataset upload` for media schemas and by the `sft-lora` training
|
|
2750
2781
|
* profile for image / video validation.
|
|
2751
2782
|
*/
|
|
2752
|
-
declare const MAX_MEDIA_ZIP_BYTES: number;
|
|
2783
|
+
export declare const MAX_MEDIA_ZIP_BYTES: number;
|
|
2753
2784
|
/**
|
|
2754
2785
|
* Parse a `--schema` CLI value into a `DatasetSchema` (or `undefined` for
|
|
2755
2786
|
* auto-detect). Single source of truth for the schema vocabulary so `dataset
|
|
2756
2787
|
* validate`, `dataset upload`, and any future caller agree on accepted values
|
|
2757
2788
|
* and error wording. Throws USAGE for anything unrecognized.
|
|
2758
2789
|
*/
|
|
2759
|
-
declare function parseDatasetSchemaFlag(value: string | undefined): DatasetSchema | undefined;
|
|
2790
|
+
export declare function parseDatasetSchemaFlag(value: string | undefined): DatasetSchema | undefined;
|
|
2760
2791
|
//#endregion
|
|
2761
2792
|
//#region src/dataset/validate/format.d.ts
|
|
2762
2793
|
/**
|
|
@@ -2766,7 +2797,7 @@ declare function parseDatasetSchemaFlag(value: string | undefined): DatasetSchem
|
|
|
2766
2797
|
* (`dataset validate`, `dataset upload`, `finetune create`) so the error
|
|
2767
2798
|
* presentation stays consistent regardless of which command ran the validator.
|
|
2768
2799
|
*/
|
|
2769
|
-
declare function formatIssue(issue: ValidationIssue): string;
|
|
2800
|
+
export declare function formatIssue(issue: ValidationIssue): string;
|
|
2770
2801
|
//#endregion
|
|
2771
2802
|
//#region src/finetune/types.d.ts
|
|
2772
2803
|
/**
|
|
@@ -2776,7 +2807,7 @@ declare function formatIssue(issue: ValidationIssue): string;
|
|
|
2776
2807
|
* preserved verbatim — callers decide how to surface fields).
|
|
2777
2808
|
*/
|
|
2778
2809
|
/** Hyper-parameters honored by text/thinking/vision SFT models. */
|
|
2779
|
-
interface FineTuneHyperParameters {
|
|
2810
|
+
export interface FineTuneHyperParameters {
|
|
2780
2811
|
/** Number of training epochs. */
|
|
2781
2812
|
n_epochs?: number;
|
|
2782
2813
|
batch_size?: number;
|
|
@@ -2790,7 +2821,7 @@ interface FineTuneHyperParameters {
|
|
|
2790
2821
|
[k: string]: unknown;
|
|
2791
2822
|
}
|
|
2792
2823
|
/** POST /api/v1/fine-tunes request body. */
|
|
2793
|
-
interface CreateFineTuneRequest {
|
|
2824
|
+
export interface CreateFineTuneRequest {
|
|
2794
2825
|
/** Base model ID, or a previously fine-tuned model ID for continued training. */
|
|
2795
2826
|
model: string;
|
|
2796
2827
|
training_file_ids: string[];
|
|
@@ -2814,11 +2845,11 @@ interface CreateFineTuneRequest {
|
|
|
2814
2845
|
finetuned_output_suffix?: string;
|
|
2815
2846
|
}
|
|
2816
2847
|
/** GET /api/v1/fine-tunes/{id}/logs response. */
|
|
2817
|
-
interface FineTuneLogEntry {
|
|
2848
|
+
export interface FineTuneLogEntry {
|
|
2818
2849
|
/** Server-defined log line — schema varies; preserve as-is. */
|
|
2819
2850
|
[k: string]: unknown;
|
|
2820
2851
|
}
|
|
2821
|
-
interface GetFineTuneLogsResponse {
|
|
2852
|
+
export interface GetFineTuneLogsResponse {
|
|
2822
2853
|
request_id?: string;
|
|
2823
2854
|
output?: {
|
|
2824
2855
|
logs?: Array<FineTuneLogEntry | string>;
|
|
@@ -2836,7 +2867,7 @@ interface GetFineTuneLogsResponse {
|
|
|
2836
2867
|
};
|
|
2837
2868
|
}
|
|
2838
2869
|
/** A single checkpoint as returned by the platform. */
|
|
2839
|
-
interface FineTuneCheckpoint {
|
|
2870
|
+
export interface FineTuneCheckpoint {
|
|
2840
2871
|
checkpoint?: string;
|
|
2841
2872
|
checkpoint_id?: string;
|
|
2842
2873
|
full_name?: string;
|
|
@@ -2860,7 +2891,7 @@ interface FineTuneCheckpoint {
|
|
|
2860
2891
|
* `{ checkpoints: [...] }`). The wrapped form is preserved as a fallback for
|
|
2861
2892
|
* older deployments.
|
|
2862
2893
|
*/
|
|
2863
|
-
interface ListCheckpointsResponse {
|
|
2894
|
+
export interface ListCheckpointsResponse {
|
|
2864
2895
|
request_id?: string;
|
|
2865
2896
|
output?: FineTuneCheckpoint[] | {
|
|
2866
2897
|
checkpoints?: FineTuneCheckpoint[];
|
|
@@ -2874,10 +2905,11 @@ interface ListCheckpointsResponse {
|
|
|
2874
2905
|
};
|
|
2875
2906
|
}
|
|
2876
2907
|
/** GET /api/v1/fine-tunes/{job_id}/export/{checkpoint}?model_name= response. */
|
|
2877
|
-
interface ExportCheckpointResponse {
|
|
2908
|
+
export interface ExportCheckpointResponse {
|
|
2878
2909
|
request_id?: string;
|
|
2879
2910
|
output?: {
|
|
2880
|
-
/** Resulting deployable model name. */
|
|
2911
|
+
/** Resulting deployable model name. */
|
|
2912
|
+
model_name?: string;
|
|
2881
2913
|
[k: string]: unknown;
|
|
2882
2914
|
};
|
|
2883
2915
|
data?: {
|
|
@@ -2886,13 +2918,13 @@ interface ExportCheckpointResponse {
|
|
|
2886
2918
|
};
|
|
2887
2919
|
}
|
|
2888
2920
|
/** POST /api/v1/fine-tunes/{id}/cancel response. */
|
|
2889
|
-
interface CancelFineTuneResponse {
|
|
2921
|
+
export interface CancelFineTuneResponse {
|
|
2890
2922
|
request_id?: string;
|
|
2891
2923
|
output?: FineTuneJob;
|
|
2892
2924
|
data?: FineTuneJob;
|
|
2893
2925
|
}
|
|
2894
2926
|
/** DELETE /api/v1/fine-tunes/{id} response. */
|
|
2895
|
-
interface DeleteFineTuneResponse {
|
|
2927
|
+
export interface DeleteFineTuneResponse {
|
|
2896
2928
|
request_id?: string;
|
|
2897
2929
|
output?: {
|
|
2898
2930
|
deleted?: boolean;
|
|
@@ -2906,7 +2938,7 @@ interface DeleteFineTuneResponse {
|
|
|
2906
2938
|
};
|
|
2907
2939
|
}
|
|
2908
2940
|
/** A single fine-tune job record as returned by the platform. */
|
|
2909
|
-
interface FineTuneJob {
|
|
2941
|
+
export interface FineTuneJob {
|
|
2910
2942
|
job_id?: string;
|
|
2911
2943
|
job_name?: string;
|
|
2912
2944
|
model?: string;
|
|
@@ -2930,7 +2962,7 @@ interface FineTuneJob {
|
|
|
2930
2962
|
[k: string]: unknown;
|
|
2931
2963
|
}
|
|
2932
2964
|
/** POST /api/v1/fine-tunes response. */
|
|
2933
|
-
interface CreateFineTuneResponse {
|
|
2965
|
+
export interface CreateFineTuneResponse {
|
|
2934
2966
|
request_id?: string;
|
|
2935
2967
|
/** Modern DashScope shape. */
|
|
2936
2968
|
output?: FineTuneJob;
|
|
@@ -2938,7 +2970,7 @@ interface CreateFineTuneResponse {
|
|
|
2938
2970
|
data?: FineTuneJob;
|
|
2939
2971
|
}
|
|
2940
2972
|
/** GET /api/v1/fine-tunes response. */
|
|
2941
|
-
interface ListFineTunesResponse {
|
|
2973
|
+
export interface ListFineTunesResponse {
|
|
2942
2974
|
request_id?: string;
|
|
2943
2975
|
output?: {
|
|
2944
2976
|
jobs?: FineTuneJob[];
|
|
@@ -2954,7 +2986,7 @@ interface ListFineTunesResponse {
|
|
|
2954
2986
|
};
|
|
2955
2987
|
}
|
|
2956
2988
|
/** GET /api/v1/fine-tunes/{job_id} response. */
|
|
2957
|
-
interface GetFineTuneResponse {
|
|
2989
|
+
export interface GetFineTuneResponse {
|
|
2958
2990
|
request_id?: string;
|
|
2959
2991
|
output?: FineTuneJob;
|
|
2960
2992
|
data?: FineTuneJob;
|
|
@@ -2962,8 +2994,8 @@ interface GetFineTuneResponse {
|
|
|
2962
2994
|
//#endregion
|
|
2963
2995
|
//#region src/finetune/api.d.ts
|
|
2964
2996
|
/** POST /api/v1/fine-tunes */
|
|
2965
|
-
declare function createFineTune(client: Client, body: CreateFineTuneRequest, signal?: AbortSignal): Promise<CreateFineTuneResponse>;
|
|
2966
|
-
interface ListFineTunesParams {
|
|
2997
|
+
export declare function createFineTune(client: Client, body: CreateFineTuneRequest, signal?: AbortSignal): Promise<CreateFineTuneResponse>;
|
|
2998
|
+
export interface ListFineTunesParams {
|
|
2967
2999
|
pageNo?: number;
|
|
2968
3000
|
pageSize?: number;
|
|
2969
3001
|
status?: string;
|
|
@@ -2972,22 +3004,22 @@ interface ListFineTunesParams {
|
|
|
2972
3004
|
signal?: AbortSignal;
|
|
2973
3005
|
}
|
|
2974
3006
|
/** GET /api/v1/fine-tunes */
|
|
2975
|
-
declare function listFineTunes(client: Client, params?: ListFineTunesParams): Promise<ListFineTunesResponse>;
|
|
3007
|
+
export declare function listFineTunes(client: Client, params?: ListFineTunesParams): Promise<ListFineTunesResponse>;
|
|
2976
3008
|
/** GET /api/v1/fine-tunes/{job_id} */
|
|
2977
|
-
declare function getFineTune(client: Client, jobId: string, signal?: AbortSignal): Promise<GetFineTuneResponse>;
|
|
3009
|
+
export declare function getFineTune(client: Client, jobId: string, signal?: AbortSignal): Promise<GetFineTuneResponse>;
|
|
2978
3010
|
/** POST /api/v1/fine-tunes/{job_id}/cancel */
|
|
2979
|
-
declare function cancelFineTune(client: Client, jobId: string, signal?: AbortSignal): Promise<CancelFineTuneResponse>;
|
|
3011
|
+
export declare function cancelFineTune(client: Client, jobId: string, signal?: AbortSignal): Promise<CancelFineTuneResponse>;
|
|
2980
3012
|
/** DELETE /api/v1/fine-tunes/{job_id} */
|
|
2981
|
-
declare function deleteFineTune(client: Client, jobId: string, signal?: AbortSignal): Promise<DeleteFineTuneResponse>;
|
|
2982
|
-
interface GetFineTuneLogsParams {
|
|
3013
|
+
export declare function deleteFineTune(client: Client, jobId: string, signal?: AbortSignal): Promise<DeleteFineTuneResponse>;
|
|
3014
|
+
export interface GetFineTuneLogsParams {
|
|
2983
3015
|
pageNo?: number;
|
|
2984
3016
|
pageSize?: number;
|
|
2985
3017
|
signal?: AbortSignal;
|
|
2986
3018
|
}
|
|
2987
3019
|
/** GET /api/v1/fine-tunes/{job_id}/logs */
|
|
2988
|
-
declare function getFineTuneLogs(client: Client, jobId: string, params?: GetFineTuneLogsParams): Promise<GetFineTuneLogsResponse>;
|
|
3020
|
+
export declare function getFineTuneLogs(client: Client, jobId: string, params?: GetFineTuneLogsParams): Promise<GetFineTuneLogsResponse>;
|
|
2989
3021
|
/** GET /api/v1/fine-tunes/{job_id}/checkpoints */
|
|
2990
|
-
declare function listCheckpoints(client: Client, jobId: string, signal?: AbortSignal): Promise<ListCheckpointsResponse>;
|
|
3022
|
+
export declare function listCheckpoints(client: Client, jobId: string, signal?: AbortSignal): Promise<ListCheckpointsResponse>;
|
|
2991
3023
|
/**
|
|
2992
3024
|
* GET /api/v1/fine-tunes/{job_id}/export/{checkpoint}?model_name={name}
|
|
2993
3025
|
*
|
|
@@ -2995,7 +3027,7 @@ declare function listCheckpoints(client: Client, jobId: string, signal?: AbortSi
|
|
|
2995
3027
|
* `deploy <modality> create` can target it. The platform may auto-export the best
|
|
2996
3028
|
* checkpoint on SUCCEEDED, but explicit export is the canonical path.
|
|
2997
3029
|
*/
|
|
2998
|
-
declare function exportCheckpoint(client: Client, jobId: string, checkpoint: string, modelName: string, signal?: AbortSignal): Promise<ExportCheckpointResponse>;
|
|
3030
|
+
export declare function exportCheckpoint(client: Client, jobId: string, checkpoint: string, modelName: string, signal?: AbortSignal): Promise<ExportCheckpointResponse>;
|
|
2999
3031
|
//#endregion
|
|
3000
3032
|
//#region src/finetune/capability.d.ts
|
|
3001
3033
|
/**
|
|
@@ -3011,7 +3043,7 @@ declare function exportCheckpoint(client: Client, jobId: string, checkpoint: str
|
|
|
3011
3043
|
* the interface boundary (request body), so the rest of the CLI never sees the
|
|
3012
3044
|
* raw server strings (`efficient_sft`, `dpo_full`, ...).
|
|
3013
3045
|
*/
|
|
3014
|
-
declare const TRAINING_TYPE_MAP: {
|
|
3046
|
+
export declare const TRAINING_TYPE_MAP: {
|
|
3015
3047
|
readonly sft: {
|
|
3016
3048
|
readonly server: "sft";
|
|
3017
3049
|
readonly method: "sft";
|
|
@@ -3038,11 +3070,11 @@ declare const TRAINING_TYPE_MAP: {
|
|
|
3038
3070
|
readonly variant: "full";
|
|
3039
3071
|
};
|
|
3040
3072
|
};
|
|
3041
|
-
type TrainingTypeCli = keyof typeof TRAINING_TYPE_MAP;
|
|
3073
|
+
export type TrainingTypeCli = keyof typeof TRAINING_TYPE_MAP;
|
|
3042
3074
|
/** All accepted CLI training-type values (for whitelisting / help text). */
|
|
3043
|
-
declare const TRAINING_TYPES_CLI: readonly TrainingTypeCli[];
|
|
3075
|
+
export declare const TRAINING_TYPES_CLI: readonly TrainingTypeCli[];
|
|
3044
3076
|
/** Default training type when `--training-type` is omitted. */
|
|
3045
|
-
declare const DEFAULT_TRAINING_TYPE: TrainingTypeCli;
|
|
3077
|
+
export declare const DEFAULT_TRAINING_TYPE: TrainingTypeCli;
|
|
3046
3078
|
/** Subset of `supports` relevant to training capability. */
|
|
3047
3079
|
interface ModelSupports {
|
|
3048
3080
|
sft?: boolean;
|
|
@@ -3054,16 +3086,16 @@ interface ModelSupports {
|
|
|
3054
3086
|
* A model record's training-capability fields. The full listFoundationModels
|
|
3055
3087
|
* item carries many more fields; only these are consulted here.
|
|
3056
3088
|
*/
|
|
3057
|
-
interface ModelCapability {
|
|
3089
|
+
export interface ModelCapability {
|
|
3058
3090
|
model?: string;
|
|
3059
3091
|
supports?: ModelSupports;
|
|
3060
3092
|
trainingTypes?: Record<string, string[]>;
|
|
3061
3093
|
[key: string]: unknown;
|
|
3062
3094
|
}
|
|
3063
3095
|
/** True when `value` is one of the accepted CLI training types. */
|
|
3064
|
-
declare function isTrainingTypeCli(value: string): value is TrainingTypeCli;
|
|
3096
|
+
export declare function isTrainingTypeCli(value: string): value is TrainingTypeCli;
|
|
3065
3097
|
/** The (method, variant) pair a CLI training type resolves to. */
|
|
3066
|
-
declare function trainingTypeMethodVariant(value: TrainingTypeCli): {
|
|
3098
|
+
export declare function trainingTypeMethodVariant(value: TrainingTypeCli): {
|
|
3067
3099
|
method: string;
|
|
3068
3100
|
variant: string;
|
|
3069
3101
|
};
|
|
@@ -3075,13 +3107,13 @@ declare function trainingTypeMethodVariant(value: TrainingTypeCli): {
|
|
|
3075
3107
|
* 2. `trainingTypes.<method>` includes the corresponding variant
|
|
3076
3108
|
* (`full` for the bare name, `lora` for the `-lora` suffix).
|
|
3077
3109
|
*/
|
|
3078
|
-
declare function modelSupportsTrainingType(model: ModelCapability | undefined | null, value: TrainingTypeCli): boolean;
|
|
3110
|
+
export declare function modelSupportsTrainingType(model: ModelCapability | undefined | null, value: TrainingTypeCli): boolean;
|
|
3079
3111
|
/**
|
|
3080
3112
|
* Every CLI training type a model supports, in canonical order
|
|
3081
3113
|
* (sft, sft-lora, dpo, dpo-lora, cpt). Empty when the model carries no
|
|
3082
3114
|
* capability metadata or supports none.
|
|
3083
3115
|
*/
|
|
3084
|
-
declare function listSupportedTrainingTypes(model: ModelCapability | undefined | null): TrainingTypeCli[];
|
|
3116
|
+
export declare function listSupportedTrainingTypes(model: ModelCapability | undefined | null): TrainingTypeCli[];
|
|
3085
3117
|
/**
|
|
3086
3118
|
* Fetch a single model's foundation metadata by name (console gateway
|
|
3087
3119
|
* `listFoundationModels` with a `name` filter). No console login required —
|
|
@@ -3091,12 +3123,12 @@ declare function listSupportedTrainingTypes(model: ModelCapability | undefined |
|
|
|
3091
3123
|
* server's `name` filter is a substring match, so we additionally require an
|
|
3092
3124
|
* exact `model` equality to avoid e.g. `qwen3-8b` matching `qwen3-8b-v2`).
|
|
3093
3125
|
*/
|
|
3094
|
-
declare function fetchModelCapability(settings: Settings, modelName: string): Promise<ModelCapability | null>;
|
|
3126
|
+
export declare function fetchModelCapability(settings: Settings, modelName: string): Promise<ModelCapability | null>;
|
|
3095
3127
|
//#endregion
|
|
3096
3128
|
//#region src/finetune/preflight.d.ts
|
|
3097
3129
|
/** Stable issue code for "too few training samples for the batch size". */
|
|
3098
|
-
declare const INSUFFICIENT_SAMPLES_CODE = "INSUFFICIENT_SAMPLES";
|
|
3099
|
-
interface BatchSizeGateInput {
|
|
3130
|
+
export declare const INSUFFICIENT_SAMPLES_CODE = "INSUFFICIENT_SAMPLES";
|
|
3131
|
+
export interface BatchSizeGateInput {
|
|
3100
3132
|
/**
|
|
3101
3133
|
* Total training-sample count across all `--datasets` files. Sourced from
|
|
3102
3134
|
* `validateDataset`'s `stats.totalRecords` (summed per file). The gate only
|
|
@@ -3112,7 +3144,7 @@ interface BatchSizeGateInput {
|
|
|
3112
3144
|
*/
|
|
3113
3145
|
batchSize: number;
|
|
3114
3146
|
}
|
|
3115
|
-
interface BatchSizeGateResult {
|
|
3147
|
+
export interface BatchSizeGateResult {
|
|
3116
3148
|
ok: boolean;
|
|
3117
3149
|
/** Present when `!ok`, in the same shape `validateDataset` issues use. */
|
|
3118
3150
|
issue?: ValidationIssue;
|
|
@@ -3133,25 +3165,25 @@ interface BatchSizeGateResult {
|
|
|
3133
3165
|
* may still fail on the platform; that's an acceptable false negative for a
|
|
3134
3166
|
* pre-check, and the hint nudges users to leave margin for the split.
|
|
3135
3167
|
*/
|
|
3136
|
-
declare function preflightBatchSizeGate(input: BatchSizeGateInput): BatchSizeGateResult;
|
|
3168
|
+
export declare function preflightBatchSizeGate(input: BatchSizeGateInput): BatchSizeGateResult;
|
|
3137
3169
|
//#endregion
|
|
3138
3170
|
//#region src/finetune/profiles/registry.d.ts
|
|
3139
3171
|
/** Look up a profile by its CLI training-type name. Throws USAGE if unknown. */
|
|
3140
|
-
declare function getProfile(clientTrainingType: string): TrainingProfile;
|
|
3172
|
+
export declare function getProfile(clientTrainingType: string): TrainingProfile;
|
|
3141
3173
|
/** All registered CLI training-type names (for help text / whitelisting). */
|
|
3142
|
-
declare function listTrainingTypes(): string[];
|
|
3174
|
+
export declare function listTrainingTypes(): string[];
|
|
3143
3175
|
//#endregion
|
|
3144
3176
|
//#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 {
|
|
3177
|
+
export declare const TRAINING_MODEL_PRICE_API = "zeldaEasy.broadscope-platform.modelCenter.getModelPrice";
|
|
3178
|
+
export declare const CALC_DATASETS_TOKENS_API = "zeldaEasy.broadscope-platform.modelInstance.calculateDatasetsTotalTokens";
|
|
3179
|
+
export declare const ESTIMATE_FINETUNE_TOKENS_API = "zeldaEasy.broadscope-platform.modelInstance.estimateFinetuneTokens";
|
|
3180
|
+
export interface TrainingModelPrice {
|
|
3149
3181
|
price?: string;
|
|
3150
3182
|
priceUnit?: string;
|
|
3151
3183
|
modelId?: string;
|
|
3152
3184
|
[key: string]: unknown;
|
|
3153
3185
|
}
|
|
3154
|
-
interface TokenEstimate {
|
|
3186
|
+
export interface TokenEstimate {
|
|
3155
3187
|
estimatedDatasetConsumedTokensMinPerEpoch?: number;
|
|
3156
3188
|
estimatedDatasetConsumedTokensMaxPerEpoch?: number;
|
|
3157
3189
|
estimatedMixedConsumedTokensMinPerEpoch?: number;
|
|
@@ -3162,12 +3194,12 @@ interface TokenEstimate {
|
|
|
3162
3194
|
* Training unit price for a model. `price` is denominated in `priceUnit`
|
|
3163
3195
|
* (typically "千Token" — yuan per 1000 tokens).
|
|
3164
3196
|
*/
|
|
3165
|
-
declare function fetchTrainingModelPrice(client: Client, modelId: string): Promise<TrainingModelPrice>;
|
|
3197
|
+
export declare function fetchTrainingModelPrice(client: Client, modelId: string): Promise<TrainingModelPrice>;
|
|
3166
3198
|
/**
|
|
3167
3199
|
* Estimate training tokens for SFT / DPO jobs.
|
|
3168
3200
|
* Returns a per-epoch min/max range; multiply by `n_epochs` for the total.
|
|
3169
3201
|
*/
|
|
3170
|
-
declare function estimateSftDpoTokens(client: Client, datasetIds: string[], hyperParams: {
|
|
3202
|
+
export declare function estimateSftDpoTokens(client: Client, datasetIds: string[], hyperParams: {
|
|
3171
3203
|
nEpochs: number;
|
|
3172
3204
|
batchSize: number;
|
|
3173
3205
|
maxLength: number;
|
|
@@ -3181,7 +3213,7 @@ declare function estimateSftDpoTokens(client: Client, datasetIds: string[], hype
|
|
|
3181
3213
|
* `n_epochs` / `max_length` materially affect the estimate; the remaining
|
|
3182
3214
|
* hyper-parameters are fixed defaults.
|
|
3183
3215
|
*/
|
|
3184
|
-
declare function estimateCptTokens(client: Client, model: string, datasetIdsCsv: string, nEpochs: number): Promise<TokenEstimate>;
|
|
3216
|
+
export declare function estimateCptTokens(client: Client, model: string, datasetIdsCsv: string, nEpochs: number): Promise<TokenEstimate>;
|
|
3185
3217
|
//#endregion
|
|
3186
3218
|
//#region src/deploy/types.d.ts
|
|
3187
3219
|
/**
|
|
@@ -3191,7 +3223,7 @@ declare function estimateCptTokens(client: Client, model: string, datasetIdsCsv:
|
|
|
3191
3223
|
* preserved verbatim — callers decide how to surface fields).
|
|
3192
3224
|
*/
|
|
3193
3225
|
/** A single deployment record as returned by the platform. */
|
|
3194
|
-
interface Deployment {
|
|
3226
|
+
export interface Deployment {
|
|
3195
3227
|
/** Unique deployed-model identifier — used as the `model` parameter when invoking the deployed model. */
|
|
3196
3228
|
deployed_model?: string;
|
|
3197
3229
|
/** Human-friendly display name set at creation time. */
|
|
@@ -3218,6 +3250,18 @@ interface Deployment {
|
|
|
3218
3250
|
/** PTU-only token-rate limits. */
|
|
3219
3251
|
input_tpm?: number;
|
|
3220
3252
|
output_tpm?: number;
|
|
3253
|
+
/** Aggregate effective reservation capacity, in kTPM. */
|
|
3254
|
+
ptu_capacity?: ReservationCapacity;
|
|
3255
|
+
/** ptu_fast | ptu_default | future service tiers. */
|
|
3256
|
+
ptu_service_tier?: string;
|
|
3257
|
+
pre_paid_info?: PrePaidInfo;
|
|
3258
|
+
pre_paid_instance_id?: string;
|
|
3259
|
+
pre_paid_gmt_expired?: string;
|
|
3260
|
+
/** enable | disable | future overflow strategies. */
|
|
3261
|
+
overflow_strategy?: string;
|
|
3262
|
+
fail_reason?: string;
|
|
3263
|
+
operation_id?: string;
|
|
3264
|
+
instance_id?: string;
|
|
3221
3265
|
enable_thinking?: boolean;
|
|
3222
3266
|
max_context_length?: number;
|
|
3223
3267
|
workspace_id?: string;
|
|
@@ -3228,8 +3272,73 @@ interface Deployment {
|
|
|
3228
3272
|
/** Free-form additional fields are preserved by callers. */
|
|
3229
3273
|
[k: string]: unknown;
|
|
3230
3274
|
}
|
|
3275
|
+
/** Reservation capacity returned by queries; separate from legacy PTU write input. */
|
|
3276
|
+
export interface ReservationCapacity {
|
|
3277
|
+
/** Input capacity in kTPM (1 kTPM = 1000 tokens/minute); zero is valid. */
|
|
3278
|
+
input_tpm?: number;
|
|
3279
|
+
/** Output capacity in kTPM; zero is valid. */
|
|
3280
|
+
output_tpm?: number;
|
|
3281
|
+
[key: string]: unknown;
|
|
3282
|
+
}
|
|
3283
|
+
/** Prepaid purchase and renewal configuration returned by queries. */
|
|
3284
|
+
export interface PrePaidInfo {
|
|
3285
|
+
/** Purchase / renewal duration in days. */
|
|
3286
|
+
duration?: number;
|
|
3287
|
+
auto_renewal?: boolean;
|
|
3288
|
+
/** Automatic renewal duration in days. */
|
|
3289
|
+
auto_renewal_duration?: number;
|
|
3290
|
+
/** Renewal cycle unit, e.g. Day. */
|
|
3291
|
+
auto_renewal_cycle?: string;
|
|
3292
|
+
[key: string]: unknown;
|
|
3293
|
+
}
|
|
3294
|
+
/** A capacity instance returned by list/detail queries, including released instances. */
|
|
3295
|
+
export interface CapacityInstance {
|
|
3296
|
+
/** The deployment's ModelCode. Identifiers are opaque strings. */
|
|
3297
|
+
model_service_id?: string;
|
|
3298
|
+
instance_id?: string;
|
|
3299
|
+
/** pre_paid | post_paid | future charge types. */
|
|
3300
|
+
charge_type?: string;
|
|
3301
|
+
/** Instance lifecycle state; future states are preserved. */
|
|
3302
|
+
status?: string;
|
|
3303
|
+
deleted?: boolean;
|
|
3304
|
+
/** Currently confirmed serving capacity. */
|
|
3305
|
+
effective_capacity?: ReservationCapacity;
|
|
3306
|
+
/** Configured / contracted capacity, which may remain while stopped or suspended. */
|
|
3307
|
+
configured_capacity?: ReservationCapacity;
|
|
3308
|
+
/** Pending target, not effective capacity; may be absent or null in a stable state. */
|
|
3309
|
+
target_capacity?: ReservationCapacity | null;
|
|
3310
|
+
pre_paid_info?: PrePaidInfo;
|
|
3311
|
+
gmt_expired?: string;
|
|
3312
|
+
can_scale?: boolean;
|
|
3313
|
+
can_renew?: boolean;
|
|
3314
|
+
can_delete?: boolean;
|
|
3315
|
+
fail_reason?: string;
|
|
3316
|
+
gmt_created?: string;
|
|
3317
|
+
gmt_modified?: string;
|
|
3318
|
+
gmt_deleted?: string;
|
|
3319
|
+
[key: string]: unknown;
|
|
3320
|
+
}
|
|
3321
|
+
/** A capacity operation returned by a query; no state or identifier normalization. */
|
|
3322
|
+
export interface CapacityOperation {
|
|
3323
|
+
operation_id?: string;
|
|
3324
|
+
/** Original operation request ID, distinct from the query response's request_id. */
|
|
3325
|
+
request_id?: string;
|
|
3326
|
+
/** CREATE | SCALE | RENEW | DELETE | STOP | REFUND | future operation types. */
|
|
3327
|
+
operation_type?: string;
|
|
3328
|
+
/** PROCESSING | SUCCEEDED | FAILED | future operation states. */
|
|
3329
|
+
operation_status?: string;
|
|
3330
|
+
model_service_id?: string;
|
|
3331
|
+
instance_id?: string;
|
|
3332
|
+
from_status?: string;
|
|
3333
|
+
current_status?: string;
|
|
3334
|
+
error_code?: string;
|
|
3335
|
+
error_message?: string;
|
|
3336
|
+
gmt_created?: string;
|
|
3337
|
+
gmt_finished?: string;
|
|
3338
|
+
[key: string]: unknown;
|
|
3339
|
+
}
|
|
3231
3340
|
/** A single deployable model record (GET /deployments/models). */
|
|
3232
|
-
interface DeployableModel {
|
|
3341
|
+
export interface DeployableModel {
|
|
3233
3342
|
model_name?: string;
|
|
3234
3343
|
base_model?: string;
|
|
3235
3344
|
/** custom | public | base | … */
|
|
@@ -3258,7 +3367,7 @@ interface DeployableModel {
|
|
|
3258
3367
|
[k: string]: unknown;
|
|
3259
3368
|
}
|
|
3260
3369
|
/** A single deployment template (only used by `plan=mu` base models). */
|
|
3261
|
-
interface DeployableTemplate {
|
|
3370
|
+
export interface DeployableTemplate {
|
|
3262
3371
|
template_id?: string;
|
|
3263
3372
|
template_name?: string;
|
|
3264
3373
|
template_desc?: string;
|
|
@@ -3292,23 +3401,26 @@ interface DeployableTemplate {
|
|
|
3292
3401
|
[k: string]: unknown;
|
|
3293
3402
|
}
|
|
3294
3403
|
/** POST /api/v1/deployments request body. */
|
|
3295
|
-
interface CreateDeploymentRequest {
|
|
3404
|
+
export interface CreateDeploymentRequest {
|
|
3296
3405
|
/** Required. The catalog or fine-tuned model identifier. */
|
|
3297
3406
|
model_name: string;
|
|
3298
|
-
/**
|
|
3299
|
-
name
|
|
3407
|
+
/** Optional display name; PTU creation generates one when omitted. */
|
|
3408
|
+
name?: string;
|
|
3300
3409
|
/** Required. Billing plan: mu | cu | ptu | lora. CLI defaults to "lora". */
|
|
3301
3410
|
plan: string;
|
|
3411
|
+
/** Required for PTU creation; distinct from instance billing_method. */
|
|
3412
|
+
charge_type?: "pre_paid" | "post_paid";
|
|
3413
|
+
/** PTU performance tier; the service defaults to ptu_fast. */
|
|
3414
|
+
service_tier?: "ptu_fast" | "ptu_default";
|
|
3415
|
+
/** Optional ModelCode suffix; generated by the service when omitted. */
|
|
3416
|
+
suffix?: string;
|
|
3417
|
+
/** Required for prepaid PTU creation; omitted for postpaid. */
|
|
3418
|
+
pre_paid_info?: PrePaidInfo;
|
|
3302
3419
|
/** Required by API even for token-billed (lora) plans where it is ignored — CLI injects 1. */
|
|
3303
3420
|
capacity?: number;
|
|
3304
3421
|
/** Deploy spec id (e.g. "MU1", "dps-..."), sent as `deploy_spec` in POST body. */
|
|
3305
3422
|
deploy_spec?: string;
|
|
3306
|
-
/**
|
|
3307
|
-
* PTU capacity (provisioned throughput limits). Only effective when
|
|
3308
|
-
* `plan === "ptu"`. The doc says this defaults to 10000/1000 when omitted,
|
|
3309
|
-
* but the platform currently rejects creation without it ("Miss ptu capacity
|
|
3310
|
-
* info"), so the CLI treats it as required for ptu.
|
|
3311
|
-
*/
|
|
3423
|
+
/** Required PTU capacity in kTPM; values are forwarded without conversion. */
|
|
3312
3424
|
ptu_capacity?: PtuCapacity;
|
|
3313
3425
|
/**
|
|
3314
3426
|
* AIGC generation config for fine-tuned Wan video (i2v/kf2v) LoRA deployments.
|
|
@@ -3326,28 +3438,28 @@ interface CreateDeploymentRequest {
|
|
|
3326
3438
|
* - use_input_prompt=true: honor the caller's prompt.
|
|
3327
3439
|
* `lora_prompt_default` is the default trigger-word phrase appended for the LoRA.
|
|
3328
3440
|
*/
|
|
3329
|
-
interface AigcConfig {
|
|
3441
|
+
export interface AigcConfig {
|
|
3330
3442
|
use_input_prompt?: boolean;
|
|
3331
3443
|
prompt?: string;
|
|
3332
3444
|
lora_prompt_default?: string;
|
|
3333
3445
|
}
|
|
3334
|
-
/** PTU
|
|
3335
|
-
interface PtuCapacity {
|
|
3336
|
-
/**
|
|
3446
|
+
/** Legacy PTU input shape, retained for source compatibility. */
|
|
3447
|
+
export interface PtuCapacity {
|
|
3448
|
+
/** Input capacity in kTPM. */
|
|
3337
3449
|
input_tpm?: number;
|
|
3338
|
-
/**
|
|
3450
|
+
/** Output capacity in kTPM. */
|
|
3339
3451
|
output_tpm?: number;
|
|
3340
|
-
/**
|
|
3452
|
+
/** @deprecated Current reservation models do not support separate thinking-output capacity. */
|
|
3341
3453
|
thinking_output_tpm?: number;
|
|
3342
3454
|
}
|
|
3343
3455
|
/** POST /api/v1/deployments response. */
|
|
3344
|
-
interface CreateDeploymentResponse {
|
|
3456
|
+
export interface CreateDeploymentResponse {
|
|
3345
3457
|
request_id?: string;
|
|
3346
3458
|
output?: Deployment;
|
|
3347
3459
|
data?: Deployment;
|
|
3348
3460
|
}
|
|
3349
3461
|
/** GET /api/v1/deployments response. */
|
|
3350
|
-
interface ListDeploymentsResponse {
|
|
3462
|
+
export interface ListDeploymentsResponse {
|
|
3351
3463
|
request_id?: string;
|
|
3352
3464
|
output?: {
|
|
3353
3465
|
deployments?: Deployment[];
|
|
@@ -3365,27 +3477,78 @@ interface ListDeploymentsResponse {
|
|
|
3365
3477
|
};
|
|
3366
3478
|
}
|
|
3367
3479
|
/** GET /api/v1/deployments/{deployed_model} response. */
|
|
3368
|
-
interface GetDeploymentResponse {
|
|
3480
|
+
export interface GetDeploymentResponse {
|
|
3369
3481
|
request_id?: string;
|
|
3370
3482
|
output?: Deployment;
|
|
3371
3483
|
data?: Deployment;
|
|
3372
3484
|
}
|
|
3373
|
-
/**
|
|
3374
|
-
interface
|
|
3485
|
+
/** GET /api/v1/deployments/{deployed_model}/capacity-instances response. */
|
|
3486
|
+
export interface ListCapacityInstancesResponse {
|
|
3375
3487
|
request_id?: string;
|
|
3376
3488
|
output?: {
|
|
3489
|
+
records?: CapacityInstance[];
|
|
3490
|
+
/** Total record count, not the current page's records. */
|
|
3491
|
+
items?: number;
|
|
3492
|
+
page?: number;
|
|
3493
|
+
itemsPerPage?: number;
|
|
3494
|
+
pageCount?: number;
|
|
3495
|
+
[key: string]: unknown;
|
|
3496
|
+
};
|
|
3497
|
+
data?: ListCapacityInstancesResponse["output"];
|
|
3498
|
+
[key: string]: unknown;
|
|
3499
|
+
}
|
|
3500
|
+
/** GET /api/v1/deployments/{deployed_model}/capacity-instances/{instance_id} response. */
|
|
3501
|
+
export interface GetCapacityInstanceResponse {
|
|
3502
|
+
request_id?: string;
|
|
3503
|
+
output?: CapacityInstance;
|
|
3504
|
+
data?: CapacityInstance;
|
|
3505
|
+
[key: string]: unknown;
|
|
3506
|
+
}
|
|
3507
|
+
/** GET /api/v1/deployments/{deployed_model}/capacity-operations/{operation_id} response. */
|
|
3508
|
+
export interface GetCapacityOperationResponse {
|
|
3509
|
+
request_id?: string;
|
|
3510
|
+
output?: CapacityOperation;
|
|
3511
|
+
data?: CapacityOperation;
|
|
3512
|
+
[key: string]: unknown;
|
|
3513
|
+
}
|
|
3514
|
+
/** Instance writes return an operation, including HTTP 200 responses with status FAILED. */
|
|
3515
|
+
export type CapacityOperationResponse = GetCapacityOperationResponse;
|
|
3516
|
+
/** POST /api/v1/deployments/{deployed_model}/capacity-instances request body. */
|
|
3517
|
+
export interface CreateCapacityInstanceRequest {
|
|
3518
|
+
billing_method: "PRE_PAY" | "POST_PAY";
|
|
3519
|
+
ptu_capacity: ReservationCapacity;
|
|
3520
|
+
/** Required for PRE_PAY; omitted for POST_PAY. */
|
|
3521
|
+
pre_paid_info?: PrePaidInfo;
|
|
3522
|
+
}
|
|
3523
|
+
/** PUT /api/v1/deployments/{deployed_model}/capacity-instances/{instance_id}/scale body. */
|
|
3524
|
+
export interface ScaleCapacityInstanceRequest {
|
|
3525
|
+
/** Absolute target capacity for this instance, not a delta or deployment total. */
|
|
3526
|
+
ptu_capacity: ReservationCapacity;
|
|
3527
|
+
/** Omit to reuse saved prepaid information; do not send for postpaid. */
|
|
3528
|
+
pre_paid_info?: PrePaidInfo;
|
|
3529
|
+
order_type?: "UPGRADE" | "DOWNGRADE";
|
|
3530
|
+
}
|
|
3531
|
+
/** PUT /api/v1/deployments/{deployed_model}/capacity-instances/{instance_id}/renew body. */
|
|
3532
|
+
export interface RenewCapacityInstanceRequest {
|
|
3533
|
+
pre_paid_info: PrePaidInfo;
|
|
3534
|
+
/** Required to be true when changing capacity; defaults to false on the service. */
|
|
3535
|
+
is_change?: boolean;
|
|
3536
|
+
ptu_capacity?: ReservationCapacity;
|
|
3537
|
+
}
|
|
3538
|
+
/** PUT /api/v1/deployments/{deployed_model}/update-overflowstrategy response. */
|
|
3539
|
+
export type UpdateDeploymentOverflowResponse = GetDeploymentResponse;
|
|
3540
|
+
/** DELETE /api/v1/deployments/{deployed_model} response, including legacy deleted flags. */
|
|
3541
|
+
export interface DeleteDeploymentResponse {
|
|
3542
|
+
request_id?: string;
|
|
3543
|
+
output?: Deployment & {
|
|
3377
3544
|
deleted?: boolean;
|
|
3378
|
-
deployed_model?: string;
|
|
3379
|
-
[k: string]: unknown;
|
|
3380
3545
|
};
|
|
3381
|
-
data?: {
|
|
3546
|
+
data?: Deployment & {
|
|
3382
3547
|
deleted?: boolean;
|
|
3383
|
-
deployed_model?: string;
|
|
3384
|
-
[k: string]: unknown;
|
|
3385
3548
|
};
|
|
3386
3549
|
}
|
|
3387
3550
|
/** GET /api/v1/deployments/models response. */
|
|
3388
|
-
interface ListDeployableModelsResponse {
|
|
3551
|
+
export interface ListDeployableModelsResponse {
|
|
3389
3552
|
request_id?: string;
|
|
3390
3553
|
output?: {
|
|
3391
3554
|
models?: DeployableModel[];
|
|
@@ -3403,16 +3566,22 @@ interface ListDeployableModelsResponse {
|
|
|
3403
3566
|
};
|
|
3404
3567
|
}
|
|
3405
3568
|
/** PUT /api/v1/deployments/{deployed_model}/scale request body. */
|
|
3406
|
-
interface ScaleDeploymentRequest {
|
|
3407
|
-
/** New capacity in plan units.
|
|
3569
|
+
export interface ScaleDeploymentRequest {
|
|
3570
|
+
/** New capacity in legacy MU plan units. */
|
|
3408
3571
|
capacity?: number;
|
|
3409
|
-
/** PTU
|
|
3572
|
+
/** Required for PTU when more than one undeleted instance exists. */
|
|
3573
|
+
instance_id?: string;
|
|
3574
|
+
/** Absolute PTU target capacity for the selected instance, in kTPM. */
|
|
3575
|
+
ptu_capacity?: ReservationCapacity;
|
|
3576
|
+
pre_paid_info?: PrePaidInfo;
|
|
3577
|
+
order_type?: "UPGRADE" | "DOWNGRADE";
|
|
3578
|
+
/** Legacy top-level PTU fields retained for source compatibility. */
|
|
3410
3579
|
input_tpm?: number;
|
|
3411
3580
|
output_tpm?: number;
|
|
3412
3581
|
[k: string]: unknown;
|
|
3413
3582
|
}
|
|
3414
3583
|
/** PUT /api/v1/deployments/{deployed_model}/scale response. */
|
|
3415
|
-
interface ScaleDeploymentResponse {
|
|
3584
|
+
export interface ScaleDeploymentResponse {
|
|
3416
3585
|
request_id?: string;
|
|
3417
3586
|
output?: Deployment;
|
|
3418
3587
|
data?: Deployment;
|
|
@@ -3424,34 +3593,68 @@ interface ScaleDeploymentResponse {
|
|
|
3424
3593
|
* - rpm_limit: requests per minute
|
|
3425
3594
|
* - tpm_limit: tokens per minute
|
|
3426
3595
|
*/
|
|
3427
|
-
interface UpdateDeploymentRequest {
|
|
3596
|
+
export interface UpdateDeploymentRequest {
|
|
3428
3597
|
rpm_limit?: number;
|
|
3429
3598
|
tpm_limit?: number;
|
|
3430
3599
|
[k: string]: unknown;
|
|
3431
3600
|
}
|
|
3432
3601
|
/** PUT /api/v1/deployments/{deployed_model} response. */
|
|
3433
|
-
interface UpdateDeploymentResponse {
|
|
3602
|
+
export interface UpdateDeploymentResponse {
|
|
3434
3603
|
request_id?: string;
|
|
3435
3604
|
output?: Deployment;
|
|
3436
3605
|
data?: Deployment;
|
|
3437
3606
|
}
|
|
3438
3607
|
//#endregion
|
|
3439
3608
|
//#region src/deploy/api.d.ts
|
|
3440
|
-
/**
|
|
3441
|
-
|
|
3442
|
-
|
|
3609
|
+
/** Caller-owned idempotency key; wrappers never generate keys or retry writes. */
|
|
3610
|
+
export interface CapacityWriteOptions {
|
|
3611
|
+
requestId?: string;
|
|
3612
|
+
signal?: AbortSignal;
|
|
3613
|
+
}
|
|
3614
|
+
/** POST /api/v1/deployments; initial ModelCode creation has no instance-idempotency guarantee. */
|
|
3615
|
+
export declare function createDeployment(client: Client, body: CreateDeploymentRequest, signal?: AbortSignal): Promise<CreateDeploymentResponse>;
|
|
3616
|
+
export interface ListDeploymentsParams {
|
|
3443
3617
|
pageNo?: number;
|
|
3444
3618
|
pageSize?: number;
|
|
3445
|
-
|
|
3619
|
+
plan?: string;
|
|
3446
3620
|
signal?: AbortSignal;
|
|
3447
3621
|
}
|
|
3448
3622
|
/** GET /api/v1/deployments */
|
|
3449
|
-
declare function listDeployments(client: Client, params?: ListDeploymentsParams): Promise<ListDeploymentsResponse>;
|
|
3623
|
+
export declare function listDeployments(client: Client, params?: ListDeploymentsParams): Promise<ListDeploymentsResponse>;
|
|
3450
3624
|
/** GET /api/v1/deployments/{deployed_model} */
|
|
3451
|
-
declare function getDeployment(client: Client, deployedModel: string, signal?: AbortSignal): Promise<GetDeploymentResponse>;
|
|
3625
|
+
export declare function getDeployment(client: Client, deployedModel: string, signal?: AbortSignal): Promise<GetDeploymentResponse>;
|
|
3626
|
+
export interface ListCapacityInstancesParams {
|
|
3627
|
+
pageNo?: number;
|
|
3628
|
+
pageSize?: number;
|
|
3629
|
+
includeDeleted?: boolean;
|
|
3630
|
+
statuses?: string[];
|
|
3631
|
+
chargeTypes?: string[];
|
|
3632
|
+
signal?: AbortSignal;
|
|
3633
|
+
}
|
|
3634
|
+
/** GET /api/v1/deployments/{deployed_model}/capacity-instances */
|
|
3635
|
+
export declare function listCapacityInstances(client: Client, code: string, params?: ListCapacityInstancesParams): Promise<ListCapacityInstancesResponse>;
|
|
3636
|
+
/** GET /api/v1/deployments/{deployed_model}/capacity-instances/{instance_id} */
|
|
3637
|
+
export declare function getCapacityInstance(client: Client, code: string, id: string, signal?: AbortSignal): Promise<GetCapacityInstanceResponse>;
|
|
3638
|
+
/** GET /api/v1/deployments/{deployed_model}/capacity-operations/{operation_id} */
|
|
3639
|
+
export declare function getCapacityOperation(client: Client, code: string, id: string, signal?: AbortSignal): Promise<GetCapacityOperationResponse>;
|
|
3640
|
+
/**
|
|
3641
|
+
* POST /api/v1/deployments/{deployed_model}/capacity-instances
|
|
3642
|
+
* All instance writes return operations verbatim; callers must check operation_status, even on HTTP 200.
|
|
3643
|
+
*/
|
|
3644
|
+
export declare function createCapacityInstance(client: Client, code: string, body: CreateCapacityInstanceRequest, options?: CapacityWriteOptions): Promise<CapacityOperationResponse>;
|
|
3645
|
+
/** PUT /api/v1/deployments/{deployed_model}/capacity-instances/{instance_id}/scale */
|
|
3646
|
+
export declare function scaleCapacityInstance(client: Client, code: string, id: string, body: ScaleCapacityInstanceRequest, options?: CapacityWriteOptions): Promise<CapacityOperationResponse>;
|
|
3647
|
+
/** PUT /api/v1/deployments/{deployed_model}/capacity-instances/{instance_id}/renew */
|
|
3648
|
+
export declare function renewCapacityInstance(client: Client, code: string, id: string, body: RenewCapacityInstanceRequest, options?: CapacityWriteOptions): Promise<CapacityOperationResponse>;
|
|
3649
|
+
/** DELETE /api/v1/deployments/{deployed_model}/capacity-instances/{instance_id}; no JSON body. */
|
|
3650
|
+
export declare function deleteCapacityInstance(client: Client, code: string, id: string, options?: CapacityWriteOptions & {
|
|
3651
|
+
reason?: string;
|
|
3652
|
+
}): Promise<CapacityOperationResponse>;
|
|
3653
|
+
/** PUT /api/v1/deployments/{deployed_model}/update-overflowstrategy */
|
|
3654
|
+
export declare function updateDeploymentOverflow(client: Client, code: string, strategy: "enable" | "disable", signal?: AbortSignal): Promise<UpdateDeploymentOverflowResponse>;
|
|
3452
3655
|
/** DELETE /api/v1/deployments/{deployed_model} */
|
|
3453
|
-
declare function deleteDeployment(client: Client, deployedModel: string, signal?: AbortSignal): Promise<DeleteDeploymentResponse>;
|
|
3454
|
-
interface ListDeployableModelsParams {
|
|
3656
|
+
export declare function deleteDeployment(client: Client, deployedModel: string, signal?: AbortSignal): Promise<DeleteDeploymentResponse>;
|
|
3657
|
+
export interface ListDeployableModelsParams {
|
|
3455
3658
|
pageNo?: number;
|
|
3456
3659
|
pageSize?: number;
|
|
3457
3660
|
/** Catalog version filter, e.g. "v1.0". */
|
|
@@ -3461,15 +3664,15 @@ interface ListDeployableModelsParams {
|
|
|
3461
3664
|
signal?: AbortSignal;
|
|
3462
3665
|
}
|
|
3463
3666
|
/** GET /api/v1/deployments/models */
|
|
3464
|
-
declare function listDeployableModels(client: Client, params?: ListDeployableModelsParams): Promise<ListDeployableModelsResponse>;
|
|
3667
|
+
export declare function listDeployableModels(client: Client, params?: ListDeployableModelsParams): Promise<ListDeployableModelsResponse>;
|
|
3465
3668
|
/** PUT /api/v1/deployments/{deployed_model}/scale */
|
|
3466
|
-
declare function scaleDeployment(client: Client, deployedModel: string, body: ScaleDeploymentRequest, signal?: AbortSignal): Promise<ScaleDeploymentResponse>;
|
|
3669
|
+
export declare function scaleDeployment(client: Client, deployedModel: string, body: ScaleDeploymentRequest, signal?: AbortSignal, requestId?: string): Promise<ScaleDeploymentResponse>;
|
|
3467
3670
|
/**
|
|
3468
3671
|
* PUT /api/v1/deployments/{deployed_model}/update
|
|
3469
3672
|
*
|
|
3470
3673
|
* Update rate limits. At least one of `rpm_limit` / `tpm_limit` must be set.
|
|
3471
3674
|
*/
|
|
3472
|
-
declare function updateDeployment(client: Client, deployedModel: string, body: UpdateDeploymentRequest, signal?: AbortSignal): Promise<UpdateDeploymentResponse>;
|
|
3675
|
+
export declare function updateDeployment(client: Client, deployedModel: string, body: UpdateDeploymentRequest, signal?: AbortSignal): Promise<UpdateDeploymentResponse>;
|
|
3473
3676
|
//#endregion
|
|
3474
3677
|
//#region src/deploy/constants.d.ts
|
|
3475
3678
|
/**
|
|
@@ -3478,16 +3681,19 @@ declare function updateDeployment(client: Client, deployedModel: string, body: U
|
|
|
3478
3681
|
* string for these server-contract values.
|
|
3479
3682
|
*/
|
|
3480
3683
|
/** Billing plan (`--plan` value, matches the server's deployment plan). */
|
|
3481
|
-
declare const DEPLOY_PLAN: {
|
|
3482
|
-
/** Token-billed; the CLI default. */
|
|
3483
|
-
readonly
|
|
3684
|
+
export declare const DEPLOY_PLAN: {
|
|
3685
|
+
/** Token-billed; the CLI default. */
|
|
3686
|
+
readonly LORA: "lora";
|
|
3687
|
+
/** Token-billed, provisioned throughput. */
|
|
3688
|
+
readonly PTU: "ptu";
|
|
3689
|
+
/** Model-unit-billed. */
|
|
3484
3690
|
readonly MU: "mu";
|
|
3485
3691
|
};
|
|
3486
|
-
type DeployPlan = (typeof DEPLOY_PLAN)[keyof typeof DEPLOY_PLAN];
|
|
3692
|
+
export type DeployPlan = (typeof DEPLOY_PLAN)[keyof typeof DEPLOY_PLAN];
|
|
3487
3693
|
/** CLI default plan when `--plan` is omitted. */
|
|
3488
|
-
declare const DEFAULT_DEPLOY_PLAN: DeployPlan;
|
|
3694
|
+
export declare const DEFAULT_DEPLOY_PLAN: DeployPlan;
|
|
3489
3695
|
/** Deployment target modality — fixes the default plan when `--plan` is omitted. */
|
|
3490
|
-
type DeployModality = "text" | "audio" | "image";
|
|
3696
|
+
export type DeployModality = "text" | "audio" | "image";
|
|
3491
3697
|
/**
|
|
3492
3698
|
* Default plan per modality when `--plan` is omitted.
|
|
3493
3699
|
*
|
|
@@ -3498,34 +3704,57 @@ type DeployModality = "text" | "audio" | "image";
|
|
|
3498
3704
|
* speech-synthesis guide fixes `plan: "mu"` and requires deploy_spec /
|
|
3499
3705
|
* capacity / billing_method (all auto-picked by the mu strategy).
|
|
3500
3706
|
*/
|
|
3501
|
-
declare function defaultDeployPlan(modality: DeployModality): DeployPlan;
|
|
3707
|
+
export declare function defaultDeployPlan(modality: DeployModality): DeployPlan;
|
|
3502
3708
|
/** Billing method (`billing_method`, plan=mu only). */
|
|
3503
|
-
declare const BILLING_METHOD: {
|
|
3504
|
-
/** Post-paid (currently the only server-supported value). */
|
|
3709
|
+
export declare const BILLING_METHOD: {
|
|
3710
|
+
/** Post-paid (currently the only server-supported value). */
|
|
3711
|
+
readonly POST_PAY: "POST_PAY";
|
|
3712
|
+
/** Pre-paid. */
|
|
3505
3713
|
readonly PRE_PAY: "PRE_PAY";
|
|
3506
3714
|
};
|
|
3507
|
-
type BillingMethod = (typeof BILLING_METHOD)[keyof typeof BILLING_METHOD];
|
|
3715
|
+
export type BillingMethod = (typeof BILLING_METHOD)[keyof typeof BILLING_METHOD];
|
|
3508
3716
|
/** Default billing method for plan=mu when `--billing-method` is omitted. */
|
|
3509
|
-
declare const DEFAULT_BILLING_METHOD: BillingMethod;
|
|
3717
|
+
export declare const DEFAULT_BILLING_METHOD: BillingMethod;
|
|
3510
3718
|
/** Template charge type (`charge_type`) returned by the deployable-models catalog. */
|
|
3511
|
-
declare const CHARGE_TYPE: {
|
|
3719
|
+
export declare const CHARGE_TYPE: {
|
|
3512
3720
|
readonly POST_PAID: "post_paid";
|
|
3513
3721
|
readonly PRE_PAID: "pre_paid";
|
|
3514
3722
|
};
|
|
3515
|
-
type ChargeType = (typeof CHARGE_TYPE)[keyof typeof CHARGE_TYPE];
|
|
3723
|
+
export type ChargeType = (typeof CHARGE_TYPE)[keyof typeof CHARGE_TYPE];
|
|
3724
|
+
//#endregion
|
|
3725
|
+
//#region src/deploy/reservation.d.ts
|
|
3726
|
+
/** Shared flags for reservation creation, scaling and renewal; capacity is in kTPM. */
|
|
3727
|
+
export interface ReservationFlags {
|
|
3728
|
+
inputTpm?: number;
|
|
3729
|
+
outputTpm?: number;
|
|
3730
|
+
duration?: number;
|
|
3731
|
+
autoRenewal?: boolean;
|
|
3732
|
+
autoRenewalDuration?: number;
|
|
3733
|
+
autoRenewalCycle?: string;
|
|
3734
|
+
}
|
|
3735
|
+
/** Validate paired capacity locally; model-specific steps and limits belong to the service. */
|
|
3736
|
+
export declare function validateReservationCapacity(flags: ReservationFlags, required: boolean): string | undefined;
|
|
3737
|
+
/** Build validated capacity without converting units or dropping zero. */
|
|
3738
|
+
export declare function buildReservationCapacity(flags: ReservationFlags): ReservationCapacity;
|
|
3739
|
+
export declare function hasPrepaidFlags(flags: ReservationFlags): boolean;
|
|
3740
|
+
/** Validate a complete prepaid block whenever any prepaid field is supplied. */
|
|
3741
|
+
export declare function validatePrepaidFlags(flags: ReservationFlags, required: boolean): string | undefined;
|
|
3742
|
+
/** Build validated prepaid information, preserving explicit false and omitting absent fields. */
|
|
3743
|
+
export declare function buildPrepaidInfo(flags: ReservationFlags): PrePaidInfo | undefined;
|
|
3516
3744
|
//#endregion
|
|
3517
3745
|
//#region src/deploy/plans.d.ts
|
|
3518
3746
|
/** Plan-relevant subset of `deploy <modality> create` flags (parsed flags satisfy this shape). */
|
|
3519
|
-
interface CreatePlanFlags {
|
|
3747
|
+
export interface CreatePlanFlags extends ReservationFlags {
|
|
3520
3748
|
plan?: string;
|
|
3521
3749
|
deploySpec?: string;
|
|
3522
3750
|
capacity?: number;
|
|
3523
3751
|
billingMethod?: string;
|
|
3524
|
-
|
|
3525
|
-
|
|
3752
|
+
chargeType?: string;
|
|
3753
|
+
serviceTier?: string;
|
|
3754
|
+
suffix?: string;
|
|
3526
3755
|
thinkingOutputTpm?: number;
|
|
3527
3756
|
}
|
|
3528
|
-
interface PlanContext {
|
|
3757
|
+
export interface PlanContext {
|
|
3529
3758
|
client: Client;
|
|
3530
3759
|
/** True in --dry-run: strategies must skip side-effecting catalog lookups. */
|
|
3531
3760
|
dryRun: boolean;
|
|
@@ -3534,17 +3763,17 @@ interface PlanContext {
|
|
|
3534
3763
|
flags: CreatePlanFlags;
|
|
3535
3764
|
/** Underlying model identifier (`--model`). */
|
|
3536
3765
|
model: string;
|
|
3537
|
-
/**
|
|
3538
|
-
name
|
|
3766
|
+
/** Optional console display name (`--name`); PTU can use the generated name. */
|
|
3767
|
+
name?: string;
|
|
3539
3768
|
}
|
|
3540
|
-
interface PlanResolved {
|
|
3769
|
+
export interface PlanResolved {
|
|
3541
3770
|
/**
|
|
3542
3771
|
* Plan-specific fields to merge into the request body. The shared envelope
|
|
3543
3772
|
* (`{model_name, name, plan}`) is added by the caller.
|
|
3544
3773
|
*/
|
|
3545
3774
|
body: Record<string, unknown>;
|
|
3546
3775
|
}
|
|
3547
|
-
interface PlanStrategy {
|
|
3776
|
+
export interface PlanStrategy {
|
|
3548
3777
|
/** Plan id, matches `--plan` CLI value. */
|
|
3549
3778
|
name: string;
|
|
3550
3779
|
/** Returns an error message when required flags are missing; undefined to pass. */
|
|
@@ -3561,15 +3790,15 @@ interface PlanStrategy {
|
|
|
3561
3790
|
* accepted by the create endpoint, so the dispatcher in the command will
|
|
3562
3791
|
* reject anything outside this table with a clear USAGE error.
|
|
3563
3792
|
*/
|
|
3564
|
-
declare const STRATEGIES: Record<string, PlanStrategy>;
|
|
3793
|
+
export declare const STRATEGIES: Record<string, PlanStrategy>;
|
|
3565
3794
|
/** Throws USAGE if `plan` is not in the strategy table. */
|
|
3566
|
-
declare function pickPlanStrategy(plan: string): PlanStrategy;
|
|
3795
|
+
export declare function pickPlanStrategy(plan: string): PlanStrategy;
|
|
3567
3796
|
//#endregion
|
|
3568
3797
|
//#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 {
|
|
3798
|
+
export declare const DEPLOY_START_API = "zeldaEasy.broadscope-platform.modelInstance.startModelService";
|
|
3799
|
+
export declare const DEPLOY_STOP_API = "zeldaEasy.broadscope-platform.modelInstance.stopModelService";
|
|
3800
|
+
export declare const DEPLOY_LIST_INDEPENDENT_API = "zeldaEasy.broadscope-platform.modelInstance.listIndependentDeployedModel";
|
|
3801
|
+
export interface ModelServiceEntry {
|
|
3573
3802
|
modelServiceId?: string;
|
|
3574
3803
|
deployedModel?: string;
|
|
3575
3804
|
deployed_model?: string;
|
|
@@ -3580,24 +3809,24 @@ interface ModelServiceEntry {
|
|
|
3580
3809
|
[key: string]: unknown;
|
|
3581
3810
|
}
|
|
3582
3811
|
/** Start (bring online) a stopped deployment. */
|
|
3583
|
-
declare function startModelService(client: Client, modelServiceId: string): Promise<Record<string, unknown>>;
|
|
3812
|
+
export declare function startModelService(client: Client, modelServiceId: string): Promise<Record<string, unknown>>;
|
|
3584
3813
|
/** Stop (take offline) a running deployment. Stops billing for mu/ptu plans. */
|
|
3585
|
-
declare function stopModelService(client: Client, modelServiceId: string): Promise<Record<string, unknown>>;
|
|
3814
|
+
export declare function stopModelService(client: Client, modelServiceId: string): Promise<Record<string, unknown>>;
|
|
3586
3815
|
/**
|
|
3587
3816
|
* List independently deployed models (console domain).
|
|
3588
3817
|
* Used for precheck status verification and ID mapping.
|
|
3589
3818
|
* Paginates internally to return all entries.
|
|
3590
3819
|
*/
|
|
3591
|
-
declare function listIndependentDeployedModels(client: Client): Promise<ModelServiceEntry[]>;
|
|
3820
|
+
export declare function listIndependentDeployedModels(client: Client): Promise<ModelServiceEntry[]>;
|
|
3592
3821
|
/**
|
|
3593
3822
|
* Find a deployment entry by its identifier in the console-domain list.
|
|
3594
3823
|
* Matches against `modelServiceId`, `deployedModel`, or `deployed_model`.
|
|
3595
3824
|
*/
|
|
3596
|
-
declare function findDeploymentEntry(entries: ModelServiceEntry[], deployedModel: string): ModelServiceEntry | undefined;
|
|
3825
|
+
export declare function findDeploymentEntry(entries: ModelServiceEntry[], deployedModel: string): ModelServiceEntry | undefined;
|
|
3597
3826
|
//#endregion
|
|
3598
3827
|
//#region src/speech/vocabulary.d.ts
|
|
3599
3828
|
/** Fixed model id for the hot-word customization endpoint. */
|
|
3600
|
-
declare const SPEECH_BIASING_MODEL = "speech-biasing";
|
|
3829
|
+
export declare const SPEECH_BIASING_MODEL = "speech-biasing";
|
|
3601
3830
|
interface VocabularyEntry {
|
|
3602
3831
|
text: string;
|
|
3603
3832
|
weight: number;
|
|
@@ -3622,47 +3851,47 @@ interface VocabularyRequest {
|
|
|
3622
3851
|
input: Record<string, unknown>;
|
|
3623
3852
|
}
|
|
3624
3853
|
/** 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: {
|
|
3854
|
+
export declare function buildVocabularyRequest(action: string, input: Record<string, unknown>): VocabularyRequest;
|
|
3855
|
+
export declare function createVocabulary(client: Client, params: {
|
|
3627
3856
|
targetModel: string;
|
|
3628
3857
|
prefix: string;
|
|
3629
3858
|
vocabulary: VocabularyEntry[];
|
|
3630
3859
|
}, signal?: AbortSignal): Promise<VocabularyEnvelope<{
|
|
3631
3860
|
vocabulary_id?: string;
|
|
3632
3861
|
}>>;
|
|
3633
|
-
declare function listVocabularies(client: Client, params?: {
|
|
3862
|
+
export declare function listVocabularies(client: Client, params?: {
|
|
3634
3863
|
prefix?: string;
|
|
3635
3864
|
pageIndex?: number;
|
|
3636
3865
|
pageSize?: number;
|
|
3637
3866
|
}, signal?: AbortSignal): Promise<VocabularyEnvelope<{
|
|
3638
3867
|
vocabulary_list?: VocabularyListItem[];
|
|
3639
3868
|
}>>;
|
|
3640
|
-
declare function queryVocabulary(client: Client, vocabularyId: string, signal?: AbortSignal): Promise<VocabularyEnvelope<{
|
|
3869
|
+
export declare function queryVocabulary(client: Client, vocabularyId: string, signal?: AbortSignal): Promise<VocabularyEnvelope<{
|
|
3641
3870
|
gmt_create?: string;
|
|
3642
3871
|
gmt_modified?: string;
|
|
3643
3872
|
status?: string;
|
|
3644
3873
|
target_model?: string;
|
|
3645
3874
|
vocabulary?: VocabularyEntry[];
|
|
3646
3875
|
}>>;
|
|
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>>>;
|
|
3876
|
+
export declare function updateVocabulary(client: Client, vocabularyId: string, vocabulary: VocabularyEntry[], signal?: AbortSignal): Promise<VocabularyEnvelope<Record<string, never>>>;
|
|
3877
|
+
export declare function deleteVocabulary(client: Client, vocabularyId: string, signal?: AbortSignal): Promise<VocabularyEnvelope<Record<string, never>>>;
|
|
3649
3878
|
//#endregion
|
|
3650
3879
|
//#region src/speech/vocabulary-input.d.ts
|
|
3651
3880
|
/**
|
|
3652
3881
|
* Instant hot words for `recognize --vocabulary`.
|
|
3653
3882
|
* The API field is a flat word→weight object, so an array is a usage error here.
|
|
3654
3883
|
*/
|
|
3655
|
-
declare function parseInstantVocabulary(raw: string): Record<string, number>;
|
|
3884
|
+
export declare function parseInstantVocabulary(raw: string): Record<string, number>;
|
|
3656
3885
|
/**
|
|
3657
3886
|
* Vocabulary create/update --words.
|
|
3658
3887
|
* Accepts the same word→weight object as recognize, or the API entry array
|
|
3659
3888
|
* when per-entry lang is needed. Array form ignores the optional lang param.
|
|
3660
3889
|
*/
|
|
3661
|
-
declare function parseVocabularyEntries(raw: string, lang?: string): VocabularyEntry[];
|
|
3890
|
+
export declare function parseVocabularyEntries(raw: string, lang?: string): VocabularyEntry[];
|
|
3662
3891
|
//#endregion
|
|
3663
3892
|
//#region src/types/command-pack.d.ts
|
|
3664
3893
|
/** Current Command Pack protocol version understood by this release. */
|
|
3665
|
-
declare const COMMAND_PACK_API_VERSION: 1;
|
|
3894
|
+
export declare const COMMAND_PACK_API_VERSION: 1;
|
|
3666
3895
|
/** `package.json#bailianCli` metadata for a Command Pack package. */
|
|
3667
3896
|
interface CommandPackMeta {
|
|
3668
3897
|
type: "command-pack";
|
|
@@ -3772,7 +4001,7 @@ interface SecurityAlertList {
|
|
|
3772
4001
|
}
|
|
3773
4002
|
//#endregion
|
|
3774
4003
|
//#region src/utils/filename.d.ts
|
|
3775
|
-
declare function generateFilename(prefix: string, prompt: string): string;
|
|
4004
|
+
export declare function generateFilename(prefix: string, prompt: string): string;
|
|
3776
4005
|
//#endregion
|
|
3777
4006
|
//#region src/utils/output-dir.d.ts
|
|
3778
4007
|
/**
|
|
@@ -3786,13 +4015,13 @@ declare function generateFilename(prefix: string, prompt: string): string;
|
|
|
3786
4015
|
* Optionally appends a subdirectory (e.g. 'images', 'videos', 'speech').
|
|
3787
4016
|
* Creates the directory if it doesn't exist.
|
|
3788
4017
|
*/
|
|
3789
|
-
declare function resolveOutputDir(settings: Settings, options?: {
|
|
4018
|
+
export declare function resolveOutputDir(settings: Settings, options?: {
|
|
3790
4019
|
flagDir?: string;
|
|
3791
4020
|
subDir?: string;
|
|
3792
4021
|
}): string;
|
|
3793
4022
|
//#endregion
|
|
3794
4023
|
//#region src/utils/token.d.ts
|
|
3795
|
-
declare function maskToken(token: string): string;
|
|
4024
|
+
export declare function maskToken(token: string): string;
|
|
3796
4025
|
//#endregion
|
|
3797
4026
|
//#region src/utils/object.d.ts
|
|
3798
4027
|
/**
|
|
@@ -3807,29 +4036,29 @@ declare function maskToken(token: string): string;
|
|
|
3807
4036
|
* stripUndefined(params); // { a: 1 }
|
|
3808
4037
|
* ```
|
|
3809
4038
|
*/
|
|
3810
|
-
declare function stripUndefined<T extends Record<string, unknown>>(obj: T): T;
|
|
4039
|
+
export declare function stripUndefined<T extends Record<string, unknown>>(obj: T): T;
|
|
3811
4040
|
//#endregion
|
|
3812
4041
|
//#region src/utils/fs.d.ts
|
|
3813
|
-
declare function readTextFromPathOrStdin(path: string): string;
|
|
4042
|
+
export declare function readTextFromPathOrStdin(path: string): string;
|
|
3814
4043
|
//#endregion
|
|
3815
4044
|
//#region src/utils/concurrency.d.ts
|
|
3816
4045
|
/**
|
|
3817
4046
|
* Run async task factories with a bounded concurrency pool.
|
|
3818
4047
|
* Returns results in the same order as the input tasks array.
|
|
3819
4048
|
*/
|
|
3820
|
-
declare function runWithConcurrency<T>(tasks: Array<() => Promise<T>>, limit: number): Promise<T[]>;
|
|
4049
|
+
export declare function runWithConcurrency<T>(tasks: Array<() => Promise<T>>, limit: number): Promise<T[]>;
|
|
3821
4050
|
//#endregion
|
|
3822
4051
|
//#region src/utils/boolean-flag.d.ts
|
|
3823
4052
|
/** 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;
|
|
4053
|
+
export declare function parseBooleanValue(value: unknown, label?: string): boolean;
|
|
4054
|
+
export declare function parseOptionalBooleanValue(value: unknown, label?: string): boolean | undefined;
|
|
3826
4055
|
/**
|
|
3827
4056
|
* Resolve a tri-state boolean CLI flag (`--name <bool>`).
|
|
3828
4057
|
* Returns `defaultWhenUnset` when the flag is omitted.
|
|
3829
4058
|
*/
|
|
3830
|
-
declare function resolveBooleanFlag(flagValue: unknown, defaultWhenUnset: boolean | undefined, label?: string): boolean | undefined;
|
|
4059
|
+
export declare function resolveBooleanFlag(flagValue: unknown, defaultWhenUnset: boolean | undefined, label?: string): boolean | undefined;
|
|
3831
4060
|
/** Resolve `--watermark`; command flag overrides config, then defaults to true. */
|
|
3832
|
-
declare function resolveWatermark(flagValue: unknown, configuredValue?: boolean): boolean;
|
|
4061
|
+
export declare function resolveWatermark(flagValue: unknown, configuredValue?: boolean): boolean;
|
|
3833
4062
|
//#endregion
|
|
3834
4063
|
//#region src/telemetry/event.d.ts
|
|
3835
4064
|
interface TrackingEvent {
|
|
@@ -3847,7 +4076,7 @@ interface TrackingEvent {
|
|
|
3847
4076
|
authMethod?: AuthRequirement;
|
|
3848
4077
|
params?: Record<string, unknown>;
|
|
3849
4078
|
}
|
|
3850
|
-
declare function createTrackingEvent(opts: {
|
|
4079
|
+
export declare function createTrackingEvent(opts: {
|
|
3851
4080
|
command: string;
|
|
3852
4081
|
durationMs: number;
|
|
3853
4082
|
success: boolean;
|
|
@@ -3873,9 +4102,9 @@ declare function createTrackingEvent(opts: {
|
|
|
3873
4102
|
* 埋点永远不应阻塞 CLI:调用方应传入较短的超时(例如 1000ms),并始终与超时
|
|
3874
4103
|
* race。错误与超时一律静默吞掉。
|
|
3875
4104
|
*/
|
|
3876
|
-
declare function flushTelemetry(timeoutMs?: number): Promise<void>;
|
|
3877
|
-
declare function localSink(event: TrackingEvent): Promise<void>;
|
|
3878
|
-
declare function remoteSink(event: TrackingEvent): Promise<void>;
|
|
4105
|
+
export declare function flushTelemetry(timeoutMs?: number): Promise<void>;
|
|
4106
|
+
export declare function localSink(event: TrackingEvent): Promise<void>;
|
|
4107
|
+
export declare function remoteSink(event: TrackingEvent): Promise<void>;
|
|
3879
4108
|
//#endregion
|
|
3880
4109
|
//#region src/telemetry/tracker.d.ts
|
|
3881
4110
|
/** 遥测只记录命令声明的鉴权域,不接触具体凭证能力。 */
|
|
@@ -3884,7 +4113,7 @@ interface TrackingDeps {
|
|
|
3884
4113
|
settings: Settings;
|
|
3885
4114
|
authMethod?: AuthRequirement;
|
|
3886
4115
|
}
|
|
3887
|
-
declare function trackCommandExecution(deps: TrackingDeps, commandPath: string[], flags: Record<string, unknown>, fn: () => Promise<void>): Promise<void>;
|
|
4116
|
+
export declare function trackCommandExecution(deps: TrackingDeps, commandPath: string[], flags: Record<string, unknown>, fn: () => Promise<void>): Promise<void>;
|
|
3888
4117
|
//#endregion
|
|
3889
4118
|
//#region src/advisor/types.d.ts
|
|
3890
4119
|
type Modality = "Text" | "Image" | "Video" | "Audio";
|
|
@@ -3901,32 +4130,32 @@ interface ModelPreference {
|
|
|
3901
4130
|
targets?: string[];
|
|
3902
4131
|
excludes?: string[];
|
|
3903
4132
|
}
|
|
3904
|
-
declare const Modalities: {
|
|
4133
|
+
export declare const Modalities: {
|
|
3905
4134
|
readonly Text: "Text";
|
|
3906
4135
|
readonly Image: "Image";
|
|
3907
4136
|
readonly Video: "Video";
|
|
3908
4137
|
readonly Audio: "Audio";
|
|
3909
4138
|
};
|
|
3910
|
-
declare const Complexities: {
|
|
4139
|
+
export declare const Complexities: {
|
|
3911
4140
|
readonly Single: "single";
|
|
3912
4141
|
readonly Pipeline: "pipeline";
|
|
3913
4142
|
};
|
|
3914
|
-
declare const Budgets: {
|
|
4143
|
+
export declare const Budgets: {
|
|
3915
4144
|
readonly Low: "low";
|
|
3916
4145
|
readonly Medium: "medium";
|
|
3917
4146
|
readonly High: "high";
|
|
3918
4147
|
};
|
|
3919
|
-
declare const ContextNeeds: {
|
|
4148
|
+
export declare const ContextNeeds: {
|
|
3920
4149
|
readonly Standard: "standard";
|
|
3921
4150
|
readonly Large: "large";
|
|
3922
4151
|
readonly ExtraLarge: "extra-large";
|
|
3923
4152
|
};
|
|
3924
|
-
declare const QualityPreferences: {
|
|
4153
|
+
export declare const QualityPreferences: {
|
|
3925
4154
|
readonly Flagship: "flagship";
|
|
3926
4155
|
readonly Balanced: "balanced";
|
|
3927
4156
|
readonly CostOptimized: "cost-optimized";
|
|
3928
4157
|
};
|
|
3929
|
-
declare const Capabilities: {
|
|
4158
|
+
export declare const Capabilities: {
|
|
3930
4159
|
readonly TG: "TG";
|
|
3931
4160
|
readonly Reasoning: "Reasoning";
|
|
3932
4161
|
readonly VU: "VU";
|
|
@@ -3943,13 +4172,13 @@ declare const Capabilities: {
|
|
|
3943
4172
|
readonly TR: "TR";
|
|
3944
4173
|
readonly ThreeDGeneration: "3D-generation";
|
|
3945
4174
|
};
|
|
3946
|
-
declare const Features: {
|
|
4175
|
+
export declare const Features: {
|
|
3947
4176
|
readonly FunctionCalling: "function-calling";
|
|
3948
4177
|
readonly WebSearch: "web-search";
|
|
3949
4178
|
readonly StructuredOutputs: "structured-outputs";
|
|
3950
4179
|
readonly PrefixCompletion: "prefix-completion";
|
|
3951
4180
|
};
|
|
3952
|
-
declare const ModelCategories: {
|
|
4181
|
+
export declare const ModelCategories: {
|
|
3953
4182
|
readonly Flagship: "Flagship";
|
|
3954
4183
|
readonly CostOptimized: "Cost-optimized";
|
|
3955
4184
|
};
|
|
@@ -4048,10 +4277,10 @@ type RecommendResult = SingleResult | PipelineResult;
|
|
|
4048
4277
|
interface GetModelsOptions {
|
|
4049
4278
|
onPrepareStart?: () => void;
|
|
4050
4279
|
}
|
|
4051
|
-
declare function getModels(settings: Settings, options?: GetModelsOptions): Promise<ModelProfile[]>;
|
|
4280
|
+
export declare function getModels(settings: Settings, options?: GetModelsOptions): Promise<ModelProfile[]>;
|
|
4052
4281
|
//#endregion
|
|
4053
4282
|
//#region src/advisor/constants/scoring.d.ts
|
|
4054
|
-
declare const SEMANTIC_TOP_K = 20;
|
|
4283
|
+
export declare const SEMANTIC_TOP_K = 20;
|
|
4055
4284
|
//#endregion
|
|
4056
4285
|
//#region src/advisor/intent.d.ts
|
|
4057
4286
|
/**
|
|
@@ -4063,7 +4292,7 @@ declare const SEMANTIC_TOP_K = 20;
|
|
|
4063
4292
|
*
|
|
4064
4293
|
* On failure, degrades gracefully to DEFAULT_INTENT with confidence 0.
|
|
4065
4294
|
*/
|
|
4066
|
-
declare function analyzeIntent(client: Client, input: string): Promise<IntentProfile>;
|
|
4295
|
+
export declare function analyzeIntent(client: Client, input: string): Promise<IntentProfile>;
|
|
4067
4296
|
//#endregion
|
|
4068
4297
|
//#region src/advisor/recall.d.ts
|
|
4069
4298
|
interface ScoredCandidate {
|
|
@@ -4074,11 +4303,11 @@ interface ScoredCandidate {
|
|
|
4074
4303
|
/** Cosine similarity [0,1] between the semantic query and the model embedding. */
|
|
4075
4304
|
softScore?: number;
|
|
4076
4305
|
}
|
|
4077
|
-
declare function recallCandidates(models: ModelProfile[], intent: IntentProfile): ScoredCandidate[];
|
|
4306
|
+
export declare function recallCandidates(models: ModelProfile[], intent: IntentProfile): ScoredCandidate[];
|
|
4078
4307
|
//#endregion
|
|
4079
4308
|
//#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[]>;
|
|
4309
|
+
export declare function isSemanticAvailable(): boolean;
|
|
4310
|
+
export declare function recallSemantic(client: Client, models: ModelProfile[], query: string, topK: number, intent?: IntentProfile): Promise<ScoredCandidate[]>;
|
|
4082
4311
|
//#endregion
|
|
4083
4312
|
//#region src/advisor/recommend.d.ts
|
|
4084
4313
|
interface RecommendOptions {
|
|
@@ -4086,15 +4315,15 @@ interface RecommendOptions {
|
|
|
4086
4315
|
onContentStart?: () => void;
|
|
4087
4316
|
enableThinking?: boolean;
|
|
4088
4317
|
}
|
|
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>;
|
|
4318
|
+
export declare function buildDocLink(docUrl?: string): string | undefined;
|
|
4319
|
+
export declare function rankModels(client: Client, candidates: ScoredCandidate[], intent: IntentProfile, userInput: string, top: number, options?: RecommendOptions): Promise<RecommendResult>;
|
|
4091
4320
|
//#endregion
|
|
4092
4321
|
//#region src/advisor/sync.d.ts
|
|
4093
4322
|
/**
|
|
4094
4323
|
* Check and sync Wiki data. Runs silently; never throws.
|
|
4095
4324
|
* @returns Whether data was actually updated (for testing/debugging)
|
|
4096
4325
|
*/
|
|
4097
|
-
declare function maybeSyncWikiData(): Promise<boolean>;
|
|
4326
|
+
export declare function maybeSyncWikiData(): Promise<boolean>;
|
|
4098
4327
|
//#endregion
|
|
4099
4328
|
//#region src/advisor/sources/types.d.ts
|
|
4100
4329
|
interface ModelSource {
|
|
@@ -4107,7 +4336,7 @@ interface ModelSource {
|
|
|
4107
4336
|
/** How the CLI was installed on this machine. */
|
|
4108
4337
|
type InstallMethod = "binary" | "npm" | "brew" | "winget" | "unknown";
|
|
4109
4338
|
/** Product that currently ships standalone binary artifacts (`bl` / `bailian`). */
|
|
4110
|
-
declare const BINARY_PRODUCT_CLIENT_NAME = "bailian-cli";
|
|
4339
|
+
export declare const BINARY_PRODUCT_CLIENT_NAME = "bailian-cli";
|
|
4111
4340
|
type InstallMethodIdentity = {
|
|
4112
4341
|
clientName: string;
|
|
4113
4342
|
};
|
|
@@ -4117,9 +4346,9 @@ type InstallMethodIdentity = {
|
|
|
4117
4346
|
*
|
|
4118
4347
|
* Binary entrypoints set `BAILIAN_COMPILED=1` before other code runs.
|
|
4119
4348
|
*/
|
|
4120
|
-
declare function isCompiledBinary(): boolean;
|
|
4349
|
+
export declare function isCompiledBinary(): boolean;
|
|
4121
4350
|
/** Infer install method when no marker file / env override is present. */
|
|
4122
|
-
declare function detectInstallMethod(): InstallMethod;
|
|
4351
|
+
export declare function detectInstallMethod(): InstallMethod;
|
|
4123
4352
|
/**
|
|
4124
4353
|
* Read the persisted install method, falling back to detection.
|
|
4125
4354
|
*
|
|
@@ -4127,13 +4356,13 @@ declare function detectInstallMethod(): InstallMethod;
|
|
|
4127
4356
|
* Legacy `~/.bailian/install-method` is only consulted for `bailian-cli`
|
|
4128
4357
|
* so other products (e.g. kscli) are not polluted by a shared binary marker.
|
|
4129
4358
|
*/
|
|
4130
|
-
declare function getInstallMethod(identity?: InstallMethodIdentity): InstallMethod;
|
|
4359
|
+
export declare function getInstallMethod(identity?: InstallMethodIdentity): InstallMethod;
|
|
4131
4360
|
/**
|
|
4132
4361
|
* Install method for update / auto-update routing.
|
|
4133
4362
|
* Only `bailian-cli` may follow the binary channel; other products always use npm
|
|
4134
4363
|
* even if env or a mistaken marker claims `binary`.
|
|
4135
4364
|
*/
|
|
4136
|
-
declare function getUpdateInstallMethod(identity: {
|
|
4365
|
+
export declare function getUpdateInstallMethod(identity: {
|
|
4137
4366
|
clientName: string;
|
|
4138
4367
|
npmPackage: string;
|
|
4139
4368
|
}): InstallMethod;
|
|
@@ -4141,7 +4370,7 @@ declare function getUpdateInstallMethod(identity: {
|
|
|
4141
4370
|
* Persist install method under `~/.bailian/install-method.<clientName>` (best-effort).
|
|
4142
4371
|
* For `bailian-cli`, also write the legacy `install-method` file for older readers.
|
|
4143
4372
|
*/
|
|
4144
|
-
declare function writeInstallMethodSync(method: InstallMethod, identity?: InstallMethodIdentity): void;
|
|
4373
|
+
export declare function writeInstallMethodSync(method: InstallMethod, identity?: InstallMethodIdentity): void;
|
|
4145
4374
|
//#endregion
|
|
4146
4375
|
//#region src/install/cdn.d.ts
|
|
4147
4376
|
/**
|
|
@@ -4164,13 +4393,13 @@ declare function writeInstallMethodSync(method: InstallMethod, identity?: Instal
|
|
|
4164
4393
|
*
|
|
4165
4394
|
* Override with `BAILIAN_CLI_CDN`.
|
|
4166
4395
|
*/
|
|
4167
|
-
declare const DEFAULT_CLI_CDN_BASE = "https://bailian-wiki.oss-cn-hangzhou.aliyuncs.com/release";
|
|
4396
|
+
export declare const DEFAULT_CLI_CDN_BASE = "https://bailian-wiki.oss-cn-hangzhou.aliyuncs.com/release";
|
|
4168
4397
|
/** GitHub Releases base — used when writing manifests attached to gh release assets. */
|
|
4169
|
-
declare const GITHUB_RELEASES_BASE = "https://github.com/modelstudioai/cli/releases";
|
|
4398
|
+
export declare const GITHUB_RELEASES_BASE = "https://github.com/modelstudioai/cli/releases";
|
|
4170
4399
|
/** 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;
|
|
4400
|
+
export declare const DEFAULT_INSTALL_SCRIPT_URL = "https://bailian.aliyun.com/cli/install.sh";
|
|
4401
|
+
export declare const DEFAULT_INSTALL_PS1_URL = "https://bailian.aliyun.com/cli/install.ps1";
|
|
4402
|
+
export declare function getCliCdnBase(): string;
|
|
4174
4403
|
/**
|
|
4175
4404
|
* Rolling manifest URL at the CDN base root.
|
|
4176
4405
|
* Stable (`latest` / `stable` / empty) → `manifest.json`.
|
|
@@ -4178,31 +4407,31 @@ declare function getCliCdnBase(): string;
|
|
|
4178
4407
|
* Other names still map to `{channel}.json` for backward compatibility only.
|
|
4179
4408
|
* All share the same rolling-manifest shape from binary-build.
|
|
4180
4409
|
*/
|
|
4181
|
-
declare function channelManifestUrl(channel?: string): string;
|
|
4410
|
+
export declare function channelManifestUrl(channel?: string): string;
|
|
4182
4411
|
/** Immutable per-version asset: `{base}/v{version}/{fileName}`. */
|
|
4183
|
-
declare function releaseAssetUrl(version: string, fileName: string): string;
|
|
4412
|
+
export declare function releaseAssetUrl(version: string, fileName: string): string;
|
|
4184
4413
|
/** Platform triple used in asset names: `bl-<ver>-<os>-<arch>[.exe]`. */
|
|
4185
|
-
declare function detectBinaryPlatform(): {
|
|
4414
|
+
export declare function detectBinaryPlatform(): {
|
|
4186
4415
|
os: string;
|
|
4187
4416
|
arch: string;
|
|
4188
4417
|
fileSuffix: string;
|
|
4189
4418
|
};
|
|
4190
4419
|
/** Release download asset: `bl-<ver>-<os>-<arch>.zip`. */
|
|
4191
|
-
declare function binaryAssetFileName(version: string, os: string, arch: string, _exe?: boolean): string;
|
|
4420
|
+
export declare function binaryAssetFileName(version: string, os: string, arch: string, _exe?: boolean): string;
|
|
4192
4421
|
/**
|
|
4193
4422
|
* Unix install.sh archive: `bl-<ver>-<os>-<arch>.tar.gz`.
|
|
4194
4423
|
* Windows has no tar.gz (PowerShell Expand-Archive uses zip).
|
|
4195
4424
|
*/
|
|
4196
|
-
declare function binaryTarFileName(version: string, os: string, arch: string): string | undefined;
|
|
4425
|
+
export declare function binaryTarFileName(version: string, os: string, arch: string): string | undefined;
|
|
4197
4426
|
/** Uncompressed binary name inside the zip. */
|
|
4198
|
-
declare function binaryInnerFileName(version: string, os: string, arch: string, exe?: boolean): string;
|
|
4427
|
+
export declare function binaryInnerFileName(version: string, os: string, arch: string, exe?: boolean): string;
|
|
4199
4428
|
//#endregion
|
|
4200
4429
|
//#region src/install/unzip-asset.d.ts
|
|
4201
4430
|
/**
|
|
4202
4431
|
* Extract `entryName` (or the first non-directory entry) from `zipPath` to `destPath`.
|
|
4203
4432
|
* Returns the archive entry basename that was extracted.
|
|
4204
4433
|
*/
|
|
4205
|
-
declare function extractZipEntryToFile(zipPath: string, destPath: string, entryName?: string): Promise<string>;
|
|
4434
|
+
export declare function extractZipEntryToFile(zipPath: string, destPath: string, entryName?: string): Promise<string>;
|
|
4206
4435
|
//#endregion
|
|
4207
4436
|
//#region src/skills/types.d.ts
|
|
4208
4437
|
/**
|
|
@@ -4276,18 +4505,18 @@ interface SkillStatusRow {
|
|
|
4276
4505
|
}
|
|
4277
4506
|
//#endregion
|
|
4278
4507
|
//#region src/skills/registry.d.ts
|
|
4279
|
-
declare function getSkillRegistryBaseUrl(): string;
|
|
4508
|
+
export declare function getSkillRegistryBaseUrl(): string;
|
|
4280
4509
|
/**
|
|
4281
4510
|
* Fetch the remote skill index. No local caching — the diff comparison is always
|
|
4282
4511
|
* "live remote index vs local skill-lock.json".
|
|
4283
4512
|
* Silent background channels (advisor sync) may pass a tighter timeout and attempts=1
|
|
4284
4513
|
* than the interactive defaults.
|
|
4285
4514
|
*/
|
|
4286
|
-
declare function fetchSkillsIndex(timeoutMs?: number, attempts?: number): Promise<SkillsIndex>;
|
|
4515
|
+
export declare function fetchSkillsIndex(timeoutMs?: number, attempts?: number): Promise<SkillsIndex>;
|
|
4287
4516
|
/** Resolve which file to download for a skill: content-addressed object, else legacy fixed key */
|
|
4288
|
-
declare function resolveAssetFileName(entry?: SkillIndexEntry): string;
|
|
4517
|
+
export declare function resolveAssetFileName(entry?: SkillIndexEntry): string;
|
|
4289
4518
|
/** 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>;
|
|
4519
|
+
export declare function downloadSkillAsset(name: string, entry?: SkillIndexEntry, attempts?: number): Promise<Buffer>;
|
|
4291
4520
|
//#endregion
|
|
4292
4521
|
//#region src/skills/lock.d.ts
|
|
4293
4522
|
/**
|
|
@@ -4297,23 +4526,23 @@ declare function downloadSkillAsset(name: string, entry?: SkillIndexEntry, attem
|
|
|
4297
4526
|
* caches the remote index — list/update diffs are always "live remote index vs lock".
|
|
4298
4527
|
* Paths follow the config.json directory logic (BAILIAN_CONFIG_DIR can redirect everything).
|
|
4299
4528
|
*/
|
|
4300
|
-
declare function getSkillsDir(): string;
|
|
4301
|
-
declare function getSkillLockPath(): string;
|
|
4302
|
-
declare function emptySkillLock(): SkillLockFile;
|
|
4529
|
+
export declare function getSkillsDir(): string;
|
|
4530
|
+
export declare function getSkillLockPath(): string;
|
|
4531
|
+
export declare function emptySkillLock(): SkillLockFile;
|
|
4303
4532
|
/**
|
|
4304
4533
|
* Read installation records. Returns an empty lock when the file is absent (first install),
|
|
4305
4534
|
* corrupted, or has an unrecognized version — an empty lock is a valid initial state, not an
|
|
4306
4535
|
* error; subsequent install actions will rebuild correct records.
|
|
4307
4536
|
*/
|
|
4308
|
-
declare function readSkillLock(): SkillLockFile;
|
|
4309
|
-
declare function writeSkillLock(lock: SkillLockFile): void;
|
|
4537
|
+
export declare function readSkillLock(): SkillLockFile;
|
|
4538
|
+
export declare function writeSkillLock(lock: SkillLockFile): void;
|
|
4310
4539
|
/**
|
|
4311
4540
|
* Merge-update a single skill's installation record (read-modify-write).
|
|
4312
4541
|
* Shallow-merges with the existing entry: fields not provided in patch (typically links —
|
|
4313
4542
|
* agent fan-out records) are preserved, preventing "install-only, no fan-out" sync channels
|
|
4314
4543
|
* like postinstall/advisor from overwriting link records established by bl skill add.
|
|
4315
4544
|
*/
|
|
4316
|
-
declare function upsertSkillLockEntry(name: string, patch: SkillLockEntry): void;
|
|
4545
|
+
export declare function upsertSkillLockEntry(name: string, patch: SkillLockEntry): void;
|
|
4317
4546
|
//#endregion
|
|
4318
4547
|
//#region src/skills/sanitize.d.ts
|
|
4319
4548
|
/**
|
|
@@ -4325,16 +4554,16 @@ declare function upsertSkillLockEntry(name: string, patch: SkillLockEntry): void
|
|
|
4325
4554
|
* `bl skill` uses this as an "equivalence check": if the sanitized name differs from the original,
|
|
4326
4555
|
* installation is rejected outright (the publisher already has an isomorphic allowlist; this is client-side defense-in-depth).
|
|
4327
4556
|
*/
|
|
4328
|
-
declare function sanitizeSkillName(name: string): string;
|
|
4557
|
+
export declare function sanitizeSkillName(name: string): string;
|
|
4329
4558
|
/** Whether the skill name is already a safe directory name (unchanged after sanitization) */
|
|
4330
|
-
declare function isSafeSkillName(name: string): boolean;
|
|
4559
|
+
export declare function isSafeSkillName(name: string): boolean;
|
|
4331
4560
|
//#endregion
|
|
4332
4561
|
//#region src/skills/names.d.ts
|
|
4333
4562
|
/**
|
|
4334
4563
|
* Parse --name: `all` or a comma-separated list of skill names (deduplicated, trimmed).
|
|
4335
4564
|
* `all` cannot be mixed with specific names.
|
|
4336
4565
|
*/
|
|
4337
|
-
declare function parseSkillNames(raw: string | undefined, defaultAll: boolean): string[] | "all";
|
|
4566
|
+
export declare function parseSkillNames(raw: string | undefined, defaultAll: boolean): string[] | "all";
|
|
4338
4567
|
//#endregion
|
|
4339
4568
|
//#region src/skills/validate.d.ts
|
|
4340
4569
|
/**
|
|
@@ -4349,25 +4578,25 @@ interface SkillMeta {
|
|
|
4349
4578
|
name: string;
|
|
4350
4579
|
description: string;
|
|
4351
4580
|
}
|
|
4352
|
-
declare function validateSkillDir(dir: string, skillName: string): SkillMeta;
|
|
4581
|
+
export declare function validateSkillDir(dir: string, skillName: string): SkillMeta;
|
|
4353
4582
|
//#endregion
|
|
4354
4583
|
//#region src/skills/extract.d.ts
|
|
4355
4584
|
/** tar 条目路径必须是相对路径且不含 ..,防止 tar-slip 逃逸解包目录 */
|
|
4356
|
-
declare function isSafeEntryName(name: string): boolean;
|
|
4585
|
+
export declare function isSafeEntryName(name: string): boolean;
|
|
4357
4586
|
/** Brotli decompress + tar-stream extract into destDir (per-entry path safety check). */
|
|
4358
|
-
declare function extractTarBr(tarBrBuffer: Buffer, destDir: string): Promise<void>;
|
|
4587
|
+
export declare function extractTarBr(tarBrBuffer: Buffer, destDir: string): Promise<void>;
|
|
4359
4588
|
/**
|
|
4360
4589
|
* Recompute the publisher's deterministic content hash over an extracted directory:
|
|
4361
4590
|
* regular files sorted by "/"-separated relative path (code-unit order, same as the
|
|
4362
4591
|
* publisher's byte-order sort for ASCII paths), sha256 accumulating relPath + bytes.
|
|
4363
4592
|
* Symmetric with computeContentHash in FC skills-publish.mjs.
|
|
4364
4593
|
*/
|
|
4365
|
-
declare function computeDirContentHash(dir: string): string;
|
|
4594
|
+
export declare function computeDirContentHash(dir: string): string;
|
|
4366
4595
|
/**
|
|
4367
4596
|
* Atomic swap: replace destDir with the extracted content from tmpDir.
|
|
4368
4597
|
* tmpDir must be on the same volume as destDir (same parent) for renameSync to be atomic.
|
|
4369
4598
|
*/
|
|
4370
|
-
declare function atomicSwap(tmpDir: string, destDir: string): void;
|
|
4599
|
+
export declare function atomicSwap(tmpDir: string, destDir: string): void;
|
|
4371
4600
|
//#endregion
|
|
4372
4601
|
//#region src/skills/agents.d.ts
|
|
4373
4602
|
/**
|
|
@@ -4394,8 +4623,8 @@ interface AgentTarget {
|
|
|
4394
4623
|
* project-only). Shared-dir agents (Cline/Warp/Zed/Kimi/… read ~/.agents/skills; Amp/Replit
|
|
4395
4624
|
* read $XDG_CONFIG_HOME/agents/skills) are folded into the universal pseudo-agents' detectDirs.
|
|
4396
4625
|
*/
|
|
4397
|
-
declare function getAgentTargets(): AgentTarget[];
|
|
4398
|
-
declare function detectInstalledAgents(): AgentTarget[];
|
|
4626
|
+
export declare function getAgentTargets(): AgentTarget[];
|
|
4627
|
+
export declare function detectInstalledAgents(): AgentTarget[];
|
|
4399
4628
|
interface LinkResult {
|
|
4400
4629
|
agent: string;
|
|
4401
4630
|
path: string;
|
|
@@ -4409,7 +4638,7 @@ interface LinkResult {
|
|
|
4409
4638
|
* any other existing files/dirs are always skipped (never delete user content).
|
|
4410
4639
|
* Falls back to copy when symlink fails (e.g. Windows without Developer Mode).
|
|
4411
4640
|
*/
|
|
4412
|
-
declare function linkSkillToAgents(name: string, agents?: AgentTarget[], recordedLinks?: string[]): LinkResult[];
|
|
4641
|
+
export declare function linkSkillToAgents(name: string, agents?: AgentTarget[], recordedLinks?: string[]): LinkResult[];
|
|
4413
4642
|
/**
|
|
4414
4643
|
* Fan-out workflow: link to agents AND compute the next lock ledger in one step.
|
|
4415
4644
|
* Shared by bl skill add/update (fresh install and self-healing) and advisor wiki sync,
|
|
@@ -4431,14 +4660,21 @@ interface FanoutOutcome {
|
|
|
4431
4660
|
* - recorded paths confirmed foreign this run (unmanaged skip) are dropped — the user
|
|
4432
4661
|
* replaced our artifact, and keeping the record would let remove delete user content.
|
|
4433
4662
|
*/
|
|
4434
|
-
declare function fanOutSkillToAgents(name: string, agents?: AgentTarget[], recordedLinks?: string[]): FanoutOutcome;
|
|
4663
|
+
export declare function fanOutSkillToAgents(name: string, agents?: AgentTarget[], recordedLinks?: string[]): FanoutOutcome;
|
|
4664
|
+
/**
|
|
4665
|
+
* Collect paths that unlinkSkillFromAgents would reclaim (read-only).
|
|
4666
|
+
* Same candidate set and eligibility rules as the mutating unlink: managed
|
|
4667
|
+
* symlinks anywhere under the agent registry (including historical links not
|
|
4668
|
+
* in lock), plus recorded copy-fallback directories.
|
|
4669
|
+
*/
|
|
4670
|
+
export declare function planUnlinkSkillFromAgents(name: string, recordedLinks?: string[]): string[];
|
|
4435
4671
|
/**
|
|
4436
4672
|
* Reclaim fan-out artifacts for a skill across all agent dirs.
|
|
4437
4673
|
* Symlinks pointing to canonical are removed (including historical links not in lock,
|
|
4438
4674
|
* via defensive scan of the full registry); real directories are only removed if recorded
|
|
4439
4675
|
* in lock (copy-fallback artifacts). A single failure does not block the rest.
|
|
4440
4676
|
*/
|
|
4441
|
-
declare function unlinkSkillFromAgents(name: string, recordedLinks?: string[]): string[];
|
|
4677
|
+
export declare function unlinkSkillFromAgents(name: string, recordedLinks?: string[]): string[];
|
|
4442
4678
|
//#endregion
|
|
4443
4679
|
//#region src/skills/installer.d.ts
|
|
4444
4680
|
/**
|
|
@@ -4452,17 +4688,17 @@ interface InstalledSkill {
|
|
|
4452
4688
|
meta: SkillMeta;
|
|
4453
4689
|
}
|
|
4454
4690
|
/** 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>;
|
|
4691
|
+
export declare function installSkillFromBuffer(name: string, tarBrBuffer: Buffer, expectedContentHash?: string): Promise<InstalledSkill>;
|
|
4456
4692
|
/** Install a single skill by index entry (download + validate + write to disk) */
|
|
4457
|
-
declare function installSkill(name: string, entry: SkillIndexEntry, downloadAttempts?: number): Promise<InstalledSkill>;
|
|
4693
|
+
export declare function installSkill(name: string, entry: SkillIndexEntry, downloadAttempts?: number): Promise<InstalledSkill>;
|
|
4458
4694
|
/** Remove the skill directory under canonical; returns whether it was actually deleted (dir absent → false) */
|
|
4459
|
-
declare function removeSkillDir(name: string): boolean;
|
|
4695
|
+
export declare function removeSkillDir(name: string): boolean;
|
|
4460
4696
|
/**
|
|
4461
4697
|
* Build a skill-lock entry from an index entry + effective fan-out link paths.
|
|
4462
4698
|
* Single source of truth for the "installation fact" shape shared by bl skill add/update,
|
|
4463
4699
|
* advisor wiki sync, and any future install channel.
|
|
4464
4700
|
*/
|
|
4465
|
-
declare function buildSkillLockEntry(entry: SkillIndexEntry, links: string[]): SkillLockEntry;
|
|
4701
|
+
export declare function buildSkillLockEntry(entry: SkillIndexEntry, links: string[]): SkillLockEntry;
|
|
4466
4702
|
interface SkillInstallRecord {
|
|
4467
4703
|
/** Ready-to-persist lock entry (links = effective fan-out paths) */
|
|
4468
4704
|
lockEntry: SkillLockEntry;
|
|
@@ -4478,14 +4714,14 @@ interface SkillInstallRecord {
|
|
|
4478
4714
|
* downloadAttempts = registry fetch attempts (undefined → interactive default; silent
|
|
4479
4715
|
* background channels pass 1 to fail fast instead of stalling the host command).
|
|
4480
4716
|
*/
|
|
4481
|
-
declare function installSkillWithFanout(name: string, entry: SkillIndexEntry, agents?: AgentTarget[], recordedLinks?: string[], downloadAttempts?: number): Promise<SkillInstallRecord>;
|
|
4717
|
+
export declare function installSkillWithFanout(name: string, entry: SkillIndexEntry, agents?: AgentTarget[], recordedLinks?: string[], downloadAttempts?: number): Promise<SkillInstallRecord>;
|
|
4482
4718
|
//#endregion
|
|
4483
4719
|
//#region src/skills/status.d.ts
|
|
4484
4720
|
/**
|
|
4485
4721
|
* Three-way reconciliation for list: remote index (live) × skill-lock.json (installation facts) × disk (ground truth).
|
|
4486
4722
|
*/
|
|
4487
4723
|
/** 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[];
|
|
4724
|
+
export declare function listSkillDirsOnDisk(): string[];
|
|
4725
|
+
export declare function computeSkillStatuses(index: SkillsIndex, lock: SkillLockFile, diskNames: string[]): SkillStatusRow[];
|
|
4490
4726
|
//#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 };
|
|
4727
|
+
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 };
|