builder.io 1.6.23 → 1.6.25

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.
@@ -1,4 +1,8 @@
1
1
  import type { DevToolsSys } from "../types";
2
+ import type { Credentials } from "./credentials";
3
+ import type { CLIArgs } from "cli";
4
+ import type { SessionContext } from "./codegen";
5
+ import type { CodebaseSearchOptions, CodebaseSearchResponse, RepoInfo } from "$/ai-utils";
2
6
  export interface GitRankingParams {
3
7
  sys: DevToolsSys;
4
8
  appRootDir: string;
@@ -42,3 +46,5 @@ export declare function updateFileRelationships(fileInfoMap: Map<string, GitFile
42
46
  */
43
47
  export declare function calculateGitImportance(file: string, gitFiles: Map<string, GitFileInfo>, baseImportance: number, relevantPaths: string[]): number;
44
48
  export declare function shouldIncludeHiddenFile(sys: DevToolsSys, file: string): boolean;
49
+ export declare function performSearch(sys: DevToolsSys, credentials: Credentials, args: CLIArgs, sessionContext: SessionContext, repoInfo: RepoInfo, files: string[], hiddenFiles: string[], userPrompt: string, allFiles: string[], packageJson: any, signal: AbortSignal | undefined): Promise<CodebaseSearchResponse | null>;
50
+ export declare function searchCodeBase(sys: DevToolsSys, credentials: Credentials, args: CLIArgs, signal: AbortSignal | undefined, body: CodebaseSearchOptions): Promise<CodebaseSearchResponse | null>;
@@ -1,3 +0,0 @@
1
- import type { DevToolsSys } from "../types";
2
- import type { DevToolsServer } from "../server";
3
- export declare function setupCodeServer(sys: DevToolsSys): Promise<DevToolsServer>;
@@ -5,7 +5,22 @@ export interface LLMToolCalls {
5
5
  input: Record<string, any>;
6
6
  id: string;
7
7
  }
8
+ export interface ToolResolution {
9
+ toolResult: string;
10
+ isError: boolean;
11
+ title?: string;
12
+ }
8
13
  export declare function resolveToolCalls(sys: DevToolsSys, toolCalls: LLMToolCalls[]): Promise<{
9
14
  toolResults: ContentMessageItemToolResult[];
10
15
  projectFiles: ProjectFile[];
11
16
  }>;
17
+ interface RipgrepMatch {
18
+ path: string;
19
+ lineNumber: number;
20
+ lineContent: string;
21
+ }
22
+ interface RipgrepResult {
23
+ matches: RipgrepMatch[];
24
+ }
25
+ export declare function runRipgrep(sys: DevToolsSys, pattern: string, includeGlob?: string, excludeGlob?: string): Promise<RipgrepResult>;
26
+ export {};
@@ -1,61 +1,7 @@
1
1
  import type { DevToolsSys } from "../types";
2
2
  import type { CLIArgs } from "./index";
3
- import { type Credentials } from "./credentials";
4
- import { type Checkpoint } from "./incremental-tsc";
5
- import { type IOService } from "./io-service";
6
- import type { ContentMessageItemToolResult, CustomInstruction, ProjectFile, UserContext } from "$/ai-utils";
7
- import prettier from "prettier";
8
- interface UndoState {
9
- files: {
10
- path: string;
11
- content: Uint8Array | null;
12
- }[];
13
- isAgent: boolean;
14
- url: string | undefined;
15
- toolResults: ContentMessageItemToolResult[];
16
- }
17
- interface CodeGenSearchResponse {
18
- ranked: RankedResult[];
19
- relevantPaths: string[];
20
- }
21
- interface RankedResult {
22
- filePath: string;
23
- startIndex: number;
24
- endIndex: number;
25
- score: number;
26
- id: string;
27
- }
28
- type State = "initial-with-url" | "initial-without-url" | "success" | "success-just-text" | "abort" | "error";
29
- export interface SessionContext {
30
- sessionId: string;
31
- undoStates: UndoState[];
32
- selectedFilePaths: Map<string, number>;
33
- customInstructions: CustomInstruction[];
34
- userContext: UserContext;
35
- prettierConfig: prettier.Config | null;
36
- state: State;
37
- }
38
- export interface UserInput {
39
- userPrompt: string;
40
- sentiment: "positive" | "negative" | "undo";
41
- files: ProjectFile[];
42
- searchResponse: CodeGenSearchResponse | null;
43
- rerankFiles?: number;
44
- mostRelevantFile: string | null;
45
- role: "user" | "agent";
46
- }
47
- export declare const runCodeCommand: (sys: DevToolsSys, subCommand: string, args: CLIArgs, io?: IOService) => Promise<void>;
48
- export declare const createSessionContext: (sys: DevToolsSys) => Promise<SessionContext>;
49
- export declare const runCodeGen: (sys: DevToolsSys, args: CLIArgs, io?: IOService) => Promise<void>;
50
- interface InteractiveAnswer {
51
- command: "exit" | undefined;
52
- userPrompt: string | undefined;
53
- feedback: "positive" | "negative" | "undo" | undefined;
54
- }
55
- export declare function getUserInput(sys: DevToolsSys, credentials: Credentials, args: CLIArgs, sessionContext: SessionContext, answer: InteractiveAnswer, signal: AbortSignal | undefined, io?: IOService): Promise<UserInput>;
56
- export declare function agentCompletion(sys: DevToolsSys, credentials: Credentials, args: CLIArgs, sessionContext: SessionContext, userInput: UserInput, url: string | undefined, baselineCheckpoint: Checkpoint, signal: AbortSignal | undefined, io?: IOService): Promise<Checkpoint>;
57
- export declare function createApp(userId: string, spaceId: string, privateKey: string, body: any): Promise<void>;
58
- export declare function transformStream(body: ReadableStream<Uint8Array> | null): AsyncGenerator<string, void, unknown>;
59
- export declare function checkProjectRoot(sys: DevToolsSys, interactive: boolean, io?: IOService): Promise<void>;
3
+ import type { UserContext } from "$/ai-utils";
4
+ export declare const runCodeCommand: (sys: DevToolsSys, subCommand: string, args: CLIArgs) => Promise<void>;
5
+ export declare const runCodeGen: (sys: DevToolsSys, args: CLIArgs) => Promise<void>;
6
+ export declare function checkProjectRoot(sys: DevToolsSys, interactive: boolean): Promise<void>;
60
7
  export declare function getUserContext(sys: DevToolsSys): Promise<UserContext>;
61
- export {};
@@ -0,0 +1,64 @@
1
+ import type { DevToolsSys } from "../types";
2
+ import type { CLIArgs } from "./index";
3
+ import { type Credentials } from "./credentials";
4
+ import { type Checkpoint } from "./incremental-tsc";
5
+ import type { ApplyActionsResult, CodebaseSearchResponse, ContentMessageItemToolResult, CustomInstruction, GenerateCompletionStep, GenerateUserMessage, ProjectFile, UserContext } from "$/ai-utils";
6
+ import prettier from "prettier";
7
+ interface UndoState {
8
+ files: {
9
+ path: string;
10
+ content: Uint8Array | null;
11
+ }[];
12
+ isUserMessage: boolean;
13
+ url: string | undefined;
14
+ toolResults: ContentMessageItemToolResult[];
15
+ sentiment?: "positive" | "negative" | "undo";
16
+ applyResults: ApplyActionsResult[];
17
+ projectFiles: ProjectFile[];
18
+ }
19
+ type State = "initial-with-url" | "initial-without-url" | "success" | "success-just-text" | "abort" | "error";
20
+ export interface SessionContext {
21
+ sessionId: string;
22
+ undoStates: UndoState[];
23
+ selectedFilePaths: Map<string, number>;
24
+ customInstructions: CustomInstruction[];
25
+ userContext: UserContext;
26
+ prettierConfig: prettier.Config | null;
27
+ state: State;
28
+ }
29
+ export interface UserInput {
30
+ userPrompt: string;
31
+ sentiment: "positive" | "negative" | "undo";
32
+ files: ProjectFile[];
33
+ searchResponse: CodebaseSearchResponse | null;
34
+ rerankFiles?: number;
35
+ mostRelevantFile: string | null;
36
+ role: "user" | "agent";
37
+ }
38
+ export declare class CodeGenSession {
39
+ #private;
40
+ constructor(sys: DevToolsSys, credentials: Credentials, args: CLIArgs, position: string, initialUrl?: string, mode?: "quality" | "quality-v3" | "fast");
41
+ setDebug(debug: boolean): void;
42
+ getAllFiles(): Promise<string[]>;
43
+ isNextPage(): boolean;
44
+ getSessionId(): Promise<string>;
45
+ getSpaceId(): string | undefined;
46
+ undoLastUserMessage(dryRun?: boolean): Promise<string[]>;
47
+ getNextMessage(): Promise<GenerateUserMessage>;
48
+ sendFeedback(sentiment: "positive" | "negative" | "undo", message?: string, lastCompletionId?: string | undefined): Promise<void>;
49
+ hasUndoChanges(): Promise<boolean>;
50
+ isBusy(): boolean;
51
+ sendMessage(message: GenerateUserMessage): void;
52
+ isEventLoopRunning(): boolean;
53
+ getSessionContext(): Promise<SessionContext>;
54
+ abort(): void;
55
+ stopEventLoop(): void;
56
+ startEventLoop(onStep: (step: GenerateCompletionStep) => void): Promise<void>;
57
+ agentCompletion(userMessage: GenerateUserMessage, baselineCheckpoint: Checkpoint, signal: AbortSignal | undefined, onStep: (step: GenerateCompletionStep) => Promise<void> | void): Promise<Checkpoint>;
58
+ getUserInput(userMessage: GenerateUserMessage, signal: AbortSignal | undefined): Promise<UserInput>;
59
+ }
60
+ export declare const createSessionContext: (sys: DevToolsSys) => Promise<SessionContext>;
61
+ export declare function transformStream(body: ReadableStream<Uint8Array> | null): AsyncGenerator<string, void, unknown>;
62
+ export declare function getUserContext(sys: DevToolsSys): Promise<UserContext>;
63
+ export declare function makeAsyncIterator<T>(): readonly [AsyncGenerator<T, void, void>, (event: T) => void, () => void];
64
+ export {};
@@ -4,7 +4,7 @@ export declare function extractSignatureInfo(content: string): {
4
4
  sessionKey?: string;
5
5
  snippetId?: string;
6
6
  };
7
- export declare function getAllProjectFiles(basePath: string, globPattern?: string): Promise<string[]>;
7
+ export declare function getAllProjectFiles(basePath: string, ignorePatterns?: (path: string) => boolean, globPattern?: string): Promise<string[]>;
8
8
  export declare function findBuilderFiles(basePath: string, targetContentId: string, targetSessionKey: string): Promise<FileNode[]>;
9
9
  export declare function filterNonImportantFiles(files: string[]): string[];
10
10
  export declare function getIgnorePatterns(basePath: string): (path: string) => boolean;