@builder.io/ai-utils 0.50.4 → 0.52.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.50.4",
3
+ "version": "0.52.0",
4
4
  "description": "Builder.io AI utils",
5
5
  "files": [
6
6
  "src"
package/src/codegen.d.ts CHANGED
@@ -202,7 +202,7 @@ export interface AskUserQuestion {
202
202
  }
203
203
  export interface AskUserQuestionToolInput {
204
204
  questions: AskUserQuestion[];
205
- answers?: Record<string, string>;
205
+ answers?: Record<string, string | string[]>;
206
206
  }
207
207
  export interface AgentToolInput {
208
208
  description: string;
@@ -448,7 +448,7 @@ export interface UpdateSetupValueToolInput {
448
448
  };
449
449
  reason: string;
450
450
  }
451
- export type ExitState = "verified" | "no-frontend" | "empty-project" | "mobile-project" | "user-question" | "code-change-required" | "other" | "started";
451
+ export type ExitState = "verified" | "no-frontend" | "empty-project" | "mobile-project" | "user-question" | "code-change-required" | "other" | "started" | "failed";
452
452
  export interface ExitToolInput {
453
453
  state: ExitState;
454
454
  summary: string;
package/src/events.d.ts CHANGED
@@ -798,6 +798,8 @@ export type PrReviewRequestedV1 = FusionEventVariant<"pr.review.requested", {
798
798
  triggerSource?: string;
799
799
  isSynchronize?: boolean;
800
800
  isFork?: boolean;
801
+ prAuthorGithubUsername?: string;
802
+ prAuthorIsBot?: boolean;
801
803
  forceBrowserTesting?: boolean;
802
804
  }, {}, 1>;
803
805
  export declare const PrReviewRequestedV1: {
package/src/index.d.ts CHANGED
@@ -12,5 +12,5 @@ export * from "./vscode-tunnel.js";
12
12
  export * from "./claw.js";
13
13
  export * from "./kube-error.js";
14
14
  export * from "./connectivity/types.js";
15
- export * from "./vpc-peering.js";
15
+ export * from "./single-tenancy.js";
16
16
  export { connectivityErrorCodeToLikelyCause, mapConnectivityErrorMessage, } from "./connectivity/error-codes.js";
package/src/index.js CHANGED
@@ -12,5 +12,5 @@ export * from "./vscode-tunnel.js";
12
12
  export * from "./claw.js";
13
13
  export * from "./kube-error.js";
14
14
  export * from "./connectivity/types.js";
15
- export * from "./vpc-peering.js";
15
+ export * from "./single-tenancy.js";
16
16
  export { connectivityErrorCodeToLikelyCause, mapConnectivityErrorMessage, } from "./connectivity/error-codes.js";
@@ -101,9 +101,9 @@ interface OrganizationSettings {
101
101
  ticketAssessmentModel?: string;
102
102
  ticketAssessmentDailyLimit?: number;
103
103
  fusionWebhooks?: FusionWebhook[];
104
- /** Default VPC peering ID for this space. References a document in the vpcPeerings collection.
105
- * Projects can override this with their own vpcPeering setting. */
106
- defaultVpcPeering?: string;
104
+ /** Default single tenancy config ID for this space. References a document in the singleTenancyConfigurations collection.
105
+ * Projects can override this with their own singleTenancyConfig setting. */
106
+ defaultSingleTenancyConfig?: string;
107
107
  controlModelAvailability?: boolean;
108
108
  allowedAiModels?: string[];
109
109
  autoModelOverride?: string;
package/src/projects.d.ts CHANGED
@@ -371,6 +371,13 @@ export interface PartialBranchData {
371
371
  projectId: string;
372
372
  branchName: string;
373
373
  };
374
+ /**
375
+ * Pre-generated sessionId. internal use only. When provided, the branch will use this sessionId
376
+ * instead of generating a new one. Allows callers (e.g. setup-agent spawner)
377
+ * to bootstrap a ProposedConfig doc keyed by sessionId before the branch
378
+ * record is fully created.
379
+ */
380
+ sessionId?: string;
374
381
  }
375
382
  export type EntityState = "active" | "deleted" | "archived";
376
383
  /**
@@ -407,6 +414,10 @@ export interface BranchMetadata {
407
414
  description?: string;
408
415
  /** Whether the branch is a cloned branch */
409
416
  isClonedBranch?: boolean;
417
+ /** For QA branches reviewing an internal PR (originated from Builder): the project ID of the source branch */
418
+ originalProjectId?: string;
419
+ /** For QA branches reviewing an internal PR (originated from Builder): the name of the source branch */
420
+ originalBranchName?: string;
410
421
  /** Data passed in via /agents/run api that we echo in webhook response **/
411
422
  webhookContext?: Record<string, unknown>;
412
423
  [key: string]: unknown;
@@ -691,9 +702,9 @@ export interface Project {
691
702
  * Agents will pick this project when asked to do something with the connected repository.
692
703
  */
693
704
  isPreferredForRepo?: boolean;
694
- /** VPC peering ID for this project. Overrides the space-level defaultVpcPeering.
695
- * References a document in the vpcPeerings collection. */
696
- vpcPeering?: string;
705
+ /** Single tenancy config ID for this project. Overrides the space-level defaultSingleTenancyConfig.
706
+ * References a document in the singleTenancyConfigurations collection. */
707
+ singleTenancyConfig?: string;
697
708
  previewPasswordProtection?: PreviewPasswordProtection;
698
709
  };
699
710
  screenshot: string | null;
@@ -720,6 +731,8 @@ export interface Project {
720
731
  useBranchesCollection?: boolean;
721
732
  /** When true, the project is in code-only mode */
722
733
  codeOnlyMode?: boolean;
734
+ /** When true, analysis detected a mobile-only app (no usable web dev server path) */
735
+ mobileOnlyDetected?: boolean;
723
736
  /** When true, this project is an org-level Claw agent */
724
737
  isOrgAgent?: boolean;
725
738
  /** Configuration for the org agent */
@@ -850,6 +863,17 @@ export interface CreateBranchOptions {
850
863
  branchName: string;
851
864
  url: string;
852
865
  }) => Promise<void> | void;
866
+ /**
867
+ * INTERNAL ONLY. Pre-generated sessionId used by trusted callers
868
+ * (e.g. setup-agent spawner) to bootstrap a ProposedConfig doc keyed by
869
+ * sessionId before the branch record exists.
870
+ *
871
+ * SECURITY: Must be stripped from any user-facing HTTP request body — this
872
+ * value becomes a Firestore document ID and accepting it from untrusted
873
+ * input enables cross-user ProposedConfig corruption via
874
+ * `.set(..., { merge: true })`.
875
+ */
876
+ sessionId?: string;
853
877
  }
854
878
  interface BaseCreateBranchMessage {
855
879
  }
@@ -0,0 +1,92 @@
1
+ /** Fields common to all VPC connectivity types. */
2
+ interface VpcConnectionBase {
3
+ type: string;
4
+ proxyIp: string;
5
+ customerDnsServers: string[];
6
+ }
7
+ /** Traditional VPC Peering via bridge VPC. */
8
+ export interface VpcGcpPeering extends VpcConnectionBase {
9
+ type: "gcp-peering";
10
+ gcpProjectId: string;
11
+ gcpNetworkName: string;
12
+ bridgeCidr: string;
13
+ importCustomRoutes: boolean;
14
+ }
15
+ /**
16
+ * PSC Network Attachment — customer creates the network attachment in their VPC,
17
+ * our proxy VM connects to it via a PSC interface on nic1.
18
+ * No bridge VPC or bridge CIDR needed on our side.
19
+ */
20
+ export interface VpcGcpNetworkAttachment extends VpcConnectionBase {
21
+ type: "gcp-network-attachment";
22
+ gcpProjectId: string;
23
+ networkAttachmentName: string;
24
+ }
25
+ /** Discriminated union of all VPC connectivity types. */
26
+ export type VpcConnection = VpcGcpPeering | VpcGcpNetworkAttachment;
27
+ /**
28
+ * Dedicated node pool preferences for a single tenancy customer.
29
+ * Independent of VPC connectivity.
30
+ */
31
+ export interface DedicatedNodePoolConfig {
32
+ enabled: boolean;
33
+ machineType?: string;
34
+ minNodes?: number;
35
+ maxNodes?: number;
36
+ diskSizeGb?: number;
37
+ diskType?: string;
38
+ }
39
+ /**
40
+ * Single tenancy configuration — unified data model for VPC connectivity
41
+ * and dedicated node pool preferences per customer.
42
+ *
43
+ * Stored in the `singleTenancyConfigurations` Firestore collection.
44
+ */
45
+ export interface SingleTenancyConfig {
46
+ id: string;
47
+ ownerId: string;
48
+ enabled: boolean;
49
+ createdAt: number;
50
+ updatedAt: number;
51
+ /** VPC connectivity — optional, not all customers need VPC. */
52
+ vpc?: VpcConnection;
53
+ /** Dedicated node pool — optional, independent of VPC. */
54
+ dedicatedNodePool?: DedicatedNodePoolConfig;
55
+ }
56
+ export interface CreateVpcGcpPeeringParams {
57
+ type: "gcp-peering";
58
+ gcpProjectId: string;
59
+ gcpNetworkName: string;
60
+ bridgeCidr: string;
61
+ customerDnsServers: string[];
62
+ importCustomRoutes?: boolean;
63
+ }
64
+ export interface CreateVpcGcpNetworkAttachmentParams {
65
+ type: "gcp-network-attachment";
66
+ gcpProjectId: string;
67
+ networkAttachmentName: string;
68
+ customerDnsServers: string[];
69
+ }
70
+ export type CreateSingleTenancyVpcParams = CreateVpcGcpPeeringParams | CreateVpcGcpNetworkAttachmentParams;
71
+ /**
72
+ * Full create payload — VPC connectivity plus optional dedicated node pool.
73
+ * The {@link CreateSingleTenancyVpcParams} discriminated union still drives
74
+ * which VPC fields are required.
75
+ */
76
+ export type CreateSingleTenancyConfigOpts = CreateSingleTenancyVpcParams & {
77
+ dedicatedNodePool?: DedicatedNodePoolConfig;
78
+ };
79
+ /**
80
+ * Patch payload for an existing single tenancy config.
81
+ * Only the safe-to-edit fields are exposed; `vpc.type`, `vpc.proxyIp`,
82
+ * `vpc.gcpProjectId`, `vpc.gcpNetworkName`, `vpc.networkAttachmentName`, and
83
+ * `vpc.bridgeCidr` are immutable because changing them would diverge from
84
+ * already-provisioned infrastructure.
85
+ */
86
+ export interface UpdateSingleTenancyConfigOpts {
87
+ enabled?: boolean;
88
+ customerDnsServers?: string[];
89
+ importCustomRoutes?: boolean;
90
+ dedicatedNodePool?: DedicatedNodePoolConfig | null;
91
+ }
92
+ export {};
@@ -1,49 +0,0 @@
1
- /** Fields common to all VPC connectivity types. */
2
- interface VpcConnectionBase {
3
- id: string;
4
- ownerId: string;
5
- type: string;
6
- gcpRegion: string;
7
- customerDnsServers: string[];
8
- proxyIp: string;
9
- enabled: boolean;
10
- createdAt: number;
11
- updatedAt: number;
12
- }
13
- /** Traditional VPC Peering via bridge VPC. */
14
- export interface VpcGcpPeering extends VpcConnectionBase {
15
- type: "gcp-peering";
16
- gcpProjectId: string;
17
- gcpNetworkName: string;
18
- bridgeCidr: string;
19
- importCustomRoutes: boolean;
20
- }
21
- /**
22
- * PSC Network Attachment — customer creates the network attachment in their VPC,
23
- * our proxy VM connects to it via a PSC interface on nic1.
24
- * No bridge VPC or bridge CIDR needed on our side.
25
- */
26
- export interface VpcGcpNetworkAttachment extends VpcConnectionBase {
27
- type: "gcp-network-attachment";
28
- gcpProjectId: string;
29
- networkAttachmentName: string;
30
- }
31
- /** Discriminated union of all VPC connectivity types. */
32
- export type VpcPeering = VpcGcpPeering | VpcGcpNetworkAttachment;
33
- export interface CreateVpcGcpPeeringParams {
34
- type: "gcp-peering";
35
- gcpRegion: string;
36
- gcpProjectId: string;
37
- gcpNetworkName: string;
38
- bridgeCidr: string;
39
- customerDnsServers: string[];
40
- importCustomRoutes?: boolean;
41
- }
42
- export interface CreateVpcGcpNetworkAttachmentParams {
43
- type: "gcp-network-attachment";
44
- gcpProjectId: string;
45
- networkAttachmentName: string;
46
- customerDnsServers: string[];
47
- }
48
- export type CreateVpcPeeringParams = CreateVpcGcpPeeringParams | CreateVpcGcpNetworkAttachmentParams;
49
- export {};
File without changes