@kevisual/cnb 0.0.56 → 0.0.57
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/routes/call/index.ts +5 -4
- package/agent/routes/cnb-env/env.ts +3 -2
- package/agent/routes/cnb-env/vscode.ts +9 -8
- package/agent/routes/index.ts +1 -0
- package/agent/routes/issues/comments.ts +18 -17
- package/agent/routes/issues/issue.ts +11 -10
- package/agent/routes/issues/list.ts +11 -10
- package/agent/routes/knowledge/ai.ts +6 -5
- package/agent/routes/labels/issue-label.ts +17 -16
- package/agent/routes/package/index.ts +2 -0
- package/agent/routes/package/package.ts +255 -0
- package/agent/routes/package/registry.ts +107 -0
- package/agent/routes/repo/list.ts +6 -5
- package/agent/routes/repo/repo-label.ts +17 -16
- package/agent/routes/repo/repo.ts +18 -17
- package/agent/routes/workspace/build.ts +7 -6
- package/agent/routes/workspace/index.ts +17 -17
- package/agent/routes/workspace/keep.ts +5 -5
- package/agent/routes/workspace/rerun.ts +6 -1
- package/agent/routes/workspace/skills.ts +2 -2
- package/dist/cli.js +683 -207
- package/dist/npc.js +683 -207
- package/dist/opencode.js +691 -215
- package/dist/routes.d.ts +235 -3
- package/dist/routes.js +683 -207
- package/package.json +1 -1
- package/src/index.ts +15 -1
- package/src/issue/index.ts +5 -2
- package/src/knowledge/index.ts +92 -5
- package/src/package/index.ts +2 -0
- package/src/package/package.ts +134 -0
- package/src/package/registry.ts +145 -0
package/dist/cli.js
CHANGED
|
@@ -21679,9 +21679,6 @@ var fromJSONSchema2 = (args = {}, opts) => {
|
|
|
21679
21679
|
return resultArgs;
|
|
21680
21680
|
};
|
|
21681
21681
|
var pickValue = ["path", "key", "id", "description", "type", "middleware", "metadata"];
|
|
21682
|
-
var tool = {
|
|
21683
|
-
schema: exports_external
|
|
21684
|
-
};
|
|
21685
21682
|
var createSkill = (skill) => {
|
|
21686
21683
|
if (skill.tags) {
|
|
21687
21684
|
const hasOpencode = skill.tags.includes("opencode");
|
|
@@ -24608,10 +24605,7 @@ class KnowledgeBase extends CNBCore {
|
|
|
24608
24605
|
}
|
|
24609
24606
|
queryKnowledgeBase(repo, data) {
|
|
24610
24607
|
const url3 = `/${repo}/-/knowledge/base/query`;
|
|
24611
|
-
|
|
24612
|
-
query: data.query
|
|
24613
|
-
};
|
|
24614
|
-
return this.post({ url: url3, data: postData });
|
|
24608
|
+
return this.post({ url: url3, data });
|
|
24615
24609
|
}
|
|
24616
24610
|
getEmbeddingModels(repo) {
|
|
24617
24611
|
const url3 = `/${repo}/-/knowledge/embedding/models`;
|
|
@@ -24625,6 +24619,30 @@ class KnowledgeBase extends CNBCore {
|
|
|
24625
24619
|
const url3 = `/${repo}/-/knowledge/base`;
|
|
24626
24620
|
return this.request({ url: url3, method: "DELETE" });
|
|
24627
24621
|
}
|
|
24622
|
+
createKnowledgeBase(repo, data) {
|
|
24623
|
+
const url3 = `/${repo}/-/knowledge/base`;
|
|
24624
|
+
return this.post({ url: url3, data });
|
|
24625
|
+
}
|
|
24626
|
+
updateKnowledgeBase(repo, data) {
|
|
24627
|
+
const url3 = `/${repo}/-/knowledge/base`;
|
|
24628
|
+
return this.put({ url: url3, data });
|
|
24629
|
+
}
|
|
24630
|
+
getEmbedding(repo, text) {
|
|
24631
|
+
const url3 = `/${repo}/-/knowledge/embedding`;
|
|
24632
|
+
return this.post({ url: url3, data: { text } });
|
|
24633
|
+
}
|
|
24634
|
+
addDocument(repo, chunksData) {
|
|
24635
|
+
const url3 = `/${repo}/-/knowledge/documents/upsert-document-with-chunks`;
|
|
24636
|
+
return this.post({ url: url3, data: chunksData });
|
|
24637
|
+
}
|
|
24638
|
+
deleteDocument(repo, paths) {
|
|
24639
|
+
const url3 = `/${repo}/-/knowledge/documents`;
|
|
24640
|
+
return this.delete({ url: url3, data: { paths } });
|
|
24641
|
+
}
|
|
24642
|
+
listDocument(repo, page = 1, page_size = 50) {
|
|
24643
|
+
const url3 = `/${repo}/-/knowledge/documents`;
|
|
24644
|
+
return this.get({ url: url3, params: { page, page_size } });
|
|
24645
|
+
}
|
|
24628
24646
|
}
|
|
24629
24647
|
|
|
24630
24648
|
// src/repo/index.ts
|
|
@@ -25225,6 +25243,88 @@ class IssueLabel extends CNBCore {
|
|
|
25225
25243
|
return this.delete({ url: url3 });
|
|
25226
25244
|
}
|
|
25227
25245
|
}
|
|
25246
|
+
// src/package/registry.ts
|
|
25247
|
+
class RegistryPackage extends CNBCore {
|
|
25248
|
+
constructor(options) {
|
|
25249
|
+
super(options);
|
|
25250
|
+
}
|
|
25251
|
+
listGroupRegistries(slug, params) {
|
|
25252
|
+
const url3 = `/${slug}/-/registries`;
|
|
25253
|
+
return this.get({
|
|
25254
|
+
url: url3,
|
|
25255
|
+
params,
|
|
25256
|
+
headers: {
|
|
25257
|
+
Accept: "application/vnd.cnb.api+json"
|
|
25258
|
+
}
|
|
25259
|
+
});
|
|
25260
|
+
}
|
|
25261
|
+
setVisibility(registry2, data) {
|
|
25262
|
+
const url3 = `/${registry2}/-/settings/set_visibility`;
|
|
25263
|
+
return this.post({
|
|
25264
|
+
url: url3,
|
|
25265
|
+
data
|
|
25266
|
+
});
|
|
25267
|
+
}
|
|
25268
|
+
remove(registry2) {
|
|
25269
|
+
const url3 = `/${registry2}`;
|
|
25270
|
+
return this.delete({ url: url3 });
|
|
25271
|
+
}
|
|
25272
|
+
}
|
|
25273
|
+
// src/package/package.ts
|
|
25274
|
+
class PackageManagement extends CNBCore {
|
|
25275
|
+
constructor(options) {
|
|
25276
|
+
super(options);
|
|
25277
|
+
}
|
|
25278
|
+
list(slug, type, params) {
|
|
25279
|
+
const url3 = `/${slug}/-/packages`;
|
|
25280
|
+
return this.get({
|
|
25281
|
+
url: url3,
|
|
25282
|
+
params: {
|
|
25283
|
+
type,
|
|
25284
|
+
...params
|
|
25285
|
+
},
|
|
25286
|
+
headers: {
|
|
25287
|
+
Accept: "application/vnd.cnb.api+json"
|
|
25288
|
+
}
|
|
25289
|
+
});
|
|
25290
|
+
}
|
|
25291
|
+
getOne(slug, type, name) {
|
|
25292
|
+
const url3 = `/${slug}/-/packages/${type}/${encodeURIComponent(name)}`;
|
|
25293
|
+
return this.get({
|
|
25294
|
+
url: url3,
|
|
25295
|
+
headers: {
|
|
25296
|
+
Accept: "application/vnd.cnb.api+json"
|
|
25297
|
+
}
|
|
25298
|
+
});
|
|
25299
|
+
}
|
|
25300
|
+
remove(slug, type, name) {
|
|
25301
|
+
const url3 = `/${slug}/-/packages/${type}/${encodeURIComponent(name)}`;
|
|
25302
|
+
return this.delete({ url: url3 });
|
|
25303
|
+
}
|
|
25304
|
+
getTag(slug, type, name, tag) {
|
|
25305
|
+
const url3 = `/${slug}/-/packages/${type}/${encodeURIComponent(name)}/tags/${encodeURIComponent(tag)}`;
|
|
25306
|
+
return this.get({
|
|
25307
|
+
url: url3,
|
|
25308
|
+
headers: {
|
|
25309
|
+
Accept: "application/vnd.cnb.api+json"
|
|
25310
|
+
}
|
|
25311
|
+
});
|
|
25312
|
+
}
|
|
25313
|
+
removeTag(slug, type, name, tag) {
|
|
25314
|
+
const url3 = `/${slug}/-/packages/${type}/${encodeURIComponent(name)}/tags/${encodeURIComponent(tag)}`;
|
|
25315
|
+
return this.delete({ url: url3 });
|
|
25316
|
+
}
|
|
25317
|
+
listTags(slug, type, name, params) {
|
|
25318
|
+
const url3 = `/${slug}/-/packages/${type}/${encodeURIComponent(name)}/tags`;
|
|
25319
|
+
return this.get({
|
|
25320
|
+
url: url3,
|
|
25321
|
+
params,
|
|
25322
|
+
headers: {
|
|
25323
|
+
Accept: "application/vnd.cnb.api+json"
|
|
25324
|
+
}
|
|
25325
|
+
});
|
|
25326
|
+
}
|
|
25327
|
+
}
|
|
25228
25328
|
// src/index.ts
|
|
25229
25329
|
class CNB extends CNBCore {
|
|
25230
25330
|
workspace;
|
|
@@ -25236,6 +25336,7 @@ class CNB extends CNBCore {
|
|
|
25236
25336
|
mission;
|
|
25237
25337
|
ai;
|
|
25238
25338
|
labels;
|
|
25339
|
+
packages;
|
|
25239
25340
|
constructor(options) {
|
|
25240
25341
|
super({ ...options, token: options.token, cookie: options.cookie, cnb: options.cnb });
|
|
25241
25342
|
this.init(options);
|
|
@@ -25258,6 +25359,10 @@ class CNB extends CNBCore {
|
|
|
25258
25359
|
repoLabel: new RepoLabel(options),
|
|
25259
25360
|
issueLabel: new IssueLabel(options)
|
|
25260
25361
|
};
|
|
25362
|
+
this.packages = {
|
|
25363
|
+
registry: new RegistryPackage(options),
|
|
25364
|
+
package: new PackageManagement(options)
|
|
25365
|
+
};
|
|
25261
25366
|
}
|
|
25262
25367
|
setToken(token) {
|
|
25263
25368
|
this.token = token;
|
|
@@ -25269,6 +25374,8 @@ class CNB extends CNBCore {
|
|
|
25269
25374
|
this.mission.token = token;
|
|
25270
25375
|
this.labels.repoLabel.token = token;
|
|
25271
25376
|
this.labels.issueLabel.token = token;
|
|
25377
|
+
this.packages.registry.token = token;
|
|
25378
|
+
this.packages.package.token = token;
|
|
25272
25379
|
}
|
|
25273
25380
|
setCookie(cookie) {
|
|
25274
25381
|
this.cookie = cookie;
|
|
@@ -25280,6 +25387,8 @@ class CNB extends CNBCore {
|
|
|
25280
25387
|
this.mission.cookie = cookie;
|
|
25281
25388
|
this.labels.repoLabel.cookie = cookie;
|
|
25282
25389
|
this.labels.issueLabel.cookie = cookie;
|
|
25390
|
+
this.packages.registry.cookie = cookie;
|
|
25391
|
+
this.packages.package.cookie = cookie;
|
|
25283
25392
|
}
|
|
25284
25393
|
getCNBVersion = getCNBVersion;
|
|
25285
25394
|
}
|
|
@@ -25647,7 +25756,7 @@ __export(exports_external2, {
|
|
|
25647
25756
|
safeEncode: () => safeEncode5,
|
|
25648
25757
|
safeDecodeAsync: () => safeDecodeAsync5,
|
|
25649
25758
|
safeDecode: () => safeDecode5,
|
|
25650
|
-
registry: () =>
|
|
25759
|
+
registry: () => registry3,
|
|
25651
25760
|
regexes: () => exports_regexes2,
|
|
25652
25761
|
regex: () => _regex2,
|
|
25653
25762
|
refine: () => refine2,
|
|
@@ -25857,7 +25966,7 @@ __export(exports_core3, {
|
|
|
25857
25966
|
safeEncode: () => safeEncode3,
|
|
25858
25967
|
safeDecodeAsync: () => safeDecodeAsync3,
|
|
25859
25968
|
safeDecode: () => safeDecode3,
|
|
25860
|
-
registry: () =>
|
|
25969
|
+
registry: () => registry3,
|
|
25861
25970
|
regexes: () => exports_regexes2,
|
|
25862
25971
|
process: () => process3,
|
|
25863
25972
|
prettifyError: () => prettifyError2,
|
|
@@ -35377,10 +35486,10 @@ class $ZodRegistry2 {
|
|
|
35377
35486
|
return this._map.has(schema);
|
|
35378
35487
|
}
|
|
35379
35488
|
}
|
|
35380
|
-
function
|
|
35489
|
+
function registry3() {
|
|
35381
35490
|
return new $ZodRegistry2;
|
|
35382
35491
|
}
|
|
35383
|
-
(_a15 = globalThis).__zod_globalRegistry ?? (_a15.__zod_globalRegistry =
|
|
35492
|
+
(_a15 = globalThis).__zod_globalRegistry ?? (_a15.__zod_globalRegistry = registry3());
|
|
35384
35493
|
var globalRegistry2 = globalThis.__zod_globalRegistry;
|
|
35385
35494
|
// ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js
|
|
35386
35495
|
function _string2(Class3, params) {
|
|
@@ -37160,21 +37269,21 @@ var allProcessors2 = {
|
|
|
37160
37269
|
};
|
|
37161
37270
|
function toJSONSchema4(input, params) {
|
|
37162
37271
|
if ("_idmap" in input) {
|
|
37163
|
-
const
|
|
37272
|
+
const registry4 = input;
|
|
37164
37273
|
const ctx2 = initializeContext2({ ...params, processors: allProcessors2 });
|
|
37165
37274
|
const defs = {};
|
|
37166
|
-
for (const entry of
|
|
37275
|
+
for (const entry of registry4._idmap.entries()) {
|
|
37167
37276
|
const [_, schema] = entry;
|
|
37168
37277
|
process3(schema, ctx2);
|
|
37169
37278
|
}
|
|
37170
37279
|
const schemas = {};
|
|
37171
37280
|
const external = {
|
|
37172
|
-
registry:
|
|
37281
|
+
registry: registry4,
|
|
37173
37282
|
uri: params?.uri,
|
|
37174
37283
|
defs
|
|
37175
37284
|
};
|
|
37176
37285
|
ctx2.external = external;
|
|
37177
|
-
for (const entry of
|
|
37286
|
+
for (const entry of registry4._idmap.entries()) {
|
|
37178
37287
|
const [key, schema] = entry;
|
|
37179
37288
|
extractDefs2(ctx2, schema);
|
|
37180
37289
|
schemas[key] = finalize2(ctx2, schema);
|
|
@@ -43060,7 +43169,7 @@ class EventSourceParserStream extends TransformStream {
|
|
|
43060
43169
|
}
|
|
43061
43170
|
}
|
|
43062
43171
|
|
|
43063
|
-
// ../../node_modules/.pnpm/@ai-sdk+provider-utils@4.0.
|
|
43172
|
+
// ../../node_modules/.pnpm/@ai-sdk+provider-utils@4.0.21_zod@4.3.6/node_modules/@ai-sdk/provider-utils/dist/index.mjs
|
|
43064
43173
|
function combineHeaders(...headers) {
|
|
43065
43174
|
return headers.reduce((combinedHeaders, currentHeaders) => ({
|
|
43066
43175
|
...combinedHeaders,
|
|
@@ -43324,6 +43433,9 @@ async function downloadBlob(url4, options) {
|
|
|
43324
43433
|
const response = await fetch(url4, {
|
|
43325
43434
|
signal: options == null ? undefined : options.abortSignal
|
|
43326
43435
|
});
|
|
43436
|
+
if (response.redirected) {
|
|
43437
|
+
validateDownloadUrl(response.url);
|
|
43438
|
+
}
|
|
43327
43439
|
if (!response.ok) {
|
|
43328
43440
|
throw new DownloadError({
|
|
43329
43441
|
url: url4,
|
|
@@ -43480,7 +43592,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
43480
43592
|
normalizedHeaders.set("user-agent", [currentUserAgentHeader, ...userAgentSuffixParts].filter(Boolean).join(" "));
|
|
43481
43593
|
return Object.fromEntries(normalizedHeaders.entries());
|
|
43482
43594
|
}
|
|
43483
|
-
var VERSION = "4.0.
|
|
43595
|
+
var VERSION = "4.0.21";
|
|
43484
43596
|
var getOriginalFetch = () => globalThis.fetch;
|
|
43485
43597
|
var getFromApi = async ({
|
|
43486
43598
|
url: url4,
|
|
@@ -43655,7 +43767,7 @@ function visit(def) {
|
|
|
43655
43767
|
return def;
|
|
43656
43768
|
return addAdditionalPropertiesToJsonSchema(def);
|
|
43657
43769
|
}
|
|
43658
|
-
var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
|
|
43770
|
+
var ignoreOverride = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use");
|
|
43659
43771
|
var defaultOptions = {
|
|
43660
43772
|
name: undefined,
|
|
43661
43773
|
$refStrategy: "root",
|
|
@@ -44648,7 +44760,7 @@ var zod3ToJsonSchema = (schema, options) => {
|
|
|
44648
44760
|
combined.$schema = "http://json-schema.org/draft-07/schema#";
|
|
44649
44761
|
return combined;
|
|
44650
44762
|
};
|
|
44651
|
-
var schemaSymbol = Symbol.for("vercel.ai.schema");
|
|
44763
|
+
var schemaSymbol = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
|
|
44652
44764
|
function lazySchema(createSchema) {
|
|
44653
44765
|
let schema;
|
|
44654
44766
|
return () => {
|
|
@@ -44955,8 +45067,8 @@ var postToApi = async ({
|
|
|
44955
45067
|
throw handleFetchError({ error: error49, url: url4, requestBodyValues: body.values });
|
|
44956
45068
|
}
|
|
44957
45069
|
};
|
|
44958
|
-
function tool2
|
|
44959
|
-
return
|
|
45070
|
+
function tool(tool2) {
|
|
45071
|
+
return tool2;
|
|
44960
45072
|
}
|
|
44961
45073
|
function createProviderToolFactoryWithOutputSchema({
|
|
44962
45074
|
id,
|
|
@@ -44972,7 +45084,7 @@ function createProviderToolFactoryWithOutputSchema({
|
|
|
44972
45084
|
onInputDelta,
|
|
44973
45085
|
onInputAvailable,
|
|
44974
45086
|
...args
|
|
44975
|
-
}) =>
|
|
45087
|
+
}) => tool({
|
|
44976
45088
|
type: "provider",
|
|
44977
45089
|
id,
|
|
44978
45090
|
args,
|
|
@@ -45108,7 +45220,7 @@ async function* executeTool({
|
|
|
45108
45220
|
}
|
|
45109
45221
|
}
|
|
45110
45222
|
|
|
45111
|
-
// ../../node_modules/.pnpm/@ai-sdk+openai-compatible@2.0.
|
|
45223
|
+
// ../../node_modules/.pnpm/@ai-sdk+openai-compatible@2.0.37_zod@4.3.6/node_modules/@ai-sdk/openai-compatible/dist/index.mjs
|
|
45112
45224
|
var openaiCompatibleErrorDataSchema = exports_external2.object({
|
|
45113
45225
|
error: exports_external2.object({
|
|
45114
45226
|
message: exports_external2.string(),
|
|
@@ -45393,20 +45505,20 @@ function prepareTools({
|
|
|
45393
45505
|
return { tools: undefined, toolChoice: undefined, toolWarnings };
|
|
45394
45506
|
}
|
|
45395
45507
|
const openaiCompatTools = [];
|
|
45396
|
-
for (const
|
|
45397
|
-
if (
|
|
45508
|
+
for (const tool2 of tools) {
|
|
45509
|
+
if (tool2.type === "provider") {
|
|
45398
45510
|
toolWarnings.push({
|
|
45399
45511
|
type: "unsupported",
|
|
45400
|
-
feature: `provider-defined tool ${
|
|
45512
|
+
feature: `provider-defined tool ${tool2.id}`
|
|
45401
45513
|
});
|
|
45402
45514
|
} else {
|
|
45403
45515
|
openaiCompatTools.push({
|
|
45404
45516
|
type: "function",
|
|
45405
45517
|
function: {
|
|
45406
|
-
name:
|
|
45407
|
-
description:
|
|
45408
|
-
parameters:
|
|
45409
|
-
...
|
|
45518
|
+
name: tool2.name,
|
|
45519
|
+
description: tool2.description,
|
|
45520
|
+
parameters: tool2.inputSchema,
|
|
45521
|
+
...tool2.strict != null ? { strict: tool2.strict } : {}
|
|
45410
45522
|
}
|
|
45411
45523
|
});
|
|
45412
45524
|
}
|
|
@@ -46555,7 +46667,7 @@ async function fileToBlob(file3) {
|
|
|
46555
46667
|
function toCamelCase(str) {
|
|
46556
46668
|
return str.replace(/[_-]([a-z])/g, (g) => g[1].toUpperCase());
|
|
46557
46669
|
}
|
|
46558
|
-
var VERSION2 = "2.0.
|
|
46670
|
+
var VERSION2 = "2.0.37";
|
|
46559
46671
|
function createOpenAICompatible(options) {
|
|
46560
46672
|
const baseURL = withoutTrailingSlash(options.baseURL);
|
|
46561
46673
|
const providerName = options.name;
|
|
@@ -46803,10 +46915,10 @@ app.route({
|
|
|
46803
46915
|
title: "列出cnb代码仓库",
|
|
46804
46916
|
summary: "列出cnb代码仓库, 可选flags参数,如 KnowledgeBase",
|
|
46805
46917
|
args: {
|
|
46806
|
-
search:
|
|
46807
|
-
page:
|
|
46808
|
-
pageSize:
|
|
46809
|
-
flags:
|
|
46918
|
+
search: exports_external2.string().optional().describe("搜索关键词"),
|
|
46919
|
+
page: exports_external2.number().optional().describe("分页页码,默认 1"),
|
|
46920
|
+
pageSize: exports_external2.number().optional().describe("每页数量,默认99"),
|
|
46921
|
+
flags: exports_external2.string().optional().describe("仓库标记,如果是知识库则填写 KnowledgeBase")
|
|
46810
46922
|
}
|
|
46811
46923
|
})
|
|
46812
46924
|
}
|
|
@@ -46851,9 +46963,9 @@ app.route({
|
|
|
46851
46963
|
skill: "create-repo",
|
|
46852
46964
|
title: "创建代码仓库",
|
|
46853
46965
|
args: {
|
|
46854
|
-
name:
|
|
46855
|
-
visibility:
|
|
46856
|
-
description:
|
|
46966
|
+
name: exports_external2.string().describe("代码仓库名称, 如 my-user/my-repo"),
|
|
46967
|
+
visibility: exports_external2.string().describe("代码仓库可见性, public 或 private").default("public"),
|
|
46968
|
+
description: exports_external2.string().describe("代码仓库描述")
|
|
46857
46969
|
},
|
|
46858
46970
|
summary: "创建一个新的代码仓库"
|
|
46859
46971
|
})
|
|
@@ -46885,7 +46997,7 @@ app.route({
|
|
|
46885
46997
|
middleware: ["auth"],
|
|
46886
46998
|
metadata: {
|
|
46887
46999
|
args: {
|
|
46888
|
-
name:
|
|
47000
|
+
name: exports_external2.string().describe("代码仓库名称, 如 my-user/my-repo")
|
|
46889
47001
|
}
|
|
46890
47002
|
}
|
|
46891
47003
|
}).define(async (ctx) => {
|
|
@@ -46909,10 +47021,10 @@ app.route({
|
|
|
46909
47021
|
title: "在代码仓库中创建文件",
|
|
46910
47022
|
summary: `在代码仓库中创建文件, encoding 可选,默认 raw`,
|
|
46911
47023
|
args: {
|
|
46912
|
-
repoName:
|
|
46913
|
-
filePath:
|
|
46914
|
-
content:
|
|
46915
|
-
encoding:
|
|
47024
|
+
repoName: exports_external2.string().describe("代码仓库名称, 如 my-user/my-repo"),
|
|
47025
|
+
filePath: exports_external2.string().describe("文件路径, 如 src/index.ts"),
|
|
47026
|
+
content: exports_external2.string().describe("文本的字符串的内容"),
|
|
47027
|
+
encoding: exports_external2.string().describe("编码方式,如 raw").optional()
|
|
46916
47028
|
}
|
|
46917
47029
|
})
|
|
46918
47030
|
}
|
|
@@ -46944,7 +47056,7 @@ app.route({
|
|
|
46944
47056
|
skill: "delete-repo",
|
|
46945
47057
|
title: "删除代码仓库",
|
|
46946
47058
|
args: {
|
|
46947
|
-
name:
|
|
47059
|
+
name: exports_external2.string().describe("代码仓库名称")
|
|
46948
47060
|
},
|
|
46949
47061
|
summary: "删除一个代码仓库"
|
|
46950
47062
|
})
|
|
@@ -46978,11 +47090,11 @@ app.route({
|
|
|
46978
47090
|
skill: "update-repo-info",
|
|
46979
47091
|
title: "更新代码仓库信息",
|
|
46980
47092
|
args: {
|
|
46981
|
-
name:
|
|
46982
|
-
description:
|
|
46983
|
-
license:
|
|
46984
|
-
site:
|
|
46985
|
-
topics:
|
|
47093
|
+
name: exports_external2.string().describe("代码仓库名称"),
|
|
47094
|
+
description: exports_external2.string().describe("代码仓库描述"),
|
|
47095
|
+
license: exports_external2.string().describe("代码仓库许可证类型,如 MIT").optional(),
|
|
47096
|
+
site: exports_external2.string().describe("代码仓库主页链接").optional(),
|
|
47097
|
+
topics: exports_external2.array(exports_external2.string()).describe("代码仓库话题标签列表").optional()
|
|
46986
47098
|
},
|
|
46987
47099
|
summary: "更新代码仓库的信息"
|
|
46988
47100
|
})
|
|
@@ -47010,8 +47122,8 @@ app.route({
|
|
|
47010
47122
|
middleware: ["auth"],
|
|
47011
47123
|
metadata: {
|
|
47012
47124
|
args: {
|
|
47013
|
-
name:
|
|
47014
|
-
visibility:
|
|
47125
|
+
name: exports_external2.string().describe("代码仓库名称"),
|
|
47126
|
+
visibility: exports_external2.string().describe("代码仓库可见性, public 或 private 或 protected")
|
|
47015
47127
|
}
|
|
47016
47128
|
}
|
|
47017
47129
|
}).define(async (ctx) => {
|
|
@@ -47044,10 +47156,10 @@ app.route({
|
|
|
47044
47156
|
title: "查询仓库标签列表",
|
|
47045
47157
|
summary: "查询仓库的标签列表",
|
|
47046
47158
|
args: {
|
|
47047
|
-
repo:
|
|
47048
|
-
page:
|
|
47049
|
-
pageSize:
|
|
47050
|
-
keyword:
|
|
47159
|
+
repo: exports_external2.string().describe("仓库路径, 如 my-user/my-repo"),
|
|
47160
|
+
page: exports_external2.number().optional().describe("分页页码,默认 1"),
|
|
47161
|
+
pageSize: exports_external2.number().optional().describe("分页每页大小,默认 30"),
|
|
47162
|
+
keyword: exports_external2.string().optional().describe("标签搜索关键词")
|
|
47051
47163
|
}
|
|
47052
47164
|
})
|
|
47053
47165
|
}
|
|
@@ -47079,10 +47191,10 @@ app.route({
|
|
|
47079
47191
|
title: "创建仓库标签",
|
|
47080
47192
|
summary: "创建一个仓库标签",
|
|
47081
47193
|
args: {
|
|
47082
|
-
repo:
|
|
47083
|
-
name:
|
|
47084
|
-
color:
|
|
47085
|
-
description:
|
|
47194
|
+
repo: exports_external2.string().describe("仓库路径, 如 my-user/my-repo"),
|
|
47195
|
+
name: exports_external2.string().describe("标签名称"),
|
|
47196
|
+
color: exports_external2.string().describe("标签颜色,十六进制颜色码,不含 # 前缀"),
|
|
47197
|
+
description: exports_external2.string().optional().describe("标签描述")
|
|
47086
47198
|
}
|
|
47087
47199
|
})
|
|
47088
47200
|
}
|
|
@@ -47114,11 +47226,11 @@ app.route({
|
|
|
47114
47226
|
title: "更新仓库标签",
|
|
47115
47227
|
summary: "更新仓库标签信息",
|
|
47116
47228
|
args: {
|
|
47117
|
-
repo:
|
|
47118
|
-
name:
|
|
47119
|
-
color:
|
|
47120
|
-
description:
|
|
47121
|
-
newName:
|
|
47229
|
+
repo: exports_external2.string().describe("仓库路径, 如 my-user/my-repo"),
|
|
47230
|
+
name: exports_external2.string().describe("标签名称"),
|
|
47231
|
+
color: exports_external2.string().optional().describe("标签颜色,十六进制颜色码,不含 # 前缀"),
|
|
47232
|
+
description: exports_external2.string().optional().describe("标签描述"),
|
|
47233
|
+
newName: exports_external2.string().optional().describe("新标签名称")
|
|
47122
47234
|
}
|
|
47123
47235
|
})
|
|
47124
47236
|
}
|
|
@@ -47151,8 +47263,8 @@ app.route({
|
|
|
47151
47263
|
title: "删除仓库标签",
|
|
47152
47264
|
summary: "删除指定的仓库标签",
|
|
47153
47265
|
args: {
|
|
47154
|
-
repo:
|
|
47155
|
-
name:
|
|
47266
|
+
repo: exports_external2.string().describe("仓库路径, 如 my-user/my-repo"),
|
|
47267
|
+
name: exports_external2.string().describe("标签名称")
|
|
47156
47268
|
}
|
|
47157
47269
|
})
|
|
47158
47270
|
}
|
|
@@ -47307,8 +47419,8 @@ app.route({
|
|
|
47307
47419
|
tags: [],
|
|
47308
47420
|
...{
|
|
47309
47421
|
args: {
|
|
47310
|
-
repo:
|
|
47311
|
-
pipelineId:
|
|
47422
|
+
repo: exports_external2.string().describe("代码仓库路径,例如 user/repo"),
|
|
47423
|
+
pipelineId: exports_external2.string().describe("流水线ID,例如 cnb-708-1ji9sog7o-001")
|
|
47312
47424
|
}
|
|
47313
47425
|
}
|
|
47314
47426
|
}
|
|
@@ -47347,8 +47459,8 @@ app.route({
|
|
|
47347
47459
|
tags: [],
|
|
47348
47460
|
...{
|
|
47349
47461
|
args: {
|
|
47350
|
-
repo:
|
|
47351
|
-
pipelineId:
|
|
47462
|
+
repo: exports_external2.string().describe("代码仓库路径,例如 user/repo"),
|
|
47463
|
+
pipelineId: exports_external2.string().describe("流水线ID,例如 cnb-708-1ji9sog7o-001")
|
|
47352
47464
|
}
|
|
47353
47465
|
}
|
|
47354
47466
|
}
|
|
@@ -47399,11 +47511,11 @@ app.route({
|
|
|
47399
47511
|
title: "云端构建",
|
|
47400
47512
|
summary: "在云端构建代码仓库,参数包括 event, repo, branch, ref, config, env",
|
|
47401
47513
|
args: {
|
|
47402
|
-
env:
|
|
47403
|
-
event:
|
|
47404
|
-
branch:
|
|
47405
|
-
config:
|
|
47406
|
-
repo:
|
|
47514
|
+
env: exports_external2.any().optional().describe('构建环境变量,格式为 { "KEY": "VALUE" }'),
|
|
47515
|
+
event: exports_external2.string().optional().describe("触发事件类型,例如 api_trigger_event"),
|
|
47516
|
+
branch: exports_external2.string().optional().describe("分支名称,默认主分支"),
|
|
47517
|
+
config: exports_external2.string().describe("构建config文件内容,例如 cloudbuild.yaml对应的yml的内容"),
|
|
47518
|
+
repo: exports_external2.string().describe("代码仓库路径,例如 user/repo")
|
|
47407
47519
|
}
|
|
47408
47520
|
})
|
|
47409
47521
|
}
|
|
@@ -47465,7 +47577,12 @@ app.route({
|
|
|
47465
47577
|
const branch = item.branch || "main";
|
|
47466
47578
|
const repo3 = item.slug;
|
|
47467
47579
|
const sn = item.sn;
|
|
47468
|
-
await cnb.workspace.stopWorkspace({ sn });
|
|
47580
|
+
const res2 = await cnb.workspace.stopWorkspace({ sn });
|
|
47581
|
+
if (res2.code !== 200) {
|
|
47582
|
+
ctx.throw(500, res2.message || "Failed to stop workspace");
|
|
47583
|
+
} else {
|
|
47584
|
+
console.log(`工作区 ${repo3} 停止成功,${res2.data?.buildLogUrl ? `构建日志链接: ${res2.data.buildLogUrl}` : ""}`);
|
|
47585
|
+
}
|
|
47469
47586
|
if (config3) {
|
|
47470
47587
|
await cnb.build.startBuild(repo3, { branch, config: config3, event });
|
|
47471
47588
|
} else {
|
|
@@ -47490,9 +47607,9 @@ app.route({
|
|
|
47490
47607
|
title: "启动cnb工作空间",
|
|
47491
47608
|
summary: "启动cnb工作空间",
|
|
47492
47609
|
args: {
|
|
47493
|
-
repo:
|
|
47494
|
-
branch:
|
|
47495
|
-
ref:
|
|
47610
|
+
repo: exports_external2.string().describe("代码仓库路径,例如 user/repo"),
|
|
47611
|
+
branch: exports_external2.string().optional().describe("分支名称,默认主分支"),
|
|
47612
|
+
ref: exports_external2.string().optional().describe("提交引用,例如 commit sha")
|
|
47496
47613
|
}
|
|
47497
47614
|
})
|
|
47498
47615
|
}
|
|
@@ -47522,11 +47639,11 @@ app.route({
|
|
|
47522
47639
|
title: "列出cnb工作空间",
|
|
47523
47640
|
summary: "列出cnb工作空间列表,支持按状态过滤, status 可选值 running 或 closed",
|
|
47524
47641
|
args: {
|
|
47525
|
-
status:
|
|
47526
|
-
page:
|
|
47527
|
-
pageSize:
|
|
47528
|
-
slug:
|
|
47529
|
-
branch:
|
|
47642
|
+
status: exports_external2.string().optional().describe("开发环境状态,running: 运行中,closed: 已关闭和停止的"),
|
|
47643
|
+
page: exports_external2.number().optional().describe("分页页码,默认 1"),
|
|
47644
|
+
pageSize: exports_external2.number().optional().describe("分页大小,默认 20,最大 100"),
|
|
47645
|
+
slug: exports_external2.string().optional().describe("仓库路径,例如 groupname/reponame"),
|
|
47646
|
+
branch: exports_external2.string().optional().describe("分支名称")
|
|
47530
47647
|
}
|
|
47531
47648
|
})
|
|
47532
47649
|
}
|
|
@@ -47552,8 +47669,8 @@ app.route({
|
|
|
47552
47669
|
title: "获取工作空间详情",
|
|
47553
47670
|
summary: "获取工作空间详细信息",
|
|
47554
47671
|
args: {
|
|
47555
|
-
repo:
|
|
47556
|
-
sn:
|
|
47672
|
+
repo: exports_external2.string().describe("代码仓库路径,例如 user/repo"),
|
|
47673
|
+
sn: exports_external2.string().describe("工作空间流水线的 sn")
|
|
47557
47674
|
}
|
|
47558
47675
|
})
|
|
47559
47676
|
}
|
|
@@ -47582,9 +47699,9 @@ app.route({
|
|
|
47582
47699
|
title: "删除工作空间",
|
|
47583
47700
|
summary: "删除工作空间,pipelineId 和 sn 二选一",
|
|
47584
47701
|
args: {
|
|
47585
|
-
pipelineId:
|
|
47586
|
-
sn:
|
|
47587
|
-
sns:
|
|
47702
|
+
pipelineId: exports_external2.string().optional().describe("流水线 ID,优先使用"),
|
|
47703
|
+
sn: exports_external2.string().optional().describe("流水线构建号"),
|
|
47704
|
+
sns: exports_external2.array(exports_external2.string()).optional().describe("批量流水线构建号")
|
|
47588
47705
|
}
|
|
47589
47706
|
})
|
|
47590
47707
|
}
|
|
@@ -47620,8 +47737,8 @@ app.route({
|
|
|
47620
47737
|
title: "停止工作空间",
|
|
47621
47738
|
summary: "停止运行中的工作空间",
|
|
47622
47739
|
args: {
|
|
47623
|
-
pipelineId:
|
|
47624
|
-
sn:
|
|
47740
|
+
pipelineId: exports_external2.string().optional().describe("流水线 ID,优先使用"),
|
|
47741
|
+
sn: exports_external2.string().optional().describe("流水线构建号")
|
|
47625
47742
|
}
|
|
47626
47743
|
})
|
|
47627
47744
|
}
|
|
@@ -47649,9 +47766,9 @@ app.route({
|
|
|
47649
47766
|
title: "调用app应用",
|
|
47650
47767
|
summary: "调用router的应用, 参数path, key, payload",
|
|
47651
47768
|
args: {
|
|
47652
|
-
path:
|
|
47653
|
-
key:
|
|
47654
|
-
payload:
|
|
47769
|
+
path: exports_external2.string().describe("应用路径,例如 cnb"),
|
|
47770
|
+
key: exports_external2.string().optional().describe("应用key,例如 list-repos"),
|
|
47771
|
+
payload: exports_external2.object({}).optional().describe("调用参数")
|
|
47655
47772
|
}
|
|
47656
47773
|
})
|
|
47657
47774
|
}
|
|
@@ -47698,7 +47815,7 @@ app.route({
|
|
|
47698
47815
|
title: "获取当前cnb工作空间的port代理uri",
|
|
47699
47816
|
summary: "获取当前cnb工作空间的port代理uri,用于端口转发",
|
|
47700
47817
|
args: {
|
|
47701
|
-
port:
|
|
47818
|
+
port: exports_external2.number().optional().describe("端口号,默认为51515")
|
|
47702
47819
|
}
|
|
47703
47820
|
})
|
|
47704
47821
|
}
|
|
@@ -47725,11 +47842,11 @@ app.route({
|
|
|
47725
47842
|
title: "获取当前cnb工作空间的编辑器访问地址",
|
|
47726
47843
|
summary: "获取当前cnb工作空间的vscode代理uri,用于在浏览器中访问vscode,包含多种访问方式,如web、vscode、codebuddy、cursor、ssh",
|
|
47727
47844
|
args: {
|
|
47728
|
-
web:
|
|
47729
|
-
vscode:
|
|
47730
|
-
codebuddy:
|
|
47731
|
-
cursor:
|
|
47732
|
-
ssh:
|
|
47845
|
+
web: exports_external2.boolean().optional().describe("是否获取vscode web的访问uri,默认为false"),
|
|
47846
|
+
vscode: exports_external2.boolean().optional().describe("是否获取vscode的代理uri,默认为true"),
|
|
47847
|
+
codebuddy: exports_external2.boolean().optional().describe("是否获取codebuddy的代理uri,默认为false"),
|
|
47848
|
+
cursor: exports_external2.boolean().optional().describe("是否获取cursor的代理uri,默认为false"),
|
|
47849
|
+
ssh: exports_external2.boolean().optional().describe("是否获取vscode remote ssh的连接字符串,默认为false")
|
|
47733
47850
|
}
|
|
47734
47851
|
})
|
|
47735
47852
|
}
|
|
@@ -47788,7 +47905,7 @@ app.route({
|
|
|
47788
47905
|
title: "设置当前cnb工作空间的cookie环境变量",
|
|
47789
47906
|
summary: "设置当前cnb工作空间的cookie环境变量,用于界面操作定制模块功能,例子:CNBSESSION=xxxx;csrfkey=2222xxxx;",
|
|
47790
47907
|
args: {
|
|
47791
|
-
cookie:
|
|
47908
|
+
cookie: exports_external2.string().describe("cnb的cookie值")
|
|
47792
47909
|
}
|
|
47793
47910
|
})
|
|
47794
47911
|
}
|
|
@@ -48125,8 +48242,8 @@ app.route({
|
|
|
48125
48242
|
title: "调用cnb的知识库ai对话功能进行聊天",
|
|
48126
48243
|
summary: "调用cnb的知识库ai对话功能进行聊天,基于cnb提供的ai能力",
|
|
48127
48244
|
args: {
|
|
48128
|
-
question:
|
|
48129
|
-
repo:
|
|
48245
|
+
question: exports_external2.string().describe("用户输入的消息内容"),
|
|
48246
|
+
repo: exports_external2.string().optional().describe("知识库仓库ID,默认为空表示使用默认知识库")
|
|
48130
48247
|
}
|
|
48131
48248
|
})
|
|
48132
48249
|
}
|
|
@@ -48228,8 +48345,8 @@ app.route({
|
|
|
48228
48345
|
title: "调用cnb的知识库RAG查询功能进行问答",
|
|
48229
48346
|
summary: "调用cnb的知识库RAG查询功能进行问答,基于cnb提供的知识库能力",
|
|
48230
48347
|
args: {
|
|
48231
|
-
question:
|
|
48232
|
-
repo:
|
|
48348
|
+
question: exports_external2.string().describe("用户输入的消息内容"),
|
|
48349
|
+
repo: exports_external2.string().optional().describe("知识库仓库ID,默认为空表示使用默认知识库")
|
|
48233
48350
|
}
|
|
48234
48351
|
})
|
|
48235
48352
|
}
|
|
@@ -48291,13 +48408,13 @@ app.route({
|
|
|
48291
48408
|
skill: "list-issues",
|
|
48292
48409
|
title: "查询 Issue 列表",
|
|
48293
48410
|
args: {
|
|
48294
|
-
repo:
|
|
48295
|
-
state:
|
|
48296
|
-
keyword:
|
|
48297
|
-
labels:
|
|
48298
|
-
page:
|
|
48299
|
-
page_size:
|
|
48300
|
-
order_by:
|
|
48411
|
+
repo: exports_external2.string().optional().describe("代码仓库名称, 如 my-user/my-repo"),
|
|
48412
|
+
state: exports_external2.string().optional().describe("Issue 状态:open 或 closed"),
|
|
48413
|
+
keyword: exports_external2.string().optional().describe("问题搜索关键词"),
|
|
48414
|
+
labels: exports_external2.string().optional().describe("问题标签,多个用逗号分隔"),
|
|
48415
|
+
page: exports_external2.number().optional().describe("分页页码,默认: 1"),
|
|
48416
|
+
page_size: exports_external2.number().optional().describe("分页每页大小,默认: 30"),
|
|
48417
|
+
order_by: exports_external2.string().optional().describe("排序方式,如 created_at, -updated_at")
|
|
48301
48418
|
},
|
|
48302
48419
|
summary: "查询 Issue 列表"
|
|
48303
48420
|
})
|
|
@@ -48341,8 +48458,8 @@ app.route({
|
|
|
48341
48458
|
skill: "getIssue",
|
|
48342
48459
|
title: "获取 单个 Issue",
|
|
48343
48460
|
args: {
|
|
48344
|
-
repo:
|
|
48345
|
-
issueNumber:
|
|
48461
|
+
repo: exports_external2.string().optional().describe("代码仓库名称, 如 my-user/my-repo"),
|
|
48462
|
+
issueNumber: exports_external2.union([exports_external2.string(), exports_external2.number()]).describe("Issue 编号")
|
|
48346
48463
|
},
|
|
48347
48464
|
summary: "获取 单个 Issue"
|
|
48348
48465
|
})
|
|
@@ -48373,12 +48490,12 @@ app.route({
|
|
|
48373
48490
|
skill: "create-issue",
|
|
48374
48491
|
title: "创建 Issue",
|
|
48375
48492
|
args: {
|
|
48376
|
-
repo:
|
|
48377
|
-
title:
|
|
48378
|
-
body:
|
|
48379
|
-
assignees:
|
|
48380
|
-
labels:
|
|
48381
|
-
priority:
|
|
48493
|
+
repo: exports_external2.string().describe("代码仓库名称, 如 my-user/my-repo"),
|
|
48494
|
+
title: exports_external2.string().describe("Issue 标题"),
|
|
48495
|
+
body: exports_external2.string().optional().describe("Issue 描述内容"),
|
|
48496
|
+
assignees: exports_external2.array(exports_external2.string()).optional().describe("指派人列表"),
|
|
48497
|
+
labels: exports_external2.array(exports_external2.string()).optional().describe("标签列表"),
|
|
48498
|
+
priority: exports_external2.string().optional().describe("优先级")
|
|
48382
48499
|
},
|
|
48383
48500
|
summary: "创建一个新的 Issue"
|
|
48384
48501
|
})
|
|
@@ -48414,9 +48531,9 @@ app.route({
|
|
|
48414
48531
|
skill: "complete-issue",
|
|
48415
48532
|
title: "完成 CNB的任务Issue",
|
|
48416
48533
|
args: {
|
|
48417
|
-
repo:
|
|
48418
|
-
issueNumber:
|
|
48419
|
-
state:
|
|
48534
|
+
repo: exports_external2.string().describe("代码仓库名称, 如 my-user/my-repo"),
|
|
48535
|
+
issueNumber: exports_external2.union([exports_external2.string(), exports_external2.number()]).describe("Issue 编号"),
|
|
48536
|
+
state: exports_external2.string().optional().describe("Issue 状态,默认为 closed")
|
|
48420
48537
|
},
|
|
48421
48538
|
summary: "完成一个 Issue(将 state 改为 closed)"
|
|
48422
48539
|
})
|
|
@@ -48449,10 +48566,10 @@ app.route({
|
|
|
48449
48566
|
skill: "list-issue-comments",
|
|
48450
48567
|
title: "查询 Issue 评论列表",
|
|
48451
48568
|
args: {
|
|
48452
|
-
repo:
|
|
48453
|
-
issueNumber:
|
|
48454
|
-
page:
|
|
48455
|
-
page_size:
|
|
48569
|
+
repo: exports_external2.string().optional().describe("代码仓库名称, 如 my-user/my-repo"),
|
|
48570
|
+
issueNumber: exports_external2.number().describe("Issue 编号"),
|
|
48571
|
+
page: exports_external2.number().optional().describe("分页页码,默认: 1"),
|
|
48572
|
+
page_size: exports_external2.number().optional().describe("分页每页大小,默认: 30")
|
|
48456
48573
|
},
|
|
48457
48574
|
summary: "查询 Issue 评论列表"
|
|
48458
48575
|
})
|
|
@@ -48488,10 +48605,10 @@ app.route({
|
|
|
48488
48605
|
skill: "create-issue-comment",
|
|
48489
48606
|
title: "创建 Issue 评论",
|
|
48490
48607
|
args: {
|
|
48491
|
-
repo:
|
|
48492
|
-
issueNumber:
|
|
48493
|
-
body:
|
|
48494
|
-
clearAt:
|
|
48608
|
+
repo: exports_external2.string().optional().describe("代码仓库名称, 如 my-user/my-repo"),
|
|
48609
|
+
issueNumber: exports_external2.number().describe("Issue 编号"),
|
|
48610
|
+
body: exports_external2.string().describe("评论内容"),
|
|
48611
|
+
clearAt: exports_external2.boolean().optional().describe("是否清除评论内容中的 @ 提及,默认: true")
|
|
48495
48612
|
},
|
|
48496
48613
|
summary: "创建 Issue 评论"
|
|
48497
48614
|
})
|
|
@@ -48528,9 +48645,9 @@ app.route({
|
|
|
48528
48645
|
skill: "get-issue-comment",
|
|
48529
48646
|
title: "获取 Issue 评论",
|
|
48530
48647
|
args: {
|
|
48531
|
-
repo:
|
|
48532
|
-
issueNumber:
|
|
48533
|
-
commentId:
|
|
48648
|
+
repo: exports_external2.string().optional().describe("代码仓库名称, 如 my-user/my-repo"),
|
|
48649
|
+
issueNumber: exports_external2.number().describe("Issue 编号"),
|
|
48650
|
+
commentId: exports_external2.number().describe("评论 ID")
|
|
48534
48651
|
},
|
|
48535
48652
|
summary: "获取 Issue 评论"
|
|
48536
48653
|
})
|
|
@@ -48563,11 +48680,11 @@ app.route({
|
|
|
48563
48680
|
skill: "update-issue-comment",
|
|
48564
48681
|
title: "修改 Issue 评论",
|
|
48565
48682
|
args: {
|
|
48566
|
-
repo:
|
|
48567
|
-
issueNumber:
|
|
48568
|
-
commentId:
|
|
48569
|
-
body:
|
|
48570
|
-
clearAt:
|
|
48683
|
+
repo: exports_external2.string().optional().describe("代码仓库名称, 如 my-user/my-repo"),
|
|
48684
|
+
issueNumber: exports_external2.number().describe("Issue 编号"),
|
|
48685
|
+
commentId: exports_external2.number().describe("评论 ID"),
|
|
48686
|
+
body: exports_external2.string().describe("评论内容"),
|
|
48687
|
+
clearAt: exports_external2.boolean().optional().describe("是否清除评论内容中的 @ 提及,默认: true")
|
|
48571
48688
|
},
|
|
48572
48689
|
summary: "修改 Issue 评论"
|
|
48573
48690
|
})
|
|
@@ -49483,7 +49600,7 @@ app.route({
|
|
|
49483
49600
|
};
|
|
49484
49601
|
}).addTo(app);
|
|
49485
49602
|
|
|
49486
|
-
// ../../node_modules/.pnpm/@ai-sdk+gateway@3.0.
|
|
49603
|
+
// ../../node_modules/.pnpm/@ai-sdk+gateway@3.0.77_zod@4.3.6/node_modules/@ai-sdk/gateway/dist/index.mjs
|
|
49487
49604
|
var import_oidc = __toESM(require_dist(), 1);
|
|
49488
49605
|
var import_oidc2 = __toESM(require_dist(), 1);
|
|
49489
49606
|
var marker17 = "vercel.ai.gateway.error";
|
|
@@ -50549,7 +50666,7 @@ async function getVercelRequestId() {
|
|
|
50549
50666
|
var _a92;
|
|
50550
50667
|
return (_a92 = import_oidc.getContext().headers) == null ? undefined : _a92["x-vercel-id"];
|
|
50551
50668
|
}
|
|
50552
|
-
var VERSION3 = "3.0.
|
|
50669
|
+
var VERSION3 = "3.0.77";
|
|
50553
50670
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
|
50554
50671
|
function createGatewayProvider(options = {}) {
|
|
50555
50672
|
var _a92, _b92;
|
|
@@ -50705,7 +50822,7 @@ async function getGatewayAuthToken(options) {
|
|
|
50705
50822
|
};
|
|
50706
50823
|
}
|
|
50707
50824
|
|
|
50708
|
-
// ../../node_modules/.pnpm/ai@6.0.
|
|
50825
|
+
// ../../node_modules/.pnpm/ai@6.0.134_zod@4.3.6/node_modules/ai/dist/index.mjs
|
|
50709
50826
|
var import_api = __toESM(require_src(), 1);
|
|
50710
50827
|
var import_api2 = __toESM(require_src(), 1);
|
|
50711
50828
|
var __defProp4 = Object.defineProperty;
|
|
@@ -51276,7 +51393,7 @@ function detectMediaType({
|
|
|
51276
51393
|
}
|
|
51277
51394
|
return;
|
|
51278
51395
|
}
|
|
51279
|
-
var VERSION4 = "6.0.
|
|
51396
|
+
var VERSION4 = "6.0.134";
|
|
51280
51397
|
var download = async ({
|
|
51281
51398
|
url: url4,
|
|
51282
51399
|
maxBytes,
|
|
@@ -51290,6 +51407,9 @@ var download = async ({
|
|
|
51290
51407
|
headers: withUserAgentSuffix({}, `ai-sdk/${VERSION4}`, getRuntimeEnvironmentUserAgent()),
|
|
51291
51408
|
signal: abortSignal
|
|
51292
51409
|
});
|
|
51410
|
+
if (response.redirected) {
|
|
51411
|
+
validateDownloadUrl(response.url);
|
|
51412
|
+
}
|
|
51293
51413
|
if (!response.ok) {
|
|
51294
51414
|
throw new DownloadError({
|
|
51295
51415
|
url: urlText,
|
|
@@ -51693,7 +51813,7 @@ async function createToolModelOutput({
|
|
|
51693
51813
|
toolCallId,
|
|
51694
51814
|
input,
|
|
51695
51815
|
output,
|
|
51696
|
-
tool:
|
|
51816
|
+
tool: tool2,
|
|
51697
51817
|
errorMode
|
|
51698
51818
|
}) {
|
|
51699
51819
|
if (errorMode === "text") {
|
|
@@ -51701,8 +51821,8 @@ async function createToolModelOutput({
|
|
|
51701
51821
|
} else if (errorMode === "json") {
|
|
51702
51822
|
return { type: "error-json", value: toJSONValue(output) };
|
|
51703
51823
|
}
|
|
51704
|
-
if (
|
|
51705
|
-
return await
|
|
51824
|
+
if (tool2 == null ? undefined : tool2.toModelOutput) {
|
|
51825
|
+
return await tool2.toModelOutput({ toolCallId, input, output });
|
|
51706
51826
|
}
|
|
51707
51827
|
return typeof output === "string" ? { type: "text", value: output } : { type: "json", value: toJSONValue(output) };
|
|
51708
51828
|
}
|
|
@@ -51816,8 +51936,8 @@ async function prepareToolsAndToolChoice({
|
|
|
51816
51936
|
}
|
|
51817
51937
|
const filteredTools = activeTools != null ? Object.entries(tools).filter(([name21]) => activeTools.includes(name21)) : Object.entries(tools);
|
|
51818
51938
|
const languageModelTools = [];
|
|
51819
|
-
for (const [name21,
|
|
51820
|
-
const toolType =
|
|
51939
|
+
for (const [name21, tool2] of filteredTools) {
|
|
51940
|
+
const toolType = tool2.type;
|
|
51821
51941
|
switch (toolType) {
|
|
51822
51942
|
case undefined:
|
|
51823
51943
|
case "dynamic":
|
|
@@ -51825,19 +51945,19 @@ async function prepareToolsAndToolChoice({
|
|
|
51825
51945
|
languageModelTools.push({
|
|
51826
51946
|
type: "function",
|
|
51827
51947
|
name: name21,
|
|
51828
|
-
description:
|
|
51829
|
-
inputSchema: await asSchema(
|
|
51830
|
-
...
|
|
51831
|
-
providerOptions:
|
|
51832
|
-
...
|
|
51948
|
+
description: tool2.description,
|
|
51949
|
+
inputSchema: await asSchema(tool2.inputSchema).jsonSchema,
|
|
51950
|
+
...tool2.inputExamples != null ? { inputExamples: tool2.inputExamples } : {},
|
|
51951
|
+
providerOptions: tool2.providerOptions,
|
|
51952
|
+
...tool2.strict != null ? { strict: tool2.strict } : {}
|
|
51833
51953
|
});
|
|
51834
51954
|
break;
|
|
51835
51955
|
case "provider":
|
|
51836
51956
|
languageModelTools.push({
|
|
51837
51957
|
type: "provider",
|
|
51838
51958
|
name: name21,
|
|
51839
|
-
id:
|
|
51840
|
-
args:
|
|
51959
|
+
id: tool2.id,
|
|
51960
|
+
args: tool2.args
|
|
51841
51961
|
});
|
|
51842
51962
|
break;
|
|
51843
51963
|
default: {
|
|
@@ -52603,8 +52723,8 @@ async function executeToolCall({
|
|
|
52603
52723
|
onToolCallFinish
|
|
52604
52724
|
}) {
|
|
52605
52725
|
const { toolName, toolCallId, input } = toolCall;
|
|
52606
|
-
const
|
|
52607
|
-
if ((
|
|
52726
|
+
const tool2 = tools == null ? undefined : tools[toolName];
|
|
52727
|
+
if ((tool2 == null ? undefined : tool2.execute) == null) {
|
|
52608
52728
|
return;
|
|
52609
52729
|
}
|
|
52610
52730
|
const baseCallbackEvent = {
|
|
@@ -52640,7 +52760,7 @@ async function executeToolCall({
|
|
|
52640
52760
|
const startTime = now();
|
|
52641
52761
|
try {
|
|
52642
52762
|
const stream = executeTool({
|
|
52643
|
-
execute:
|
|
52763
|
+
execute: tool2.execute.bind(tool2),
|
|
52644
52764
|
input,
|
|
52645
52765
|
options: {
|
|
52646
52766
|
toolCallId,
|
|
@@ -52679,7 +52799,7 @@ async function executeToolCall({
|
|
|
52679
52799
|
toolName,
|
|
52680
52800
|
input,
|
|
52681
52801
|
error: error49,
|
|
52682
|
-
dynamic:
|
|
52802
|
+
dynamic: tool2.type === "dynamic",
|
|
52683
52803
|
...toolCall.providerMetadata != null ? { providerMetadata: toolCall.providerMetadata } : {}
|
|
52684
52804
|
};
|
|
52685
52805
|
}
|
|
@@ -52709,7 +52829,7 @@ async function executeToolCall({
|
|
|
52709
52829
|
toolName,
|
|
52710
52830
|
input,
|
|
52711
52831
|
output,
|
|
52712
|
-
dynamic:
|
|
52832
|
+
dynamic: tool2.type === "dynamic",
|
|
52713
52833
|
...toolCall.providerMetadata != null ? { providerMetadata: toolCall.providerMetadata } : {}
|
|
52714
52834
|
};
|
|
52715
52835
|
}
|
|
@@ -52751,18 +52871,18 @@ var DefaultGeneratedFile = class {
|
|
|
52751
52871
|
}
|
|
52752
52872
|
};
|
|
52753
52873
|
async function isApprovalNeeded({
|
|
52754
|
-
tool:
|
|
52874
|
+
tool: tool2,
|
|
52755
52875
|
toolCall,
|
|
52756
52876
|
messages,
|
|
52757
52877
|
experimental_context
|
|
52758
52878
|
}) {
|
|
52759
|
-
if (
|
|
52879
|
+
if (tool2.needsApproval == null) {
|
|
52760
52880
|
return false;
|
|
52761
52881
|
}
|
|
52762
|
-
if (typeof
|
|
52763
|
-
return
|
|
52882
|
+
if (typeof tool2.needsApproval === "boolean") {
|
|
52883
|
+
return tool2.needsApproval;
|
|
52764
52884
|
}
|
|
52765
|
-
return await
|
|
52885
|
+
return await tool2.needsApproval(toolCall.input, {
|
|
52766
52886
|
toolCallId: toolCall.toolCallId,
|
|
52767
52887
|
messages,
|
|
52768
52888
|
experimental_context
|
|
@@ -53497,8 +53617,8 @@ async function doParseToolCall({
|
|
|
53497
53617
|
tools
|
|
53498
53618
|
}) {
|
|
53499
53619
|
const toolName = toolCall.toolName;
|
|
53500
|
-
const
|
|
53501
|
-
if (
|
|
53620
|
+
const tool2 = tools[toolName];
|
|
53621
|
+
if (tool2 == null) {
|
|
53502
53622
|
if (toolCall.providerExecuted && toolCall.dynamic) {
|
|
53503
53623
|
return await parseProviderExecutedDynamicToolCall(toolCall);
|
|
53504
53624
|
}
|
|
@@ -53507,7 +53627,7 @@ async function doParseToolCall({
|
|
|
53507
53627
|
availableTools: Object.keys(tools)
|
|
53508
53628
|
});
|
|
53509
53629
|
}
|
|
53510
|
-
const schema = asSchema(
|
|
53630
|
+
const schema = asSchema(tool2.inputSchema);
|
|
53511
53631
|
const parseResult = toolCall.input.trim() === "" ? await safeValidateTypes({ value: {}, schema }) : await safeParseJSON({ text: toolCall.input, schema });
|
|
53512
53632
|
if (parseResult.success === false) {
|
|
53513
53633
|
throw new InvalidToolInputError({
|
|
@@ -53516,7 +53636,7 @@ async function doParseToolCall({
|
|
|
53516
53636
|
cause: parseResult.error
|
|
53517
53637
|
});
|
|
53518
53638
|
}
|
|
53519
|
-
return
|
|
53639
|
+
return tool2.type === "dynamic" ? {
|
|
53520
53640
|
type: "tool-call",
|
|
53521
53641
|
toolCallId: toolCall.toolCallId,
|
|
53522
53642
|
toolName: toolCall.toolName,
|
|
@@ -53524,7 +53644,7 @@ async function doParseToolCall({
|
|
|
53524
53644
|
providerExecuted: toolCall.providerExecuted,
|
|
53525
53645
|
providerMetadata: toolCall.providerMetadata,
|
|
53526
53646
|
dynamic: true,
|
|
53527
|
-
title:
|
|
53647
|
+
title: tool2.title
|
|
53528
53648
|
} : {
|
|
53529
53649
|
type: "tool-call",
|
|
53530
53650
|
toolCallId: toolCall.toolCallId,
|
|
@@ -53532,7 +53652,7 @@ async function doParseToolCall({
|
|
|
53532
53652
|
input: parseResult.value,
|
|
53533
53653
|
providerExecuted: toolCall.providerExecuted,
|
|
53534
53654
|
providerMetadata: toolCall.providerMetadata,
|
|
53535
|
-
title:
|
|
53655
|
+
title: tool2.title
|
|
53536
53656
|
};
|
|
53537
53657
|
}
|
|
53538
53658
|
var DefaultStepResult = class {
|
|
@@ -53872,7 +53992,7 @@ async function generateText({
|
|
|
53872
53992
|
}),
|
|
53873
53993
|
tracer,
|
|
53874
53994
|
fn: async (span) => {
|
|
53875
|
-
var _a21, _b16, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
53995
|
+
var _a21, _b16, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
53876
53996
|
const initialMessages = initialPrompt.messages;
|
|
53877
53997
|
const responseMessages = [];
|
|
53878
53998
|
const { approvedToolApprovals, deniedToolApprovals } = collectToolApprovals({ messages: initialMessages });
|
|
@@ -54036,7 +54156,7 @@ async function generateText({
|
|
|
54036
54156
|
input: () => stringifyForTelemetry(promptMessages)
|
|
54037
54157
|
},
|
|
54038
54158
|
"ai.prompt.tools": {
|
|
54039
|
-
input: () => stepTools == null ? undefined : stepTools.map((
|
|
54159
|
+
input: () => stepTools == null ? undefined : stepTools.map((tool2) => JSON.stringify(tool2))
|
|
54040
54160
|
},
|
|
54041
54161
|
"ai.prompt.toolChoice": {
|
|
54042
54162
|
input: () => stepToolChoice != null ? JSON.stringify(stepToolChoice) : undefined
|
|
@@ -54072,6 +54192,7 @@ async function generateText({
|
|
|
54072
54192
|
headers: (_g2 = result.response) == null ? undefined : _g2.headers,
|
|
54073
54193
|
body: (_h2 = result.response) == null ? undefined : _h2.body
|
|
54074
54194
|
};
|
|
54195
|
+
const usage = asLanguageModelUsage(result.usage);
|
|
54075
54196
|
span2.setAttributes(await selectTelemetryAttributes({
|
|
54076
54197
|
telemetry,
|
|
54077
54198
|
attributes: {
|
|
@@ -54092,8 +54213,16 @@ async function generateText({
|
|
|
54092
54213
|
"ai.response.model": responseData.modelId,
|
|
54093
54214
|
"ai.response.timestamp": responseData.timestamp.toISOString(),
|
|
54094
54215
|
"ai.response.providerMetadata": JSON.stringify(result.providerMetadata),
|
|
54095
|
-
"ai.usage.
|
|
54096
|
-
"ai.usage.
|
|
54216
|
+
"ai.usage.inputTokens": result.usage.inputTokens.total,
|
|
54217
|
+
"ai.usage.inputTokenDetails.noCacheTokens": result.usage.inputTokens.noCache,
|
|
54218
|
+
"ai.usage.inputTokenDetails.cacheReadTokens": result.usage.inputTokens.cacheRead,
|
|
54219
|
+
"ai.usage.inputTokenDetails.cacheWriteTokens": result.usage.inputTokens.cacheWrite,
|
|
54220
|
+
"ai.usage.outputTokens": result.usage.outputTokens.total,
|
|
54221
|
+
"ai.usage.outputTokenDetails.textTokens": result.usage.outputTokens.text,
|
|
54222
|
+
"ai.usage.outputTokenDetails.reasoningTokens": result.usage.outputTokens.reasoning,
|
|
54223
|
+
"ai.usage.totalTokens": usage.totalTokens,
|
|
54224
|
+
"ai.usage.reasoningTokens": result.usage.outputTokens.reasoning,
|
|
54225
|
+
"ai.usage.cachedInputTokens": result.usage.inputTokens.cacheRead,
|
|
54097
54226
|
"gen_ai.response.finish_reasons": [
|
|
54098
54227
|
result.finishReason.unified
|
|
54099
54228
|
],
|
|
@@ -54119,12 +54248,12 @@ async function generateText({
|
|
|
54119
54248
|
if (toolCall.invalid) {
|
|
54120
54249
|
continue;
|
|
54121
54250
|
}
|
|
54122
|
-
const
|
|
54123
|
-
if (
|
|
54251
|
+
const tool2 = tools == null ? undefined : tools[toolCall.toolName];
|
|
54252
|
+
if (tool2 == null) {
|
|
54124
54253
|
continue;
|
|
54125
54254
|
}
|
|
54126
|
-
if ((
|
|
54127
|
-
await
|
|
54255
|
+
if ((tool2 == null ? undefined : tool2.onInputAvailable) != null) {
|
|
54256
|
+
await tool2.onInputAvailable({
|
|
54128
54257
|
input: toolCall.input,
|
|
54129
54258
|
toolCallId: toolCall.toolCallId,
|
|
54130
54259
|
messages: stepInputMessages,
|
|
@@ -54133,7 +54262,7 @@ async function generateText({
|
|
|
54133
54262
|
});
|
|
54134
54263
|
}
|
|
54135
54264
|
if (await isApprovalNeeded({
|
|
54136
|
-
tool:
|
|
54265
|
+
tool: tool2,
|
|
54137
54266
|
toolCall,
|
|
54138
54267
|
messages: stepInputMessages,
|
|
54139
54268
|
experimental_context
|
|
@@ -54182,8 +54311,8 @@ async function generateText({
|
|
|
54182
54311
|
for (const toolCall of stepToolCalls) {
|
|
54183
54312
|
if (!toolCall.providerExecuted)
|
|
54184
54313
|
continue;
|
|
54185
|
-
const
|
|
54186
|
-
if ((
|
|
54314
|
+
const tool2 = tools == null ? undefined : tools[toolCall.toolName];
|
|
54315
|
+
if ((tool2 == null ? undefined : tool2.type) === "provider" && tool2.supportsDeferredResults) {
|
|
54187
54316
|
const hasResultInResponse = currentModelResponse.content.some((part) => part.type === "tool-result" && part.toolCallId === toolCall.toolCallId);
|
|
54188
54317
|
if (!hasResultInResponse) {
|
|
54189
54318
|
pendingDeferredToolCalls.set(toolCall.toolCallId, {
|
|
@@ -54262,9 +54391,7 @@ async function generateText({
|
|
|
54262
54391
|
return toolCalls == null ? undefined : JSON.stringify(toolCalls);
|
|
54263
54392
|
}
|
|
54264
54393
|
},
|
|
54265
|
-
"ai.response.providerMetadata": JSON.stringify(currentModelResponse.providerMetadata)
|
|
54266
|
-
"ai.usage.promptTokens": currentModelResponse.usage.inputTokens.total,
|
|
54267
|
-
"ai.usage.completionTokens": currentModelResponse.usage.outputTokens.total
|
|
54394
|
+
"ai.response.providerMetadata": JSON.stringify(currentModelResponse.providerMetadata)
|
|
54268
54395
|
}
|
|
54269
54396
|
}));
|
|
54270
54397
|
const lastStep = steps[steps.length - 1];
|
|
@@ -54277,6 +54404,21 @@ async function generateText({
|
|
|
54277
54404
|
reasoningTokens: undefined,
|
|
54278
54405
|
cachedInputTokens: undefined
|
|
54279
54406
|
});
|
|
54407
|
+
span.setAttributes(await selectTelemetryAttributes({
|
|
54408
|
+
telemetry,
|
|
54409
|
+
attributes: {
|
|
54410
|
+
"ai.usage.inputTokens": totalUsage.inputTokens,
|
|
54411
|
+
"ai.usage.inputTokenDetails.noCacheTokens": (_n = totalUsage.inputTokenDetails) == null ? undefined : _n.noCacheTokens,
|
|
54412
|
+
"ai.usage.inputTokenDetails.cacheReadTokens": (_o = totalUsage.inputTokenDetails) == null ? undefined : _o.cacheReadTokens,
|
|
54413
|
+
"ai.usage.inputTokenDetails.cacheWriteTokens": (_p = totalUsage.inputTokenDetails) == null ? undefined : _p.cacheWriteTokens,
|
|
54414
|
+
"ai.usage.outputTokens": totalUsage.outputTokens,
|
|
54415
|
+
"ai.usage.outputTokenDetails.textTokens": (_q = totalUsage.outputTokenDetails) == null ? undefined : _q.textTokens,
|
|
54416
|
+
"ai.usage.outputTokenDetails.reasoningTokens": (_r = totalUsage.outputTokenDetails) == null ? undefined : _r.reasoningTokens,
|
|
54417
|
+
"ai.usage.totalTokens": totalUsage.totalTokens,
|
|
54418
|
+
"ai.usage.reasoningTokens": (_s = totalUsage.outputTokenDetails) == null ? undefined : _s.reasoningTokens,
|
|
54419
|
+
"ai.usage.cachedInputTokens": (_t = totalUsage.inputTokenDetails) == null ? undefined : _t.cacheReadTokens
|
|
54420
|
+
}
|
|
54421
|
+
}));
|
|
54280
54422
|
await notify({
|
|
54281
54423
|
event: {
|
|
54282
54424
|
stepNumber: lastStep.stepNumber,
|
|
@@ -54476,8 +54618,8 @@ function asContent({
|
|
|
54476
54618
|
case "tool-result": {
|
|
54477
54619
|
const toolCall = toolCalls.find((toolCall2) => toolCall2.toolCallId === part.toolCallId);
|
|
54478
54620
|
if (toolCall == null) {
|
|
54479
|
-
const
|
|
54480
|
-
const supportsDeferredResults = (
|
|
54621
|
+
const tool2 = tools == null ? undefined : tools[part.toolName];
|
|
54622
|
+
const supportsDeferredResults = (tool2 == null ? undefined : tool2.type) === "provider" && tool2.supportsDeferredResults;
|
|
54481
54623
|
if (!supportsDeferredResults) {
|
|
54482
54624
|
throw new Error(`Tool call ${part.toolCallId} not found.`);
|
|
54483
54625
|
}
|
|
@@ -54489,7 +54631,8 @@ function asContent({
|
|
|
54489
54631
|
input: undefined,
|
|
54490
54632
|
error: part.result,
|
|
54491
54633
|
providerExecuted: true,
|
|
54492
|
-
dynamic: part.dynamic
|
|
54634
|
+
dynamic: part.dynamic,
|
|
54635
|
+
...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {}
|
|
54493
54636
|
});
|
|
54494
54637
|
} else {
|
|
54495
54638
|
contentParts.push({
|
|
@@ -54499,7 +54642,8 @@ function asContent({
|
|
|
54499
54642
|
input: undefined,
|
|
54500
54643
|
output: part.result,
|
|
54501
54644
|
providerExecuted: true,
|
|
54502
|
-
dynamic: part.dynamic
|
|
54645
|
+
dynamic: part.dynamic,
|
|
54646
|
+
...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {}
|
|
54503
54647
|
});
|
|
54504
54648
|
}
|
|
54505
54649
|
break;
|
|
@@ -54512,7 +54656,8 @@ function asContent({
|
|
|
54512
54656
|
input: toolCall.input,
|
|
54513
54657
|
error: part.result,
|
|
54514
54658
|
providerExecuted: true,
|
|
54515
|
-
dynamic: toolCall.dynamic
|
|
54659
|
+
dynamic: toolCall.dynamic,
|
|
54660
|
+
...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {}
|
|
54516
54661
|
});
|
|
54517
54662
|
} else {
|
|
54518
54663
|
contentParts.push({
|
|
@@ -54522,7 +54667,8 @@ function asContent({
|
|
|
54522
54667
|
input: toolCall.input,
|
|
54523
54668
|
output: part.result,
|
|
54524
54669
|
providerExecuted: true,
|
|
54525
|
-
dynamic: toolCall.dynamic
|
|
54670
|
+
dynamic: toolCall.dynamic,
|
|
54671
|
+
...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {}
|
|
54526
54672
|
});
|
|
54527
54673
|
}
|
|
54528
54674
|
break;
|
|
@@ -54628,6 +54774,7 @@ var uiMessageChunkSchema = lazySchema(() => zodSchema(exports_external2.union([
|
|
|
54628
54774
|
toolCallId: exports_external2.string(),
|
|
54629
54775
|
output: exports_external2.unknown(),
|
|
54630
54776
|
providerExecuted: exports_external2.boolean().optional(),
|
|
54777
|
+
providerMetadata: providerMetadataSchema.optional(),
|
|
54631
54778
|
dynamic: exports_external2.boolean().optional(),
|
|
54632
54779
|
preliminary: exports_external2.boolean().optional()
|
|
54633
54780
|
}),
|
|
@@ -54636,6 +54783,7 @@ var uiMessageChunkSchema = lazySchema(() => zodSchema(exports_external2.union([
|
|
|
54636
54783
|
toolCallId: exports_external2.string(),
|
|
54637
54784
|
errorText: exports_external2.string(),
|
|
54638
54785
|
providerExecuted: exports_external2.boolean().optional(),
|
|
54786
|
+
providerMetadata: providerMetadataSchema.optional(),
|
|
54639
54787
|
dynamic: exports_external2.boolean().optional()
|
|
54640
54788
|
}),
|
|
54641
54789
|
exports_external2.strictObject({
|
|
@@ -54834,6 +54982,7 @@ var uiMessagesSchema = lazySchema(() => zodSchema(exports_external2.array(export
|
|
|
54834
54982
|
output: exports_external2.unknown(),
|
|
54835
54983
|
errorText: exports_external2.never().optional(),
|
|
54836
54984
|
callProviderMetadata: providerMetadataSchema.optional(),
|
|
54985
|
+
resultProviderMetadata: providerMetadataSchema.optional(),
|
|
54837
54986
|
preliminary: exports_external2.boolean().optional(),
|
|
54838
54987
|
approval: exports_external2.object({
|
|
54839
54988
|
id: exports_external2.string(),
|
|
@@ -54852,6 +55001,7 @@ var uiMessagesSchema = lazySchema(() => zodSchema(exports_external2.array(export
|
|
|
54852
55001
|
output: exports_external2.never().optional(),
|
|
54853
55002
|
errorText: exports_external2.string(),
|
|
54854
55003
|
callProviderMetadata: providerMetadataSchema.optional(),
|
|
55004
|
+
resultProviderMetadata: providerMetadataSchema.optional(),
|
|
54855
55005
|
approval: exports_external2.object({
|
|
54856
55006
|
id: exports_external2.string(),
|
|
54857
55007
|
approved: exports_external2.literal(true),
|
|
@@ -54935,6 +55085,7 @@ var uiMessagesSchema = lazySchema(() => zodSchema(exports_external2.array(export
|
|
|
54935
55085
|
output: exports_external2.unknown(),
|
|
54936
55086
|
errorText: exports_external2.never().optional(),
|
|
54937
55087
|
callProviderMetadata: providerMetadataSchema.optional(),
|
|
55088
|
+
resultProviderMetadata: providerMetadataSchema.optional(),
|
|
54938
55089
|
preliminary: exports_external2.boolean().optional(),
|
|
54939
55090
|
approval: exports_external2.object({
|
|
54940
55091
|
id: exports_external2.string(),
|
|
@@ -54952,6 +55103,7 @@ var uiMessagesSchema = lazySchema(() => zodSchema(exports_external2.array(export
|
|
|
54952
55103
|
output: exports_external2.never().optional(),
|
|
54953
55104
|
errorText: exports_external2.string(),
|
|
54954
55105
|
callProviderMetadata: providerMetadataSchema.optional(),
|
|
55106
|
+
resultProviderMetadata: providerMetadataSchema.optional(),
|
|
54955
55107
|
approval: exports_external2.object({
|
|
54956
55108
|
id: exports_external2.string(),
|
|
54957
55109
|
approved: exports_external2.literal(true),
|
|
@@ -55338,7 +55490,7 @@ var createTool = async (app2, message) => {
|
|
|
55338
55490
|
console.error(`未找到路径 ${message.path} 和 key ${message.key} 的路由`);
|
|
55339
55491
|
return null;
|
|
55340
55492
|
}
|
|
55341
|
-
const _tool =
|
|
55493
|
+
const _tool = tool({
|
|
55342
55494
|
description: route?.metadata?.summary || route?.description || "无描述",
|
|
55343
55495
|
inputSchema: zod_default.object({
|
|
55344
55496
|
...route.metadata?.args
|
|
@@ -55484,10 +55636,10 @@ app.route({
|
|
|
55484
55636
|
title: "查询 Issue 标签列表",
|
|
55485
55637
|
summary: "查询 Issue 的标签列表",
|
|
55486
55638
|
args: {
|
|
55487
|
-
repo:
|
|
55488
|
-
issueNumber:
|
|
55489
|
-
page:
|
|
55490
|
-
pageSize:
|
|
55639
|
+
repo: exports_external2.string().optional().describe("仓库路径, 如 my-user/my-repo"),
|
|
55640
|
+
issueNumber: exports_external2.number().describe("Issue 编号"),
|
|
55641
|
+
page: exports_external2.number().optional().describe("分页页码,默认 1"),
|
|
55642
|
+
pageSize: exports_external2.number().optional().describe("分页每页大小,默认 30")
|
|
55491
55643
|
}
|
|
55492
55644
|
})
|
|
55493
55645
|
}
|
|
@@ -55521,9 +55673,9 @@ app.route({
|
|
|
55521
55673
|
title: "设置 Issue 标签",
|
|
55522
55674
|
summary: "设置 Issue 标签(完全替换现有标签)",
|
|
55523
55675
|
args: {
|
|
55524
|
-
repo:
|
|
55525
|
-
issueNumber:
|
|
55526
|
-
labels:
|
|
55676
|
+
repo: exports_external2.string().optional().describe("仓库路径, 如 my-user/my-repo"),
|
|
55677
|
+
issueNumber: exports_external2.number().describe("Issue 编号"),
|
|
55678
|
+
labels: exports_external2.array(exports_external2.string()).describe("标签名称数组")
|
|
55527
55679
|
}
|
|
55528
55680
|
})
|
|
55529
55681
|
}
|
|
@@ -55556,9 +55708,9 @@ app.route({
|
|
|
55556
55708
|
title: "新增 Issue 标签",
|
|
55557
55709
|
summary: "新增 Issue 标签(追加到现有标签)",
|
|
55558
55710
|
args: {
|
|
55559
|
-
repo:
|
|
55560
|
-
issueNumber:
|
|
55561
|
-
labels:
|
|
55711
|
+
repo: exports_external2.string().optional().describe("仓库路径, 如 my-user/my-repo"),
|
|
55712
|
+
issueNumber: exports_external2.number().describe("Issue 编号"),
|
|
55713
|
+
labels: exports_external2.array(exports_external2.string()).describe("标签名称数组")
|
|
55562
55714
|
}
|
|
55563
55715
|
})
|
|
55564
55716
|
}
|
|
@@ -55591,8 +55743,8 @@ app.route({
|
|
|
55591
55743
|
title: "清空 Issue 标签",
|
|
55592
55744
|
summary: "清空 Issue 标签(移除所有标签)",
|
|
55593
55745
|
args: {
|
|
55594
|
-
repo:
|
|
55595
|
-
issueNumber:
|
|
55746
|
+
repo: exports_external2.string().optional().describe("仓库路径, 如 my-user/my-repo"),
|
|
55747
|
+
issueNumber: exports_external2.number().describe("Issue 编号")
|
|
55596
55748
|
}
|
|
55597
55749
|
})
|
|
55598
55750
|
}
|
|
@@ -55621,9 +55773,9 @@ app.route({
|
|
|
55621
55773
|
title: "删除 Issue 标签",
|
|
55622
55774
|
summary: "删除 Issue 指定标签",
|
|
55623
55775
|
args: {
|
|
55624
|
-
repo:
|
|
55625
|
-
issueNumber:
|
|
55626
|
-
name:
|
|
55776
|
+
repo: exports_external2.string().optional().describe("仓库路径, 如 my-user/my-repo"),
|
|
55777
|
+
issueNumber: exports_external2.number().describe("Issue 编号"),
|
|
55778
|
+
name: exports_external2.string().describe("标签名称")
|
|
55627
55779
|
}
|
|
55628
55780
|
})
|
|
55629
55781
|
}
|
|
@@ -55645,6 +55797,330 @@ app.route({
|
|
|
55645
55797
|
ctx.forward(res);
|
|
55646
55798
|
}).addTo(app);
|
|
55647
55799
|
|
|
55800
|
+
// agent/routes/package/registry.ts
|
|
55801
|
+
app.route({
|
|
55802
|
+
path: "cnb",
|
|
55803
|
+
key: "list-group-registries",
|
|
55804
|
+
description: "查询组织下的制品库列表, 参数 slug",
|
|
55805
|
+
middleware: ["auth"],
|
|
55806
|
+
metadata: {
|
|
55807
|
+
tags: ["package"],
|
|
55808
|
+
...createSkill({
|
|
55809
|
+
skill: "list-group-registries",
|
|
55810
|
+
title: "查询制品库列表",
|
|
55811
|
+
args: {
|
|
55812
|
+
slug: exports_external2.string().describe("组织 slug, 如 my-org"),
|
|
55813
|
+
page: exports_external2.number().describe("页码").optional(),
|
|
55814
|
+
page_size: exports_external2.number().describe("每页数量").optional(),
|
|
55815
|
+
registry_type: exports_external2.string().describe("制品仓库类型: npm, maven, ohpm").optional(),
|
|
55816
|
+
filter_type: exports_external2.string().describe("制品仓库可见性: private, public").optional(),
|
|
55817
|
+
order_by: exports_external2.string().describe("排序字段: created_at, name").optional()
|
|
55818
|
+
},
|
|
55819
|
+
summary: "查询组织下的制品库列表"
|
|
55820
|
+
})
|
|
55821
|
+
}
|
|
55822
|
+
}).define(async (ctx) => {
|
|
55823
|
+
const cnb = await cnbManager.getContext(ctx);
|
|
55824
|
+
const slug = ctx.query?.slug;
|
|
55825
|
+
const { page, page_size, registry_type, filter_type, order_by } = ctx.query || {};
|
|
55826
|
+
if (!slug) {
|
|
55827
|
+
ctx.throw(400, "缺少参数 slug");
|
|
55828
|
+
}
|
|
55829
|
+
const res = await cnb.packages.registry.listGroupRegistries(slug, {
|
|
55830
|
+
page,
|
|
55831
|
+
page_size,
|
|
55832
|
+
registry_type,
|
|
55833
|
+
filter_type,
|
|
55834
|
+
order_by
|
|
55835
|
+
});
|
|
55836
|
+
ctx.forward(res);
|
|
55837
|
+
}).addTo(app);
|
|
55838
|
+
app.route({
|
|
55839
|
+
path: "cnb",
|
|
55840
|
+
key: "set-registry-visibility",
|
|
55841
|
+
description: "设置制品库可见性, 参数 registry, visibility",
|
|
55842
|
+
middleware: ["auth"],
|
|
55843
|
+
metadata: {
|
|
55844
|
+
tags: ["package"],
|
|
55845
|
+
...createSkill({
|
|
55846
|
+
skill: "set-registry-visibility",
|
|
55847
|
+
title: "设置制品库可见性",
|
|
55848
|
+
args: {
|
|
55849
|
+
registry: exports_external2.string().describe("制品库路径, 如 my-org/my-registry"),
|
|
55850
|
+
visibility: exports_external2.string().describe("可见性: private 或 public")
|
|
55851
|
+
},
|
|
55852
|
+
summary: "设置制品库的可见性"
|
|
55853
|
+
})
|
|
55854
|
+
}
|
|
55855
|
+
}).define(async (ctx) => {
|
|
55856
|
+
const cnb = await cnbManager.getContext(ctx);
|
|
55857
|
+
const registry4 = ctx.query?.registry;
|
|
55858
|
+
const visibility = ctx.query?.visibility;
|
|
55859
|
+
if (!registry4) {
|
|
55860
|
+
ctx.throw(400, "缺少参数 registry");
|
|
55861
|
+
}
|
|
55862
|
+
if (!visibility) {
|
|
55863
|
+
ctx.throw(400, "缺少参数 visibility");
|
|
55864
|
+
}
|
|
55865
|
+
const res = await cnb.packages.registry.setVisibility(registry4, { visibility });
|
|
55866
|
+
ctx.forward(res);
|
|
55867
|
+
}).addTo(app);
|
|
55868
|
+
app.route({
|
|
55869
|
+
path: "cnb",
|
|
55870
|
+
key: "delete-registry",
|
|
55871
|
+
description: "删除制品库, 参数 registry",
|
|
55872
|
+
middleware: ["auth"],
|
|
55873
|
+
metadata: {
|
|
55874
|
+
tags: ["package"],
|
|
55875
|
+
...createSkill({
|
|
55876
|
+
skill: "delete-registry",
|
|
55877
|
+
title: "删除制品库",
|
|
55878
|
+
args: {
|
|
55879
|
+
registry: exports_external2.string().describe("制品库路径, 如 my-org/my-registry")
|
|
55880
|
+
},
|
|
55881
|
+
summary: "删除指定的制品库"
|
|
55882
|
+
})
|
|
55883
|
+
}
|
|
55884
|
+
}).define(async (ctx) => {
|
|
55885
|
+
const cnb = await cnbManager.getContext(ctx);
|
|
55886
|
+
const registry4 = ctx.query?.registry;
|
|
55887
|
+
if (!registry4) {
|
|
55888
|
+
ctx.throw(400, "缺少参数 registry");
|
|
55889
|
+
}
|
|
55890
|
+
const res = await cnb.packages.registry.remove(registry4);
|
|
55891
|
+
ctx.forward(res);
|
|
55892
|
+
}).addTo(app);
|
|
55893
|
+
|
|
55894
|
+
// agent/routes/package/package.ts
|
|
55895
|
+
app.route({
|
|
55896
|
+
path: "cnb",
|
|
55897
|
+
key: "list-packages",
|
|
55898
|
+
description: "查询制品列表, 参数 slug, type",
|
|
55899
|
+
middleware: ["auth"],
|
|
55900
|
+
metadata: {
|
|
55901
|
+
tags: ["package"],
|
|
55902
|
+
...createSkill({
|
|
55903
|
+
skill: "list-packages",
|
|
55904
|
+
title: "查询制品列表",
|
|
55905
|
+
args: {
|
|
55906
|
+
slug: exports_external2.string().describe("资源路径, 如 my-org/my-registry"),
|
|
55907
|
+
type: exports_external2.string().describe("制品类型: all, docker, helm, docker-model, maven, npm, ohpm, pypi, nuget, composer, conan, cargo"),
|
|
55908
|
+
ordering: exports_external2.string().describe("排序类型: pull_count, last_push_at, name_ascend, name_descend").optional(),
|
|
55909
|
+
name: exports_external2.string().describe("关键字,搜索制品名称").optional(),
|
|
55910
|
+
page: exports_external2.number().describe("页码").optional(),
|
|
55911
|
+
page_size: exports_external2.number().describe("每页数量").optional()
|
|
55912
|
+
},
|
|
55913
|
+
summary: "查询制品列表"
|
|
55914
|
+
})
|
|
55915
|
+
}
|
|
55916
|
+
}).define(async (ctx) => {
|
|
55917
|
+
const cnb = await cnbManager.getContext(ctx);
|
|
55918
|
+
const slug = ctx.query?.slug;
|
|
55919
|
+
const type = ctx.query?.type;
|
|
55920
|
+
const { ordering, name: name21, page, page_size } = ctx.query || {};
|
|
55921
|
+
if (!slug) {
|
|
55922
|
+
ctx.throw(400, "缺少参数 slug");
|
|
55923
|
+
}
|
|
55924
|
+
if (!type) {
|
|
55925
|
+
ctx.throw(400, "缺少参数 type");
|
|
55926
|
+
}
|
|
55927
|
+
const res = await cnb.packages.package.list(slug, type, {
|
|
55928
|
+
ordering,
|
|
55929
|
+
name: name21,
|
|
55930
|
+
page,
|
|
55931
|
+
page_size
|
|
55932
|
+
});
|
|
55933
|
+
ctx.forward(res);
|
|
55934
|
+
}).addTo(app);
|
|
55935
|
+
app.route({
|
|
55936
|
+
path: "cnb",
|
|
55937
|
+
key: "get-package",
|
|
55938
|
+
description: "获取制品详情, 参数 slug, type, name",
|
|
55939
|
+
middleware: ["auth"],
|
|
55940
|
+
metadata: {
|
|
55941
|
+
tags: ["package"],
|
|
55942
|
+
...createSkill({
|
|
55943
|
+
skill: "get-package",
|
|
55944
|
+
title: "获取制品详情",
|
|
55945
|
+
args: {
|
|
55946
|
+
slug: exports_external2.string().describe("资源路径, 如 my-org/my-registry"),
|
|
55947
|
+
type: exports_external2.string().describe("制品类型"),
|
|
55948
|
+
name: exports_external2.string().describe("制品名称")
|
|
55949
|
+
},
|
|
55950
|
+
summary: "获取指定制品的详细信息"
|
|
55951
|
+
})
|
|
55952
|
+
}
|
|
55953
|
+
}).define(async (ctx) => {
|
|
55954
|
+
const cnb = await cnbManager.getContext(ctx);
|
|
55955
|
+
const slug = ctx.query?.slug;
|
|
55956
|
+
const type = ctx.query?.type;
|
|
55957
|
+
const name21 = ctx.query?.name;
|
|
55958
|
+
if (!slug) {
|
|
55959
|
+
ctx.throw(400, "缺少参数 slug");
|
|
55960
|
+
}
|
|
55961
|
+
if (!type) {
|
|
55962
|
+
ctx.throw(400, "缺少参数 type");
|
|
55963
|
+
}
|
|
55964
|
+
if (!name21) {
|
|
55965
|
+
ctx.throw(400, "缺少参数 name");
|
|
55966
|
+
}
|
|
55967
|
+
const res = await cnb.packages.package.getOne(slug, type, name21);
|
|
55968
|
+
ctx.forward(res);
|
|
55969
|
+
}).addTo(app);
|
|
55970
|
+
app.route({
|
|
55971
|
+
path: "cnb",
|
|
55972
|
+
key: "delete-package",
|
|
55973
|
+
description: "删除制品, 参数 slug, type, name",
|
|
55974
|
+
middleware: ["auth"],
|
|
55975
|
+
metadata: {
|
|
55976
|
+
tags: ["package"],
|
|
55977
|
+
...createSkill({
|
|
55978
|
+
skill: "delete-package",
|
|
55979
|
+
title: "删除制品",
|
|
55980
|
+
args: {
|
|
55981
|
+
slug: exports_external2.string().describe("资源路径, 如 my-org/my-registry"),
|
|
55982
|
+
type: exports_external2.string().describe("制品类型"),
|
|
55983
|
+
name: exports_external2.string().describe("制品名称")
|
|
55984
|
+
},
|
|
55985
|
+
summary: "删除指定的制品"
|
|
55986
|
+
})
|
|
55987
|
+
}
|
|
55988
|
+
}).define(async (ctx) => {
|
|
55989
|
+
const cnb = await cnbManager.getContext(ctx);
|
|
55990
|
+
const slug = ctx.query?.slug;
|
|
55991
|
+
const type = ctx.query?.type;
|
|
55992
|
+
const name21 = ctx.query?.name;
|
|
55993
|
+
if (!slug) {
|
|
55994
|
+
ctx.throw(400, "缺少参数 slug");
|
|
55995
|
+
}
|
|
55996
|
+
if (!type) {
|
|
55997
|
+
ctx.throw(400, "缺少参数 type");
|
|
55998
|
+
}
|
|
55999
|
+
if (!name21) {
|
|
56000
|
+
ctx.throw(400, "缺少参数 name");
|
|
56001
|
+
}
|
|
56002
|
+
const res = await cnb.packages.package.remove(slug, type, name21);
|
|
56003
|
+
ctx.forward(res);
|
|
56004
|
+
}).addTo(app);
|
|
56005
|
+
app.route({
|
|
56006
|
+
path: "cnb",
|
|
56007
|
+
key: "list-package-tags",
|
|
56008
|
+
description: "获取制品标签列表, 参数 slug, type, name",
|
|
56009
|
+
middleware: ["auth"],
|
|
56010
|
+
metadata: {
|
|
56011
|
+
tags: ["package"],
|
|
56012
|
+
...createSkill({
|
|
56013
|
+
skill: "list-package-tags",
|
|
56014
|
+
title: "获取制品标签列表",
|
|
56015
|
+
args: {
|
|
56016
|
+
slug: exports_external2.string().describe("资源路径, 如 my-org/my-registry"),
|
|
56017
|
+
type: exports_external2.string().describe("制品类型"),
|
|
56018
|
+
name: exports_external2.string().describe("制品名称"),
|
|
56019
|
+
page: exports_external2.number().describe("页码").optional(),
|
|
56020
|
+
page_size: exports_external2.number().describe("每页数量").optional()
|
|
56021
|
+
},
|
|
56022
|
+
summary: "获取制品的标签列表"
|
|
56023
|
+
})
|
|
56024
|
+
}
|
|
56025
|
+
}).define(async (ctx) => {
|
|
56026
|
+
const cnb = await cnbManager.getContext(ctx);
|
|
56027
|
+
const slug = ctx.query?.slug;
|
|
56028
|
+
const type = ctx.query?.type;
|
|
56029
|
+
const name21 = ctx.query?.name;
|
|
56030
|
+
const { page, page_size } = ctx.query || {};
|
|
56031
|
+
if (!slug) {
|
|
56032
|
+
ctx.throw(400, "缺少参数 slug");
|
|
56033
|
+
}
|
|
56034
|
+
if (!type) {
|
|
56035
|
+
ctx.throw(400, "缺少参数 type");
|
|
56036
|
+
}
|
|
56037
|
+
if (!name21) {
|
|
56038
|
+
ctx.throw(400, "缺少参数 name");
|
|
56039
|
+
}
|
|
56040
|
+
const res = await cnb.packages.package.listTags(slug, type, name21, { page, page_size });
|
|
56041
|
+
ctx.forward(res);
|
|
56042
|
+
}).addTo(app);
|
|
56043
|
+
app.route({
|
|
56044
|
+
path: "cnb",
|
|
56045
|
+
key: "get-package-tag",
|
|
56046
|
+
description: "获取制品标签详情, 参数 slug, type, name, tag",
|
|
56047
|
+
middleware: ["auth"],
|
|
56048
|
+
metadata: {
|
|
56049
|
+
tags: ["package"],
|
|
56050
|
+
...createSkill({
|
|
56051
|
+
skill: "get-package-tag",
|
|
56052
|
+
title: "获取制品标签详情",
|
|
56053
|
+
args: {
|
|
56054
|
+
slug: exports_external2.string().describe("资源路径, 如 my-org/my-registry"),
|
|
56055
|
+
type: exports_external2.string().describe("制品类型"),
|
|
56056
|
+
name: exports_external2.string().describe("制品名称"),
|
|
56057
|
+
tag: exports_external2.string().describe("标签名称")
|
|
56058
|
+
},
|
|
56059
|
+
summary: "获取制品标签的详细信息"
|
|
56060
|
+
})
|
|
56061
|
+
}
|
|
56062
|
+
}).define(async (ctx) => {
|
|
56063
|
+
const cnb = await cnbManager.getContext(ctx);
|
|
56064
|
+
const slug = ctx.query?.slug;
|
|
56065
|
+
const type = ctx.query?.type;
|
|
56066
|
+
const name21 = ctx.query?.name;
|
|
56067
|
+
const tag = ctx.query?.tag;
|
|
56068
|
+
if (!slug) {
|
|
56069
|
+
ctx.throw(400, "缺少参数 slug");
|
|
56070
|
+
}
|
|
56071
|
+
if (!type) {
|
|
56072
|
+
ctx.throw(400, "缺少参数 type");
|
|
56073
|
+
}
|
|
56074
|
+
if (!name21) {
|
|
56075
|
+
ctx.throw(400, "缺少参数 name");
|
|
56076
|
+
}
|
|
56077
|
+
if (!tag) {
|
|
56078
|
+
ctx.throw(400, "缺少参数 tag");
|
|
56079
|
+
}
|
|
56080
|
+
const res = await cnb.packages.package.getTag(slug, type, name21, tag);
|
|
56081
|
+
ctx.forward(res);
|
|
56082
|
+
}).addTo(app);
|
|
56083
|
+
app.route({
|
|
56084
|
+
path: "cnb",
|
|
56085
|
+
key: "delete-package-tag",
|
|
56086
|
+
description: "删除制品标签, 参数 slug, type, name, tag",
|
|
56087
|
+
middleware: ["auth"],
|
|
56088
|
+
metadata: {
|
|
56089
|
+
tags: ["package"],
|
|
56090
|
+
...createSkill({
|
|
56091
|
+
skill: "delete-package-tag",
|
|
56092
|
+
title: "删除制品标签",
|
|
56093
|
+
args: {
|
|
56094
|
+
slug: exports_external2.string().describe("资源路径, 如 my-org/my-registry"),
|
|
56095
|
+
type: exports_external2.string().describe("制品类型"),
|
|
56096
|
+
name: exports_external2.string().describe("制品名称"),
|
|
56097
|
+
tag: exports_external2.string().describe("标签名称")
|
|
56098
|
+
},
|
|
56099
|
+
summary: "删除制品的指定标签"
|
|
56100
|
+
})
|
|
56101
|
+
}
|
|
56102
|
+
}).define(async (ctx) => {
|
|
56103
|
+
const cnb = await cnbManager.getContext(ctx);
|
|
56104
|
+
const slug = ctx.query?.slug;
|
|
56105
|
+
const type = ctx.query?.type;
|
|
56106
|
+
const name21 = ctx.query?.name;
|
|
56107
|
+
const tag = ctx.query?.tag;
|
|
56108
|
+
if (!slug) {
|
|
56109
|
+
ctx.throw(400, "缺少参数 slug");
|
|
56110
|
+
}
|
|
56111
|
+
if (!type) {
|
|
56112
|
+
ctx.throw(400, "缺少参数 type");
|
|
56113
|
+
}
|
|
56114
|
+
if (!name21) {
|
|
56115
|
+
ctx.throw(400, "缺少参数 name");
|
|
56116
|
+
}
|
|
56117
|
+
if (!tag) {
|
|
56118
|
+
ctx.throw(400, "缺少参数 tag");
|
|
56119
|
+
}
|
|
56120
|
+
const res = await cnb.packages.package.removeTag(slug, type, name21, tag);
|
|
56121
|
+
ctx.forward(res);
|
|
56122
|
+
}).addTo(app);
|
|
56123
|
+
|
|
55648
56124
|
// agent/routes/index.ts
|
|
55649
56125
|
var checkAppId = (ctx, appId) => {
|
|
55650
56126
|
const _appId = ctx?.app?.appId;
|