@builder.io/ai-utils 0.25.2 → 0.25.4

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.25.2",
3
+ "version": "0.25.4",
4
4
  "description": "Builder.io AI utils",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/codegen.d.ts CHANGED
@@ -276,17 +276,24 @@ export interface ProposeConfigToolInput {
276
276
  config: SetupAnalysisValues;
277
277
  message?: string;
278
278
  }
279
- export type SetupValueField = "installCommand" | "devServer" | "validationScript";
279
+ export type SetupValueField = "installCommand" | "devServer" | "validationScript" | "environmentVariables";
280
280
  export interface UpdateSetupValueToolInput {
281
281
  field: SetupValueField;
282
282
  value: {
283
- command: string;
283
+ command?: string;
284
284
  url?: string;
285
285
  port?: number;
286
+ environmentVariables?: Array<{
287
+ key: string;
288
+ description?: string;
289
+ isRequired?: boolean;
290
+ isSecret?: boolean;
291
+ defaultValue?: string | null;
292
+ }>;
286
293
  };
287
294
  reason: string;
288
295
  }
289
- export type ExitState = "verified" | "more-disk" | "more-memory" | "user-question" | "other";
296
+ export type ExitState = "verified" | "more-disk" | "more-memory" | "user-question" | "other" | "started";
290
297
  export interface ExitToolInput {
291
298
  state: ExitState;
292
299
  summary: string;
@@ -554,7 +561,7 @@ export interface CodeGenToolMap {
554
561
  }
555
562
  export type CodeGenTools = keyof CodeGenToolMap;
556
563
  export type AllCodeGenTools = CodeGenTools | "web_search";
557
- export type SessionMode = "planning" | "normal" | "auto-planning";
564
+ export type SessionMode = "planning" | "normal" | "auto-planning" | "deep-research";
558
565
  export type CodeGenMode = "quality" | "quality-v3" | "quality-v4" | "quality-v4-agent";
559
566
  export type BaseCodeGenPosition = "fusion" | "editor-ai" | "repo-indexing" | "cli" | "create-app-firebase" | "create-app-lovable" | "builder-code-panel" | "dsi-mcp";
560
567
  export type CodeGenPosition = BaseCodeGenPosition | `${BaseCodeGenPosition}-agent`;
@@ -1054,9 +1061,16 @@ export interface GenerateCompletionStepUpdateSetupValue {
1054
1061
  type: "update_setup_value";
1055
1062
  field: SetupValueField;
1056
1063
  value: {
1057
- command: string;
1064
+ command?: string;
1058
1065
  url?: string;
1059
1066
  port?: number;
1067
+ environmentVariables?: Array<{
1068
+ key: string;
1069
+ description?: string;
1070
+ isRequired?: boolean;
1071
+ isSecret?: boolean;
1072
+ defaultValue?: string | null;
1073
+ }>;
1060
1074
  };
1061
1075
  reason: string;
1062
1076
  }
package/src/events.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { BuilderContent, BuilderElement } from "@builder.io/sdk";
2
2
  import type { AssistantMessage, AssistantMessageAction } from "./messages.js";
3
3
  import type { AssistantSettings } from "./settings.js";
4
+ import type { ExitState } from "./codegen.js";
4
5
  export type BuilderAssistantEventHandler = (ev: BuilderAssistantEvent) => void;
5
6
  export type BuilderAssistantEvent = AssistantCompletionResultEvent | AssistantErrorEvent | AssistantStreamErrorEvent | AppCloseEvent | AppMessagesClickEvent | AppMessagesGenerationEvent | AppMessageEditCustomInstructionsEvent | AppPromptAbortEvent | AppPromptFocusEvent | AppPromptSubmitEvent | AppReadyEvent | AppSettingsSetEvent | AppThreadNewEvent | AssistantStatsEvent | AssistantThemeEvent | BuilderEditorAuthEvent | BuilderEditorStateEvent | ContentUpdateEvent | ContentApplySnapshotEvent | ModelUndoEvent | ModelRedoEvent | ResultEvent | ThreadCreatedEvent | ThreadMessageCompletedEvent | ThreadMessageCreatedEvent | ThreadMessageDeltaEvent | ThreadMessageFeedbackEvent | ThreadRunStepCreatedEvent | ThreadRunStepDeltaEvent | AppAcceptChangeEvent | AppAcceptRejectEvent | AssistantTrackEvent | AssistantEditorAuthMessage | AppAttachmentTemplateEvent | AppPasteSmartExportEvent | ThreadMessageRetryEvent | AppFigmaImportEvent | AppWebImportEvent | AppMcpServersEvent | AssistantContentInitialEvent | ThreadMessageSummaryEvent | ThreadMessageSummaryCodegenDeltaEvent | ThreadMessageThinkingDeltaEvent | AssistantHeartbeatEvent | ShowUpgradeDialogEvent | AssistantFusionSuggestionEvent | AppNavigateToFusionEvent;
6
7
  export interface AssistantCompletionResultEvent {
@@ -420,6 +421,10 @@ export interface AssistantFusionSuggestionEvent {
420
421
  message: string;
421
422
  };
422
423
  }
424
+ interface Superuser {
425
+ isSuperUser: boolean;
426
+ permissions: string[];
427
+ }
423
428
  export interface BaseFusionEvent<ExtraData extends Record<string, unknown> = {}, ExtraAttrs extends Record<string, string> = {}, V extends number = number> {
424
429
  data: {
425
430
  eventId: string;
@@ -427,6 +432,7 @@ export interface BaseFusionEvent<ExtraData extends Record<string, unknown> = {},
427
432
  timestamp: number;
428
433
  correlationId?: string;
429
434
  userId?: string;
435
+ superuser?: Superuser;
430
436
  source?: string;
431
437
  tags?: string[];
432
438
  audience?: string;
@@ -482,5 +488,25 @@ export declare const ClientDevtoolsSessionStartedEvent: {
482
488
  eventName: "client.devtools.session.started";
483
489
  version: "1";
484
490
  };
485
- export type FusionEvent = AiTaskCompletedEvent | AiTaskFailedEvent | GitPrCreatedEvent | ClientDevtoolsSessionStartedEvent;
491
+ export type FusionProjectCreatedV1 = FusionEventVariant<"fusion.project.created", {
492
+ projectId: string;
493
+ branchName?: string;
494
+ branchId?: string;
495
+ }, {}, 1>;
496
+ export declare const FusionProjectCreatedV1: {
497
+ eventName: "fusion.project.created";
498
+ version: "1";
499
+ };
500
+ export type SetupAgentCompletedV1 = FusionEventVariant<"fusion.setup.completed", {
501
+ proposedConfigId: string;
502
+ projectId: string;
503
+ branchName: string;
504
+ branchId?: string;
505
+ state: ExitState;
506
+ }, {}, 1>;
507
+ export declare const SetupAgentCompletedV1: {
508
+ eventName: "fusion.setup.completed";
509
+ version: "1";
510
+ };
511
+ export type FusionEvent = AiTaskCompletedEvent | AiTaskFailedEvent | GitPrCreatedEvent | ClientDevtoolsSessionStartedEvent | FusionProjectCreatedV1 | SetupAgentCompletedV1;
486
512
  export {};
package/src/events.js CHANGED
@@ -14,3 +14,11 @@ export const ClientDevtoolsSessionStartedEvent = {
14
14
  eventName: "client.devtools.session.started",
15
15
  version: "1",
16
16
  };
17
+ export const FusionProjectCreatedV1 = {
18
+ eventName: "fusion.project.created",
19
+ version: "1",
20
+ };
21
+ export const SetupAgentCompletedV1 = {
22
+ eventName: "fusion.setup.completed",
23
+ version: "1",
24
+ };
package/src/projects.d.ts CHANGED
@@ -234,12 +234,16 @@ export interface GitBackupUploadUrlOptions {
234
234
  size: number;
235
235
  partial: boolean;
236
236
  contentMd5: string;
237
+ folderName?: string;
238
+ repoUrl?: string;
237
239
  }
238
240
  export interface GitBackupDownloadUrlOptions {
239
241
  ownerId: string;
240
242
  projectId: string;
241
243
  branchName: string;
242
244
  partial: boolean;
245
+ folderName?: string;
246
+ repoUrl?: string;
243
247
  }
244
248
  export type ForcedBackup = "offline-full" | "offline" | undefined;
245
249
  export interface GitBackupRecordOptions {
@@ -258,6 +262,7 @@ export interface GitBackupRecordOptions {
258
262
  version: "v1" | "v2";
259
263
  forced: ForcedBackup;
260
264
  metadata?: Record<string, string | string[] | undefined>;
265
+ folderName?: string;
261
266
  }
262
267
  export interface RecordScreenshotOptions {
263
268
  projectId: string;
@@ -267,6 +272,9 @@ export interface RecordScreenshotOptions {
267
272
  href?: string;
268
273
  meta?: Record<string, any>;
269
274
  }
275
+ export type GitBackupRecordBody = GitBackupRecordOptions | {
276
+ backups: GitBackupRecordOptions[];
277
+ };
270
278
  export interface GitBackupRecordResult {
271
279
  success: boolean;
272
280
  }
@@ -336,6 +344,7 @@ export interface PartialBranchData {
336
344
  lockedFusionEnvironment?: FusionExecutionEnvironment;
337
345
  metadata?: BranchMetadata;
338
346
  backup?: BranchBackup;
347
+ backups?: Record<string, BranchBackup>;
339
348
  hidden?: boolean;
340
349
  gitAiBranch?: string | null;
341
350
  lastCommitHash?: GitSnapshot | null;
@@ -394,7 +403,7 @@ export interface BranchReview {
394
403
  updatedAt: number;
395
404
  }
396
405
  export type BranchType = "code-review" | "setup-project";
397
- interface BranchSharedData {
406
+ export interface BranchSharedData {
398
407
  appName?: string | null;
399
408
  prNumber?: number | null;
400
409
  prUrl?: string | null;
@@ -430,6 +439,7 @@ interface BranchSharedData {
430
439
  allocated: boolean | null;
431
440
  } | null;
432
441
  backup?: BranchBackup;
442
+ backups?: Record<string, BranchBackup>;
433
443
  metadata?: BranchMetadata;
434
444
  memoriesExtracted?: boolean;
435
445
  needsCleanup?: boolean;
@@ -541,6 +551,7 @@ export interface Project {
541
551
  pinned?: boolean;
542
552
  archived?: boolean;
543
553
  createdBy: string;
554
+ lastUpdateBy?: string;
544
555
  checkRunCounts?: Record<string, number>;
545
556
  repoAddedBy?: string;
546
557
  pipelineCounts?: Record<string, number>;