@builder.io/ai-utils 0.4.30 → 0.4.32

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.4.30",
3
+ "version": "0.4.32",
4
4
  "description": "Builder.io AI utils",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/codegen.d.ts CHANGED
@@ -309,7 +309,7 @@ export interface GenerateCompletionStepContinue {
309
309
  id: string;
310
310
  url: string;
311
311
  }
312
- export type DevCommandState = "running" | "stopped" | "failed" | "unset";
312
+ export type DevCommandState = "running" | "stopped" | "starting" | "failed" | "unset";
313
313
  export type SetupCommandState = "not-installed" | "installing" | "installed" | "install-failed";
314
314
  export type HttpServerState = "ok-2xx" | "error-4xx" | "error-5xx" | "error-fetch" | "stopped" | "connecting";
315
315
  export interface CodeGenHealthStatus {
@@ -340,10 +340,25 @@ export interface GenerateCompletionStepWaitForInput {
340
340
  state: GenerateCompletionState;
341
341
  suggestion?: SuggestedAction;
342
342
  }
343
- export interface GenerateCompletionStepBuilderAction {
343
+ export type GenerateCompletionStepBuilderAction = GenerateCompletionStepBuilderActionRefresh | GenerateCompletionStepBuilderActionOpenPath | GenerateCompletionStepBuilderActionMCPConnect;
344
+ export interface GenerateCompletionStepBuilderActionRefresh {
344
345
  type: "builder-action";
345
- action: "refresh" | "open-path";
346
- metadata: Record<string, any>;
346
+ action: "refresh";
347
+ metadata: {};
348
+ }
349
+ export interface GenerateCompletionStepBuilderActionOpenPath {
350
+ type: "builder-action";
351
+ action: "open-path";
352
+ metadata: {
353
+ path: string;
354
+ };
355
+ }
356
+ export interface GenerateCompletionStepBuilderActionMCPConnect {
357
+ type: "builder-action";
358
+ action: "mcp-connect";
359
+ metadata: {
360
+ mcpServer: string;
361
+ };
347
362
  }
348
363
  export interface GenerateCompletionStepAbort {
349
364
  type: "user-abort";
@@ -366,10 +381,14 @@ export interface GenerateCompletionStepDevServerState {
366
381
  devServerState: DevCommandState;
367
382
  setupState: SetupCommandState;
368
383
  httpServerState: HttpServerState;
384
+ devCommand: string | undefined;
385
+ setupCommand: string | undefined;
386
+ proxyServer: string | undefined;
369
387
  }
370
388
  export interface GenerateCompletionStepGit {
371
389
  type: "git";
372
390
  isSessionDirty: boolean;
391
+ hasGeneratingPlaceholder: boolean;
373
392
  remoteBranchExists: boolean;
374
393
  canPush: boolean;
375
394
  canPull: boolean;
@@ -429,18 +448,29 @@ export interface UserSourceBuilder {
429
448
  userEmail?: string;
430
449
  role: "user";
431
450
  photoURL?: string;
451
+ principals?: string[];
432
452
  }
433
453
  export interface UserSourceGithub {
434
454
  source: "github";
435
455
  userName: string;
456
+ userEmail?: string;
457
+ link?: string;
458
+ role: "user" | "agent";
459
+ principals?: string[];
460
+ }
461
+ export interface UserSourceGitlab {
462
+ source: "gitlab";
463
+ userName: string;
436
464
  link?: string;
437
465
  role: "user" | "agent";
466
+ principals?: string[];
438
467
  }
439
468
  export interface UserSourceAgent {
440
469
  source: "agent";
441
470
  role: "agent";
471
+ principals?: string[];
442
472
  }
443
- export type UserSource = UserSourceBuilder | UserSourceGithub | UserSourceAgent;
473
+ export type UserSource = UserSourceBuilder | UserSourceGithub | UserSourceGitlab | UserSourceAgent;
444
474
  export interface GenerateUserMessage {
445
475
  user?: UserSource;
446
476
  userPrompt: string;
@@ -463,7 +493,7 @@ export interface UserInput {
463
493
  rerankFiles?: number;
464
494
  mostRelevantFile: string | null;
465
495
  toolResults: ContentMessageItemToolResult[];
466
- role: "user" | "agent";
496
+ user: UserSource;
467
497
  }
468
498
  export interface CodegenTurn {
469
499
  state: "running" | "done" | "error";
@@ -585,9 +615,11 @@ export interface AclEntry {
585
615
  resource: string;
586
616
  permissions: Permission[];
587
617
  description?: string;
618
+ principals?: string[];
588
619
  }
589
620
  export interface AclPolicy {
590
- entries: AclEntry[];
621
+ secrets?: string[];
622
+ entries?: AclEntry[];
591
623
  }
592
624
  export interface AccessResult {
593
625
  allowed: boolean;
package/src/messages.d.ts CHANGED
@@ -19,7 +19,7 @@ export interface ContentMessageItemImage {
19
19
  }
20
20
  export interface ContentMessageItemDocument {
21
21
  type: "document";
22
- source: DocumentBase64Source | DocumentUrlSource;
22
+ source: DocumentBase64Source | DocumentUrlSource | DocumentTextSource;
23
23
  cache?: boolean;
24
24
  ephemeral?: boolean;
25
25
  }
@@ -32,6 +32,11 @@ export interface DocumentUrlSource {
32
32
  type: "url";
33
33
  url: string;
34
34
  }
35
+ export interface DocumentTextSource {
36
+ type: "text";
37
+ media_type: "text/plain";
38
+ data: string;
39
+ }
35
40
  export interface ContentMessageItemToolResult {
36
41
  type: "tool_result";
37
42
  tool_use_id: string;
@@ -248,9 +253,10 @@ export interface URL {
248
253
  }
249
254
  export interface FileUpload {
250
255
  type: "upload";
251
- contentType: "image/webp" | "image/png" | "image/jpeg" | "image/gif" | "application/pdf";
256
+ contentType: "image/webp" | "image/png" | "image/jpeg" | "image/gif" | "application/pdf" | "application/json" | "text/plain";
252
257
  name: string;
253
258
  dataUrl: string;
259
+ text?: string;
254
260
  size: number;
255
261
  id: string;
256
262
  originalUrl?: string;
package/src/projects.d.ts CHANGED
@@ -132,7 +132,7 @@ export interface ReadyMessage extends BaseMessage {
132
132
  url: string;
133
133
  status?: LaunchServerStatus;
134
134
  }
135
- export type EnsureContainerErrorCode = "FLY_APP_CHECK_ERROR" | "FLY_CAPACITY_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" | "ensure-checking-existing-machines" | "found-multiple-failed-machine" | "maximun-retries-machine-creation" | "git-auth-failed" | "unknown" | "project-bad-state" | "project-not-found" | "project-branch-not-found" | "project-repo-full-name-not-found" | "project-org-not-found" | "no-available-regions" | "machine-status-polling-failed";
135
+ export type EnsureContainerErrorCode = "FLY_APP_CHECK_ERROR" | "FLY_CAPACITY_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" | "ensure-checking-existing-machines" | "found-multiple-failed-machine" | "maximun-retries-machine-creation" | "git-auth-failed" | "unknown" | "project-bad-state" | "project-not-found" | "project-branch-not-found" | "project-repo-full-name-not-found" | "project-org-not-found" | "no-available-regions" | "machine-status-polling-failed" | "timeout" | "fatal:zod-validation-error" | `fatal:${string}`;
136
136
  export interface ErrorStateMessage extends BaseMessage {
137
137
  state: "error";
138
138
  message: string;