@builder.io/ai-utils 0.70.0 → 0.71.1

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.70.0",
3
+ "version": "0.71.1",
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<{
@@ -1908,6 +1910,7 @@ export declare const CodeGenToolMapSchema: z.ZodObject<{
1908
1910
  builder_user_id: z.ZodOptional<z.ZodString>;
1909
1911
  draft: z.ZodOptional<z.ZodBoolean>;
1910
1912
  }, z.core.$strip>;
1913
+ GenerateDesignSystemAgentMd: z.ZodObject<{}, z.core.$strip>;
1911
1914
  }, z.core.$strip>;
1912
1915
  export type CodeGenToolMap = z.infer<typeof CodeGenToolMapSchema>;
1913
1916
  export declare const CodeGenToolsSchema: z.ZodEnum<{
@@ -1930,6 +1933,7 @@ export declare const CodeGenToolsSchema: z.ZodEnum<{
1930
1933
  ExitPlanMode: "ExitPlanMode";
1931
1934
  ExplorationMetadata: "ExplorationMetadata";
1932
1935
  FindMedia: "FindMedia";
1936
+ GenerateDesignSystemAgentMd: "GenerateDesignSystemAgentMd";
1933
1937
  GetAvailableRepos: "GetAvailableRepos";
1934
1938
  GetLastBrowserTest: "GetLastBrowserTest";
1935
1939
  GetScreenshot: "GetScreenshot";
@@ -2646,6 +2650,7 @@ export declare const CodeGenInputOptionsSchema: z.ZodObject<{
2646
2650
  ExitPlanMode: "ExitPlanMode";
2647
2651
  ExplorationMetadata: "ExplorationMetadata";
2648
2652
  FindMedia: "FindMedia";
2653
+ GenerateDesignSystemAgentMd: "GenerateDesignSystemAgentMd";
2649
2654
  GetAvailableRepos: "GetAvailableRepos";
2650
2655
  GetLastBrowserTest: "GetLastBrowserTest";
2651
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/AGENTS.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.",
@@ -1489,6 +1498,7 @@ export const CodeGenToolMapSchema = z.object({
1489
1498
  PullPrototype: PullPrototypeToolInputSchema,
1490
1499
  ConnectMCP: ConnectMCPToolInputSchema,
1491
1500
  EnsurePR: EnsurePRToolInputSchema,
1501
+ GenerateDesignSystemAgentMd: GenerateDesignSystemAgentMdInputSchema,
1492
1502
  });
1493
1503
  export const CodeGenToolsSchema = CodeGenToolMapSchema.keyof().meta({
1494
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
@@ -42,7 +44,7 @@ export interface GenerateDesignSystemRequest extends GenerateDesignSystemFormFie
42
44
  export interface GenerateDesignSystemResponse {
43
45
  projectId: string;
44
46
  /**
45
- * Decode job id. The .fig file is decoded asynchronously in the
47
+ * Decode job id. Attachments are processed asynchronously in the
46
48
  * `ai-queue-subscribers` worker. Clients should listen on the
47
49
  * `figmaDecodeJobs/{jobId}` Firestore document for progress and the
48
50
  * resolved `branchName` / `branchUrl`.
@@ -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;