@builder.io/ai-utils 0.12.29 → 0.13.1

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.29",
3
+ "version": "0.13.1",
4
4
  "description": "Builder.io AI utils",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/codegen.d.ts CHANGED
@@ -28,6 +28,7 @@ export interface CustomInstruction {
28
28
  filePath?: string;
29
29
  glob?: string;
30
30
  description?: string;
31
+ allowedTools?: string[];
31
32
  }
32
33
  export interface CustomAgentInfo {
33
34
  name: string;
@@ -46,7 +47,7 @@ export interface CustomAgentDefinition {
46
47
  export type CodeGenFramework = "react" | "html" | "mitosis" | "react-native" | "angular" | "vue" | "svelte" | "qwik" | "solid" | "marko" | "swiftui" | "jetpack-compose" | "flutter";
47
48
  export type CodeGenStyleLibrary = "tailwind" | "tailwind-precise" | "emotion" | "styled-components" | "styled-jsx" | "react-native" | undefined;
48
49
  export type CompletionStopReason = "max_tokens" | "stop_sequence" | "tool_use" | "end_turn" | "content_filter" | "error" | "aborted" | "pause_turn" | "refusal" | "model_context_window_exceeded" | null;
49
- export interface ViewPathToolInput {
50
+ export interface ReadToolInput {
50
51
  file_path: string;
51
52
  view_range?: [number, number];
52
53
  offset?: number | null;
@@ -189,8 +190,12 @@ export interface ExplorationMetadataToolInput {
189
190
  export interface ExitPlanModeToolInput {
190
191
  plan: string;
191
192
  }
193
+ export interface ReadMcpResourceToolInput {
194
+ uri: string;
195
+ serverName?: string;
196
+ }
192
197
  export interface CodeGenToolMap {
193
- view_path: ViewPathToolInput;
198
+ view_path: ReadToolInput;
194
199
  glob_search: GlobSearchToolInput;
195
200
  grep_search: GrepSearchToolInput;
196
201
  get_rule: GetRuleToolInput;
@@ -203,7 +208,7 @@ export interface CodeGenToolMap {
203
208
  write_file: WriteFileInput;
204
209
  search_replace_file: SearchReplaceInput;
205
210
  find_media: FindMediaToolInput;
206
- Read: ViewPathToolInput;
211
+ Read: ReadToolInput;
207
212
  Write: WriteFileInput;
208
213
  Edit: SearchReplaceInput;
209
214
  ReadRule: GetRuleToolInput;
@@ -229,12 +234,13 @@ export interface CodeGenToolMap {
229
234
  WebFetch: WebFetchToolInput;
230
235
  ExplorationMetadata: ExplorationMetadataToolInput;
231
236
  ExitPlanMode: ExitPlanModeToolInput;
237
+ ReadMcpResource: ReadMcpResourceToolInput;
232
238
  }
233
239
  export type CodeGenTools = keyof CodeGenToolMap;
234
240
  export type AllCodeGenTools = CodeGenTools | "web_search";
235
241
  export type SessionMode = "planning" | "normal" | "auto-planning";
236
242
  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";
243
+ export type BaseCodeGenPosition = "fusion" | "editor-ai" | "repo-indexing" | "cli" | "create-app-firebase" | "create-app-lovable" | "builder-code-panel" | "dsi-mcp";
238
244
  export type CodeGenPosition = BaseCodeGenPosition | `${BaseCodeGenPosition}-agent`;
239
245
  export interface RepoIndexingConfig {
240
246
  designSystems: string[];
@@ -259,6 +265,7 @@ export interface CodeGenInputOptions {
259
265
  customAgents?: CustomAgentInfo[];
260
266
  systemPromptOverride?: string;
261
267
  userPrompt?: string;
268
+ systemRemainderPrompt?: string;
262
269
  ephemeralUserPrompt?: string;
263
270
  uiContextPrompt?: string;
264
271
  displayUserPrompt?: string;
@@ -744,6 +751,7 @@ export interface GenerateUserMessage {
744
751
  export interface UserInput {
745
752
  userMessage: GenerateUserMessage | undefined;
746
753
  userPrompt: string;
754
+ systemRemainderPrompt: string | undefined;
747
755
  attachments: Attachment[];
748
756
  files: ProjectFile[];
749
757
  searchResponse: CodebaseSearchResponse | null;
@@ -13,6 +13,12 @@ export interface BitbucketEnterprisePAT {
13
13
  host: string;
14
14
  botUsername: string;
15
15
  }
16
+ export interface GitlabEnterprisePATValue {
17
+ token: string;
18
+ host: string;
19
+ botUsername: string;
20
+ secondaryHost?: string;
21
+ }
16
22
  interface OrganizationSettings {
17
23
  attribution?: string[];
18
24
  visualEditorAiStyleInspirationURL?: string;
@@ -26,6 +32,7 @@ interface OrganizationSettings {
26
32
  isUserPluginIntegrationRequestGranted?: boolean;
27
33
  shopify?: boolean;
28
34
  githubEnterpriseSetupValue?: GithubEnterpriseSetupValue;
35
+ gitlabEnterprisePAT?: GitlabEnterprisePATValue;
29
36
  bitbucketEnterprisePAT?: BitbucketEnterprisePAT;
30
37
  useProxy?: boolean;
31
38
  fusionShareableUrlSuffix?: 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;
@@ -405,9 +409,10 @@ export interface Project {
405
409
  validateCommand?: string;
406
410
  proxyOrigin?: string;
407
411
  proxyDefaultOrigin?: string;
408
- gitBranchNamingStrategy?: "ai-session" | "branch-name" | "custom" | "ask-user";
412
+ gitBranchNamingStrategy?: "ai-session" | "branch-name" | "custom";
409
413
  setupDependencies?: SetupDependency[];
410
414
  gitBranchNamingCustom?: string;
415
+ askUserForBranchName?: boolean;
411
416
  devServerCommand?: string;
412
417
  cpuKind?: CpuKind;
413
418
  cpus?: 1 | 2 | 4;
@@ -478,6 +483,12 @@ export interface Project {
478
483
  state?: EntityState;
479
484
  deletedAt?: string;
480
485
  deletedBy?: string;
486
+ /**
487
+ * When true, branches are stored in the standalone `branches` collection
488
+ * instead of embedded in project.branches field.
489
+ * Defaults to false for backwards compatibility with existing projects.
490
+ */
491
+ useBranchesCollection?: boolean;
481
492
  }
482
493
  /**
483
494
  * Get the state of a branch, checking `state` first and falling back to `deleted` for backwards compatibility.