@builder.io/ai-utils 0.74.1 → 0.74.2
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/package.json +1 -1
- package/src/codegen.d.ts +20 -2
- package/src/codegen.js +24 -3
package/package.json
CHANGED
package/src/codegen.d.ts
CHANGED
|
@@ -1317,7 +1317,16 @@ export type SubmitPRReviewToolInput = z.infer<typeof SubmitPRReviewToolInputSche
|
|
|
1317
1317
|
export declare const AddCommentToolInputSchema: z.ZodObject<{
|
|
1318
1318
|
type: z.ZodString;
|
|
1319
1319
|
content: z.ZodString;
|
|
1320
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
1320
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
1321
|
+
filePath: z.ZodOptional<z.ZodString>;
|
|
1322
|
+
startLine: z.ZodOptional<z.ZodNumber>;
|
|
1323
|
+
endLine: z.ZodOptional<z.ZodNumber>;
|
|
1324
|
+
severity: z.ZodOptional<z.ZodEnum<{
|
|
1325
|
+
high: "high";
|
|
1326
|
+
low: "low";
|
|
1327
|
+
medium: "medium";
|
|
1328
|
+
}>>;
|
|
1329
|
+
}, z.core.$loose>>;
|
|
1321
1330
|
}, z.core.$strip>;
|
|
1322
1331
|
export type AddCommentToolInput = Omit<z.infer<typeof AddCommentToolInputSchema>, "metadata"> & {
|
|
1323
1332
|
metadata?: AddedCommentMetadata;
|
|
@@ -1669,7 +1678,16 @@ export declare const CodeGenToolMapSchema: z.ZodObject<{
|
|
|
1669
1678
|
AddComment: z.ZodObject<{
|
|
1670
1679
|
type: z.ZodString;
|
|
1671
1680
|
content: z.ZodString;
|
|
1672
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
1681
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
1682
|
+
filePath: z.ZodOptional<z.ZodString>;
|
|
1683
|
+
startLine: z.ZodOptional<z.ZodNumber>;
|
|
1684
|
+
endLine: z.ZodOptional<z.ZodNumber>;
|
|
1685
|
+
severity: z.ZodOptional<z.ZodEnum<{
|
|
1686
|
+
high: "high";
|
|
1687
|
+
low: "low";
|
|
1688
|
+
medium: "medium";
|
|
1689
|
+
}>>;
|
|
1690
|
+
}, z.core.$loose>>;
|
|
1673
1691
|
}, z.core.$strip>;
|
|
1674
1692
|
ProposeConfig: z.ZodObject<{
|
|
1675
1693
|
config: z.ZodObject<{
|
package/src/codegen.js
CHANGED
|
@@ -1362,9 +1362,30 @@ export const AddCommentToolInputSchema = z
|
|
|
1362
1362
|
}),
|
|
1363
1363
|
// `looseObject` (not `z.record`) so the JSON schema emits
|
|
1364
1364
|
// `additionalProperties` rather than `propertyNames`, which OpenAI's strict
|
|
1365
|
-
// tool-schema mode rejects.
|
|
1366
|
-
|
|
1367
|
-
|
|
1365
|
+
// tool-schema mode rejects. The location fields are declared explicitly
|
|
1366
|
+
// (rather than left to an open object) because typed fields get filled far
|
|
1367
|
+
// more consistently by the model. They are optional in the schema since
|
|
1368
|
+
// `metadata` is shared across comment types; for 'code-review', filePath and
|
|
1369
|
+
// startLine are enforced as required server-side (see AddComment tool).
|
|
1370
|
+
metadata: z
|
|
1371
|
+
.looseObject({
|
|
1372
|
+
filePath: z.string().min(1).optional().meta({
|
|
1373
|
+
description: "Project-relative file path the comment refers to. Required for 'code-review'.",
|
|
1374
|
+
}),
|
|
1375
|
+
startLine: z.number().int().positive().optional().meta({
|
|
1376
|
+
description: "1-indexed start line the comment refers to. Required for 'code-review'. Use the [L:N] markers from the annotated diff.",
|
|
1377
|
+
}),
|
|
1378
|
+
endLine: z.number().int().positive().optional().meta({
|
|
1379
|
+
description: "1-indexed end line; defaults to startLine when omitted.",
|
|
1380
|
+
}),
|
|
1381
|
+
severity: z
|
|
1382
|
+
.enum(["high", "medium", "low"])
|
|
1383
|
+
.optional()
|
|
1384
|
+
.meta({ description: "Finding severity for 'code-review'." }),
|
|
1385
|
+
})
|
|
1386
|
+
.optional()
|
|
1387
|
+
.meta({
|
|
1388
|
+
description: "Type-specific fields. For 'code-review': filePath and startLine are required; endLine and severity are optional. originalSnippet is populated automatically.",
|
|
1368
1389
|
}),
|
|
1369
1390
|
})
|
|
1370
1391
|
.meta({ title: "AddCommentToolInput" });
|