@builder.io/ai-utils 0.51.0 → 0.53.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.51.0",
3
+ "version": "0.53.0",
4
4
  "description": "Builder.io AI utils",
5
5
  "files": [
6
6
  "src"
@@ -21,5 +21,8 @@
21
21
  "types": "./src/connectivity/browser.d.ts",
22
22
  "import": "./src/connectivity/browser.js"
23
23
  }
24
+ },
25
+ "dependencies": {
26
+ "zod": "^4.4.3"
24
27
  }
25
28
  }
package/src/codegen.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { z } from "zod";
1
2
  import type { Attachment, ContentMessageItemToolResult } from "./messages";
2
3
  import type { BuilderContent } from "./completion";
3
4
  import type { Options as PrettierOptions } from "prettier";
@@ -36,7 +37,13 @@ export interface CustomInstruction {
36
37
  userInvocable?: boolean;
37
38
  }
38
39
  /** Reasoning effort level for LLM completions. */
39
- export type ReasoningEffort = "low" | "medium" | "high" | "minimal";
40
+ export declare const ReasoningEffortSchema: z.ZodEnum<{
41
+ low: "low";
42
+ medium: "medium";
43
+ high: "high";
44
+ minimal: "minimal";
45
+ }>;
46
+ export type ReasoningEffort = z.infer<typeof ReasoningEffortSchema>;
40
47
  export interface CustomAgentInfo {
41
48
  name: string;
42
49
  description?: string;
@@ -448,7 +455,7 @@ export interface UpdateSetupValueToolInput {
448
455
  };
449
456
  reason: string;
450
457
  }
451
- export type ExitState = "verified" | "no-frontend" | "empty-project" | "mobile-project" | "user-question" | "code-change-required" | "other" | "started";
458
+ export type ExitState = "verified" | "no-frontend" | "empty-project" | "mobile-project" | "user-question" | "code-change-required" | "other" | "started" | "failed";
452
459
  export interface ExitToolInput {
453
460
  state: ExitState;
454
461
  summary: string;
@@ -652,6 +659,16 @@ export interface SendMessageToolInput {
652
659
  * Default to false (text) for all text-originated messages.
653
660
  */
654
661
  voice_response?: boolean;
662
+ /**
663
+ * Builder.io user ID this message is from / should be attributed to. Only
664
+ * allowed when channel_id is 'builder/branch/{project_id}/{branch_name}'.
665
+ * When set, the message is delivered to the target branch as coming from
666
+ * this user (role 'user') instead of from the agent. Use whenever the
667
+ * message represents user feedback/intent that should be assigned to
668
+ * someone — even if it was composed, summarized, or merged from multiple
669
+ * people.
670
+ */
671
+ from_user_id?: string;
655
672
  }
656
673
  export interface SpawnBranchToolInput {
657
674
  project_id: string;
@@ -662,6 +679,7 @@ export interface SpawnBranchToolInput {
662
679
  session_mode?: "normal" | "planning" | "deep-research";
663
680
  model?: "auto" | "opus" | "sonnet" | "haiku";
664
681
  attachment_urls?: string[];
682
+ git_base_branch?: string;
665
683
  }
666
684
  export interface CreateProjectToolInput {
667
685
  repo_url: string;
@@ -2077,6 +2095,7 @@ export interface InitState {
2077
2095
  }[];
2078
2096
  }
2079
2097
  export type LaunchServerState = "initial" | "init-running" | "init-complete" | "ready" | "active-session" | "init-error" | "session-error" | "error" | "closing";
2098
+ export type LaunchServerPhase = "state-created" | "server-starting" | "server-error" | "server-listening" | "dev-server-configured" | "dev-server-error" | "setup-command-waiting" | "setup-command-error" | "launch-server-setup" | "websocket-ready" | "state-ready" | "editor-url-building" | "editor-url-ready" | "editor-ready" | "launch-error";
2080
2099
  export interface LaunchServerStatus {
2081
2100
  status: "ok";
2082
2101
  state: LaunchServerState;
@@ -2085,12 +2104,17 @@ export interface LaunchServerStatus {
2085
2104
  isFinalState: boolean;
2086
2105
  httpServerState?: HttpServerState;
2087
2106
  editorReady: boolean;
2107
+ editorReadyAt?: number;
2108
+ editorReadySource?: string;
2088
2109
  initState?: InitState;
2089
2110
  initStatusLogs?: InitStatusLog[];
2090
2111
  errorMessage?: string;
2091
2112
  devToolsVersion: string;
2092
2113
  lastRequestTime: number;
2093
2114
  startTime: number;
2115
+ processId: number;
2116
+ launchPhase?: LaunchServerPhase;
2117
+ launchPhaseUpdatedAt?: number;
2094
2118
  machine?: MachineConfig;
2095
2119
  projectId?: string;
2096
2120
  detectedServerUrl?: string;
@@ -2126,12 +2150,17 @@ export interface FusionStatus {
2126
2150
  setupState: SetupCommandState | undefined;
2127
2151
  devState: DevCommandState | undefined;
2128
2152
  editorReady: boolean;
2153
+ editorReadyAt: number | undefined;
2154
+ editorReadySource: string | undefined;
2129
2155
  httpServerState: HttpServerState | undefined;
2130
2156
  initState: InitState | undefined;
2131
2157
  errorMessage: string | undefined;
2132
2158
  devToolsVersion: string;
2133
2159
  idleTime: number;
2134
2160
  upTime: number;
2161
+ processId: number;
2162
+ launchPhase: LaunchServerPhase | undefined;
2163
+ launchPhaseUpdatedAt: number | undefined;
2135
2164
  machine: MachineConfig | undefined;
2136
2165
  projectId: string | undefined;
2137
2166
  detectedServerUrl: string | undefined;
package/src/codegen.js CHANGED
@@ -1,3 +1,8 @@
1
+ import { z } from "zod";
2
+ /** Reasoning effort level for LLM completions. */
3
+ export const ReasoningEffortSchema = z
4
+ .enum(["low", "medium", "high", "minimal"])
5
+ .meta({ title: "ReasoningEffort" });
1
6
  export const BASE_CODEGEN_POSITIONS = [
2
7
  "fusion",
3
8
  "editor-ai",
@@ -84,6 +84,8 @@ interface OrganizationSettings {
84
84
  fusionShareableUrlSuffix?: string;
85
85
  autoDetectDevServerPatterns?: string[];
86
86
  environmentVariables?: EnvironmentVariable[];
87
+ projectsUseGithubServerToken?: boolean;
88
+ prAuthoringMode?: "" | "prefer-user" | "always-bot" | "always-user";
87
89
  fusionPrLabel?: string;
88
90
  fusionPrQuietMode?: boolean;
89
91
  runInPty?: boolean;
package/src/projects.d.ts CHANGED
@@ -371,6 +371,13 @@ export interface PartialBranchData {
371
371
  projectId: string;
372
372
  branchName: string;
373
373
  };
374
+ /**
375
+ * Pre-generated sessionId. internal use only. When provided, the branch will use this sessionId
376
+ * instead of generating a new one. Allows callers (e.g. setup-agent spawner)
377
+ * to bootstrap a ProposedConfig doc keyed by sessionId before the branch
378
+ * record is fully created.
379
+ */
380
+ sessionId?: string;
374
381
  }
375
382
  export type EntityState = "active" | "deleted" | "archived";
376
383
  /**
@@ -724,6 +731,8 @@ export interface Project {
724
731
  useBranchesCollection?: boolean;
725
732
  /** When true, the project is in code-only mode */
726
733
  codeOnlyMode?: boolean;
734
+ /** When true, analysis detected a mobile-only app (no usable web dev server path) */
735
+ mobileOnlyDetected?: boolean;
727
736
  /** When true, this project is an org-level Claw agent */
728
737
  isOrgAgent?: boolean;
729
738
  /** Configuration for the org agent */
@@ -854,6 +863,17 @@ export interface CreateBranchOptions {
854
863
  branchName: string;
855
864
  url: string;
856
865
  }) => Promise<void> | void;
866
+ /**
867
+ * INTERNAL ONLY. Pre-generated sessionId used by trusted callers
868
+ * (e.g. setup-agent spawner) to bootstrap a ProposedConfig doc keyed by
869
+ * sessionId before the branch record exists.
870
+ *
871
+ * SECURITY: Must be stripped from any user-facing HTTP request body — this
872
+ * value becomes a Firestore document ID and accepting it from untrusted
873
+ * input enables cross-user ProposedConfig corruption via
874
+ * `.set(..., { merge: true })`.
875
+ */
876
+ sessionId?: string;
857
877
  }
858
878
  interface BaseCreateBranchMessage {
859
879
  }