builder.io 1.9.21 → 1.9.23

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.
@@ -59,6 +59,7 @@ export interface ToolContext extends Partial<FusionContext> {
59
59
  name?: string;
60
60
  }>;
61
61
  patchFusionConfig: (patch: Partial<FusionConfig>) => void;
62
+ passThrough: (toolCall: LLMToolCalls, signal: AbortSignal) => Promise<ToolResolution>;
62
63
  readFile: (filePath: string) => Promise<string | null>;
63
64
  writeFile: (filePath: string, content: string | Uint8Array) => Promise<boolean>;
64
65
  deleteFile: (filePath: string) => Promise<boolean>;
@@ -2,7 +2,7 @@ import type { DevToolsSys } from "../types";
2
2
  import { type Credentials } from "./credentials";
3
3
  import type { CodegenFeedback, CodeGenToolMap, CodegenTurn, CustomInstruction, FusionConfig, GenerateCompletionState, GenerateCompletionStep, GenerateCompletionStepGit, GenerateUserMessage, UserContext, WorkspaceConfiguration, WorkspaceFolder, LoadWholeSessionOptions, LoadWholeSessionResult, LoadHistoryResult, CodeGenMode, ApplyActionsResult } from "$/ai-utils";
4
4
  import prettier from "prettier";
5
- import { type FusionContext } from "./code-tools";
5
+ import { type FusionContext, type ToolResolution } from "./code-tools";
6
6
  import EventEmitter from "node:events";
7
7
  import { type RunGitOptions } from "./utils/git";
8
8
  export interface SessionContext {
@@ -30,6 +30,7 @@ export interface CodeGenSessionOptionsBase {
30
30
  workingDirectory?: string;
31
31
  mcpServers?: boolean;
32
32
  enabledTools?: (keyof CodeGenToolMap)[];
33
+ modelOverride?: string;
33
34
  }
34
35
  export interface CodeGenSessionOptionsSession extends CodeGenSessionOptionsBase {
35
36
  sessionOrCompletionId?: string;
@@ -128,6 +129,7 @@ export declare class CodeGenSession {
128
129
  getSessionId(): string;
129
130
  getSpaceId(): string | undefined;
130
131
  revertToCommitHash(commitHash: string): Promise<void>;
132
+ resetToCommitHash(commitHash: string): Promise<void>;
131
133
  /**
132
134
  * Core function to restore the codebase to a state that matches a predicate.
133
135
  * This is the main function that handles both git-based and file-based restoration.
@@ -194,6 +196,13 @@ export declare class CodeGenSession {
194
196
  abortSetupCommand(): void;
195
197
  toolsRunning(): boolean;
196
198
  abortAllTools(): void;
199
+ /**
200
+ * Fulfil a pending tool call (usually AskUser or any passThrough tool)
201
+ * Exposed via websocket as `toolFullfilment` for the Builder UI to send back
202
+ * the user's response.
203
+ */
204
+ toolFullfilment(id: string, result: ToolResolution | string): boolean;
205
+ fulfillToolCall(id: string, result: ToolResolution): boolean;
197
206
  abortToolCall(id: string): boolean;
198
207
  abort(cleanCurrentMessage?: boolean): Promise<boolean>;
199
208
  stopEventLoop(): Promise<void>;