@builder.io/ai-utils 0.44.4 → 0.44.6

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.44.4",
3
+ "version": "0.44.6",
4
4
  "description": "Builder.io AI utils",
5
5
  "files": [
6
6
  "src"
package/src/codegen.d.ts CHANGED
@@ -41,6 +41,9 @@ export interface CustomAgentInfo {
41
41
  name: string;
42
42
  description?: string;
43
43
  }
44
+ /** Per-agent model overrides. String = fixed model, string[] = round-robin. */
45
+ export type AgentModelOverrides = Record<string, string | string[]>;
46
+ export type ReviewEffort = "medium" | "high";
44
47
  export interface CustomAgentDefinition {
45
48
  name: string;
46
49
  description?: string;
@@ -61,13 +64,6 @@ export interface CustomAgentDefinition {
61
64
  filePath?: string;
62
65
  /** Default reasoning effort level for this agent type. Overrides the session default. */
63
66
  reasoning?: ReasoningEffort;
64
- /**
65
- * When true and the parent session has an explicit model override (e.g. set
66
- * via org/project PR-reviewer settings), that model is used for this agent
67
- * instead of the agent's own `model` / `roundRobinModels` defaults.
68
- * Has no effect when no session-level model override is present.
69
- */
70
- inheritSessionModel?: boolean;
71
67
  }
72
68
  export type CodeGenFramework = "react" | "html" | "mitosis" | "react-native" | "angular" | "vue" | "svelte" | "qwik" | "solid" | "marko" | "swiftui" | "jetpack-compose" | "flutter";
73
69
  export type CodeGenStyleLibrary = "tailwind" | "tailwind-precise" | "emotion" | "styled-components" | "styled-jsx" | "react-native" | undefined;
@@ -751,7 +747,8 @@ export type AllCodeGenTools = CodeGenTools | "web_search";
751
747
  export type SessionMode = "planning" | "normal" | "auto-planning" | "deep-research";
752
748
  export type CodeGenMode = "quality" | "quality-v3" | "quality-v4" | "quality-v4-agent";
753
749
  export type QueueMode = "next-turn" | "until-idle";
754
- export type BaseCodeGenPosition = "fusion" | "editor-ai" | "repo-indexing" | "cli" | "create-app-firebase" | "create-app-lovable" | "builder-code-panel" | "setup-project" | "code-review-orchestrator" | "project-configuration" | "org-agent" | "browser-testing" | "projects-scheduler-memory-extraction" | "unknown" | "dsi-mcp";
750
+ export declare const BASE_CODEGEN_POSITIONS: readonly ["fusion", "editor-ai", "repo-indexing", "cli", "create-app-firebase", "create-app-lovable", "builder-code-panel", "setup-project", "code-review-orchestrator", "project-configuration", "org-agent", "browser-testing", "projects-scheduler-memory-extraction", "unknown", "dsi-mcp"];
751
+ export type BaseCodeGenPosition = (typeof BASE_CODEGEN_POSITIONS)[number];
755
752
  export type CodeGenPosition = BaseCodeGenPosition | `${BaseCodeGenPosition}-agent`;
756
753
  export interface RepoIndexingConfig {
757
754
  designSystems: string[];
@@ -1383,6 +1380,7 @@ export interface GenerateUserMessage {
1383
1380
  dropAbortedPrompt?: boolean;
1384
1381
  runValidateCommand?: boolean;
1385
1382
  modelOverride?: string;
1383
+ agentModelOverrides?: AgentModelOverrides;
1386
1384
  softContextWindow?: number;
1387
1385
  maxCompletions?: number;
1388
1386
  isManualContinue?: boolean;
@@ -1414,6 +1412,7 @@ export interface UserInput {
1414
1412
  user: UserSource;
1415
1413
  patchFusionConfig?: Partial<FusionConfig> | undefined;
1416
1414
  modelOverride?: string;
1415
+ agentModelOverrides?: AgentModelOverrides;
1417
1416
  category?: CodeGenCategory;
1418
1417
  enabledMCPs?: string[];
1419
1418
  /** @deprecated */
package/src/codegen.js CHANGED
@@ -1 +1,17 @@
1
- export {};
1
+ export const BASE_CODEGEN_POSITIONS = [
2
+ "fusion",
3
+ "editor-ai",
4
+ "repo-indexing",
5
+ "cli",
6
+ "create-app-firebase",
7
+ "create-app-lovable",
8
+ "builder-code-panel",
9
+ "setup-project",
10
+ "code-review-orchestrator",
11
+ "project-configuration",
12
+ "org-agent",
13
+ "browser-testing",
14
+ "projects-scheduler-memory-extraction",
15
+ "unknown",
16
+ "dsi-mcp",
17
+ ];
package/src/events.d.ts CHANGED
@@ -395,6 +395,8 @@ export interface ThreadMessageCompleted extends AssistantMessage {
395
395
  platformId: string;
396
396
  threadId: string;
397
397
  commitId?: string;
398
+ creditsUsed?: number;
399
+ model?: string;
398
400
  }
399
401
  export interface ThreadRunStepDeltaEvent {
400
402
  type: "assistant.thread.run.step.delta";
@@ -452,26 +454,6 @@ export type FusionEventVariant<EventName extends string, ExtraData extends Recor
452
454
  eventName: EventName;
453
455
  };
454
456
  };
455
- export type AiTaskCompletedEvent = FusionEventVariant<"ai.task.completed", {
456
- durationMs?: number;
457
- success: boolean;
458
- }, {
459
- taskId: string;
460
- }, 1>;
461
- export declare const AiTaskCompletedEvent: {
462
- eventName: "ai.task.completed";
463
- version: "1";
464
- };
465
- export type AiTaskFailedEvent = FusionEventVariant<"ai.task.failed", {
466
- durationMs?: number;
467
- error: string;
468
- }, {
469
- taskId: string;
470
- }, 1>;
471
- export declare const AiTaskFailedEvent: {
472
- eventName: "ai.task.failed";
473
- version: "1";
474
- };
475
457
  export type GitPrCreatedV1 = FusionEventVariant<"git.pr.created", {
476
458
  projectId: string;
477
459
  branchName: string;
@@ -867,7 +849,7 @@ export declare const ClientDevtoolsToolResultV1: {
867
849
  eventName: "client.devtools.tool.result";
868
850
  version: "1";
869
851
  };
870
- export type FusionEvent = AiTaskCompletedEvent | AiTaskFailedEvent | ClientDevtoolsSessionStartedEvent | ClientDevtoolsSessionIdleEventV1 | ClientDevtoolsToolCallRequestV1 | ClientDevtoolsToolCallV1 | ClientDevtoolsToolResultV1 | FusionProjectCreatedV1 | SetupAgentCompletedV1 | GitPrMergedV1 | GitPrCreatedV1 | GitPrClosedV1 | ForceSetupAgentV1 | ClawMessageSentV1 | CodegenCompletionV1 | CodegenUserPromptV1 | GitWebhooksRegisterV1 | FusionProjectSettingsUpdatedV1 | VideoRecordingCompletedV1 | FusionBranchCreatedV1 | FusionContainerStartedV1 | FusionContainerFailedV1 | FusionBranchFailedV1 | BotMentionExternalPrV1 | ReviewSubmittedV1 | PrReviewRequestedV1;
852
+ export type FusionEvent = ClientDevtoolsSessionStartedEvent | ClientDevtoolsSessionIdleEventV1 | ClientDevtoolsToolCallRequestV1 | ClientDevtoolsToolCallV1 | ClientDevtoolsToolResultV1 | FusionProjectCreatedV1 | SetupAgentCompletedV1 | GitPrMergedV1 | GitPrCreatedV1 | GitPrClosedV1 | ForceSetupAgentV1 | ClawMessageSentV1 | CodegenCompletionV1 | CodegenUserPromptV1 | GitWebhooksRegisterV1 | FusionProjectSettingsUpdatedV1 | VideoRecordingCompletedV1 | FusionBranchCreatedV1 | FusionContainerStartedV1 | FusionContainerFailedV1 | FusionBranchFailedV1 | BotMentionExternalPrV1 | ReviewSubmittedV1 | PrReviewRequestedV1;
871
853
  export interface ModelPermissionRequiredEvent {
872
854
  type: "assistant.model.permission.required";
873
855
  data: {
package/src/events.js CHANGED
@@ -1,11 +1,3 @@
1
- export const AiTaskCompletedEvent = {
2
- eventName: "ai.task.completed",
3
- version: "1",
4
- };
5
- export const AiTaskFailedEvent = {
6
- eventName: "ai.task.failed",
7
- version: "1",
8
- };
9
1
  export const GitPrCreatedV1 = {
10
2
  eventName: "git.pr.created",
11
3
  version: "1",
package/src/messages.d.ts CHANGED
@@ -224,7 +224,7 @@ export interface UserMessageParam {
224
224
  /**
225
225
  * The contents of the user message.
226
226
  */
227
- content: string | (ContentMessageItemText | ContentMessageItemImage | ContentMessageItemDocument | ContentMessageItemVideo | ContentMessageItemToolResult)[];
227
+ content: string | ContentUserMessageItem[];
228
228
  responseId?: string;
229
229
  /**
230
230
  * The role of the messages author, in this case `user`.
@@ -232,6 +232,7 @@ export interface UserMessageParam {
232
232
  role: "user";
233
233
  id?: string;
234
234
  }
235
+ export type ContentUserMessageItem = ContentMessageItemText | ContentMessageItemImage | ContentMessageItemDocument | ContentMessageItemVideo | ContentMessageItemToolResult;
235
236
  export type AssistantMessageAction = "new-chat";
236
237
  export interface AssistantMessageParam {
237
238
  /**
@@ -1,4 +1,4 @@
1
- import type { EnvironmentVariable, PrivacyMode } from "./codegen";
1
+ import type { EnvironmentVariable, PrivacyMode, ReviewEffort } from "./codegen";
2
2
  export interface GithubEnterpriseSetupValue {
3
3
  host: string;
4
4
  clientId: string;
@@ -94,7 +94,7 @@ interface OrganizationSettings {
94
94
  disableFigmaImageUpload?: boolean;
95
95
  prReviewer?: {
96
96
  instructions?: string;
97
- model?: string;
97
+ reviewEffort?: ReviewEffort;
98
98
  };
99
99
  enableTicketAssessment?: boolean;
100
100
  ticketAssessmentPrompt?: string;
package/src/projects.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ConnectivityErrorCode, CheckType, LikelyCause } from "./connectivity/types.js";
2
- import type { FileOverride, EnvironmentVariable, LaunchServerState, LaunchServerStatus, BranchBackup, CommitMode, CustomInstruction, CustomAgentDefinition, GitSnapshot, AutoPushMode, GenerateUserMessage, CodeGenToolMap, GenerateCompletionStep } from "./codegen";
2
+ import type { FileOverride, EnvironmentVariable, LaunchServerState, LaunchServerStatus, BranchBackup, CommitMode, CustomInstruction, CustomAgentDefinition, GitSnapshot, AutoPushMode, GenerateUserMessage, CodeGenToolMap, GenerateCompletionStep, ReviewEffort } from "./codegen";
3
3
  import type { FallbackTokensPrivate } from "./organization";
4
4
  /**
5
5
  * Temporary type for date fields during migration.
@@ -656,7 +656,7 @@ export interface Project {
656
656
  prReviewer?: {
657
657
  enabled: boolean;
658
658
  instructions?: string;
659
- model?: string;
659
+ reviewEffort?: ReviewEffort;
660
660
  };
661
661
  enableSnapshots?: boolean;
662
662
  postMergeMemories?: boolean;