@builder.io/ai-utils 0.23.2 → 0.23.3
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 +187 -14
- package/src/events.d.ts +1 -0
- package/src/messages.d.ts +4 -0
- package/src/projects.d.ts +9 -4
package/package.json
CHANGED
package/src/codegen.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export interface DevServerControlInput {
|
|
|
81
81
|
set_and_run_setup_command?: string | null;
|
|
82
82
|
set_env_variable?: [string, string] | null;
|
|
83
83
|
}
|
|
84
|
-
export interface
|
|
84
|
+
export interface DevServerLogsInput {
|
|
85
85
|
}
|
|
86
86
|
export interface BashToolInput {
|
|
87
87
|
command?: string | null;
|
|
@@ -283,15 +283,154 @@ export interface UpdateSetupValueToolInput {
|
|
|
283
283
|
};
|
|
284
284
|
reason: string;
|
|
285
285
|
}
|
|
286
|
-
export
|
|
286
|
+
export type ExitState = "verified" | "more-disk" | "more-memory" | "user-question" | "other";
|
|
287
|
+
export interface ExitToolInput {
|
|
288
|
+
state: ExitState;
|
|
289
|
+
summary: string;
|
|
290
|
+
questions?: Array<{
|
|
291
|
+
question: string;
|
|
292
|
+
context: string;
|
|
293
|
+
header?: string;
|
|
294
|
+
options?: Array<{
|
|
295
|
+
label: string;
|
|
296
|
+
description: string;
|
|
297
|
+
}>;
|
|
298
|
+
multiSelect?: boolean;
|
|
299
|
+
}>;
|
|
300
|
+
isMonorepo?: boolean;
|
|
301
|
+
isMicrofrontend?: boolean;
|
|
302
|
+
setupNeedsCredentials?: boolean;
|
|
303
|
+
devServerNeedsCredentials?: boolean;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Configuration proposed by the configuration agent, stored in Firebase
|
|
307
|
+
*/
|
|
308
|
+
export interface ProposedConfig {
|
|
309
|
+
id: string;
|
|
310
|
+
projectId: string;
|
|
311
|
+
branchName: string;
|
|
312
|
+
createdAt: number;
|
|
313
|
+
updatedAt: number;
|
|
314
|
+
ownerId: string;
|
|
315
|
+
state: ExitState;
|
|
316
|
+
summary: string;
|
|
317
|
+
questions?: Array<{
|
|
318
|
+
question: string;
|
|
319
|
+
context: string;
|
|
320
|
+
whatYouTried?: string;
|
|
321
|
+
header?: string;
|
|
322
|
+
options?: Array<{
|
|
323
|
+
label: string;
|
|
324
|
+
description: string;
|
|
325
|
+
}>;
|
|
326
|
+
multiSelect?: boolean;
|
|
327
|
+
}>;
|
|
328
|
+
configuration: {
|
|
329
|
+
setupCommand: {
|
|
330
|
+
value: string | undefined;
|
|
331
|
+
verified: boolean;
|
|
332
|
+
elapsed?: number;
|
|
333
|
+
};
|
|
334
|
+
setupDependencies: {
|
|
335
|
+
value: SetupDependency[] | undefined;
|
|
336
|
+
verified: boolean;
|
|
337
|
+
};
|
|
338
|
+
devCommand: {
|
|
339
|
+
value: string | undefined;
|
|
340
|
+
verified: boolean;
|
|
341
|
+
elapsed?: number;
|
|
342
|
+
};
|
|
343
|
+
devServer: {
|
|
344
|
+
value: string | undefined;
|
|
345
|
+
verified: boolean;
|
|
346
|
+
};
|
|
347
|
+
validateCommand: {
|
|
348
|
+
value: string | undefined;
|
|
349
|
+
verified: boolean;
|
|
350
|
+
elapsed?: number;
|
|
351
|
+
};
|
|
352
|
+
appOrigin: {
|
|
353
|
+
value: string | undefined;
|
|
354
|
+
verified: boolean;
|
|
355
|
+
};
|
|
356
|
+
defaultOrigin: {
|
|
357
|
+
value: string | undefined;
|
|
358
|
+
verified: boolean;
|
|
359
|
+
};
|
|
360
|
+
environmentVariables: {
|
|
361
|
+
value: EnvironmentVariable[] | undefined;
|
|
362
|
+
verified: boolean;
|
|
363
|
+
};
|
|
364
|
+
autoDetectDevServer: {
|
|
365
|
+
value: boolean | undefined;
|
|
366
|
+
verified: boolean;
|
|
367
|
+
};
|
|
368
|
+
autoDetectDevServerPatterns: {
|
|
369
|
+
value: string[] | undefined;
|
|
370
|
+
verified: boolean;
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
sessionId: string;
|
|
374
|
+
orchestratorStates: {
|
|
375
|
+
setupState: SetupCommandState;
|
|
376
|
+
devState: DevCommandState;
|
|
377
|
+
httpServerState: HttpServerState;
|
|
378
|
+
validateState: ValidateCommandState;
|
|
379
|
+
};
|
|
380
|
+
peakDiskUsage?: number;
|
|
381
|
+
peakMemoryUsage?: number;
|
|
382
|
+
screenshotUrl?: string;
|
|
383
|
+
isMonorepo?: boolean;
|
|
384
|
+
isMicrofrontend?: boolean;
|
|
385
|
+
setupNeedsCredentials?: boolean;
|
|
386
|
+
devServerNeedsCredentials?: boolean;
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Parameters for proposing a configuration to the backend
|
|
390
|
+
*/
|
|
391
|
+
export interface ProposeConfigParams {
|
|
392
|
+
projectId: string;
|
|
393
|
+
branchName: string;
|
|
394
|
+
state: ExitState;
|
|
395
|
+
summary: string;
|
|
396
|
+
questions?: Array<{
|
|
397
|
+
question: string;
|
|
398
|
+
context: string;
|
|
399
|
+
whatYouTried?: string;
|
|
400
|
+
header?: string;
|
|
401
|
+
options?: Array<{
|
|
402
|
+
label: string;
|
|
403
|
+
description: string;
|
|
404
|
+
}>;
|
|
405
|
+
multiSelect?: boolean;
|
|
406
|
+
}>;
|
|
407
|
+
configuration: ProposedConfig["configuration"];
|
|
408
|
+
sessionId: string;
|
|
409
|
+
orchestratorStates: ProposedConfig["orchestratorStates"];
|
|
410
|
+
peakDiskUsage?: number;
|
|
411
|
+
peakMemoryUsage?: number;
|
|
412
|
+
screenshotUrl?: string;
|
|
413
|
+
isMonorepo?: boolean;
|
|
414
|
+
isMicrofrontend?: boolean;
|
|
415
|
+
setupNeedsCredentials?: boolean;
|
|
416
|
+
devServerNeedsCredentials?: boolean;
|
|
417
|
+
}
|
|
418
|
+
export interface VerifySetupCommandToolInput {
|
|
287
419
|
command: string;
|
|
288
|
-
|
|
420
|
+
dependencies?: Array<{
|
|
421
|
+
tool: string;
|
|
422
|
+
version?: string;
|
|
423
|
+
}>;
|
|
289
424
|
}
|
|
290
|
-
export interface
|
|
425
|
+
export interface VerifyDevCommandToolInput {
|
|
291
426
|
command: string;
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
427
|
+
}
|
|
428
|
+
export interface VerifyDevServerToolInput {
|
|
429
|
+
autoDetect: boolean;
|
|
430
|
+
autoDetectPattern?: string;
|
|
431
|
+
hardcodedUrl?: string;
|
|
432
|
+
appOrigin: string;
|
|
433
|
+
defaultOrigin?: string;
|
|
295
434
|
}
|
|
296
435
|
export interface VerifyValidationScriptToolInput {
|
|
297
436
|
command: string;
|
|
@@ -302,6 +441,13 @@ export interface VerifyRuntimeDependencyToolInput {
|
|
|
302
441
|
version: string;
|
|
303
442
|
source?: string;
|
|
304
443
|
}
|
|
444
|
+
export interface SetEnvVariableToolInput {
|
|
445
|
+
key: string;
|
|
446
|
+
value: string;
|
|
447
|
+
secret?: boolean;
|
|
448
|
+
placeholder?: boolean;
|
|
449
|
+
explanation?: string;
|
|
450
|
+
}
|
|
305
451
|
/** Comment for PR review - used by both SubmitPRReview and SubmitRecording */
|
|
306
452
|
export interface PRReviewComment {
|
|
307
453
|
file_path: string;
|
|
@@ -309,7 +455,7 @@ export interface PRReviewComment {
|
|
|
309
455
|
start_line?: number;
|
|
310
456
|
title: string;
|
|
311
457
|
body: string;
|
|
312
|
-
severity: "high" | "medium";
|
|
458
|
+
severity: "high" | "medium" | "low";
|
|
313
459
|
debugInfo?: string;
|
|
314
460
|
gif_id?: string;
|
|
315
461
|
}
|
|
@@ -317,6 +463,7 @@ export interface PRReviewComment {
|
|
|
317
463
|
export interface SubmitPRReviewToolInput {
|
|
318
464
|
summary: string;
|
|
319
465
|
comments?: PRReviewComment[];
|
|
466
|
+
risk_level?: "high" | "medium" | "low";
|
|
320
467
|
}
|
|
321
468
|
/** SubmitRecording - Visual verification with recording (posted as separate review) */
|
|
322
469
|
export interface SubmitRecordingToolInput {
|
|
@@ -338,7 +485,7 @@ export interface ReportIssueToolInput {
|
|
|
338
485
|
line: number;
|
|
339
486
|
start_line?: number;
|
|
340
487
|
title: string;
|
|
341
|
-
severity: "high" | "medium";
|
|
488
|
+
severity: "high" | "medium" | "low";
|
|
342
489
|
body: string;
|
|
343
490
|
}
|
|
344
491
|
export interface CodeGenToolMap {
|
|
@@ -375,7 +522,7 @@ export interface CodeGenToolMap {
|
|
|
375
522
|
Grep: GrepSearchToolInput;
|
|
376
523
|
Glob: GlobSearchToolInput;
|
|
377
524
|
DevServerControl: DevServerControlInput;
|
|
378
|
-
|
|
525
|
+
DevServerLogs: DevServerLogsInput;
|
|
379
526
|
Revert: RevertToolInput;
|
|
380
527
|
TodoRead: TodoReadToolInput;
|
|
381
528
|
TodoWrite: TodoWriteToolInput;
|
|
@@ -390,13 +537,16 @@ export interface CodeGenToolMap {
|
|
|
390
537
|
SubmitRecording: SubmitRecordingToolInput;
|
|
391
538
|
ProposeConfig: ProposeConfigToolInput;
|
|
392
539
|
UpdateSetupValue: UpdateSetupValueToolInput;
|
|
540
|
+
Exit: ExitToolInput;
|
|
393
541
|
ResolveQAComments: ResolveQACommentsToolInput;
|
|
394
542
|
ReportUIIssue: ReportUIIssueToolInput;
|
|
395
543
|
ReportIssue: ReportIssueToolInput;
|
|
396
|
-
|
|
544
|
+
VerifySetupCommand: VerifySetupCommandToolInput;
|
|
545
|
+
VerifyDevCommand: VerifyDevCommandToolInput;
|
|
397
546
|
VerifyDevServer: VerifyDevServerToolInput;
|
|
398
547
|
VerifyValidationScript: VerifyValidationScriptToolInput;
|
|
399
548
|
VerifyRuntimeDependency: VerifyRuntimeDependencyToolInput;
|
|
549
|
+
SetEnvVariable: SetEnvVariableToolInput;
|
|
400
550
|
}
|
|
401
551
|
export type CodeGenTools = keyof CodeGenToolMap;
|
|
402
552
|
export type AllCodeGenTools = CodeGenTools | "web_search";
|
|
@@ -413,7 +563,7 @@ export interface LocalMCPTools {
|
|
|
413
563
|
inputSchema?: any;
|
|
414
564
|
serverName: string;
|
|
415
565
|
}
|
|
416
|
-
export type CodeGenCategory = `repair-${string}` | `user-normal` | `user-figma` | `user-pdf` | `user-image` | `background-${string}` | `indexing-${string}`;
|
|
566
|
+
export type CodeGenCategory = `repair-${string}` | `user-normal` | `user-figma` | `user-pdf` | `user-image` | `setup-agent` | `background-${string}` | `indexing-${string}`;
|
|
417
567
|
export interface CodeGenInputOptions {
|
|
418
568
|
position: string;
|
|
419
569
|
eventName?: string;
|
|
@@ -906,9 +1056,24 @@ export interface GenerateCompletionStepUpdateSetupValue {
|
|
|
906
1056
|
};
|
|
907
1057
|
reason: string;
|
|
908
1058
|
}
|
|
1059
|
+
export interface GenerateCompletionStepExit {
|
|
1060
|
+
type: "exit";
|
|
1061
|
+
state: ExitState;
|
|
1062
|
+
summary: string;
|
|
1063
|
+
questions: Array<{
|
|
1064
|
+
question: string;
|
|
1065
|
+
context: string;
|
|
1066
|
+
header?: string;
|
|
1067
|
+
options?: Array<{
|
|
1068
|
+
label: string;
|
|
1069
|
+
description: string;
|
|
1070
|
+
}>;
|
|
1071
|
+
multiSelect?: boolean;
|
|
1072
|
+
}>;
|
|
1073
|
+
}
|
|
909
1074
|
export type GenerateCompletionStep = {
|
|
910
1075
|
timestamp?: number;
|
|
911
|
-
} & (GenerateCompletionStepPlanning | GenerateCompletionStepStart | GenerateCompletionStepDelta | GenerateCompletionStepUser | GenerateCompletionStepFile | GenerateCompletionStepDiff | GenerateCompletionStepTool | GenerateCompletionStepError | GenerateCompletionStepContinue | GenerateCompletionStepWaitForInput | GenerateCompletionStepAbort | GenerateCompletionStepDone | GenerateCompletionStepUserInput | GenerateCompletionStepText | GenerateCompletionStepRestore | GenerateCompletionStepState | GenerateCompletionStepStdio | GenerateCompletionStepSession | GenerateCompletionStepServerToolResult | GenerateCompletionStepGit | GenerateCompletionStepBuilderAction | GenerateCompletionStepToolResult | GenerateCompletionStepFusionConfigPatch | GenerateCompletionStepToolCallRequest | GenerateCodeEventMCPStatus | GenerateCodeEventMCPAuthRequired | GenerateCompletionStepDevServerState | GenerateCompletionStepAgent | GenerateCompletionStepBatch | GenerateCompletionStepTerminals | GenerateCompletionStepMetadata | GenerateCompletionStepMessageQueue | GenerateCompletionStepProposeConfig | GenerateCompletionStepUpdateSetupValue);
|
|
1076
|
+
} & (GenerateCompletionStepPlanning | GenerateCompletionStepStart | GenerateCompletionStepDelta | GenerateCompletionStepUser | GenerateCompletionStepFile | GenerateCompletionStepDiff | GenerateCompletionStepTool | GenerateCompletionStepError | GenerateCompletionStepContinue | GenerateCompletionStepWaitForInput | GenerateCompletionStepAbort | GenerateCompletionStepDone | GenerateCompletionStepUserInput | GenerateCompletionStepText | GenerateCompletionStepRestore | GenerateCompletionStepState | GenerateCompletionStepStdio | GenerateCompletionStepSession | GenerateCompletionStepServerToolResult | GenerateCompletionStepGit | GenerateCompletionStepBuilderAction | GenerateCompletionStepToolResult | GenerateCompletionStepFusionConfigPatch | GenerateCompletionStepToolCallRequest | GenerateCodeEventMCPStatus | GenerateCodeEventMCPAuthRequired | GenerateCompletionStepDevServerState | GenerateCompletionStepAgent | GenerateCompletionStepBatch | GenerateCompletionStepTerminals | GenerateCompletionStepMetadata | GenerateCompletionStepMessageQueue | GenerateCompletionStepProposeConfig | GenerateCompletionStepUpdateSetupValue | GenerateCompletionStepExit);
|
|
912
1077
|
export interface ApplyActionsResult {
|
|
913
1078
|
filePath: string;
|
|
914
1079
|
addedLines: number;
|
|
@@ -1319,6 +1484,8 @@ export interface EnvironmentVariable {
|
|
|
1319
1484
|
key: string;
|
|
1320
1485
|
value: string;
|
|
1321
1486
|
isSecret: boolean;
|
|
1487
|
+
placeholder?: boolean;
|
|
1488
|
+
explanation?: string;
|
|
1322
1489
|
}
|
|
1323
1490
|
export interface FileOverride {
|
|
1324
1491
|
/**
|
|
@@ -1357,7 +1524,7 @@ export interface FusionConfig {
|
|
|
1357
1524
|
sessionId?: string;
|
|
1358
1525
|
browserAutomationInstructions?: string;
|
|
1359
1526
|
/** Whether this branch is for a code review - affects enabled agents and tools */
|
|
1360
|
-
branchType?: "code-review";
|
|
1527
|
+
branchType?: "code-review" | "setup-project";
|
|
1361
1528
|
featureBranch?: string;
|
|
1362
1529
|
aiBranch?: string;
|
|
1363
1530
|
/** Whether this is a fork PR - affects git operations (read-only, can't push) */
|
|
@@ -1549,6 +1716,8 @@ export interface LaunchServerStatus {
|
|
|
1549
1716
|
containerState: "idle" | "busy";
|
|
1550
1717
|
containerStateTimestamp: number;
|
|
1551
1718
|
activeOperations: number;
|
|
1719
|
+
diskUsage?: number;
|
|
1720
|
+
memoryUsage?: number;
|
|
1552
1721
|
}
|
|
1553
1722
|
/**
|
|
1554
1723
|
* VS Code Tunnel status information
|
|
@@ -1592,6 +1761,10 @@ export interface FusionStatus {
|
|
|
1592
1761
|
eventLoopDelays?: number[];
|
|
1593
1762
|
/** Max memory pressure observed in the reporting period (0-1, where 1 is near OOM) */
|
|
1594
1763
|
memoryPressure?: number;
|
|
1764
|
+
/** Current disk usage as a ratio (0-1, where 1 is full) */
|
|
1765
|
+
diskUsage?: number;
|
|
1766
|
+
/** Current memory usage as a ratio (0-1, where 1 is fully used) */
|
|
1767
|
+
memoryUsage?: number;
|
|
1595
1768
|
}
|
|
1596
1769
|
export interface FusionMetrics {
|
|
1597
1770
|
counters: {
|
package/src/events.d.ts
CHANGED
package/src/messages.d.ts
CHANGED
|
@@ -245,6 +245,10 @@ export interface AssistantMessageParam {
|
|
|
245
245
|
* typically used when there is an error.
|
|
246
246
|
*/
|
|
247
247
|
actions?: AssistantMessageAction[];
|
|
248
|
+
/**
|
|
249
|
+
* Technical details for expandable view in error messages.
|
|
250
|
+
*/
|
|
251
|
+
details?: string;
|
|
248
252
|
}
|
|
249
253
|
export interface SystemMessage extends SystemMessageParam {
|
|
250
254
|
id: string;
|
package/src/projects.d.ts
CHANGED
|
@@ -326,6 +326,7 @@ export interface SetupScriptDependency {
|
|
|
326
326
|
script: string;
|
|
327
327
|
}
|
|
328
328
|
export type FusionExecutionEnvironment = "containerized" | "container-less" | "cloud" | "cloud-v2";
|
|
329
|
+
export type AgentType = "setup-project" | "project-configuration";
|
|
329
330
|
export interface PartialBranchData {
|
|
330
331
|
name?: string;
|
|
331
332
|
createdBy: string;
|
|
@@ -335,16 +336,18 @@ export interface PartialBranchData {
|
|
|
335
336
|
lockedFusionEnvironment?: FusionExecutionEnvironment;
|
|
336
337
|
metadata?: BranchMetadata;
|
|
337
338
|
backup?: BranchBackup;
|
|
339
|
+
hidden?: boolean;
|
|
338
340
|
gitAiBranch?: string | null;
|
|
339
341
|
lastCommitHash?: GitSnapshot | null;
|
|
340
342
|
lastCommitDate?: number | null;
|
|
341
343
|
commitMode?: CommitMode;
|
|
342
344
|
useHomeDir?: boolean;
|
|
345
|
+
agentType?: AgentType;
|
|
343
346
|
checkoutBranch?: string | null;
|
|
344
347
|
/** Whether this branch is for a fork PR - affects git operations (read-only, can't push) */
|
|
345
348
|
isFork?: boolean | null;
|
|
346
349
|
/** Whether this branch is for a code review - affects enabled agents and tools*/
|
|
347
|
-
type?:
|
|
350
|
+
type?: BranchType | null;
|
|
348
351
|
cloneFrom?: {
|
|
349
352
|
projectId: string;
|
|
350
353
|
branchName: string;
|
|
@@ -390,6 +393,7 @@ export interface BranchReview {
|
|
|
390
393
|
createdAt: number;
|
|
391
394
|
updatedAt: number;
|
|
392
395
|
}
|
|
396
|
+
export type BranchType = "code-review" | "setup-project";
|
|
393
397
|
interface BranchSharedData {
|
|
394
398
|
appName?: string | null;
|
|
395
399
|
prNumber?: number | null;
|
|
@@ -408,7 +412,7 @@ interface BranchSharedData {
|
|
|
408
412
|
lastServerStateDate?: number | null;
|
|
409
413
|
lastServerVersion?: string | null;
|
|
410
414
|
name?: string;
|
|
411
|
-
|
|
415
|
+
hidden?: boolean;
|
|
412
416
|
createdBy?: string;
|
|
413
417
|
isPublic?: boolean;
|
|
414
418
|
isDefault?: boolean;
|
|
@@ -455,7 +459,8 @@ interface BranchSharedData {
|
|
|
455
459
|
/** Screenshots indexed by normalized href (without query params, fragments, protocol) */
|
|
456
460
|
screenshots?: Record<string, string>;
|
|
457
461
|
/** Whether this branch is for a code review - affects enabled agents and tools */
|
|
458
|
-
type?:
|
|
462
|
+
type?: BranchType | null;
|
|
463
|
+
agentType?: AgentType | null;
|
|
459
464
|
}
|
|
460
465
|
/**
|
|
461
466
|
* fields that are required in the new branch format, but optional in the legacy branch format.
|
|
@@ -604,7 +609,7 @@ export interface Project {
|
|
|
604
609
|
enabled: boolean;
|
|
605
610
|
instructions?: string;
|
|
606
611
|
};
|
|
607
|
-
|
|
612
|
+
enableSnapshots?: boolean;
|
|
608
613
|
postMergeMemories?: boolean;
|
|
609
614
|
commitInstructions?: string;
|
|
610
615
|
maxAgentCompletions?: number;
|