@builder.io/ai-utils 0.88.0 → 0.89.0
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/package.json +1 -1
- package/src/codegen.d.ts +0 -16
- package/src/index.d.ts +0 -1
- package/src/index.js +0 -1
- package/src/projects.d.ts +0 -3
- package/src/vscode-tunnel.d.ts +0 -89
- package/src/vscode-tunnel.js +0 -109
package/package.json
CHANGED
package/src/codegen.d.ts
CHANGED
|
@@ -4539,20 +4539,6 @@ export interface LaunchServerStatus {
|
|
|
4539
4539
|
memoryUsage?: number;
|
|
4540
4540
|
sessionId?: string;
|
|
4541
4541
|
}
|
|
4542
|
-
/**
|
|
4543
|
-
* VS Code Tunnel status information
|
|
4544
|
-
*/
|
|
4545
|
-
export interface TunnelStatusInfo {
|
|
4546
|
-
enabled: boolean;
|
|
4547
|
-
status: "stopped" | "starting" | "running" | "error";
|
|
4548
|
-
name: string | null;
|
|
4549
|
-
url: string | null;
|
|
4550
|
-
vscodeUri: string | null;
|
|
4551
|
-
cursorUri: string | null;
|
|
4552
|
-
webUrl: string | null;
|
|
4553
|
-
error: string | null;
|
|
4554
|
-
workspacePath: string;
|
|
4555
|
-
}
|
|
4556
4542
|
export interface FusionStatus {
|
|
4557
4543
|
status: "ok";
|
|
4558
4544
|
state: LaunchServerState;
|
|
@@ -4581,8 +4567,6 @@ export interface FusionStatus {
|
|
|
4581
4567
|
containerStateTimestamp?: number;
|
|
4582
4568
|
wsClients: number;
|
|
4583
4569
|
httpClients: number;
|
|
4584
|
-
/** VS Code Tunnel status for remote editor connections */
|
|
4585
|
-
tunnel?: TunnelStatusInfo;
|
|
4586
4570
|
/** Event loop delays collected every 5 seconds (in milliseconds) for percentile calculation */
|
|
4587
4571
|
eventLoopDelays?: number[];
|
|
4588
4572
|
/** Max memory pressure observed in the reporting period (0-1, where 1 is near OOM) */
|
package/src/index.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ export * from "./fusion-environment.js";
|
|
|
13
13
|
export * from "./repo-indexing.js";
|
|
14
14
|
export * from "./organization.js";
|
|
15
15
|
export * from "./features.js";
|
|
16
|
-
export * from "./vscode-tunnel.js";
|
|
17
16
|
export * from "./claw.js";
|
|
18
17
|
export * from "./kube-error.js";
|
|
19
18
|
export * from "./connectivity/types.js";
|
package/src/index.js
CHANGED
|
@@ -13,7 +13,6 @@ export * from "./fusion-environment.js";
|
|
|
13
13
|
export * from "./repo-indexing.js";
|
|
14
14
|
export * from "./organization.js";
|
|
15
15
|
export * from "./features.js";
|
|
16
|
-
export * from "./vscode-tunnel.js";
|
|
17
16
|
export * from "./claw.js";
|
|
18
17
|
export * from "./kube-error.js";
|
|
19
18
|
export * from "./connectivity/types.js";
|
package/src/projects.d.ts
CHANGED
|
@@ -616,9 +616,6 @@ export interface BranchSharedData {
|
|
|
616
616
|
checkoutCommit?: string | null;
|
|
617
617
|
/** Whether this branch is for a fork PR - affects git operations (read-only, can't push) */
|
|
618
618
|
isFork?: boolean | null;
|
|
619
|
-
vscodeTunnelUrl?: string | null;
|
|
620
|
-
vscodeTunnelName?: string | null;
|
|
621
|
-
vscodeTunnelExpiresAt?: string | null;
|
|
622
619
|
commitMode?: CommitMode;
|
|
623
620
|
/** @internal When false, merging this branch's PR does not archive it. Seeded from project.settings at creation. */
|
|
624
621
|
autoCloseBranchOnMerge?: boolean;
|
package/src/vscode-tunnel.d.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* VS Code Tunnel Deep Link Utilities
|
|
3
|
-
*
|
|
4
|
-
* Generates deep links for opening VS Code, Cursor, or web editor
|
|
5
|
-
* connected to a VS Code tunnel.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Default workspace path inside the container
|
|
9
|
-
*/
|
|
10
|
-
export declare const DEFAULT_WORKSPACE_PATH = "/root/app/code";
|
|
11
|
-
/**
|
|
12
|
-
* Generate a VS Code deep link for a tunnel
|
|
13
|
-
*
|
|
14
|
-
* @param tunnelName - The name of the VS Code tunnel
|
|
15
|
-
* @param workspacePath - The path to open in the editor (defaults to /root/app/code)
|
|
16
|
-
* @returns A vscode:// URI that opens VS Code connected to the tunnel
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* generateVSCodeDeepLink("my-project-main")
|
|
20
|
-
* // Returns: "vscode://vscode-remote/tunnel+my-project-main/root/app/code"
|
|
21
|
-
*/
|
|
22
|
-
export declare function generateVSCodeDeepLink(tunnelName: string, workspacePath?: string): string;
|
|
23
|
-
/**
|
|
24
|
-
* Generate a Cursor deep link for a tunnel
|
|
25
|
-
*
|
|
26
|
-
* @param tunnelName - The name of the VS Code tunnel
|
|
27
|
-
* @param workspacePath - The path to open in the editor (defaults to /root/app/code)
|
|
28
|
-
* @returns A cursor:// URI that opens Cursor connected to the tunnel
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* generateCursorDeepLink("my-project-main")
|
|
32
|
-
* // Returns: "cursor://cursor-remote/tunnel+my-project-main/root/app/code"
|
|
33
|
-
*/
|
|
34
|
-
export declare function generateCursorDeepLink(tunnelName: string, workspacePath?: string): string;
|
|
35
|
-
/**
|
|
36
|
-
* Generate a web editor (vscode.dev) link for a tunnel
|
|
37
|
-
*
|
|
38
|
-
* @param tunnelName - The name of the VS Code tunnel
|
|
39
|
-
* @param workspacePath - The path to open in the editor (defaults to /root/app/code)
|
|
40
|
-
* @returns A https://vscode.dev URL that opens the web editor connected to the tunnel
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* generateWebEditorLink("my-project-main")
|
|
44
|
-
* // Returns: "https://vscode.dev/tunnel/my-project-main/root/app/code"
|
|
45
|
-
*/
|
|
46
|
-
export declare function generateWebEditorLink(tunnelName: string, workspacePath?: string): string;
|
|
47
|
-
/**
|
|
48
|
-
* Generate all deep links for a tunnel
|
|
49
|
-
*
|
|
50
|
-
* @param tunnelName - The name of the VS Code tunnel
|
|
51
|
-
* @param workspacePath - The path to open in the editor (defaults to /root/app/code)
|
|
52
|
-
* @returns An object containing all deep link variants
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* generateAllEditorLinks("my-project-main")
|
|
56
|
-
* // Returns: {
|
|
57
|
-
* // vscode: "vscode://vscode-remote/tunnel+my-project-main/root/app/code",
|
|
58
|
-
* // cursor: "cursor://cursor-remote/tunnel+my-project-main/root/app/code",
|
|
59
|
-
* // web: "https://vscode.dev/tunnel/my-project-main/root/app/code"
|
|
60
|
-
* // }
|
|
61
|
-
*/
|
|
62
|
-
export declare function generateAllEditorLinks(tunnelName: string, workspacePath?: string): {
|
|
63
|
-
vscode: string;
|
|
64
|
-
cursor: string;
|
|
65
|
-
web: string;
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Generate a sanitized tunnel name from project and branch identifiers
|
|
69
|
-
*
|
|
70
|
-
* @param projectId - The project ID
|
|
71
|
-
* @param branchName - The branch name
|
|
72
|
-
* @returns A DNS-compatible tunnel name (max 63 chars, lowercase alphanumeric and hyphens)
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* generateTunnelName("abc123", "feature/my-branch")
|
|
76
|
-
* // Returns: "abc123-feature-my-branch"
|
|
77
|
-
*/
|
|
78
|
-
export declare function generateTunnelName(projectId: string, branchName: string): string;
|
|
79
|
-
/**
|
|
80
|
-
* Parse a tunnel URL to extract the tunnel name
|
|
81
|
-
*
|
|
82
|
-
* @param tunnelUrl - A vscode.dev tunnel URL
|
|
83
|
-
* @returns The tunnel name, or null if the URL is invalid
|
|
84
|
-
*
|
|
85
|
-
* @example
|
|
86
|
-
* parseTunnelUrl("https://vscode.dev/tunnel/my-project-main/root/app/code")
|
|
87
|
-
* // Returns: "my-project-main"
|
|
88
|
-
*/
|
|
89
|
-
export declare function parseTunnelUrl(tunnelUrl: string): string | null;
|
package/src/vscode-tunnel.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* VS Code Tunnel Deep Link Utilities
|
|
3
|
-
*
|
|
4
|
-
* Generates deep links for opening VS Code, Cursor, or web editor
|
|
5
|
-
* connected to a VS Code tunnel.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Default workspace path inside the container
|
|
9
|
-
*/
|
|
10
|
-
export const DEFAULT_WORKSPACE_PATH = "/root/app/code";
|
|
11
|
-
/**
|
|
12
|
-
* Generate a VS Code deep link for a tunnel
|
|
13
|
-
*
|
|
14
|
-
* @param tunnelName - The name of the VS Code tunnel
|
|
15
|
-
* @param workspacePath - The path to open in the editor (defaults to /root/app/code)
|
|
16
|
-
* @returns A vscode:// URI that opens VS Code connected to the tunnel
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* generateVSCodeDeepLink("my-project-main")
|
|
20
|
-
* // Returns: "vscode://vscode-remote/tunnel+my-project-main/root/app/code"
|
|
21
|
-
*/
|
|
22
|
-
export function generateVSCodeDeepLink(tunnelName, workspacePath = DEFAULT_WORKSPACE_PATH) {
|
|
23
|
-
return `vscode://vscode-remote/tunnel+${tunnelName}${workspacePath}`;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Generate a Cursor deep link for a tunnel
|
|
27
|
-
*
|
|
28
|
-
* @param tunnelName - The name of the VS Code tunnel
|
|
29
|
-
* @param workspacePath - The path to open in the editor (defaults to /root/app/code)
|
|
30
|
-
* @returns A cursor:// URI that opens Cursor connected to the tunnel
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* generateCursorDeepLink("my-project-main")
|
|
34
|
-
* // Returns: "cursor://cursor-remote/tunnel+my-project-main/root/app/code"
|
|
35
|
-
*/
|
|
36
|
-
export function generateCursorDeepLink(tunnelName, workspacePath = DEFAULT_WORKSPACE_PATH) {
|
|
37
|
-
return `cursor://cursor-remote/tunnel+${tunnelName}${workspacePath}`;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Generate a web editor (vscode.dev) link for a tunnel
|
|
41
|
-
*
|
|
42
|
-
* @param tunnelName - The name of the VS Code tunnel
|
|
43
|
-
* @param workspacePath - The path to open in the editor (defaults to /root/app/code)
|
|
44
|
-
* @returns A https://vscode.dev URL that opens the web editor connected to the tunnel
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* generateWebEditorLink("my-project-main")
|
|
48
|
-
* // Returns: "https://vscode.dev/tunnel/my-project-main/root/app/code"
|
|
49
|
-
*/
|
|
50
|
-
export function generateWebEditorLink(tunnelName, workspacePath = DEFAULT_WORKSPACE_PATH) {
|
|
51
|
-
return `https://vscode.dev/tunnel/${tunnelName}${workspacePath}`;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Generate all deep links for a tunnel
|
|
55
|
-
*
|
|
56
|
-
* @param tunnelName - The name of the VS Code tunnel
|
|
57
|
-
* @param workspacePath - The path to open in the editor (defaults to /root/app/code)
|
|
58
|
-
* @returns An object containing all deep link variants
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* generateAllEditorLinks("my-project-main")
|
|
62
|
-
* // Returns: {
|
|
63
|
-
* // vscode: "vscode://vscode-remote/tunnel+my-project-main/root/app/code",
|
|
64
|
-
* // cursor: "cursor://cursor-remote/tunnel+my-project-main/root/app/code",
|
|
65
|
-
* // web: "https://vscode.dev/tunnel/my-project-main/root/app/code"
|
|
66
|
-
* // }
|
|
67
|
-
*/
|
|
68
|
-
export function generateAllEditorLinks(tunnelName, workspacePath = DEFAULT_WORKSPACE_PATH) {
|
|
69
|
-
return {
|
|
70
|
-
vscode: generateVSCodeDeepLink(tunnelName, workspacePath),
|
|
71
|
-
cursor: generateCursorDeepLink(tunnelName, workspacePath),
|
|
72
|
-
web: generateWebEditorLink(tunnelName, workspacePath),
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Generate a sanitized tunnel name from project and branch identifiers
|
|
77
|
-
*
|
|
78
|
-
* @param projectId - The project ID
|
|
79
|
-
* @param branchName - The branch name
|
|
80
|
-
* @returns A DNS-compatible tunnel name (max 63 chars, lowercase alphanumeric and hyphens)
|
|
81
|
-
*
|
|
82
|
-
* @example
|
|
83
|
-
* generateTunnelName("abc123", "feature/my-branch")
|
|
84
|
-
* // Returns: "abc123-feature-my-branch"
|
|
85
|
-
*/
|
|
86
|
-
export function generateTunnelName(projectId, branchName) {
|
|
87
|
-
const combined = `${projectId}-${branchName}`;
|
|
88
|
-
const sanitized = combined
|
|
89
|
-
.toLowerCase()
|
|
90
|
-
.replace(/[^a-z0-9-]/g, "-")
|
|
91
|
-
.replace(/-+/g, "-")
|
|
92
|
-
.replace(/^-|-$/g, "")
|
|
93
|
-
.substring(0, 63);
|
|
94
|
-
return sanitized || "builder-tunnel";
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Parse a tunnel URL to extract the tunnel name
|
|
98
|
-
*
|
|
99
|
-
* @param tunnelUrl - A vscode.dev tunnel URL
|
|
100
|
-
* @returns The tunnel name, or null if the URL is invalid
|
|
101
|
-
*
|
|
102
|
-
* @example
|
|
103
|
-
* parseTunnelUrl("https://vscode.dev/tunnel/my-project-main/root/app/code")
|
|
104
|
-
* // Returns: "my-project-main"
|
|
105
|
-
*/
|
|
106
|
-
export function parseTunnelUrl(tunnelUrl) {
|
|
107
|
-
const match = tunnelUrl.match(/(?:vscode\.dev\/tunnel\/|tunnel\+)([a-zA-Z0-9_-]+)/);
|
|
108
|
-
return match ? match[1] : null;
|
|
109
|
-
}
|