@builder.io/dev-tools 1.6.27 → 1.6.28-dev.202504171328.43249660

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.
@@ -5,22 +5,7 @@ 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
- }
13
8
  export declare function resolveToolCalls(sys: DevToolsSys, toolCalls: LLMToolCalls[]): Promise<{
14
9
  toolResults: ContentMessageItemToolResult[];
15
10
  projectFiles: ProjectFile[];
16
11
  }>;
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 {};
@@ -2,26 +2,24 @@ import type { DevToolsSys } from "../types";
2
2
  import type { CLIArgs } from "./index";
3
3
  import { type Credentials } from "./credentials";
4
4
  import { type Checkpoint } from "./incremental-tsc";
5
- import type { ApplyActionsResult, Attachment, CodebaseSearchResponse, ContentMessageItemToolResult, CustomInstruction, GenerateCompletionStep, GenerateUserMessage, ProjectFile, UserContext } from "$/ai-utils";
5
+ import type { ApplyActionsResult, CodebaseSearchResponse, ContentMessageItemToolResult, CustomInstruction, GenerateCompletionStep, ProjectFile, UserContext } from "$/ai-utils";
6
6
  import prettier from "prettier";
7
- interface Turn {
8
- completionId: string;
9
- nextUrl: string | undefined;
10
- originalFiles: {
7
+ interface UndoState {
8
+ files: {
11
9
  path: string;
12
10
  content: Uint8Array | null;
13
11
  }[];
14
12
  isUserMessage: boolean;
13
+ url: string | undefined;
15
14
  toolResults: ContentMessageItemToolResult[];
16
15
  sentiment?: "positive" | "negative" | "undo";
17
16
  applyResults: ApplyActionsResult[];
18
17
  projectFiles: ProjectFile[];
19
- userInput: UserInput;
20
18
  }
21
- type State = "unknown" | "initial-with-url" | "initial-without-url" | "generating" | "success" | "abort" | "error";
19
+ type State = "initial-with-url" | "initial-without-url" | "success" | "success-just-text" | "abort" | "error";
22
20
  export interface SessionContext {
23
21
  sessionId: string;
24
- turns: Turn[];
22
+ undoStates: UndoState[];
25
23
  selectedFilePaths: Map<string, number>;
26
24
  customInstructions: CustomInstruction[];
27
25
  userContext: UserContext;
@@ -30,7 +28,6 @@ export interface SessionContext {
30
28
  }
31
29
  export interface UserInput {
32
30
  userPrompt: string;
33
- attachments: Attachment[];
34
31
  sentiment: "positive" | "negative" | "undo";
35
32
  files: ProjectFile[];
36
33
  searchResponse: CodebaseSearchResponse | null;
@@ -38,6 +35,11 @@ export interface UserInput {
38
35
  mostRelevantFile: string | null;
39
36
  role: "user" | "agent";
40
37
  }
38
+ interface UserMessage {
39
+ userPrompt: string;
40
+ files?: string[];
41
+ includeBaseFiles?: boolean;
42
+ }
41
43
  export declare class CodeGenSession {
42
44
  #private;
43
45
  constructor(sys: DevToolsSys, credentials: Credentials, args: CLIArgs, position: string, initialUrl?: string, mode?: "quality" | "quality-v3" | "fast");
@@ -47,23 +49,18 @@ export declare class CodeGenSession {
47
49
  getSessionId(): Promise<string>;
48
50
  getSpaceId(): string | undefined;
49
51
  undoLastUserMessage(dryRun?: boolean): Promise<string[]>;
50
- getLastCompletionId(): string | undefined;
51
- getCurrentState(): State;
52
- getLastTurn(): Turn | undefined;
53
- getNextUrl(): string | undefined;
54
- getNextMessage(): Promise<GenerateUserMessage>;
52
+ getNextMessage(): Promise<UserMessage>;
55
53
  sendFeedback(sentiment: "positive" | "negative" | "undo", message?: string, lastCompletionId?: string | undefined): Promise<void>;
56
54
  hasUndoChanges(): Promise<boolean>;
57
55
  isBusy(): boolean;
58
- sendMessage(message: GenerateUserMessage): void;
56
+ sendMessage(message: UserMessage): void;
59
57
  isEventLoopRunning(): boolean;
60
- getTurns(): void;
61
58
  getSessionContext(): Promise<SessionContext>;
62
59
  abort(): void;
63
60
  stopEventLoop(): void;
64
61
  startEventLoop(onStep: (step: GenerateCompletionStep) => void): Promise<void>;
65
- agentCompletion(userMessage: GenerateUserMessage, baselineCheckpoint: Checkpoint, signal: AbortSignal | undefined, onStep: (step: GenerateCompletionStep) => Promise<void> | void): Promise<Checkpoint>;
66
- getUserInput(userMessage: GenerateUserMessage, signal: AbortSignal | undefined): Promise<UserInput>;
62
+ agentCompletion(userMessage: UserMessage, baselineCheckpoint: Checkpoint, signal: AbortSignal | undefined, onStep: (step: GenerateCompletionStep) => Promise<void> | void): Promise<Checkpoint>;
63
+ getUserInput(userMessage: UserMessage, signal: AbortSignal | undefined): Promise<UserInput>;
67
64
  }
68
65
  export declare const createSessionContext: (sys: DevToolsSys) => Promise<SessionContext>;
69
66
  export declare function transformStream(body: ReadableStream<Uint8Array> | null): AsyncGenerator<string, void, unknown>;
@@ -41,9 +41,9 @@ export interface CLIArgs {
41
41
  port?: number;
42
42
  /** Port number for the dev server (shorthand) */
43
43
  p?: number;
44
- /** Dev server command to execute */
44
+ /** Command to execute */
45
45
  command?: string;
46
- /** Dev server command to execute (shorthand) */
46
+ /** Command to execute (shorthand) */
47
47
  c?: string;
48
48
  /** Skip authentication for testing purposes */
49
49
  noAuth?: boolean;
@@ -57,8 +57,8 @@ export interface CLIArgs {
57
57
  open?: boolean;
58
58
  /** Raw command line arguments */
59
59
  _: string[];
60
+ builderPublicKey?: string;
61
+ builderPrivateKey?: string;
60
62
  /** Silent mode for launch command */
61
63
  silent?: boolean;
62
- /** Fusion project ID */
63
- projectId?: string;
64
64
  }
@@ -1,7 +1,7 @@
1
1
  import type { DevToolsSys } from "@builder.io/dev-tools/core";
2
2
  import type { CLIArgs } from "../index";
3
3
  import type { EnsureConfigResult } from "types";
4
- export type InstallOutcome = EnsureConfigResult["outcome"] | "install-failed";
5
4
  export declare const installJsxPlugin: (sys: DevToolsSys, args: CLIArgs) => Promise<{
6
- installOutcome: InstallOutcome;
5
+ buildToolType: string | null;
6
+ installOutcome: EnsureConfigResult["outcome"];
7
7
  }>;
@@ -1,7 +1,4 @@
1
1
  import type { DevToolsSys } from "@builder.io/dev-tools/core";
2
2
  import type { CLIArgs } from "./index";
3
3
  export declare const PROXY_PORT = 48752;
4
- export declare function runLaunchCommand({ sys, args, }: {
5
- sys: DevToolsSys;
6
- args: CLIArgs;
7
- }): Promise<number>;
4
+ export declare function runLaunchCommand(sys: DevToolsSys, _subCommand: string, args: CLIArgs): Promise<number>;
@@ -17,7 +17,7 @@ export declare const NUMBER_TYPES: string[];
17
17
  export declare const BOOLEAN_TYPES: string[];
18
18
  export declare const ARRAY_TYPES: string[];
19
19
  export declare const OBJECT_TYPES: string[];
20
- export declare function getPrimitiveType(t: string): "number" | "string" | "boolean" | "object" | "array";
20
+ export declare function getPrimitiveType(t: string): "string" | "number" | "boolean" | "object" | "array";
21
21
  export declare function removeQuotes(text: string): string;
22
22
  export declare const resolveType: (sys: DevToolsSys, checker: ts.TypeChecker, type: ts.Type) => string[] | undefined;
23
23
  export declare const typeToString: (sys: DevToolsSys, checker: ts.TypeChecker, type: ts.Type) => string;
@@ -8,4 +8,4 @@ export declare function objectExpressionToObjectValue(sys: DevToolsSys, objectLi
8
8
  };
9
9
  export declare function convertArrayExpressionToJsArray(sys: DevToolsSys, arr: ts.ArrayLiteralExpression): any[];
10
10
  export declare function getTextOfPropertyName(sys: DevToolsSys, prop: ts.PropertyAssignment | ts.ObjectLiteralElementLike | undefined): string | undefined;
11
- export declare function valueToExpression(sys: DevToolsSys, val: any): ts.ObjectLiteralExpression | ts.Identifier | ts.StringLiteral | ts.NumericLiteral | ts.TrueLiteral | ts.FalseLiteral | ts.ArrayLiteralExpression;
11
+ export declare function valueToExpression(sys: DevToolsSys, val: any): ts.Identifier | ts.ObjectLiteralExpression | ts.StringLiteral | ts.NumericLiteral | ts.ArrayLiteralExpression | ts.TrueLiteral | ts.FalseLiteral;
@@ -0,0 +1,6 @@
1
+ import type { DevToolsSys } from "../..";
2
+ import type { EnsureConfigResult } from "../../../types";
3
+ /**
4
+ * Ensure the Remix Vite config has the necessary plugins and settings
5
+ */
6
+ export declare function ensureRemixConfig(sys: DevToolsSys, configFilePath: string, configContent: string): Promise<EnsureConfigResult>;
@@ -0,0 +1,10 @@
1
+ import type { DevToolsSys } from "../..";
2
+ import type ts from "typescript";
3
+ /**
4
+ * Check if the current project is using Remix framework
5
+ */
6
+ export declare function isRemixFramework(sys: DevToolsSys): boolean;
7
+ /**
8
+ * Update an object literal to include the external dependencies for Remix
9
+ */
10
+ export declare function updateCommonJsLibrary(sys: DevToolsSys, config: ts.ObjectLiteralExpression): ts.ObjectLiteralExpression | null;
@@ -0,0 +1,6 @@
1
+ import type { DevToolsSys } from "../..";
2
+ import type { EnsureConfigResult } from "../../../types";
3
+ /**
4
+ * Update a Vite config file to include a plugin
5
+ */
6
+ export declare function updateViteConfig(sys: DevToolsSys, configFilePath: string, configContent: string, pluginName: string, importPath: string): Promise<EnsureConfigResult>;
@@ -1,7 +1,3 @@
1
1
  import type { EnsureConfigResult } from "../../../types";
2
2
  import type { DevToolsSys } from "../..";
3
3
  export declare function viteEnsureConfigPlugin(sys: DevToolsSys, configFilePath: string, configContent: string): Promise<EnsureConfigResult>;
4
- /**
5
- * Update a Vite config file to include a plugin
6
- */
7
- export declare function updateViteConfig(sys: DevToolsSys, configFilePath: string, configContent: string, pluginName: string, importPath: string): Promise<EnsureConfigResult>;
@@ -29,7 +29,6 @@ export interface BaseFigmaProps {
29
29
  $name: string;
30
30
  $type: FigmaNodeType;
31
31
  $inputs: readonly FigmaComponentInput[];
32
- inputs: readonly FigmaComponentInput[];
33
32
  $componentName?: string;
34
33
  /** Represents the text content of the node and its descendants */
35
34
  $textContent: string;