declare global { var NO_INTERACTIVE: boolean; var USE_ACC_OSS: boolean; } export interface Session { token: string; } export type Platform = 'ios' | 'android' | 'harmony'; export interface Package { id: string; name: string; version?: string; status?: string; appId?: string; appKey?: string; versionName?: any; buildTime?: any; } export interface Version { id: string; hash: string; name: string; packages?: Package[]; } export interface CommandContext { args: string[]; options: Record; platform?: Platform; appId?: string; session?: Session; } export interface CommandResult { success: boolean; data?: any; error?: string; } export interface CommandDefinition { name: string; description?: string; handler: (context: CommandContext) => Promise; options?: Record< string, { hasValue?: boolean; default?: any; description?: string; } >; } export interface BundleOptions { dev?: boolean; platform?: Platform; bundleName?: string; entryFile?: string; output?: string; sourcemap?: boolean; taro?: boolean; expo?: boolean; rncli?: boolean; hermes?: boolean; } export interface PublishOptions { name?: string; description?: string; metaInfo?: string; packageId?: string; packageVersion?: string; minPackageVersion?: string; maxPackageVersion?: string; packageVersionRange?: string; rollout?: number; dryRun?: boolean; } export interface UploadOptions { platform?: Platform; filePath: string; appId?: string; version?: string; } export interface WorkflowStep { name: string; description?: string; execute: (context: CommandContext, previousResult?: any) => Promise; condition?: (context: CommandContext) => boolean; } export interface CustomWorkflow { name: string; description?: string; steps: WorkflowStep[]; validate?: (context: CommandContext) => boolean; options?: Record< string, { hasValue?: boolean; default?: any; description?: string; } >; } export interface CLIProvider { bundle: (options: BundleOptions) => Promise; publish: (options: PublishOptions) => Promise; upload: (options: UploadOptions) => Promise; createApp: (name: string, platform: Platform) => Promise; listApps: (platform?: Platform) => Promise; getSelectedApp: ( platform?: Platform, ) => Promise<{ appId: string; platform: Platform }>; listVersions: (appId: string) => Promise; updateVersion: ( appId: string, versionId: string, updates: Partial, ) => Promise; getPlatform: (platform?: Platform) => Promise; loadSession: () => Promise; registerWorkflow: (workflow: CustomWorkflow) => void; executeWorkflow: ( workflowName: string, context: CommandContext, ) => Promise; } export interface CLIModule { name: string; version: string; commands?: CommandDefinition[]; workflows?: CustomWorkflow[]; init?: (provider: CLIProvider) => void; cleanup?: () => void; }