@builder.io/ai-utils 0.11.26-0 → 0.11.27

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.11.26-0",
3
+ "version": "0.11.27",
4
4
  "description": "Builder.io AI utils",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/codegen.d.ts CHANGED
@@ -849,6 +849,9 @@ export interface GitBackupDownloadUrlResult {
849
849
  partial: boolean;
850
850
  }
851
851
  export interface BranchBackup {
852
+ projectId: string;
853
+ ownerId: string;
854
+ branchName: string;
852
855
  at: number;
853
856
  size: number;
854
857
  gitBranchName: string;
@@ -971,6 +974,18 @@ export interface EnvironmentVariable {
971
974
  value: string;
972
975
  isSecret: boolean;
973
976
  }
977
+ export interface FileOverride {
978
+ /**
979
+ * Absolute path where the file should be written in the container.
980
+ * Example: "/app/.env", "/etc/config/app.conf"
981
+ */
982
+ path: string;
983
+ /**
984
+ * Content to write to the file.
985
+ * Can be plain text or binary content (base64 encoded if needed).
986
+ */
987
+ content: string;
988
+ }
974
989
  export interface FusionConfig {
975
990
  devCommand?: string;
976
991
  checkCommand?: string;
@@ -1041,6 +1056,12 @@ export interface FusionConfig {
1041
1056
  * @default false
1042
1057
  */
1043
1058
  autoConfigureHosts?: boolean;
1059
+ /**
1060
+ * Array of files to inject into the container during setup.
1061
+ * These files will be written before setupCommand or devCommand is executed.
1062
+ * Useful for configuration files, credentials, or environment-specific overrides.
1063
+ */
1064
+ fileOverrides?: FileOverride[];
1044
1065
  /**
1045
1066
  * Local MCP server configurations.
1046
1067
  * Servers defined here will be merged with servers from mcp.json.
@@ -1052,6 +1073,10 @@ export interface FusionConfig {
1052
1073
  env?: Record<string, string>;
1053
1074
  envFile?: string;
1054
1075
  }>;
1076
+ /**
1077
+ * List of built-in tools to disable.
1078
+ */
1079
+ disabledTools?: string[];
1055
1080
  /** @deprecated use devCommand */
1056
1081
  command?: string;
1057
1082
  }
@@ -1192,6 +1217,7 @@ export interface CodegenApiTerminal {
1192
1217
  export interface SetupCommandResult {
1193
1218
  code: number | null;
1194
1219
  output: string;
1220
+ capturedEnv?: Record<string, string>;
1195
1221
  }
1196
1222
  export type DevCommandResult = DevCommandResultSuccess | DevCommandResultFailure;
1197
1223
  export interface DevCommandResultSuccess {
package/src/index.d.ts CHANGED
@@ -8,4 +8,3 @@ export * from "./projects.js";
8
8
  export * from "./repo-indexing.js";
9
9
  export * from "./organization.js";
10
10
  export * from "./features.js";
11
- export * from "./fusion.js";
package/src/index.js CHANGED
@@ -8,4 +8,3 @@ export * from "./projects.js";
8
8
  export * from "./repo-indexing.js";
9
9
  export * from "./organization.js";
10
10
  export * from "./features.js";
11
- export * from "./fusion.js";
package/src/projects.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { LaunchServerState, LaunchServerStatus } from "./codegen";
1
+ import type { FileOverride, EnvironmentVariable, LaunchServerState, LaunchServerStatus, BranchBackup } from "./codegen";
2
2
  export interface ConfigStatus {
3
3
  isReady: boolean;
4
4
  lastUpdated: string;
@@ -85,6 +85,7 @@ export interface ErrorMessage extends BaseMessage {
85
85
  error: string;
86
86
  details?: any;
87
87
  message?: string;
88
+ code?: string;
88
89
  }
89
90
  export interface InfoMessage extends BaseMessage {
90
91
  type: "info";
@@ -134,7 +135,7 @@ export interface ReadyMessage extends BaseMessage {
134
135
  }
135
136
  export type MachineState = "unknown" | "created" | "starting" | "started" | "stopping" | "stopped" | "suspending" | "suspended" | "replacing" | "destroying" | "destroyed" | "not-found" | "running" | "failed";
136
137
  export type FlyVolumeState = "unknown" | "creating" | "created" | "extending" | "restoring" | "enabling_remote_export" | "hydrating" | "recovering" | "scheduling_destroy" | "pending_destroy" | "failed";
137
- export type GitAuthErrorCode = "git-auth-failed" | "git-auth-failed-root-repo" | "git-auth-failed-folder-added-by" | "git-auth-failed-folder-created-by" | "git-auth-failed-folder-server-token" | "git-auth-failed-root-repo-server-token";
138
+ export type GitAuthErrorCode = "git-auth-failed" | "git-auth-failed-root-repo" | "git-auth-failed-folder-added-by" | "git-auth-failed-folder-created-by" | "git-auth-failed-repo-not-found" | "git-auth-failed-folder-server-token" | "git-auth-failed-root-repo-server-token";
138
139
  export type EnsureContainerErrorCode = "FAILED_TO_START_MACHINE_ERROR" | "FLY_APP_CHECK_ERROR" | "FLY_CAPACITY_ERROR" | "FLY_PERMISSIONS_TOKEN_ERROR" | "FLY_VOLUME_CREATE_ERROR" | "FLY_VOLUME_FORK_ERROR" | "FLY_VOLUME_DELETE_RECENTLY_FORKED_ERROR" | "FLY_MACHINE_CREATE_ERROR" | "FLY_VOLUME_CHECK_ERROR" | "FLY_NON_MOUNTABLE_VOLUME_ERROR" | "FLY_DEPRECATED_REGION_ERROR" | "FLY_VOLUME_NOT_FOUND" | "FLY_MACHINE_LIMIT_ERROR" | "KUBE_CAPACITY_ERROR" | "KUBE_PERMISSIONS_ERROR" | "KUBE_POD_LIMIT_ERROR" | "KUBE_RESOURCE_QUOTA_ERROR" | "KUBE_NAMESPACE_CHECK_ERROR" | "KUBE_PVC_CREATE_ERROR" | "KUBE_PVC_CHECK_ERROR" | "KUBE_POD_CREATE_ERROR" | "KUBE_SERVICE_CREATE_ERROR" | "KUBE_INGRESS_CREATE_ERROR" | "KUBE_POD_FAILED_TO_START_ERROR" | "ensure-checking-existing-machines" | "found-multiple-failed-machine" | "maximun-retries-machine-creation" | GitAuthErrorCode | "unknown" | "project-bad-state" | "project-not-found" | "project-branch-not-found" | "project-branch-no-session-id" | "project-repo-full-name-not-found" | "project-org-not-found" | "invalid-project-repo-url-already-in-use" | "no-available-regions" | "invalid-backup-without-volume-id" | "missing-app-with-machine-or-volume" | "update-branch-info-in-firebase" | "update-branch-app-name-in-firebase" | `machine-status-polling-${MachineState}` | `machine-image-exited-immediately` | `volume-not-found-${FlyVolumeState}` | "trying-to-remove-used-volume" | "timeout" | "fatal:zod-validation-error" | `fatal:${string}`;
139
140
  export interface ErrorStateMessage extends BaseMessage {
140
141
  state: "error";
@@ -254,4 +255,191 @@ export interface SetupScriptDependency {
254
255
  name: string;
255
256
  script: string;
256
257
  }
258
+ export type FusionExecutionEnvironment = "containerized" | "container-less" | "cloud";
259
+ export interface PartialBranchData {
260
+ name?: string;
261
+ createdBy: string;
262
+ friendlyName: string;
263
+ isDefault: boolean;
264
+ isPublic: boolean;
265
+ lockedFusionEnvironment: FusionExecutionEnvironment;
266
+ metadata?: Record<string, unknown>;
267
+ backup?: BranchBackup;
268
+ gitAiBranch?: string | null;
269
+ lastCommitHash?: string | null;
270
+ lastCommitDate?: number | null;
271
+ commitMode?: "commits" | "draft-prs" | "prs";
272
+ useHomeDir?: boolean;
273
+ cloneFrom?: {
274
+ projectId: string;
275
+ branchName: string;
276
+ };
277
+ }
278
+ export interface Branch {
279
+ lockedFusionEnvironment?: FusionExecutionEnvironment;
280
+ id?: string;
281
+ appName?: string | null;
282
+ prNumber?: number | null;
283
+ prUrl?: string | null;
284
+ machineId?: string | null;
285
+ lastMachineIdRemovedAt?: number | null;
286
+ volumeId?: string | null;
287
+ secondaryVolumeId?: string | null;
288
+ volumeName?: string | null;
289
+ gitAiBranch?: string | null;
290
+ lastCommitHash?: string | null;
291
+ lastCommitDate?: number | null;
292
+ lastServerState?: LaunchServerState | null;
293
+ lastServerStateDate?: number | null;
294
+ lastServerVersion?: string | null;
295
+ name?: string;
296
+ createdBy?: string;
297
+ isPublic?: boolean;
298
+ isDefault?: boolean;
299
+ sessionId?: string;
300
+ createdAt?: number | null;
301
+ friendlyName?: string;
302
+ useHomeDir?: boolean;
303
+ useCloudHomeDir?: boolean;
304
+ ipv4?: {
305
+ address: string | null;
306
+ allocated: boolean | null;
307
+ } | null;
308
+ ipv6?: {
309
+ address: string | null;
310
+ allocated: boolean | null;
311
+ } | null;
312
+ preRecoveryData?: Partial<Branch> & {
313
+ recoveryDate: Date;
314
+ };
315
+ backup?: BranchBackup;
316
+ metadata?: Record<string, unknown>;
317
+ needsCleanup?: boolean;
318
+ deleted?: boolean;
319
+ updatedAt?: string;
320
+ commitMode?: "commits" | "draft-prs" | "prs";
321
+ kubePodName?: string | null;
322
+ kubeNamespace?: string | null;
323
+ kubePvcName?: string | null;
324
+ kubeHostname?: string | null;
325
+ }
326
+ export type CpuKind = "performance" | "shared";
327
+ export type MachineAutoStop = "stop" | "off" | "suspend";
328
+ export interface Project {
329
+ id: string;
330
+ name: string;
331
+ ownerId: string;
332
+ repoFullName: string | undefined;
333
+ repoProvider: string;
334
+ repoProtocol: string | undefined;
335
+ repoDescription?: string;
336
+ repoPrivate: boolean;
337
+ repoUrl: string | undefined;
338
+ createdDate: string;
339
+ updatedAt: string;
340
+ pinned?: boolean;
341
+ archived?: boolean;
342
+ createdBy: string;
343
+ checkRunCounts?: Record<string, number>;
344
+ repoAddedBy?: string;
345
+ pipelineCounts?: Record<string, number>;
346
+ needSetup?: boolean;
347
+ domains?: string[];
348
+ settings: {
349
+ autoDetectDevServer?: boolean;
350
+ autoDetectDevServerPatterns?: string[];
351
+ fusionEnvironment?: FusionExecutionEnvironment;
352
+ devServerPort?: number;
353
+ devServerUrl?: string;
354
+ refreshPreview?: boolean;
355
+ installCommand?: string;
356
+ gitBranchNamingStrategy?: "ai-session" | "branch-name" | "custom";
357
+ setupDependencies?: SetupDependency[];
358
+ gitBranchNamingCustom?: string;
359
+ devServerCommand?: string;
360
+ memoryLimit?: 1024 | 2048 | 4096 | 8192 | 16384;
361
+ cpuKind?: CpuKind;
362
+ autoStop?: MachineAutoStop;
363
+ mainBranchName?: string;
364
+ minMachinesRunning?: number;
365
+ volumeSize?: 5 | 10 | 12 | 15 | 20;
366
+ includePath?: string;
367
+ includePatterns?: string[];
368
+ environmentVariables?: EnvironmentVariable[];
369
+ fileOverrides?: FileOverride[];
370
+ commitMode?: "commits" | "draft-prs" | "prs";
371
+ dockerImagePath?: string;
372
+ nodeVersion?: string;
373
+ designSystems?: string[];
374
+ useNI?: boolean;
375
+ folders?: Array<{
376
+ name: string;
377
+ remoteUrl: string;
378
+ mainBranchName?: string;
379
+ includePath?: string;
380
+ addedBy?: string;
381
+ repoProvider?: string;
382
+ repoProtocol?: string;
383
+ }>;
384
+ agentsMD?: string;
385
+ initializationCommand?: string;
386
+ repoSubpath?: string;
387
+ recommendedRoot?: string;
388
+ https?: boolean;
389
+ localHttpsDomain?: string;
390
+ httpsServerKeyPath?: string;
391
+ httpsServerCertPath?: string;
392
+ httpsServerCaPath?: string;
393
+ httpsServerKeyContent?: string;
394
+ httpsServerCertContent?: string;
395
+ httpsServerCaContent?: string;
396
+ httpsServerPfx?: string;
397
+ httpsServerPassphrase?: string;
398
+ httpsServerSecureProtocol?: string;
399
+ httpsServerSecureOptions?: number;
400
+ httpsServerCiphers?: string;
401
+ httpsServerHonorCipherOrder?: boolean;
402
+ httpsServerRequestCert?: boolean;
403
+ httpsServerRejectUnauthorized?: boolean;
404
+ };
405
+ screenshot: string | null;
406
+ isExample?: boolean;
407
+ isPublic?: boolean;
408
+ snapshotVolume?: {
409
+ volumeId: string;
410
+ appName: string;
411
+ createdAt: number;
412
+ };
413
+ isFromUserTemplate?: boolean;
414
+ templateId?: string | null;
415
+ localPath?: string | null;
416
+ }
417
+ export interface ProjectWithBranches extends Project {
418
+ branches: Record<string, Branch>;
419
+ }
420
+ export interface OrganizationPrivate {
421
+ ownerId: string;
422
+ id: string;
423
+ installs?: {
424
+ ids: number[];
425
+ host: string;
426
+ }[];
427
+ createdAt: number;
428
+ updatedAt: number;
429
+ }
430
+ export interface CreateProjectOptions {
431
+ name: string;
432
+ repoFullName: string;
433
+ repoProvider: string;
434
+ repoProtocol: string;
435
+ repoDescription?: string;
436
+ repoPrivate: boolean;
437
+ repoUrl: string;
438
+ needSetup: boolean;
439
+ domains?: string[];
440
+ settings?: Partial<Project["settings"]>;
441
+ isPublic?: boolean;
442
+ isExample?: boolean;
443
+ templateId?: string;
444
+ }
257
445
  export {};
package/src/fusion.d.ts DELETED
@@ -1,160 +0,0 @@
1
- import type { BranchBackup, EnvironmentVariable, LaunchServerState, SetupDependency } from "./index.js";
2
- export type FusionExecutionEnvironment = "containerized" | "container-less" | "cloud";
3
- export interface PartialBranchData {
4
- name?: string;
5
- createdBy: string;
6
- friendlyName: string;
7
- isDefault: boolean;
8
- isPublic: boolean;
9
- lockedFusionEnvironment: FusionExecutionEnvironment;
10
- metadata?: Record<string, unknown>;
11
- useHomeDir?: boolean;
12
- }
13
- export interface Branch {
14
- lockedFusionEnvironment?: FusionExecutionEnvironment;
15
- id?: string;
16
- appName?: string | null;
17
- prNumber?: number | null;
18
- prUrl?: string | null;
19
- machineId?: string | null;
20
- lastMachineIdRemovedAt?: number | null;
21
- volumeId?: string | null;
22
- secondaryVolumeId?: string | null;
23
- volumeName?: string | null;
24
- gitAiBranch?: string | null;
25
- lastCommitHash?: string | null;
26
- lastCommitDate?: number | null;
27
- lastServerState?: LaunchServerState | null;
28
- lastServerStateDate?: number | null;
29
- lastServerVersion?: string | null;
30
- name?: string;
31
- createdBy?: string;
32
- isPublic?: boolean;
33
- isDefault?: boolean;
34
- sessionId?: string;
35
- createdAt?: number | null;
36
- friendlyName?: string;
37
- useHomeDir?: boolean;
38
- ipv4?: {
39
- address: string | null;
40
- allocated: boolean | null;
41
- } | null;
42
- ipv6?: {
43
- address: string | null;
44
- allocated: boolean | null;
45
- } | null;
46
- preRecoveryData?: Partial<Branch> & {
47
- recoveryDate: Date;
48
- };
49
- backup?: BranchBackup;
50
- metadata?: Record<string, unknown>;
51
- needsCleanup?: boolean;
52
- deleted?: boolean;
53
- updatedAt?: string;
54
- commitMode?: "commits" | "draft-prs" | "prs";
55
- kubePodName?: string | null;
56
- kubeNamespace?: string | null;
57
- kubePvcName?: string | null;
58
- kubeHostname?: string | null;
59
- }
60
- export type CpuKind = "performance" | "shared";
61
- export type MachineAutoStop = "stop" | "off" | "suspend";
62
- export interface Project {
63
- id: string;
64
- name: string;
65
- ownerId: string;
66
- repoFullName: string | undefined;
67
- repoProvider: string;
68
- repoProtocol: string | undefined;
69
- repoDescription?: string;
70
- repoPrivate: boolean;
71
- repoUrl: string | undefined;
72
- createdDate: string;
73
- updatedAt: string;
74
- pinned?: boolean;
75
- archived?: boolean;
76
- createdBy: string;
77
- checkRunCounts?: Record<string, number>;
78
- repoAddedBy?: string;
79
- pipelineCounts?: Record<string, number>;
80
- needSetup?: boolean;
81
- domains?: string[];
82
- settings: {
83
- autoDetectDevServer?: boolean;
84
- autoDetectDevServerPatterns?: string[];
85
- fusionEnvironment?: FusionExecutionEnvironment;
86
- devServerPort?: number;
87
- devServerUrl?: string;
88
- refreshPreview?: boolean;
89
- installCommand?: string;
90
- gitBranchNamingStrategy?: "ai-session" | "branch-name" | "custom";
91
- setupDependencies?: SetupDependency[];
92
- gitBranchNamingCustom?: string;
93
- devServerCommand?: string;
94
- memoryLimit?: 1024 | 2048 | 4096 | 8192 | 16384;
95
- cpuKind?: CpuKind;
96
- autoStop?: MachineAutoStop;
97
- mainBranchName?: string;
98
- minMachinesRunning?: number;
99
- volumeSize?: 5 | 10 | 12 | 15 | 20;
100
- includePath?: string;
101
- includePatterns?: string[];
102
- environmentVariables?: EnvironmentVariable[];
103
- commitMode?: "commits" | "draft-prs" | "prs";
104
- dockerImagePath?: string;
105
- nodeVersion?: string;
106
- designSystems?: string[];
107
- useNI?: boolean;
108
- folders?: Array<{
109
- name: string;
110
- remoteUrl: string;
111
- mainBranchName?: string;
112
- includePath?: string;
113
- addedBy?: string;
114
- repoProvider?: string;
115
- repoProtocol?: string;
116
- }>;
117
- agentsMD?: string;
118
- initializationCommand?: string;
119
- repoSubpath?: string;
120
- recommendedRoot?: string;
121
- https?: boolean;
122
- localHttpsDomain?: string;
123
- httpsServerKeyPath?: string;
124
- httpsServerCertPath?: string;
125
- httpsServerCaPath?: string;
126
- httpsServerKeyContent?: string;
127
- httpsServerCertContent?: string;
128
- httpsServerCaContent?: string;
129
- httpsServerPfx?: string;
130
- httpsServerPassphrase?: string;
131
- httpsServerSecureProtocol?: string;
132
- httpsServerSecureOptions?: number;
133
- httpsServerCiphers?: string;
134
- httpsServerHonorCipherOrder?: boolean;
135
- httpsServerRequestCert?: boolean;
136
- httpsServerRejectUnauthorized?: boolean;
137
- };
138
- screenshot: string | null;
139
- isExample?: boolean;
140
- snapshotVolume?: {
141
- volumeId: string;
142
- appName: string;
143
- createdAt: number;
144
- };
145
- isFromUserTemplate?: boolean;
146
- localPath?: string | null;
147
- }
148
- export interface ProjectWithBranches extends Project {
149
- branches: Record<string, Branch>;
150
- }
151
- export interface OrganizationPrivate {
152
- ownerId: string;
153
- id: string;
154
- installs?: {
155
- ids: number[];
156
- host: string;
157
- }[];
158
- createdAt: number;
159
- updatedAt: number;
160
- }
package/src/fusion.js DELETED
@@ -1 +0,0 @@
1
- export {};