@builder.io/ai-utils 0.66.2 → 0.67.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.66.2",
3
+ "version": "0.67.0",
4
4
  "description": "Builder.io AI utils",
5
5
  "files": [
6
6
  "src"
package/src/codegen.d.ts CHANGED
@@ -2687,6 +2687,7 @@ export declare const CodeGenInputOptionsSchema: z.ZodObject<{
2687
2687
  Write: "Write";
2688
2688
  }>>>;
2689
2689
  enabledMCPs: z.ZodOptional<z.ZodArray<z.ZodString>>;
2690
+ skippedMCPs: z.ZodOptional<z.ZodArray<z.ZodString>>;
2690
2691
  skipFileDiff: z.ZodOptional<z.ZodBoolean>;
2691
2692
  interruptActiveTask: z.ZodOptional<z.ZodBoolean>;
2692
2693
  localMCPTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -3482,6 +3483,7 @@ export declare const GenerateUserMessageSchema: z.ZodObject<{
3482
3483
  updateLastCommits: z.ZodOptional<z.ZodBoolean>;
3483
3484
  }, z.core.$strip>>;
3484
3485
  enabledMCPs: z.ZodOptional<z.ZodArray<z.ZodString>>;
3486
+ skippedMCPs: z.ZodOptional<z.ZodArray<z.ZodString>>;
3485
3487
  sessionMode: z.ZodOptional<z.ZodEnum<{
3486
3488
  "auto-planning": "auto-planning";
3487
3489
  "deep-research": "deep-research";
@@ -3522,6 +3524,7 @@ export interface UserInput {
3522
3524
  agentModelOverrides?: AgentModelOverrides;
3523
3525
  category?: CodeGenCategory;
3524
3526
  enabledMCPs?: string[];
3527
+ skippedMCPs?: string[];
3525
3528
  /** @deprecated */
3526
3529
  repair?: boolean;
3527
3530
  }
@@ -3989,6 +3992,12 @@ export interface FusionConfig {
3989
3992
  browserAutomationInstructions?: string;
3990
3993
  /** Whether this branch is for a code review - affects enabled agents and tools */
3991
3994
  branchType?: BranchType;
3995
+ /**
3996
+ * When set, launch.ts hydrates `.builder/figma/<...>` from the corresponding
3997
+ * GCS frame manifest before the agent starts. Only used on
3998
+ * `branchType === "design-system-indexing"` branches.
3999
+ */
4000
+ figmaDecodeJobId?: string;
3992
4001
  featureBranch?: string;
3993
4002
  aiBranch?: string;
3994
4003
  /** Whether this is a fork PR - affects git operations (read-only, can't push) */
package/src/codegen.js CHANGED
@@ -1761,6 +1761,9 @@ export const CodeGenInputOptionsSchema = z
1761
1761
  recommendedRoot: z.string().optional(),
1762
1762
  enabledTools: z.array(CodeGenToolsSchema).optional(),
1763
1763
  enabledMCPs: z.array(z.string()).optional(),
1764
+ skippedMCPs: z.array(z.string()).optional().meta({
1765
+ description: "Per-message denylist of MCP server ids to skip. Skipped servers are not mounted or connected for this message and will not trigger an `mcp-auth-required` event. Tokens and org-level enabled state are untouched; this is purely message-scoped.",
1766
+ }),
1764
1767
  skipFileDiff: z.boolean().optional(),
1765
1768
  interruptActiveTask: z.boolean().optional().meta({
1766
1769
  description: "When true, the agent should interrupt its current task to handle this message immediately, rather than finishing the current task first.",
@@ -1858,6 +1861,9 @@ export const GenerateUserMessageSchema = z
1858
1861
  autoPush: AutoPushModeSchema.optional(),
1859
1862
  syncChanges: SyncChangesFromRemoteSchema.optional(),
1860
1863
  enabledMCPs: z.array(z.string()).optional(),
1864
+ skippedMCPs: z.array(z.string()).optional().meta({
1865
+ description: "Per-message denylist of MCP server names to skip. Skipped servers are not mounted or connected for this message and will not trigger an `mcp-auth-required` event. Tokens and org-level enabled state are untouched; this is purely message-scoped.",
1866
+ }),
1861
1867
  sessionMode: SessionModeSchema.optional(),
1862
1868
  queue: z.boolean().optional(),
1863
1869
  agentType: z.string().optional().meta({
@@ -1,4 +1,16 @@
1
1
  import { z } from "zod";
2
+ export interface FigmaHydrationFile {
3
+ /** Relative path to write under `.builder/figma/`. */
4
+ localPath: string;
5
+ downloadUrl: string;
6
+ contentType: string;
7
+ }
8
+ export interface FigmaHydrationResponse {
9
+ jobId: string;
10
+ status: "pending" | "processing" | "complete" | "error";
11
+ manifest: import("./events.js").FigmaFrameManifest | null;
12
+ files: FigmaHydrationFile[];
13
+ }
2
14
  export type GenerateDesignSystemAttachmentKind = "fig" | "image" | "pdf" | "text";
3
15
  export interface GenerateDesignSystemFormFields {
4
16
  /**
@@ -6,6 +18,7 @@ export interface GenerateDesignSystemFormFields {
6
18
  * the uploaded `.fig` filenames.
7
19
  */
8
20
  projectName?: string;
21
+ devToolsVersion?: string;
9
22
  /**
10
23
  * Optional map of filename → page/frame GUIDs to restrict indexing.
11
24
  * GUIDs are file-local, so they must be scoped per attachment.
@@ -21,8 +34,13 @@ export interface GenerateDesignSystemRequest extends GenerateDesignSystemFormFie
21
34
  }
22
35
  export interface GenerateDesignSystemResponse {
23
36
  projectId: string;
24
- branchName: string;
25
- branchUrl: string;
37
+ /**
38
+ * Decode job id. The .fig file is decoded asynchronously in the
39
+ * `ai-queue-subscribers` worker. Clients should listen on the
40
+ * `figmaDecodeJobs/{jobId}` Firestore document for progress and the
41
+ * resolved `branchName` / `branchUrl`.
42
+ */
43
+ jobId: string;
26
44
  }
27
45
  export interface GenerateDesignSystemErrorResponse {
28
46
  error: string | Record<string, unknown>;
@@ -39,6 +57,7 @@ export declare const GENERATE_DESIGN_SYSTEM_MIN_ATTACHMENTS = 1;
39
57
  */
40
58
  export declare const generateDesignSystemBodySchema: z.ZodObject<{
41
59
  projectName: z.ZodOptional<z.ZodString>;
60
+ devToolsVersion: z.ZodOptional<z.ZodString>;
42
61
  selection: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>>;
43
62
  }, z.core.$strip>;
44
63
  export type GenerateDesignSystemBody = z.infer<typeof generateDesignSystemBodySchema>;
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- export const GENERATE_DESIGN_SYSTEM_MAX_FILE_BYTES = 200 * 1024 * 1024;
2
+ export const GENERATE_DESIGN_SYSTEM_MAX_FILE_BYTES = 2 * 1024 * 1024 * 1024;
3
3
  export const GENERATE_DESIGN_SYSTEM_MAX_ATTACHMENTS = 50;
4
4
  export const GENERATE_DESIGN_SYSTEM_MIN_ATTACHMENTS = 1;
5
5
  /**
@@ -11,6 +11,7 @@ export const GENERATE_DESIGN_SYSTEM_MIN_ATTACHMENTS = 1;
11
11
  */
12
12
  export const generateDesignSystemBodySchema = z.object({
13
13
  projectName: z.string().trim().min(1).max(200).optional(),
14
+ devToolsVersion: z.string().trim().min(1).max(64).optional(),
14
15
  selection: z
15
16
  .preprocess((v) => {
16
17
  if (typeof v !== "string")
package/src/events.d.ts CHANGED
@@ -896,6 +896,69 @@ export interface SendMessageToOrgAgentInput {
896
896
  */
897
897
  autoCreateProject?: boolean;
898
898
  }
899
+ export type FigmaDecodeJobV1 = FusionEventVariant<"figma.decode.job", {
900
+ jobId: string;
901
+ projectId: string;
902
+ projectName: string;
903
+ figmaName: string;
904
+ /**
905
+ * GCS object paths (relative to the configured bucket) of every attachment
906
+ * uploaded for this job. The worker streams these back down, runs
907
+ * `figProcessor.extract()` on the `.fig` entries, and forwards the rest as
908
+ * `FileUpload` attachments to the agent's initial message.
909
+ */
910
+ attachmentGcsPaths: Array<{
911
+ kind: "fig" | "image" | "pdf" | "text";
912
+ originalName: string;
913
+ gcsPath: string;
914
+ mimetype: string;
915
+ size: number;
916
+ }>;
917
+ devToolsVersion?: string;
918
+ }, {}, 1>;
919
+ export declare const FigmaDecodeJobV1: {
920
+ eventName: "figma.decode.job";
921
+ version: "1";
922
+ };
923
+ export interface FigmaDecodeJobDoc {
924
+ jobId: string;
925
+ ownerId: string;
926
+ userId?: string;
927
+ superuser?: Superuser;
928
+ projectId: string;
929
+ projectName: string;
930
+ figmaName: string;
931
+ status: "pending" | "processing" | "complete" | "error";
932
+ framesProcessed: number;
933
+ totalFrames: number;
934
+ manifestGcsPath: string | null;
935
+ branchName: string | null;
936
+ branchUrl: string | null;
937
+ error: string | null;
938
+ createdAt: number;
939
+ updatedAt: number;
940
+ }
941
+ export interface FigmaFrameManifestEntry {
942
+ index: number;
943
+ frameName: string;
944
+ htmlGcsPath: string;
945
+ screenshotGcsPath: string | null;
946
+ htmlSizeBytes: number;
947
+ }
948
+ export interface FigmaFrameAsset {
949
+ /** Bucket-relative GCS path. */
950
+ gcsPath: string;
951
+ /** Relative path under `.builder/figma/` (e.g. `images/abc123.png`). */
952
+ localPath: string;
953
+ contentType: string;
954
+ }
955
+ export interface FigmaFrameManifest {
956
+ jobId: string;
957
+ figmaName: string;
958
+ frames: FigmaFrameManifestEntry[];
959
+ /** Raster assets referenced by frame HTML via relative `images/…` URLs. */
960
+ assets?: FigmaFrameAsset[];
961
+ }
899
962
  export type PrReviewRequestedV1 = FusionEventVariant<"pr.review.requested", {
900
963
  repoFullName: string;
901
964
  repoHtmlUrl?: string;
@@ -967,7 +1030,7 @@ export declare const ClientDevtoolsToolResultV1: {
967
1030
  eventName: "client.devtools.tool.result";
968
1031
  version: "1";
969
1032
  };
970
- export type FusionEvent = ClientDevtoolsSessionStartedEvent | ClientDevtoolsSessionIdleEventV1 | ClientDevtoolsToolCallRequestV1 | ClientDevtoolsToolCallV1 | ClientDevtoolsToolResultV1 | FusionProjectCreatedV1 | SetupAgentCompletedV1 | GitPrMergedV1 | GitPrCreatedV1 | GitPrClosedV1 | ForceSetupAgentV1 | ClawMessageSentV1 | CodegenCompletionV1 | CodegenUserPromptV1 | GitWebhooksRegisterV1 | FusionProjectSettingsUpdatedV1 | VideoRecordingCompletedV1 | TimelineRecordingReadyV1 | FusionBranchCreatedV1 | FusionContainerStartedV1 | FusionContainerFailedV1 | FusionBranchFailedV1 | BotMentionExternalPrV1 | ReviewSubmittedV1 | PrReviewRequestedV1 | ProjectSnapshotRefreshV1 | ProjectSnapshotCapturedV1 | ProjectSnapshotCreatedV1 | ProjectSnapshotFailedV1 | ProjectSnapshotReadyCheckV1 | ProjectSnapshotPodWatchV1;
1033
+ export type FusionEvent = ClientDevtoolsSessionStartedEvent | ClientDevtoolsSessionIdleEventV1 | ClientDevtoolsToolCallRequestV1 | ClientDevtoolsToolCallV1 | ClientDevtoolsToolResultV1 | FusionProjectCreatedV1 | SetupAgentCompletedV1 | GitPrMergedV1 | GitPrCreatedV1 | GitPrClosedV1 | ForceSetupAgentV1 | ClawMessageSentV1 | CodegenCompletionV1 | CodegenUserPromptV1 | GitWebhooksRegisterV1 | FusionProjectSettingsUpdatedV1 | VideoRecordingCompletedV1 | TimelineRecordingReadyV1 | FusionBranchCreatedV1 | FusionContainerStartedV1 | FusionContainerFailedV1 | FusionBranchFailedV1 | BotMentionExternalPrV1 | ReviewSubmittedV1 | PrReviewRequestedV1 | FigmaDecodeJobV1 | ProjectSnapshotRefreshV1 | ProjectSnapshotCapturedV1 | ProjectSnapshotCreatedV1 | ProjectSnapshotFailedV1 | ProjectSnapshotReadyCheckV1 | ProjectSnapshotPodWatchV1;
971
1034
  export interface ModelPermissionRequiredEvent {
972
1035
  type: "assistant.model.permission.required";
973
1036
  data: {
package/src/events.js CHANGED
@@ -106,6 +106,10 @@ export const TimelineRecordingReadyV1 = {
106
106
  eventName: "timeline.recording.ready",
107
107
  version: "1",
108
108
  };
109
+ export const FigmaDecodeJobV1 = {
110
+ eventName: "figma.decode.job",
111
+ version: "1",
112
+ };
109
113
  export const PrReviewRequestedV1 = {
110
114
  eventName: "pr.review.requested",
111
115
  version: "1",
package/src/projects.js CHANGED
@@ -36,7 +36,11 @@ export const EXAMPLE_REPOS = [
36
36
  ];
37
37
  export const STARTER_REPO = "BuilderIO/fusion-starter";
38
38
  export const DSI_PREVIEW_REPO = "BuilderIO/dsi-starter";
39
- export const EXAMPLE_OR_STARTER_REPOS = [...EXAMPLE_REPOS, STARTER_REPO];
39
+ export const EXAMPLE_OR_STARTER_REPOS = [
40
+ ...EXAMPLE_REPOS,
41
+ STARTER_REPO,
42
+ DSI_PREVIEW_REPO,
43
+ ];
40
44
  export const EXAMPLE_OR_STARTER_REPOS_URLS = EXAMPLE_OR_STARTER_REPOS.map((repo) => `https://github.com/${repo}`);
41
45
  export const checkIsNewBranch = (branch) => {
42
46
  return "projectId" in branch;
@@ -105,6 +105,8 @@ export interface AddDesignSystemInput {
105
105
  gitOriginUrl: string | undefined;
106
106
  gitRelativePath: string | undefined;
107
107
  cliArgs: string[];
108
+ projectId?: string;
109
+ branchName?: string;
108
110
  }
109
111
  export interface UpdateDesignSystemInput {
110
112
  id: string;
@@ -133,6 +135,8 @@ export interface DesignSystem {
133
135
  gitRelativePath: string | undefined;
134
136
  cliArgs: string[];
135
137
  source: "custom" | "auto";
138
+ projectId?: string;
139
+ branchName?: string;
136
140
  }
137
141
  export interface DisplayDesignSystem extends DesignSystem {
138
142
  docCount: number;