This commit is contained in:
2026-01-12 03:16:35 +08:00
parent c2dcc53018
commit 5310ff28ae
48 changed files with 1349 additions and 254 deletions

View File

@@ -1,16 +1,12 @@
import { CNBCore, CNBCoreOptions, RequestOptions, Result } from "../cnb-core.ts";
type AiOptions = CNBCoreOptions<{
group?: string;
}>
class AiBase extends CNBCore {
group: string;
constructor(options: AiOptions) {
constructor(options: CNBCoreOptions) {
super({ token: options.token, cookie: options.cookie });
this.group = options.group || '';
}
autoPr(repo: string, data: { body: string, branch?: string, title: string }): Promise<Result<any>> {
const group = this.group || '';
const url = `/${group}/${repo}/-/build/ai/auto-pr`;
const url = `/${repo}/-/build/ai/auto-pr`;
const postData = {
...data,
branch: data.branch || 'refs/heads/main',