@databutton/firebase-types 1.150.0 → 1.151.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.
|
@@ -307,5 +307,6 @@ export declare enum AccountEmployeeCount {
|
|
|
307
307
|
COUNT_5000_PLUS = "5000+"
|
|
308
308
|
}
|
|
309
309
|
export declare enum NotificationType {
|
|
310
|
-
AGENT_TASK_REQUIRE_INPUT = "agent-task-require-input"
|
|
310
|
+
AGENT_TASK_REQUIRE_INPUT = "agent-task-require-input",
|
|
311
|
+
AGENT_SUGGEST_NEXT_STEPS = "agent-suggest-next-steps"
|
|
311
312
|
}
|
|
@@ -339,5 +339,6 @@ export var AccountEmployeeCount;
|
|
|
339
339
|
export var NotificationType;
|
|
340
340
|
(function (NotificationType) {
|
|
341
341
|
NotificationType["AGENT_TASK_REQUIRE_INPUT"] = "agent-task-require-input";
|
|
342
|
+
NotificationType["AGENT_SUGGEST_NEXT_STEPS"] = "agent-suggest-next-steps";
|
|
342
343
|
})(NotificationType || (NotificationType = {}));
|
|
343
344
|
//# sourceMappingURL=enums.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Timestamp } from "firebase/firestore";
|
|
2
2
|
import type { JsonObject, Primitive } from "type-fest";
|
|
3
3
|
import type { ProjectMigration } from "../internal/enums.js";
|
|
4
|
-
import
|
|
4
|
+
import { NotificationType } from "./enums.js";
|
|
5
|
+
import type { AccountBusinessModel, AccountEmployeeCount, AccountIndustry, AccountRole, ConfigTypes, ImprovementPriority, ImprovementStatus, TaskPriority, TaskRelation, ThirdPartyAuthName, ThirdPartyDatabaseName, ThirdPartyPaymentsName, ThirdPartyServiceCategory, ThirdPartyStorageName, UiComponentTag } from "./enums.js";
|
|
5
6
|
/**
|
|
6
7
|
* Types here should reflect data format stored in firestore and
|
|
7
8
|
* either be backwards-compatible or migrated when needed
|
|
@@ -47,12 +48,15 @@ export interface SubscribedNotificationGroup {
|
|
|
47
48
|
groupId: string;
|
|
48
49
|
mode: NotificationGroupMode;
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
+
interface NotificationBase {
|
|
51
52
|
createdBy: PerformedBy;
|
|
52
53
|
createdAt: Timestamp;
|
|
53
54
|
userId: string | null;
|
|
54
55
|
groupId: string | null;
|
|
55
56
|
read: boolean;
|
|
57
|
+
}
|
|
58
|
+
/** A tool call is awaiting human approval. */
|
|
59
|
+
export interface NotificationForApproval extends NotificationBase {
|
|
56
60
|
type: NotificationType.AGENT_TASK_REQUIRE_INPUT;
|
|
57
61
|
metadata: {
|
|
58
62
|
projectId: string;
|
|
@@ -68,6 +72,27 @@ export interface Notification {
|
|
|
68
72
|
environment?: "dev" | "prod" | null;
|
|
69
73
|
};
|
|
70
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* The agent reached a natural stop point and is asking the human for input
|
|
77
|
+
* (via the suggest_next_steps tool). The suggested options live on the tool
|
|
78
|
+
* call in the session, not on the notification.
|
|
79
|
+
*/
|
|
80
|
+
export interface NotificationForSuggestNextSteps extends NotificationBase {
|
|
81
|
+
type: NotificationType.AGENT_SUGGEST_NEXT_STEPS;
|
|
82
|
+
metadata: {
|
|
83
|
+
projectId: string;
|
|
84
|
+
title: string;
|
|
85
|
+
description: string;
|
|
86
|
+
sessionId: string;
|
|
87
|
+
taskId?: string | null;
|
|
88
|
+
displayId?: string | null;
|
|
89
|
+
taskTitle?: string | null;
|
|
90
|
+
environment?: "dev" | "prod" | null;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export type Notification = NotificationForApproval | NotificationForSuggestNextSteps;
|
|
94
|
+
export declare function isApprovalNotification(notification: Notification): notification is NotificationForApproval;
|
|
95
|
+
export declare function isSuggestNextStepsNotification(notification: Notification): notification is NotificationForSuggestNextSteps;
|
|
71
96
|
export interface PublicUsername {
|
|
72
97
|
username: string;
|
|
73
98
|
slug: string;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
// NotificationType is imported as a value (not `import type`) because the
|
|
2
|
+
// notification type guards below compare against its members at runtime.
|
|
3
|
+
import { NotificationType } from "./enums.js";
|
|
4
|
+
export function isApprovalNotification(notification) {
|
|
5
|
+
return notification.type === NotificationType.AGENT_TASK_REQUIRE_INPUT;
|
|
6
|
+
}
|
|
7
|
+
export function isSuggestNextStepsNotification(notification) {
|
|
8
|
+
return notification.type === NotificationType.AGENT_SUGGEST_NEXT_STEPS;
|
|
9
|
+
}
|
|
1
10
|
export var FrontendBuildStage;
|
|
2
11
|
(function (FrontendBuildStage) {
|
|
3
12
|
FrontendBuildStage["PROTOTYPE"] = "prototype";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Timestamp } from "firebase/firestore";
|
|
2
2
|
import type { RunMigrationsResponse } from "../db-api.js";
|
|
3
|
-
import type { CreateNeonTransferErrorCode, CreateProjectErrorCode, CreateStackAuthTransferErrorCode, CreateTeamAccountErrorCode, MigrateToRiffErrorCode } from "./enums.js";
|
|
3
|
+
import type { CreateNeonTransferErrorCode, CreateProjectErrorCode, CreateStackAuthTransferErrorCode, CreateTeamAccountErrorCode, MigrateToRiffErrorCode, NotificationType } from "./enums.js";
|
|
4
4
|
import type { ApprovalLevel, Datafile, Dataframe, Job, Project, ProjectPermissionName, ProjectTemplate, ScheduleTarget, ScheduleWhen } from "./persisted.js";
|
|
5
5
|
export type DeleteJob = Pick<Job, "markedForDeletionAt" | "markedForDeletionBy">;
|
|
6
6
|
export type DeleteProject = Pick<Project, "markedForDeletionAt" | "markedForDeletionBy">;
|
|
@@ -575,21 +575,29 @@ export type RegisterSlackAppResponse = {
|
|
|
575
575
|
errorCode: string;
|
|
576
576
|
errorMessage?: string;
|
|
577
577
|
};
|
|
578
|
-
|
|
578
|
+
/**
|
|
579
|
+
* Request for the single agent-notification callable. `type` selects the
|
|
580
|
+
* notification kind (defaults to AGENT_TASK_REQUIRE_INPUT / approval when
|
|
581
|
+
* omitted). Type-specific fields are optional: approval uses `toolName` /
|
|
582
|
+
* `reason` / `messageSequence` / `toolUseId`; suggest-next-steps uses `message`.
|
|
583
|
+
*/
|
|
584
|
+
export type CreateNotificationRequest = {
|
|
585
|
+
type?: NotificationType | null;
|
|
579
586
|
projectId: string;
|
|
580
587
|
accountId: string;
|
|
581
588
|
userId: string | null;
|
|
582
|
-
toolName: string;
|
|
583
589
|
sessionId: string;
|
|
584
|
-
messageSequence?: string | null;
|
|
585
|
-
toolUseId?: string | null;
|
|
586
590
|
taskId?: string | null;
|
|
587
591
|
displayId?: string | null;
|
|
588
|
-
reason?: string | null;
|
|
589
592
|
taskTitle?: string | null;
|
|
590
593
|
environment?: "dev" | "prod" | null;
|
|
594
|
+
toolName?: string | null;
|
|
595
|
+
reason?: string | null;
|
|
596
|
+
messageSequence?: string | null;
|
|
597
|
+
toolUseId?: string | null;
|
|
598
|
+
message?: string | null;
|
|
591
599
|
};
|
|
592
|
-
export type
|
|
600
|
+
export type CreateNotificationResponse = {
|
|
593
601
|
notificationId: string;
|
|
594
602
|
};
|
|
595
603
|
export {};
|