@builder.io/ai-utils 0.105.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.105.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>;
@@ -2319,6 +2328,7 @@ export declare const PublishAgentMessageRequestSchema: z.ZodObject<{
2319
2328
  }, z.core.$strip>]>>>;
2320
2329
  requireConfirmation: z.ZodOptional<z.ZodBoolean>;
2321
2330
  skippedMCPs: z.ZodOptional<z.ZodArray<z.ZodString>>;
2331
+ customInstructions: z.ZodOptional<z.ZodString>;
2322
2332
  }, z.core.$strip>;
2323
2333
  export type PublishAgentMessageRequest = z.infer<typeof PublishAgentMessageRequestSchema>;
2324
2334
  export declare const RepoIndexingConfigSchema: z.ZodObject<{
@@ -4496,6 +4506,8 @@ export interface FusionConfig {
4496
4506
  branchFriendlyName?: string;
4497
4507
  sessionId?: string;
4498
4508
  browserAutomationInstructions?: string;
4509
+ /** Start a headed Chromium in the container, driven from scripts over DevTools. */
4510
+ branchBrowser?: boolean;
4499
4511
  /** Whether this branch is for a code review - affects enabled agents and tools */
4500
4512
  branchType?: BranchType;
4501
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" }),
@@ -1824,6 +1837,9 @@ export const PublishAgentMessageRequestSchema = z
1824
1837
  skippedMCPs: z.array(z.string()).optional().meta({
1825
1838
  description: "Per-message denylist of MCP server ids to skip, e.g. a 'disable for this session' UI toggle.",
1826
1839
  }),
1840
+ customInstructions: z.string().max(100000).optional().meta({
1841
+ description: "The organization's Publish Agent instructions, applied as an always-on rule. Send on every request, including tool-result continuations.",
1842
+ }),
1827
1843
  })
1828
1844
  .refine(({ message, toolResults }) => Boolean(message) || Boolean(toolResults === null || toolResults === void 0 ? void 0 : toolResults.length), {
1829
1845
  path: ["message"],
@@ -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/events.d.ts CHANGED
@@ -943,6 +943,45 @@ export declare const FusionContainerFailedV1: {
943
943
  eventName: "fusion.container.failed";
944
944
  version: "1";
945
945
  };
946
+ /**
947
+ * Why the preview never came up. A closed set so the funnel can group by it;
948
+ * the detail belongs in the container's logs.
949
+ */
950
+ export type FusionPreviewFailureReason = "http-4xx" | "http-5xx" | "unreachable" | "dev-command-failed";
951
+ /**
952
+ * The first moment the user has something to look at. Deliberately not a reuse
953
+ * of `FusionContainerStartedV1`, which only means the box booted: conflating
954
+ * the two makes preview failure unmeasurable, since a container that serves
955
+ * nothing looks identical to a healthy one.
956
+ */
957
+ export type FusionPreviewReadyV1 = FusionEventVariant<"fusion.preview.ready", {
958
+ projectId: string;
959
+ branchName: string;
960
+ /** ms from the dev server being started to its first successful response. */
961
+ durationMs?: number;
962
+ }, {
963
+ projectId: string;
964
+ branchName: string;
965
+ }, 1>;
966
+ export declare const FusionPreviewReadyV1: {
967
+ eventName: "fusion.preview.ready";
968
+ version: "1";
969
+ };
970
+ /** The counterpart to {@link FusionPreviewReadyV1}: the preview never came up. */
971
+ export type FusionPreviewFailedV1 = FusionEventVariant<"fusion.preview.failed", {
972
+ projectId: string;
973
+ branchName: string;
974
+ reason: FusionPreviewFailureReason;
975
+ /** ms from the dev server being started to the failure being called. */
976
+ durationMs?: number;
977
+ }, {
978
+ projectId: string;
979
+ branchName: string;
980
+ }, 1>;
981
+ export declare const FusionPreviewFailedV1: {
982
+ eventName: "fusion.preview.failed";
983
+ version: "1";
984
+ };
946
985
  export type FusionBranchFailedV1 = FusionEventVariant<"fusion.branch.failed", {
947
986
  projectId: string;
948
987
  branchName?: string;
@@ -1460,7 +1499,7 @@ export declare const HostingCustomDomainDelegationCheckV1: {
1460
1499
  eventName: "hosting.custom-domain.delegation-check";
1461
1500
  version: "1";
1462
1501
  };
1463
- export type FusionEvent = ClientDevtoolsSessionStartedEvent | ClientDevtoolsSessionIdleEventV1 | ClientDevtoolsToolCallRequestV1 | ClientDevtoolsToolCallV1 | ClientDevtoolsToolResultV1 | ClientDevtoolsBuildMigratedV1 | ClientDevtoolsBuildCompletedV1 | ClientDevtoolsBuildUploadedV1 | ClientDevtoolsBuildFailedV1 | FusionProjectCreatedV1 | FusionShapeIssuedV1 | FusionShapeAssembledV1 | FusionShapeResolvedV1 | FusionShapeQuestionAnsweredV1 | FusionShapeQuestionSkippedV1 | SetupAgentCompletedV1 | GitPrMergedV1 | GitPrCreatedV1 | GitPrClosedV1 | ForceSetupAgentV1 | ClawMessageSentV1 | CodegenCompletionV1 | CodegenUserPromptV1 | GitWebhooksRegisterV1 | FusionProjectSettingsUpdatedV1 | VideoRecordingCompletedV1 | TimelineRecordingReadyV1 | FusionBranchCreatedV1 | FusionContainerStartedV1 | FusionContainerFailedV1 | FusionBranchFailedV1 | BotMentionGitHubExternalPrV1 | BotMentionGitHubInternalPrV1 | BotMentionGitLabPrV1 | BotMentionBitbucketPrV1 | BotMentionAzurePrV1 | ReviewSubmittedV1 | PrReviewRequestedV1 | FigmaDecodeJobV1 | ProjectSnapshotRefreshV1 | ProjectSnapshotGoldenWatchdogV1 | ProjectSnapshotGoldenRetryV1 | ProjectSnapshotCapturedV1 | ProjectSnapshotCreatedV1 | ProjectSnapshotFailedV1 | ProjectSnapshotReadyCheckV1 | ProjectSnapshotPodWatchV1 | McpPrototypePulledV1 | HostingCustomDomainCertCheckV1 | HostingCustomDomainServingCheckV1 | HostingCustomDomainDelegationCheckV1;
1502
+ export type FusionEvent = ClientDevtoolsSessionStartedEvent | ClientDevtoolsSessionIdleEventV1 | ClientDevtoolsToolCallRequestV1 | ClientDevtoolsToolCallV1 | ClientDevtoolsToolResultV1 | ClientDevtoolsBuildMigratedV1 | ClientDevtoolsBuildCompletedV1 | ClientDevtoolsBuildUploadedV1 | ClientDevtoolsBuildFailedV1 | FusionProjectCreatedV1 | FusionShapeIssuedV1 | FusionShapeAssembledV1 | FusionShapeResolvedV1 | FusionShapeQuestionAnsweredV1 | FusionShapeQuestionSkippedV1 | SetupAgentCompletedV1 | GitPrMergedV1 | GitPrCreatedV1 | GitPrClosedV1 | ForceSetupAgentV1 | ClawMessageSentV1 | CodegenCompletionV1 | CodegenUserPromptV1 | GitWebhooksRegisterV1 | FusionProjectSettingsUpdatedV1 | VideoRecordingCompletedV1 | TimelineRecordingReadyV1 | FusionBranchCreatedV1 | FusionContainerStartedV1 | FusionContainerFailedV1 | FusionPreviewReadyV1 | FusionPreviewFailedV1 | FusionBranchFailedV1 | BotMentionGitHubExternalPrV1 | BotMentionGitHubInternalPrV1 | BotMentionGitLabPrV1 | BotMentionBitbucketPrV1 | BotMentionAzurePrV1 | ReviewSubmittedV1 | PrReviewRequestedV1 | FigmaDecodeJobV1 | ProjectSnapshotRefreshV1 | ProjectSnapshotGoldenWatchdogV1 | ProjectSnapshotGoldenRetryV1 | ProjectSnapshotCapturedV1 | ProjectSnapshotCreatedV1 | ProjectSnapshotFailedV1 | ProjectSnapshotReadyCheckV1 | ProjectSnapshotPodWatchV1 | McpPrototypePulledV1 | HostingCustomDomainCertCheckV1 | HostingCustomDomainServingCheckV1 | HostingCustomDomainDelegationCheckV1;
1464
1503
  export interface ModelPermissionRequiredEvent {
1465
1504
  type: "assistant.model.permission.required";
1466
1505
  data: {
package/src/events.js CHANGED
@@ -106,6 +106,14 @@ export const FusionContainerFailedV1 = {
106
106
  eventName: "fusion.container.failed",
107
107
  version: "1",
108
108
  };
109
+ export const FusionPreviewReadyV1 = {
110
+ eventName: "fusion.preview.ready",
111
+ version: "1",
112
+ };
113
+ export const FusionPreviewFailedV1 = {
114
+ eventName: "fusion.preview.failed",
115
+ version: "1",
116
+ };
109
117
  export const FusionBranchFailedV1 = {
110
118
  eventName: "fusion.branch.failed",
111
119
  version: "1",
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;