@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
@@ -1,5 +1,5 @@
1
1
  export type Source = "local" | "cloud" | "static-ip" | "vpc";
2
- export type TestId = "builder.io" | "builder.codes" | "api.builder.io" | "cdn.builder.io" | "builderio.xyz" | "builderio.xyz:ws" | "builderio.dev" | "builderio.dev:ws" | "fly.dev" | "git-host:http" | "git-host:dns" | "git-host:tcp" | "git-host:tls" | "git-host:ssh";
2
+ export type TestId = "builder.io" | "builder.codes" | "api.builder.io" | "cdn.builder.io" | "builderio.xyz" | "builderio.xyz:ws" | "builderio.dev" | "builderio.dev:ws" | "fly.dev" | "git-host:http" | "git-host:dns" | "git-host:tcp" | "git-host:tls" | "git-host:ssh" | "project:dns" | "project:tcp" | "project:tls" | "project:http" | "project-health:dns" | "project-health:tcp" | "project-health:tls" | "project-health:http";
3
3
  export interface Test {
4
4
  source: Source;
5
5
  testId: TestId;
@@ -25,6 +25,12 @@ export interface RunChecksInput {
25
25
  * Typically only needed server-side for static IP routing.
26
26
  */
27
27
  dispatcher?: object;
28
+ /**
29
+ * Treat 4xx HTTP responses as failures (not just 5xx). Used by
30
+ * `doctor --browser` so a proxy block page (e.g. a 403 from Zscaler) counts
31
+ * as a failure instead of a reachable-server pass.
32
+ */
33
+ strictHttpStatus?: boolean;
28
34
  /**
29
35
  * Returns a connected socket tunneled through a proxy (via HTTP CONNECT
30
36
  * or SOCKS5). Used by TCP and TLS checks for static IP / VPC routing. The
@@ -45,6 +51,16 @@ export interface RunChecksInput {
45
51
  dnsResolver?: {
46
52
  servers: string[];
47
53
  };
54
+ /**
55
+ * Full URL of a specific project (e.g. a project's status-v2 endpoint) that the
56
+ * `project:*` tests probe. Resolved by resolveTarget for those testIds.
57
+ */
58
+ projectUrl?: string;
59
+ /**
60
+ * URL of the health.builderio.* domain the project is routed through, probed by
61
+ * the `project-health:*` tests. Derived from projectUrl's kube domain.
62
+ */
63
+ projectHealthUrl?: string;
48
64
  }
49
65
  export type ProgressEvent = {
50
66
  type: "test:start";
@@ -0,0 +1,53 @@
1
+ import { z } from "zod";
2
+ export declare const EDITOR_AI_READ_DEFAULT_LIMIT = 250;
3
+ export declare const EDITOR_AI_READ_MAX_LIMIT = 1500;
4
+ export declare const EditorAiReadRequestSchema: z.ZodObject<{
5
+ contentId: z.ZodString;
6
+ offset: z.ZodOptional<z.ZodNumber>;
7
+ limit: z.ZodOptional<z.ZodNumber>;
8
+ activeLocale: z.ZodOptional<z.ZodString>;
9
+ }, z.core.$strip>;
10
+ export type EditorAiReadRequest = z.infer<typeof EditorAiReadRequestSchema>;
11
+ export declare const EditorAiReadResponseSchema: z.ZodObject<{
12
+ contentId: z.ZodString;
13
+ totalLines: z.ZodNumber;
14
+ offset: z.ZodNumber;
15
+ limit: z.ZodNumber;
16
+ activeLocale: z.ZodString;
17
+ content: z.ZodString;
18
+ }, z.core.$strip>;
19
+ export type EditorAiReadResponse = z.infer<typeof EditorAiReadResponseSchema>;
20
+ export declare const EditorAiEditRequestSchema: z.ZodObject<{
21
+ contentId: z.ZodString;
22
+ old_str: z.ZodString;
23
+ new_str: z.ZodString;
24
+ activeLocale: z.ZodOptional<z.ZodString>;
25
+ }, z.core.$strip>;
26
+ export type EditorAiEditRequest = z.infer<typeof EditorAiEditRequestSchema>;
27
+ export declare const EditorAiEditResponseSchema: z.ZodObject<{
28
+ contentId: z.ZodString;
29
+ patch: z.ZodString;
30
+ modifiedBuilderContent: z.ZodRecord<z.ZodString, z.ZodUnknown>;
31
+ }, z.core.$strip>;
32
+ export type EditorAiEditResponse = z.infer<typeof EditorAiEditResponseSchema>;
33
+ export declare const EditorAiWriteRequestSchema: z.ZodObject<{
34
+ contentId: z.ZodString;
35
+ content: z.ZodString;
36
+ activeLocale: z.ZodOptional<z.ZodString>;
37
+ }, z.core.$strip>;
38
+ export type EditorAiWriteRequest = z.infer<typeof EditorAiWriteRequestSchema>;
39
+ export declare const EditorAiWriteResponseSchema: z.ZodObject<{
40
+ contentId: z.ZodString;
41
+ modifiedBuilderContent: z.ZodRecord<z.ZodString, z.ZodUnknown>;
42
+ }, z.core.$strip>;
43
+ export type EditorAiWriteResponse = z.infer<typeof EditorAiWriteResponseSchema>;
44
+ export type EditorAiErrorCode = "BAD_REQUEST" | "UNAUTHORIZED" | "FORBIDDEN" | "NOT_FOUND" | "NO_MATCH" | "VALIDATION_FAILED" | "INTERNAL";
45
+ export declare const EditorAiErrorBodySchema: z.ZodObject<{
46
+ error: z.ZodObject<{
47
+ code: z.ZodString;
48
+ message: z.ZodString;
49
+ hint: z.ZodOptional<z.ZodString>;
50
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
51
+ }, z.core.$strip>;
52
+ }, z.core.$strip>;
53
+ export type EditorAiErrorBody = z.infer<typeof EditorAiErrorBodySchema>;
@@ -0,0 +1,69 @@
1
+ import { z } from "zod";
2
+ // Request/response contracts for the stateless /editor/read|edit|write
3
+ // endpoints. Shared so the Builder CMS MCP server reuses the same shapes.
4
+ export const EDITOR_AI_READ_DEFAULT_LIMIT = 250;
5
+ export const EDITOR_AI_READ_MAX_LIMIT = 1500;
6
+ export const EditorAiReadRequestSchema = z
7
+ .object({
8
+ contentId: z.string().min(1),
9
+ offset: z.number().int().min(0).optional(),
10
+ limit: z.number().int().min(1).max(EDITOR_AI_READ_MAX_LIMIT).optional(),
11
+ // Locale to operate on; defaults to "Default" when omitted.
12
+ activeLocale: z.string().min(1).optional(),
13
+ })
14
+ .meta({ title: "EditorAiReadRequest" });
15
+ export const EditorAiReadResponseSchema = z
16
+ .object({
17
+ contentId: z.string(),
18
+ totalLines: z.number().int(),
19
+ offset: z.number().int(),
20
+ limit: z.number().int(),
21
+ activeLocale: z.string(),
22
+ content: z.string(),
23
+ })
24
+ .meta({ title: "EditorAiReadResponse" });
25
+ export const EditorAiEditRequestSchema = z
26
+ .object({
27
+ contentId: z.string().min(1),
28
+ old_str: z
29
+ .string()
30
+ .min(1)
31
+ .refine((s) => s.trim().length > 0, {
32
+ message: "old_str must not be only whitespace",
33
+ }),
34
+ new_str: z.string(),
35
+ // Locale to operate on; defaults to "Default" when omitted.
36
+ activeLocale: z.string().min(1).optional(),
37
+ })
38
+ .meta({ title: "EditorAiEditRequest" });
39
+ export const EditorAiEditResponseSchema = z
40
+ .object({
41
+ contentId: z.string(),
42
+ patch: z.string(),
43
+ modifiedBuilderContent: z.record(z.string(), z.unknown()),
44
+ })
45
+ .meta({ title: "EditorAiEditResponse" });
46
+ export const EditorAiWriteRequestSchema = z
47
+ .object({
48
+ contentId: z.string().min(1),
49
+ content: z.string().min(1),
50
+ // Locale to operate on; defaults to "Default" when omitted.
51
+ activeLocale: z.string().min(1).optional(),
52
+ })
53
+ .meta({ title: "EditorAiWriteRequest" });
54
+ export const EditorAiWriteResponseSchema = z
55
+ .object({
56
+ contentId: z.string(),
57
+ modifiedBuilderContent: z.record(z.string(), z.unknown()),
58
+ })
59
+ .meta({ title: "EditorAiWriteResponse" });
60
+ export const EditorAiErrorBodySchema = z
61
+ .object({
62
+ error: z.object({
63
+ code: z.string(),
64
+ message: z.string(),
65
+ hint: z.string().optional(),
66
+ details: z.record(z.string(), z.unknown()).optional(),
67
+ }),
68
+ })
69
+ .meta({ title: "EditorAiErrorBody" });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,37 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { EditorAiEditRequestSchema } from "./editor-ai.js";
3
+ describe("EditorAiEditRequestSchema", () => {
4
+ it("accepts an old_str with real content (whitespace preserved)", () => {
5
+ const parsed = EditorAiEditRequestSchema.parse({
6
+ contentId: "c1",
7
+ old_str: ' <Text text="hi" />',
8
+ new_str: ' <Text text="bye" />',
9
+ });
10
+ // Value is not trimmed — exact indentation is preserved for matching.
11
+ expect(parsed.old_str).toBe(' <Text text="hi" />');
12
+ });
13
+ it("rejects an empty old_str", () => {
14
+ const result = EditorAiEditRequestSchema.safeParse({
15
+ contentId: "c1",
16
+ old_str: "",
17
+ new_str: "x",
18
+ });
19
+ expect(result.success).toBe(false);
20
+ });
21
+ it("rejects a whitespace-only old_str", () => {
22
+ const result = EditorAiEditRequestSchema.safeParse({
23
+ contentId: "c1",
24
+ old_str: " \n\t",
25
+ new_str: "x",
26
+ });
27
+ expect(result.success).toBe(false);
28
+ });
29
+ it("allows an empty new_str (delete)", () => {
30
+ const result = EditorAiEditRequestSchema.safeParse({
31
+ contentId: "c1",
32
+ old_str: '<Text text="hi" />',
33
+ new_str: "",
34
+ });
35
+ expect(result.success).toBe(true);
36
+ });
37
+ });
@@ -0,0 +1,82 @@
1
+ import { z } from "zod";
2
+ export declare const BUILDER_EMBEDDING_MODEL = "builder-multimodal-embedding";
3
+ export declare const BUILDER_EMBEDDING_DIMENSIONS = 1024;
4
+ export declare const BUILDER_EMBEDDING_IMAGE_MIME_TYPES: readonly ["image/png", "image/jpeg", "image/webp", "image/gif"];
5
+ export declare const BuilderEmbeddingImageSchema: z.ZodObject<{
6
+ mimeType: z.ZodEnum<{
7
+ "image/gif": "image/gif";
8
+ "image/jpeg": "image/jpeg";
9
+ "image/png": "image/png";
10
+ "image/webp": "image/webp";
11
+ }>;
12
+ data: z.ZodString;
13
+ }, z.core.$strip>;
14
+ export declare const BuilderEmbeddingInputSchema: z.ZodObject<{
15
+ text: z.ZodOptional<z.ZodString>;
16
+ images: z.ZodDefault<z.ZodArray<z.ZodObject<{
17
+ mimeType: z.ZodEnum<{
18
+ "image/gif": "image/gif";
19
+ "image/jpeg": "image/jpeg";
20
+ "image/png": "image/png";
21
+ "image/webp": "image/webp";
22
+ }>;
23
+ data: z.ZodString;
24
+ }, z.core.$strip>>>;
25
+ }, z.core.$strip>;
26
+ export declare const BuilderEmbeddingsRequestSchema: z.ZodObject<{
27
+ model: z.ZodDefault<z.ZodEnum<{
28
+ auto: "auto";
29
+ "builder-multimodal-embedding": "builder-multimodal-embedding";
30
+ }>>;
31
+ inputType: z.ZodDefault<z.ZodEnum<{
32
+ document: "document";
33
+ query: "query";
34
+ }>>;
35
+ inputs: z.ZodArray<z.ZodObject<{
36
+ text: z.ZodOptional<z.ZodString>;
37
+ images: z.ZodDefault<z.ZodArray<z.ZodObject<{
38
+ mimeType: z.ZodEnum<{
39
+ "image/gif": "image/gif";
40
+ "image/jpeg": "image/jpeg";
41
+ "image/png": "image/png";
42
+ "image/webp": "image/webp";
43
+ }>;
44
+ data: z.ZodString;
45
+ }, z.core.$strip>>>;
46
+ }, z.core.$strip>>;
47
+ source: z.ZodOptional<z.ZodObject<{
48
+ appId: z.ZodOptional<z.ZodString>;
49
+ feature: z.ZodOptional<z.ZodString>;
50
+ resourceId: z.ZodOptional<z.ZodString>;
51
+ userId: z.ZodOptional<z.ZodString>;
52
+ }, z.core.$strip>>;
53
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
54
+ }, z.core.$strip>;
55
+ export type BuilderEmbeddingsRequestInput = z.input<typeof BuilderEmbeddingsRequestSchema>;
56
+ export type BuilderEmbeddingsRequest = z.output<typeof BuilderEmbeddingsRequestSchema>;
57
+ export declare const BuilderEmbeddingsResponseSchema: z.ZodObject<{
58
+ id: z.ZodString;
59
+ object: z.ZodLiteral<"list">;
60
+ model: z.ZodObject<{
61
+ publicId: z.ZodLiteral<"builder-multimodal-embedding">;
62
+ provider: z.ZodLiteral<"voyage">;
63
+ providerModel: z.ZodLiteral<"voyage-multimodal-3.5">;
64
+ version: z.ZodLiteral<"3.5">;
65
+ dimensions: z.ZodLiteral<1024>;
66
+ }, z.core.$strip>;
67
+ inputType: z.ZodEnum<{
68
+ document: "document";
69
+ query: "query";
70
+ }>;
71
+ data: z.ZodArray<z.ZodObject<{
72
+ object: z.ZodLiteral<"embedding">;
73
+ index: z.ZodNumber;
74
+ embedding: z.ZodArray<z.ZodNumber>;
75
+ }, z.core.$strip>>;
76
+ usage: z.ZodObject<{
77
+ textTokens: z.ZodNumber;
78
+ imagePixels: z.ZodNumber;
79
+ totalTokens: z.ZodNumber;
80
+ }, z.core.$strip>;
81
+ }, z.core.$strip>;
82
+ export type BuilderEmbeddingsResponse = z.infer<typeof BuilderEmbeddingsResponseSchema>;
@@ -0,0 +1,106 @@
1
+ import { z } from "zod";
2
+ export const BUILDER_EMBEDDING_MODEL = "builder-multimodal-embedding";
3
+ export const BUILDER_EMBEDDING_DIMENSIONS = 1024;
4
+ export const BUILDER_EMBEDDING_IMAGE_MIME_TYPES = [
5
+ "image/png",
6
+ "image/jpeg",
7
+ "image/webp",
8
+ "image/gif",
9
+ ];
10
+ const MAX_IMAGE_BASE64_LENGTH = 14000000;
11
+ const MAX_REQUEST_BASE64_LENGTH = 24000000;
12
+ const MAX_REQUEST_TEXT_LENGTH = 256000;
13
+ export const BuilderEmbeddingImageSchema = z.object({
14
+ mimeType: z.enum(BUILDER_EMBEDDING_IMAGE_MIME_TYPES),
15
+ data: z
16
+ .string()
17
+ .min(1)
18
+ .max(MAX_IMAGE_BASE64_LENGTH)
19
+ .regex(/^[A-Za-z0-9+/]*={0,2}$/, "Image data must be raw base64."),
20
+ });
21
+ export const BuilderEmbeddingInputSchema = z
22
+ .object({
23
+ text: z.string().trim().min(1).max(32000).optional(),
24
+ images: z.array(BuilderEmbeddingImageSchema).max(6).default([]),
25
+ })
26
+ .superRefine((input, ctx) => {
27
+ if (!input.text && input.images.length === 0) {
28
+ ctx.addIssue({
29
+ code: "custom",
30
+ message: "Each input must contain text, an image, or both.",
31
+ });
32
+ }
33
+ });
34
+ export const BuilderEmbeddingsRequestSchema = z
35
+ .object({
36
+ model: z.enum(["auto", BUILDER_EMBEDDING_MODEL]).default("auto"),
37
+ inputType: z.enum(["query", "document"]).default("document"),
38
+ inputs: z.array(BuilderEmbeddingInputSchema).min(1).max(32),
39
+ source: z
40
+ .object({
41
+ appId: z.string().max(100).optional(),
42
+ feature: z.string().max(100).optional(),
43
+ resourceId: z.string().max(200).optional(),
44
+ userId: z.string().max(200).optional(),
45
+ })
46
+ .optional(),
47
+ metadata: z.record(z.string().max(100), z.string().max(1000)).optional(),
48
+ })
49
+ .superRefine((request, ctx) => {
50
+ var _a;
51
+ var _b;
52
+ let base64Length = 0;
53
+ let textLength = 0;
54
+ for (const input of request.inputs) {
55
+ textLength += (_b = (_a = input.text) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
56
+ for (const image of input.images)
57
+ base64Length += image.data.length;
58
+ }
59
+ if (base64Length > MAX_REQUEST_BASE64_LENGTH) {
60
+ ctx.addIssue({
61
+ code: "too_big",
62
+ maximum: MAX_REQUEST_BASE64_LENGTH,
63
+ origin: "string",
64
+ inclusive: true,
65
+ message: "Combined image data is too large.",
66
+ path: ["inputs"],
67
+ });
68
+ }
69
+ if (textLength > MAX_REQUEST_TEXT_LENGTH) {
70
+ ctx.addIssue({
71
+ code: "too_big",
72
+ maximum: MAX_REQUEST_TEXT_LENGTH,
73
+ origin: "string",
74
+ inclusive: true,
75
+ message: "Combined text input is too large.",
76
+ path: ["inputs"],
77
+ });
78
+ }
79
+ })
80
+ .meta({
81
+ description: "Request body for POST /agent-native/embeddings/v1/embeddings.",
82
+ });
83
+ export const BuilderEmbeddingsResponseSchema = z.object({
84
+ id: z.string(),
85
+ object: z.literal("list"),
86
+ model: z.object({
87
+ publicId: z.literal(BUILDER_EMBEDDING_MODEL),
88
+ provider: z.literal("voyage"),
89
+ providerModel: z.literal("voyage-multimodal-3.5"),
90
+ version: z.literal("3.5"),
91
+ dimensions: z.literal(BUILDER_EMBEDDING_DIMENSIONS),
92
+ }),
93
+ inputType: z.enum(["query", "document"]),
94
+ data: z.array(z.object({
95
+ object: z.literal("embedding"),
96
+ index: z.number().int().nonnegative(),
97
+ embedding: z
98
+ .array(z.number().finite())
99
+ .length(BUILDER_EMBEDDING_DIMENSIONS),
100
+ })),
101
+ usage: z.object({
102
+ textTokens: z.number().int().nonnegative(),
103
+ imagePixels: z.number().int().nonnegative(),
104
+ totalTokens: z.number().int().nonnegative(),
105
+ }),
106
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,43 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { BUILDER_EMBEDDING_MODEL, BuilderEmbeddingsRequestSchema, } from "./embeddings";
3
+ describe("BuilderEmbeddingsRequestSchema", () => {
4
+ it("accepts retrieval text and multimodal inputs", () => {
5
+ var _a;
6
+ const parsed = BuilderEmbeddingsRequestSchema.parse({
7
+ model: BUILDER_EMBEDDING_MODEL,
8
+ inputType: "document",
9
+ inputs: [
10
+ { text: "A product launch slide" },
11
+ {
12
+ text: "A warm editorial campaign",
13
+ images: [{ mimeType: "image/png", data: "aGVsbG8=" }],
14
+ },
15
+ ],
16
+ });
17
+ expect(parsed.inputs).toHaveLength(2);
18
+ expect((_a = parsed.inputs[1]) === null || _a === void 0 ? void 0 : _a.images).toHaveLength(1);
19
+ });
20
+ it("rejects empty inputs and data URLs", () => {
21
+ expect(() => BuilderEmbeddingsRequestSchema.parse({ inputs: [{}] })).toThrow(/text, an image, or both/);
22
+ expect(() => BuilderEmbeddingsRequestSchema.parse({
23
+ inputs: [
24
+ {
25
+ images: [
26
+ {
27
+ mimeType: "image/png",
28
+ data: "data:image/png;base64,aGVsbG8=",
29
+ },
30
+ ],
31
+ },
32
+ ],
33
+ })).toThrow(/raw base64/);
34
+ });
35
+ it("rejects unsupported image formats and oversized batches", () => {
36
+ expect(() => BuilderEmbeddingsRequestSchema.parse({
37
+ inputs: [{ images: [{ mimeType: "image/svg+xml", data: "PHN2Zz4=" }] }],
38
+ })).toThrow();
39
+ expect(() => BuilderEmbeddingsRequestSchema.parse({
40
+ inputs: Array.from({ length: 33 }, () => ({ text: "text" })),
41
+ })).toThrow();
42
+ });
43
+ });
package/src/events.d.ts CHANGED
@@ -1296,7 +1296,33 @@ export declare const McpPrototypePulledV1: {
1296
1296
  eventName: "mcp.prototype.pulled";
1297
1297
  version: "1";
1298
1298
  };
1299
- 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;
1299
+ export type HostingCustomDomainCertCheckV1 = FusionEventVariant<"hosting.custom-domain.cert-check", {
1300
+ domain: string;
1301
+ projectId: string;
1302
+ certId: string;
1303
+ startedAtMs: number;
1304
+ timeoutMs: number;
1305
+ }, {
1306
+ projectId: string;
1307
+ }, 1>;
1308
+ export declare const HostingCustomDomainCertCheckV1: {
1309
+ eventName: "hosting.custom-domain.cert-check";
1310
+ version: "1";
1311
+ };
1312
+ export type HostingCustomDomainDelegationCheckV1 = FusionEventVariant<"hosting.custom-domain.delegation-check", {
1313
+ domain: string;
1314
+ projectId: string;
1315
+ attemptId: string;
1316
+ startedAtMs: number;
1317
+ timeoutMs: number;
1318
+ }, {
1319
+ projectId: string;
1320
+ }, 1>;
1321
+ export declare const HostingCustomDomainDelegationCheckV1: {
1322
+ eventName: "hosting.custom-domain.delegation-check";
1323
+ version: "1";
1324
+ };
1325
+ 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;
1300
1326
  export interface ModelPermissionRequiredEvent {
1301
1327
  type: "assistant.model.permission.required";
1302
1328
  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/index.d.ts CHANGED
@@ -19,4 +19,7 @@ export * from "./connectivity/types.js";
19
19
  export * from "./connectivity/classify.js";
20
20
  export * from "./single-tenancy.js";
21
21
  export * from "./design-systems.js";
22
+ export * from "./editor-ai.js";
23
+ export * from "./realtime.js";
24
+ export * from "./embeddings.js";
22
25
  export { connectivityErrorCodeToLikelyCause, mapConnectivityErrorMessage, } from "./connectivity/error-codes.js";
package/src/index.js CHANGED
@@ -19,4 +19,7 @@ export * from "./connectivity/types.js";
19
19
  export * from "./connectivity/classify.js";
20
20
  export * from "./single-tenancy.js";
21
21
  export * from "./design-systems.js";
22
+ export * from "./editor-ai.js";
23
+ export * from "./realtime.js";
24
+ export * from "./embeddings.js";
22
25
  export { connectivityErrorCodeToLikelyCause, mapConnectivityErrorMessage, } from "./connectivity/error-codes.js";
package/src/messages.d.ts CHANGED
@@ -93,6 +93,14 @@ export interface MCPServerURLDefinition {
93
93
  serverId: string;
94
94
  disabled: boolean;
95
95
  clientName?: string;
96
+ /**
97
+ * Per-server opt-in to the LLM-driven `mcp__<name>__authenticate` flow,
98
+ * independent of the `codegen-tool-mcp-authenticate` LD flag. Set on the
99
+ * Firestore `mcpServers` doc to roll the tool out to one server at a time;
100
+ * the LD flag remains the org-wide switch. Either being true opts the
101
+ * server in, so the flag can still turn it on everywhere at once.
102
+ */
103
+ useAuthenticateTool?: boolean;
96
104
  }
97
105
  export interface MCPServerToolConfiguration {
98
106
  allowed_tools?: Array<string> | null;
@@ -119,6 +127,13 @@ export interface MCPServerDoc<TCreateDate = unknown, TLegacyTokenExpiresAt = nev
119
127
  disabled?: boolean;
120
128
  clientName: string | undefined;
121
129
  tool_configuration?: MCPServerToolConfiguration | null;
130
+ /**
131
+ * Opt this server in to the LLM-driven `mcp__<name>__authenticate` tool
132
+ * instead of the blocking `mcp-auth-required` event, without turning on the
133
+ * org-wide `codegen-tool-mcp-authenticate` LD flag. Lets a single MCP server
134
+ * ship on the tool path ahead of the rest.
135
+ */
136
+ useAuthenticateTool?: boolean;
122
137
  oauthMetadata?: MCPServerOAuthMetadata | null;
123
138
  authorizationToken?: string;
124
139
  refreshToken?: string | null;
@@ -1,5 +1,11 @@
1
1
  import type { PrivacyMode, ReviewEffort } from "./codegen";
2
2
  import type { EnvironmentVariable } from "./common-schemas";
3
+ export interface GitlabEnterpriseSetupValue {
4
+ host: string;
5
+ secondaryHost?: string;
6
+ setupType: "oauth" | "pat";
7
+ clientId?: string;
8
+ }
3
9
  export interface GithubEnterpriseSetupValue {
4
10
  host: string;
5
11
  clientId: string;
@@ -19,6 +25,8 @@ export interface GitlabEnterprisePATValue {
19
25
  host: string;
20
26
  botUsername: string;
21
27
  secondaryHost?: string;
28
+ createdBy?: string;
29
+ createdAt?: number;
22
30
  }
23
31
  export interface GitlabCloudFallbackToken {
24
32
  token: string;
@@ -79,6 +87,7 @@ interface OrganizationSettings {
79
87
  isUserPluginIntegrationRequestGranted?: boolean;
80
88
  shopify?: boolean;
81
89
  githubEnterpriseSetupValue?: GithubEnterpriseSetupValue;
90
+ gitlabEnterpriseSetupValue?: GitlabEnterpriseSetupValue;
82
91
  gitlabEnterprisePAT?: GitlabEnterprisePATValue;
83
92
  gitlabCloudFallbackToken?: GitlabCloudFallbackToken;
84
93
  azureCloudFallbackToken?: AzureCloudFallbackToken;