@builder.io/ai-utils 0.84.0 → 0.85.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 +1 -1
- package/src/events.d.ts +28 -1
- package/src/events.js +8 -0
- package/src/projects.d.ts +120 -2
- package/src/projects.js +99 -2
package/package.json
CHANGED
package/src/events.d.ts
CHANGED
|
@@ -1300,7 +1300,34 @@ export declare const McpPrototypePulledV1: {
|
|
|
1300
1300
|
eventName: "mcp.prototype.pulled";
|
|
1301
1301
|
version: "1";
|
|
1302
1302
|
};
|
|
1303
|
-
export type
|
|
1303
|
+
export type HostingCustomDomainCertCheckV1 = FusionEventVariant<"hosting.custom-domain.cert-check", {
|
|
1304
|
+
domain: string;
|
|
1305
|
+
projectId: string;
|
|
1306
|
+
certId: string;
|
|
1307
|
+
attemptId: string;
|
|
1308
|
+
startedAtMs: number;
|
|
1309
|
+
timeoutMs: number;
|
|
1310
|
+
}, {
|
|
1311
|
+
projectId: string;
|
|
1312
|
+
}, 1>;
|
|
1313
|
+
export declare const HostingCustomDomainCertCheckV1: {
|
|
1314
|
+
eventName: "hosting.custom-domain.cert-check";
|
|
1315
|
+
version: "1";
|
|
1316
|
+
};
|
|
1317
|
+
export type HostingCustomDomainDelegationCheckV1 = FusionEventVariant<"hosting.custom-domain.delegation-check", {
|
|
1318
|
+
domain: string;
|
|
1319
|
+
projectId: string;
|
|
1320
|
+
attemptId: string;
|
|
1321
|
+
startedAtMs: number;
|
|
1322
|
+
timeoutMs: number;
|
|
1323
|
+
}, {
|
|
1324
|
+
projectId: string;
|
|
1325
|
+
}, 1>;
|
|
1326
|
+
export declare const HostingCustomDomainDelegationCheckV1: {
|
|
1327
|
+
eventName: "hosting.custom-domain.delegation-check";
|
|
1328
|
+
version: "1";
|
|
1329
|
+
};
|
|
1330
|
+
export type FusionEvent = ClientDevtoolsSessionStartedEvent | ClientDevtoolsSessionIdleEventV1 | ClientDevtoolsToolCallRequestV1 | ClientDevtoolsToolCallV1 | ClientDevtoolsToolResultV1 | ClientDevtoolsBuildMigratedV1 | ClientDevtoolsBuildCompletedV1 | ClientDevtoolsBuildUploadedV1 | ClientDevtoolsBuildFailedV1 | FusionProjectCreatedV1 | SetupAgentCompletedV1 | GitPrMergedV1 | GitPrCreatedV1 | GitPrClosedV1 | ForceSetupAgentV1 | ClawMessageSentV1 | CodegenCompletionV1 | CodegenUserPromptV1 | GitWebhooksRegisterV1 | FusionProjectSettingsUpdatedV1 | VideoRecordingCompletedV1 | TimelineRecordingReadyV1 | FusionBranchCreatedV1 | FusionContainerStartedV1 | FusionContainerFailedV1 | FusionBranchFailedV1 | BotMentionGitHubExternalPrV1 | BotMentionGitHubInternalPrV1 | BotMentionGitLabPrV1 | BotMentionBitbucketPrV1 | BotMentionAzurePrV1 | ReviewSubmittedV1 | PrReviewRequestedV1 | FigmaDecodeJobV1 | ProjectSnapshotRefreshV1 | ProjectSnapshotCapturedV1 | ProjectSnapshotCreatedV1 | ProjectSnapshotFailedV1 | ProjectSnapshotReadyCheckV1 | ProjectSnapshotPodWatchV1 | McpPrototypePulledV1 | HostingCustomDomainCertCheckV1 | HostingCustomDomainDelegationCheckV1;
|
|
1304
1331
|
export interface ModelPermissionRequiredEvent {
|
|
1305
1332
|
type: "assistant.model.permission.required";
|
|
1306
1333
|
data: {
|
package/src/events.js
CHANGED
|
@@ -162,3 +162,11 @@ export const McpPrototypePulledV1 = {
|
|
|
162
162
|
eventName: "mcp.prototype.pulled",
|
|
163
163
|
version: "1",
|
|
164
164
|
};
|
|
165
|
+
export const HostingCustomDomainCertCheckV1 = {
|
|
166
|
+
eventName: "hosting.custom-domain.cert-check",
|
|
167
|
+
version: "1",
|
|
168
|
+
};
|
|
169
|
+
export const HostingCustomDomainDelegationCheckV1 = {
|
|
170
|
+
eventName: "hosting.custom-domain.delegation-check",
|
|
171
|
+
version: "1",
|
|
172
|
+
};
|
package/src/projects.d.ts
CHANGED
|
@@ -1490,9 +1490,8 @@ export declare const ProjectHostingSchema: z.ZodObject<{
|
|
|
1490
1490
|
uploading: "uploading";
|
|
1491
1491
|
}>>;
|
|
1492
1492
|
publishedCommit: z.ZodOptional<z.ZodString>;
|
|
1493
|
-
customDomain: z.ZodOptional<z.ZodString>;
|
|
1494
|
-
customDomainVerified: z.ZodOptional<z.ZodBoolean>;
|
|
1495
1493
|
autoDeploy: z.ZodOptional<z.ZodBoolean>;
|
|
1494
|
+
domainIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1496
1495
|
}, z.core.$strip>;
|
|
1497
1496
|
export type ProjectHosting = z.infer<typeof ProjectHostingSchema>;
|
|
1498
1497
|
/**
|
|
@@ -1711,6 +1710,125 @@ export declare const GetDeploysResponseSchema: z.ZodObject<{
|
|
|
1711
1710
|
}, z.core.$strip>>;
|
|
1712
1711
|
}, z.core.$strip>;
|
|
1713
1712
|
export type GetDeploysResponse = z.infer<typeof GetDeploysResponseSchema>;
|
|
1713
|
+
export declare const HostingDomainStatusSchema: z.ZodEnum<{
|
|
1714
|
+
active: "active";
|
|
1715
|
+
failed: "failed";
|
|
1716
|
+
pending: "pending";
|
|
1717
|
+
provisioning: "provisioning";
|
|
1718
|
+
verifying: "verifying";
|
|
1719
|
+
}>;
|
|
1720
|
+
export type HostingDomainStatus = z.infer<typeof HostingDomainStatusSchema>;
|
|
1721
|
+
export declare const HostingDomainKindSchema: z.ZodEnum<{
|
|
1722
|
+
apex: "apex";
|
|
1723
|
+
subdomain: "subdomain";
|
|
1724
|
+
}>;
|
|
1725
|
+
export type HostingDomainKind = z.infer<typeof HostingDomainKindSchema>;
|
|
1726
|
+
/**
|
|
1727
|
+
* Custom domain record. The same shape backs two Firestore collections:
|
|
1728
|
+
*
|
|
1729
|
+
* - Lock doc `hosting-domains/{domain}` is the single exclusive owner. It
|
|
1730
|
+
* exists only once a project reaches `provisioning`/`active` (cert + route
|
|
1731
|
+
* created, DNS ownership proven) and is the cross-project serialization
|
|
1732
|
+
* point serving/deploy/unpublish read to answer "is this verified?".
|
|
1733
|
+
* `certId`/`certMapEntryName`/`httpRouteName`/`verifiedAt` are only ever
|
|
1734
|
+
* populated here.
|
|
1735
|
+
* - Claim subdoc `hosting-domains/{domain}/claims/{projectId}` is a
|
|
1736
|
+
* non-exclusive, per-project verification attempt (`pending`/`verifying`/
|
|
1737
|
+
* `failed`). Multiple projects can hold a claim on the same domain at once;
|
|
1738
|
+
* whoever proves DNS ownership first wins the lock and the losers are swept
|
|
1739
|
+
* to `failed`.
|
|
1740
|
+
*
|
|
1741
|
+
* The normalized domain is the doc key — global uniqueness comes for free.
|
|
1742
|
+
*/
|
|
1743
|
+
export declare const HostingDomainSchema: z.ZodObject<{
|
|
1744
|
+
domain: z.ZodString;
|
|
1745
|
+
kind: z.ZodEnum<{
|
|
1746
|
+
apex: "apex";
|
|
1747
|
+
subdomain: "subdomain";
|
|
1748
|
+
}>;
|
|
1749
|
+
projectId: z.ZodString;
|
|
1750
|
+
ownerId: z.ZodString;
|
|
1751
|
+
status: z.ZodEnum<{
|
|
1752
|
+
active: "active";
|
|
1753
|
+
failed: "failed";
|
|
1754
|
+
pending: "pending";
|
|
1755
|
+
provisioning: "provisioning";
|
|
1756
|
+
verifying: "verifying";
|
|
1757
|
+
}>;
|
|
1758
|
+
dnsAuthId: z.ZodString;
|
|
1759
|
+
delegationTarget: z.ZodString;
|
|
1760
|
+
trafficTarget: z.ZodOptional<z.ZodString>;
|
|
1761
|
+
certId: z.ZodOptional<z.ZodString>;
|
|
1762
|
+
certMapEntryName: z.ZodOptional<z.ZodString>;
|
|
1763
|
+
httpRouteName: z.ZodOptional<z.ZodString>;
|
|
1764
|
+
createdAt: z.ZodNumber;
|
|
1765
|
+
pendingSince: z.ZodNumber;
|
|
1766
|
+
verifyingSince: z.ZodOptional<z.ZodNumber>;
|
|
1767
|
+
attemptId: z.ZodOptional<z.ZodString>;
|
|
1768
|
+
verifiedAt: z.ZodOptional<z.ZodNumber>;
|
|
1769
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1770
|
+
failedStep: z.ZodOptional<z.ZodEnum<{
|
|
1771
|
+
dns: "dns";
|
|
1772
|
+
https: "https";
|
|
1773
|
+
}>>;
|
|
1774
|
+
createdBy: z.ZodString;
|
|
1775
|
+
}, z.core.$strip>;
|
|
1776
|
+
export type HostingDomain = z.infer<typeof HostingDomainSchema>;
|
|
1777
|
+
export declare const AddDomainRequestSchema: z.ZodObject<{
|
|
1778
|
+
projectId: z.ZodString;
|
|
1779
|
+
domain: z.ZodString;
|
|
1780
|
+
}, z.core.$strip>;
|
|
1781
|
+
export type AddDomainRequest = z.infer<typeof AddDomainRequestSchema>;
|
|
1782
|
+
export declare const AddDomainResponseSchema: z.ZodObject<{
|
|
1783
|
+
domain: z.ZodString;
|
|
1784
|
+
kind: z.ZodEnum<{
|
|
1785
|
+
apex: "apex";
|
|
1786
|
+
subdomain: "subdomain";
|
|
1787
|
+
}>;
|
|
1788
|
+
records: z.ZodObject<{
|
|
1789
|
+
traffic: z.ZodObject<{
|
|
1790
|
+
recordType: z.ZodEnum<{
|
|
1791
|
+
A: "A";
|
|
1792
|
+
CNAME: "CNAME";
|
|
1793
|
+
}>;
|
|
1794
|
+
name: z.ZodString;
|
|
1795
|
+
value: z.ZodString;
|
|
1796
|
+
}, z.core.$strip>;
|
|
1797
|
+
validation: z.ZodObject<{
|
|
1798
|
+
recordType: z.ZodEnum<{
|
|
1799
|
+
A: "A";
|
|
1800
|
+
CNAME: "CNAME";
|
|
1801
|
+
}>;
|
|
1802
|
+
name: z.ZodString;
|
|
1803
|
+
value: z.ZodString;
|
|
1804
|
+
}, z.core.$strip>;
|
|
1805
|
+
}, z.core.$strip>;
|
|
1806
|
+
}, z.core.$strip>;
|
|
1807
|
+
export type AddDomainResponse = z.infer<typeof AddDomainResponseSchema>;
|
|
1808
|
+
export declare const VerifyDomainRequestSchema: z.ZodObject<{
|
|
1809
|
+
projectId: z.ZodString;
|
|
1810
|
+
domain: z.ZodString;
|
|
1811
|
+
}, z.core.$strip>;
|
|
1812
|
+
export type VerifyDomainRequest = z.infer<typeof VerifyDomainRequestSchema>;
|
|
1813
|
+
export declare const VerifyDomainResponseSchema: z.ZodObject<{
|
|
1814
|
+
status: z.ZodEnum<{
|
|
1815
|
+
active: "active";
|
|
1816
|
+
failed: "failed";
|
|
1817
|
+
pending: "pending";
|
|
1818
|
+
provisioning: "provisioning";
|
|
1819
|
+
verifying: "verifying";
|
|
1820
|
+
}>;
|
|
1821
|
+
}, z.core.$strip>;
|
|
1822
|
+
export type VerifyDomainResponse = z.infer<typeof VerifyDomainResponseSchema>;
|
|
1823
|
+
export declare const RemoveDomainRequestSchema: z.ZodObject<{
|
|
1824
|
+
projectId: z.ZodString;
|
|
1825
|
+
domain: z.ZodString;
|
|
1826
|
+
}, z.core.$strip>;
|
|
1827
|
+
export type RemoveDomainRequest = z.infer<typeof RemoveDomainRequestSchema>;
|
|
1828
|
+
export declare const RemoveDomainResponseSchema: z.ZodObject<{
|
|
1829
|
+
success: z.ZodLiteral<true>;
|
|
1830
|
+
}, z.core.$strip>;
|
|
1831
|
+
export type RemoveDomainResponse = z.infer<typeof RemoveDomainResponseSchema>;
|
|
1714
1832
|
export declare const CloneProjectOptionsSchema: z.ZodObject<{
|
|
1715
1833
|
sourceProjectId: z.ZodString;
|
|
1716
1834
|
sourceBranchName: z.ZodDefault<z.ZodString>;
|
package/src/projects.js
CHANGED
|
@@ -324,12 +324,13 @@ export const ProjectHostingSchema = z.object({
|
|
|
324
324
|
lastDeployStatus: DeployStatusSchema.optional(),
|
|
325
325
|
/** Git commit currently live at the project's hosting URL (set on go-live). */
|
|
326
326
|
publishedCommit: z.string().optional(),
|
|
327
|
-
customDomain: z.string().optional(),
|
|
328
|
-
customDomainVerified: z.boolean().optional(),
|
|
329
327
|
autoDeploy: z
|
|
330
328
|
.boolean()
|
|
331
329
|
.optional()
|
|
332
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
|
+
}),
|
|
333
334
|
});
|
|
334
335
|
/**
|
|
335
336
|
* Canonical "is this project hostable" predicate. Keys off the explicit
|
|
@@ -615,6 +616,102 @@ export const GetDeploysRequestSchema = z.object({
|
|
|
615
616
|
export const GetDeploysResponseSchema = z.object({
|
|
616
617
|
deploys: z.array(DeployListItemSchema),
|
|
617
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. The same shape backs two Firestore collections:
|
|
629
|
+
*
|
|
630
|
+
* - Lock doc `hosting-domains/{domain}` is the single exclusive owner. It
|
|
631
|
+
* exists only once a project reaches `provisioning`/`active` (cert + route
|
|
632
|
+
* created, DNS ownership proven) and is the cross-project serialization
|
|
633
|
+
* point serving/deploy/unpublish read to answer "is this verified?".
|
|
634
|
+
* `certId`/`certMapEntryName`/`httpRouteName`/`verifiedAt` are only ever
|
|
635
|
+
* populated here.
|
|
636
|
+
* - Claim subdoc `hosting-domains/{domain}/claims/{projectId}` is a
|
|
637
|
+
* non-exclusive, per-project verification attempt (`pending`/`verifying`/
|
|
638
|
+
* `failed`). Multiple projects can hold a claim on the same domain at once;
|
|
639
|
+
* whoever proves DNS ownership first wins the lock and the losers are swept
|
|
640
|
+
* to `failed`.
|
|
641
|
+
*
|
|
642
|
+
* The normalized domain is the doc key — global uniqueness comes for free.
|
|
643
|
+
*/
|
|
644
|
+
export const HostingDomainSchema = z.object({
|
|
645
|
+
domain: z
|
|
646
|
+
.string()
|
|
647
|
+
.meta({ description: "Doc key — normalized (punycode) domain." }),
|
|
648
|
+
kind: HostingDomainKindSchema,
|
|
649
|
+
projectId: z.string(),
|
|
650
|
+
ownerId: z.string(),
|
|
651
|
+
status: HostingDomainStatusSchema,
|
|
652
|
+
dnsAuthId: z
|
|
653
|
+
.string()
|
|
654
|
+
.meta({ description: "GCP DNS authorization resource name." }),
|
|
655
|
+
delegationTarget: z.string().meta({
|
|
656
|
+
description: "_acme-challenge CNAME value the customer must add.",
|
|
657
|
+
}),
|
|
658
|
+
trafficTarget: z.string().optional().meta({
|
|
659
|
+
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.",
|
|
660
|
+
}),
|
|
661
|
+
certId: z
|
|
662
|
+
.string()
|
|
663
|
+
.optional()
|
|
664
|
+
.meta({ description: "Certificate Manager cert resource name." }),
|
|
665
|
+
certMapEntryName: z.string().optional(),
|
|
666
|
+
httpRouteName: z.string().optional(),
|
|
667
|
+
createdAt: z.number(),
|
|
668
|
+
pendingSince: z.number().meta({
|
|
669
|
+
description: "TTL anchor: set on entering `pending`, re-stamped on `failed`→`pending`.",
|
|
670
|
+
}),
|
|
671
|
+
verifyingSince: z.number().optional().meta({
|
|
672
|
+
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.",
|
|
673
|
+
}),
|
|
674
|
+
attemptId: z.string().optional().meta({
|
|
675
|
+
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.",
|
|
676
|
+
}),
|
|
677
|
+
verifiedAt: z.number().optional(),
|
|
678
|
+
error: z.string().optional(),
|
|
679
|
+
failedStep: z.enum(["dns", "https"]).optional().meta({
|
|
680
|
+
description: "Which setup step failed, set alongside `status: failed` so the UI can attribute the failure. `dns` = delegation verification, `https` = cert/route provisioning.",
|
|
681
|
+
}),
|
|
682
|
+
createdBy: z.string(),
|
|
683
|
+
});
|
|
684
|
+
export const AddDomainRequestSchema = z.object({
|
|
685
|
+
projectId: z.string(),
|
|
686
|
+
domain: z.string(),
|
|
687
|
+
});
|
|
688
|
+
const DnsRecordSchema = z.object({
|
|
689
|
+
recordType: z.enum(["A", "CNAME"]),
|
|
690
|
+
name: z.string(),
|
|
691
|
+
value: z.string(),
|
|
692
|
+
});
|
|
693
|
+
export const AddDomainResponseSchema = z.object({
|
|
694
|
+
domain: z.string(),
|
|
695
|
+
kind: HostingDomainKindSchema,
|
|
696
|
+
records: z.object({
|
|
697
|
+
traffic: DnsRecordSchema,
|
|
698
|
+
validation: DnsRecordSchema,
|
|
699
|
+
}),
|
|
700
|
+
});
|
|
701
|
+
export const VerifyDomainRequestSchema = z.object({
|
|
702
|
+
projectId: z.string(),
|
|
703
|
+
domain: z.string(),
|
|
704
|
+
});
|
|
705
|
+
export const VerifyDomainResponseSchema = z.object({
|
|
706
|
+
status: HostingDomainStatusSchema,
|
|
707
|
+
});
|
|
708
|
+
export const RemoveDomainRequestSchema = z.object({
|
|
709
|
+
projectId: z.string(),
|
|
710
|
+
domain: z.string(),
|
|
711
|
+
});
|
|
712
|
+
export const RemoveDomainResponseSchema = z.object({
|
|
713
|
+
success: z.literal(true),
|
|
714
|
+
});
|
|
618
715
|
export const CloneProjectOptionsSchema = z.object({
|
|
619
716
|
sourceProjectId: z.string().min(1).meta({
|
|
620
717
|
description: "Project to clone from.",
|