@builder.io/ai-utils 0.83.0 → 0.84.0-dev.202607212345.137e4170f

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/src/projects.js CHANGED
@@ -36,11 +36,13 @@ export const EXAMPLE_REPOS = [
36
36
  ];
37
37
  export const STARTER_REPO = "BuilderIO/fusion-starter";
38
38
  export const DSI_PREVIEW_REPO = "BuilderIO/dsi-starter";
39
+ export const DSI_PLACEHOLDER_REPO = "BuilderIO/dsi-placeholder";
39
40
  export const AGENT_NATIVE_STARTER_REPO = "BuilderIO/builder-agent-native-starter";
40
41
  export const EXAMPLE_OR_STARTER_REPOS = [
41
42
  ...EXAMPLE_REPOS,
42
43
  STARTER_REPO,
43
44
  DSI_PREVIEW_REPO,
45
+ DSI_PLACEHOLDER_REPO,
44
46
  AGENT_NATIVE_STARTER_REPO,
45
47
  ];
46
48
  export const EXAMPLE_OR_STARTER_REPOS_URLS = EXAMPLE_OR_STARTER_REPOS.map((repo) => `https://github.com/${repo}`);
@@ -322,12 +324,13 @@ export const ProjectHostingSchema = z.object({
322
324
  lastDeployStatus: DeployStatusSchema.optional(),
323
325
  /** Git commit currently live at the project's hosting URL (set on go-live). */
324
326
  publishedCommit: z.string().optional(),
325
- customDomain: z.string().optional(),
326
- customDomainVerified: z.boolean().optional(),
327
327
  autoDeploy: z
328
328
  .boolean()
329
329
  .optional()
330
330
  .meta({ description: "auto-deploy on push/merge" }),
331
+ domainIds: z.array(z.string()).optional().meta({
332
+ description: "Doc keys (normalized domains) in `hosting-domains` attached to this project. The domain docs are the source of truth; this is only the back-pointer.",
333
+ }),
331
334
  });
332
335
  /**
333
336
  * Canonical "is this project hostable" predicate. Keys off the explicit
@@ -613,6 +616,90 @@ export const GetDeploysRequestSchema = z.object({
613
616
  export const GetDeploysResponseSchema = z.object({
614
617
  deploys: z.array(DeployListItemSchema),
615
618
  });
619
+ export const HostingDomainStatusSchema = z.enum([
620
+ "pending",
621
+ "verifying",
622
+ "provisioning",
623
+ "active",
624
+ "failed",
625
+ ]);
626
+ export const HostingDomainKindSchema = z.enum(["apex", "subdomain"]);
627
+ /**
628
+ * Custom domain record, stored at `hosting-domains/{domain}`.
629
+ * The normalized domain is the doc key — global uniqueness comes for free.
630
+ * This doc is both the record AND the claim for the domain.
631
+ */
632
+ export const HostingDomainSchema = z.object({
633
+ domain: z
634
+ .string()
635
+ .meta({ description: "Doc key — normalized (punycode) domain." }),
636
+ kind: HostingDomainKindSchema,
637
+ projectId: z.string(),
638
+ ownerId: z.string(),
639
+ status: HostingDomainStatusSchema,
640
+ dnsAuthId: z
641
+ .string()
642
+ .meta({ description: "GCP DNS authorization resource name." }),
643
+ delegationTarget: z.string().meta({
644
+ description: "_acme-challenge CNAME value the customer must add.",
645
+ }),
646
+ trafficTarget: z.string().optional().meta({
647
+ description: "The traffic record value: ALB anycast IP for apex domains, `cname.builder.cloud` for subdomains. Persisted so the UI can reconstruct both DNS records after page reload.",
648
+ }),
649
+ certId: z
650
+ .string()
651
+ .optional()
652
+ .meta({ description: "Certificate Manager cert resource name." }),
653
+ certMapEntryName: z.string().optional(),
654
+ httpRouteName: z.string().optional(),
655
+ createdAt: z.number(),
656
+ pendingSince: z.number().meta({
657
+ description: "TTL anchor: set on entering `pending`, re-stamped on `failed`→`pending`.",
658
+ }),
659
+ verifyingSince: z.number().optional().meta({
660
+ description: "Set when the delegation-check poll loop starts (on entering `verifying`). Used for the poll timeout and UI. Cleared on promotion to `provisioning` or on failure.",
661
+ }),
662
+ attemptId: z.string().optional().meta({
663
+ description: "Per-verify-attempt nonce, set on entering `verifying`. Delegation-check polls whose attemptId no longer matches are stale (a newer retry superseded them) and stop early.",
664
+ }),
665
+ verifiedAt: z.number().optional(),
666
+ error: z.string().optional(),
667
+ failedStep: z.enum(["dns", "https"]).optional().meta({
668
+ description: "Which setup step failed, set alongside `status: failed` so the UI can attribute the failure. `dns` = delegation verification, `https` = cert/route provisioning.",
669
+ }),
670
+ createdBy: z.string(),
671
+ });
672
+ export const AddDomainRequestSchema = z.object({
673
+ projectId: z.string(),
674
+ domain: z.string(),
675
+ });
676
+ const DnsRecordSchema = z.object({
677
+ recordType: z.enum(["A", "CNAME"]),
678
+ name: z.string(),
679
+ value: z.string(),
680
+ });
681
+ export const AddDomainResponseSchema = z.object({
682
+ domain: z.string(),
683
+ kind: HostingDomainKindSchema,
684
+ records: z.object({
685
+ traffic: DnsRecordSchema,
686
+ validation: DnsRecordSchema,
687
+ }),
688
+ });
689
+ export const VerifyDomainRequestSchema = z.object({
690
+ projectId: z.string(),
691
+ domain: z.string(),
692
+ });
693
+ export const VerifyDomainResponseSchema = z.object({
694
+ status: HostingDomainStatusSchema,
695
+ });
696
+ export const RemoveDomainRequestSchema = z.object({
697
+ projectId: z.string(),
698
+ domain: z.string(),
699
+ });
700
+ export const RemoveDomainResponseSchema = z.object({
701
+ success: z.literal(true),
702
+ });
616
703
  export const CloneProjectOptionsSchema = z.object({
617
704
  sourceProjectId: z.string().min(1).meta({
618
705
  description: "Project to clone from.",
@@ -1,4 +1,6 @@
1
+ import type { FullLibrarySourceInput } from "./design-systems.js";
1
2
  export type StoreComponentDocsInput = StoreComponentDocsInputV1 | StoreComponentDocsInputV2 | IndexDocumentV1;
3
+ export type ComponentDocSource = "full" | "approximation";
2
4
  export interface ManualDocumentV1 {
3
5
  document: IndexDocumentV1;
4
6
  filePath: string;
@@ -46,6 +48,7 @@ export interface DocumentBase {
46
48
  designSystemVersion?: string;
47
49
  tokens?: number;
48
50
  sessionId?: string;
51
+ source?: ComponentDocSource;
49
52
  }
50
53
  export declare const isAgentDocument: (doc: IndexDocumentV1) => doc is AgentDocument;
51
54
  export declare const isIconDocument: (doc: IndexDocumentV1) => doc is IconDocument;
@@ -117,6 +120,13 @@ export interface UpdateDesignSystemInput {
117
120
  status?: "in-progress" | "completed" | "failed";
118
121
  source?: "auto" | "custom";
119
122
  }
123
+ export type LastIndexInput = {
124
+ mode: "full-library";
125
+ sources: FullLibrarySourceInput[];
126
+ } | {
127
+ mode: "designs-only";
128
+ uploadGcsPaths: string[];
129
+ };
120
130
  export interface DesignSystem {
121
131
  id: string;
122
132
  spaceId: string;
@@ -137,6 +147,8 @@ export interface DesignSystem {
137
147
  source: "custom" | "auto";
138
148
  projectId?: string;
139
149
  branchName?: string;
150
+ lastIndexInput?: LastIndexInput;
151
+ lastIndexedAt?: string;
140
152
  }
141
153
  export interface DisplayDesignSystem extends DesignSystem {
142
154
  docCount: number;
@@ -0,0 +1,49 @@
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 {};
@@ -0,0 +1 @@
1
+ export {};