@builder.io/dev-tools 1.24.0-dev.202602060823.cf6b0e472 → 1.24.0-dev.202602060949.9613162d0
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 +91 -305
- package/cli/index.cjs.map +2 -2
- 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 +3 -3
- package/server/index.cjs +2 -2
- package/server/index.mjs +2 -2
- package/types/_tests_/utils.d.ts +35 -48
- package/types/cli/abort-signal-any.d.ts +1 -3
- package/types/cli/auth/auth-utils.d.ts +1 -3
- package/types/cli/auth/auth.d.ts +1 -5
- package/types/cli/backup.d.ts +60 -114
- package/types/cli/builder-add/interface.d.ts +4 -21
- package/types/cli/code-file-utils.d.ts +8 -11
- package/types/cli/code-tools.test.d.ts +1 -0
- package/types/cli/code.d.ts +3 -13
- package/types/cli/codegen.d.ts +0 -8
- package/types/cli/credentials.d.ts +45 -61
- package/types/cli/detectors/nextjs.d.ts +1 -4
- package/types/cli/detectors/svelte.d.ts +1 -4
- package/types/cli/detectors/vue.d.ts +1 -4
- package/types/cli/download.d.ts +4 -9
- package/types/cli/dsi-mcp.d.ts +1 -4
- package/types/cli/fetch.d.ts +2 -7
- package/types/cli/figma-publish.d.ts +17 -34
- package/types/cli/figma-utils.d.ts +21 -51
- package/types/cli/figma.d.ts +2 -9
- package/types/cli/generate.d.ts +11 -14
- package/types/cli/github-cli.test.d.ts +1 -0
- package/types/cli/incremental-tsc.d.ts +7 -19
- package/types/cli/index.d.ts +154 -154
- package/types/cli/launch/InitStateMachine.d.ts +89 -156
- package/types/cli/launch/config.d.ts +3 -13
- package/types/cli/launch/dry-run-backup.d.ts +7 -14
- package/types/cli/launch/errors.d.ts +2 -7
- package/types/cli/launch/grafana.d.ts +1 -5
- package/types/cli/launch/helpers.d.ts +10 -19
- package/types/cli/launch/machine-health.d.ts +3 -8
- package/types/cli/launch/proxy.d.ts +4 -11
- package/types/cli/launch/server.d.ts +12 -19
- package/types/cli/launch/vscode-tunnel-manager.d.ts +68 -77
- package/types/cli/launch.d.ts +106 -109
- package/types/cli/prettier.d.ts +2 -9
- package/types/cli/repo-connect/env-collector.d.ts +11 -16
- package/types/cli/repo-connect/file-collector.d.ts +15 -22
- package/types/cli/repo-connect/git-detector.d.ts +11 -13
- package/types/cli/repo-connect/install-runner.d.ts +5 -8
- package/types/cli/repo-connect/package-detector.d.ts +8 -12
- package/types/cli/repo-connect/repo-connect.d.ts +1 -4
- package/types/cli/repo-indexing/component-discovery.d.ts +17 -30
- package/types/cli/repo-indexing/icons.d.ts +24 -36
- package/types/cli/repo-indexing/installation.d.ts +14 -22
- package/types/cli/repo-indexing/repo-indexing-utils.d.ts +79 -138
- package/types/cli/repo-indexing/repo-indexing.d.ts +17 -37
- package/types/cli/repo-indexing/repo-indexing.mock.d.ts +3 -3
- package/types/cli/repo-indexing/tokens.d.ts +25 -44
- package/types/cli/repo-indexing/types.d.ts +0 -2
- package/types/cli/repo-metrics-utils.d.ts +5 -13
- package/types/cli/repo-metrics.d.ts +1 -4
- package/types/cli/report/figma-report.d.ts +36 -63
- package/types/cli/server-ws.d.ts +32 -40
- package/types/cli/spinner.d.ts +4 -4
- package/types/cli/track.d.ts +1 -4
- package/types/cli/utils/agent-discovery.d.ts +5 -10
- package/types/cli/utils/codegen-utils.d.ts +0 -9
- package/types/cli/utils/component-group-mdx-prompt.d.ts +1 -2
- package/types/cli/utils/discovery-test-utils.d.ts +1 -3
- package/types/cli/utils/env-capture.d.ts +15 -21
- package/types/cli/utils/env-substitution.d.ts +1 -4
- package/types/cli/utils/feature-flags.d.ts +1 -3
- package/types/cli/utils/file-overrides-manager.d.ts +23 -39
- package/types/cli/utils/git.d.ts +16 -28
- package/types/cli/utils/hosts-file-manager.d.ts +4 -7
- package/types/cli/utils/lock-file.d.ts +7 -10
- package/types/cli/utils/parseGitDiff.d.ts +1 -4
- package/types/cli/utils/process-tracker.d.ts +51 -85
- package/types/cli/utils/repo-indexing-agent-prompt.d.ts +1 -2
- package/types/cli/utils/rules-discovery.d.ts +5 -10
- package/types/cli/utils/rules-parser.d.ts +1 -5
- package/types/cli/utils/terminal-buffer.d.ts +23 -23
- package/types/cli/utils/workspace-path-resolver.d.ts +16 -23
- package/types/cli/utils/yaml-frontmatter.d.ts +6 -10
- package/types/client/client-api.d.ts +10 -42
- package/types/client/edit-button/document-listeners.d.ts +1 -3
- package/types/client/edit-button/index.d.ts +6 -6
- package/types/client/menu/index.d.ts +3 -3
- package/types/client/menu/pages/component-detail.d.ts +2 -8
- package/types/client/menu/pages/component-input.d.ts +1 -5
- package/types/client/menu/pages/component-list.d.ts +1 -4
- package/types/client/menu/toggle/menu-toggle.d.ts +1 -4
- package/types/client/setup-ui/overview.d.ts +2 -2
- package/types/client/tracking.d.ts +11 -11
- package/types/client/utils.d.ts +3 -5
- package/types/common/ast/app-dependencies.d.ts +2 -8
- package/types/common/ast/component-info.d.ts +6 -26
- package/types/common/ast/component-input-types.d.ts +9 -28
- package/types/common/ast/component-registry.d.ts +8 -23
- package/types/common/ast/convert-values.d.ts +8 -40
- package/types/common/ast/ensure-array-statement.d.ts +3 -7
- package/types/common/ast/ensure-comments.d.ts +1 -5
- package/types/common/ast/ensure-imports.d.ts +5 -10
- package/types/common/ast/exported-statements.d.ts +4 -8
- package/types/common/ast/imported-statements.d.ts +1 -5
- package/types/common/ast/normalize-statements.d.ts +3 -12
- package/types/common/ast/remove-unused-imports.d.ts +1 -4
- package/types/common/ast/transform.d.ts +3 -13
- package/types/common/ast/utils.d.ts +19 -42
- package/types/common/builder/builder-api.d.ts +23 -32
- package/types/common/builder/builder-sdks.d.ts +8 -10
- package/types/common/builder/content-generation.d.ts +7 -10
- package/types/common/builder/content-ids.d.ts +1 -2
- package/types/common/cache.d.ts +1 -4
- package/types/common/constants.d.ts +1 -2
- package/types/common/dotenv.d.ts +5 -24
- package/types/common/errors.d.ts +22 -50
- package/types/common/fs.d.ts +4 -17
- package/types/common/interactive-select-files.d.ts +2 -16
- package/types/common/mem-sys.d.ts +5 -7
- package/types/common/node-request.d.ts +4 -4
- package/types/common/path.d.ts +3 -1
- package/types/common/test-utils.d.ts +7 -21
- package/types/common/typescript.d.ts +7 -26
- package/types/common/utils.d.ts +8 -36
- package/types/core/adapters/angular/angular-api-key.d.ts +6 -29
- package/types/core/adapters/angular/angular-app-module-imports.d.ts +2 -12
- package/types/core/adapters/angular/angular-app-routes-update.d.ts +1 -6
- package/types/core/adapters/angular/angular-components.d.ts +12 -40
- package/types/core/adapters/angular/angular-ensure-builder-setup.d.ts +3 -9
- package/types/core/adapters/angular/angular-ensure-config-plugin.d.ts +4 -16
- package/types/core/adapters/angular/angular-fix-tsconfig.d.ts +1 -3
- package/types/core/adapters/angular/angular-registry-parse.d.ts +10 -22
- package/types/core/adapters/angular/angular-registry.d.ts +2 -15
- package/types/core/adapters/angular/angular-test-utils.d.ts +4 -8
- package/types/core/adapters/angular/index.d.ts +12 -20
- package/types/core/adapters/angular/types.d.ts +5 -5
- package/types/core/adapters/next/index.d.ts +18 -26
- package/types/core/adapters/next/next-api-key.d.ts +1 -4
- package/types/core/adapters/next/next-component-info.d.ts +2 -9
- package/types/core/adapters/next/next-components.d.ts +1 -4
- package/types/core/adapters/next/next-ensure-builder-setup.d.ts +2 -6
- package/types/core/adapters/next/next-ensure-config-plugin.d.ts +1 -5
- package/types/core/adapters/next/next-registry-parse.d.ts +8 -21
- package/types/core/adapters/next/next-registry.d.ts +2 -15
- package/types/core/adapters/next/next-test-utils.d.ts +11 -21
- package/types/core/adapters/qwik-city/index.d.ts +6 -14
- package/types/core/adapters/qwik-city/qwik-api-key.d.ts +1 -4
- package/types/core/adapters/qwik-city/qwik-component-source-inputs.d.ts +1 -4
- package/types/core/adapters/qwik-city/qwik-components.d.ts +8 -23
- package/types/core/adapters/qwik-city/qwik-ensure-builder-setup.d.ts +2 -6
- package/types/core/adapters/qwik-city/qwik-ensure-config-plugin.d.ts +1 -5
- package/types/core/adapters/qwik-city/qwik-registry-parse.d.ts +10 -22
- package/types/core/adapters/qwik-city/qwik-registry.d.ts +2 -15
- package/types/core/adapters/qwik-city/qwik-test-utils.d.ts +4 -8
- package/types/core/adapters/qwik-city/qwik-ts-program.d.ts +1 -3
- package/types/core/adapters/react/index.d.ts +11 -19
- package/types/core/adapters/react/react-api-key.d.ts +1 -4
- package/types/core/adapters/react/react-builder-sdk-setup.d.ts +1 -3
- package/types/core/adapters/react/react-component-info.d.ts +2 -9
- package/types/core/adapters/react/react-components.d.ts +11 -37
- package/types/core/adapters/react/react-ensure-builder-setup.d.ts +2 -6
- package/types/core/adapters/react/react-registry-parse.d.ts +8 -21
- package/types/core/adapters/react/react-registry.d.ts +2 -15
- package/types/core/adapters/react/react-test-utils.d.ts +5 -11
- package/types/core/adapters/react/react-ts-program.d.ts +1 -3
- package/types/core/adapters/remix/index.d.ts +11 -19
- package/types/core/adapters/remix/remix-api-key.d.ts +1 -4
- package/types/core/adapters/remix/remix-components.d.ts +1 -4
- package/types/core/adapters/remix/remix-ensure-builder-setup.d.ts +3 -9
- package/types/core/adapters/remix/remix-ensure-config-plugin.d.ts +1 -5
- package/types/core/adapters/remix/remix-registry-parse.d.ts +10 -22
- package/types/core/adapters/remix/remix-registry.d.ts +2 -15
- package/types/core/adapters/remix/remix-test-utils.d.ts +5 -11
- package/types/core/adapters/vite/vite-ensure-config-plugin.d.ts +2 -12
- package/types/core/adapters/vue/index.d.ts +12 -20
- package/types/core/adapters/vue/vue-api-key.d.ts +1 -4
- package/types/core/adapters/vue/vue-components.d.ts +2 -10
- package/types/core/adapters/vue/vue-ensure-builder-setup.d.ts +3 -7
- package/types/core/adapters/vue/vue-registry-parse.d.ts +9 -19
- package/types/core/adapters/vue/vue-registry.d.ts +3 -6
- package/types/core/adapters/webpack/webpack-config-helpers.d.ts +3 -8
- package/types/core/adapters/webpack/webpack-ensure-config-plugin.d.ts +1 -5
- package/types/core/create-dev-tools.d.ts +1 -4
- package/types/core/detect-frameworks.d.ts +2 -7
- package/types/core/ensure-config-plugin.d.ts +2 -6
- package/types/core/find-dependencies.d.ts +3 -6
- package/types/core/import-export-registry.d.ts +2 -9
- package/types/core/index.d.ts +3 -18
- package/types/figma/index.d.ts +64 -95
- package/types/node/node-sys.d.ts +6 -13
- package/types/remix/index.d.ts +3 -5
- package/types/server/auth.d.ts +1 -4
- package/types/server/builder-connect.d.ts +6 -21
- package/types/server/client-script.d.ts +2 -6
- package/types/server/create-dev-tools-server.d.ts +1 -3
- package/types/server/dev-tools-api.d.ts +1 -4
- package/types/server/dev-tools-http-server.d.ts +1 -3
- package/types/server/index.d.ts +1 -28
- package/types/server/request-handler.d.ts +1 -6
- package/types/tsconfig.tsbuildinfo +1 -1
- package/types/types/codegen-server.d.ts +1 -1
- package/types/types/connection-tracker.d.ts +34 -34
- package/types/types/proxy-middleware.d.ts +15 -25
- package/types/types/websocket-types.d.ts +7 -9
- package/types/types.d.ts +358 -387
- package/types/vite/main.d.ts +1 -1
- package/types/webpack/main.d.ts +5 -5
- package/vendors/darwin-arm64/complete/rg.bash +783 -0
- package/vendors/darwin-arm64/complete/rg.fish +175 -0
- package/vendors/darwin-arm64/doc/rg.1 +2178 -0
- package/vendors/darwin-arm64/rg +0 -0
- package/vendors/darwin-x64/complete/rg.bash +783 -0
- package/vendors/darwin-x64/complete/rg.fish +175 -0
- package/vendors/darwin-x64/doc/rg.1 +2178 -0
- package/vendors/darwin-x64/rg +0 -0
- package/vendors/linux-arm64/complete/rg.bash +783 -0
- package/vendors/linux-arm64/complete/rg.fish +175 -0
- package/vendors/linux-arm64/doc/rg.1 +2178 -0
- package/vendors/linux-arm64/rg +0 -0
- package/vendors/linux-x64/complete/rg.bash +783 -0
- package/vendors/linux-x64/complete/rg.fish +175 -0
- package/vendors/linux-x64/doc/rg.1 +2178 -0
- package/vendors/linux-x64/rg +0 -0
- package/vendors/win32-x64/rg.exe +0 -0
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/COPYING +3 -0
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/LICENSE-MIT +21 -0
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/README.md +516 -0
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/UNLICENSE +24 -0
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/complete/_rg +665 -0
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/complete/_rg.ps1 +213 -0
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/complete/rg.bash +783 -0
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/complete/rg.fish +175 -0
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/doc/CHANGELOG.md +1689 -0
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/doc/FAQ.md +1046 -0
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/doc/GUIDE.md +1022 -0
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/doc/rg.1 +2178 -0
- package/vendors/win32-x64/ripgrep-14.1.0-x86_64-pc-windows-msvc/rg.exe +0 -0
|
@@ -1,166 +1,99 @@
|
|
|
1
1
|
import type { DevToolsSys } from "@builder.io/dev-tools/core";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type InitState,
|
|
6
|
-
type InitStateStep,
|
|
7
|
-
type InitStatusLog,
|
|
8
|
-
} from "$/ai-utils";
|
|
9
|
-
type ValidatedWorkspaceFolder = WorkspaceFolder &
|
|
10
|
-
Required<Pick<WorkspaceFolder, "name" | "path">>;
|
|
11
|
-
type WorkspaceFolderWithRepoInfo = ValidatedWorkspaceFolder &
|
|
12
|
-
Required<Pick<WorkspaceFolder, "repoName" | "repoUrl">>;
|
|
2
|
+
import { type FusionConfig, type WorkspaceFolder, type InitState, type InitStateStep, type InitStatusLog } from "$/ai-utils";
|
|
3
|
+
type ValidatedWorkspaceFolder = WorkspaceFolder & Required<Pick<WorkspaceFolder, "name" | "path">>;
|
|
4
|
+
type WorkspaceFolderWithRepoInfo = ValidatedWorkspaceFolder & Required<Pick<WorkspaceFolder, "repoName" | "repoUrl">>;
|
|
13
5
|
import type { Credentials } from "../credentials";
|
|
14
6
|
import { type GitBackupDownloadResult } from "../backup";
|
|
15
7
|
export interface InitConfig {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
fusionConfig: FusionConfig;
|
|
9
|
+
credentials: Credentials;
|
|
10
|
+
sys: DevToolsSys;
|
|
11
|
+
debug?: boolean;
|
|
12
|
+
sentryTags?: Record<string, string>;
|
|
21
13
|
}
|
|
22
14
|
export interface InitStatus {
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
message: string;
|
|
16
|
+
error?: string;
|
|
25
17
|
}
|
|
26
18
|
export declare class InitStateMachine {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
volumePath: string,
|
|
107
|
-
repositories: ValidatedWorkspaceFolder[],
|
|
108
|
-
): Promise<void>;
|
|
109
|
-
step4CollectRepoInfo(
|
|
110
|
-
config: InitConfig,
|
|
111
|
-
volumePath: string,
|
|
112
|
-
repositories: ValidatedWorkspaceFolder[],
|
|
113
|
-
): Promise<void>;
|
|
114
|
-
private isGitConfigured;
|
|
115
|
-
private getGitRemoteUrl;
|
|
116
|
-
private sanitizeGitRemoteUrl;
|
|
117
|
-
/**
|
|
118
|
-
* Check if the repository URL is from a standard git hosting provider
|
|
119
|
-
*/
|
|
120
|
-
private isStandardGitHost;
|
|
121
|
-
/**
|
|
122
|
-
* Check if the repository host is reachable via network
|
|
123
|
-
* Performs DNS resolution and TCP connection check
|
|
124
|
-
*/
|
|
125
|
-
private checkHostConnectivity;
|
|
126
|
-
private checkConnectivityDirect;
|
|
127
|
-
private checkConnectivityViaProxy;
|
|
128
|
-
/**
|
|
129
|
-
* Ensures the parent directory of the given path exists.
|
|
130
|
-
* Handles nested repo.path like "subdir/myproject".
|
|
131
|
-
*/
|
|
132
|
-
private ensureParentDirExists;
|
|
133
|
-
private cleanupLockFiles;
|
|
134
|
-
validateGitRepo(repoPath: string): Promise<void>;
|
|
135
|
-
/**
|
|
136
|
-
* If a backup is available, perform a backup recovery (and throw if it fails and cannot be recovered from).
|
|
137
|
-
* If no backup is available, do nothing.
|
|
138
|
-
*/
|
|
139
|
-
private restoreFromPartialBackup;
|
|
140
|
-
private initializeGitRepo;
|
|
141
|
-
private refreshRepoConfig;
|
|
142
|
-
runInitializationCommand({
|
|
143
|
-
repo,
|
|
144
|
-
tempCloningDir,
|
|
145
|
-
repoPath,
|
|
146
|
-
initCommand,
|
|
147
|
-
}: {
|
|
148
|
-
repo: ValidatedWorkspaceFolder;
|
|
149
|
-
tempCloningDir: string;
|
|
150
|
-
repoPath: string;
|
|
151
|
-
initCommand: string;
|
|
152
|
-
}): Promise<{
|
|
153
|
-
outcome: boolean;
|
|
154
|
-
error?: Error;
|
|
155
|
-
}>;
|
|
156
|
-
cloneRepository({
|
|
157
|
-
repo,
|
|
158
|
-
repoPath,
|
|
159
|
-
backupResult,
|
|
160
|
-
}: {
|
|
161
|
-
repo: WorkspaceFolderWithRepoInfo;
|
|
162
|
-
repoPath: string;
|
|
163
|
-
backupResult: GitBackupDownloadResult | undefined;
|
|
164
|
-
}): Promise<boolean>;
|
|
19
|
+
logIdCounter: number;
|
|
20
|
+
initStatusLogs: InitStatusLog[];
|
|
21
|
+
sys: DevToolsSys;
|
|
22
|
+
config: InitConfig;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated use addInitLog instead. Do not use this directly.
|
|
25
|
+
*/
|
|
26
|
+
debug: boolean;
|
|
27
|
+
initState: InitState;
|
|
28
|
+
constructor(config: InitConfig);
|
|
29
|
+
checkout(branchName: string, ref: string, repoPath: string): Promise<boolean>;
|
|
30
|
+
execAsync(exec: string, args: string[], cwd?: string, retry?: number): Promise<string>;
|
|
31
|
+
git(args: string[], cwd: string, retry?: number, timeout?: number): Promise<string>;
|
|
32
|
+
performBackup({ sys, credentials, fusionConfig, volumePath, repositories, isConnectedToProvider, forcedFullBackup, }: {
|
|
33
|
+
sys: DevToolsSys;
|
|
34
|
+
credentials: Credentials;
|
|
35
|
+
fusionConfig: FusionConfig;
|
|
36
|
+
volumePath: string;
|
|
37
|
+
repositories: ValidatedWorkspaceFolder[];
|
|
38
|
+
isConnectedToProvider: boolean;
|
|
39
|
+
forcedFullBackup: boolean;
|
|
40
|
+
}): Promise<void>;
|
|
41
|
+
performRegularBackup(args: Omit<Parameters<typeof this.performBackup>[0], "isConnectedToProvider" | "forcedFullBackup">): Promise<void>;
|
|
42
|
+
performOfflineBackup(args: Omit<Parameters<typeof this.performBackup>[0], "isConnectedToProvider" | "forcedFullBackup">): Promise<void>;
|
|
43
|
+
performForcedFullBackup(args: Omit<Parameters<typeof this.performBackup>[0], "isConnectedToProvider" | "forcedFullBackup">): Promise<void>;
|
|
44
|
+
init(): Promise<boolean>;
|
|
45
|
+
addInitLog(type: "status" | "log" | "error" | "complete", message: string, options?: {
|
|
46
|
+
step?: InitStateStep;
|
|
47
|
+
error?: string;
|
|
48
|
+
success?: boolean;
|
|
49
|
+
}): void;
|
|
50
|
+
clearInitLogs(): void;
|
|
51
|
+
hasFilesButNoGit(repoPath: string): Promise<boolean>;
|
|
52
|
+
step1CheckDirectories(volumePath: string, repositories: ValidatedWorkspaceFolder[]): Promise<void>;
|
|
53
|
+
step2ConfigureGitRepositories(volumePath: string, repositories: ValidatedWorkspaceFolder[]): Promise<void>;
|
|
54
|
+
step3ConfigureGitUser(volumePath: string, repositories: ValidatedWorkspaceFolder[]): Promise<void>;
|
|
55
|
+
step4CollectRepoInfo(config: InitConfig, volumePath: string, repositories: ValidatedWorkspaceFolder[]): Promise<void>;
|
|
56
|
+
private isGitConfigured;
|
|
57
|
+
private getGitRemoteUrl;
|
|
58
|
+
private sanitizeGitRemoteUrl;
|
|
59
|
+
/**
|
|
60
|
+
* Check if the repository URL is from a standard git hosting provider
|
|
61
|
+
*/
|
|
62
|
+
private isStandardGitHost;
|
|
63
|
+
/**
|
|
64
|
+
* Check if the repository host is reachable via network
|
|
65
|
+
* Performs DNS resolution and TCP connection check
|
|
66
|
+
*/
|
|
67
|
+
private checkHostConnectivity;
|
|
68
|
+
private checkConnectivityDirect;
|
|
69
|
+
private checkConnectivityViaProxy;
|
|
70
|
+
/**
|
|
71
|
+
* Ensures the parent directory of the given path exists.
|
|
72
|
+
* Handles nested repo.path like "subdir/myproject".
|
|
73
|
+
*/
|
|
74
|
+
private ensureParentDirExists;
|
|
75
|
+
private cleanupLockFiles;
|
|
76
|
+
validateGitRepo(repoPath: string): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* If a backup is available, perform a backup recovery (and throw if it fails and cannot be recovered from).
|
|
79
|
+
* If no backup is available, do nothing.
|
|
80
|
+
*/
|
|
81
|
+
private restoreFromPartialBackup;
|
|
82
|
+
private initializeGitRepo;
|
|
83
|
+
private refreshRepoConfig;
|
|
84
|
+
runInitializationCommand({ repo, tempCloningDir, repoPath, initCommand, }: {
|
|
85
|
+
repo: ValidatedWorkspaceFolder;
|
|
86
|
+
tempCloningDir: string;
|
|
87
|
+
repoPath: string;
|
|
88
|
+
initCommand: string;
|
|
89
|
+
}): Promise<{
|
|
90
|
+
outcome: boolean;
|
|
91
|
+
error?: Error;
|
|
92
|
+
}>;
|
|
93
|
+
cloneRepository({ repo, repoPath, backupResult, }: {
|
|
94
|
+
repo: WorkspaceFolderWithRepoInfo;
|
|
95
|
+
repoPath: string;
|
|
96
|
+
backupResult: GitBackupDownloadResult | undefined;
|
|
97
|
+
}): Promise<boolean>;
|
|
165
98
|
}
|
|
166
99
|
export {};
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { type FusionConfig } from "$/ai-utils";
|
|
2
2
|
import type { LaunchArgs } from "../launch";
|
|
3
3
|
import type { DevToolsSys } from "../../types";
|
|
4
|
-
export declare function getFusionConfig(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
): Promise<FusionConfig>;
|
|
8
|
-
export declare function saveFusionConfig(
|
|
9
|
-
sys: DevToolsSys,
|
|
10
|
-
fusionConfig: FusionConfig,
|
|
11
|
-
args: LaunchArgs,
|
|
12
|
-
): Promise<void>;
|
|
13
|
-
export declare function trackConfigData(
|
|
14
|
-
sys: DevToolsSys,
|
|
15
|
-
fusionConfig: FusionConfig,
|
|
16
|
-
): void;
|
|
4
|
+
export declare function getFusionConfig(sys: DevToolsSys, args: LaunchArgs): Promise<FusionConfig>;
|
|
5
|
+
export declare function saveFusionConfig(sys: DevToolsSys, fusionConfig: FusionConfig, args: LaunchArgs): Promise<void>;
|
|
6
|
+
export declare function trackConfigData(sys: DevToolsSys, fusionConfig: FusionConfig): void;
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import { type InitConfig } from "./InitStateMachine";
|
|
2
2
|
import type { InitState } from "$/ai-utils";
|
|
3
|
-
export declare const attemptDryRunBackupGit: (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
| {
|
|
12
|
-
success: boolean;
|
|
13
|
-
error?: undefined;
|
|
14
|
-
}
|
|
15
|
-
| null
|
|
16
|
-
>;
|
|
3
|
+
export declare const attemptDryRunBackupGit: (initConfig: InitConfig, realInitState: InitState) => Promise<{
|
|
4
|
+
success: boolean;
|
|
5
|
+
error: string;
|
|
6
|
+
} | {
|
|
7
|
+
success: boolean;
|
|
8
|
+
error?: undefined;
|
|
9
|
+
} | null>;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
export declare const isGitHubAuthError: (errorMessage: string) => boolean;
|
|
2
|
-
export declare const getGitHubAuthErrorMessage: (
|
|
3
|
-
|
|
4
|
-
hasGhToken: boolean,
|
|
5
|
-
) => string;
|
|
6
|
-
export declare const getUserMessageForNpmInstallErrors: (
|
|
7
|
-
errorOutput: string,
|
|
8
|
-
) => string;
|
|
2
|
+
export declare const getGitHubAuthErrorMessage: (repoName: string, hasGhToken: boolean) => string;
|
|
3
|
+
export declare const getUserMessageForNpmInstallErrors: (errorOutput: string) => string;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import type { FusionMetrics } from "$/ai-utils";
|
|
2
2
|
import type { Credentials } from "../credentials";
|
|
3
3
|
import type { DevToolsSys } from "../../types";
|
|
4
|
-
export declare function pushMetrics(
|
|
5
|
-
sys: DevToolsSys,
|
|
6
|
-
credentials: Credentials,
|
|
7
|
-
body: FusionMetrics,
|
|
8
|
-
): Promise<void>;
|
|
4
|
+
export declare function pushMetrics(sys: DevToolsSys, credentials: Credentials, body: FusionMetrics): Promise<void>;
|
|
@@ -3,26 +3,17 @@ import type { DevToolsSys } from "../../types";
|
|
|
3
3
|
/**
|
|
4
4
|
* Scrub sensitive data from fusion config before sending to webapp or logging
|
|
5
5
|
*/
|
|
6
|
-
export declare function scrubFusionConfig(
|
|
7
|
-
config: FusionConfig | undefined,
|
|
8
|
-
): FusionConfig | undefined;
|
|
6
|
+
export declare function scrubFusionConfig(config: FusionConfig | undefined): FusionConfig | undefined;
|
|
9
7
|
export declare const isInRemoteContainer: () => boolean;
|
|
10
8
|
export declare const getVolumePath: (fusionConfig: FusionConfig) => string;
|
|
11
|
-
export declare function computeAIBranchName(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
sys,
|
|
17
|
-
gitWorkingDirectory,
|
|
18
|
-
strict,
|
|
19
|
-
}: {
|
|
20
|
-
sys: DevToolsSys;
|
|
21
|
-
gitWorkingDirectory: string;
|
|
22
|
-
strict: boolean;
|
|
9
|
+
export declare function computeAIBranchName(featureBranch: string, sessionId: string): string;
|
|
10
|
+
export declare const getAndParseGitRepoInfo: ({ sys, gitWorkingDirectory, strict, }: {
|
|
11
|
+
sys: DevToolsSys;
|
|
12
|
+
gitWorkingDirectory: string;
|
|
13
|
+
strict: boolean;
|
|
23
14
|
}) => Promise<{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
currentBranch: string;
|
|
16
|
+
featureBranch: string;
|
|
17
|
+
sessionId: string | undefined;
|
|
18
|
+
currentCommitHash: string;
|
|
28
19
|
}>;
|
|
@@ -2,13 +2,8 @@ import type { DevToolsSys } from "@builder.io/dev-tools/core";
|
|
|
2
2
|
import type { Credentials } from "../credentials";
|
|
3
3
|
import type { FusionConfig, LaunchServerStatus } from "$/ai-utils";
|
|
4
4
|
interface FusionStatusMonitor {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
start: () => void;
|
|
6
|
+
stop: () => void;
|
|
7
7
|
}
|
|
8
|
-
export declare function createFusionStatusMonitor(
|
|
9
|
-
sys: DevToolsSys,
|
|
10
|
-
credentials: Credentials,
|
|
11
|
-
fusionConfig: FusionConfig,
|
|
12
|
-
sharedState: LaunchServerStatus,
|
|
13
|
-
): FusionStatusMonitor | null;
|
|
8
|
+
export declare function createFusionStatusMonitor(sys: DevToolsSys, credentials: Credentials, fusionConfig: FusionConfig, sharedState: LaunchServerStatus): FusionStatusMonitor | null;
|
|
14
9
|
export {};
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
import type { DevToolsSys } from "../../types";
|
|
2
2
|
import type { ProxyMiddleware } from "../../types/proxy-middleware";
|
|
3
3
|
import type { IncomingMessage } from "http";
|
|
4
|
-
export declare const createPassThroughProxy: () => import("http-proxy-3").ProxyServer<
|
|
5
|
-
|
|
6
|
-
typeof import("http").ServerResponse,
|
|
7
|
-
Error
|
|
8
|
-
>;
|
|
9
|
-
export declare const createProxyMiddleware: (
|
|
10
|
-
serverUrl: URL,
|
|
11
|
-
sys: DevToolsSys,
|
|
12
|
-
) => ProxyMiddleware | undefined;
|
|
4
|
+
export declare const createPassThroughProxy: () => import("http-proxy-3").ProxyServer<typeof IncomingMessage, typeof import("http").ServerResponse, Error>;
|
|
5
|
+
export declare const createProxyMiddleware: (serverUrl: URL, sys: DevToolsSys) => ProxyMiddleware | undefined;
|
|
13
6
|
/**
|
|
14
7
|
* Detects if HTML was server-side rendered by checking for framework-specific markers.
|
|
15
8
|
* Returns whether SSR was used and whether the header/head was server-rendered.
|
|
16
9
|
*/
|
|
17
10
|
export declare const detectSSR: (body: string) => {
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
hasSSR: boolean;
|
|
12
|
+
hasHeaderSSR: boolean;
|
|
20
13
|
};
|
|
21
14
|
export declare const permissiveHTTPS: any;
|
|
@@ -7,24 +7,17 @@ export declare const BUILDER_API_ENDPOINT_PREFIX: string;
|
|
|
7
7
|
* Endpoints that are not authenticated because they are used by the fly.io health check.
|
|
8
8
|
*/
|
|
9
9
|
export declare const NON_AUTHENTICATED_ENDPOINTS: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
readonly STATUS: "/status";
|
|
11
|
+
readonly PROXY_STATUS: "/proxy-status";
|
|
12
|
+
readonly STATUS_V2: "/status-v2";
|
|
13
|
+
readonly INIT_LOGS: "/init-logs";
|
|
14
|
+
readonly TUNNEL_STATUS: "/tunnel/status";
|
|
15
15
|
};
|
|
16
|
-
export declare const configureServer: ({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}: {
|
|
24
|
-
sys: DevToolsSys;
|
|
25
|
-
app: Express;
|
|
26
|
-
validBuilderPrivateKey: string | undefined;
|
|
27
|
-
authenticateProxy: boolean;
|
|
28
|
-
isLocal: boolean;
|
|
29
|
-
sharedState: LaunchServerStatus;
|
|
16
|
+
export declare const configureServer: ({ sys, app, validBuilderPrivateKey, authenticateProxy, isLocal, sharedState, }: {
|
|
17
|
+
sys: DevToolsSys;
|
|
18
|
+
app: Express;
|
|
19
|
+
validBuilderPrivateKey: string | undefined;
|
|
20
|
+
authenticateProxy: boolean;
|
|
21
|
+
isLocal: boolean;
|
|
22
|
+
sharedState: LaunchServerStatus;
|
|
30
23
|
}) => void;
|
|
@@ -7,23 +7,23 @@ export type TunnelStatus = "stopped" | "starting" | "running" | "error";
|
|
|
7
7
|
* VS Code Tunnel information
|
|
8
8
|
*/
|
|
9
9
|
export interface TunnelInfo {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
status: TunnelStatus;
|
|
11
|
+
name: string | null;
|
|
12
|
+
url: string | null;
|
|
13
|
+
vscodeUri: string | null;
|
|
14
|
+
cursorUri: string | null;
|
|
15
|
+
webUrl: string | null;
|
|
16
|
+
error: string | null;
|
|
17
|
+
workspacePath: string;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Options for starting a VS Code tunnel
|
|
21
21
|
*/
|
|
22
22
|
export interface TunnelOptions {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
name: string;
|
|
24
|
+
workspacePath?: string;
|
|
25
|
+
acceptLicense?: boolean;
|
|
26
|
+
autoRestart?: boolean;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* VS Code Tunnel Manager
|
|
@@ -36,59 +36,59 @@ export interface TunnelOptions {
|
|
|
36
36
|
* - Cleanup on shutdown
|
|
37
37
|
*/
|
|
38
38
|
export declare class VSCodeTunnelManager extends EventEmitter {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
39
|
+
private process;
|
|
40
|
+
private status;
|
|
41
|
+
private tunnelName;
|
|
42
|
+
private tunnelUrl;
|
|
43
|
+
private error;
|
|
44
|
+
private workspacePath;
|
|
45
|
+
private autoRestart;
|
|
46
|
+
private restartAttempts;
|
|
47
|
+
private maxRestartAttempts;
|
|
48
|
+
private restartDelay;
|
|
49
|
+
private isShuttingDown;
|
|
50
|
+
constructor();
|
|
51
|
+
/**
|
|
52
|
+
* Start the VS Code tunnel
|
|
53
|
+
*/
|
|
54
|
+
start(options: TunnelOptions): Promise<TunnelInfo>;
|
|
55
|
+
/**
|
|
56
|
+
* Spawn the tunnel process
|
|
57
|
+
*/
|
|
58
|
+
private spawnTunnel;
|
|
59
|
+
/**
|
|
60
|
+
* Parse tunnel output to extract URL
|
|
61
|
+
*/
|
|
62
|
+
private parseOutput;
|
|
63
|
+
/**
|
|
64
|
+
* Stop the VS Code tunnel
|
|
65
|
+
*/
|
|
66
|
+
stop(): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Get current tunnel information
|
|
69
|
+
*/
|
|
70
|
+
getInfo(): TunnelInfo;
|
|
71
|
+
/**
|
|
72
|
+
* Get tunnel status
|
|
73
|
+
*/
|
|
74
|
+
getStatus(): TunnelStatus;
|
|
75
|
+
/**
|
|
76
|
+
* Check if tunnel is enabled
|
|
77
|
+
* Enabled by default for cloud environments, can be disabled with VSCODE_TUNNEL_ENABLED=false
|
|
78
|
+
*/
|
|
79
|
+
static isEnabled(): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Check if auto-start is enabled
|
|
82
|
+
*/
|
|
83
|
+
static isAutoStartEnabled(): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Get the configured tunnel name from environment or generate one
|
|
86
|
+
*/
|
|
87
|
+
static getTunnelName(projectId?: string, branchName?: string): string;
|
|
88
|
+
/**
|
|
89
|
+
* Get the configured workspace path
|
|
90
|
+
*/
|
|
91
|
+
static getWorkspacePath(): string;
|
|
92
92
|
}
|
|
93
93
|
/**
|
|
94
94
|
* Get the singleton tunnel manager instance
|
|
@@ -97,21 +97,12 @@ export declare function getTunnelManager(): VSCodeTunnelManager;
|
|
|
97
97
|
/**
|
|
98
98
|
* Generate VS Code deep link for a tunnel
|
|
99
99
|
*/
|
|
100
|
-
export declare function generateVSCodeDeepLink(
|
|
101
|
-
tunnelName: string,
|
|
102
|
-
workspacePath?: string,
|
|
103
|
-
): string;
|
|
100
|
+
export declare function generateVSCodeDeepLink(tunnelName: string, workspacePath?: string): string;
|
|
104
101
|
/**
|
|
105
102
|
* Generate Cursor deep link for a tunnel
|
|
106
103
|
*/
|
|
107
|
-
export declare function generateCursorDeepLink(
|
|
108
|
-
tunnelName: string,
|
|
109
|
-
workspacePath?: string,
|
|
110
|
-
): string;
|
|
104
|
+
export declare function generateCursorDeepLink(tunnelName: string, workspacePath?: string): string;
|
|
111
105
|
/**
|
|
112
106
|
* Generate web editor link for a tunnel
|
|
113
107
|
*/
|
|
114
|
-
export declare function generateWebEditorLink(
|
|
115
|
-
tunnelName: string,
|
|
116
|
-
workspacePath?: string,
|
|
117
|
-
): string;
|
|
108
|
+
export declare function generateWebEditorLink(tunnelName: string, workspacePath?: string): string;
|