@builder.io/ai-utils 0.40.0 → 0.41.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/events.d.ts +4 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/kube-error.d.ts +6 -0
- package/src/kube-error.js +13 -0
- package/src/organization.d.ts +6 -0
- package/src/projects.d.ts +3 -0
package/package.json
CHANGED
package/src/events.d.ts
CHANGED
|
@@ -554,7 +554,10 @@ export type ClientDevtoolsSessionIdleEventV1 = FusionEventVariant<"client.devtoo
|
|
|
554
554
|
branchName?: string;
|
|
555
555
|
hasPlanToApply?: boolean;
|
|
556
556
|
sessionMode?: string;
|
|
557
|
-
}, {
|
|
557
|
+
}, {
|
|
558
|
+
projectId?: string;
|
|
559
|
+
branchName?: string;
|
|
560
|
+
}, 1>;
|
|
558
561
|
export declare const ClientDevtoolsSessionIdleEventV1: {
|
|
559
562
|
eventName: "client.devtools.session.idle";
|
|
560
563
|
version: "1";
|
package/src/index.d.ts
CHANGED
|
@@ -10,5 +10,6 @@ export * from "./organization.js";
|
|
|
10
10
|
export * from "./features.js";
|
|
11
11
|
export * from "./vscode-tunnel.js";
|
|
12
12
|
export * from "./claw.js";
|
|
13
|
+
export * from "./kube-error.js";
|
|
13
14
|
export * from "./connectivity/types.js";
|
|
14
15
|
export { connectivityErrorCodeToLikelyCause, mapConnectivityErrorMessage, } from "./connectivity/error-codes.js";
|
package/src/index.js
CHANGED
|
@@ -10,5 +10,6 @@ export * from "./organization.js";
|
|
|
10
10
|
export * from "./features.js";
|
|
11
11
|
export * from "./vscode-tunnel.js";
|
|
12
12
|
export * from "./claw.js";
|
|
13
|
+
export * from "./kube-error.js";
|
|
13
14
|
export * from "./connectivity/types.js";
|
|
14
15
|
export { connectivityErrorCodeToLikelyCause, mapConnectivityErrorMessage, } from "./connectivity/error-codes.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract the HTTP status code from a Kubernetes client error.
|
|
3
|
+
* ApiException (v1.x) uses numeric `.code`, but raw network errors (e.g. ECONNREFUSED)
|
|
4
|
+
* set `.code` to a string. This helper ensures we always return a number.
|
|
5
|
+
*/
|
|
6
|
+
export declare function kubeErrorStatus(error: any): number;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract the HTTP status code from a Kubernetes client error.
|
|
3
|
+
* ApiException (v1.x) uses numeric `.code`, but raw network errors (e.g. ECONNREFUSED)
|
|
4
|
+
* set `.code` to a string. This helper ensures we always return a number.
|
|
5
|
+
*/
|
|
6
|
+
export function kubeErrorStatus(error) {
|
|
7
|
+
var _a;
|
|
8
|
+
if (typeof error.code === "number")
|
|
9
|
+
return error.code;
|
|
10
|
+
if (typeof ((_a = error.response) === null || _a === void 0 ? void 0 : _a.statusCode) === "number")
|
|
11
|
+
return error.response.statusCode;
|
|
12
|
+
return 0;
|
|
13
|
+
}
|
package/src/organization.d.ts
CHANGED
|
@@ -54,6 +54,8 @@ export interface FallbackTokensPrivate {
|
|
|
54
54
|
token: string;
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
+
export type BackgroundAgentsWebhookEvent = "started" | "completed" | "error";
|
|
58
|
+
export type BackgroundAgentsWebhookEvents = ["all"] | BackgroundAgentsWebhookEvent[];
|
|
57
59
|
interface OrganizationSettings {
|
|
58
60
|
attribution?: string[];
|
|
59
61
|
visualEditorAiStyleInspirationURL?: string;
|
|
@@ -92,6 +94,10 @@ interface OrganizationSettings {
|
|
|
92
94
|
ticketAssessmentPrompt?: string;
|
|
93
95
|
ticketAssessmentModel?: string;
|
|
94
96
|
ticketAssessmentDailyLimit?: number;
|
|
97
|
+
backgroundAgentsWebhook?: {
|
|
98
|
+
url?: string;
|
|
99
|
+
events?: BackgroundAgentsWebhookEvents;
|
|
100
|
+
};
|
|
95
101
|
}
|
|
96
102
|
interface RoleOptions {
|
|
97
103
|
read?: boolean;
|
package/src/projects.d.ts
CHANGED
|
@@ -405,6 +405,8 @@ export interface BranchMetadata {
|
|
|
405
405
|
description?: string;
|
|
406
406
|
/** Whether the branch is a cloned branch */
|
|
407
407
|
isClonedBranch?: boolean;
|
|
408
|
+
/** Data passed in via /agents/run api that we echo in webhook response **/
|
|
409
|
+
webhookContext?: Record<string, unknown>;
|
|
408
410
|
[key: string]: unknown;
|
|
409
411
|
}
|
|
410
412
|
export type PRStatus = "open" | "closed" | "merged" | "draft" | "approved";
|
|
@@ -752,6 +754,7 @@ export interface OrganizationPrivate {
|
|
|
752
754
|
createdAt: number;
|
|
753
755
|
updatedAt: number;
|
|
754
756
|
fallbackTokens?: FallbackTokensPrivate;
|
|
757
|
+
backgroundAgentsWebhookSecret?: string;
|
|
755
758
|
}
|
|
756
759
|
export interface CreateProjectOptions {
|
|
757
760
|
name?: string;
|