@builder.io/ai-utils 0.26.0 → 0.26.2
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 +33 -4
- package/src/events.d.ts +31 -1
- package/src/projects.d.ts +6 -2
- package/src/projects.js +2 -0
package/package.json
CHANGED
package/src/codegen.d.ts
CHANGED
|
@@ -293,7 +293,7 @@ export interface UpdateSetupValueToolInput {
|
|
|
293
293
|
};
|
|
294
294
|
reason: string;
|
|
295
295
|
}
|
|
296
|
-
export type ExitState = "verified" | "
|
|
296
|
+
export type ExitState = "verified" | "no-frontend" | "empty-project" | "user-question" | "other" | "started";
|
|
297
297
|
export interface ExitToolInput {
|
|
298
298
|
state: ExitState;
|
|
299
299
|
summary: string;
|
|
@@ -353,6 +353,7 @@ export interface ProposedConfig {
|
|
|
353
353
|
devServer: {
|
|
354
354
|
value: string | undefined;
|
|
355
355
|
verified: boolean;
|
|
356
|
+
elapsed?: number;
|
|
356
357
|
};
|
|
357
358
|
validateCommand: {
|
|
358
359
|
value: string | undefined;
|
|
@@ -442,7 +443,7 @@ export interface VerifyDevServerToolInput {
|
|
|
442
443
|
appOrigin: string;
|
|
443
444
|
defaultOrigin?: string;
|
|
444
445
|
}
|
|
445
|
-
export interface
|
|
446
|
+
export interface VerifyValidateCommandToolInput {
|
|
446
447
|
command: string;
|
|
447
448
|
timeout?: number;
|
|
448
449
|
}
|
|
@@ -555,7 +556,7 @@ export interface CodeGenToolMap {
|
|
|
555
556
|
VerifySetupCommand: VerifySetupCommandToolInput;
|
|
556
557
|
VerifyDevCommand: VerifyDevCommandToolInput;
|
|
557
558
|
VerifyDevServer: VerifyDevServerToolInput;
|
|
558
|
-
|
|
559
|
+
VerifyValidateCommand: VerifyValidateCommandToolInput;
|
|
559
560
|
VerifyRuntimeDependency: VerifyRuntimeDependencyToolInput;
|
|
560
561
|
SetEnvVariable: SetEnvVariableToolInput;
|
|
561
562
|
}
|
|
@@ -629,6 +630,12 @@ export interface CodeGenInputOptions {
|
|
|
629
630
|
* vs cloud/container mode. Used to determine git auto-commit behavior.
|
|
630
631
|
*/
|
|
631
632
|
isLocal?: boolean;
|
|
633
|
+
/**
|
|
634
|
+
* Optional factory function to wrap the MCP client with custom behavior
|
|
635
|
+
* Used by Editor AI to add permission checks for model operations
|
|
636
|
+
* @internal
|
|
637
|
+
*/
|
|
638
|
+
_mcpClientWrapperFactory?: (realClient: any) => any;
|
|
632
639
|
maxAgentLoops?: number;
|
|
633
640
|
maxAgentTiming?: number;
|
|
634
641
|
/**
|
|
@@ -1313,7 +1320,24 @@ export interface GenerateCodeEventMCPAuthRequired {
|
|
|
1313
1320
|
servers: Array<MCPAuthRequiredServer>;
|
|
1314
1321
|
message: string;
|
|
1315
1322
|
}
|
|
1316
|
-
export
|
|
1323
|
+
export interface GenerateCodeEventModelPermissionRequired {
|
|
1324
|
+
type: "model-permission-required";
|
|
1325
|
+
id: string;
|
|
1326
|
+
operation: "create_model" | "update_model";
|
|
1327
|
+
toolName: string;
|
|
1328
|
+
toolInput: Record<string, any>;
|
|
1329
|
+
modelName: string;
|
|
1330
|
+
details: {
|
|
1331
|
+
modelType?: string;
|
|
1332
|
+
fields?: Array<{
|
|
1333
|
+
name: string;
|
|
1334
|
+
type: string;
|
|
1335
|
+
required?: boolean;
|
|
1336
|
+
}>;
|
|
1337
|
+
changes?: string[];
|
|
1338
|
+
};
|
|
1339
|
+
}
|
|
1340
|
+
export type GenerateCodeEvent = ActionItem | GenerateCodeEventDone | GenerateCodeEventContinue | GenerateCodeEventPagination | GenerateCodeEventDelta | GenerateCodeEventError | GenerateCodeEventPing | GenerateCodeEventMCPStatus | GenerateCodeEventMCPAuthRequired | GenerateCodeEventModelPermissionRequired | GenerateCodeEventUser;
|
|
1317
1341
|
export type CommitMode = "commits" | "draft-prs" | "prs";
|
|
1318
1342
|
export interface GitBackupDownloadUrlResult {
|
|
1319
1343
|
signedUrl: string;
|
|
@@ -1644,6 +1668,11 @@ export interface FusionConfig {
|
|
|
1644
1668
|
* Read from project settings, with fallback to organization/space settings.
|
|
1645
1669
|
*/
|
|
1646
1670
|
maxAgentCompletions?: number;
|
|
1671
|
+
/**
|
|
1672
|
+
* If true, skip all command security policy validation (e.g. allow curl, npx, etc without restrictions).
|
|
1673
|
+
* This is a dangerous setting that removes safety guardrails - equivalent to full shell access.
|
|
1674
|
+
*/
|
|
1675
|
+
skipCommandSecurity?: boolean;
|
|
1647
1676
|
/** @deprecated use devCommand */
|
|
1648
1677
|
command?: string;
|
|
1649
1678
|
}
|
package/src/events.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { AssistantMessage, AssistantMessageAction } from "./messages.js";
|
|
|
3
3
|
import type { AssistantSettings } from "./settings.js";
|
|
4
4
|
import type { ExitState } from "./codegen.js";
|
|
5
5
|
export type BuilderAssistantEventHandler = (ev: BuilderAssistantEvent) => void;
|
|
6
|
-
export type BuilderAssistantEvent = AssistantCompletionResultEvent | AssistantErrorEvent | AssistantStreamErrorEvent | AppCloseEvent | AppMessagesClickEvent | AppMessagesGenerationEvent | AppMessageEditCustomInstructionsEvent | AppPromptAbortEvent | AppPromptFocusEvent | AppPromptSubmitEvent | AppReadyEvent | AppSettingsSetEvent | AppThreadNewEvent | AssistantStatsEvent | AssistantThemeEvent | BuilderEditorAuthEvent | BuilderEditorStateEvent | ContentUpdateEvent | ContentApplySnapshotEvent | ModelUndoEvent | ModelRedoEvent | ResultEvent | ThreadCreatedEvent | ThreadMessageCompletedEvent | ThreadMessageCreatedEvent | ThreadMessageDeltaEvent | ThreadMessageFeedbackEvent | ThreadRunStepCreatedEvent | ThreadRunStepDeltaEvent | AppAcceptChangeEvent | AppAcceptRejectEvent | AssistantTrackEvent | AssistantEditorAuthMessage | AppAttachmentTemplateEvent | AppPasteSmartExportEvent | ThreadMessageRetryEvent | AppFigmaImportEvent | AppWebImportEvent | AppMcpServersEvent | AssistantContentInitialEvent | ThreadMessageSummaryEvent | ThreadMessageSummaryCodegenDeltaEvent | ThreadMessageThinkingDeltaEvent | AssistantHeartbeatEvent | ShowUpgradeDialogEvent | AssistantFusionSuggestionEvent | AppNavigateToFusionEvent;
|
|
6
|
+
export type BuilderAssistantEvent = AssistantCompletionResultEvent | AssistantErrorEvent | AssistantStreamErrorEvent | AppCloseEvent | AppMessagesClickEvent | AppMessagesGenerationEvent | AppMessageEditCustomInstructionsEvent | AppPromptAbortEvent | AppPromptFocusEvent | AppPromptSubmitEvent | AppReadyEvent | AppSettingsSetEvent | AppThreadNewEvent | AssistantStatsEvent | AssistantThemeEvent | BuilderEditorAuthEvent | BuilderEditorStateEvent | ContentUpdateEvent | ContentApplySnapshotEvent | ModelUndoEvent | ModelRedoEvent | ResultEvent | ThreadCreatedEvent | ThreadMessageCompletedEvent | ThreadMessageCreatedEvent | ThreadMessageDeltaEvent | ThreadMessageFeedbackEvent | ThreadRunStepCreatedEvent | ThreadRunStepDeltaEvent | AppAcceptChangeEvent | AppAcceptRejectEvent | AssistantTrackEvent | AssistantEditorAuthMessage | AppAttachmentTemplateEvent | AppPasteSmartExportEvent | ThreadMessageRetryEvent | AppFigmaImportEvent | AppWebImportEvent | AppMcpServersEvent | AssistantContentInitialEvent | ThreadMessageSummaryEvent | ThreadMessageSummaryCodegenDeltaEvent | ThreadMessageThinkingDeltaEvent | AssistantHeartbeatEvent | ShowUpgradeDialogEvent | AssistantFusionSuggestionEvent | AppNavigateToFusionEvent | ModelPermissionRequiredEvent | ModelPermissionResponseEvent;
|
|
7
7
|
export interface AssistantCompletionResultEvent {
|
|
8
8
|
type: "assistant.result";
|
|
9
9
|
data: {
|
|
@@ -481,7 +481,11 @@ export declare const GitPrCreatedEvent: {
|
|
|
481
481
|
version: "1";
|
|
482
482
|
};
|
|
483
483
|
export type ClientDevtoolsSessionStartedEvent = FusionEventVariant<"client.devtools.session.started", {
|
|
484
|
+
sessionId?: string;
|
|
484
485
|
sessionType?: string;
|
|
486
|
+
projectId?: string;
|
|
487
|
+
branchName?: string;
|
|
488
|
+
branchId?: string;
|
|
485
489
|
platform?: string;
|
|
486
490
|
}, {}, 1>;
|
|
487
491
|
export declare const ClientDevtoolsSessionStartedEvent: {
|
|
@@ -509,4 +513,30 @@ export declare const SetupAgentCompletedV1: {
|
|
|
509
513
|
version: "1";
|
|
510
514
|
};
|
|
511
515
|
export type FusionEvent = AiTaskCompletedEvent | AiTaskFailedEvent | GitPrCreatedEvent | ClientDevtoolsSessionStartedEvent | FusionProjectCreatedV1 | SetupAgentCompletedV1;
|
|
516
|
+
export interface ModelPermissionRequiredEvent {
|
|
517
|
+
type: "assistant.model.permission.required";
|
|
518
|
+
data: {
|
|
519
|
+
id: string;
|
|
520
|
+
sessionId: string;
|
|
521
|
+
operation: "create_model" | "update_model";
|
|
522
|
+
modelName: string;
|
|
523
|
+
details: {
|
|
524
|
+
modelType?: string;
|
|
525
|
+
fields?: Array<{
|
|
526
|
+
name: string;
|
|
527
|
+
type: string;
|
|
528
|
+
required?: boolean;
|
|
529
|
+
}>;
|
|
530
|
+
changes?: string[];
|
|
531
|
+
};
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
export interface ModelPermissionResponseEvent extends AwaitResultEvent {
|
|
535
|
+
type: "assistant.model.permission.response";
|
|
536
|
+
data: {
|
|
537
|
+
id: string;
|
|
538
|
+
approved: boolean;
|
|
539
|
+
reason?: string;
|
|
540
|
+
};
|
|
541
|
+
}
|
|
512
542
|
export {};
|
package/src/projects.d.ts
CHANGED
|
@@ -152,7 +152,7 @@ export type GitAuthErrorCode = "git-auth-failed" | "git-auth-failed-root-repo" |
|
|
|
152
152
|
/**
|
|
153
153
|
* Git provider types for diagnostics.
|
|
154
154
|
*/
|
|
155
|
-
export type GitDiagnosticsProvider = "github" | "bitbucket" | "gitlab" | "azure" | "unknown";
|
|
155
|
+
export type GitDiagnosticsProvider = "github" | "selfHostedGithub" | "bitbucket" | "gitlab" | "azure" | "unknown";
|
|
156
156
|
/**
|
|
157
157
|
* Detect git provider from a repository URL (HTTPS or SSH).
|
|
158
158
|
* Used by both error diagnostics and connectivity checks for consistent provider labeling.
|
|
@@ -213,9 +213,10 @@ export interface CleanupCompletedMessage extends BaseMessage {
|
|
|
213
213
|
* Messages sent by the container orchestrator.
|
|
214
214
|
*/
|
|
215
215
|
export type ProjectsChunkMessage = InitializingMessage | FetchingGithubTokenMessage | FetchingFusionKeyMessage | CheckingAppMessage | CleaningUpAppMessage | CreatingAppMessage | CheckingIPMessage | AllocatingIPMessage | CheckingMachineMessage | CheckingVolumeMessage | ForkingVolumeMessage | RetryingWithNewRegionMessage | WaitingBeforePollingMessage | PollingMachineStatusMessage | WarningStateMessage | PingMessage | DebugMessage | ErrorMessage | InfoMessage | WarningMessage | MachineStatusMessage | LogsMessage | ConfigStatusMessage | AppCreatedMessage | MachineCreatedMessage | IpAllocatedMessage | VolumeForkedMessage | ReadyMessage | ErrorStateMessage | CleanupCompletedMessage;
|
|
216
|
+
export type GitProvider = "github" | "selfHostedGithub" | "bitbucket" | "gitlab" | "azure";
|
|
216
217
|
export interface GitConfig {
|
|
217
218
|
url: string;
|
|
218
|
-
provider:
|
|
219
|
+
provider: GitProvider | "unknown";
|
|
219
220
|
token: string | undefined;
|
|
220
221
|
}
|
|
221
222
|
export type GitConfigs = Record<string, GitConfig>;
|
|
@@ -629,6 +630,7 @@ export interface Project {
|
|
|
629
630
|
postMergeMemories?: boolean;
|
|
630
631
|
commitInstructions?: string;
|
|
631
632
|
maxAgentCompletions?: number;
|
|
633
|
+
skipCommandSecurity?: boolean;
|
|
632
634
|
httpsServerKeyPath?: string;
|
|
633
635
|
httpsServerCertPath?: string;
|
|
634
636
|
httpsServerCaPath?: string;
|
|
@@ -666,6 +668,8 @@ export interface Project {
|
|
|
666
668
|
* Defaults to false for backwards compatibility with existing projects.
|
|
667
669
|
*/
|
|
668
670
|
useBranchesCollection?: boolean;
|
|
671
|
+
/** When true, the project is in code-only mode */
|
|
672
|
+
codeOnlyMode?: boolean;
|
|
669
673
|
}
|
|
670
674
|
/**
|
|
671
675
|
* Get the state of a branch, checking `state` first and falling back to `deleted` for backwards compatibility.
|
package/src/projects.js
CHANGED