@builder.io/ai-utils 0.18.5 → 0.18.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/ai-utils",
3
- "version": "0.18.5",
3
+ "version": "0.18.7",
4
4
  "description": "Builder.io AI utils",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/codegen.d.ts CHANGED
@@ -41,6 +41,7 @@ export interface CustomAgentDefinition {
41
41
  systemPrompt?: string;
42
42
  tools?: string[];
43
43
  model?: string;
44
+ position?: string;
44
45
  needDevServer?: boolean;
45
46
  needValidation?: boolean;
46
47
  includeMemories?: boolean;
@@ -224,6 +225,82 @@ export interface RecordFrameToolInput {
224
225
  title: string;
225
226
  frame: "last-image";
226
227
  }
228
+ /**
229
+ * Configuration values proposed by the setup analyzer agent
230
+ */
231
+ export interface SetupAnalysisValues {
232
+ projectOverview: {
233
+ framework: string | null;
234
+ packageManager: "npm" | "yarn" | "pnpm" | "bun" | null;
235
+ isMonorepo: boolean;
236
+ detectedLanguage: "typescript" | "javascript" | null;
237
+ };
238
+ rootDirectory: {
239
+ path: string;
240
+ reason: string;
241
+ } | null;
242
+ installCommand: {
243
+ command: string;
244
+ reason: string;
245
+ } | null;
246
+ runtimeDependencies: Array<{
247
+ tool: string;
248
+ version: string;
249
+ source: string;
250
+ }>;
251
+ devServer: {
252
+ command: string;
253
+ url: string;
254
+ port: number;
255
+ reason: string;
256
+ } | null;
257
+ environmentVariables: Array<{
258
+ key: string;
259
+ description: string;
260
+ isRequired: boolean;
261
+ isSecret: boolean;
262
+ defaultValue: string | null;
263
+ source: string;
264
+ }>;
265
+ validationScript: {
266
+ command: string;
267
+ reason: string;
268
+ } | null;
269
+ npmrcContents: string | null;
270
+ }
271
+ export interface ProposeConfigToolInput {
272
+ config: SetupAnalysisValues;
273
+ message?: string;
274
+ }
275
+ export type SetupValueField = "installCommand" | "devServer" | "validationScript";
276
+ export interface UpdateSetupValueToolInput {
277
+ field: SetupValueField;
278
+ value: {
279
+ command: string;
280
+ url?: string;
281
+ port?: number;
282
+ };
283
+ reason: string;
284
+ }
285
+ export interface VerifyInstallCommandToolInput {
286
+ command: string;
287
+ timeout?: number;
288
+ }
289
+ export interface VerifyDevServerToolInput {
290
+ command: string;
291
+ url: string;
292
+ port: number;
293
+ timeout?: number;
294
+ }
295
+ export interface VerifyValidationScriptToolInput {
296
+ command: string;
297
+ timeout?: number;
298
+ }
299
+ export interface VerifyRuntimeDependencyToolInput {
300
+ tool: string;
301
+ version: string;
302
+ source?: string;
303
+ }
227
304
  export interface AddQAReviewComment {
228
305
  file_path: string;
229
306
  line: number;
@@ -293,9 +370,15 @@ export interface CodeGenToolMap {
293
370
  ExitPlanMode: ExitPlanModeToolInput;
294
371
  ReadMcpResource: ReadMcpResourceToolInput;
295
372
  RecordFrame: RecordFrameToolInput;
373
+ ProposeConfig: ProposeConfigToolInput;
374
+ UpdateSetupValue: UpdateSetupValueToolInput;
296
375
  AddQAReview: AddQAReviewToolInput;
297
376
  ResolveQAComments: ResolveQACommentsToolInput;
298
377
  ReportUIIssue: ReportUIIssueToolInput;
378
+ VerifyInstallCommand: VerifyInstallCommandToolInput;
379
+ VerifyDevServer: VerifyDevServerToolInput;
380
+ VerifyValidationScript: VerifyValidationScriptToolInput;
381
+ VerifyRuntimeDependency: VerifyRuntimeDependencyToolInput;
299
382
  }
300
383
  export type CodeGenTools = keyof CodeGenToolMap;
301
384
  export type AllCodeGenTools = CodeGenTools | "web_search";
@@ -782,9 +865,24 @@ export interface GenerateCompletionStepTerminals {
782
865
  type: "terminals";
783
866
  terminals: CodegenApiTerminal[];
784
867
  }
868
+ export interface GenerateCompletionStepProposeConfig {
869
+ type: "propose_config";
870
+ config: SetupAnalysisValues;
871
+ message?: string;
872
+ }
873
+ export interface GenerateCompletionStepUpdateSetupValue {
874
+ type: "update_setup_value";
875
+ field: SetupValueField;
876
+ value: {
877
+ command: string;
878
+ url?: string;
879
+ port?: number;
880
+ };
881
+ reason: string;
882
+ }
785
883
  export type GenerateCompletionStep = {
786
884
  timestamp?: number;
787
- } & (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);
885
+ } & (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);
788
886
  export interface ApplyActionsResult {
789
887
  filePath: string;
790
888
  addedLines: number;
@@ -864,6 +962,8 @@ export interface GenerateUserMessage {
864
962
  enabledMCPs?: string[];
865
963
  sessionMode?: SessionMode;
866
964
  queue?: boolean;
965
+ /** Custom agent type to use for this message */
966
+ agentType?: string;
867
967
  /** Enable AddQAReview tool for QA PR review branches */
868
968
  enableQAReviewTool?: boolean;
869
969
  /** @deprecated */
@@ -1464,6 +1564,8 @@ export interface FusionStatus {
1464
1564
  tunnel?: TunnelStatusInfo;
1465
1565
  /** Event loop delays collected every 5 seconds (in milliseconds) for percentile calculation */
1466
1566
  eventLoopDelays?: number[];
1567
+ /** Max memory pressure observed in the reporting period (0-1, where 1 is near OOM) */
1568
+ memoryPressure?: number;
1467
1569
  }
1468
1570
  export interface FusionMetrics {
1469
1571
  counters: {
package/src/projects.d.ts CHANGED
@@ -380,6 +380,8 @@ interface BranchSharedData {
380
380
  lastAgentActivityAt?: number | null;
381
381
  /** Timestamp of last activity on this branch - includes both agent and user activity (in milliseconds since epoch) */
382
382
  lastActivityAt?: number;
383
+ /** Whether the branch has unpushed changes (ahead > 0 or dirty working directory) */
384
+ hasUnpushedChanges?: boolean;
383
385
  }
384
386
  /**
385
387
  * fields that are required in the new branch format, but optional in the legacy branch format.