@tencent-ai/cloud-agent-sdk 0.2.11 → 0.2.12-next.21a87f3.20260203
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.cjs +385 -68
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +462 -129
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +462 -129
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +385 -68
- package/dist/index.mjs.map +1 -1
- package/dist/tencent-ai-cloud-agent-sdk-0.2.12-next.21a87f3.20260203.tgz +0 -0
- package/package.json +4 -3
- package/dist/tencent-ai-cloud-agent-sdk-0.2.11.tgz +0 -0
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
|
-
*
|
|
344
|
+
* OAuth Repository Types
|
|
345
345
|
*
|
|
346
|
-
* 定义
|
|
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
|
/** 到期时间戳 */
|
|
@@ -679,84 +916,6 @@ interface RevokeAllRequest {
|
|
|
679
916
|
/** 安装ID列表(可选,如果不传则撤销所有) */
|
|
680
917
|
installationIds?: string[];
|
|
681
918
|
}
|
|
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
919
|
/**
|
|
761
920
|
* 获取仓库列表响应
|
|
762
921
|
*/
|
|
@@ -764,8 +923,8 @@ interface GetRepoListResponse {
|
|
|
764
923
|
github_repos?: {
|
|
765
924
|
[key: string | number]: OauthGitHubRepo[];
|
|
766
925
|
};
|
|
767
|
-
gongfeng_repos?:
|
|
768
|
-
cnb_repos?:
|
|
926
|
+
gongfeng_repos?: OauthGongFengRepo[];
|
|
927
|
+
cnb_repos?: OauthCNBRepo[];
|
|
769
928
|
}
|
|
770
929
|
/**
|
|
771
930
|
* OAuth 用户信息
|
|
@@ -961,6 +1120,17 @@ interface IBackendProvider {
|
|
|
961
1120
|
reloadWindow?(params?: {
|
|
962
1121
|
locale?: string;
|
|
963
1122
|
}): Promise<void>;
|
|
1123
|
+
/**
|
|
1124
|
+
* 关闭 Agent Manager 面板(可选,仅 IPC 环境支持)
|
|
1125
|
+
* 用于 Local 模式下点击 Logo 返回 IDE
|
|
1126
|
+
*/
|
|
1127
|
+
closeAgentManager?(): Promise<void>;
|
|
1128
|
+
/**
|
|
1129
|
+
* 在外部浏览器中打开链接(可选,仅 IPC 环境支持)
|
|
1130
|
+
* 用于 Local 模式下打开外部 URL
|
|
1131
|
+
* @param url 要打开的 URL
|
|
1132
|
+
*/
|
|
1133
|
+
openExternal?(url: string): Promise<void>;
|
|
964
1134
|
/**
|
|
965
1135
|
* 监听事件(可选,用于 IPC 环境)
|
|
966
1136
|
* @param event 事件名称
|
|
@@ -974,27 +1144,60 @@ interface IBackendProvider {
|
|
|
974
1144
|
*/
|
|
975
1145
|
getEnterpriseUsage?(enterpriseId: string): Promise<EnterpriseUsage | null>;
|
|
976
1146
|
/**
|
|
977
|
-
*
|
|
978
|
-
*
|
|
979
|
-
*
|
|
1147
|
+
* 刷新 Token(可选)
|
|
1148
|
+
* 通过调用 getAccount 刷新 cookie
|
|
1149
|
+
* 适用于 Cloud 场景下页面切换回来时刷新登录态
|
|
1150
|
+
* @returns Promise<Account | null> 刷新后的账号信息
|
|
1151
|
+
*/
|
|
1152
|
+
refreshToken?(): Promise<Account | null>;
|
|
1153
|
+
/**
|
|
1154
|
+
* 获取仓库分支列表
|
|
1155
|
+
* API 端点: GET /console/as/connector/oauth/{name}/branches
|
|
1156
|
+
*
|
|
1157
|
+
* @param connector 连接器名称 ('github' | 'gongfeng' | 'cnb')
|
|
1158
|
+
* @param params 平台特定的查询参数
|
|
1159
|
+
* @param page 页码,从1开始,0表示不分页获取全部
|
|
1160
|
+
* @param perPage 每页数量,最大100
|
|
1161
|
+
* @returns Promise<OauthBranch[]> 分支列表
|
|
1162
|
+
*/
|
|
1163
|
+
getBranches?(connector: OauthConnectorName, params: GitHubBranchParams | GongfengBranchParams | CNBBranchParams, page?: number, perPage?: number): Promise<OauthBranch[]>;
|
|
1164
|
+
/**
|
|
1165
|
+
* 获取仓库列表
|
|
1166
|
+
* API 端点: GET /console/as/connector/oauth/{name}/repos
|
|
1167
|
+
*
|
|
1168
|
+
* @param connector 连接器名称 ('github' | 'gongfeng' | 'cnb')
|
|
1169
|
+
* @param page 页码,从1开始,0表示不分页获取全部
|
|
1170
|
+
* @param perPage 每页数量,最大100
|
|
1171
|
+
* @returns Promise<ListReposResponse> 仓库列表响应
|
|
980
1172
|
*/
|
|
981
|
-
|
|
1173
|
+
getRepositories?(connector: OauthConnectorName, page?: number, perPage?: number): Promise<ListReposResponse>;
|
|
982
1174
|
}
|
|
983
1175
|
/**
|
|
984
|
-
*
|
|
985
|
-
*
|
|
1176
|
+
* 场景中的插件信息
|
|
1177
|
+
* 用于描述场景关联的插件
|
|
986
1178
|
*/
|
|
987
|
-
interface
|
|
1179
|
+
interface ScenePlugin {
|
|
988
1180
|
/** 插件唯一标识 */
|
|
989
|
-
id:
|
|
990
|
-
/**
|
|
1181
|
+
id: number;
|
|
1182
|
+
/** 插件名称 */
|
|
991
1183
|
name: string;
|
|
992
|
-
/** 插件对应的 prompt 内容 */
|
|
993
|
-
prompt: string;
|
|
994
1184
|
/** 插件市场名称 */
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1185
|
+
marketplaceName: string;
|
|
1186
|
+
}
|
|
1187
|
+
/**
|
|
1188
|
+
* 支持的场景信息
|
|
1189
|
+
* 用于 Welcome 页面的 QuickActions 快捷操作
|
|
1190
|
+
* API 端点: GET /console/as/support/scenes (Web) 或 GET /v2/as/support/scenes (Local)
|
|
1191
|
+
*/
|
|
1192
|
+
interface SupportScene {
|
|
1193
|
+
/** 场景唯一标识 */
|
|
1194
|
+
id: number;
|
|
1195
|
+
/** 场景显示名称 */
|
|
1196
|
+
name: string;
|
|
1197
|
+
/** 场景关联的插件列表 */
|
|
1198
|
+
plugins: ScenePlugin[];
|
|
1199
|
+
/** 场景对应的 prompt 列表 */
|
|
1200
|
+
prompts: string[];
|
|
998
1201
|
}
|
|
999
1202
|
/**
|
|
1000
1203
|
* 插件作用域
|
|
@@ -1989,7 +2192,7 @@ interface ActiveSession {
|
|
|
1989
2192
|
error?: string;
|
|
1990
2193
|
}>;
|
|
1991
2194
|
/** Set the current session mode */
|
|
1992
|
-
setMode(modeId: string): Promise<void>;
|
|
2195
|
+
setMode(modeId: string, skipChecker?: boolean): Promise<void>;
|
|
1993
2196
|
/** Set the current session model */
|
|
1994
2197
|
setSessionModel(modelId: string): Promise<void>;
|
|
1995
2198
|
/** Set available commands (called when available_commands_update is received) */
|
|
@@ -2132,6 +2335,13 @@ interface AgentProvider<C extends AgentConnection = AgentConnection> {
|
|
|
2132
2335
|
* @returns Response with search results
|
|
2133
2336
|
*/
|
|
2134
2337
|
searchFile?(params: SearchFileParams): Promise<SearchFileResponse>;
|
|
2338
|
+
/**
|
|
2339
|
+
* Get subagent list (optional, used by LocalAgentProvider)
|
|
2340
|
+
*
|
|
2341
|
+
* @param params - Query parameters including options
|
|
2342
|
+
* @returns Response with subagent list
|
|
2343
|
+
*/
|
|
2344
|
+
getSubagentList?(params: GetSubagentListParams): Promise<GetSubagentListResponse>;
|
|
2135
2345
|
/**
|
|
2136
2346
|
* Batch toggle plugins (optional, used by LocalAgentProvider)
|
|
2137
2347
|
*
|
|
@@ -2151,6 +2361,7 @@ interface AgentProvider<C extends AgentConnection = AgentConnection> {
|
|
|
2151
2361
|
status: string;
|
|
2152
2362
|
description?: string;
|
|
2153
2363
|
version?: string;
|
|
2364
|
+
installScope?: 'user' | 'project';
|
|
2154
2365
|
}>>;
|
|
2155
2366
|
/**
|
|
2156
2367
|
* Install plugins (optional, used by LocalAgentProvider)
|
|
@@ -2158,12 +2369,22 @@ interface AgentProvider<C extends AgentConnection = AgentConnection> {
|
|
|
2158
2369
|
* @param pluginNames - Array of plugin names to install
|
|
2159
2370
|
* @param marketplaceName - Marketplace name
|
|
2160
2371
|
* @param installScope - Install scope ('user' | 'project')
|
|
2372
|
+
* @param marketplaceSource - Marketplace source URL (for auto-adding marketplace when not exists)
|
|
2161
2373
|
* @returns Result of the operation
|
|
2162
2374
|
*/
|
|
2163
|
-
installPlugins?(pluginNames: string[], marketplaceName: string, installScope?: 'user' | 'project'): Promise<{
|
|
2375
|
+
installPlugins?(pluginNames: string[], marketplaceName: string, installScope?: 'user' | 'project', marketplaceSource?: string): Promise<{
|
|
2164
2376
|
success: boolean;
|
|
2165
2377
|
error?: string;
|
|
2166
2378
|
}>;
|
|
2379
|
+
/**
|
|
2380
|
+
* Get available commands for a session (optional, used by LocalAgentProvider)
|
|
2381
|
+
* If session.availableCommands has cached values, return them
|
|
2382
|
+
* Otherwise, fetch from product configuration
|
|
2383
|
+
*
|
|
2384
|
+
* @param sessionId - Session ID to get commands for (optional, for global commands)
|
|
2385
|
+
* @returns Array of available commands
|
|
2386
|
+
*/
|
|
2387
|
+
getAvailableCommands?(sessionId?: string): Promise<AvailableCommand[]>;
|
|
2167
2388
|
/**
|
|
2168
2389
|
* Register an event listener
|
|
2169
2390
|
* Provider implementations should forward events to the underlying transport
|
|
@@ -2266,6 +2487,8 @@ interface ClientSessionsResource {
|
|
|
2266
2487
|
uploadFile(params: UploadFileParams): Promise<UploadFileResponse>;
|
|
2267
2488
|
/** Search for files in the workspace (for LocalAgentProvider) */
|
|
2268
2489
|
searchFile(params: SearchFileParams): Promise<SearchFileResponse>;
|
|
2490
|
+
/** Get subagent list (for LocalAgentProvider) */
|
|
2491
|
+
getSubagentList(params: GetSubagentListParams): Promise<GetSubagentListResponse>;
|
|
2269
2492
|
/** Batch toggle plugins (for LocalAgentProvider) */
|
|
2270
2493
|
batchTogglePlugins(request: BatchPluginOperationRequest): Promise<BatchPluginOperationResult>;
|
|
2271
2494
|
/** Get installed plugins (for LocalAgentProvider) */
|
|
@@ -2275,31 +2498,35 @@ interface ClientSessionsResource {
|
|
|
2275
2498
|
status: string;
|
|
2276
2499
|
description?: string;
|
|
2277
2500
|
version?: string;
|
|
2501
|
+
installScope?: 'user' | 'project';
|
|
2278
2502
|
}>>;
|
|
2279
2503
|
/** Install plugins (for LocalAgentProvider) */
|
|
2280
|
-
installPlugins
|
|
2504
|
+
installPlugins(pluginNames: string[], marketplaceName: string, installScope?: 'user' | 'project', marketplaceSource?: string): Promise<{
|
|
2281
2505
|
success: boolean;
|
|
2282
2506
|
error?: string;
|
|
2283
2507
|
}>;
|
|
2284
|
-
/**
|
|
2285
|
-
|
|
2286
|
-
|
|
2508
|
+
/**
|
|
2509
|
+
* Get support scenes from backend API (for LocalAgentProvider)
|
|
2510
|
+
* API 端点: GET /v2/as/support/scenes (Local) 或 GET /console/as/support/scenes (Web)
|
|
2511
|
+
*/
|
|
2512
|
+
getSupportScenes(): Promise<Array<{
|
|
2513
|
+
id: number;
|
|
2287
2514
|
name: string;
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
pluginMarketplaceName?: string;
|
|
2295
|
-
pluginName?: string;
|
|
2296
|
-
quickAction?: {
|
|
2297
|
-
title?: string;
|
|
2298
|
-
description?: string;
|
|
2299
|
-
icon?: string;
|
|
2300
|
-
promptTemplate?: string;
|
|
2301
|
-
};
|
|
2515
|
+
plugins: Array<{
|
|
2516
|
+
id: number;
|
|
2517
|
+
name: string;
|
|
2518
|
+
marketplaceName: string;
|
|
2519
|
+
}>;
|
|
2520
|
+
prompts: string[];
|
|
2302
2521
|
}>>;
|
|
2522
|
+
/**
|
|
2523
|
+
* Get available commands for a session
|
|
2524
|
+
* If session.availableCommands has cached values, return them
|
|
2525
|
+
* Otherwise, fetch from provider (for LocalAgentProvider)
|
|
2526
|
+
* @param sessionId - Session ID to get commands for (optional, for global commands)
|
|
2527
|
+
* @returns Promise<AvailableCommand[]> - Array of available commands
|
|
2528
|
+
*/
|
|
2529
|
+
getAvailableCommands(sessionId?: string): Promise<AvailableCommand[]>;
|
|
2303
2530
|
}
|
|
2304
2531
|
/**
|
|
2305
2532
|
* Workspace information (aligned with FolderSelectResult)
|
|
@@ -2428,6 +2655,52 @@ interface SearchFileResponse {
|
|
|
2428
2655
|
/** Error message (if failed) */
|
|
2429
2656
|
readonly error?: string;
|
|
2430
2657
|
}
|
|
2658
|
+
/**
|
|
2659
|
+
* Subagent information
|
|
2660
|
+
*/
|
|
2661
|
+
interface SubagentInfo {
|
|
2662
|
+
/** Subagent name */
|
|
2663
|
+
name: string;
|
|
2664
|
+
/** Subagent description */
|
|
2665
|
+
description: string;
|
|
2666
|
+
/** System prompt */
|
|
2667
|
+
systemPrompt: string;
|
|
2668
|
+
/** File path */
|
|
2669
|
+
filePath?: string;
|
|
2670
|
+
/** Model type */
|
|
2671
|
+
model?: string;
|
|
2672
|
+
/** Agent mode */
|
|
2673
|
+
agentMode?: 'agentic' | 'manual';
|
|
2674
|
+
/** Whether enabled */
|
|
2675
|
+
enabled?: boolean;
|
|
2676
|
+
/** Model ID */
|
|
2677
|
+
modelID?: string;
|
|
2678
|
+
/** Subagent level */
|
|
2679
|
+
level?: 'project' | 'user';
|
|
2680
|
+
}
|
|
2681
|
+
/**
|
|
2682
|
+
* Parameters for getting subagent list
|
|
2683
|
+
*/
|
|
2684
|
+
interface GetSubagentListParams {
|
|
2685
|
+
/** Search options */
|
|
2686
|
+
readonly options: {
|
|
2687
|
+
/** Search keyword (filter by name or description) */readonly search?: string; /** Limit number of results */
|
|
2688
|
+
readonly resultNum?: number; /** Agent mode filter */
|
|
2689
|
+
readonly agentMode?: 'agentic' | 'manual' | 'all'; /** Whether to return only enabled subagents */
|
|
2690
|
+
readonly onlyEnabled?: boolean;
|
|
2691
|
+
};
|
|
2692
|
+
/** Working directory (optional, for filtering project-level subagents) */
|
|
2693
|
+
readonly cwd?: string;
|
|
2694
|
+
}
|
|
2695
|
+
/**
|
|
2696
|
+
* Response from getting subagent list
|
|
2697
|
+
*/
|
|
2698
|
+
interface GetSubagentListResponse {
|
|
2699
|
+
/** Subagent list */
|
|
2700
|
+
readonly results: SubagentInfo[];
|
|
2701
|
+
/** Error message (if failed) */
|
|
2702
|
+
readonly error?: string;
|
|
2703
|
+
}
|
|
2431
2704
|
//#endregion
|
|
2432
2705
|
//#region ../agent-provider/lib/common/providers/cloud-agent-provider/cloud-connection.d.ts
|
|
2433
2706
|
/**
|
|
@@ -2684,8 +2957,11 @@ declare class CloudAgentProvider implements AgentProvider<CloudAgentConnection>,
|
|
|
2684
2957
|
/**
|
|
2685
2958
|
* Create a new conversation
|
|
2686
2959
|
* POST {endpoint}/console/as/conversations
|
|
2960
|
+
* @param params - Optional session params containing _meta with tags
|
|
2687
2961
|
*/
|
|
2688
|
-
create(
|
|
2962
|
+
create(params?: {
|
|
2963
|
+
_meta?: Record<string, unknown>;
|
|
2964
|
+
}): Promise<string>;
|
|
2689
2965
|
/**
|
|
2690
2966
|
* Connect to an agent and return the connection
|
|
2691
2967
|
*
|
|
@@ -2793,6 +3069,14 @@ declare class CloudAgentProvider implements AgentProvider<CloudAgentConnection>,
|
|
|
2793
3069
|
* @param args - Event arguments
|
|
2794
3070
|
*/
|
|
2795
3071
|
private emitEvent;
|
|
3072
|
+
/**
|
|
3073
|
+
* 获取支持的场景列表
|
|
3074
|
+
* API 端点: GET /console/as/support/scenes
|
|
3075
|
+
* 用于 Welcome 页面的 QuickActions 快捷操作
|
|
3076
|
+
*
|
|
3077
|
+
* @returns Promise<SupportScene[]> 支持的场景列表
|
|
3078
|
+
*/
|
|
3079
|
+
getSupportScenes(): Promise<SupportScene[]>;
|
|
2796
3080
|
private toAgentState;
|
|
2797
3081
|
/**
|
|
2798
3082
|
* Helper: 将 GET 请求的 body 转换为 URL 查询参数
|
|
@@ -3125,7 +3409,7 @@ declare class ActiveSessionImpl implements ActiveSession {
|
|
|
3125
3409
|
* await session.setMode('architect');
|
|
3126
3410
|
* ```
|
|
3127
3411
|
*/
|
|
3128
|
-
setMode(modeId: string): Promise<void>;
|
|
3412
|
+
setMode(modeId: string, skipAvailableChecker?: boolean): Promise<void>;
|
|
3129
3413
|
/**
|
|
3130
3414
|
* Set the current session model
|
|
3131
3415
|
*
|
|
@@ -3256,6 +3540,18 @@ declare class SessionManager {
|
|
|
3256
3540
|
* 7. Return ActiveSession instance (cached)
|
|
3257
3541
|
*/
|
|
3258
3542
|
loadSession(params: LoadSessionParams$1): Promise<ActiveSession>;
|
|
3543
|
+
/**
|
|
3544
|
+
* 从 ACP response 中提取可用模型列表
|
|
3545
|
+
*
|
|
3546
|
+
* 优先级:
|
|
3547
|
+
* 1. response.models._meta?.['codebuddy.ai']?.availableModels - 包含完整的模型信息(字段名为 'id')
|
|
3548
|
+
* 2. response.models?.availableModels - 只包含基本信息(字段名为 'modelId')
|
|
3549
|
+
* 3. undefined - 都没有时返回 undefined
|
|
3550
|
+
*
|
|
3551
|
+
* @param response - ACP 响应对象
|
|
3552
|
+
* @returns ModelInfo[] | undefined
|
|
3553
|
+
*/
|
|
3554
|
+
protected extractAvailableModels(response: LoadSessionResponse): ModelInfo[] | undefined;
|
|
3259
3555
|
}
|
|
3260
3556
|
//#endregion
|
|
3261
3557
|
//#region ../agent-provider/lib/backend/backend-provider.d.ts
|
|
@@ -3396,11 +3692,37 @@ declare class BackendProvider implements IBackendProvider {
|
|
|
3396
3692
|
*/
|
|
3397
3693
|
getEnterpriseUsage(enterpriseId: string): Promise<EnterpriseUsage | null>;
|
|
3398
3694
|
/**
|
|
3399
|
-
*
|
|
3400
|
-
*
|
|
3401
|
-
*
|
|
3695
|
+
* 刷新 Token
|
|
3696
|
+
* 通过调用 getAccount 刷新 cookie,适用于 Cloud 场景下页面切换回来时刷新登录态
|
|
3697
|
+
* @returns Promise<Account | null> 刷新后的账号信息
|
|
3698
|
+
*/
|
|
3699
|
+
refreshToken(): Promise<Account | null>;
|
|
3700
|
+
/**
|
|
3701
|
+
* 获取仓库分支列表
|
|
3702
|
+
* API 端点: GET /console/as/connector/oauth/{name}/branches
|
|
3703
|
+
*
|
|
3704
|
+
* @param connector 连接器名称 ('github' | 'gongfeng' | 'cnb')
|
|
3705
|
+
* @param params 平台特定的查询参数
|
|
3706
|
+
* @param page 页码,从1开始,0表示不分页获取全部
|
|
3707
|
+
* @param perPage 每页数量,最大100
|
|
3708
|
+
* @returns Promise<OauthBranch[]> 分支列表
|
|
3709
|
+
*/
|
|
3710
|
+
getBranches(connector: OauthConnectorName, params: GitHubBranchParams | GongfengBranchParams | CNBBranchParams, page?: number, perPage?: number): Promise<OauthBranch[]>;
|
|
3711
|
+
/**
|
|
3712
|
+
* 获取仓库列表
|
|
3713
|
+
* API 端点: GET /console/as/connector/oauth/{name}/repos
|
|
3714
|
+
*
|
|
3715
|
+
* Note: 由于工蜂原生支持的 Search 能力会匹配 path/name/description 部分,
|
|
3716
|
+
* 且不支持定制,不满足产品要求(只按 name 匹配),因此前端拉取全量数据后做筛选。
|
|
3717
|
+
*
|
|
3718
|
+
* @param connector 连接器名称 ('github' | 'gongfeng' | 'cnb')
|
|
3719
|
+
* @param page 页码,从1开始,0表示不分页获取全部
|
|
3720
|
+
* - GitHub 只支持全量数据,必须传 0
|
|
3721
|
+
* - 工蜂和 CNB 依据前端逻辑而定
|
|
3722
|
+
* @param perPage 每页数量,最大100
|
|
3723
|
+
* @returns Promise<ListReposResponse> 仓库列表响应
|
|
3402
3724
|
*/
|
|
3403
|
-
|
|
3725
|
+
getRepositories(connector: OauthConnectorName, page?: number, perPage?: number): Promise<ListReposResponse>;
|
|
3404
3726
|
}
|
|
3405
3727
|
/**
|
|
3406
3728
|
* 创建 BackendProvider 实例
|
|
@@ -3529,23 +3851,34 @@ declare class IPCBackendProvider implements IBackendProvider {
|
|
|
3529
3851
|
reloadWindow(params?: {
|
|
3530
3852
|
locale?: string;
|
|
3531
3853
|
}): Promise<void>;
|
|
3854
|
+
/**
|
|
3855
|
+
* 关闭 Agent Manager 面板
|
|
3856
|
+
* IDE 环境: 通过 IPC 通知 IDE 关闭 Agent Manager(用于返回 IDE)
|
|
3857
|
+
*/
|
|
3858
|
+
closeAgentManager(): Promise<void>;
|
|
3859
|
+
/**
|
|
3860
|
+
* 在外部浏览器中打开链接
|
|
3861
|
+
* IDE 环境: 通过 IPC 通知 IDE 使用 vscode.env.openExternal 打开 URL
|
|
3862
|
+
* @param url 要打开的 URL
|
|
3863
|
+
*/
|
|
3864
|
+
openExternal(url: string): Promise<void>;
|
|
3532
3865
|
/**
|
|
3533
3866
|
* 批量切换插件状态
|
|
3534
3867
|
* IDE 环境: 通过 IPC 调用 Extension Host 的 PluginService
|
|
3535
3868
|
*/
|
|
3536
3869
|
batchTogglePlugins(request: BatchPluginOperationRequest): Promise<BatchPluginOperationResult>;
|
|
3537
3870
|
/**
|
|
3538
|
-
*
|
|
3871
|
+
* 获取支持的场景列表
|
|
3539
3872
|
* IDE 环境: 通过 IPC 调用后端 API
|
|
3540
3873
|
* 用于 Welcome 页面的 QuickActions 快捷操作
|
|
3541
3874
|
*
|
|
3542
3875
|
* 调用链:
|
|
3543
|
-
* 1. agent-ui: IPCBackendProvider.
|
|
3544
|
-
* 2. Extension Host: BackendBridgeService.
|
|
3545
|
-
* 3. Backend API: GET /v2/as/support/
|
|
3546
|
-
* 4. 返回
|
|
3876
|
+
* 1. agent-ui: IPCBackendProvider.getSupportScenes()
|
|
3877
|
+
* 2. Extension Host: BackendBridgeService.handleGetSupportScenes()
|
|
3878
|
+
* 3. Backend API: GET /v2/as/support/scenes
|
|
3879
|
+
* 4. 返回 SupportScene[] 数据给 agent-ui
|
|
3547
3880
|
*/
|
|
3548
|
-
|
|
3881
|
+
getSupportScenes(): Promise<SupportScene[]>;
|
|
3549
3882
|
/**
|
|
3550
3883
|
* 调试日志
|
|
3551
3884
|
*/
|