@builder.io/ai-utils 0.69.0 → 0.71.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/ai-utils",
3
- "version": "0.69.0",
3
+ "version": "0.71.0",
4
4
  "description": "Builder.io AI utils",
5
5
  "files": [
6
6
  "src"
package/src/codegen.d.ts CHANGED
@@ -221,6 +221,8 @@ export declare const DevServerControlInputSchema: z.ZodObject<{
221
221
  export type DevServerControlInput = z.infer<typeof DevServerControlInputSchema>;
222
222
  export declare const DevServerLogsInputSchema: z.ZodObject<{}, z.core.$strip>;
223
223
  export type DevServerLogsInput = z.infer<typeof DevServerLogsInputSchema>;
224
+ export declare const GenerateDesignSystemAgentMdInputSchema: z.ZodObject<{}, z.core.$strip>;
225
+ export type GenerateDesignSystemAgentMdInput = z.infer<typeof GenerateDesignSystemAgentMdInputSchema>;
224
226
  export declare const DevServerRestartInputSchema: z.ZodObject<{}, z.core.$strip>;
225
227
  export type DevServerRestartInput = z.infer<typeof DevServerRestartInputSchema>;
226
228
  export declare const BashToolInputSchema: z.ZodObject<{
@@ -486,6 +488,7 @@ export declare const TimelineEventCategorySchema: z.ZodEnum<{
486
488
  milestone: "milestone";
487
489
  navigation: "navigation";
488
490
  observation: "observation";
491
+ verified: "verified";
489
492
  }>;
490
493
  export type TimelineEventCategory = z.infer<typeof TimelineEventCategorySchema>;
491
494
  export declare const TestOutcomeSchema: z.ZodEnum<{
@@ -519,8 +522,10 @@ export declare const RecordFrameToolInputSchema: z.ZodObject<{
519
522
  milestone: "milestone";
520
523
  navigation: "navigation";
521
524
  observation: "observation";
525
+ verified: "verified";
522
526
  }>>;
523
527
  description: z.ZodOptional<z.ZodString>;
528
+ pr_highlight: z.ZodOptional<z.ZodBoolean>;
524
529
  }, z.core.$strip>;
525
530
  export type RecordFrameToolInput = z.infer<typeof RecordFrameToolInputSchema>;
526
531
  export declare const ReportTestOutcomeToolInputSchema: z.ZodObject<{
@@ -580,6 +585,8 @@ export interface TimelineFrameMetadata {
580
585
  displayDurationMs: number;
581
586
  fileName?: string;
582
587
  image_url?: string;
588
+ prHighlight?: boolean;
589
+ description?: string;
583
590
  cursorX?: number | null;
584
591
  cursorY?: number | null;
585
592
  viewportWidth?: number;
@@ -1587,8 +1594,10 @@ export declare const CodeGenToolMapSchema: z.ZodObject<{
1587
1594
  milestone: "milestone";
1588
1595
  navigation: "navigation";
1589
1596
  observation: "observation";
1597
+ verified: "verified";
1590
1598
  }>>;
1591
1599
  description: z.ZodOptional<z.ZodString>;
1600
+ pr_highlight: z.ZodOptional<z.ZodBoolean>;
1592
1601
  }, z.core.$strip>;
1593
1602
  SubmitPRReview: z.ZodObject<{
1594
1603
  summary: z.ZodString;
@@ -1901,6 +1910,7 @@ export declare const CodeGenToolMapSchema: z.ZodObject<{
1901
1910
  builder_user_id: z.ZodOptional<z.ZodString>;
1902
1911
  draft: z.ZodOptional<z.ZodBoolean>;
1903
1912
  }, z.core.$strip>;
1913
+ GenerateDesignSystemAgentMd: z.ZodObject<{}, z.core.$strip>;
1904
1914
  }, z.core.$strip>;
1905
1915
  export type CodeGenToolMap = z.infer<typeof CodeGenToolMapSchema>;
1906
1916
  export declare const CodeGenToolsSchema: z.ZodEnum<{
@@ -1923,6 +1933,7 @@ export declare const CodeGenToolsSchema: z.ZodEnum<{
1923
1933
  ExitPlanMode: "ExitPlanMode";
1924
1934
  ExplorationMetadata: "ExplorationMetadata";
1925
1935
  FindMedia: "FindMedia";
1936
+ GenerateDesignSystemAgentMd: "GenerateDesignSystemAgentMd";
1926
1937
  GetAvailableRepos: "GetAvailableRepos";
1927
1938
  GetLastBrowserTest: "GetLastBrowserTest";
1928
1939
  GetScreenshot: "GetScreenshot";
@@ -2639,6 +2650,7 @@ export declare const CodeGenInputOptionsSchema: z.ZodObject<{
2639
2650
  ExitPlanMode: "ExitPlanMode";
2640
2651
  ExplorationMetadata: "ExplorationMetadata";
2641
2652
  FindMedia: "FindMedia";
2653
+ GenerateDesignSystemAgentMd: "GenerateDesignSystemAgentMd";
2642
2654
  GetAvailableRepos: "GetAvailableRepos";
2643
2655
  GetLastBrowserTest: "GetLastBrowserTest";
2644
2656
  GetScreenshot: "GetScreenshot";
package/src/codegen.js CHANGED
@@ -190,6 +190,15 @@ export const DevServerControlInputSchema = z
190
190
  export const DevServerLogsInputSchema = z
191
191
  .object({})
192
192
  .meta({ title: "DevServerLogsInput" });
193
+ export const GenerateDesignSystemAgentMdInputSchema = z.object({}).meta({
194
+ title: "GenerateDesignSystemAgentMdInput",
195
+ description: "Generates and writes `.builder/output/AGENT.md` from the token and component" +
196
+ " CSS files produced during DSI approximation indexing. Reads" +
197
+ " `.builder/sources/figma/manifest.json` for the design system name," +
198
+ " `.builder/output/_index/tokens-report.json` for token categories, and" +
199
+ " globs `.builder/output/tokens/components/*.css` for component slugs." +
200
+ " Call this as the final step after all CSS files have been written.",
201
+ });
193
202
  export const DevServerRestartInputSchema = z.object({}).meta({
194
203
  title: "DevServerRestartInput",
195
204
  description: "Restarts the dev server with current configuration.",
@@ -609,6 +618,7 @@ export const TimelineEventCategorySchema = z
609
618
  "milestone",
610
619
  "code-change",
611
620
  "observation",
621
+ "verified",
612
622
  ])
613
623
  .meta({ title: "TimelineEventCategory" });
614
624
  export const TestOutcomeSchema = z
@@ -642,6 +652,9 @@ export const RecordFrameToolInputSchema = z
642
652
  description: z.string().optional().meta({
643
653
  description: "Optional longer description providing context about what this frame shows.",
644
654
  }),
655
+ pr_highlight: z.boolean().optional().meta({
656
+ description: "Set true to mark this as a 'verified screenshot' worth showing in the PR description — i.e. visual proof of how the fix/feature behaves. Use sparingly (1–3 per session) for the key moments that demonstrate the feature working. The title is used as the caption.",
657
+ }),
645
658
  })
646
659
  .meta({ title: "RecordFrameToolInput" });
647
660
  export const ReportTestOutcomeToolInputSchema = z
@@ -1485,6 +1498,7 @@ export const CodeGenToolMapSchema = z.object({
1485
1498
  PullPrototype: PullPrototypeToolInputSchema,
1486
1499
  ConnectMCP: ConnectMCPToolInputSchema,
1487
1500
  EnsurePR: EnsurePRToolInputSchema,
1501
+ GenerateDesignSystemAgentMd: GenerateDesignSystemAgentMdInputSchema,
1488
1502
  });
1489
1503
  export const CodeGenToolsSchema = CodeGenToolMapSchema.keyof().meta({
1490
1504
  title: "CodeGenTools",
@@ -25,6 +25,8 @@ export interface GenerateDesignSystemFormFields {
25
25
  */
26
26
  selection?: Record<string, string[]>;
27
27
  githubRepoUrl?: string;
28
+ /** Id of a connected Fusion project whose repo is cloned as supplementary context. Takes precedence over `githubRepoUrl`. */
29
+ connectedProjectId?: string;
28
30
  }
29
31
  /**
30
32
  * Accepts `https://github.com/<owner>/<repo>` (optionally with a trailing
@@ -68,5 +70,6 @@ export declare const generateDesignSystemBodySchema: z.ZodObject<{
68
70
  devToolsVersion: z.ZodOptional<z.ZodString>;
69
71
  selection: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>>;
70
72
  githubRepoUrl: z.ZodOptional<z.ZodString>;
73
+ connectedProjectId: z.ZodOptional<z.ZodString>;
71
74
  }, z.core.$strip>;
72
75
  export type GenerateDesignSystemBody = z.infer<typeof generateDesignSystemBodySchema>;
@@ -38,4 +38,5 @@ export const generateDesignSystemBodySchema = z.object({
38
38
  .trim()
39
39
  .regex(GITHUB_REPO_URL_REGEX, "must be a public github.com repo URL")
40
40
  .optional(),
41
+ connectedProjectId: z.string().trim().min(1).max(128).optional(),
41
42
  });
package/src/events.d.ts CHANGED
@@ -1058,6 +1058,8 @@ export type FigmaDecodeJobV1 = FusionEventVariant<"figma.decode.job", {
1058
1058
  * `.builder/sources/<repo>/` at hydration time.
1059
1059
  */
1060
1060
  githubRepoUrl?: string;
1061
+ /** Id of a connected Fusion project whose repo is cloned at hydration time. Takes precedence over `githubRepoUrl`. */
1062
+ connectedProjectId?: string;
1061
1063
  devToolsVersion?: string;
1062
1064
  /**
1063
1065
  * Optional map of `.fig` filename → page/frame GUID keys
@@ -1087,6 +1089,10 @@ export interface FigmaDecodeJobDoc {
1087
1089
  branchName: string | null;
1088
1090
  branchUrl: string | null;
1089
1091
  error: string | null;
1092
+ /** Worker failure count; the handler retries while this is under the cap. */
1093
+ attempts?: number;
1094
+ /** True if any frame chunk upload failed but the job still completed. */
1095
+ partialFailure?: boolean;
1090
1096
  createdAt: number;
1091
1097
  updatedAt: number;
1092
1098
  }
@@ -1096,6 +1102,8 @@ export interface FigmaFrameManifestEntry {
1096
1102
  htmlGcsPath: string;
1097
1103
  screenshotGcsPath: string | null;
1098
1104
  htmlSizeBytes: number;
1105
+ /** True if this frame's HTML upload failed after retry; HTML may be missing. */
1106
+ uploadError?: boolean;
1099
1107
  }
1100
1108
  export interface FigmaFrameAsset {
1101
1109
  /** Bucket-relative GCS path. */
@@ -1116,9 +1124,16 @@ export interface FigmaTextSource {
1116
1124
  sizeBytes: number;
1117
1125
  }
1118
1126
  export interface FigmaGithubRepoSource {
1127
+ /** Clone URL. For connected repos, an authenticated URL is swapped in at hydration time; no token is persisted. */
1119
1128
  url: string;
1120
1129
  /** Directory name under `.builder/sources/` to clone into. */
1121
1130
  localDir: string;
1131
+ /** Set for connected Fusion projects; used at hydration to mint an authenticated clone URL. */
1132
+ connectedProjectId?: string;
1133
+ /** Git provider of a connected repo (e.g. "github", "gitlab"). */
1134
+ provider?: string;
1135
+ /** "owner/repo" of a connected repo. */
1136
+ repoFullName?: string;
1122
1137
  }
1123
1138
  export interface FigmaFrameManifest {
1124
1139
  jobId: string;
@@ -1128,8 +1143,10 @@ export interface FigmaFrameManifest {
1128
1143
  assets?: FigmaFrameAsset[];
1129
1144
  /** Uploaded plain-text / markdown supplementary sources. */
1130
1145
  textSources?: FigmaTextSource[];
1131
- /** Optional public GitHub repo to clone as supplementary context. */
1146
+ /** Optional public or connected repo to clone as supplementary context. */
1132
1147
  githubRepo?: FigmaGithubRepoSource;
1148
+ /** True if one or more frame chunk uploads failed; some frames may be missing. */
1149
+ partialFailure?: boolean;
1133
1150
  }
1134
1151
  export type PrReviewRequestedV1 = FusionEventVariant<"pr.review.requested", {
1135
1152
  repoFullName: string;
package/src/projects.d.ts CHANGED
@@ -880,6 +880,8 @@ export interface ProjectDatabase {
880
880
  role: string;
881
881
  /** @internal Plaintext credential — Firestore IAM enforces access. Never serialize to client responses. */
882
882
  password: string;
883
+ /** Database name (white-labeled to "main"); needed to build connection URIs. */
884
+ database: string;
883
885
  region: string;
884
886
  createdAt: number;
885
887
  createdBy: string;