@builder.io/ai-utils 0.38.1 → 0.38.3
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
|
@@ -272,6 +272,12 @@ export interface TimelineEvent {
|
|
|
272
272
|
durationMs?: number;
|
|
273
273
|
thinking?: string;
|
|
274
274
|
}
|
|
275
|
+
export interface CursorPosition {
|
|
276
|
+
x: number;
|
|
277
|
+
y: number;
|
|
278
|
+
viewportWidth: number;
|
|
279
|
+
viewportHeight: number;
|
|
280
|
+
}
|
|
275
281
|
export interface TimelineFrameMetadata {
|
|
276
282
|
index: number;
|
|
277
283
|
timestamp: number;
|
|
@@ -537,11 +543,6 @@ export interface VerifyValidateCommandToolInput {
|
|
|
537
543
|
command: string;
|
|
538
544
|
timeout?: number;
|
|
539
545
|
}
|
|
540
|
-
export interface VerifyRuntimeDependencyToolInput {
|
|
541
|
-
tool: string;
|
|
542
|
-
version: string;
|
|
543
|
-
source?: string;
|
|
544
|
-
}
|
|
545
546
|
export interface ProposeEnvVariableToolInput {
|
|
546
547
|
key: string;
|
|
547
548
|
value: string;
|
|
@@ -575,6 +576,15 @@ export interface SpawnBranchToolInput {
|
|
|
575
576
|
model?: "auto" | "opus" | "sonnet" | "haiku";
|
|
576
577
|
attachment_urls?: string[];
|
|
577
578
|
}
|
|
579
|
+
export interface CreateProjectToolInput {
|
|
580
|
+
repo_url: string;
|
|
581
|
+
name?: string;
|
|
582
|
+
builder_user_id?: string;
|
|
583
|
+
origin_channel_id?: string;
|
|
584
|
+
initial_message?: string;
|
|
585
|
+
}
|
|
586
|
+
export interface GetAvailableReposToolInput {
|
|
587
|
+
}
|
|
578
588
|
export interface ReadBranchToolInput {
|
|
579
589
|
project_id: string;
|
|
580
590
|
branch_name: string;
|
|
@@ -687,11 +697,12 @@ export interface CodeGenToolMap {
|
|
|
687
697
|
VerifyDevCommand: VerifyDevCommandToolInput;
|
|
688
698
|
VerifyDevServer: VerifyDevServerToolInput;
|
|
689
699
|
VerifyValidateCommand: VerifyValidateCommandToolInput;
|
|
690
|
-
VerifyRuntimeDependency: VerifyRuntimeDependencyToolInput;
|
|
691
700
|
ProposeEnvVariable: ProposeEnvVariableToolInput;
|
|
692
701
|
SetEnvVariable: SetEnvVariableToolInput;
|
|
693
702
|
SendMessage: SendMessageToolInput;
|
|
694
703
|
SpawnBranch: SpawnBranchToolInput;
|
|
704
|
+
CreateProject: CreateProjectToolInput;
|
|
705
|
+
GetAvailableRepos: GetAvailableReposToolInput;
|
|
695
706
|
ReadBranch: ReadBranchToolInput;
|
|
696
707
|
ArchiveBranch: ArchiveBranchToolInput;
|
|
697
708
|
RunningAgents: RunningAgentsToolInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mapFetchErrorToConnectivityCode } from "../error-codes.js";
|
|
2
2
|
import { isBrowser } from "../environment.js";
|
|
3
3
|
const DEFAULT_TIMEOUT_MS = 30000;
|
|
4
4
|
const LATENCY_THRESHOLD_MS = 5000;
|
|
@@ -25,15 +25,15 @@ export async function httpCheck(options) {
|
|
|
25
25
|
: await fetchFn(target, { method, signal, redirect });
|
|
26
26
|
clearTimeout(timeoutId);
|
|
27
27
|
const durationMs = Date.now() - startTime;
|
|
28
|
-
const errorCode = mapHttpStatusToErrorCode(response.status);
|
|
29
28
|
const hasHighLatency = durationMs > LATENCY_THRESHOLD_MS;
|
|
30
|
-
|
|
29
|
+
const isServerError = response.status >= 500;
|
|
30
|
+
if (isServerError) {
|
|
31
31
|
return {
|
|
32
32
|
source,
|
|
33
33
|
testId,
|
|
34
34
|
target,
|
|
35
35
|
passed: false,
|
|
36
|
-
errorCode,
|
|
36
|
+
errorCode: "http_server_error",
|
|
37
37
|
durationMs,
|
|
38
38
|
metadata: {
|
|
39
39
|
statusCode: response.status,
|
|
@@ -41,6 +41,8 @@ export async function httpCheck(options) {
|
|
|
41
41
|
},
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
+
// Any non-5xx HTTP response means we successfully connected to the server.
|
|
45
|
+
// We don't care about 4xx etc. — only that the server is reachable and responding.
|
|
44
46
|
return {
|
|
45
47
|
source,
|
|
46
48
|
testId,
|
package/src/projects.d.ts
CHANGED
|
@@ -213,7 +213,7 @@ export interface CleanupCompletedMessage extends BaseMessage {
|
|
|
213
213
|
* Messages sent by the container orchestrator.
|
|
214
214
|
*/
|
|
215
215
|
export type ProjectsChunkMessage = InitializingMessage | FetchingGithubTokenMessage | FetchingFusionKeyMessage | CheckingAppMessage | CleaningUpAppMessage | CreatingAppMessage | CheckingIPMessage | AllocatingIPMessage | CheckingMachineMessage | CheckingVolumeMessage | ForkingVolumeMessage | RetryingWithNewRegionMessage | WaitingBeforePollingMessage | PollingMachineStatusMessage | WarningStateMessage | PingMessage | DebugMessage | ErrorMessage | InfoMessage | WarningMessage | MachineStatusMessage | LogsMessage | ConfigStatusMessage | AppCreatedMessage | MachineCreatedMessage | IpAllocatedMessage | VolumeForkedMessage | ReadyMessage | ErrorStateMessage | CleanupCompletedMessage;
|
|
216
|
-
export type GitProvider = "github" | "selfHostedGithub" | "bitbucket" | "gitlab" | "azure";
|
|
216
|
+
export type GitProvider = "github" | "selfHostedGithub" | "bitbucket" | "gitlab" | "azure" | "custom";
|
|
217
217
|
export interface GitConfig {
|
|
218
218
|
url: string;
|
|
219
219
|
provider: GitProvider | "unknown";
|
|
@@ -706,6 +706,8 @@ export interface Project {
|
|
|
706
706
|
orgAgentConfig?: OrgAgentConfig;
|
|
707
707
|
/** When true, the project is hidden from normal project listings */
|
|
708
708
|
hidden?: boolean;
|
|
709
|
+
/** When true, automatically apply verified setup configuration when the setup agent completes */
|
|
710
|
+
autoApplySetup?: boolean;
|
|
709
711
|
}
|
|
710
712
|
/**
|
|
711
713
|
* Get the state of a branch, checking `state` first and falling back to `deleted` for backwards compatibility.
|
|
@@ -745,16 +747,19 @@ export interface OrganizationPrivate {
|
|
|
745
747
|
export interface CreateProjectOptions {
|
|
746
748
|
name?: string;
|
|
747
749
|
repoFullName: string;
|
|
748
|
-
repoProvider:
|
|
750
|
+
repoProvider: GitProvider;
|
|
749
751
|
repoProtocol?: string;
|
|
750
752
|
repoDescription?: string;
|
|
751
753
|
repoPrivate: boolean;
|
|
752
754
|
repoUrl: string;
|
|
753
755
|
needSetup: boolean;
|
|
756
|
+
projectType?: Project["projectType"];
|
|
754
757
|
domains?: string[];
|
|
755
758
|
settings?: Partial<Project["settings"]>;
|
|
756
759
|
isPublic?: boolean;
|
|
757
760
|
isExample?: boolean;
|
|
761
|
+
isFromUserTemplate?: boolean;
|
|
762
|
+
autoApplySetup?: boolean;
|
|
758
763
|
templateId?: string;
|
|
759
764
|
}
|
|
760
765
|
export interface BuilderMyContext {
|