@builder.io/ai-utils 0.30.0 → 0.31.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
CHANGED
package/src/codegen.d.ts
CHANGED
|
@@ -205,7 +205,6 @@ export interface BuilderEditToolInput {
|
|
|
205
205
|
}
|
|
206
206
|
export interface GetScreenshotToolInput {
|
|
207
207
|
href?: string;
|
|
208
|
-
url?: string;
|
|
209
208
|
selector?: string;
|
|
210
209
|
width?: number;
|
|
211
210
|
height?: number;
|
|
@@ -327,6 +326,7 @@ export interface ExitToolInput {
|
|
|
327
326
|
isMicrofrontend?: boolean;
|
|
328
327
|
setupNeedsCredentials?: boolean;
|
|
329
328
|
devServerNeedsCredentials?: boolean;
|
|
329
|
+
needsVPN?: boolean;
|
|
330
330
|
/** A human-readable description of what the project is about (not tech specs), used by fusion to route requests to the right project */
|
|
331
331
|
projectDescription?: string;
|
|
332
332
|
}
|
|
@@ -419,6 +419,7 @@ export interface ProposedConfig {
|
|
|
419
419
|
projectDescription?: string;
|
|
420
420
|
cost?: number;
|
|
421
421
|
durationMs?: number;
|
|
422
|
+
needsVPN?: boolean;
|
|
422
423
|
}
|
|
423
424
|
/**
|
|
424
425
|
* Parameters for proposing a configuration to the backend
|
|
@@ -450,6 +451,7 @@ export interface ProposeConfigParams {
|
|
|
450
451
|
setupNeedsCredentials?: boolean;
|
|
451
452
|
devServerNeedsCredentials?: boolean;
|
|
452
453
|
projectDescription?: string;
|
|
454
|
+
needsVPN?: boolean;
|
|
453
455
|
}
|
|
454
456
|
export interface VerifySetupCommandToolInput {
|
|
455
457
|
command: string;
|
|
@@ -1822,6 +1824,7 @@ export interface LaunchServerStatus {
|
|
|
1822
1824
|
activeOperations: number;
|
|
1823
1825
|
diskUsage?: number;
|
|
1824
1826
|
memoryUsage?: number;
|
|
1827
|
+
sessionId?: string;
|
|
1825
1828
|
}
|
|
1826
1829
|
/**
|
|
1827
1830
|
* VS Code Tunnel status information
|
|
@@ -1869,6 +1872,8 @@ export interface FusionStatus {
|
|
|
1869
1872
|
diskUsage?: number;
|
|
1870
1873
|
/** Current memory usage as a ratio (0-1, where 1 is fully used) */
|
|
1871
1874
|
memoryUsage?: number;
|
|
1875
|
+
/** Session ID of the active codegen session */
|
|
1876
|
+
sessionId?: string;
|
|
1872
1877
|
}
|
|
1873
1878
|
export interface FusionMetrics {
|
|
1874
1879
|
counters?: {
|
|
@@ -5,5 +5,7 @@ export interface HttpCheckOptions {
|
|
|
5
5
|
testId: TestId;
|
|
6
6
|
timeout?: number;
|
|
7
7
|
fetchFn?: ConnectivityFetchFn;
|
|
8
|
+
/** Fetch dispatcher for proxy routing (e.g. undici ProxyAgent). */
|
|
9
|
+
dispatcher?: object;
|
|
8
10
|
}
|
|
9
11
|
export declare function httpCheck(options: HttpCheckOptions): Promise<CheckResult>;
|
|
@@ -3,16 +3,26 @@ import { isBrowser } from "../environment.js";
|
|
|
3
3
|
const DEFAULT_TIMEOUT_MS = 30000;
|
|
4
4
|
const LATENCY_THRESHOLD_MS = 5000;
|
|
5
5
|
export async function httpCheck(options) {
|
|
6
|
-
const { target, source, testId, timeout = DEFAULT_TIMEOUT_MS, fetchFn = fetch, } = options;
|
|
6
|
+
const { target, source, testId, timeout = DEFAULT_TIMEOUT_MS, fetchFn = fetch, dispatcher, } = options;
|
|
7
7
|
const startTime = Date.now();
|
|
8
8
|
const controller = new AbortController();
|
|
9
9
|
const timeoutId = setTimeout(() => controller.abort(), timeout);
|
|
10
10
|
try {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const method = "HEAD";
|
|
12
|
+
const redirect = isBrowser() ? "follow" : "manual";
|
|
13
|
+
const signal = controller.signal;
|
|
14
|
+
/**
|
|
15
|
+
* The custom fetch fn used in dev tools has proxy handling built-in, so no need
|
|
16
|
+
* for a custom dispatcher.
|
|
17
|
+
*/
|
|
18
|
+
const response = dispatcher
|
|
19
|
+
? await fetch(target, {
|
|
20
|
+
method,
|
|
21
|
+
signal,
|
|
22
|
+
redirect,
|
|
23
|
+
dispatcher,
|
|
24
|
+
})
|
|
25
|
+
: await fetchFn(target, { method, signal, redirect });
|
|
16
26
|
clearTimeout(timeoutId);
|
|
17
27
|
const durationMs = Date.now() - startTime;
|
|
18
28
|
const errorCode = mapHttpStatusToErrorCode(response.status);
|
|
@@ -6,7 +6,7 @@ import { tcpCheck } from "./checks/tcp-check.js";
|
|
|
6
6
|
import { tlsCheck } from "./checks/tls-check.js";
|
|
7
7
|
import { sshCheck } from "./checks/ssh-check.js";
|
|
8
8
|
export async function runChecks(input) {
|
|
9
|
-
const { tests, gitHost, onProgress, fetchFn } = input;
|
|
9
|
+
const { tests, gitHost, onProgress, fetchFn, dispatcher } = input;
|
|
10
10
|
const results = [];
|
|
11
11
|
const total = tests.length;
|
|
12
12
|
for (let index = 0; index < tests.length; index++) {
|
|
@@ -17,7 +17,7 @@ export async function runChecks(input) {
|
|
|
17
17
|
index,
|
|
18
18
|
total,
|
|
19
19
|
});
|
|
20
|
-
const result = await runSingleCheck(test, gitHost, fetchFn);
|
|
20
|
+
const result = await runSingleCheck(test, gitHost, fetchFn, dispatcher);
|
|
21
21
|
results.push(result);
|
|
22
22
|
emitProgress(onProgress, {
|
|
23
23
|
type: "test:complete",
|
|
@@ -36,7 +36,7 @@ export async function runChecks(input) {
|
|
|
36
36
|
results,
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
async function runSingleCheck(test, gitHost, fetchFn) {
|
|
39
|
+
async function runSingleCheck(test, gitHost, fetchFn, dispatcher) {
|
|
40
40
|
const { source, testId } = test;
|
|
41
41
|
const checkType = getCheckTypeForTestId(testId);
|
|
42
42
|
if (!isCheckAvailable(checkType)) {
|
|
@@ -80,7 +80,7 @@ async function runSingleCheck(test, gitHost, fetchFn) {
|
|
|
80
80
|
}
|
|
81
81
|
switch (checkType) {
|
|
82
82
|
case "http":
|
|
83
|
-
return httpCheck({ target, source, testId, fetchFn });
|
|
83
|
+
return httpCheck({ target, source, testId, fetchFn, dispatcher });
|
|
84
84
|
case "dns":
|
|
85
85
|
return dnsCheck({
|
|
86
86
|
hostname: extractHostname(target),
|
|
@@ -19,6 +19,12 @@ export interface RunChecksInput {
|
|
|
19
19
|
* environments.
|
|
20
20
|
*/
|
|
21
21
|
fetchFn?: ConnectivityFetchFn;
|
|
22
|
+
/**
|
|
23
|
+
* Fetch dispatcher for proxy routing (e.g. undici ProxyAgent).
|
|
24
|
+
* Passed through to the `dispatcher` option of fetch for HTTP checks.
|
|
25
|
+
* Typically only needed server-side for static IP routing.
|
|
26
|
+
*/
|
|
27
|
+
dispatcher?: object;
|
|
22
28
|
}
|
|
23
29
|
export type ProgressEvent = {
|
|
24
30
|
type: "test:start";
|
package/src/projects.d.ts
CHANGED
|
@@ -343,6 +343,7 @@ export interface PartialBranchData {
|
|
|
343
343
|
name?: string;
|
|
344
344
|
createdBy: string;
|
|
345
345
|
friendlyName?: string;
|
|
346
|
+
description?: string;
|
|
346
347
|
isDefault: boolean;
|
|
347
348
|
isPublic: boolean;
|
|
348
349
|
lockedFusionEnvironment?: FusionExecutionEnvironment;
|
|
@@ -357,6 +358,7 @@ export interface PartialBranchData {
|
|
|
357
358
|
useHomeDir?: boolean;
|
|
358
359
|
agentType?: AgentType;
|
|
359
360
|
checkoutBranch?: string | null;
|
|
361
|
+
prNumber?: number;
|
|
360
362
|
/** Whether this branch is for a fork PR - affects git operations (read-only, can't push) */
|
|
361
363
|
isFork?: boolean | null;
|
|
362
364
|
/** Whether this branch is for a code review - affects enabled agents and tools*/
|
|
@@ -442,6 +444,7 @@ export interface BranchSharedData {
|
|
|
442
444
|
isPublic?: boolean;
|
|
443
445
|
isDefault?: boolean;
|
|
444
446
|
friendlyName?: string;
|
|
447
|
+
description?: string;
|
|
445
448
|
useHomeDir?: boolean;
|
|
446
449
|
useCloudHomeDir?: boolean;
|
|
447
450
|
reviewers?: string[] | null;
|