@tencent-ai/cloud-agent-sdk 0.2.12 → 0.2.13-next.bb9822d.20260204

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.cts CHANGED
@@ -339,12 +339,240 @@ interface ClientEvents extends Record<string, unknown> {
339
339
  */
340
340
  type QuestionAnswers = Record<string, string | string[]>;
341
341
  //#endregion
342
- //#region ../agent-provider/lib/backend/types.d.ts
342
+ //#region ../agent-provider/lib/backend/service/oauth-repository-types.d.ts
343
343
  /**
344
- * Backend Provider 类型定义
344
+ * OAuth Repository Types
345
345
  *
346
- * 定义 IBackendProvider 接口和配置
346
+ * 定义 OAuth 连接器相关的仓库和分支操作类型
347
+ */
348
+ /**
349
+ * Connector name type for OAuth providers
350
+ */
351
+ type OauthConnectorName$1 = 'github' | 'gongfeng' | 'cnb';
352
+ /**
353
+ * Branch information from OAuth connector
354
+ * GET /console/as/connector/oauth/{name}/branches
355
+ */
356
+ interface OauthBranch$1 {
357
+ /** Branch name */
358
+ name: string;
359
+ /** Whether the branch is protected */
360
+ protected: boolean;
361
+ /** Latest commit SHA */
362
+ commit_sha: string;
363
+ /** Latest commit URL */
364
+ commit_url: string;
365
+ }
366
+ /**
367
+ * GitHub 分支查询参数
368
+ */
369
+ interface GitHubBranchParams$1 {
370
+ /** Repository owner (e.g., "CodeBuddy-Official-Account") */
371
+ owner: string;
372
+ /** Repository name (e.g., "CodeBuddyIDE") */
373
+ repo: string;
374
+ }
375
+ /**
376
+ * Gongfeng 分支查询参数
377
+ */
378
+ interface GongfengBranchParams$1 {
379
+ /** Project ID (e.g., "1611499") */
380
+ project_id: string;
381
+ }
382
+ /**
383
+ * CNB 分支查询参数
384
+ */
385
+ interface CNBBranchParams$1 {
386
+ /** Repository path: org/repo (e.g., "genie/genie-ide") */
387
+ repo: string;
388
+ }
389
+ /**
390
+ * GitHub repository owner information
391
+ */
392
+ interface OauthGitHubRepoOwner {
393
+ /** Owner login name */
394
+ login: string;
395
+ /** Owner avatar URL */
396
+ avatar_url: string;
397
+ /** Owner API URL */
398
+ url: string;
399
+ /** Owner HTML URL */
400
+ html_url: string;
401
+ /** Owner followers URL */
402
+ followers_url: string;
403
+ /** Owner starred URL */
404
+ starred_url: string;
405
+ /** Owner repos URL */
406
+ repos_url: string;
407
+ /** Owner events URL */
408
+ events_url: string;
409
+ }
410
+ /**
411
+ * GitHub repository information
412
+ * From ListReposResponse.GitHubRepos
413
+ */
414
+ interface OauthGitHubRepo$1 {
415
+ /** Repository name */
416
+ name: string;
417
+ /** Full repository name (owner/repo) */
418
+ full_name: string;
419
+ /** Whether the repository is private */
420
+ private: boolean;
421
+ /** Repository HTML URL */
422
+ html_url: string;
423
+ /** Repository API URL */
424
+ url: string;
425
+ /** Repository teams URL */
426
+ teams_url: string;
427
+ /** Repository hooks URL */
428
+ hooks_url: string;
429
+ /** Repository events URL */
430
+ events_url: string;
431
+ /** Repository branches URL */
432
+ branches_url: string;
433
+ /** Repository git commits URL */
434
+ git_commits_url: string;
435
+ /** Repository merges URL */
436
+ merges_url: string;
437
+ /** Repository pulls URL */
438
+ pulls_url: string;
439
+ /** Repository git URL */
440
+ git_url: string;
441
+ /** Repository clone URL */
442
+ clone_url: string;
443
+ /** Repository SVN URL */
444
+ svn_url: string;
445
+ /** Repository downloads URL */
446
+ downloads_url: string;
447
+ /** Repository description */
448
+ description: string;
449
+ /** Repository owner */
450
+ owner: OauthGitHubRepoOwner;
451
+ /** Number of forks */
452
+ forks_count: number;
453
+ }
454
+ /**
455
+ * Gongfeng repository namespace information
456
+ */
457
+ interface OauthGongFengRepoNamespace {
458
+ /** Namespace name */
459
+ name: string;
460
+ /** Namespace description */
461
+ description: string;
462
+ /** Namespace path */
463
+ path: string;
464
+ }
465
+ /**
466
+ * Gongfeng repository owner information
347
467
  */
468
+ interface OauthGongFengRepoOwner {
469
+ /** Owner username */
470
+ username: string;
471
+ /** Owner web URL */
472
+ web_url: string;
473
+ /** Owner name */
474
+ name: string;
475
+ /** Owner state */
476
+ state: string;
477
+ /** Owner avatar URL */
478
+ avatar_url: string;
479
+ }
480
+ /**
481
+ * Gongfeng (工蜂) repository information
482
+ * From ListReposResponse.GongFengRepos
483
+ */
484
+ interface OauthGongFengRepo$1 {
485
+ /** Repository ID */
486
+ id: number;
487
+ /** Repository description */
488
+ description: string;
489
+ /** Whether the repository is public */
490
+ public: boolean;
491
+ /** Whether the repository is archived */
492
+ archived: boolean;
493
+ /** Visibility level */
494
+ visibility_level: string;
495
+ /** Public visibility */
496
+ public_visibility: number;
497
+ /** Repository namespace */
498
+ namespace: OauthGongFengRepoNamespace;
499
+ /** Repository owner */
500
+ owner: OauthGongFengRepoOwner;
501
+ /** Repository name */
502
+ name: string;
503
+ /** Name with namespace */
504
+ name_with_namespace: string;
505
+ /** Repository path */
506
+ path: string;
507
+ /** Path with namespace */
508
+ path_with_namespace: string;
509
+ /** Repository type (Git/SVN) */
510
+ type: string;
511
+ /** Default branch */
512
+ default_branch: string;
513
+ /** SSH URL to repository */
514
+ ssh_url_to_repo: string;
515
+ /** HTTP URL to repository */
516
+ http_url_to_repo: string;
517
+ /** HTTPS URL to repository */
518
+ https_url_to_repo: string;
519
+ /** Web URL */
520
+ web_url: string;
521
+ /** Avatar URL */
522
+ avatar_url: string;
523
+ /** Forked from project */
524
+ forked_from_project: string;
525
+ }
526
+ /**
527
+ * CNB repository information
528
+ * From ListReposResponse.CNBRepos
529
+ */
530
+ interface OauthCNBRepo$1 {
531
+ /** Created timestamp */
532
+ created_at: string;
533
+ /** Repository description */
534
+ description: string;
535
+ /** Repository name */
536
+ name: string;
537
+ /** Repository path */
538
+ path: string;
539
+ /** Repository site */
540
+ site: string;
541
+ /** Repository status */
542
+ status: number;
543
+ /** Repository topics */
544
+ topics: string;
545
+ /** Visibility level */
546
+ visibility_level: string;
547
+ /** Web URL */
548
+ web_url: string;
549
+ }
550
+ /**
551
+ * Response for listing repositories
552
+ * GET /console/as/connector/oauth/{name}/repos
553
+ */
554
+ interface ListReposResponse$1 {
555
+ /**
556
+ * GitHub repositories grouped by installation id
557
+ * Map: installation_id => repository list
558
+ */
559
+ github_repos?: Record<number, OauthGitHubRepo$1[]>;
560
+ /** Gongfeng repositories */
561
+ gongfeng_repos?: OauthGongFengRepo$1[];
562
+ /** CNB repositories */
563
+ cnb_repos?: OauthCNBRepo$1[];
564
+ }
565
+ //#endregion
566
+ //#region ../agent-provider/lib/backend/types.d.ts
567
+ type OauthConnectorName = OauthConnectorName$1;
568
+ type OauthBranch = OauthBranch$1;
569
+ type GitHubBranchParams = GitHubBranchParams$1;
570
+ type GongfengBranchParams = GongfengBranchParams$1;
571
+ type CNBBranchParams = CNBBranchParams$1;
572
+ type OauthGitHubRepo = OauthGitHubRepo$1;
573
+ type OauthGongFengRepo = OauthGongFengRepo$1;
574
+ type OauthCNBRepo = OauthCNBRepo$1;
575
+ type ListReposResponse = ListReposResponse$1;
348
576
  /**
349
577
  * 账号版本类型
350
578
  */
@@ -433,6 +661,13 @@ interface AccountPlan {
433
661
  /** 所有套餐资源列表 */
434
662
  resources?: PlanResource[];
435
663
  }
664
+ /**
665
+ * 账号类型
666
+ * - sso: SSO 登录账号
667
+ * - unified: 统一登录账号
668
+ * - 空字符串: 普通账号
669
+ */
670
+ type AccountType = 'sso' | 'unified' | '';
436
671
  /**
437
672
  * 账号信息
438
673
  */
@@ -459,6 +694,8 @@ interface Account {
459
694
  pluginEnabled?: boolean;
460
695
  /** 部署状态 */
461
696
  deployStatus?: DeployStatus;
697
+ /** 账号类型 */
698
+ accountType?: AccountType;
462
699
  /** 是否是 Pro 版本 */
463
700
  isPro?: boolean;
464
701
  /** 到期时间戳 */
@@ -517,6 +754,7 @@ interface UserConnector {
517
754
  oauthClientId: string;
518
755
  /** OAuth 重定向 URL */
519
756
  oauthRedirectUrl: string;
757
+ oauthAppName: string;
520
758
  }
521
759
  /**
522
760
  * 获取用户连接器列表响应
@@ -590,6 +828,7 @@ interface TaskConnector {
590
828
  connect_at: string;
591
829
  /** 连接状态,0未连接,1已连接 */
592
830
  connectStatus: 0 | 1;
831
+ oauthAppName: string;
593
832
  }
594
833
  /**
595
834
  * 添加任务请求
@@ -679,84 +918,6 @@ interface RevokeAllRequest {
679
918
  /** 安装ID列表(可选,如果不传则撤销所有) */
680
919
  installationIds?: string[];
681
920
  }
682
- /**
683
- * GitHub 仓库所有者信息
684
- */
685
- interface OauthGitHubRepoOwner {
686
- login: string;
687
- avatar_url: string;
688
- url: string;
689
- html_url: string;
690
- followers_url: string;
691
- starred_url: string;
692
- repos_url: string;
693
- events_url: string;
694
- }
695
- /**
696
- * GitHub 仓库信息
697
- */
698
- interface OauthGitHubRepo {
699
- name: string;
700
- full_name: string;
701
- private: boolean;
702
- html_url: string;
703
- url: string;
704
- teams_url: string;
705
- hooks_url: string;
706
- events_url: string;
707
- branches_url: string;
708
- git_commits_url: string;
709
- merges_url: string;
710
- pulls_url: string;
711
- git_url: string;
712
- clone_url: string;
713
- svn_url: string;
714
- downloads_url: string;
715
- description: string;
716
- owner: OauthGitHubRepoOwner;
717
- forks_count: number;
718
- }
719
- /**
720
- * 工蜂仓库信息
721
- */
722
- interface OauthGongfengRepo {
723
- id: number;
724
- description: string;
725
- public: boolean;
726
- archived: boolean;
727
- visibility_level: number;
728
- public_visibility: number;
729
- namespace: {
730
- name: string;
731
- description: string;
732
- path: string;
733
- };
734
- owner: {
735
- username: string;
736
- web_url: string;
737
- name: string;
738
- state: string;
739
- avatar_url: string;
740
- };
741
- name: string;
742
- name_with_namespace: string;
743
- path: string;
744
- path_with_namespace: string;
745
- type: string;
746
- default_branch: string;
747
- ssh_url_to_repo: string;
748
- http_url_to_repo: string;
749
- https_url_to_repo: string;
750
- web_url: string;
751
- avatar_url: string;
752
- }
753
- /**
754
- * CNB仓库信息
755
- */
756
- interface OauthCnbRepo {
757
- name: string;
758
- [key: string]: any;
759
- }
760
921
  /**
761
922
  * 获取仓库列表响应
762
923
  */
@@ -764,8 +925,8 @@ interface GetRepoListResponse {
764
925
  github_repos?: {
765
926
  [key: string | number]: OauthGitHubRepo[];
766
927
  };
767
- gongfeng_repos?: OauthGongfengRepo[];
768
- cnb_repos?: OauthCnbRepo[];
928
+ gongfeng_repos?: OauthGongFengRepo[];
929
+ cnb_repos?: OauthCNBRepo[];
769
930
  }
770
931
  /**
771
932
  * OAuth 用户信息
@@ -966,6 +1127,12 @@ interface IBackendProvider {
966
1127
  * 用于 Local 模式下点击 Logo 返回 IDE
967
1128
  */
968
1129
  closeAgentManager?(): Promise<void>;
1130
+ /**
1131
+ * 在外部浏览器中打开链接(可选,仅 IPC 环境支持)
1132
+ * 用于 Local 模式下打开外部 URL
1133
+ * @param url 要打开的 URL
1134
+ */
1135
+ openExternal?(url: string): Promise<void>;
969
1136
  /**
970
1137
  * 监听事件(可选,用于 IPC 环境)
971
1138
  * @param event 事件名称
@@ -978,6 +1145,34 @@ interface IBackendProvider {
978
1145
  * @returns Promise<EnterpriseUsage | null> 企业用户用量信息
979
1146
  */
980
1147
  getEnterpriseUsage?(enterpriseId: string): Promise<EnterpriseUsage | null>;
1148
+ /**
1149
+ * 刷新 Token(可选)
1150
+ * 通过调用 getAccount 刷新 cookie
1151
+ * 适用于 Cloud 场景下页面切换回来时刷新登录态
1152
+ * @returns Promise<Account | null> 刷新后的账号信息
1153
+ */
1154
+ refreshToken?(): Promise<Account | null>;
1155
+ /**
1156
+ * 获取仓库分支列表
1157
+ * API 端点: GET /console/as/connector/oauth/{name}/branches
1158
+ *
1159
+ * @param connector 连接器名称 ('github' | 'gongfeng' | 'cnb')
1160
+ * @param params 平台特定的查询参数
1161
+ * @param page 页码,从1开始,0表示不分页获取全部
1162
+ * @param perPage 每页数量,最大100
1163
+ * @returns Promise<OauthBranch[]> 分支列表
1164
+ */
1165
+ getBranches?(connector: OauthConnectorName, params: GitHubBranchParams | GongfengBranchParams | CNBBranchParams, page?: number, perPage?: number): Promise<OauthBranch[]>;
1166
+ /**
1167
+ * 获取仓库列表
1168
+ * API 端点: GET /console/as/connector/oauth/{name}/repos
1169
+ *
1170
+ * @param connector 连接器名称 ('github' | 'gongfeng' | 'cnb')
1171
+ * @param page 页码,从1开始,0表示不分页获取全部
1172
+ * @param perPage 每页数量,最大100
1173
+ * @returns Promise<ListReposResponse> 仓库列表响应
1174
+ */
1175
+ getRepositories?(connector: OauthConnectorName, page?: number, perPage?: number): Promise<ListReposResponse>;
981
1176
  }
982
1177
  /**
983
1178
  * 场景中的插件信息
@@ -1635,6 +1830,8 @@ interface BaseAgentState {
1635
1830
  updatedAt?: Date;
1636
1831
  /** 是否为 playground */
1637
1832
  isPlayground?: boolean;
1833
+ /** Whether the title is user defined (1 = user defined) */
1834
+ isUserDefinedTitle?: number;
1638
1835
  }
1639
1836
  /**
1640
1837
  * LocalAgentState - 本地 Agent 状态
@@ -1781,6 +1978,8 @@ interface SessionInfo {
1781
1978
  cwd?: string;
1782
1979
  /** Whether the session is a playground */
1783
1980
  isPlayground?: boolean;
1981
+ /** Whether the title is user defined (1 = user defined) */
1982
+ isUserDefinedTitle?: number;
1784
1983
  }
1785
1984
  /**
1786
1985
  * Parameters for creating a new session
@@ -1999,7 +2198,7 @@ interface ActiveSession {
1999
2198
  error?: string;
2000
2199
  }>;
2001
2200
  /** Set the current session mode */
2002
- setMode(modeId: string): Promise<void>;
2201
+ setMode(modeId: string, skipChecker?: boolean): Promise<void>;
2003
2202
  /** Set the current session model */
2004
2203
  setSessionModel(modelId: string): Promise<void>;
2005
2204
  /** Set available commands (called when available_commands_update is received) */
@@ -2142,6 +2341,13 @@ interface AgentProvider<C extends AgentConnection = AgentConnection> {
2142
2341
  * @returns Response with search results
2143
2342
  */
2144
2343
  searchFile?(params: SearchFileParams): Promise<SearchFileResponse>;
2344
+ /**
2345
+ * Get subagent list (optional, used by LocalAgentProvider)
2346
+ *
2347
+ * @param params - Query parameters including options
2348
+ * @returns Response with subagent list
2349
+ */
2350
+ getSubagentList?(params: GetSubagentListParams): Promise<GetSubagentListResponse>;
2145
2351
  /**
2146
2352
  * Batch toggle plugins (optional, used by LocalAgentProvider)
2147
2353
  *
@@ -2169,12 +2375,22 @@ interface AgentProvider<C extends AgentConnection = AgentConnection> {
2169
2375
  * @param pluginNames - Array of plugin names to install
2170
2376
  * @param marketplaceName - Marketplace name
2171
2377
  * @param installScope - Install scope ('user' | 'project')
2378
+ * @param marketplaceSource - Marketplace source URL (for auto-adding marketplace when not exists)
2172
2379
  * @returns Result of the operation
2173
2380
  */
2174
- installPlugins?(pluginNames: string[], marketplaceName: string, installScope?: 'user' | 'project'): Promise<{
2381
+ installPlugins?(pluginNames: string[], marketplaceName: string, installScope?: 'user' | 'project', marketplaceSource?: string): Promise<{
2175
2382
  success: boolean;
2176
2383
  error?: string;
2177
2384
  }>;
2385
+ /**
2386
+ * Get available commands for a session (optional, used by LocalAgentProvider)
2387
+ * If session.availableCommands has cached values, return them
2388
+ * Otherwise, fetch from product configuration
2389
+ *
2390
+ * @param sessionId - Session ID to get commands for (optional, for global commands)
2391
+ * @returns Array of available commands
2392
+ */
2393
+ getAvailableCommands?(sessionId?: string): Promise<AvailableCommand[]>;
2178
2394
  /**
2179
2395
  * Register an event listener
2180
2396
  * Provider implementations should forward events to the underlying transport
@@ -2277,6 +2493,8 @@ interface ClientSessionsResource {
2277
2493
  uploadFile(params: UploadFileParams): Promise<UploadFileResponse>;
2278
2494
  /** Search for files in the workspace (for LocalAgentProvider) */
2279
2495
  searchFile(params: SearchFileParams): Promise<SearchFileResponse>;
2496
+ /** Get subagent list (for LocalAgentProvider) */
2497
+ getSubagentList(params: GetSubagentListParams): Promise<GetSubagentListResponse>;
2280
2498
  /** Batch toggle plugins (for LocalAgentProvider) */
2281
2499
  batchTogglePlugins(request: BatchPluginOperationRequest): Promise<BatchPluginOperationResult>;
2282
2500
  /** Get installed plugins (for LocalAgentProvider) */
@@ -2289,7 +2507,7 @@ interface ClientSessionsResource {
2289
2507
  installScope?: 'user' | 'project';
2290
2508
  }>>;
2291
2509
  /** Install plugins (for LocalAgentProvider) */
2292
- installPlugins(pluginNames: string[], marketplaceName: string, installScope?: 'user' | 'project'): Promise<{
2510
+ installPlugins(pluginNames: string[], marketplaceName: string, installScope?: 'user' | 'project', marketplaceSource?: string): Promise<{
2293
2511
  success: boolean;
2294
2512
  error?: string;
2295
2513
  }>;
@@ -2307,6 +2525,14 @@ interface ClientSessionsResource {
2307
2525
  }>;
2308
2526
  prompts: string[];
2309
2527
  }>>;
2528
+ /**
2529
+ * Get available commands for a session
2530
+ * If session.availableCommands has cached values, return them
2531
+ * Otherwise, fetch from provider (for LocalAgentProvider)
2532
+ * @param sessionId - Session ID to get commands for (optional, for global commands)
2533
+ * @returns Promise<AvailableCommand[]> - Array of available commands
2534
+ */
2535
+ getAvailableCommands(sessionId?: string): Promise<AvailableCommand[]>;
2310
2536
  }
2311
2537
  /**
2312
2538
  * Workspace information (aligned with FolderSelectResult)
@@ -2435,6 +2661,52 @@ interface SearchFileResponse {
2435
2661
  /** Error message (if failed) */
2436
2662
  readonly error?: string;
2437
2663
  }
2664
+ /**
2665
+ * Subagent information
2666
+ */
2667
+ interface SubagentInfo {
2668
+ /** Subagent name */
2669
+ name: string;
2670
+ /** Subagent description */
2671
+ description: string;
2672
+ /** System prompt */
2673
+ systemPrompt: string;
2674
+ /** File path */
2675
+ filePath?: string;
2676
+ /** Model type */
2677
+ model?: string;
2678
+ /** Agent mode */
2679
+ agentMode?: 'agentic' | 'manual';
2680
+ /** Whether enabled */
2681
+ enabled?: boolean;
2682
+ /** Model ID */
2683
+ modelID?: string;
2684
+ /** Subagent level */
2685
+ level?: 'project' | 'user';
2686
+ }
2687
+ /**
2688
+ * Parameters for getting subagent list
2689
+ */
2690
+ interface GetSubagentListParams {
2691
+ /** Search options */
2692
+ readonly options: {
2693
+ /** Search keyword (filter by name or description) */readonly search?: string; /** Limit number of results */
2694
+ readonly resultNum?: number; /** Agent mode filter */
2695
+ readonly agentMode?: 'agentic' | 'manual' | 'all'; /** Whether to return only enabled subagents */
2696
+ readonly onlyEnabled?: boolean;
2697
+ };
2698
+ /** Working directory (optional, for filtering project-level subagents) */
2699
+ readonly cwd?: string;
2700
+ }
2701
+ /**
2702
+ * Response from getting subagent list
2703
+ */
2704
+ interface GetSubagentListResponse {
2705
+ /** Subagent list */
2706
+ readonly results: SubagentInfo[];
2707
+ /** Error message (if failed) */
2708
+ readonly error?: string;
2709
+ }
2438
2710
  //#endregion
2439
2711
  //#region ../agent-provider/lib/common/providers/cloud-agent-provider/cloud-connection.d.ts
2440
2712
  /**
@@ -2691,8 +2963,11 @@ declare class CloudAgentProvider implements AgentProvider<CloudAgentConnection>,
2691
2963
  /**
2692
2964
  * Create a new conversation
2693
2965
  * POST {endpoint}/console/as/conversations
2966
+ * @param params - Optional session params containing _meta with tags
2694
2967
  */
2695
- create(): Promise<string>;
2968
+ create(params?: {
2969
+ _meta?: Record<string, unknown>;
2970
+ }): Promise<string>;
2696
2971
  /**
2697
2972
  * Connect to an agent and return the connection
2698
2973
  *
@@ -3140,7 +3415,7 @@ declare class ActiveSessionImpl implements ActiveSession {
3140
3415
  * await session.setMode('architect');
3141
3416
  * ```
3142
3417
  */
3143
- setMode(modeId: string): Promise<void>;
3418
+ setMode(modeId: string, skipAvailableChecker?: boolean): Promise<void>;
3144
3419
  /**
3145
3420
  * Set the current session model
3146
3421
  *
@@ -3271,6 +3546,18 @@ declare class SessionManager {
3271
3546
  * 7. Return ActiveSession instance (cached)
3272
3547
  */
3273
3548
  loadSession(params: LoadSessionParams$1): Promise<ActiveSession>;
3549
+ /**
3550
+ * 从 ACP response 中提取可用模型列表
3551
+ *
3552
+ * 优先级:
3553
+ * 1. response.models._meta?.['codebuddy.ai']?.availableModels - 包含完整的模型信息(字段名为 'id')
3554
+ * 2. response.models?.availableModels - 只包含基本信息(字段名为 'modelId')
3555
+ * 3. undefined - 都没有时返回 undefined
3556
+ *
3557
+ * @param response - ACP 响应对象
3558
+ * @returns ModelInfo[] | undefined
3559
+ */
3560
+ protected extractAvailableModels(response: LoadSessionResponse): ModelInfo[] | undefined;
3274
3561
  }
3275
3562
  //#endregion
3276
3563
  //#region ../agent-provider/lib/backend/backend-provider.d.ts
@@ -3410,6 +3697,38 @@ declare class BackendProvider implements IBackendProvider {
3410
3697
  * API: POST /billing/meter/get-enterprise-user-usage
3411
3698
  */
3412
3699
  getEnterpriseUsage(enterpriseId: string): Promise<EnterpriseUsage | null>;
3700
+ /**
3701
+ * 刷新 Token
3702
+ * 通过调用 getAccount 刷新 cookie,适用于 Cloud 场景下页面切换回来时刷新登录态
3703
+ * @returns Promise<Account | null> 刷新后的账号信息
3704
+ */
3705
+ refreshToken(): Promise<Account | null>;
3706
+ /**
3707
+ * 获取仓库分支列表
3708
+ * API 端点: GET /console/as/connector/oauth/{name}/branches
3709
+ *
3710
+ * @param connector 连接器名称 ('github' | 'gongfeng' | 'cnb')
3711
+ * @param params 平台特定的查询参数
3712
+ * @param page 页码,从1开始,0表示不分页获取全部
3713
+ * @param perPage 每页数量,最大100
3714
+ * @returns Promise<OauthBranch[]> 分支列表
3715
+ */
3716
+ getBranches(connector: OauthConnectorName, params: GitHubBranchParams | GongfengBranchParams | CNBBranchParams, page?: number, perPage?: number): Promise<OauthBranch[]>;
3717
+ /**
3718
+ * 获取仓库列表
3719
+ * API 端点: GET /console/as/connector/oauth/{name}/repos
3720
+ *
3721
+ * Note: 由于工蜂原生支持的 Search 能力会匹配 path/name/description 部分,
3722
+ * 且不支持定制,不满足产品要求(只按 name 匹配),因此前端拉取全量数据后做筛选。
3723
+ *
3724
+ * @param connector 连接器名称 ('github' | 'gongfeng' | 'cnb')
3725
+ * @param page 页码,从1开始,0表示不分页获取全部
3726
+ * - GitHub 只支持全量数据,必须传 0
3727
+ * - 工蜂和 CNB 依据前端逻辑而定
3728
+ * @param perPage 每页数量,最大100
3729
+ * @returns Promise<ListReposResponse> 仓库列表响应
3730
+ */
3731
+ getRepositories(connector: OauthConnectorName, page?: number, perPage?: number): Promise<ListReposResponse>;
3413
3732
  }
3414
3733
  /**
3415
3734
  * 创建 BackendProvider 实例
@@ -3543,6 +3862,12 @@ declare class IPCBackendProvider implements IBackendProvider {
3543
3862
  * IDE 环境: 通过 IPC 通知 IDE 关闭 Agent Manager(用于返回 IDE)
3544
3863
  */
3545
3864
  closeAgentManager(): Promise<void>;
3865
+ /**
3866
+ * 在外部浏览器中打开链接
3867
+ * IDE 环境: 通过 IPC 通知 IDE 使用 vscode.env.openExternal 打开 URL
3868
+ * @param url 要打开的 URL
3869
+ */
3870
+ openExternal(url: string): Promise<void>;
3546
3871
  /**
3547
3872
  * 批量切换插件状态
3548
3873
  * IDE 环境: 通过 IPC 调用 Extension Host 的 PluginService