@builder.io/dev-tools 1.54.0-dev.202605061503.b7d7f52af → 1.54.0-dev.202605071723.0f04065b3

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.
Files changed (38) hide show
  1. package/cli/index.cjs +340 -746
  2. package/cli/index.cjs.map +4 -4
  3. package/core/index.cjs +1 -1
  4. package/core/index.mjs +1 -1
  5. package/node/index.cjs +1 -1
  6. package/node/index.mjs +1 -1
  7. package/package.json +1 -1
  8. package/server/index.cjs +4 -4
  9. package/server/index.mjs +4 -4
  10. package/types/_tests_/launch-mcp-http.e2e.d.ts +11 -0
  11. package/types/_tests_/launch-mcp-mixed.e2e.d.ts +10 -0
  12. package/types/_tests_/launch-mcp-sse.e2e.d.ts +10 -0
  13. package/types/_tests_/launch-mcp-stdio.e2e.d.ts +10 -0
  14. package/types/_tests_/mcp-test-server-http.d.ts +22 -0
  15. package/types/_tests_/mcp-test-server-sse.d.ts +24 -0
  16. package/types/_tests_/mcp-test-server-stdio.d.ts +18 -0
  17. package/types/cli/codegen.d.ts +1 -2
  18. package/types/cli/debug-mcp.d.ts +19 -0
  19. package/types/cli/generate.d.ts +1 -1
  20. package/types/cli/index.d.ts +0 -2
  21. package/types/cli/launch.d.ts +1 -1
  22. package/types/cli/utils/agent-parser.d.ts +1 -2
  23. package/types/common/ast/component-input-types.d.ts +1 -1
  24. package/types/common/logger.d.ts +0 -15
  25. package/types/common/utils.d.ts +1 -1
  26. package/types/tsconfig.tsbuildinfo +1 -1
  27. package/types/cli/indexing.d.ts +0 -5
  28. package/types/cli/launch/github.d.ts +0 -3
  29. package/types/cli/utils/dev-server-url-parser.d.ts +0 -12
  30. package/types/core/component-map-builder.d.ts +0 -42
  31. package/types/server/source-map-resolver/cache.d.ts +0 -36
  32. package/types/server/source-map-resolver/indexed-map-resolver.d.ts +0 -10
  33. package/types/server/source-map-resolver/loader.d.ts +0 -16
  34. package/types/server/source-map-resolver/security.d.ts +0 -21
  35. package/types/server/source-map-resolver/types.d.ts +0 -41
  36. package/types/server/source-map-resolver/validation.d.ts +0 -16
  37. package/types/server/source-map-resolver.d.ts +0 -25
  38. /package/types/{cli/utils/dev-server-url-parser.test.d.ts → _tests_/mcp-retry.e2e.d.ts} +0 -0
@@ -0,0 +1,11 @@
1
+ /**
2
+ * E2E Tests for MCP Connections - HTTP Transport (Streamable HTTP)
3
+ *
4
+ * These tests verify:
5
+ * - Successful connection and tool execution with HTTP MCP servers
6
+ * - Initial connection retry on network failure
7
+ * - Reconnection after network interruption
8
+ * - Server shutdown during session
9
+ * - Slow network simulation
10
+ */
11
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * E2E Tests for MCP Connections - Mixed Transport & Edge Cases
3
+ *
4
+ * These tests verify:
5
+ * - Multiple MCP servers with different transport types
6
+ * - Partial failure scenarios (some servers connect, some fail)
7
+ * - Resource discovery across different transports
8
+ * - Complex configuration scenarios
9
+ */
10
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * E2E Tests for MCP Connections - SSE Transport
3
+ *
4
+ * These tests verify:
5
+ * - Successful SSE connection and tool execution
6
+ * - SSE reconnection on stream interruption
7
+ * - Server shutdown with SSE
8
+ * - Connection handling for SSE-specific scenarios
9
+ */
10
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * E2E Tests for MCP Connections - Stdio Transport
3
+ *
4
+ * These tests verify:
5
+ * - Successful connection and tool execution with stdio MCP servers
6
+ * - Invalid command handling (initial connection failure)
7
+ * - Server process crash during operation
8
+ * - Server becomes unresponsive (hang simulation)
9
+ */
10
+ export {};
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Mock MCP Server for E2E Testing - HTTP Transport (Streamable HTTP)
4
+ *
5
+ * This server implements the MCP protocol using HTTP transport for testing purposes.
6
+ * It provides controllable test tools and can simulate various failure scenarios.
7
+ *
8
+ * Usage: node mcp-test-server-http.js [port]
9
+ *
10
+ * The server outputs its port number to stdout on startup for test coordination.
11
+ *
12
+ * Test tools:
13
+ * - echo: Returns the input message
14
+ * - add_numbers: Adds two numbers
15
+ * - get_timestamp: Returns current timestamp
16
+ *
17
+ * Control endpoints:
18
+ * - POST /test/kill - Shuts down the server
19
+ * - POST /test/delay/:ms - Adds delay to next N requests
20
+ * - POST /test/error/:code - Returns HTTP error code for next request
21
+ */
22
+ export {};
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Mock MCP Server for E2E Testing - SSE Transport
4
+ *
5
+ * This server implements the MCP protocol using Server-Sent Events (SSE) transport
6
+ * for testing purposes. It provides controllable test tools and can simulate
7
+ * various failure scenarios.
8
+ *
9
+ * Usage: node mcp-test-server-sse.js [port]
10
+ *
11
+ * The server outputs its port number to stdout on startup for test coordination.
12
+ *
13
+ * Test tools:
14
+ * - echo: Returns the input message
15
+ * - add_numbers: Adds two numbers
16
+ * - get_timestamp: Returns current timestamp
17
+ *
18
+ * Control endpoints:
19
+ * - POST /test/kill - Shuts down the server
20
+ * - POST /test/delay/:ms - Adds delay to next N requests
21
+ * - POST /test/error/:code - Returns HTTP error code for next request
22
+ * - POST /test/disconnect - Forcefully disconnects all SSE clients
23
+ */
24
+ export {};
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Mock MCP Server for E2E Testing - Stdio Transport
4
+ *
5
+ * This server implements the MCP protocol using stdio transport for testing purposes.
6
+ * It provides controllable test tools and can simulate various failure scenarios.
7
+ *
8
+ * Usage: node mcp-test-server-stdio.js
9
+ *
10
+ * Test tools:
11
+ * - echo: Returns the input message
12
+ * - add_numbers: Adds two numbers
13
+ * - get_timestamp: Returns current timestamp
14
+ * - __test_exit__: Causes immediate process exit (simulates crash)
15
+ * - __test_hang__: Stops responding (simulates freeze)
16
+ * - __test_slow__: Adds delay to response (simulates slow network)
17
+ */
18
+ export {};
@@ -1,7 +1,7 @@
1
1
  import type { DevToolsSys } from "../types";
2
2
  import { type Credentials } from "./credentials";
3
3
  import { TimelineCollector } from "./utils/timeline-collector";
4
- import type { CodegenFeedback, CodeGenToolMap, CodegenTurn, CustomInstruction, FusionConfig, GenerateCompletionState, GenerateCompletionStep, 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, HttpServerState, ExplorationMetadataToolInput, CodegenAbortOptions, MessageUpdateOptions, GitRepoContext, SystemReminderObj, GitSnapshot, AutoPushMode, QueueMode, CustomAgentDefinition, AgentModelOverrides, MemorySummary, SendMessageToOrgAgentInput, ReasoningEffort } from "#ai-utils";
4
+ import type { CodegenFeedback, CodeGenToolMap, CodegenTurn, CustomInstruction, FusionConfig, GenerateCompletionState, GenerateCompletionStep, GenerateUserMessage, SessionMode, UserContext, UserSource, WorkspaceFolder, LoadWholeSessionOptions, LoadWholeSessionResult, LoadHistoryResult, ApplyActionsResult, PrivacyMode, CodeGenPosition, BackupGitRepoResult, SuggestedActionBuildError, PushChangesArgs, CodegenApiResult, CodegenApiTerminal, ConfigureDevOrchestratorOpts, ConfigureDevOrchestratorUpdates, RepoMetrics, FolderWatchEvent, MCPServerConfig, CodegenApiCreateTerminal, SyncChangesFromRemote, SearchFilesOptions, SearchFilesResult, SearchFileTreeOptions, SearchFileTreeResult, HttpServerState, ExplorationMetadataToolInput, CodegenAbortOptions, MessageUpdateOptions, GitRepoContext, SystemReminderObj, GitSnapshot, AutoPushMode, QueueMode, CustomAgentDefinition, AgentModelOverrides, MemorySummary, SendMessageToOrgAgentInput, ReasoningEffort } from "#ai-utils";
5
5
  import { type ToolResolution } from "./code-tools";
6
6
  import { type SubAgent } from "./utils/agent-discovery";
7
7
  import EventEmitter from "node:events";
@@ -42,7 +42,6 @@ export interface CodeGenSessionOptionsBase {
42
42
  credentials: Credentials;
43
43
  position: CodeGenPosition;
44
44
  maxTokens?: number;
45
- mode: CodeGenMode;
46
45
  queueMode?: QueueMode;
47
46
  privacyMode?: PrivacyMode;
48
47
  softContextWindow?: number;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * MCP Connection Debugging Command
3
+ *
4
+ * This command helps debug MCP (Model Context Protocol) server connection issues.
5
+ * It mimics exactly how the dev-tools CLI connects to MCP servers, making it useful
6
+ * for diagnosing problems like "invalid session ID" errors.
7
+ *
8
+ * Usage:
9
+ * npx builder.io debug-mcp [--server <name>] [--verbose]
10
+ */
11
+ import type { DevToolsSys } from "../core";
12
+ import type { CLIArgs } from "./index";
13
+ export interface DebugMcpArgs extends CLIArgs {
14
+ /** Test only a specific server by name */
15
+ server?: string;
16
+ /** Show verbose/detailed output */
17
+ verbose?: boolean;
18
+ }
19
+ export declare function runDebugMcpCommand(sys: DevToolsSys, args: DebugMcpArgs): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import type { ComponentInfo, ComponentRegistry, DevToolsSys } from "../types";
2
2
  import type { CLIArgs } from "./index";
3
- import { type FigmaComponentInfo, type UserContext } from "#ai-utils";
3
+ import { type FigmaComponentInfo, type UserContext } from "$/ai-utils";
4
4
  export declare const runFigmaGenerate: (sys: DevToolsSys, args: CLIArgs) => Promise<undefined>;
5
5
  export interface MappingCodeV3 {
6
6
  figmaNode?: FigmaComponentInfo;
@@ -75,8 +75,6 @@ export interface CLIArgs {
75
75
  nodeId?: string;
76
76
  /** Prompt text for non-interactive mode */
77
77
  prompt?: string;
78
- /** Generation mode */
79
- mode?: "quality" | "quality-v3";
80
78
  /** Working directory to run commands from */
81
79
  cwd?: string;
82
80
  /** Debug mode */
@@ -117,6 +117,6 @@ export declare function runFusionCommand({ sys, args, existingSession, }: {
117
117
  args: LaunchArgs;
118
118
  existingSession?: CodeGenSession;
119
119
  }): Promise<void>;
120
- declare const PUBLIC_METHODS: ("abort" | "switchSessionMode" | "switchModelOverride" | "queueSystemReminder" | "setDefaultAutoPush" | "setPrivacyMode" | "loadHistory" | "loadMoreTurns" | "setCustomInstructions" | "pushRepoV2" | "uploadBackup" | "pushChanges" | "abortMerge" | "syncChangesFromRemote" | "createTerminal" | "updateTerminal" | "writeTerminal" | "signalTerminal" | "disposeTerminal" | "restartTerminal" | "getAllFiles" | "searchFiles" | "searchFileTree" | "collectRepoMetrics" | "restoreFromCompletionId" | "restoreBeforeCompletionId" | "undoLastUserMessage" | "sendFeedback" | "clearSession" | "clearMessageQueue" | "updateMessage" | "flushMessageQueue" | "sendMessage" | "setProxyOrigin" | "abortSetupCommand" | "abortValidateCommand" | "toolFullfilment" | "abortToolCall" | "stopEventLoop" | "configureDevOrchestrator" | "tsServerInit" | "tsServerOpenFile" | "tsServerChangeFile" | "tsServerCloseFile" | "tsServerGetCompletions" | "tsServerGetCompletionDetails" | "tsServerGetDefinition" | "tsServerGetTypeDefinition" | "tsServerGetQuickInfo" | "tsServerGetReferences" | "tsServerGetSignatureHelp" | "tsServerRequestDiagnostics" | "tsServerGetRenameLocations" | "tsServerGetNavTree" | "tsServerOrganizeImports" | "tsServerGetInlayHints" | "tsServerGetCodeFixes" | "tsServerGetApplicableRefactors" | "tsServerGetEditsForRefactor" | "tsServerGetImplementation" | "tsServerGetSelectionRange" | "tsServerGetLinkedEditingRange" | "tsServerGetFormatRange" | "manualCommit" | "launchEditor" | "readFile" | "readFileWithChecksum" | "readBinaryFile" | "getSingleFileDiff" | "discardFileChanges" | "revertDiscard" | "fileExists" | "writeFile" | "listDir" | "listCustomInstructions" | "deleteFile" | "getDiff")[];
120
+ declare const PUBLIC_METHODS: ("readFile" | "readBinaryFile" | "writeFile" | "launchEditor" | "abort" | "switchSessionMode" | "switchModelOverride" | "queueSystemReminder" | "setDefaultAutoPush" | "setPrivacyMode" | "loadHistory" | "loadMoreTurns" | "setCustomInstructions" | "pushRepoV2" | "uploadBackup" | "pushChanges" | "abortMerge" | "syncChangesFromRemote" | "createTerminal" | "updateTerminal" | "writeTerminal" | "signalTerminal" | "disposeTerminal" | "restartTerminal" | "getAllFiles" | "searchFiles" | "searchFileTree" | "collectRepoMetrics" | "restoreFromCompletionId" | "restoreBeforeCompletionId" | "undoLastUserMessage" | "sendFeedback" | "clearSession" | "clearMessageQueue" | "updateMessage" | "flushMessageQueue" | "sendMessage" | "setProxyOrigin" | "abortSetupCommand" | "abortValidateCommand" | "toolFullfilment" | "abortToolCall" | "stopEventLoop" | "configureDevOrchestrator" | "tsServerInit" | "tsServerOpenFile" | "tsServerChangeFile" | "tsServerCloseFile" | "tsServerGetCompletions" | "tsServerGetCompletionDetails" | "tsServerGetDefinition" | "tsServerGetTypeDefinition" | "tsServerGetQuickInfo" | "tsServerGetReferences" | "tsServerGetSignatureHelp" | "tsServerRequestDiagnostics" | "tsServerGetRenameLocations" | "tsServerGetNavTree" | "tsServerOrganizeImports" | "tsServerGetInlayHints" | "tsServerGetCodeFixes" | "tsServerGetApplicableRefactors" | "tsServerGetEditsForRefactor" | "tsServerGetImplementation" | "tsServerGetSelectionRange" | "tsServerGetLinkedEditingRange" | "tsServerGetFormatRange" | "manualCommit" | "readFileWithChecksum" | "getSingleFileDiff" | "discardFileChanges" | "revertDiscard" | "fileExists" | "listDir" | "listCustomInstructions" | "deleteFile" | "getDiff")[];
121
121
  export type PublicCodeGenSession = Pick<InstanceType<typeof CodeGenSession>, (typeof PUBLIC_METHODS)[0]>;
122
122
  export {};
@@ -2,14 +2,13 @@
2
2
  * Agent definition parsing utilities
3
3
  * Handles parsing of custom agent definition files
4
4
  */
5
- import type { CodeGenMode, QueueMode, ReasoningEffort, CodeGenPosition } from "#ai-utils";
5
+ import type { QueueMode, ReasoningEffort, CodeGenPosition } from "#ai-utils";
6
6
  export interface SubAgent {
7
7
  name: string;
8
8
  description?: string;
9
9
  systemPrompt?: string | string[];
10
10
  tools?: string[];
11
11
  model?: string;
12
- mode?: CodeGenMode;
13
12
  position?: CodeGenPosition;
14
13
  filePath?: string;
15
14
  includeMemories?: boolean;
@@ -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): "object" | "string" | "number" | "boolean" | "array";
20
+ export declare function getPrimitiveType(t: string): "string" | "object" | "number" | "boolean" | "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;
@@ -95,19 +95,4 @@ export interface CreateLoggerOptions {
95
95
  }
96
96
  export declare function setDebuggingEnabled(enabled: boolean): void;
97
97
  export declare function createLogger(context: string, options?: CreateLoggerOptions): Logger;
98
- /**
99
- * In cloud environments, intercept process.stderr.write so that any plain-text
100
- * write is re-emitted as a structured JSON entry with severity "ERROR". Writes
101
- * that are already structured JSON (produced by the logger) are passed through
102
- * unchanged.
103
- *
104
- * No-op outside cloud environments.
105
- */
106
- export declare function setupCloudStderrCapture(): void;
107
- /**
108
- * Register process-level error handlers that route uncaught exceptions and
109
- * unhandled promise rejections through the structured logger so they appear in
110
- * Cloud Logging with severity ERROR and a proper stack trace.
111
- */
112
- export declare function setupProcessErrorHandlers(context?: string, exitFn?: (code: number) => Promise<void> | void): void;
113
98
  export {};
@@ -19,7 +19,7 @@ export declare function clone<T>(obj: T): T;
19
19
  export declare function shouldSkipFolder(sys: DevToolsSys, skipFolders: Set<string>, fileName: string): boolean;
20
20
  export declare function getPackageManager(): string;
21
21
  export declare function isWindows(): boolean;
22
- export declare function builderNpxPackage(): "builder.io" | "@builder.io/agent" | "\"@builder.io/dev-tools\"";
22
+ export declare function builderNpxPackage(): "@builder.io/agent" | "\"@builder.io/dev-tools\"" | "builder.io";
23
23
  /**
24
24
  * Sanitizes a component name for use in filesystem paths by replacing invalid characters with underscores
25
25
  * @param name The component name to sanitize