@builder.io/ai-utils 0.21.0 → 0.21.1
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 +3 -3
- package/src/events.d.ts +54 -0
- package/src/events.js +12 -1
- package/src/projects.d.ts +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/ai-utils",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"description": "Builder.io AI utils",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"import": "./src/index.js",
|
|
11
11
|
"types": "./src/index.d.ts"
|
|
12
12
|
},
|
|
13
|
-
"./connectivity/node": {
|
|
13
|
+
"./src/connectivity/node": {
|
|
14
14
|
"import": "./src/connectivity/node.js",
|
|
15
15
|
"types": "./src/connectivity/node.d.ts"
|
|
16
16
|
},
|
|
17
|
-
"./connectivity/browser": {
|
|
17
|
+
"./src/connectivity/browser": {
|
|
18
18
|
"import": "./src/connectivity/browser.js",
|
|
19
19
|
"types": "./src/connectivity/browser.d.ts"
|
|
20
20
|
}
|
package/src/events.d.ts
CHANGED
|
@@ -419,4 +419,58 @@ export interface AssistantFusionSuggestionEvent {
|
|
|
419
419
|
message: string;
|
|
420
420
|
};
|
|
421
421
|
}
|
|
422
|
+
export interface BaseFusionEvent<ExtraData extends Record<string, unknown> = {}, ExtraAttrs extends Record<string, string> = {}, V extends number = number> {
|
|
423
|
+
data: {
|
|
424
|
+
eventId: string;
|
|
425
|
+
ownerId: string;
|
|
426
|
+
userId: string | undefined;
|
|
427
|
+
source: string;
|
|
428
|
+
tags: string[];
|
|
429
|
+
audience: string;
|
|
430
|
+
private: boolean;
|
|
431
|
+
timestamp: number;
|
|
432
|
+
} & ExtraData;
|
|
433
|
+
attributes: {
|
|
434
|
+
eventName: string;
|
|
435
|
+
namespace: string;
|
|
436
|
+
version: `${V}`;
|
|
437
|
+
ownerId: string;
|
|
438
|
+
} & ExtraAttrs;
|
|
439
|
+
orderingKey?: string;
|
|
440
|
+
}
|
|
441
|
+
export type FusionEventVariant<EventName extends string, ExtraData extends Record<string, unknown> = {}, ExtraAttrs extends Record<string, string> = {}, V extends number = 1> = BaseFusionEvent<ExtraData, ExtraAttrs, V> & {
|
|
442
|
+
attributes: {
|
|
443
|
+
eventName: EventName;
|
|
444
|
+
};
|
|
445
|
+
};
|
|
446
|
+
export type AiTaskCompletedEvent = FusionEventVariant<"ai.task.completed", {
|
|
447
|
+
durationMs?: number;
|
|
448
|
+
success: boolean;
|
|
449
|
+
}, {
|
|
450
|
+
taskId: string;
|
|
451
|
+
}, 1>;
|
|
452
|
+
export declare const AiTaskCompletedEvent: {
|
|
453
|
+
eventName: "ai.task.completed";
|
|
454
|
+
version: "1";
|
|
455
|
+
};
|
|
456
|
+
export type AiTaskFailedEvent = FusionEventVariant<"ai.task.failed", {
|
|
457
|
+
durationMs?: number;
|
|
458
|
+
error: string;
|
|
459
|
+
}, {
|
|
460
|
+
taskId: string;
|
|
461
|
+
}, 1>;
|
|
462
|
+
export declare const AiTaskFailedEvent: {
|
|
463
|
+
eventName: "ai.task.failed";
|
|
464
|
+
version: "1";
|
|
465
|
+
};
|
|
466
|
+
export type GitPrCreatedEvent = FusionEventVariant<"git.pr.created", {
|
|
467
|
+
prNumber: number;
|
|
468
|
+
repo: string;
|
|
469
|
+
branch: string;
|
|
470
|
+
}, {}, 1>;
|
|
471
|
+
export declare const GitPrCreatedEvent: {
|
|
472
|
+
eventName: "git.pr.created";
|
|
473
|
+
version: "1";
|
|
474
|
+
};
|
|
475
|
+
export type FusionEvent = AiTaskCompletedEvent | AiTaskFailedEvent | GitPrCreatedEvent;
|
|
422
476
|
export {};
|
package/src/events.js
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export const AiTaskCompletedEvent = {
|
|
2
|
+
eventName: "ai.task.completed",
|
|
3
|
+
version: "1",
|
|
4
|
+
};
|
|
5
|
+
export const AiTaskFailedEvent = {
|
|
6
|
+
eventName: "ai.task.failed",
|
|
7
|
+
version: "1",
|
|
8
|
+
};
|
|
9
|
+
export const GitPrCreatedEvent = {
|
|
10
|
+
eventName: "git.pr.created",
|
|
11
|
+
version: "1",
|
|
12
|
+
};
|
package/src/projects.d.ts
CHANGED
|
@@ -535,7 +535,10 @@ export interface Project {
|
|
|
535
535
|
authUser?: string;
|
|
536
536
|
authPassword?: string;
|
|
537
537
|
};
|
|
538
|
-
|
|
538
|
+
prReviewer?: {
|
|
539
|
+
enabled: boolean;
|
|
540
|
+
instructions?: string;
|
|
541
|
+
};
|
|
539
542
|
postMergeMemories?: boolean;
|
|
540
543
|
httpsServerKeyPath?: string;
|
|
541
544
|
httpsServerCertPath?: string;
|