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