@builder.io/dev-tools 1.19.0 → 1.19.1

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,13 @@
1
1
  import { type ExpectStatic } from "vitest";
2
+ /**
3
+ * Check if the binary exists for the current platform.
4
+ */
5
+ export declare function binaryExists(): boolean;
6
+ /**
7
+ * Get the binary path for the current platform.
8
+ * Returns null if the platform is not supported.
9
+ */
10
+ export declare function getBinaryPath(): string | null;
2
11
  interface CLI {
3
12
  output(): string;
4
13
  consumeOutput(): string;
@@ -28,7 +37,14 @@ interface CLI {
28
37
  spawn(command: string, args: string[]): Promise<number>;
29
38
  }
30
39
  export declare function testCLI(name: string, template: string | undefined, handler: (cli: Handler, expect: ExpectStatic) => Promise<void>, timeout?: number, skip?: boolean): void;
31
- type Handler = (cmd: "builderio" | "create-builderio", args: string[], options?: {
40
+ /**
41
+ * Command types for the CLI handler:
42
+ * - "builderio": Run via Node.js (dist/dev-tools/cli/main.cjs)
43
+ * - "create-builderio": Run via Node.js (dist/create-builderio/index.js)
44
+ * - "binary": Run via compiled pkg binary (dist/fusion-binaries/.../builder-fusion)
45
+ */
46
+ export type CLICommand = "builderio" | "create-builderio" | "binary";
47
+ type Handler = (cmd: CLICommand, args: string[], options?: {
32
48
  debug?: boolean;
33
49
  }) => CLI;
34
50
  export declare function createCLI(template: string | undefined, handler: (cli: Handler) => Promise<void>): Promise<void>;
@@ -1,7 +1,6 @@
1
1
  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, SessionMode, UserContext, UserSource, WorkspaceFolder, LoadWholeSessionOptions, LoadWholeSessionResult, LoadHistoryResult, CodeGenMode, ApplyActionsResult, PrivacyMode, CodeGenPosition, BackupGitRepoResult, SuggestedActionBuildError, PushChangesArgs, CodegenApiResult, CodegenApiTerminal, ConfigureDevOrchestratorOpts, ConfigureDevOrchestratorUpdates, RepoMetrics, FolderWatchEvent, MCPServerConfig, CodegenApiCreateTerminal, SyncChangesFromRemote, SearchFilesOptions, SearchFilesResult, SearchFileTreeOptions, SearchFileTreeResult, ExplorationMetadataToolInput, CodegenAbortOptions, MessageUpdateOptions } from "$/ai-utils";
4
- import prettier from "prettier";
5
4
  import { type FusionContext, type ToolResolution } from "./code-tools";
6
5
  import { type SubAgent } from "./utils/agent-discovery";
7
6
  import EventEmitter from "node:events";
@@ -20,7 +19,7 @@ export interface SessionContext {
20
19
  customInstructions: CustomInstruction[];
21
20
  customAgents: SubAgent[];
22
21
  userContext: UserContext;
23
- prettierConfig: prettier.Config | null;
22
+ prettierConfig: Record<string, unknown> | null;
24
23
  state: GenerateCompletionState;
25
24
  title: string | undefined;
26
25
  beforeCommit: string | undefined;
@@ -104,6 +104,10 @@ export interface DevServerOrchestrator {
104
104
  }>;
105
105
  close: () => Promise<void>;
106
106
  }
107
+ /**
108
+ * Import PTY library with runtime detection.
109
+ * When running inside a pkg bundle, patches module resolution to find bundled native addons.
110
+ */
107
111
  export declare const importPty: (sys: DevToolsSys) => typeof import("@lydell/node-pty") | undefined;
108
112
  export declare function safeParseUrl(serverUrl: any): URL | undefined;
109
113
  export declare function devServerOrchestrator(sys: DevToolsSys, fusionConfig: FusionConfig, initialSetupState: "installed" | "not-installed" | "install-failed"): Promise<DevServerOrchestrator>;
@@ -1,3 +1,16 @@
1
- import builtInPrettier from "prettier";
2
- export declare function loadPrettier(absoluteFilePath: string | undefined): typeof builtInPrettier;
1
+ /**
2
+ * Prettier integration with graceful degradation.
3
+ *
4
+ * Prettier is externalized from the pkg binary to avoid dynamic import issues.
5
+ * This module handles the case where prettier may not be available at runtime.
6
+ */
7
+ /**
8
+ * Load prettier, preferring the user's local installation.
9
+ * Falls back to built-in prettier, or null if not available.
10
+ */
11
+ export declare function loadPrettier(absoluteFilePath: string | undefined): typeof import("prettier") | null;
12
+ /**
13
+ * Format code using prettier.
14
+ * Gracefully returns original code if prettier is not available.
15
+ */
3
16
  export declare function prettierFormat(workingDirectory: string, code: string, parser: string | undefined, filePath: string | undefined): Promise<string>;