@kevisual/cnb 0.0.42 → 0.0.43
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/agent/app.ts +5 -4
- package/agent/modules/cnb-manager.ts +20 -2
- package/agent/npc.ts +94 -0
- package/agent/routes/chat/chat.ts +41 -0
- package/agent/routes/index.ts +1 -0
- package/agent/routes/issues/comments.ts +14 -4
- package/agent/routes/issues/list.ts +33 -0
- package/agent/routes/opencode/index.ts +12 -0
- package/dist/cli.js +30510 -21932
- package/dist/keep.js +14 -14
- package/dist/opencode.js +56459 -47891
- package/dist/routes.d.ts +47 -4
- package/dist/routes.js +30383 -21816
- package/package.json +16 -11
- package/src/issue/index.ts +14 -3
- package/src/issue/npc/build-env.ts +217 -0
- package/src/issue/npc/env.ts +73 -296
- package/src/issue/npc/pr-env.ts +95 -0
- package/src/issue/npc/repo-env.ts +56 -0
package/dist/routes.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { QueryRouterServer } from '@kevisual/router';
|
|
2
2
|
import { Result as Result$1 } from '@kevisual/query/query';
|
|
3
3
|
import { Result as Result$2 } from '@kevisual/query';
|
|
4
|
+
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
|
|
4
5
|
|
|
5
6
|
type CNBCoreOptions<T = {}> = {
|
|
6
7
|
token: string;
|
|
@@ -512,6 +513,18 @@ type IssueLabel = {
|
|
|
512
513
|
description: string;
|
|
513
514
|
id: string;
|
|
514
515
|
name: string;
|
|
516
|
+
creator?: {
|
|
517
|
+
username: string;
|
|
518
|
+
nickname: string;
|
|
519
|
+
email: string;
|
|
520
|
+
is_npc: boolean;
|
|
521
|
+
};
|
|
522
|
+
applied_by?: {
|
|
523
|
+
username: string;
|
|
524
|
+
nickname: string;
|
|
525
|
+
email: string;
|
|
526
|
+
is_npc: boolean;
|
|
527
|
+
};
|
|
515
528
|
};
|
|
516
529
|
type IssueAuthor = {
|
|
517
530
|
name: string;
|
|
@@ -551,8 +564,8 @@ type IssueItem = {
|
|
|
551
564
|
};
|
|
552
565
|
declare class Issue extends CNBCore {
|
|
553
566
|
constructor(options: CNBCoreOptions);
|
|
554
|
-
createIssue(repo: string, data: Partial<IssueItem>): Promise<
|
|
555
|
-
updateIssue(repo: string, issueNumber: string | number, data: Partial<IssueItem>): Promise<
|
|
567
|
+
createIssue(repo: string, data: Partial<IssueItem>): Promise<Result<IssueItem>>;
|
|
568
|
+
updateIssue(repo: string, issueNumber: string | number, data: Partial<IssueItem>): Promise<Result<IssueItem>>;
|
|
556
569
|
getItem(repo: string, issueNumber: string | number): Promise<Result<IssueItem>>;
|
|
557
570
|
getList(repo: string, params?: Partial<GetListParams>): Promise<Result<IssueItem[]>>;
|
|
558
571
|
getCommentList(repo: string, issueNumber: string | number, params?: {
|
|
@@ -574,40 +587,69 @@ declare class Issue extends CNBCore {
|
|
|
574
587
|
getAliveMetadata(repo: string, issueNumber: string | number): Promise<Result<AliveMetadata>>;
|
|
575
588
|
useNPCEnv(): {
|
|
576
589
|
npcSlug: any;
|
|
590
|
+
npcSlugLabel: string;
|
|
577
591
|
npcName: any;
|
|
592
|
+
npcNameLabel: string;
|
|
578
593
|
npcSha: any;
|
|
594
|
+
npcShaLabel: string;
|
|
579
595
|
npcPrompt: any;
|
|
596
|
+
npcPromptLabel: string;
|
|
580
597
|
npcAvatar: any;
|
|
598
|
+
npcAvatarLabel: string;
|
|
581
599
|
npcEnableThinking: any;
|
|
600
|
+
npcEnableThinkingLabel: string;
|
|
582
601
|
};
|
|
583
602
|
useCommentEnv(): {
|
|
584
603
|
commentId: any;
|
|
604
|
+
commentIdLabel: string;
|
|
585
605
|
commentBody: any;
|
|
606
|
+
commentBodyLabel: string;
|
|
586
607
|
commentType: any;
|
|
608
|
+
commentTypeLabel: string;
|
|
587
609
|
commentFilePath: any;
|
|
610
|
+
commentFilePathLabel: string;
|
|
588
611
|
commentRange: any;
|
|
612
|
+
commentRangeLabel: string;
|
|
589
613
|
reviewId: any;
|
|
614
|
+
reviewIdLabel: string;
|
|
590
615
|
};
|
|
591
616
|
usePullRequestEnv(): {
|
|
592
617
|
pullRequest: any;
|
|
618
|
+
pullRequestLabel: string;
|
|
593
619
|
pullRequestLike: any;
|
|
620
|
+
pullRequestLikeLabel: string;
|
|
594
621
|
pullRequestProposer: any;
|
|
622
|
+
pullRequestProposerLabel: string;
|
|
595
623
|
pullRequestTitle: any;
|
|
624
|
+
pullRequestTitleLabel: string;
|
|
596
625
|
pullRequestBranch: any;
|
|
626
|
+
pullRequestBranchLabel: string;
|
|
597
627
|
pullRequestSha: any;
|
|
628
|
+
pullRequestShaLabel: string;
|
|
598
629
|
pullRequestTargetSha: any;
|
|
630
|
+
pullRequestTargetShaLabel: string;
|
|
599
631
|
pullRequestMergeSha: any;
|
|
632
|
+
pullRequestMergeShaLabel: string;
|
|
600
633
|
pullRequestSlug: any;
|
|
634
|
+
pullRequestSlugLabel: string;
|
|
601
635
|
pullRequestAction: any;
|
|
636
|
+
pullRequestActionLabel: string;
|
|
602
637
|
pullRequestId: any;
|
|
638
|
+
pullRequestIdLabel: string;
|
|
603
639
|
};
|
|
604
640
|
useRepoInfoEnv(): {
|
|
605
641
|
repoSlug: any;
|
|
642
|
+
repoSlugLabel: string;
|
|
606
643
|
repoSlugLowercase: any;
|
|
644
|
+
repoSlugLowercaseLabel: string;
|
|
607
645
|
repoName: any;
|
|
646
|
+
repoNameLabel: string;
|
|
608
647
|
repoNameLowercase: any;
|
|
648
|
+
repoNameLowercaseLabel: string;
|
|
609
649
|
repoId: any;
|
|
650
|
+
repoIdLabel: string;
|
|
610
651
|
repoUrlHttps: any;
|
|
652
|
+
repoUrlHttpsLabel: string;
|
|
611
653
|
};
|
|
612
654
|
}
|
|
613
655
|
type GetListParams = {
|
|
@@ -806,6 +848,7 @@ type CNBItem = {
|
|
|
806
848
|
runAt?: number;
|
|
807
849
|
owner?: boolean;
|
|
808
850
|
cnb: CNB;
|
|
851
|
+
cnbAi: ReturnType<typeof createOpenAICompatible>;
|
|
809
852
|
};
|
|
810
853
|
declare class CNBManager {
|
|
811
854
|
cnbMap: Map<string, CNBItem>;
|
|
@@ -821,16 +864,16 @@ declare class CNBManager {
|
|
|
821
864
|
* @returns CNB 实例
|
|
822
865
|
*/
|
|
823
866
|
getContext(ctx: any): Promise<CNB>;
|
|
867
|
+
getCNBItem(ctx: any): Promise<CNBItem>;
|
|
824
868
|
addCNB(opts: Partial<CNBItem>): CNBItem;
|
|
825
869
|
clearExpiredCNB(expireTime?: number): void;
|
|
826
870
|
clearUsername(username: string): void;
|
|
827
871
|
}
|
|
828
872
|
|
|
829
873
|
declare const cnbManager: CNBManager;
|
|
830
|
-
declare const cnb: CNB;
|
|
831
874
|
declare const app: QueryRouterServer<{
|
|
832
875
|
[x: string]: any;
|
|
833
876
|
}>;
|
|
834
877
|
declare const notCNBCheck: (ctx: any) => boolean;
|
|
835
878
|
|
|
836
|
-
export { app,
|
|
879
|
+
export { app, cnbManager, notCNBCheck };
|