bailian-cli-runtime 1.15.1 → 1.17.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 CHANGED
@@ -1,4 +1,4 @@
1
- import { AnyCommand, ApiKeyCredential, AuthStore, Client, Command, CommandPackManager, ConfigStore, FlagDef, FlagsDef, Identity, ImageSizeProfile, OutputFormat, ParsedFlags, ResolutionSources, Settings, UsageError } from "bailian-cli-core";
1
+ import { AnyCommand, ApiKeyCredential, AuthStore, Client, Command, CommandPackManager, ConfigStore, FlagDef, FlagsDef, Identity, ImageSizeProfile, Language, LocalizedText, OutputFormat, ParsedFlags, ResolutionSources, Settings, UsageError } from "bailian-cli-core";
2
2
 
3
3
  //#region src/command-packs/types.d.ts
4
4
  interface CommandPackDefinition {
@@ -38,6 +38,13 @@ interface Cli {
38
38
  */
39
39
  declare function createCli(commands: Record<string, AnyCommand>, opts: CliOptions): Cli;
40
40
  //#endregion
41
+ //#region src/i18n.d.ts
42
+ /** Per-CLI localized text selector. */
43
+ interface Translator {
44
+ language: Language;
45
+ localize(text: LocalizedText): string;
46
+ }
47
+ //#endregion
41
48
  //#region src/registry.d.ts
42
49
  /**
43
50
  * What a command path resolves to in the registry. The single judgement that
@@ -62,8 +69,10 @@ declare class CommandRegistry {
62
69
  private root;
63
70
  /** Binary name shown in usage/help/error strings (e.g. "bl", "rag"). */
64
71
  private readonly cliName;
72
+ private readonly translator?;
65
73
  private readonly authRequirements;
66
- constructor(commands: Record<string, AnyCommand>, cliName: string);
74
+ constructor(commands: Record<string, AnyCommand>, cliName: string, translator?: Translator);
75
+ private localize;
67
76
  private register;
68
77
  getAllCommands(): AnyCommand[];
69
78
  /** First registered command path, for the "Getting Help" example (e.g. "knowledge retrieve"). */
@@ -83,6 +92,8 @@ declare class CommandRegistry {
83
92
  private accent;
84
93
  private dim;
85
94
  printHelp(commandPath: string[], out?: NodeJS.WriteStream): void;
95
+ printWelcome(): void;
96
+ printQuickStart(tasks: readonly string[]): void;
86
97
  private printPipelineQuickStart;
87
98
  private printRootHelp;
88
99
  private printCommandHelp;
@@ -299,8 +310,8 @@ interface ProgressBar {
299
310
  declare function createProgressBar(total: number, label?: string): ProgressBar;
300
311
  //#endregion
301
312
  //#region src/output/banner.d.ts
302
- declare function printWelcomeBanner(cliName: string): void;
303
- declare function printQuickStart(tasks: readonly string[]): void;
313
+ declare function printWelcomeBanner(cliName: string, translator?: Translator): void;
314
+ declare function printQuickStart(tasks: readonly string[], language?: Language): void;
304
315
  //#endregion
305
316
  //#region src/output/status-bar.d.ts
306
317
  declare function maybeShowStatusBar(settings: Settings, token: string, resolved: ApiKeyCredential): void;
@@ -345,6 +356,15 @@ interface PollOptions {
345
356
  }
346
357
  declare function poll<T>(client: Client, settings: Settings, opts: PollOptions): Promise<T>;
347
358
  //#endregion
359
+ //#region src/confirm.d.ts
360
+ /**
361
+ * - `yes` (the command's own --yes switch) → pass through
362
+ * - TTY: print the summary and wait for y/yes (case-insensitive); any other
363
+ * input cancels with exit SUCCESS (cancellation is not an error)
364
+ * - non-TTY without --yes: throw USAGE
365
+ */
366
+ declare function confirmDangerousAction(summary: string, yes: boolean): Promise<void>;
367
+ //#endregion
348
368
  //#region src/utils/download.d.ts
349
369
  declare function downloadFile(url: string, destPath: string, opts?: {
350
370
  quiet?: boolean;
@@ -468,13 +488,25 @@ declare function performBinaryUpdate(targetVersion: string): Promise<string>;
468
488
  //#endregion
469
489
  //#region src/utils/flag-descriptions.d.ts
470
490
  /** Shared --foo <bool> help text; keep wording consistent with actual CLI/request behavior. */
471
- declare const BOOL_FLAG_WATERMARK = "Enable watermark (true/false). Omit flag to use CLI default (true).";
491
+ declare const BOOL_FLAG_WATERMARK: {
492
+ "en-US": string;
493
+ "zh-CN": string;
494
+ };
472
495
  /** CLI sends prompt_extend=true when flag omitted (qwen-image edit, etc.). */
473
- declare const BOOL_FLAG_PROMPT_EXTEND_CLI_TRUE = "Enable prompt extend (true/false). Omit flag to use CLI default (true).";
496
+ declare const BOOL_FLAG_PROMPT_EXTEND_CLI_TRUE: {
497
+ "en-US": string;
498
+ "zh-CN": string;
499
+ };
474
500
  /** Sync qwen-image defaults on; async models omit the field unless flag is set. */
475
- declare const BOOL_FLAG_PROMPT_EXTEND_IMAGE_GENERATE = "Enable prompt extend (true/false). Omit flag: true for qwen-image sync; parameter omitted on async models (API default).";
501
+ declare const BOOL_FLAG_PROMPT_EXTEND_IMAGE_GENERATE: {
502
+ "en-US": string;
503
+ "zh-CN": string;
504
+ };
476
505
  /** CLI omits prompt_extend in the request when flag is unset (video commands). */
477
- declare const BOOL_FLAG_PROMPT_EXTEND_API_DEFAULT = "Enable prompt extend (true/false). Omit flag to omit the parameter (DashScope default).";
506
+ declare const BOOL_FLAG_PROMPT_EXTEND_API_DEFAULT: {
507
+ "en-US": string;
508
+ "zh-CN": string;
509
+ };
478
510
  //#endregion
479
511
  //#region src/pipeline/types.d.ts
480
512
  declare const WORKFLOW_VERSION = "workflow/v1";
@@ -777,4 +809,4 @@ declare function collectPipelineHints(pipeline: PipelineDefinition, dispatcher?:
777
809
  declare function executePipeline(pipeline: PipelineDefinition, runtimeInput?: Record<string, unknown>, options?: ExecutePipelineOptions): Promise<PipelineExecutionReport>;
778
810
  declare function streamPipelineEvents(pipeline: PipelineDefinition, runtimeInput?: Record<string, unknown>, options?: Pick<ExecutePipelineOptions, "concurrency" | "basePath" | "dryRun" | "signal" | "timeoutSeconds" | "blRequestTimeoutSeconds" | "stepDispatcher">): AsyncGenerator<PipelineLifecycleEvent>;
779
811
  //#endregion
780
- export { API_KEY_PAGE, type AnsiStyles, BAILIAN_CONSOLE, BAILIAN_CONSOLE_ROOT, BOOL_FLAG_PROMPT_EXTEND_API_DEFAULT, BOOL_FLAG_PROMPT_EXTEND_CLI_TRUE, BOOL_FLAG_PROMPT_EXTEND_IMAGE_GENERATE, BOOL_FLAG_WATERMARK, type BarColumn, type BoxTableOptions, CLI_VERSION, type Cli, type CliOptions, type Command, type CommandPackCredentialAccess, type CommandPackDefinition, type CommandPackPolicy, CommandRegistry, type FlagDef, type GaugeCell, type LocateResult, MCP_WEBSEARCH_PAGE, type Middleware, NPM_PACKAGE, NPM_REGISTRY, type ParsePathResult, type PipelineDefinition, type PipelineLifecycleEvent, type Resolution, type RunContext, TOKEN_PLAN_PAGE, type TextStyle, VOICE_TTS_PAGE, ansi, checkForUpdate, collectPipelineHints, collectPipelineIssues, compose, createCli, createProgressBar, createSpinner, displayWidth, downloadFile, downloadParallel, emitBare, emitRequestId, emitResult, ensureBinaryPathEntries, executePipeline, fetchBinaryChannelManifest, fetchBinaryChannelVersion, fetchLatestVersion, formatBytes, formatTable, getBinaryBinRoot, getBinaryCurrentPath, getBinaryShareRoot, getBinaryVersionsDir, getConcurrency, getPendingUpdateNotification, handleError, initPipelineSteps, isTerminal, isValidUpdateTargetVersion, maybeShowStatusBar, mcpMarketplaceDetailPage, normalizeBinaryVersion, padEnd, parseFlags, parsePath, performBinaryUpdate, poll, printQuickStart, printWelcomeBanner, pruneBinaryVersions, readCurrentVersionDir, renderBoxTable, renderGauge, resolve, resolveBinaryDownloadSpec, resolveImageSize, runConcurrent, setupProxyFromEnv, streamPipelineEvents, supportsColor, switchCurrentToVersion };
812
+ export { API_KEY_PAGE, type AnsiStyles, BAILIAN_CONSOLE, BAILIAN_CONSOLE_ROOT, BOOL_FLAG_PROMPT_EXTEND_API_DEFAULT, BOOL_FLAG_PROMPT_EXTEND_CLI_TRUE, BOOL_FLAG_PROMPT_EXTEND_IMAGE_GENERATE, BOOL_FLAG_WATERMARK, type BarColumn, type BoxTableOptions, CLI_VERSION, type Cli, type CliOptions, type Command, type CommandPackCredentialAccess, type CommandPackDefinition, type CommandPackPolicy, CommandRegistry, type FlagDef, type GaugeCell, type LocateResult, MCP_WEBSEARCH_PAGE, type Middleware, NPM_PACKAGE, NPM_REGISTRY, type ParsePathResult, type PipelineDefinition, type PipelineLifecycleEvent, type Resolution, type RunContext, TOKEN_PLAN_PAGE, type TextStyle, VOICE_TTS_PAGE, ansi, checkForUpdate, collectPipelineHints, collectPipelineIssues, compose, confirmDangerousAction, createCli, createProgressBar, createSpinner, displayWidth, downloadFile, downloadParallel, emitBare, emitRequestId, emitResult, ensureBinaryPathEntries, executePipeline, fetchBinaryChannelManifest, fetchBinaryChannelVersion, fetchLatestVersion, formatBytes, formatTable, getBinaryBinRoot, getBinaryCurrentPath, getBinaryShareRoot, getBinaryVersionsDir, getConcurrency, getPendingUpdateNotification, handleError, initPipelineSteps, isTerminal, isValidUpdateTargetVersion, maybeShowStatusBar, mcpMarketplaceDetailPage, normalizeBinaryVersion, padEnd, parseFlags, parsePath, performBinaryUpdate, poll, printQuickStart, printWelcomeBanner, pruneBinaryVersions, readCurrentVersionDir, renderBoxTable, renderGauge, resolve, resolveBinaryDownloadSpec, resolveImageSize, runConcurrent, setupProxyFromEnv, streamPipelineEvents, supportsColor, switchCurrentToVersion };