@builder.io/ai-utils 0.106.0 → 0.107.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.106.0",
3
+ "version": "0.107.0",
4
4
  "description": "Builder.io AI utils",
5
5
  "files": [
6
6
  "src"
package/src/codegen.d.ts CHANGED
@@ -125,6 +125,15 @@ export declare const ReadToolInputSchema: z.ZodObject<{
125
125
  limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
126
126
  }, z.core.$strip>;
127
127
  export type ReadToolInput = z.infer<typeof ReadToolInputSchema>;
128
+ /** Image files the Read tool returns as image content instead of rejecting as binary. */
129
+ declare const READ_TOOL_IMAGE_MEDIA_TYPES: {
130
+ readonly ".png": "image/png";
131
+ readonly ".jpg": "image/jpeg";
132
+ readonly ".jpeg": "image/jpeg";
133
+ readonly ".gif": "image/gif";
134
+ readonly ".webp": "image/webp";
135
+ };
136
+ export declare function readToolImageMediaType(filePath: string): (typeof READ_TOOL_IMAGE_MEDIA_TYPES)[keyof typeof READ_TOOL_IMAGE_MEDIA_TYPES] | undefined;
128
137
  export declare const GlobSearchToolInputSchema: z.ZodObject<{
129
138
  pattern: z.ZodString;
130
139
  }, z.core.$strip>;
@@ -4497,6 +4506,8 @@ export interface FusionConfig {
4497
4506
  branchFriendlyName?: string;
4498
4507
  sessionId?: string;
4499
4508
  browserAutomationInstructions?: string;
4509
+ /** Start a headed Chromium in the container, driven from scripts over DevTools. */
4510
+ branchBrowser?: boolean;
4500
4511
  /** Whether this branch is for a code review - affects enabled agents and tools */
4501
4512
  branchType?: BranchType;
4502
4513
  /**
package/src/codegen.js CHANGED
@@ -128,6 +128,19 @@ export const ReadToolInputSchema = z
128
128
  }),
129
129
  })
130
130
  .meta({ title: "ReadToolInput" });
131
+ /** Image files the Read tool returns as image content instead of rejecting as binary. */
132
+ const READ_TOOL_IMAGE_MEDIA_TYPES = {
133
+ ".png": "image/png",
134
+ ".jpg": "image/jpeg",
135
+ ".jpeg": "image/jpeg",
136
+ ".gif": "image/gif",
137
+ ".webp": "image/webp",
138
+ };
139
+ export function readToolImageMediaType(filePath) {
140
+ const lower = filePath.toLowerCase();
141
+ const ext = lower.slice(lower.lastIndexOf("."));
142
+ return READ_TOOL_IMAGE_MEDIA_TYPES[ext];
143
+ }
131
144
  export const GlobSearchToolInputSchema = z
132
145
  .object({
133
146
  pattern: z.string().meta({ description: "The pattern to search for" }),
@@ -7,6 +7,11 @@ export declare const EnvironmentVariableSchema: z.ZodObject<{
7
7
  explanation: z.ZodOptional<z.ZodString>;
8
8
  }, z.core.$strip>;
9
9
  export type EnvironmentVariable = z.infer<typeof EnvironmentVariableSchema>;
10
+ export declare const NETLIFY_PRODUCTION_ENV_VALUE_MAX_LENGTH = 5000;
11
+ export declare function getOversizedProductionEnvVar(entries: ReadonlyArray<EnvironmentVariable> | undefined): {
12
+ key: string;
13
+ length: number;
14
+ } | undefined;
10
15
  export declare const SetupMiseDependencySchema: z.ZodObject<{
11
16
  key: z.ZodString;
12
17
  type: z.ZodLiteral<"mise">;
@@ -19,6 +19,18 @@ export const EnvironmentVariableSchema = z
19
19
  }),
20
20
  })
21
21
  .meta({ title: "EnvironmentVariable" });
22
+ export const NETLIFY_PRODUCTION_ENV_VALUE_MAX_LENGTH = 5000;
23
+ export function getOversizedProductionEnvVar(entries) {
24
+ for (const entry of entries !== null && entries !== void 0 ? entries : []) {
25
+ const key = entry.key.trim();
26
+ if (key &&
27
+ !entry.placeholder &&
28
+ entry.value.length > NETLIFY_PRODUCTION_ENV_VALUE_MAX_LENGTH) {
29
+ return { key, length: entry.value.length };
30
+ }
31
+ }
32
+ return undefined;
33
+ }
22
34
  export const SetupMiseDependencySchema = z
23
35
  .object({
24
36
  key: z.string(),
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+ export declare const BuilderReferralInfoResponseSchema: z.ZodObject<{
3
+ eligible: z.ZodBoolean;
4
+ inviteUrl: z.ZodNullable<z.ZodURL>;
5
+ creditsPerReferral: z.ZodNumber;
6
+ completedReferrals: z.ZodNumber;
7
+ pendingReferrals: z.ZodNumber;
8
+ creditsEarned: z.ZodNumber;
9
+ }, z.core.$strip>;
10
+ export type BuilderReferralInfoResponse = z.infer<typeof BuilderReferralInfoResponseSchema>;
package/src/credits.js ADDED
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+ export const BuilderReferralInfoResponseSchema = z.object({
3
+ eligible: z.boolean(),
4
+ inviteUrl: z.url().nullable(),
5
+ creditsPerReferral: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
6
+ completedReferrals: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
7
+ pendingReferrals: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
8
+ creditsEarned: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
9
+ });
package/src/index.d.ts CHANGED
@@ -22,6 +22,7 @@ export * from "./single-tenancy.js";
22
22
  export * from "./design-systems.js";
23
23
  export * from "./editor-ai.js";
24
24
  export * from "./realtime.js";
25
+ export * from "./credits.js";
25
26
  export * from "./embeddings.js";
26
27
  export * from "./system-one.js";
27
28
  export * from "./mcp-servers.js";
package/src/index.js CHANGED
@@ -22,6 +22,7 @@ export * from "./single-tenancy.js";
22
22
  export * from "./design-systems.js";
23
23
  export * from "./editor-ai.js";
24
24
  export * from "./realtime.js";
25
+ export * from "./credits.js";
25
26
  export * from "./embeddings.js";
26
27
  export * from "./system-one.js";
27
28
  export * from "./mcp-servers.js";
@@ -355,6 +355,7 @@ export interface FeatureMap {
355
355
  performanceInfrastructure?: boolean;
356
356
  previewPasswordProtection?: boolean;
357
357
  siteAccessControl?: boolean;
358
+ hostingCustomDomain?: boolean;
358
359
  publicPreviews?: boolean;
359
360
  privacyMode?: boolean;
360
361
  usageInsights?: boolean;
package/src/projects.d.ts CHANGED
@@ -1434,6 +1434,7 @@ export declare const ProjectSettingsSchema: z.ZodObject<{
1434
1434
  instructions: z.ZodOptional<z.ZodString>;
1435
1435
  authUser: z.ZodOptional<z.ZodString>;
1436
1436
  authPassword: z.ZodOptional<z.ZodString>;
1437
+ branchBrowser: z.ZodOptional<z.ZodBoolean>;
1437
1438
  }, z.core.$strip>>;
1438
1439
  prReviewer: z.ZodOptional<z.ZodObject<{
1439
1440
  enabled: z.ZodBoolean;
@@ -1771,6 +1772,7 @@ export declare const ProjectSettingsExternalSchema: z.ZodObject<{
1771
1772
  instructions: z.ZodOptional<z.ZodString>;
1772
1773
  authUser: z.ZodOptional<z.ZodString>;
1773
1774
  authPassword: z.ZodOptional<z.ZodString>;
1775
+ branchBrowser: z.ZodOptional<z.ZodBoolean>;
1774
1776
  }, z.core.$strip>>;
1775
1777
  prReviewer: z.ZodOptional<z.ZodObject<{
1776
1778
  enabled: z.ZodBoolean;
@@ -2982,6 +2984,7 @@ export declare const UpdateProjectOptionsSchema: z.ZodObject<{
2982
2984
  instructions: z.ZodOptional<z.ZodString>;
2983
2985
  authUser: z.ZodOptional<z.ZodString>;
2984
2986
  authPassword: z.ZodOptional<z.ZodString>;
2987
+ branchBrowser: z.ZodOptional<z.ZodBoolean>;
2985
2988
  }, z.core.$strip>>>;
2986
2989
  prReviewer: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2987
2990
  enabled: z.ZodBoolean;
@@ -3692,6 +3695,8 @@ export declare const HostingDomainSchema: z.ZodObject<{
3692
3695
  routeError: z.ZodOptional<z.ZodString>;
3693
3696
  routeErrorAt: z.ZodOptional<z.ZodNumber>;
3694
3697
  servingConfirmedAt: z.ZodOptional<z.ZodNumber>;
3698
+ certIssue: z.ZodOptional<z.ZodString>;
3699
+ certIssueAt: z.ZodOptional<z.ZodNumber>;
3695
3700
  createdBy: z.ZodString;
3696
3701
  }, z.core.$strip>;
3697
3702
  export type HostingDomain = z.infer<typeof HostingDomainSchema>;
@@ -4274,6 +4279,7 @@ export declare const ProjectTemplateSchema: z.ZodObject<{
4274
4279
  instructions: z.ZodOptional<z.ZodString>;
4275
4280
  authUser: z.ZodOptional<z.ZodString>;
4276
4281
  authPassword: z.ZodOptional<z.ZodString>;
4282
+ branchBrowser: z.ZodOptional<z.ZodBoolean>;
4277
4283
  }, z.core.$strip>>>;
4278
4284
  prReviewer: z.ZodOptional<z.ZodOptional<z.ZodObject<{
4279
4285
  enabled: z.ZodBoolean;
@@ -4699,6 +4705,7 @@ export declare const ProjectTemplateOverridesSchema: z.ZodObject<{
4699
4705
  instructions: z.ZodOptional<z.ZodString>;
4700
4706
  authUser: z.ZodOptional<z.ZodString>;
4701
4707
  authPassword: z.ZodOptional<z.ZodString>;
4708
+ branchBrowser: z.ZodOptional<z.ZodBoolean>;
4702
4709
  }, z.core.$strip>>>;
4703
4710
  prReviewer: z.ZodOptional<z.ZodOptional<z.ZodObject<{
4704
4711
  enabled: z.ZodBoolean;
@@ -5092,6 +5099,7 @@ export declare const CreateProjectTemplateFromProjectOptionsSchema: z.ZodPipe<z.
5092
5099
  instructions: z.ZodOptional<z.ZodString>;
5093
5100
  authUser: z.ZodOptional<z.ZodString>;
5094
5101
  authPassword: z.ZodOptional<z.ZodString>;
5102
+ branchBrowser: z.ZodOptional<z.ZodBoolean>;
5095
5103
  }, z.core.$strip>>>;
5096
5104
  prReviewer: z.ZodOptional<z.ZodOptional<z.ZodObject<{
5097
5105
  enabled: z.ZodBoolean;
@@ -5468,6 +5476,7 @@ export declare const CreateProjectTemplateFromProjectOptionsSchema: z.ZodPipe<z.
5468
5476
  instructions: z.ZodOptional<z.ZodString>;
5469
5477
  authUser: z.ZodOptional<z.ZodString>;
5470
5478
  authPassword: z.ZodOptional<z.ZodString>;
5479
+ branchBrowser: z.ZodOptional<z.ZodBoolean>;
5471
5480
  }, z.core.$strip>>>;
5472
5481
  prReviewer: z.ZodOptional<z.ZodOptional<z.ZodObject<{
5473
5482
  enabled: z.ZodBoolean;
@@ -5740,6 +5749,7 @@ export declare const CreateProjectTemplateFromProjectOptionsSchema: z.ZodPipe<z.
5740
5749
  instructions?: string | undefined;
5741
5750
  authUser?: string | undefined;
5742
5751
  authPassword?: string | undefined;
5752
+ branchBrowser?: boolean | undefined;
5743
5753
  } | undefined;
5744
5754
  prReviewer?: {
5745
5755
  enabled: boolean;
@@ -6008,6 +6018,7 @@ export declare const CreateProjectTemplateFromProjectOptionsSchema: z.ZodPipe<z.
6008
6018
  instructions?: string | undefined;
6009
6019
  authUser?: string | undefined;
6010
6020
  authPassword?: string | undefined;
6021
+ branchBrowser?: boolean | undefined;
6011
6022
  } | undefined;
6012
6023
  prReviewer?: {
6013
6024
  enabled: boolean;
@@ -6270,6 +6281,7 @@ export declare const CreateProjectTemplateFromProjectOptionsSchema: z.ZodPipe<z.
6270
6281
  instructions?: string | undefined;
6271
6282
  authUser?: string | undefined;
6272
6283
  authPassword?: string | undefined;
6284
+ branchBrowser?: boolean | undefined;
6273
6285
  } | undefined;
6274
6286
  prReviewer?: {
6275
6287
  enabled: boolean;
@@ -6693,6 +6705,7 @@ export declare const ListProjectTemplatesResponseSchema: z.ZodObject<{
6693
6705
  instructions: z.ZodOptional<z.ZodString>;
6694
6706
  authUser: z.ZodOptional<z.ZodString>;
6695
6707
  authPassword: z.ZodOptional<z.ZodString>;
6708
+ branchBrowser: z.ZodOptional<z.ZodBoolean>;
6696
6709
  }, z.core.$strip>>>;
6697
6710
  prReviewer: z.ZodOptional<z.ZodOptional<z.ZodObject<{
6698
6711
  enabled: z.ZodBoolean;
@@ -7113,6 +7126,7 @@ export declare const UpdateProjectTemplateOptionsSchema: z.ZodObject<{
7113
7126
  instructions: z.ZodOptional<z.ZodString>;
7114
7127
  authUser: z.ZodOptional<z.ZodString>;
7115
7128
  authPassword: z.ZodOptional<z.ZodString>;
7129
+ branchBrowser: z.ZodOptional<z.ZodBoolean>;
7116
7130
  }, z.core.$strip>>>;
7117
7131
  prReviewer: z.ZodOptional<z.ZodOptional<z.ZodObject<{
7118
7132
  enabled: z.ZodBoolean;
@@ -7525,6 +7539,7 @@ export declare const UpdateProjectTemplateResponseSchema: z.ZodObject<{
7525
7539
  instructions: z.ZodOptional<z.ZodString>;
7526
7540
  authUser: z.ZodOptional<z.ZodString>;
7527
7541
  authPassword: z.ZodOptional<z.ZodString>;
7542
+ branchBrowser: z.ZodOptional<z.ZodBoolean>;
7528
7543
  }, z.core.$strip>>>;
7529
7544
  prReviewer: z.ZodOptional<z.ZodOptional<z.ZodObject<{
7530
7545
  enabled: z.ZodBoolean;
package/src/projects.js CHANGED
@@ -777,6 +777,9 @@ export const ProjectSettingsSchema = z
777
777
  authPassword: z.string().optional().meta({
778
778
  description: "Password for sites requiring authentication.",
779
779
  }),
780
+ branchBrowser: z.boolean().optional().meta({
781
+ description: "Run a headed Chrome inside every cloud branch container, which the agent drives from scripts over DevTools.",
782
+ }),
780
783
  })
781
784
  .optional()
782
785
  .meta({
@@ -2022,7 +2025,13 @@ export const HostingDomainSchema = z.object({
2022
2025
  description: "When `routeError` was last set.",
2023
2026
  }),
2024
2027
  servingConfirmedAt: z.number().optional().meta({
2025
- description: "When the domain was confirmed serving over HTTPS: stamped by the serving-check loop once `https://<domain>/` answers over TLS through a Builder route (or by a healthy route recreate on deploy/repair). Definitive 'serving confirmed' signal for the UI's third setup step, distinct from cert issuance (`status: active`).",
2028
+ description: "When the domain was confirmed serving over HTTPS: stamped by the serving-check loop once `https://<domain>/` answers over TLS through a Builder route (or by a healthy route recreate on deploy/repair on an `active` domain). Definitive 'serving confirmed' signal for the UI's third setup step, distinct from cert issuance (`status: active`). Never set while `provisioning`.",
2029
+ }),
2030
+ certIssue: z.string().optional().meta({
2031
+ description: "Non-fatal, user-facing reason Google's latest certificate domain-authorization attempt failed while the domain is `provisioning` (e.g. the `_acme-challenge` CNAME wasn't found). Google keeps retrying, so `status` stays `provisioning`; this drives a warning on the HTTPS step instead of a silent spinner. Cleared when an attempt stops failing or the cert is issued.",
2032
+ }),
2033
+ certIssueAt: z.number().optional().meta({
2034
+ description: "When `certIssue` was last set.",
2026
2035
  }),
2027
2036
  createdBy: z.string(),
2028
2037
  });
@@ -56,7 +56,13 @@ export interface PrivateLinkEndpoint {
56
56
  */
57
57
  export interface VpcAwsPrivateLink extends VpcConnectionBase {
58
58
  type: "aws-privatelink";
59
- /** Must match the region aws-vpc-module runs in ({@link BUILDER_AWS_REGION}). */
59
+ /**
60
+ * The region the customer's Endpoint Service lives in, as embedded in each
61
+ * `endpoints[].serviceName`. May differ from {@link BUILDER_AWS_REGION}: the
62
+ * interface endpoints always live in Builder's region and reach a remote
63
+ * service via cross-region PrivateLink (`service_region` in aws-vpc-module).
64
+ * Every endpoint in one config shares this region.
65
+ */
60
66
  awsRegion: string;
61
67
  endpoints: PrivateLinkEndpoint[];
62
68
  /**
@@ -219,11 +225,18 @@ export interface SingleTenancyDerivedNames {
219
225
  privateLinkEndpointIps?: Record<string, string[]>;
220
226
  }
221
227
  /**
222
- * The single AWS region Builder's PrivateLink infrastructure runs in. Keep in
223
- * sync with the `aws` provider region in packages/terraform/main.tf — an Endpoint
224
- * Service in another region is unreachable by our interface endpoints.
228
+ * The region Builder's PrivateLink interface endpoints run in. Keep in sync with
229
+ * the `aws` provider region in packages/terraform/main.tf. A customer's Endpoint
230
+ * Service in another region is still reachable via cross-region PrivateLink (the
231
+ * endpoint names it through `service_region`); this constant is only the
232
+ * *consumer* region where our endpoints and their pinned IPs live.
225
233
  */
226
234
  export declare const BUILDER_AWS_REGION = "us-east-1";
235
+ /**
236
+ * AWS region id (e.g. `us-east-1`, `eu-west-2`, `ap-southeast-3`). Used to
237
+ * validate a config's declared service region for cross-region PrivateLink.
238
+ */
239
+ export declare const AWS_REGION_RE: RegExp;
227
240
  /**
228
241
  * AWS-generated VPC Endpoint Service name: `com.amazonaws.vpce.<region>.vpce-svc-<id>`.
229
242
  * The id is 8 or 17 hex chars — AWS resource ids are never a length in between.
@@ -1,9 +1,16 @@
1
1
  /**
2
- * The single AWS region Builder's PrivateLink infrastructure runs in. Keep in
3
- * sync with the `aws` provider region in packages/terraform/main.tf — an Endpoint
4
- * Service in another region is unreachable by our interface endpoints.
2
+ * The region Builder's PrivateLink interface endpoints run in. Keep in sync with
3
+ * the `aws` provider region in packages/terraform/main.tf. A customer's Endpoint
4
+ * Service in another region is still reachable via cross-region PrivateLink (the
5
+ * endpoint names it through `service_region`); this constant is only the
6
+ * *consumer* region where our endpoints and their pinned IPs live.
5
7
  */
6
8
  export const BUILDER_AWS_REGION = "us-east-1";
9
+ /**
10
+ * AWS region id (e.g. `us-east-1`, `eu-west-2`, `ap-southeast-3`). Used to
11
+ * validate a config's declared service region for cross-region PrivateLink.
12
+ */
13
+ export const AWS_REGION_RE = /^[a-z]{2}-[a-z]+-\d$/;
7
14
  /**
8
15
  * AWS-generated VPC Endpoint Service name: `com.amazonaws.vpce.<region>.vpce-svc-<id>`.
9
16
  * The id is 8 or 17 hex chars — AWS resource ids are never a length in between.