@builder.io/ai-utils 0.76.2 → 0.76.4
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/codegen.d.ts +14 -1
- package/src/codegen.js +20 -1
- package/src/events.d.ts +12 -1
- package/src/events.js +4 -0
- package/src/projects.d.ts +21 -0
- package/src/projects.js +46 -0
package/package.json
CHANGED
package/src/codegen.d.ts
CHANGED
|
@@ -203,6 +203,7 @@ export type GrepSearchToolInput = z.infer<typeof GrepSearchToolInputSchema>;
|
|
|
203
203
|
export declare const SkillToolInputSchema: z.ZodObject<{
|
|
204
204
|
skill: z.ZodString;
|
|
205
205
|
args: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
206
|
+
userInvoked: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
206
207
|
}, z.core.$strip>;
|
|
207
208
|
export type SkillToolInput = z.infer<typeof SkillToolInputSchema>;
|
|
208
209
|
export declare const GetRuleToolInputSchema: z.ZodObject<{
|
|
@@ -1380,6 +1381,12 @@ export declare const EnsurePRToolInputSchema: z.ZodObject<{
|
|
|
1380
1381
|
draft: z.ZodOptional<z.ZodBoolean>;
|
|
1381
1382
|
}, z.core.$strip>;
|
|
1382
1383
|
export type EnsurePRToolInput = z.infer<typeof EnsurePRToolInputSchema>;
|
|
1384
|
+
export declare const EnableDatabaseToolInputSchema: z.ZodObject<{
|
|
1385
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
1386
|
+
}, z.core.$strip>;
|
|
1387
|
+
export type EnableDatabaseToolInput = z.infer<typeof EnableDatabaseToolInputSchema>;
|
|
1388
|
+
/** Non-technical line surfaced in the run summary after EnableDatabase succeeds. */
|
|
1389
|
+
export declare function formatDatabaseEnabledUserSummary(purpose?: string): string;
|
|
1383
1390
|
export declare const ConnectMCPToolInputSchema: z.ZodObject<{
|
|
1384
1391
|
name: z.ZodString;
|
|
1385
1392
|
url: z.ZodOptional<z.ZodString>;
|
|
@@ -1410,6 +1417,7 @@ export declare const CodeGenToolMapSchema: z.ZodObject<{
|
|
|
1410
1417
|
Skill: z.ZodObject<{
|
|
1411
1418
|
skill: z.ZodString;
|
|
1412
1419
|
args: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1420
|
+
userInvoked: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
1413
1421
|
}, z.core.$strip>;
|
|
1414
1422
|
GetStyleInspiration: z.ZodObject<{
|
|
1415
1423
|
url: z.ZodString;
|
|
@@ -1960,6 +1968,9 @@ export declare const CodeGenToolMapSchema: z.ZodObject<{
|
|
|
1960
1968
|
builder_user_id: z.ZodOptional<z.ZodString>;
|
|
1961
1969
|
draft: z.ZodOptional<z.ZodBoolean>;
|
|
1962
1970
|
}, z.core.$strip>;
|
|
1971
|
+
EnableDatabase: z.ZodObject<{
|
|
1972
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
1973
|
+
}, z.core.$strip>;
|
|
1963
1974
|
GenerateDesignSystemAgentMd: z.ZodObject<{}, z.core.$strip>;
|
|
1964
1975
|
}, z.core.$strip>;
|
|
1965
1976
|
export type CodeGenToolMap = z.infer<typeof CodeGenToolMapSchema>;
|
|
@@ -1977,6 +1988,7 @@ export declare const CodeGenToolsSchema: z.ZodEnum<{
|
|
|
1977
1988
|
DevServerLogs: "DevServerLogs";
|
|
1978
1989
|
DevServerRestart: "DevServerRestart";
|
|
1979
1990
|
Edit: "Edit";
|
|
1991
|
+
EnableDatabase: "EnableDatabase";
|
|
1980
1992
|
EnsurePR: "EnsurePR";
|
|
1981
1993
|
EnterPlanMode: "EnterPlanMode";
|
|
1982
1994
|
EscalateToPlanner: "EscalateToPlanner";
|
|
@@ -2700,6 +2712,7 @@ export declare const CodeGenInputOptionsSchema: z.ZodObject<{
|
|
|
2700
2712
|
DevServerLogs: "DevServerLogs";
|
|
2701
2713
|
DevServerRestart: "DevServerRestart";
|
|
2702
2714
|
Edit: "Edit";
|
|
2715
|
+
EnableDatabase: "EnableDatabase";
|
|
2703
2716
|
EnsurePR: "EnsurePR";
|
|
2704
2717
|
EnterPlanMode: "EnterPlanMode";
|
|
2705
2718
|
EscalateToPlanner: "EscalateToPlanner";
|
|
@@ -2884,7 +2897,7 @@ export type CodeGenInputOptions = z.infer<typeof CodeGenInputOptionsSchema> & {
|
|
|
2884
2897
|
*/
|
|
2885
2898
|
_mcpClientWrapperFactory?: (realClient: any) => any;
|
|
2886
2899
|
};
|
|
2887
|
-
export type CodeGenErrorCodes = "credits-limit-daily" | "credits-limit-monthly" | "credits-limit-user" | "credits-limit-other" | "cli-genetic-error" | "git-update-error" | "prompt-too-long" | "context-too-long" | "abrupt-end" | "unknown" | "failed-recover-state" | "completion-expired" | "ask-to-continue" | "bad-initial-url" | "bad-smart-export-payload" | "invalid-last-message" | "corrupted-session" | "privacy-mode-key-required" | "privacy-mode-key-invalid" | "cli-network-error" | "model-restricted-too-large" | "org-no-models-enabled" | "assertion" | "rate-limit" | "unknown-design-system";
|
|
2900
|
+
export type CodeGenErrorCodes = "credits-limit-daily" | "credits-limit-monthly" | "credits-limit-user" | "credits-limit-other" | "cli-genetic-error" | "git-update-error" | "prompt-too-long" | "context-too-long" | "abrupt-end" | "unknown" | "failed-recover-state" | "completion-expired" | "ask-to-continue" | "bad-initial-url" | "bad-smart-export-payload" | "invalid-last-message" | "corrupted-session" | "privacy-mode-key-required" | "privacy-mode-key-invalid" | "cli-network-error" | "invalid-credentials" | "model-restricted-too-large" | "org-no-models-enabled" | "assertion" | "rate-limit" | "unknown-design-system";
|
|
2888
2901
|
export interface CodegenUsage {
|
|
2889
2902
|
total: number;
|
|
2890
2903
|
fast: number;
|
package/src/codegen.js
CHANGED
|
@@ -157,6 +157,9 @@ export const SkillToolInputSchema = z
|
|
|
157
157
|
args: z.string().nullish().meta({
|
|
158
158
|
description: "Optional invocation arguments; forwarded with the skill body in the tool result.",
|
|
159
159
|
}),
|
|
160
|
+
userInvoked: z.boolean().nullish().meta({
|
|
161
|
+
description: "Set to true when the user explicitly mentioned or requested this skill by name in their message (including slash commands). Set to false or omit when invoking proactively based on context.",
|
|
162
|
+
}),
|
|
160
163
|
})
|
|
161
164
|
.meta({ title: "SkillToolInput" });
|
|
162
165
|
export const GetRuleToolInputSchema = z
|
|
@@ -433,7 +436,7 @@ export const AskUserQuestionSchema = z
|
|
|
433
436
|
description: 'Very short label displayed as a chip/tag (max 12 chars). Examples: "Auth method", "Library", "Approach".',
|
|
434
437
|
}),
|
|
435
438
|
options: z.array(AskUserQuestionOptionSchema).min(2).max(4).meta({
|
|
436
|
-
description: "The available choices for this question. Must have 2-4 options. Each option should be a distinct, mutually exclusive choice (unless multiSelect is enabled).
|
|
439
|
+
description: "The available choices for this question. Must have 2-4 options. Each option should be a distinct, mutually exclusive choice (unless multiSelect is enabled). Provide only concrete, substantive choices. Do NOT add a free-form / catch-all option such as 'Other', 'Custom', 'Something else', 'Let me specify', 'None of these', etc. — the UI always appends an implicit 'Other' option that lets the user type a custom answer, so adding your own would create a duplicate that cannot accept input.",
|
|
437
440
|
}),
|
|
438
441
|
multiSelect: z.boolean().optional().meta({
|
|
439
442
|
description: "Set to true to allow the user to select multiple options instead of just one. Use when choices are not mutually exclusive.",
|
|
@@ -1482,6 +1485,21 @@ export const EnsurePRToolInputSchema = z
|
|
|
1482
1485
|
}),
|
|
1483
1486
|
})
|
|
1484
1487
|
.meta({ title: "EnsurePRToolInput" });
|
|
1488
|
+
export const EnableDatabaseToolInputSchema = z
|
|
1489
|
+
.object({
|
|
1490
|
+
purpose: z.string().optional().meta({
|
|
1491
|
+
description: "Brief non-technical note about what data will be stored (e.g. 'contact form submissions'). Used in the user-facing summary.",
|
|
1492
|
+
}),
|
|
1493
|
+
})
|
|
1494
|
+
.meta({ title: "EnableDatabaseToolInput" });
|
|
1495
|
+
/** Non-technical line surfaced in the run summary after EnableDatabase succeeds. */
|
|
1496
|
+
export function formatDatabaseEnabledUserSummary(purpose) {
|
|
1497
|
+
const trimmed = purpose === null || purpose === void 0 ? void 0 : purpose.trim();
|
|
1498
|
+
if (trimmed) {
|
|
1499
|
+
return `Spun up a database to store ${trimmed}.`;
|
|
1500
|
+
}
|
|
1501
|
+
return "Spun up a database for this project.";
|
|
1502
|
+
}
|
|
1485
1503
|
export const ConnectMCPToolInputSchema = z
|
|
1486
1504
|
.object({
|
|
1487
1505
|
name: z.string().meta({
|
|
@@ -1559,6 +1577,7 @@ export const CodeGenToolMapSchema = z.object({
|
|
|
1559
1577
|
PullPrototype: PullPrototypeToolInputSchema,
|
|
1560
1578
|
ConnectMCP: ConnectMCPToolInputSchema,
|
|
1561
1579
|
EnsurePR: EnsurePRToolInputSchema,
|
|
1580
|
+
EnableDatabase: EnableDatabaseToolInputSchema,
|
|
1562
1581
|
GenerateDesignSystemAgentMd: GenerateDesignSystemAgentMdInputSchema,
|
|
1563
1582
|
});
|
|
1564
1583
|
export const CodeGenToolsSchema = CodeGenToolMapSchema.keyof().meta({
|
package/src/events.d.ts
CHANGED
|
@@ -1253,7 +1253,18 @@ export declare const ClientDevtoolsBuildFailedV1: {
|
|
|
1253
1253
|
eventName: "client.devtools.build.failed";
|
|
1254
1254
|
version: "1";
|
|
1255
1255
|
};
|
|
1256
|
-
export type
|
|
1256
|
+
export type McpPrototypePulledV1 = FusionEventVariant<"mcp.prototype.pulled", {
|
|
1257
|
+
projectId: string;
|
|
1258
|
+
branchName: string;
|
|
1259
|
+
prototypeUrl: string;
|
|
1260
|
+
}, {
|
|
1261
|
+
projectId: string;
|
|
1262
|
+
}, 1>;
|
|
1263
|
+
export declare const McpPrototypePulledV1: {
|
|
1264
|
+
eventName: "mcp.prototype.pulled";
|
|
1265
|
+
version: "1";
|
|
1266
|
+
};
|
|
1267
|
+
export type FusionEvent = ClientDevtoolsSessionStartedEvent | ClientDevtoolsSessionIdleEventV1 | ClientDevtoolsToolCallRequestV1 | ClientDevtoolsToolCallV1 | ClientDevtoolsToolResultV1 | 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;
|
|
1257
1268
|
export interface ModelPermissionRequiredEvent {
|
|
1258
1269
|
type: "assistant.model.permission.required";
|
|
1259
1270
|
data: {
|
package/src/events.js
CHANGED
package/src/projects.d.ts
CHANGED
|
@@ -1028,6 +1028,8 @@ export interface CreateProjectOptions {
|
|
|
1028
1028
|
autoApplySetup?: boolean;
|
|
1029
1029
|
templateId?: string;
|
|
1030
1030
|
useInternalHost?: boolean;
|
|
1031
|
+
/** Store branches in the standalone `branches` collection vs embedded in the project doc. */
|
|
1032
|
+
useBranchesCollection?: boolean;
|
|
1031
1033
|
}
|
|
1032
1034
|
export interface BuilderMyContext {
|
|
1033
1035
|
success: boolean;
|
|
@@ -1606,4 +1608,23 @@ export declare const GetDeploysResponseSchema: z.ZodObject<{
|
|
|
1606
1608
|
}, z.core.$strip>>;
|
|
1607
1609
|
}, z.core.$strip>;
|
|
1608
1610
|
export type GetDeploysResponse = z.infer<typeof GetDeploysResponseSchema>;
|
|
1611
|
+
export declare const CloneProjectOptionsSchema: z.ZodObject<{
|
|
1612
|
+
sourceProjectId: z.ZodString;
|
|
1613
|
+
sourceBranchName: z.ZodDefault<z.ZodString>;
|
|
1614
|
+
newProjectName: z.ZodOptional<z.ZodString>;
|
|
1615
|
+
intent: z.ZodEnum<{
|
|
1616
|
+
clone: "clone";
|
|
1617
|
+
duplicate: "duplicate";
|
|
1618
|
+
}>;
|
|
1619
|
+
userEmail: z.ZodOptional<z.ZodString>;
|
|
1620
|
+
useKube: z.ZodDefault<z.ZodBoolean>;
|
|
1621
|
+
useBranchesCollection: z.ZodDefault<z.ZodBoolean>;
|
|
1622
|
+
}, z.core.$strip>;
|
|
1623
|
+
export type CloneProjectOptions = z.infer<typeof CloneProjectOptionsSchema>;
|
|
1624
|
+
export declare const DuplicateBranchOptionsSchema: z.ZodObject<{
|
|
1625
|
+
projectId: z.ZodString;
|
|
1626
|
+
sourceBranchName: z.ZodString;
|
|
1627
|
+
friendlyName: z.ZodOptional<z.ZodString>;
|
|
1628
|
+
}, z.core.$strip>;
|
|
1629
|
+
export type DuplicateBranchOptions = z.infer<typeof DuplicateBranchOptionsSchema>;
|
|
1609
1630
|
export {};
|
package/src/projects.js
CHANGED
|
@@ -507,3 +507,49 @@ export const GetDeploysRequestSchema = z.object({
|
|
|
507
507
|
export const GetDeploysResponseSchema = z.object({
|
|
508
508
|
deploys: z.array(DeployListItemSchema),
|
|
509
509
|
});
|
|
510
|
+
export const CloneProjectOptionsSchema = z.object({
|
|
511
|
+
sourceProjectId: z.string().min(1).meta({
|
|
512
|
+
description: "Project to clone from.",
|
|
513
|
+
}),
|
|
514
|
+
sourceBranchName: z.string().min(1).default("main").meta({
|
|
515
|
+
description: "Branch to seed the clone's branch from.",
|
|
516
|
+
}),
|
|
517
|
+
newProjectName: z.string().min(1).max(200).optional().meta({
|
|
518
|
+
description: 'Name for the new project. Defaults to "{source} (cloned)" for clones.',
|
|
519
|
+
}),
|
|
520
|
+
intent: z.enum(["clone", "duplicate"]).meta({
|
|
521
|
+
description: '"clone": public example/starter → caller\'s space (always full backup, ' +
|
|
522
|
+
'isExample, name suffixed). "duplicate": copy one of the caller\'s own ' +
|
|
523
|
+
"projects. Required.",
|
|
524
|
+
}),
|
|
525
|
+
userEmail: z
|
|
526
|
+
.string()
|
|
527
|
+
.optional()
|
|
528
|
+
.meta({
|
|
529
|
+
description: "Attributes the new project to a concrete user when the request has no " +
|
|
530
|
+
"user session (e.g. API-key auth). Resolved to a user id that must " +
|
|
531
|
+
"belong to the caller's org; without it a no-session request can't be " +
|
|
532
|
+
"attributed and project creation fails with 401.",
|
|
533
|
+
}),
|
|
534
|
+
useKube: z.boolean().default(false).meta({
|
|
535
|
+
description: "Whether to provision on cloud-v2 (Kubernetes). Defaults to false.",
|
|
536
|
+
}),
|
|
537
|
+
useBranchesCollection: z
|
|
538
|
+
.boolean()
|
|
539
|
+
.default(false)
|
|
540
|
+
.meta({
|
|
541
|
+
description: "Whether the new project stores branches in the standalone `branches` " +
|
|
542
|
+
"collection rather than embedded in the project doc. Defaults to false.",
|
|
543
|
+
}),
|
|
544
|
+
});
|
|
545
|
+
export const DuplicateBranchOptionsSchema = z.object({
|
|
546
|
+
projectId: z.string().min(1).meta({
|
|
547
|
+
description: "Project that owns the branch being duplicated.",
|
|
548
|
+
}),
|
|
549
|
+
sourceBranchName: z.string().min(1).meta({
|
|
550
|
+
description: "Branch to duplicate.",
|
|
551
|
+
}),
|
|
552
|
+
friendlyName: z.string().max(200).optional().meta({
|
|
553
|
+
description: "Optional friendly (display) name for the new branch.",
|
|
554
|
+
}),
|
|
555
|
+
});
|