@builder.io/ai-utils 0.42.0 → 0.44.0

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.42.0",
3
+ "version": "0.44.0",
4
4
  "description": "Builder.io AI utils",
5
5
  "files": [
6
6
  "src"
package/src/codegen.d.ts CHANGED
@@ -57,6 +57,7 @@ export interface CustomAgentDefinition {
57
57
  mcpServers?: boolean;
58
58
  asyncSubAgents?: boolean;
59
59
  queueMode?: QueueMode;
60
+ softContextWindow?: number;
60
61
  filePath?: string;
61
62
  /** Default reasoning effort level for this agent type. Overrides the session default. */
62
63
  reasoning?: ReasoningEffort;
@@ -865,6 +866,10 @@ export interface CodeGenInputOptions {
865
866
  * @internal - Set by middleware, not by clients
866
867
  */
867
868
  branchAgentTypeChecked?: boolean;
869
+ /**
870
+ * The parent session ID, used to roll up sub-agent costs into the parent session's extraCost.
871
+ */
872
+ parentSessionId?: string;
868
873
  /** @deprecated */
869
874
  prevId?: string;
870
875
  /** @deprecated */
@@ -1844,6 +1849,8 @@ export interface FusionConfig {
1844
1849
  machine?: RemoteMachineConfig;
1845
1850
  _attemptDryRunBackupGit?: boolean;
1846
1851
  _useNI?: boolean;
1852
+ /** If true, nuke and re-clone the git repo during init, overwriting the existing repo */
1853
+ rebuildGit?: boolean;
1847
1854
  mode?: Mode;
1848
1855
  autoDetectDevServer?: boolean;
1849
1856
  autoDetectDevServerPatterns?: string[];
@@ -2413,6 +2420,10 @@ export interface SessionData {
2413
2420
  description?: string;
2414
2421
  hasPlanToApply?: boolean;
2415
2422
  cost: number;
2423
+ /** Cost from tools (e.g. WebSearch LLM calls) and sub-agent roll-ups. Total session cost = cost + extraCost. */
2424
+ extraCost?: number;
2425
+ /** If set, this session is a sub-agent of the given parent session. Used to avoid double-counting in aggregations. */
2426
+ parentSessionId?: string;
2416
2427
  totalCompletions: number;
2417
2428
  numUserMessages: number;
2418
2429
  numNormalUserMessages: number;
package/src/events.d.ts CHANGED
@@ -592,6 +592,8 @@ export type ClientDevtoolsSessionIdleEventV1 = FusionEventVariant<"client.devtoo
592
592
  branchName?: string;
593
593
  hasPlanToApply?: boolean;
594
594
  sessionMode?: string;
595
+ gifId?: string;
596
+ planContent?: string;
595
597
  }, {
596
598
  projectId?: string;
597
599
  branchName?: string;
@@ -796,7 +798,76 @@ export interface SendMessageToOrgAgentInput {
796
798
  */
797
799
  autoCreateProject?: boolean;
798
800
  }
799
- export type FusionEvent = AiTaskCompletedEvent | AiTaskFailedEvent | ClientDevtoolsSessionStartedEvent | ClientDevtoolsSessionIdleEventV1 | FusionProjectCreatedV1 | SetupAgentCompletedV1 | GitPrMergedV1 | GitPrCreatedV1 | GitPrClosedV1 | ForceSetupAgentV1 | ClawMessageSentV1 | CodegenCompletionV1 | CodegenUserPromptV1 | GitWebhooksRegisterV1 | FusionProjectSettingsUpdatedV1 | VideoRecordingCompletedV1 | FusionBranchCreatedV1 | FusionContainerStartedV1 | FusionContainerFailedV1 | FusionBranchFailedV1 | BotMentionExternalPrV1 | ReviewSubmittedV1;
801
+ export type PrReviewRequestedV1 = FusionEventVariant<"pr.review.requested", {
802
+ repoFullName: string;
803
+ repoHtmlUrl?: string;
804
+ prNumber: number;
805
+ prTitle: string;
806
+ prDescription: string;
807
+ headRef: string;
808
+ headSha: string;
809
+ isDraft?: boolean;
810
+ forceRun?: boolean;
811
+ triggerSource?: string;
812
+ isSynchronize?: boolean;
813
+ isFork?: boolean;
814
+ forceBrowserTesting?: boolean;
815
+ }, {}, 1>;
816
+ export declare const PrReviewRequestedV1: {
817
+ eventName: "pr.review.requested";
818
+ version: "1";
819
+ };
820
+ export type ClientDevtoolsToolCallRequestV1 = FusionEventVariant<"client.devtools.tool.call-request", {
821
+ toolUseId: string;
822
+ toolName: string;
823
+ input?: unknown;
824
+ sessionId?: string;
825
+ projectId?: string;
826
+ branchName?: string;
827
+ messageValid?: boolean;
828
+ }, {
829
+ toolName: string;
830
+ projectId?: string;
831
+ branchName?: string;
832
+ }, 1>;
833
+ export declare const ClientDevtoolsToolCallRequestV1: {
834
+ eventName: "client.devtools.tool.call-request";
835
+ version: "1";
836
+ };
837
+ export type ClientDevtoolsToolCallV1 = FusionEventVariant<"client.devtools.tool.call", {
838
+ toolUseId: string;
839
+ toolName: string;
840
+ content?: string;
841
+ sessionId?: string;
842
+ projectId?: string;
843
+ branchName?: string;
844
+ }, {
845
+ toolName: string;
846
+ projectId?: string;
847
+ branchName?: string;
848
+ }, 1>;
849
+ export declare const ClientDevtoolsToolCallV1: {
850
+ eventName: "client.devtools.tool.call";
851
+ version: "1";
852
+ };
853
+ export type ClientDevtoolsToolResultV1 = FusionEventVariant<"client.devtools.tool.result", {
854
+ toolUseId: string;
855
+ toolName: string;
856
+ result?: unknown;
857
+ isError?: boolean;
858
+ sessionId?: string;
859
+ projectId?: string;
860
+ branchName?: string;
861
+ }, {
862
+ toolName: string;
863
+ projectId?: string;
864
+ branchName?: string;
865
+ }, 1>;
866
+ export declare const ClientDevtoolsToolResultV1: {
867
+ eventName: "client.devtools.tool.result";
868
+ version: "1";
869
+ };
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;
800
871
  export interface ModelPermissionRequiredEvent {
801
872
  type: "assistant.model.permission.required";
802
873
  data: {
package/src/events.js CHANGED
@@ -86,3 +86,19 @@ export const VideoRecordingCompletedV1 = {
86
86
  eventName: "video.recording.completed",
87
87
  version: "1",
88
88
  };
89
+ export const PrReviewRequestedV1 = {
90
+ eventName: "pr.review.requested",
91
+ version: "1",
92
+ };
93
+ export const ClientDevtoolsToolCallRequestV1 = {
94
+ eventName: "client.devtools.tool.call-request",
95
+ version: "1",
96
+ };
97
+ export const ClientDevtoolsToolCallV1 = {
98
+ eventName: "client.devtools.tool.call",
99
+ version: "1",
100
+ };
101
+ export const ClientDevtoolsToolResultV1 = {
102
+ eventName: "client.devtools.tool.result",
103
+ version: "1",
104
+ };
package/src/index.d.ts CHANGED
@@ -12,4 +12,5 @@ export * from "./vscode-tunnel.js";
12
12
  export * from "./claw.js";
13
13
  export * from "./kube-error.js";
14
14
  export * from "./connectivity/types.js";
15
+ export * from "./vpc-peering.js";
15
16
  export { connectivityErrorCodeToLikelyCause, mapConnectivityErrorMessage, } from "./connectivity/error-codes.js";
package/src/index.js CHANGED
@@ -12,4 +12,5 @@ export * from "./vscode-tunnel.js";
12
12
  export * from "./claw.js";
13
13
  export * from "./kube-error.js";
14
14
  export * from "./connectivity/types.js";
15
+ export * from "./vpc-peering.js";
15
16
  export { connectivityErrorCodeToLikelyCause, mapConnectivityErrorMessage, } from "./connectivity/error-codes.js";
@@ -101,6 +101,12 @@ interface OrganizationSettings {
101
101
  ticketAssessmentModel?: string;
102
102
  ticketAssessmentDailyLimit?: number;
103
103
  fusionWebhooks?: FusionWebhook[];
104
+ /** Default VPC peering ID for this space. References a document in the vpcPeerings collection.
105
+ * Projects can override this with their own vpcPeering setting. */
106
+ defaultVpcPeering?: string;
107
+ controlModelAvailability?: boolean;
108
+ allowedAiModels?: string[];
109
+ autoModelOverride?: string;
104
110
  }
105
111
  interface RoleOptions {
106
112
  read?: boolean;
package/src/projects.d.ts CHANGED
@@ -682,6 +682,9 @@ export interface Project {
682
682
  * Agents will pick this project when asked to do something with the connected repository.
683
683
  */
684
684
  isPreferredForRepo?: boolean;
685
+ /** VPC peering ID for this project. Overrides the space-level defaultVpcPeering.
686
+ * References a document in the vpcPeerings collection. */
687
+ vpcPeering?: string;
685
688
  };
686
689
  screenshot: string | null;
687
690
  isExample?: boolean;
@@ -815,6 +818,8 @@ export interface CreateBranchOptions {
815
818
  branchNameSuffix?: string;
816
819
  /** Additional metadata to store on the branch (e.g., Slack thread origin) */
817
820
  metadata?: Record<string, unknown>;
821
+ /** The git branch name this Fusion branch corresponds to (used by push/pull CLI commands) */
822
+ gitAiBranch?: string | null;
818
823
  }
819
824
  interface BaseCreateBranchMessage {
820
825
  }
@@ -0,0 +1,49 @@
1
+ /** Fields common to all VPC connectivity types. */
2
+ interface VpcConnectionBase {
3
+ id: string;
4
+ ownerId: string;
5
+ type: string;
6
+ gcpRegion: string;
7
+ customerDnsServers: string[];
8
+ proxyIp: string;
9
+ enabled: boolean;
10
+ createdAt: number;
11
+ updatedAt: number;
12
+ }
13
+ /** Traditional VPC Peering via bridge VPC. */
14
+ export interface VpcGcpPeering extends VpcConnectionBase {
15
+ type: "gcp-peering";
16
+ gcpProjectId: string;
17
+ gcpNetworkName: string;
18
+ bridgeCidr: string;
19
+ importCustomRoutes: boolean;
20
+ }
21
+ /**
22
+ * PSC Network Attachment — customer creates the network attachment in their VPC,
23
+ * our proxy VM connects to it via a PSC interface on nic1.
24
+ * No bridge VPC or bridge CIDR needed on our side.
25
+ */
26
+ export interface VpcGcpNetworkAttachment extends VpcConnectionBase {
27
+ type: "gcp-network-attachment";
28
+ gcpProjectId: string;
29
+ networkAttachmentName: string;
30
+ }
31
+ /** Discriminated union of all VPC connectivity types. */
32
+ export type VpcPeering = VpcGcpPeering | VpcGcpNetworkAttachment;
33
+ export interface CreateVpcGcpPeeringParams {
34
+ type: "gcp-peering";
35
+ gcpRegion: string;
36
+ gcpProjectId: string;
37
+ gcpNetworkName: string;
38
+ bridgeCidr: string;
39
+ customerDnsServers: string[];
40
+ importCustomRoutes?: boolean;
41
+ }
42
+ export interface CreateVpcGcpNetworkAttachmentParams {
43
+ type: "gcp-network-attachment";
44
+ gcpProjectId: string;
45
+ networkAttachmentName: string;
46
+ customerDnsServers: string[];
47
+ }
48
+ export type CreateVpcPeeringParams = CreateVpcGcpPeeringParams | CreateVpcGcpNetworkAttachmentParams;
49
+ export {};
@@ -0,0 +1 @@
1
+ export {};