@builder.io/ai-utils 0.12.28 → 0.13.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.12.28",
3
+ "version": "0.13.0",
4
4
  "description": "Builder.io AI utils",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/codegen.d.ts CHANGED
@@ -189,6 +189,10 @@ export interface ExplorationMetadataToolInput {
189
189
  export interface ExitPlanModeToolInput {
190
190
  plan: string;
191
191
  }
192
+ export interface ReadMcpResourceToolInput {
193
+ uri: string;
194
+ serverName?: string;
195
+ }
192
196
  export interface CodeGenToolMap {
193
197
  view_path: ViewPathToolInput;
194
198
  glob_search: GlobSearchToolInput;
@@ -229,12 +233,13 @@ export interface CodeGenToolMap {
229
233
  WebFetch: WebFetchToolInput;
230
234
  ExplorationMetadata: ExplorationMetadataToolInput;
231
235
  ExitPlanMode: ExitPlanModeToolInput;
236
+ ReadMcpResource: ReadMcpResourceToolInput;
232
237
  }
233
238
  export type CodeGenTools = keyof CodeGenToolMap;
234
239
  export type AllCodeGenTools = CodeGenTools | "web_search";
235
240
  export type SessionMode = "planning" | "normal" | "auto-planning";
236
241
  export type CodeGenMode = "quality" | "quality-v3" | "quality-v4" | "quality-v4-agent";
237
- export type BaseCodeGenPosition = "fusion" | "editor-ai" | "repo-indexing" | "cli" | "create-app-firebase" | "create-app-lovable" | "builder-code-panel";
242
+ export type BaseCodeGenPosition = "fusion" | "editor-ai" | "repo-indexing" | "cli" | "create-app-firebase" | "create-app-lovable" | "builder-code-panel" | "dsi-mcp";
238
243
  export type CodeGenPosition = BaseCodeGenPosition | `${BaseCodeGenPosition}-agent`;
239
244
  export interface RepoIndexingConfig {
240
245
  designSystems: string[];
package/src/projects.d.ts CHANGED
@@ -278,8 +278,6 @@ export interface PartialBranchData {
278
278
  }
279
279
  export type EntityState = "active" | "deleted";
280
280
  interface BranchSharedData {
281
- lockedFusionEnvironment?: FusionExecutionEnvironment;
282
- id?: string;
283
281
  appName?: string | null;
284
282
  prNumber?: number | null;
285
283
  prUrl?: string | null;
@@ -298,8 +296,6 @@ interface BranchSharedData {
298
296
  createdBy?: string;
299
297
  isPublic?: boolean;
300
298
  isDefault?: boolean;
301
- sessionId?: string;
302
- createdAt?: number | null;
303
299
  friendlyName?: string;
304
300
  useHomeDir?: boolean;
305
301
  useCloudHomeDir?: boolean;
@@ -314,25 +310,34 @@ interface BranchSharedData {
314
310
  backup?: BranchBackup;
315
311
  metadata?: Record<string, unknown>;
316
312
  needsCleanup?: boolean;
317
- /** The state of the branch. Use `isBranchDeleted()` helper for backwards-compatible checks. */
318
- state?: EntityState;
319
313
  /** @deprecated Use `state` field instead. Kept for backwards compatibility. */
320
314
  deleted?: boolean;
321
315
  deletedAt?: string;
322
316
  deletedBy?: string;
323
- updatedAt?: string;
324
- commitMode?: CommitMode;
325
317
  kubePodName?: string | null;
326
318
  kubeNamespace?: string | null;
327
319
  kubePvcName?: string | null;
328
320
  kubeHostname?: string | null;
329
321
  checkoutBranch?: string | null;
330
322
  }
323
+ /**
324
+ * fields that are required in the new branch format, but optional in the legacy branch format.
325
+ */
326
+ interface RequiredBranchSharedData {
327
+ /** The state of the branch. Use `isBranchDeleted()` helper for backwards-compatible checks. */
328
+ state: EntityState;
329
+ lockedFusionEnvironment: FusionExecutionEnvironment;
330
+ id: string;
331
+ sessionId: string;
332
+ createdAt: number;
333
+ updatedAt: string;
334
+ commitMode: CommitMode;
335
+ }
331
336
  /**
332
337
  * LegacyBranch represents branch data as stored in the nested project.branches field.
333
338
  * This type does NOT include projectId or legacyId as those don't exist in the legacy format.
334
339
  */
335
- export interface LegacyBranch extends BranchSharedData {
340
+ export interface LegacyBranch extends BranchSharedData, Partial<RequiredBranchSharedData> {
336
341
  preRecoveryData?: Partial<LegacyBranch> & {
337
342
  recoveryDate: Date;
338
343
  };
@@ -341,10 +346,9 @@ export interface LegacyBranch extends BranchSharedData {
341
346
  * NewBranch represents branch data as stored in the standalone branches collection.
342
347
  * Extends LegacyBranch with required projectId, name, and optional legacyId fields.
343
348
  */
344
- export interface NewBranch extends BranchSharedData {
345
- /** The project this branch belongs to */
349
+ export interface NewBranch extends BranchSharedData, RequiredBranchSharedData {
350
+ ownerId: string;
346
351
  projectId: string;
347
- /** The branch name (required in new collection) */
348
352
  name: string;
349
353
  /** Legacy ID for mapping to project.branches[branchName] format: ${projectId}-${branchName} */
350
354
  legacyId: string;
@@ -444,7 +448,6 @@ export interface Project {
444
448
  localHttpsDomain?: string;
445
449
  browserAutomation?: {
446
450
  backgroundAgents?: boolean;
447
- builderApp?: boolean;
448
451
  instructions?: string;
449
452
  authUser?: string;
450
453
  authPassword?: string;
@@ -479,6 +482,12 @@ export interface Project {
479
482
  state?: EntityState;
480
483
  deletedAt?: string;
481
484
  deletedBy?: string;
485
+ /**
486
+ * When true, branches are stored in the standalone `branches` collection
487
+ * instead of embedded in project.branches field.
488
+ * Defaults to false for backwards compatibility with existing projects.
489
+ */
490
+ useBranchesCollection?: boolean;
482
491
  }
483
492
  /**
484
493
  * Get the state of a branch, checking `state` first and falling back to `deleted` for backwards compatibility.