@builder.io/ai-utils 0.81.3 → 0.83.0-dev.202607211718.99c5f9cf8

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.
Files changed (46) hide show
  1. package/package.json +1 -1
  2. package/src/acl-schema.d.ts +88 -0
  3. package/src/acl-schema.js +71 -0
  4. package/src/claw.d.ts +1 -0
  5. package/src/claw.js +9 -0
  6. package/src/claw.spec.js +11 -1
  7. package/src/codegen/investigation-context.d.ts +1 -1
  8. package/src/codegen.d.ts +10 -0
  9. package/src/codegen.js +2 -1
  10. package/src/completion.d.ts +2 -1
  11. package/src/connectivity/checks/http-check.d.ts +7 -0
  12. package/src/connectivity/checks/http-check.js +13 -5
  13. package/src/connectivity/checks/http-check.spec.js +58 -0
  14. package/src/connectivity/environment.js +6 -0
  15. package/src/connectivity/node.d.ts +1 -1
  16. package/src/connectivity/node.js +1 -1
  17. package/src/connectivity/run-checks.js +13 -6
  18. package/src/connectivity/targets.d.ts +11 -1
  19. package/src/connectivity/targets.js +34 -1
  20. package/src/connectivity/targets.spec.js +51 -1
  21. package/src/connectivity/types.d.ts +17 -1
  22. package/src/editor-ai.d.ts +53 -0
  23. package/src/editor-ai.js +69 -0
  24. package/src/editor-ai.test.d.ts +1 -0
  25. package/src/editor-ai.test.js +37 -0
  26. package/src/embeddings.d.ts +82 -0
  27. package/src/embeddings.js +106 -0
  28. package/src/embeddings.spec.d.ts +1 -0
  29. package/src/embeddings.spec.js +43 -0
  30. package/src/events.d.ts +27 -1
  31. package/src/events.js +8 -0
  32. package/src/index.d.ts +3 -0
  33. package/src/index.js +3 -0
  34. package/src/messages.d.ts +15 -0
  35. package/src/organization.d.ts +9 -0
  36. package/src/perf-report.d.ts +116 -0
  37. package/src/perf-report.js +122 -0
  38. package/src/projects.d.ts +109 -12
  39. package/src/projects.js +87 -9
  40. package/src/proxy.d.ts +1 -1
  41. package/src/realtime.d.ts +232 -0
  42. package/src/realtime.js +158 -0
  43. package/src/realtime.spec.d.ts +1 -0
  44. package/src/realtime.spec.js +122 -0
  45. package/src/vpc-peering.d.ts +49 -0
  46. package/src/vpc-peering.js +1 -0
@@ -0,0 +1,116 @@
1
+ import { z } from "zod";
2
+ export declare const CURRENT_PERF_REPORT_SCHEMA_VERSION = 1;
3
+ export declare const PerfIncidentTypeSchema: z.ZodEnum<{
4
+ hang: "hang";
5
+ "memory-pressure": "memory-pressure";
6
+ "recovered-hang": "recovered-hang";
7
+ "recovered-unclean-exit": "recovered-unclean-exit";
8
+ "renderer-crash": "renderer-crash";
9
+ }>;
10
+ export type PerfIncidentType = z.infer<typeof PerfIncidentTypeSchema>;
11
+ export declare const PerfProcessSchema: z.ZodObject<{
12
+ kind: z.ZodEnum<{
13
+ browser: "browser";
14
+ child: "child";
15
+ gpu: "gpu";
16
+ renderer: "renderer";
17
+ utility: "utility";
18
+ }>;
19
+ pid: z.ZodNumber;
20
+ memoryKb: z.ZodNumber;
21
+ cpuPercent: z.ZodNumber;
22
+ tabId: z.ZodOptional<z.ZodString>;
23
+ }, z.core.$strip>;
24
+ export type PerfProcess = z.infer<typeof PerfProcessSchema>;
25
+ export declare const PerfTabSchema: z.ZodObject<{
26
+ tabId: z.ZodString;
27
+ route: z.ZodOptional<z.ZodString>;
28
+ feature: z.ZodOptional<z.ZodString>;
29
+ jsHeapUsedKb: z.ZodOptional<z.ZodNumber>;
30
+ jsHeapLimitKb: z.ZodOptional<z.ZodNumber>;
31
+ subsystems: z.ZodRecord<z.ZodString, z.ZodNumber>;
32
+ livenessLatencyMs: z.ZodOptional<z.ZodNumber>;
33
+ }, z.core.$strip>;
34
+ export type PerfTab = z.infer<typeof PerfTabSchema>;
35
+ export declare const PerfSampleSchema: z.ZodObject<{
36
+ t: z.ZodNumber;
37
+ desktopFootprintKb: z.ZodNumber;
38
+ freeMemoryKb: z.ZodNumber;
39
+ perTabHeapKb: z.ZodRecord<z.ZodString, z.ZodNumber>;
40
+ }, z.core.$strip>;
41
+ export type PerfSample = z.infer<typeof PerfSampleSchema>;
42
+ export declare const PerfReportSchema: z.ZodObject<{
43
+ schemaVersion: z.ZodNumber;
44
+ incidentType: z.ZodEnum<{
45
+ hang: "hang";
46
+ "memory-pressure": "memory-pressure";
47
+ "recovered-hang": "recovered-hang";
48
+ "recovered-unclean-exit": "recovered-unclean-exit";
49
+ "renderer-crash": "renderer-crash";
50
+ }>;
51
+ sessionId: z.ZodString;
52
+ deviceId: z.ZodString;
53
+ appVersion: z.ZodString;
54
+ platform: z.ZodEnum<{
55
+ darwin: "darwin";
56
+ linux: "linux";
57
+ win32: "win32";
58
+ }>;
59
+ channel: z.ZodEnum<{
60
+ alpha: "alpha";
61
+ stable: "stable";
62
+ }>;
63
+ timestamp: z.ZodNumber;
64
+ machine: z.ZodObject<{
65
+ totalMemoryKb: z.ZodNumber;
66
+ freeMemoryKb: z.ZodNumber;
67
+ desktopFootprintKb: z.ZodNumber;
68
+ }, z.core.$strip>;
69
+ processes: z.ZodArray<z.ZodObject<{
70
+ kind: z.ZodEnum<{
71
+ browser: "browser";
72
+ child: "child";
73
+ gpu: "gpu";
74
+ renderer: "renderer";
75
+ utility: "utility";
76
+ }>;
77
+ pid: z.ZodNumber;
78
+ memoryKb: z.ZodNumber;
79
+ cpuPercent: z.ZodNumber;
80
+ tabId: z.ZodOptional<z.ZodString>;
81
+ }, z.core.$strip>>;
82
+ tabs: z.ZodArray<z.ZodObject<{
83
+ tabId: z.ZodString;
84
+ route: z.ZodOptional<z.ZodString>;
85
+ feature: z.ZodOptional<z.ZodString>;
86
+ jsHeapUsedKb: z.ZodOptional<z.ZodNumber>;
87
+ jsHeapLimitKb: z.ZodOptional<z.ZodNumber>;
88
+ subsystems: z.ZodRecord<z.ZodString, z.ZodNumber>;
89
+ livenessLatencyMs: z.ZodOptional<z.ZodNumber>;
90
+ }, z.core.$strip>>;
91
+ crash: z.ZodOptional<z.ZodObject<{
92
+ reason: z.ZodString;
93
+ exitCode: z.ZodOptional<z.ZodNumber>;
94
+ oom: z.ZodOptional<z.ZodBoolean>;
95
+ }, z.core.$strip>>;
96
+ hang: z.ZodOptional<z.ZodObject<{
97
+ startedAt: z.ZodNumber;
98
+ durationMs: z.ZodNumber;
99
+ recovered: z.ZodBoolean;
100
+ surface: z.ZodString;
101
+ }, z.core.$strip>>;
102
+ samples: z.ZodArray<z.ZodObject<{
103
+ t: z.ZodNumber;
104
+ desktopFootprintKb: z.ZodNumber;
105
+ freeMemoryKb: z.ZodNumber;
106
+ perTabHeapKb: z.ZodRecord<z.ZodString, z.ZodNumber>;
107
+ }, z.core.$strip>>;
108
+ }, z.core.$strip>;
109
+ export type PerfReport = z.infer<typeof PerfReportSchema>;
110
+ /**
111
+ * Collapses opaque identifiers out of a route/URL so a report can't carry a
112
+ * project/space id. Keeps the structural shape (which screen was open) while
113
+ * masking the specific resource.
114
+ */
115
+ export declare function redactPerfRoute(route: string | undefined): string | undefined;
116
+ export declare function redactPerfReport(report: PerfReport): PerfReport;
@@ -0,0 +1,122 @@
1
+ import { z } from "zod";
2
+ // ============================================================================
3
+ // Desktop performance & crash monitoring wire contract.
4
+ //
5
+ // Canonical schema. The Electron desktop app lives in a separate workspace and
6
+ // cannot import this file, so it keeps a hand-mirrored TypeScript type in
7
+ // code/packages/electron-app/src/perf-report.types.ts. Keep the two in sync and
8
+ // bump CURRENT_PERF_REPORT_SCHEMA_VERSION on any breaking shape change.
9
+ // ============================================================================
10
+ export const CURRENT_PERF_REPORT_SCHEMA_VERSION = 1;
11
+ export const PerfIncidentTypeSchema = z.enum([
12
+ "renderer-crash",
13
+ "hang",
14
+ "recovered-hang",
15
+ "memory-pressure",
16
+ "recovered-unclean-exit",
17
+ ]);
18
+ export const PerfProcessSchema = z.object({
19
+ kind: z.enum(["browser", "renderer", "gpu", "utility", "child"]),
20
+ pid: z.number(),
21
+ memoryKb: z.number(),
22
+ cpuPercent: z.number(),
23
+ tabId: z.string().optional(),
24
+ });
25
+ export const PerfTabSchema = z.object({
26
+ tabId: z.string(),
27
+ route: z.string().optional(),
28
+ feature: z.string().optional(),
29
+ jsHeapUsedKb: z.number().optional(),
30
+ jsHeapLimitKb: z.number().optional(),
31
+ subsystems: z.record(z.string(), z.number()),
32
+ livenessLatencyMs: z.number().optional(),
33
+ });
34
+ export const PerfSampleSchema = z.object({
35
+ t: z.number(),
36
+ desktopFootprintKb: z.number(),
37
+ freeMemoryKb: z.number(),
38
+ perTabHeapKb: z.record(z.string(), z.number()),
39
+ });
40
+ export const PerfReportSchema = z.object({
41
+ schemaVersion: z.number(),
42
+ incidentType: PerfIncidentTypeSchema,
43
+ sessionId: z.string(),
44
+ deviceId: z.string(),
45
+ appVersion: z.string(),
46
+ platform: z.enum(["darwin", "win32", "linux"]),
47
+ channel: z.enum(["stable", "alpha"]),
48
+ timestamp: z.number(),
49
+ machine: z.object({
50
+ totalMemoryKb: z.number(),
51
+ freeMemoryKb: z.number(),
52
+ desktopFootprintKb: z.number(),
53
+ }),
54
+ processes: z.array(PerfProcessSchema),
55
+ tabs: z.array(PerfTabSchema),
56
+ crash: z
57
+ .object({
58
+ reason: z.string(),
59
+ exitCode: z.number().optional(),
60
+ oom: z.boolean().optional(),
61
+ })
62
+ .optional(),
63
+ hang: z
64
+ .object({
65
+ startedAt: z.number(),
66
+ durationMs: z.number(),
67
+ recovered: z.boolean(),
68
+ surface: z.string(),
69
+ })
70
+ .optional(),
71
+ samples: z.array(PerfSampleSchema),
72
+ });
73
+ // ---------------------------------------------------------------------------
74
+ // Route/URL redaction. The desktop client redacts before sending; this runs
75
+ // again at ingest (defense in depth) because the service cannot import the
76
+ // renderer's redactSnapshot helper across the workspace boundary.
77
+ // ---------------------------------------------------------------------------
78
+ const PROJECT_ID_SEGMENTS = new Set([
79
+ "projects",
80
+ "content",
81
+ "fusion",
82
+ "space",
83
+ "org",
84
+ "organization",
85
+ ]);
86
+ /**
87
+ * Collapses opaque identifiers out of a route/URL so a report can't carry a
88
+ * project/space id. Keeps the structural shape (which screen was open) while
89
+ * masking the specific resource.
90
+ */
91
+ export function redactPerfRoute(route) {
92
+ if (!route) {
93
+ return route;
94
+ }
95
+ const [pathPart] = route.split("?");
96
+ const segments = pathPart.split("/");
97
+ const redacted = segments.map((segment, index) => {
98
+ var _a;
99
+ if (!segment) {
100
+ return segment;
101
+ }
102
+ const previous = (_a = segments[index - 1]) === null || _a === void 0 ? void 0 : _a.toLowerCase();
103
+ if (previous && PROJECT_ID_SEGMENTS.has(previous)) {
104
+ return ":id";
105
+ }
106
+ // Bare id-looking segments (uuids, long hex/base62 tokens).
107
+ if (/^[0-9a-f]{16,}$/i.test(segment) || /^[0-9a-z]{20,}$/i.test(segment)) {
108
+ return ":id";
109
+ }
110
+ return segment;
111
+ });
112
+ return redacted.join("/");
113
+ }
114
+ export function redactPerfReport(report) {
115
+ return {
116
+ ...report,
117
+ tabs: report.tabs.map((tab) => ({
118
+ ...tab,
119
+ route: redactPerfRoute(tab.route),
120
+ })),
121
+ };
122
+ }
package/src/projects.d.ts CHANGED
@@ -153,7 +153,7 @@ export interface ReadyMessage extends BaseMessage {
153
153
  }
154
154
  export type MachineState = "unknown" | "created" | "starting" | "started" | "stopping" | "stopped" | "suspending" | "suspended" | "replacing" | "destroying" | "destroyed" | "not-found" | "running" | "failed";
155
155
  export type FlyVolumeState = "unknown" | "creating" | "created" | "extending" | "restoring" | "enabling_remote_export" | "hydrating" | "recovering" | "scheduling_destroy" | "pending_destroy" | "failed";
156
- export type GitAuthErrorCode = "git-auth-failed" | "git-auth-failed-root-repo" | "git-auth-failed-folder-added-by" | "git-auth-failed-folder-created-by" | "git-auth-failed-repo-not-found" | "git-auth-failed-repo-renamed" | "git-auth-failed-folder-server-token" | "git-auth-failed-root-repo-server-token" | "git-auth-failed-ghes-unreachable";
156
+ export type GitAuthErrorCode = "git-auth-failed" | "git-auth-failed-root-repo" | "git-auth-failed-folder-added-by" | "git-auth-failed-folder-created-by" | "git-auth-failed-repo-not-found" | "git-auth-failed-repo-renamed" | "git-auth-failed-folder-server-token" | "git-auth-failed-root-repo-server-token" | "git-auth-failed-ghes-unreachable" | "git-auth-reauth-required";
157
157
  /**
158
158
  * Git provider types for diagnostics.
159
159
  */
@@ -909,12 +909,6 @@ export interface Project {
909
909
  deletedAt?: InMigrationDateNullable;
910
910
  /** User ID of whoever deleted the project. */
911
911
  deletedBy?: string;
912
- /**
913
- * When true, branches are stored in the standalone `branches` collection
914
- * instead of embedded in project.branches field.
915
- * Defaults to false for backwards compatibility with existing projects.
916
- */
917
- useBranchesCollection?: boolean;
918
912
  /** When true, the project is in code-only mode */
919
913
  codeOnlyMode?: boolean;
920
914
  /**
@@ -1075,8 +1069,6 @@ export interface CreateProjectOptions {
1075
1069
  autoApplySetup?: boolean;
1076
1070
  templateId?: string;
1077
1071
  useInternalHost?: boolean;
1078
- /** Store branches in the standalone `branches` collection vs embedded in the project doc. */
1079
- useBranchesCollection?: boolean;
1080
1072
  /** @internal Read-only source repo cloned to bootstrap the project. Carried through to Firestore. */
1081
1073
  templateRepoUrl?: string;
1082
1074
  /** @internal First-class hosting config copied from the template. Carried through to Firestore. */
@@ -1497,9 +1489,8 @@ export declare const ProjectHostingSchema: z.ZodObject<{
1497
1489
  uploading: "uploading";
1498
1490
  }>>;
1499
1491
  publishedCommit: z.ZodOptional<z.ZodString>;
1500
- customDomain: z.ZodOptional<z.ZodString>;
1501
- customDomainVerified: z.ZodOptional<z.ZodBoolean>;
1502
1492
  autoDeploy: z.ZodOptional<z.ZodBoolean>;
1493
+ domainIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1503
1494
  }, z.core.$strip>;
1504
1495
  export type ProjectHosting = z.infer<typeof ProjectHostingSchema>;
1505
1496
  /**
@@ -1718,6 +1709,113 @@ export declare const GetDeploysResponseSchema: z.ZodObject<{
1718
1709
  }, z.core.$strip>>;
1719
1710
  }, z.core.$strip>;
1720
1711
  export type GetDeploysResponse = z.infer<typeof GetDeploysResponseSchema>;
1712
+ export declare const HostingDomainStatusSchema: z.ZodEnum<{
1713
+ active: "active";
1714
+ failed: "failed";
1715
+ pending: "pending";
1716
+ provisioning: "provisioning";
1717
+ verifying: "verifying";
1718
+ }>;
1719
+ export type HostingDomainStatus = z.infer<typeof HostingDomainStatusSchema>;
1720
+ export declare const HostingDomainKindSchema: z.ZodEnum<{
1721
+ apex: "apex";
1722
+ subdomain: "subdomain";
1723
+ }>;
1724
+ export type HostingDomainKind = z.infer<typeof HostingDomainKindSchema>;
1725
+ /**
1726
+ * Custom domain record, stored at `hosting-domains/{domain}`.
1727
+ * The normalized domain is the doc key — global uniqueness comes for free.
1728
+ * This doc is both the record AND the claim for the domain.
1729
+ */
1730
+ export declare const HostingDomainSchema: z.ZodObject<{
1731
+ domain: z.ZodString;
1732
+ kind: z.ZodEnum<{
1733
+ apex: "apex";
1734
+ subdomain: "subdomain";
1735
+ }>;
1736
+ projectId: z.ZodString;
1737
+ ownerId: z.ZodString;
1738
+ status: z.ZodEnum<{
1739
+ active: "active";
1740
+ failed: "failed";
1741
+ pending: "pending";
1742
+ provisioning: "provisioning";
1743
+ verifying: "verifying";
1744
+ }>;
1745
+ dnsAuthId: z.ZodString;
1746
+ delegationTarget: z.ZodString;
1747
+ trafficTarget: z.ZodOptional<z.ZodString>;
1748
+ certId: z.ZodOptional<z.ZodString>;
1749
+ certMapEntryName: z.ZodOptional<z.ZodString>;
1750
+ httpRouteName: z.ZodOptional<z.ZodString>;
1751
+ createdAt: z.ZodNumber;
1752
+ pendingSince: z.ZodNumber;
1753
+ verifyingSince: z.ZodOptional<z.ZodNumber>;
1754
+ attemptId: z.ZodOptional<z.ZodString>;
1755
+ verifiedAt: z.ZodOptional<z.ZodNumber>;
1756
+ error: z.ZodOptional<z.ZodString>;
1757
+ failedStep: z.ZodOptional<z.ZodEnum<{
1758
+ dns: "dns";
1759
+ https: "https";
1760
+ }>>;
1761
+ createdBy: z.ZodString;
1762
+ }, z.core.$strip>;
1763
+ export type HostingDomain = z.infer<typeof HostingDomainSchema>;
1764
+ export declare const AddDomainRequestSchema: z.ZodObject<{
1765
+ projectId: z.ZodString;
1766
+ domain: z.ZodString;
1767
+ }, z.core.$strip>;
1768
+ export type AddDomainRequest = z.infer<typeof AddDomainRequestSchema>;
1769
+ export declare const AddDomainResponseSchema: z.ZodObject<{
1770
+ domain: z.ZodString;
1771
+ kind: z.ZodEnum<{
1772
+ apex: "apex";
1773
+ subdomain: "subdomain";
1774
+ }>;
1775
+ records: z.ZodObject<{
1776
+ traffic: z.ZodObject<{
1777
+ recordType: z.ZodEnum<{
1778
+ A: "A";
1779
+ CNAME: "CNAME";
1780
+ }>;
1781
+ name: z.ZodString;
1782
+ value: z.ZodString;
1783
+ }, z.core.$strip>;
1784
+ validation: z.ZodObject<{
1785
+ recordType: z.ZodEnum<{
1786
+ A: "A";
1787
+ CNAME: "CNAME";
1788
+ }>;
1789
+ name: z.ZodString;
1790
+ value: z.ZodString;
1791
+ }, z.core.$strip>;
1792
+ }, z.core.$strip>;
1793
+ }, z.core.$strip>;
1794
+ export type AddDomainResponse = z.infer<typeof AddDomainResponseSchema>;
1795
+ export declare const VerifyDomainRequestSchema: z.ZodObject<{
1796
+ projectId: z.ZodString;
1797
+ domain: z.ZodString;
1798
+ }, z.core.$strip>;
1799
+ export type VerifyDomainRequest = z.infer<typeof VerifyDomainRequestSchema>;
1800
+ export declare const VerifyDomainResponseSchema: z.ZodObject<{
1801
+ status: z.ZodEnum<{
1802
+ active: "active";
1803
+ failed: "failed";
1804
+ pending: "pending";
1805
+ provisioning: "provisioning";
1806
+ verifying: "verifying";
1807
+ }>;
1808
+ }, z.core.$strip>;
1809
+ export type VerifyDomainResponse = z.infer<typeof VerifyDomainResponseSchema>;
1810
+ export declare const RemoveDomainRequestSchema: z.ZodObject<{
1811
+ projectId: z.ZodString;
1812
+ domain: z.ZodString;
1813
+ }, z.core.$strip>;
1814
+ export type RemoveDomainRequest = z.infer<typeof RemoveDomainRequestSchema>;
1815
+ export declare const RemoveDomainResponseSchema: z.ZodObject<{
1816
+ success: z.ZodLiteral<true>;
1817
+ }, z.core.$strip>;
1818
+ export type RemoveDomainResponse = z.infer<typeof RemoveDomainResponseSchema>;
1721
1819
  export declare const CloneProjectOptionsSchema: z.ZodObject<{
1722
1820
  sourceProjectId: z.ZodString;
1723
1821
  sourceBranchName: z.ZodDefault<z.ZodString>;
@@ -1728,7 +1826,6 @@ export declare const CloneProjectOptionsSchema: z.ZodObject<{
1728
1826
  }>;
1729
1827
  userEmail: z.ZodOptional<z.ZodString>;
1730
1828
  useKube: z.ZodDefault<z.ZodBoolean>;
1731
- useBranchesCollection: z.ZodDefault<z.ZodBoolean>;
1732
1829
  }, z.core.$strip>;
1733
1830
  export type CloneProjectOptions = z.infer<typeof CloneProjectOptionsSchema>;
1734
1831
  export declare const DuplicateBranchOptionsSchema: z.ZodObject<{
package/src/projects.js CHANGED
@@ -322,12 +322,13 @@ export const ProjectHostingSchema = z.object({
322
322
  lastDeployStatus: DeployStatusSchema.optional(),
323
323
  /** Git commit currently live at the project's hosting URL (set on go-live). */
324
324
  publishedCommit: z.string().optional(),
325
- customDomain: z.string().optional(),
326
- customDomainVerified: z.boolean().optional(),
327
325
  autoDeploy: z
328
326
  .boolean()
329
327
  .optional()
330
328
  .meta({ description: "auto-deploy on push/merge" }),
329
+ domainIds: z.array(z.string()).optional().meta({
330
+ 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.",
331
+ }),
331
332
  });
332
333
  /**
333
334
  * Canonical "is this project hostable" predicate. Keys off the explicit
@@ -613,6 +614,90 @@ export const GetDeploysRequestSchema = z.object({
613
614
  export const GetDeploysResponseSchema = z.object({
614
615
  deploys: z.array(DeployListItemSchema),
615
616
  });
617
+ export const HostingDomainStatusSchema = z.enum([
618
+ "pending",
619
+ "verifying",
620
+ "provisioning",
621
+ "active",
622
+ "failed",
623
+ ]);
624
+ export const HostingDomainKindSchema = z.enum(["apex", "subdomain"]);
625
+ /**
626
+ * Custom domain record, stored at `hosting-domains/{domain}`.
627
+ * The normalized domain is the doc key — global uniqueness comes for free.
628
+ * This doc is both the record AND the claim for the domain.
629
+ */
630
+ export const HostingDomainSchema = z.object({
631
+ domain: z
632
+ .string()
633
+ .meta({ description: "Doc key — normalized (punycode) domain." }),
634
+ kind: HostingDomainKindSchema,
635
+ projectId: z.string(),
636
+ ownerId: z.string(),
637
+ status: HostingDomainStatusSchema,
638
+ dnsAuthId: z
639
+ .string()
640
+ .meta({ description: "GCP DNS authorization resource name." }),
641
+ delegationTarget: z.string().meta({
642
+ description: "_acme-challenge CNAME value the customer must add.",
643
+ }),
644
+ trafficTarget: z.string().optional().meta({
645
+ 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.",
646
+ }),
647
+ certId: z
648
+ .string()
649
+ .optional()
650
+ .meta({ description: "Certificate Manager cert resource name." }),
651
+ certMapEntryName: z.string().optional(),
652
+ httpRouteName: z.string().optional(),
653
+ createdAt: z.number(),
654
+ pendingSince: z.number().meta({
655
+ description: "TTL anchor: set on entering `pending`, re-stamped on `failed`→`pending`.",
656
+ }),
657
+ verifyingSince: z.number().optional().meta({
658
+ 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.",
659
+ }),
660
+ attemptId: z.string().optional().meta({
661
+ 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.",
662
+ }),
663
+ verifiedAt: z.number().optional(),
664
+ error: z.string().optional(),
665
+ failedStep: z.enum(["dns", "https"]).optional().meta({
666
+ description: "Which setup step failed, set alongside `status: failed` so the UI can attribute the failure. `dns` = delegation verification, `https` = cert/route provisioning.",
667
+ }),
668
+ createdBy: z.string(),
669
+ });
670
+ export const AddDomainRequestSchema = z.object({
671
+ projectId: z.string(),
672
+ domain: z.string(),
673
+ });
674
+ const DnsRecordSchema = z.object({
675
+ recordType: z.enum(["A", "CNAME"]),
676
+ name: z.string(),
677
+ value: z.string(),
678
+ });
679
+ export const AddDomainResponseSchema = z.object({
680
+ domain: z.string(),
681
+ kind: HostingDomainKindSchema,
682
+ records: z.object({
683
+ traffic: DnsRecordSchema,
684
+ validation: DnsRecordSchema,
685
+ }),
686
+ });
687
+ export const VerifyDomainRequestSchema = z.object({
688
+ projectId: z.string(),
689
+ domain: z.string(),
690
+ });
691
+ export const VerifyDomainResponseSchema = z.object({
692
+ status: HostingDomainStatusSchema,
693
+ });
694
+ export const RemoveDomainRequestSchema = z.object({
695
+ projectId: z.string(),
696
+ domain: z.string(),
697
+ });
698
+ export const RemoveDomainResponseSchema = z.object({
699
+ success: z.literal(true),
700
+ });
616
701
  export const CloneProjectOptionsSchema = z.object({
617
702
  sourceProjectId: z.string().min(1).meta({
618
703
  description: "Project to clone from.",
@@ -640,13 +725,6 @@ export const CloneProjectOptionsSchema = z.object({
640
725
  useKube: z.boolean().default(false).meta({
641
726
  description: "Whether to provision on cloud-v2 (Kubernetes). Defaults to false.",
642
727
  }),
643
- useBranchesCollection: z
644
- .boolean()
645
- .default(false)
646
- .meta({
647
- description: "Whether the new project stores branches in the standalone `branches` " +
648
- "collection rather than embedded in the project doc. Defaults to false.",
649
- }),
650
728
  });
651
729
  export const DuplicateBranchOptionsSchema = z.object({
652
730
  projectId: z.string().min(1).meta({
package/src/proxy.d.ts CHANGED
@@ -20,7 +20,7 @@ export interface ProxyConfig {
20
20
  *
21
21
  * `proxyDestination` is always passed through unchanged.
22
22
  */
23
- export declare function getProxyConfig({ devServerUrl, proxyOrigin, proxyDefaultOrigin, proxyDestination }: ProxyConfig): {
23
+ export declare function getProxyConfig({ devServerUrl, proxyOrigin, proxyDefaultOrigin, proxyDestination, }: ProxyConfig): {
24
24
  proxyOrigin: string | undefined;
25
25
  proxyDefaultOrigin: string | undefined;
26
26
  proxyDestination: string | undefined;