@builder.io/dev-tools 1.58.0-dev.202605140732.2747c3a90 → 1.58.0-dev.202605181223.6f1dc53f2
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.
- package/cli/index.cjs +161 -606
- package/cli/index.cjs.map +4 -4
- package/core/index.cjs +1 -1
- package/core/index.mjs +1 -1
- package/node/index.cjs +1 -1
- package/node/index.mjs +1 -1
- package/package.json +1 -1
- package/server/index.cjs +2 -2
- package/server/index.mjs +2 -2
- package/types/cli/indexing.d.ts +5 -0
- package/types/cli/launch/github.d.ts +3 -0
- package/types/cli/launch.d.ts +1 -1
- package/types/cli/snapshot-mode.d.ts +6 -0
- package/types/cli/utils/dev-server-url-parser.d.ts +12 -0
- package/types/cli/utils/replay-action-uploader.d.ts +7 -44
- package/types/core/component-map-builder.d.ts +42 -0
- package/types/server/snapshot-mode.d.ts +24 -0
- package/types/server/source-map-resolver/cache.d.ts +36 -0
- package/types/server/source-map-resolver/indexed-map-resolver.d.ts +10 -0
- package/types/server/source-map-resolver/loader.d.ts +16 -0
- package/types/server/source-map-resolver/security.d.ts +21 -0
- package/types/server/source-map-resolver/types.d.ts +41 -0
- package/types/server/source-map-resolver/validation.d.ts +16 -0
- package/types/server/source-map-resolver.d.ts +25 -0
- package/types/tsconfig.tsbuildinfo +1 -1
- package/types/cli/github-cli.test.d.ts +0 -1
- package/types/cli/utils/macros/macro-player.d.ts +0 -44
- package/types/cli/utils/macros/snapshot-utils.d.ts +0 -57
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/COPYING +0 -3
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/LICENSE-MIT +0 -21
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/README.md +0 -516
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/UNLICENSE +0 -24
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/complete/_rg +0 -665
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/complete/_rg.ps1 +0 -213
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/complete/rg.bash +0 -783
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/complete/rg.fish +0 -175
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/doc/CHANGELOG.md +0 -1689
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/doc/FAQ.md +0 -1046
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/doc/GUIDE.md +0 -1022
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/doc/rg.1 +0 -2178
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/rg.exe +0 -0
- /package/types/cli/{code-tools.test.d.ts → utils/dev-server-url-parser.test.d.ts} +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DevToolsSys } from "../types";
|
|
2
|
+
import type { CLIArgs } from "./index";
|
|
3
|
+
import { type Credentials } from "./credentials";
|
|
4
|
+
export declare const runCodeIndexing: (_sys: DevToolsSys, _args: CLIArgs) => Promise<void>;
|
|
5
|
+
export declare const codeIndexing: (sys: DevToolsSys, credentials: Credentials) => Promise<void>;
|
package/types/cli/launch.d.ts
CHANGED
|
@@ -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" | "
|
|
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")[];
|
|
121
121
|
export type PublicCodeGenSession = Pick<InstanceType<typeof CodeGenSession>, (typeof PUBLIC_METHODS)[0]>;
|
|
122
122
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attach snapshot-mode lifecycle to the dev server.
|
|
3
|
+
* Must be called after the dev server orchestrator is set up.
|
|
4
|
+
* `onHttpOk` should be called when httpServerState becomes "ok-2xx".
|
|
5
|
+
*/
|
|
6
|
+
export declare function attachSnapshotMode(onHttpOk: (cb: () => Promise<void>) => void): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface DevServerUrlInfo {
|
|
2
|
+
url: string;
|
|
3
|
+
port: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Parse dev server output to extract URL and port information
|
|
7
|
+
*
|
|
8
|
+
* @param output - The command output string to parse
|
|
9
|
+
* @param customPatterns - Optional array of custom regex patterns to try first
|
|
10
|
+
* @returns Object with url and port, or null if no valid URL found
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseDevServerOutput(output: string, customPatterns?: string[]): DevServerUrlInfo | null;
|
|
@@ -5,40 +5,18 @@ import { type Credentials } from "../credentials";
|
|
|
5
5
|
* the published `@builder.io/dev-tools` package free of cross-package
|
|
6
6
|
* type imports.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* Only the user-visible content is captured: assistant `text` blocks
|
|
9
|
+
* and `thinking` blocks. Tool calls and chapter markers are
|
|
10
|
+
* deliberately excluded.
|
|
11
11
|
*/
|
|
12
|
-
export interface
|
|
13
|
-
|
|
14
|
-
name?: string;
|
|
15
|
-
text?: string;
|
|
16
|
-
cssPath?: string;
|
|
17
|
-
}
|
|
18
|
-
export type ReplayActionRecord = {
|
|
12
|
+
export interface ReplayActionRecord {
|
|
13
|
+
/** Wall-clock timestamp in ms epoch. */
|
|
19
14
|
ts: number;
|
|
20
|
-
type: "text" | "thinking";
|
|
15
|
+
type: "text" | "thinking" | "checkpoint";
|
|
21
16
|
content?: string;
|
|
22
|
-
} | {
|
|
23
|
-
ts: number;
|
|
24
|
-
type: "checkpoint";
|
|
25
17
|
label?: string;
|
|
26
18
|
imageUrl?: string;
|
|
27
|
-
}
|
|
28
|
-
ts: number;
|
|
29
|
-
type: "tool_call";
|
|
30
|
-
toolName: string;
|
|
31
|
-
input: unknown;
|
|
32
|
-
url: string;
|
|
33
|
-
ok: boolean;
|
|
34
|
-
durationMs?: number;
|
|
35
|
-
/**
|
|
36
|
-
* Per-uid resolution captured at record time, keyed by the uid as
|
|
37
|
-
* it appeared in the original input. Replay re-resolves to a
|
|
38
|
-
* fresh uid using these.
|
|
39
|
-
*/
|
|
40
|
-
targets?: Record<string, ReplayTargetInfo>;
|
|
41
|
-
};
|
|
19
|
+
}
|
|
42
20
|
/**
|
|
43
21
|
* Buffers user-visible agent blocks (`text`, `thinking`) during a
|
|
44
22
|
* `browser-testing` run and POSTs them as JSON to
|
|
@@ -64,21 +42,6 @@ export declare class ReplayActionUploader {
|
|
|
64
42
|
recordText(content: string, ts?: number): void;
|
|
65
43
|
recordReasoning(content: string, ts?: number): void;
|
|
66
44
|
recordCheckpoint(ts?: number, label?: string, imageUrl?: string): void;
|
|
67
|
-
/**
|
|
68
|
-
* Record a UI-affecting Chrome MCP tool call so it can later be
|
|
69
|
-
* replayed as part of a macro. Read-only tools (snapshots,
|
|
70
|
-
* screenshots, console reads) must NOT be recorded — they only
|
|
71
|
-
* matter at record time to resolve element references.
|
|
72
|
-
*/
|
|
73
|
-
recordToolCall(record: {
|
|
74
|
-
ts?: number;
|
|
75
|
-
toolName: string;
|
|
76
|
-
input: unknown;
|
|
77
|
-
url: string;
|
|
78
|
-
ok: boolean;
|
|
79
|
-
durationMs?: number;
|
|
80
|
-
targets?: Record<string, ReplayTargetInfo>;
|
|
81
|
-
}): void;
|
|
82
45
|
flush(): Promise<void>;
|
|
83
46
|
close(): Promise<void>;
|
|
84
47
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component Map Builder
|
|
3
|
+
*
|
|
4
|
+
* Builds a map of component names to their source file locations for the Design tab.
|
|
5
|
+
* This allows the Design tab to work without requiring React's _debugSource or customer plugins.
|
|
6
|
+
*/
|
|
7
|
+
import type { DevToolsSys } from "../types";
|
|
8
|
+
export interface ComponentLocation {
|
|
9
|
+
file: string;
|
|
10
|
+
line: number;
|
|
11
|
+
column: number;
|
|
12
|
+
displayName: string;
|
|
13
|
+
}
|
|
14
|
+
export type ComponentMap = Record<string, ComponentLocation[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Build a map of component names to their source locations
|
|
17
|
+
*/
|
|
18
|
+
export declare function buildComponentMap(sys: DevToolsSys, rootDir?: string): Promise<ComponentMap>;
|
|
19
|
+
/**
|
|
20
|
+
* Cache for component map with file watching
|
|
21
|
+
*/
|
|
22
|
+
export declare class ComponentMapCache {
|
|
23
|
+
private cache;
|
|
24
|
+
private lastBuilt;
|
|
25
|
+
private building;
|
|
26
|
+
private readonly ttl;
|
|
27
|
+
private sys;
|
|
28
|
+
private rootDir;
|
|
29
|
+
constructor(sys: DevToolsSys, rootDir?: string);
|
|
30
|
+
/**
|
|
31
|
+
* Get the component map, building it if necessary
|
|
32
|
+
*/
|
|
33
|
+
get(): Promise<ComponentMap>;
|
|
34
|
+
/**
|
|
35
|
+
* Invalidate the cache
|
|
36
|
+
*/
|
|
37
|
+
invalidate(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Force rebuild of the component map
|
|
40
|
+
*/
|
|
41
|
+
rebuild(): Promise<ComponentMap>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { DevToolsHttpServer } from "../types";
|
|
2
|
+
interface SnapshotModeContext {
|
|
3
|
+
eventId: string;
|
|
4
|
+
projectId: string;
|
|
5
|
+
gitSha: string;
|
|
6
|
+
pvcName: string;
|
|
7
|
+
callbackBase: string;
|
|
8
|
+
callbackToken: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Attach snapshot-mode lifecycle handlers to the dev-tools server.
|
|
12
|
+
* Only called when FUSION_SNAPSHOT_MODE=1.
|
|
13
|
+
*
|
|
14
|
+
* - On dev-server ready: POST /internal/snapshot-completed → exit(0)
|
|
15
|
+
* - On SIGTERM: POST /internal/snapshot-failed (reason=evicted) → exit(143)
|
|
16
|
+
* - On unhandled error: POST /internal/snapshot-failed → exit(1)
|
|
17
|
+
*/
|
|
18
|
+
export declare function attachSnapshotModeHandlers(ctx: SnapshotModeContext, server: DevToolsHttpServer): void;
|
|
19
|
+
/**
|
|
20
|
+
* Initialize snapshot mode from environment variables.
|
|
21
|
+
* Returns context if FUSION_SNAPSHOT_MODE=1, null otherwise.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getSnapshotModeContext(): SnapshotModeContext | null;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LRU cache for source maps and TraceMap instances
|
|
3
|
+
*/
|
|
4
|
+
import { TraceMap } from "@jridgewell/trace-mapping";
|
|
5
|
+
import type { SourceMapV3 } from "./types";
|
|
6
|
+
interface CachedSourceMap {
|
|
7
|
+
json: SourceMapV3;
|
|
8
|
+
/** TraceMap instances keyed by section index (-1 for non-indexed maps) */
|
|
9
|
+
tracers: Map<number, TraceMap>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Get or create cache key from bundled path and source mapping URL
|
|
13
|
+
*/
|
|
14
|
+
export declare function getCacheKey(bundledPath: string, sourceMappingURL: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Get cached source map data
|
|
17
|
+
* Returns undefined if not cached, null if cached as failed
|
|
18
|
+
*/
|
|
19
|
+
export declare function getCached(key: string): CachedSourceMap | null | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Cache a successfully loaded source map
|
|
22
|
+
*/
|
|
23
|
+
export declare function setCached(key: string, json: SourceMapV3): CachedSourceMap;
|
|
24
|
+
/**
|
|
25
|
+
* Cache a failed load attempt (negative caching)
|
|
26
|
+
*/
|
|
27
|
+
export declare function setCachedFailure(key: string): void;
|
|
28
|
+
/**
|
|
29
|
+
* Get or create a TraceMap for a specific section (or -1 for non-indexed)
|
|
30
|
+
*/
|
|
31
|
+
export declare function getOrCreateTracer(entry: CachedSourceMap, sectionIndex: number, mapJson: SourceMapV3): TraceMap;
|
|
32
|
+
/**
|
|
33
|
+
* Clear all cached data
|
|
34
|
+
*/
|
|
35
|
+
export declare function clearCache(): void;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for handling indexed source maps (section maps)
|
|
3
|
+
*/
|
|
4
|
+
import type { SourceMapSection, SectionMatch } from "./types";
|
|
5
|
+
/**
|
|
6
|
+
* Find the section containing a given position in an indexed source map.
|
|
7
|
+
* Sections are ordered by offset, so we find the last one that starts
|
|
8
|
+
* at or before the target position.
|
|
9
|
+
*/
|
|
10
|
+
export declare function findMatchingSection(sections: SourceMapSection[], line: number, column: number): SectionMatch | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File and source map loading utilities
|
|
3
|
+
*/
|
|
4
|
+
import type { ResolveContext } from "./types";
|
|
5
|
+
/**
|
|
6
|
+
* Extract sourceMappingURL from JS file content
|
|
7
|
+
*/
|
|
8
|
+
export declare function extractSourceMappingURL(content: string): string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Load JS file content from dev server or filesystem
|
|
11
|
+
*/
|
|
12
|
+
export declare function loadJSContent(ctx: ResolveContext, bundledPath: string, isServerChunk: boolean): Promise<string | null>;
|
|
13
|
+
/**
|
|
14
|
+
* Load source map content from various sources
|
|
15
|
+
*/
|
|
16
|
+
export declare function loadSourceMapContent(ctx: ResolveContext, bundledPath: string, sourceMappingURL: string): Promise<string | null>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security utilities for path validation and sanitization
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Check if a resolved path is safely within the project root.
|
|
6
|
+
* Prevents sibling directory access (e.g., /project-sensitive when root is /project)
|
|
7
|
+
*/
|
|
8
|
+
export declare function isPathWithinRoot(filePath: string, rootPath: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Sanitize and validate a bundled path input.
|
|
11
|
+
* Returns decoded path or null if invalid.
|
|
12
|
+
*/
|
|
13
|
+
export declare function sanitizeBundledPath(bundledPath: string): string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Check if a chunk filename is definitely internal (not user code)
|
|
16
|
+
*/
|
|
17
|
+
export declare function isDefinitelyInternalChunk(filename: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Check if a resolved source path is framework code
|
|
20
|
+
*/
|
|
21
|
+
export declare function isFrameworkCode(sourcePath: string): boolean;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for source map resolution
|
|
3
|
+
*/
|
|
4
|
+
export interface OriginalPosition {
|
|
5
|
+
source: string;
|
|
6
|
+
line: number;
|
|
7
|
+
column: number;
|
|
8
|
+
name?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Source Map v3 JSON structure
|
|
12
|
+
* Based on: https://sourcemaps.info/spec.html
|
|
13
|
+
*/
|
|
14
|
+
export interface SourceMapV3 {
|
|
15
|
+
version: number;
|
|
16
|
+
file?: string;
|
|
17
|
+
sourceRoot?: string;
|
|
18
|
+
sources?: string[];
|
|
19
|
+
sourcesContent?: (string | null)[];
|
|
20
|
+
names?: string[];
|
|
21
|
+
mappings?: string;
|
|
22
|
+
sections?: SourceMapSection[];
|
|
23
|
+
}
|
|
24
|
+
export interface SourceMapSection {
|
|
25
|
+
offset: {
|
|
26
|
+
line: number;
|
|
27
|
+
column: number;
|
|
28
|
+
};
|
|
29
|
+
map?: SourceMapV3;
|
|
30
|
+
url?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ResolveContext {
|
|
33
|
+
projectRoot: string;
|
|
34
|
+
devServerUrl: string;
|
|
35
|
+
}
|
|
36
|
+
export interface SectionMatch {
|
|
37
|
+
section: SourceMapSection;
|
|
38
|
+
index: number;
|
|
39
|
+
relativeLine: number;
|
|
40
|
+
relativeColumn: number;
|
|
41
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source map validation utilities
|
|
3
|
+
*/
|
|
4
|
+
import type { SourceMapV3 } from "./types";
|
|
5
|
+
export interface ValidationResult {
|
|
6
|
+
valid: boolean;
|
|
7
|
+
error?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Validate a source map v3 structure
|
|
11
|
+
*/
|
|
12
|
+
export declare function validateSourceMap(json: unknown): ValidationResult;
|
|
13
|
+
/**
|
|
14
|
+
* Clean up source map structure before processing
|
|
15
|
+
*/
|
|
16
|
+
export declare function prepareSourceMap(json: SourceMapV3): SourceMapV3;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side source map resolution using @jridgewell/trace-mapping
|
|
3
|
+
* Fetches bundled files from dev server and resolves to original source locations
|
|
4
|
+
*/
|
|
5
|
+
import type { OriginalPosition } from "./source-map-resolver/types";
|
|
6
|
+
import { clearCache } from "./source-map-resolver/cache";
|
|
7
|
+
export type { OriginalPosition };
|
|
8
|
+
export { clearCache as clearSourceMapCache };
|
|
9
|
+
/**
|
|
10
|
+
* Resolve a bundled file location to its original source location
|
|
11
|
+
* @param projectRoot Root directory of the project (for file fallback)
|
|
12
|
+
* @param devServerUrl Base URL of the dev server (e.g., http://localhost:3000)
|
|
13
|
+
* @param bundledPath Path to the bundled file (e.g., /_next/static/chunks/app/page.js)
|
|
14
|
+
* @param line Line number in bundled file (1-indexed)
|
|
15
|
+
* @param column Column number in bundled file (0-indexed)
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveSourceLocation(projectRoot: string, devServerUrl: string, bundledPath: string, line: number, column: number): Promise<OriginalPosition | null>;
|
|
18
|
+
/**
|
|
19
|
+
* Batch resolve multiple source locations with deduplication
|
|
20
|
+
*/
|
|
21
|
+
export declare function batchResolveSourceLocations(projectRoot: string, devServerUrl: string, locations: Array<{
|
|
22
|
+
bundledPath: string;
|
|
23
|
+
line: number;
|
|
24
|
+
column: number;
|
|
25
|
+
}>): Promise<Array<OriginalPosition | null>>;
|