@brimble/models 3.8.133 → 3.8.135
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/dist/agent-chat-file.d.ts +9 -0
- package/dist/agent-chat-file.js +17 -0
- package/dist/agent-chat-message.d.ts +9 -0
- package/dist/agent-chat-message.js +20 -0
- package/dist/agent-chat-model.d.ts +9 -0
- package/dist/agent-chat-model.js +16 -0
- package/dist/agent-chat.d.ts +9 -0
- package/dist/agent-chat.js +22 -0
- package/dist/enum/index.d.ts +9 -0
- package/dist/enum/index.js +12 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.js +13 -3
- package/dist/plan_configuration.js +4 -1
- package/dist/types/agent-chat-file.d.ts +14 -0
- package/dist/types/agent-chat-file.js +2 -0
- package/dist/types/agent-chat-message.d.ts +12 -0
- package/dist/types/agent-chat-message.js +2 -0
- package/dist/types/agent-chat-model.d.ts +12 -0
- package/dist/types/agent-chat-model.js +2 -0
- package/dist/types/agent-chat.d.ts +13 -0
- package/dist/types/agent-chat.js +2 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/plan_configuration.d.ts +3 -0
- package/dist/types/user.d.ts +1 -0
- package/dist/user.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IAgentChatFile } from "./types/agent-chat-file";
|
|
2
|
+
declare const _default: import("mongoose").Model<IAgentChatFile, {}, {}, {}, import("mongoose").Document<unknown, {}, IAgentChatFile, {}, import("mongoose").DefaultSchemaOptions> & IAgentChatFile & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IAgentChatFile>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const agentChatFileSchema = new mongoose_1.Schema({
|
|
5
|
+
chat_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "AgentChat", required: true },
|
|
6
|
+
message_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "AgentChatMessage", default: null },
|
|
7
|
+
user_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true },
|
|
8
|
+
filename: { type: String, required: true },
|
|
9
|
+
content_type: { type: String, required: true },
|
|
10
|
+
size: { type: Number, required: true },
|
|
11
|
+
s3_key: { type: String, required: true },
|
|
12
|
+
}, {
|
|
13
|
+
timestamps: { createdAt: "created_at", updatedAt: false },
|
|
14
|
+
collection: "agent_chat_files",
|
|
15
|
+
});
|
|
16
|
+
agentChatFileSchema.index({ chat_id: 1 });
|
|
17
|
+
exports.default = (0, mongoose_1.model)("AgentChatFile", agentChatFileSchema);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IAgentChatMessage } from "./types/agent-chat-message";
|
|
2
|
+
declare const _default: import("mongoose").Model<IAgentChatMessage, {}, {}, {}, import("mongoose").Document<unknown, {}, IAgentChatMessage, {}, import("mongoose").DefaultSchemaOptions> & IAgentChatMessage & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IAgentChatMessage>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const enum_1 = require("./enum");
|
|
5
|
+
const agentChatMessageSchema = new mongoose_1.Schema({
|
|
6
|
+
chat_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "AgentChat", required: true },
|
|
7
|
+
user_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true },
|
|
8
|
+
role: {
|
|
9
|
+
type: String,
|
|
10
|
+
enum: Object.values(enum_1.AGENT_CHAT_MESSAGE_ROLE),
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
13
|
+
content: { type: String, required: true },
|
|
14
|
+
model_id: { type: String, default: null },
|
|
15
|
+
}, {
|
|
16
|
+
timestamps: { createdAt: "created_at", updatedAt: false },
|
|
17
|
+
collection: "agent_chat_messages",
|
|
18
|
+
});
|
|
19
|
+
agentChatMessageSchema.index({ chat_id: 1, created_at: 1 });
|
|
20
|
+
exports.default = (0, mongoose_1.model)("AgentChatMessage", agentChatMessageSchema);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IAgentChatModel } from "./types/agent-chat-model";
|
|
2
|
+
declare const _default: import("mongoose").Model<IAgentChatModel, {}, {}, {}, import("mongoose").Document<unknown, {}, IAgentChatModel, {}, import("mongoose").DefaultSchemaOptions> & IAgentChatModel & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IAgentChatModel>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const agentChatModelSchema = new mongoose_1.Schema({
|
|
5
|
+
slug: { type: String, required: true, unique: true },
|
|
6
|
+
label: { type: String, required: true },
|
|
7
|
+
provider: { type: String, required: true },
|
|
8
|
+
gateway_model: { type: String, required: true },
|
|
9
|
+
is_default: { type: Boolean, required: true, default: false },
|
|
10
|
+
enabled: { type: Boolean, required: true, default: true },
|
|
11
|
+
sort_order: { type: Number, required: true, default: 0 },
|
|
12
|
+
}, {
|
|
13
|
+
timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
|
|
14
|
+
collection: "agent_chat_models",
|
|
15
|
+
});
|
|
16
|
+
exports.default = (0, mongoose_1.model)("AgentChatModel", agentChatModelSchema);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IAgentChat } from "./types/agent-chat";
|
|
2
|
+
declare const _default: import("mongoose").Model<IAgentChat, {}, {}, {}, import("mongoose").Document<unknown, {}, IAgentChat, {}, import("mongoose").DefaultSchemaOptions> & IAgentChat & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IAgentChat>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const enum_1 = require("./enum");
|
|
5
|
+
const agentChatSchema = new mongoose_1.Schema({
|
|
6
|
+
user_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true },
|
|
7
|
+
team_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "Team", default: null },
|
|
8
|
+
title: { type: String, required: true, default: "New chat" },
|
|
9
|
+
tokens_used: { type: Number, required: true, default: 0 },
|
|
10
|
+
status: {
|
|
11
|
+
type: String,
|
|
12
|
+
enum: Object.values(enum_1.AGENT_CHAT_STATUS),
|
|
13
|
+
required: true,
|
|
14
|
+
default: enum_1.AGENT_CHAT_STATUS.Active,
|
|
15
|
+
},
|
|
16
|
+
}, {
|
|
17
|
+
timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
|
|
18
|
+
collection: "agent_chats",
|
|
19
|
+
});
|
|
20
|
+
agentChatSchema.index({ user_id: 1, created_at: -1 });
|
|
21
|
+
agentChatSchema.index({ user_id: 1, team_id: 1, created_at: -1 });
|
|
22
|
+
exports.default = (0, mongoose_1.model)("AgentChat", agentChatSchema);
|
package/dist/enum/index.d.ts
CHANGED
|
@@ -484,3 +484,12 @@ export declare enum CouponRedemptionStatus {
|
|
|
484
484
|
Applied = "applied",
|
|
485
485
|
Reversed = "reversed"
|
|
486
486
|
}
|
|
487
|
+
export declare enum AGENT_CHAT_STATUS {
|
|
488
|
+
Active = "active",
|
|
489
|
+
LimitReached = "limit_reached"
|
|
490
|
+
}
|
|
491
|
+
export declare enum AGENT_CHAT_MESSAGE_ROLE {
|
|
492
|
+
User = "user",
|
|
493
|
+
Assistant = "assistant",
|
|
494
|
+
System = "system"
|
|
495
|
+
}
|
package/dist/enum/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.INVOICE_PAYMENT_STATUS = exports.INVOICE_STATUS = exports.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = exports.NomadDeploymentStatus = exports.DomainTransferStatus = exports.DomainTransferDirection = exports.DomainTransferProvider = exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SCALING_SOURCE = exports.SCALING_METRIC = exports.SCALING_STRATEGY = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.ServiceType = exports.VOLUME_BACKEND = exports.REGION_CONTINENT = exports.PERMISSION_TYPE = exports.ROLES = exports.DNS_CHANGE_SOURCE = exports.DNS_CHANGE_TYPE = exports.DNS_TYPE = exports.SERVER_STATUS = exports.OAUTH_PERMISSIONS = exports.SUBSCRIPTION_PLAN_TYPE = exports.SUBSCRIPTION_STATUS = exports.DrainEventType = exports.LogSource = exports.DrainStatus = exports.DrainType = exports.AlertEventStatus = exports.AlertChannelMode = exports.AlertRuleState = exports.AlertCondition = exports.AlertMetric = exports.PROJECT_STATUS = exports.CARD_TYPES = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.CONFIG_FILE_VISIBILITY = exports.ENVIRONMENT = exports.REQUEST_TYPE = exports.PROJECT_DISABLED_BY = exports.BUILD_DISABLED_BY = exports.SERVER_PROTOCOL = exports.GIT_TYPE = void 0;
|
|
4
|
-
exports.CouponRedemptionStatus = exports.CouponScope = exports.CouponDiscountType = exports.QUEST_TARGETLESS_REQUIREMENTS = exports.QUEST_CLAIM_REQUIREMENTS = exports.WorkbenchMode = exports.QuestRequirementType = exports.QuestEntity = exports.QuestCriterionType = exports.QuestRewardStatus = exports.RewardType = exports.EligibilityType = exports.ACTION_TO_MILESTONE = exports.QUEST_COUNTABLE_MILESTONES = exports.MilestoneType = exports.QualifyingActionType = exports.XRobotsTag = exports.XContentTypeOptions = exports.XFrameOptions = exports.StorageMigrationStatus = exports.StorageCredentialStatus = exports.StorageCredentialRole = exports.PlatformApiKeyStatus = exports.StorageTokenStatus = exports.StorageUploadStatus = exports.StorageBucketStatus = exports.RESTORE_STATUS = exports.WorkerRunTrigger = exports.WorkerRunStatus = exports.BACKUP_STATUS = exports.SANDBOX_SNAPSHOT_STATUS = exports.SANDBOX_EGRESS_MODE = exports.SANDBOX_DESTROY_REASON = exports.SANDBOX_STATUS = exports.SANDBOX_TEMPLATE = exports.INVOICE_TYPE = void 0;
|
|
4
|
+
exports.AGENT_CHAT_MESSAGE_ROLE = exports.AGENT_CHAT_STATUS = exports.CouponRedemptionStatus = exports.CouponScope = exports.CouponDiscountType = exports.QUEST_TARGETLESS_REQUIREMENTS = exports.QUEST_CLAIM_REQUIREMENTS = exports.WorkbenchMode = exports.QuestRequirementType = exports.QuestEntity = exports.QuestCriterionType = exports.QuestRewardStatus = exports.RewardType = exports.EligibilityType = exports.ACTION_TO_MILESTONE = exports.QUEST_COUNTABLE_MILESTONES = exports.MilestoneType = exports.QualifyingActionType = exports.XRobotsTag = exports.XContentTypeOptions = exports.XFrameOptions = exports.StorageMigrationStatus = exports.StorageCredentialStatus = exports.StorageCredentialRole = exports.PlatformApiKeyStatus = exports.StorageTokenStatus = exports.StorageUploadStatus = exports.StorageBucketStatus = exports.RESTORE_STATUS = exports.WorkerRunTrigger = exports.WorkerRunStatus = exports.BACKUP_STATUS = exports.SANDBOX_SNAPSHOT_STATUS = exports.SANDBOX_EGRESS_MODE = exports.SANDBOX_DESTROY_REASON = exports.SANDBOX_STATUS = exports.SANDBOX_TEMPLATE = exports.INVOICE_TYPE = void 0;
|
|
5
5
|
var GIT_TYPE;
|
|
6
6
|
(function (GIT_TYPE) {
|
|
7
7
|
GIT_TYPE["GITHUB"] = "GITHUB";
|
|
@@ -590,3 +590,14 @@ var CouponRedemptionStatus;
|
|
|
590
590
|
CouponRedemptionStatus["Applied"] = "applied";
|
|
591
591
|
CouponRedemptionStatus["Reversed"] = "reversed";
|
|
592
592
|
})(CouponRedemptionStatus || (exports.CouponRedemptionStatus = CouponRedemptionStatus = {}));
|
|
593
|
+
var AGENT_CHAT_STATUS;
|
|
594
|
+
(function (AGENT_CHAT_STATUS) {
|
|
595
|
+
AGENT_CHAT_STATUS["Active"] = "active";
|
|
596
|
+
AGENT_CHAT_STATUS["LimitReached"] = "limit_reached";
|
|
597
|
+
})(AGENT_CHAT_STATUS || (exports.AGENT_CHAT_STATUS = AGENT_CHAT_STATUS = {}));
|
|
598
|
+
var AGENT_CHAT_MESSAGE_ROLE;
|
|
599
|
+
(function (AGENT_CHAT_MESSAGE_ROLE) {
|
|
600
|
+
AGENT_CHAT_MESSAGE_ROLE["User"] = "user";
|
|
601
|
+
AGENT_CHAT_MESSAGE_ROLE["Assistant"] = "assistant";
|
|
602
|
+
AGENT_CHAT_MESSAGE_ROLE["System"] = "system";
|
|
603
|
+
})(AGENT_CHAT_MESSAGE_ROLE || (exports.AGENT_CHAT_MESSAGE_ROLE = AGENT_CHAT_MESSAGE_ROLE = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -91,8 +91,12 @@ export { default as QuestRewardIssuance } from "./quest-reward-issuance";
|
|
|
91
91
|
export { default as Coupon } from "./coupon";
|
|
92
92
|
export { default as CouponRedemption } from "./coupon-redemption";
|
|
93
93
|
export { default as Ticket } from "./ticket";
|
|
94
|
-
export {
|
|
95
|
-
export {
|
|
94
|
+
export { default as AgentChat } from "./agent-chat";
|
|
95
|
+
export { default as AgentChatMessage } from "./agent-chat-message";
|
|
96
|
+
export { default as AgentChatFile } from "./agent-chat-file";
|
|
97
|
+
export { default as AgentChatModel } from "./agent-chat-model";
|
|
98
|
+
export { IUser, IGit, IProject, IProjectAnalytics, IPreview, IProjectConnection, IProjectNetworkSettings, IRatelimit, RatelimitConfig, RateLimitZone, RateLimitMatcher, DistributedRateLimitConfig, IFollowing, IIntegration, IEnv, IServer, IDomain, IToken, IPlatformApiKey, IMember, ITeam, IInstalledIntegration, ILog, ISubscription, ICard, IPaymentMethod, IDns, IDnsChangeLog, IRole, IPermission, IMemberPermission, IWallet, IDbImage, IJob, ILicense, IPlanConfiguration, IAutoScalingGroup, IComputeChange, IRegion, IVolume, IFramework, BrimbleFrameworkType, ISettings, ILoadBalancerPort, IDomainRenewal, IDomainTransfer, IWebhookCategory, IWebhookEvent, IWebhookSetting, IIntention, IProvider, ICollabAnnotation, ICollabComment, ICollabAttachment, ICollabIntegration, ICollabSettings, ICollabShareToken, ICollabPushSubscription, IAppMessage, IInvoice, ITag, IProjectTagAssignment, ICashierSubscription, ICashierSubscriptionItem, IProjectEnvironment, IEnvironmentVariable, IProjectConfigFile, IActivityLog, IAlertRule, IAlertRuleState, IAlertEvent, IAlertNotificationResult, IDrain, IProjectDrainSubscription, IOwnershipTransfer, ISandbox, ISandboxSpecs, ISandboxActivity, ISandboxImage, ISandboxSize, ISandboxSnapshot, IBackupHistory, IRestoreHistory, IWorkerRun, ISandboxSnapshotUsageSegment, ISandboxSnapshotUsageSegmentCosts, ISandboxUsageSegment, ISandboxUsageSegmentCurrent, ISandboxUsageSegmentCosts, IVolumeUsageSegment, IVolumeUsageSegmentCosts, IPgBouncerUsageSegment, IPgBouncerUsageSegmentCosts, IObjectStorageUsageSegment, IObjectStorageUsageSegmentCosts, IObjectStorageUsageUnitsSummary, IIdempotencyRecord, IStorageBucket, IStorageObject, IStorageUpload, IStorageToken, IStorageCredential, IStorageMigration, StorageTokenPermission, StorageLifecycleRule, StorageCorsRule, StorageLifecycleRuleTransition, IStreak, IStreakMilestoneRef, IStreakEvent, IStreakDay, IStreakMilestone, IQuestCampaign, IQuestCriterion, IQuestRequirement, IQuestReward, IQuestParticipation, IQuestCriterionProgress, IQuestRewardIssuance, IQuestIssuedReward, ICoupon, ICouponRedemption, ITicket, IAgentChat, IAgentChatMessage, IAgentChatFile, IAgentChatModel, } from "./types";
|
|
99
|
+
export { GIT_TYPE, INTEGRATION_TYPES, INTEGRATION_PROVIDERS, OAUTH_PERMISSIONS, ENVIRONMENT, SERVER_STATUS, ROLES, SUBSCRIPTION_PLAN_TYPE, PROJECT_STATUS, AlertMetric, AlertCondition, AlertRuleState, AlertChannelMode, AlertEventStatus, DrainType, DrainStatus, LogSource, DrainEventType, SUBSCRIPTION_STATUS, CARD_TYPES, DNS_TYPE, DNS_CHANGE_TYPE, DNS_CHANGE_SOURCE, PERMISSION_TYPE, REQUEST_TYPE, ServiceType, SCALING_SOURCE, DatabaseEngine, JobStatus, LicenseStatus, REGION_CONTINENT, VOLUME_BACKEND, BUILD_DISABLED_BY, PROJECT_DISABLED_BY, SERVER_PROTOCOL, FrameworkApplicationType, DomainRenewalStatus, DomainTransferProvider, DomainTransferDirection, DomainTransferStatus, NomadDeploymentStatus, COLLAB_ANNOTATION_STATUS, COLLAB_INTEGRATION_TYPE, COLLAB_THEME, COLLAB_TOOLBAR_POSITION, INVOICE_STATUS, INVOICE_PAYMENT_STATUS, INVOICE_TYPE, SANDBOX_TEMPLATE, SANDBOX_STATUS, SANDBOX_DESTROY_REASON, SANDBOX_EGRESS_MODE, SANDBOX_SNAPSHOT_STATUS, BACKUP_STATUS, WorkerRunStatus, WorkerRunTrigger, RESTORE_STATUS, StorageBucketStatus, StorageUploadStatus, StorageTokenStatus, PlatformApiKeyStatus, StorageCredentialRole, StorageCredentialStatus, StorageMigrationStatus, XFrameOptions, XContentTypeOptions, XRobotsTag, QualifyingActionType, MilestoneType, QUEST_COUNTABLE_MILESTONES, ACTION_TO_MILESTONE, EligibilityType, RewardType, QuestRewardStatus, QuestCriterionType, QuestEntity, QuestRequirementType, QUEST_CLAIM_REQUIREMENTS, QUEST_TARGETLESS_REQUIREMENTS, WorkbenchMode, CouponDiscountType, CouponScope, CouponRedemptionStatus, CONFIG_FILE_VISIBILITY, AGENT_CHAT_STATUS, AGENT_CHAT_MESSAGE_ROLE, } from "./enum";
|
|
96
100
|
import mongoose from "mongoose";
|
|
97
101
|
export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
|
|
98
102
|
export declare const db: mongoose.Connection;
|
package/dist/index.js
CHANGED
|
@@ -13,9 +13,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.CollabShareToken = exports.CollabSettings = exports.CollabIntegration = exports.CollabComment = exports.CollabAnnotation = exports.Provider = exports.Intention = exports.WebhookSetting = exports.WebhookEvent = exports.WebhookCategory = exports.DomainTransfer = exports.DomainRenewal = exports.LoadBalancerPort = exports.Settings = exports.Framework = exports.Volume = exports.Region = exports.ComputeChange = exports.AutoScalingGroup = exports.PlanConfiguration = exports.Liscense = exports.Job = exports.DbImage = exports.Wallet = exports.Server = exports.Card = exports.Subscription = exports.Log = exports.Role = exports.MemberPermission = exports.PaymentMethod = exports.Permission = exports.Member = exports.Team = exports.PlatformApiKey = exports.Token = exports.Env = exports.DnsChangeLog = exports.Dns = exports.Domain = exports.Integration = exports.Following = exports.Ratelimit = exports.ProjectNetworkSettings = exports.ProjectConnection = exports.Preview = exports.ProjectAnalytics = exports.DeletedProject = exports.Project = exports.User = void 0;
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.CONFIG_FILE_VISIBILITY = exports.CouponRedemptionStatus = exports.CouponScope = exports.CouponDiscountType = exports.WorkbenchMode = exports.QUEST_TARGETLESS_REQUIREMENTS = exports.QUEST_CLAIM_REQUIREMENTS = exports.QuestRequirementType = exports.QuestEntity = exports.QuestCriterionType = exports.QuestRewardStatus = exports.RewardType = exports.EligibilityType = exports.ACTION_TO_MILESTONE = exports.QUEST_COUNTABLE_MILESTONES = exports.MilestoneType = exports.QualifyingActionType = exports.XRobotsTag = exports.XContentTypeOptions = exports.XFrameOptions = exports.StorageMigrationStatus = exports.StorageCredentialStatus = exports.StorageCredentialRole = exports.PlatformApiKeyStatus = exports.StorageTokenStatus = exports.StorageUploadStatus = exports.StorageBucketStatus = exports.RESTORE_STATUS = exports.WorkerRunTrigger = exports.WorkerRunStatus = exports.BACKUP_STATUS = exports.SANDBOX_SNAPSHOT_STATUS = exports.SANDBOX_EGRESS_MODE = void 0;
|
|
16
|
+
exports.AgentChat = exports.Ticket = exports.CouponRedemption = exports.Coupon = exports.QuestRewardIssuance = exports.QuestParticipation = exports.QuestCampaign = exports.StreakMilestone = exports.StreakDay = exports.StreakEvent = exports.Streak = exports.StorageMigration = exports.StorageCredential = exports.StorageToken = exports.StorageUpload = exports.StorageObject = exports.StorageBucket = exports.IdempotencyRecord = exports.ObjectStorageUsageSegment = exports.PgBouncerUsageSegment = exports.VolumeUsageSegment = exports.SandboxUsageSegment = exports.SandboxSnapshotUsageSegment = exports.WorkerRun = exports.RestoreHistory = exports.BackupHistory = exports.SandboxSnapshot = exports.SandboxWarmPoolMember = exports.SandboxWarmPool = exports.SandboxSize = exports.SandboxImage = exports.SandboxActivity = exports.Sandbox = exports.OwnershipTransfer = exports.ProjectDrainSubscription = exports.Drain = exports.AlertEvent = exports.AlertRuleStateModel = exports.AlertRule = exports.ActivityLog = exports.ProjectConfigFile = exports.EnvironmentVariable = exports.ProjectEnvironment = exports.CashierSubscriptionItem = exports.CashierSubscription = exports.ProjectTagAssignment = exports.Tag = exports.Invoice = exports.AppMessage = exports.CollabPushSubscription = void 0;
|
|
17
|
+
exports.INVOICE_PAYMENT_STATUS = exports.INVOICE_STATUS = exports.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = exports.NomadDeploymentStatus = exports.DomainTransferStatus = exports.DomainTransferDirection = exports.DomainTransferProvider = exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SERVER_PROTOCOL = exports.PROJECT_DISABLED_BY = exports.BUILD_DISABLED_BY = exports.VOLUME_BACKEND = exports.REGION_CONTINENT = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.SCALING_SOURCE = exports.ServiceType = exports.REQUEST_TYPE = exports.PERMISSION_TYPE = exports.DNS_CHANGE_SOURCE = exports.DNS_CHANGE_TYPE = exports.DNS_TYPE = exports.CARD_TYPES = exports.SUBSCRIPTION_STATUS = exports.DrainEventType = exports.LogSource = exports.DrainStatus = exports.DrainType = exports.AlertEventStatus = exports.AlertChannelMode = exports.AlertRuleState = exports.AlertCondition = exports.AlertMetric = exports.PROJECT_STATUS = exports.SUBSCRIPTION_PLAN_TYPE = exports.ROLES = exports.SERVER_STATUS = exports.ENVIRONMENT = exports.OAUTH_PERMISSIONS = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.GIT_TYPE = exports.AgentChatModel = exports.AgentChatFile = exports.AgentChatMessage = void 0;
|
|
18
|
+
exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.AGENT_CHAT_MESSAGE_ROLE = exports.AGENT_CHAT_STATUS = exports.CONFIG_FILE_VISIBILITY = exports.CouponRedemptionStatus = exports.CouponScope = exports.CouponDiscountType = exports.WorkbenchMode = exports.QUEST_TARGETLESS_REQUIREMENTS = exports.QUEST_CLAIM_REQUIREMENTS = exports.QuestRequirementType = exports.QuestEntity = exports.QuestCriterionType = exports.QuestRewardStatus = exports.RewardType = exports.EligibilityType = exports.ACTION_TO_MILESTONE = exports.QUEST_COUNTABLE_MILESTONES = exports.MilestoneType = exports.QualifyingActionType = exports.XRobotsTag = exports.XContentTypeOptions = exports.XFrameOptions = exports.StorageMigrationStatus = exports.StorageCredentialStatus = exports.StorageCredentialRole = exports.PlatformApiKeyStatus = exports.StorageTokenStatus = exports.StorageUploadStatus = exports.StorageBucketStatus = exports.RESTORE_STATUS = exports.WorkerRunTrigger = exports.WorkerRunStatus = exports.BACKUP_STATUS = exports.SANDBOX_SNAPSHOT_STATUS = exports.SANDBOX_EGRESS_MODE = exports.SANDBOX_DESTROY_REASON = exports.SANDBOX_STATUS = exports.SANDBOX_TEMPLATE = exports.INVOICE_TYPE = void 0;
|
|
19
19
|
var user_1 = require("./user");
|
|
20
20
|
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return __importDefault(user_1).default; } });
|
|
21
21
|
var project_1 = require("./project");
|
|
@@ -208,6 +208,14 @@ var coupon_redemption_1 = require("./coupon-redemption");
|
|
|
208
208
|
Object.defineProperty(exports, "CouponRedemption", { enumerable: true, get: function () { return __importDefault(coupon_redemption_1).default; } });
|
|
209
209
|
var ticket_1 = require("./ticket");
|
|
210
210
|
Object.defineProperty(exports, "Ticket", { enumerable: true, get: function () { return __importDefault(ticket_1).default; } });
|
|
211
|
+
var agent_chat_1 = require("./agent-chat");
|
|
212
|
+
Object.defineProperty(exports, "AgentChat", { enumerable: true, get: function () { return __importDefault(agent_chat_1).default; } });
|
|
213
|
+
var agent_chat_message_1 = require("./agent-chat-message");
|
|
214
|
+
Object.defineProperty(exports, "AgentChatMessage", { enumerable: true, get: function () { return __importDefault(agent_chat_message_1).default; } });
|
|
215
|
+
var agent_chat_file_1 = require("./agent-chat-file");
|
|
216
|
+
Object.defineProperty(exports, "AgentChatFile", { enumerable: true, get: function () { return __importDefault(agent_chat_file_1).default; } });
|
|
217
|
+
var agent_chat_model_1 = require("./agent-chat-model");
|
|
218
|
+
Object.defineProperty(exports, "AgentChatModel", { enumerable: true, get: function () { return __importDefault(agent_chat_model_1).default; } });
|
|
211
219
|
var enum_1 = require("./enum");
|
|
212
220
|
Object.defineProperty(exports, "GIT_TYPE", { enumerable: true, get: function () { return enum_1.GIT_TYPE; } });
|
|
213
221
|
Object.defineProperty(exports, "INTEGRATION_TYPES", { enumerable: true, get: function () { return enum_1.INTEGRATION_TYPES; } });
|
|
@@ -293,6 +301,8 @@ Object.defineProperty(exports, "CouponDiscountType", { enumerable: true, get: fu
|
|
|
293
301
|
Object.defineProperty(exports, "CouponScope", { enumerable: true, get: function () { return enum_1.CouponScope; } });
|
|
294
302
|
Object.defineProperty(exports, "CouponRedemptionStatus", { enumerable: true, get: function () { return enum_1.CouponRedemptionStatus; } });
|
|
295
303
|
Object.defineProperty(exports, "CONFIG_FILE_VISIBILITY", { enumerable: true, get: function () { return enum_1.CONFIG_FILE_VISIBILITY; } });
|
|
304
|
+
Object.defineProperty(exports, "AGENT_CHAT_STATUS", { enumerable: true, get: function () { return enum_1.AGENT_CHAT_STATUS; } });
|
|
305
|
+
Object.defineProperty(exports, "AGENT_CHAT_MESSAGE_ROLE", { enumerable: true, get: function () { return enum_1.AGENT_CHAT_MESSAGE_ROLE; } });
|
|
296
306
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
297
307
|
const utils_1 = require("@brimble/utils");
|
|
298
308
|
const connectToMongo = (mongoUrl, config) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -65,6 +65,9 @@ const PlanConfigurationSchema = new mongoose_1.Schema({
|
|
|
65
65
|
sandbox_max_volume_size_gb: { type: Number, default: 0 },
|
|
66
66
|
sandbox_max_volumes: { type: Number, default: 0 },
|
|
67
67
|
backup_storage_gb_threshold: { type: Number, default: 10 },
|
|
68
|
-
backup_retention_days: { type: Number, default: 30 }
|
|
68
|
+
backup_retention_days: { type: Number, default: 30 },
|
|
69
|
+
agent_chat_enabled: { type: Boolean, default: false },
|
|
70
|
+
agent_chat_tokens_per_session: { type: Number, default: 0 },
|
|
71
|
+
agent_chats_per_day: { type: Number, default: 0 },
|
|
69
72
|
}, { timestamps: true });
|
|
70
73
|
exports.default = (0, mongoose_1.model)("PlanConfigurations", PlanConfigurationSchema, "plan_configurations");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
import { IAgentChat } from "./agent-chat";
|
|
3
|
+
import { IAgentChatMessage } from "./agent-chat-message";
|
|
4
|
+
import { IUser } from "./user";
|
|
5
|
+
export interface IAgentChatFile extends Document {
|
|
6
|
+
chat_id: IAgentChat | Types.ObjectId;
|
|
7
|
+
message_id: IAgentChatMessage | Types.ObjectId | null;
|
|
8
|
+
user_id: IUser | Types.ObjectId;
|
|
9
|
+
filename: string;
|
|
10
|
+
content_type: string;
|
|
11
|
+
size: number;
|
|
12
|
+
s3_key: string;
|
|
13
|
+
created_at: Date;
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
import { AGENT_CHAT_MESSAGE_ROLE } from "../enum";
|
|
3
|
+
import { IAgentChat } from "./agent-chat";
|
|
4
|
+
import { IUser } from "./user";
|
|
5
|
+
export interface IAgentChatMessage extends Document {
|
|
6
|
+
chat_id: IAgentChat | Types.ObjectId;
|
|
7
|
+
user_id: IUser | Types.ObjectId;
|
|
8
|
+
role: AGENT_CHAT_MESSAGE_ROLE;
|
|
9
|
+
content: string;
|
|
10
|
+
model_id: string | null;
|
|
11
|
+
created_at: Date;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
export interface IAgentChatModel extends Document {
|
|
3
|
+
slug: string;
|
|
4
|
+
label: string;
|
|
5
|
+
provider: string;
|
|
6
|
+
gateway_model: string;
|
|
7
|
+
is_default: boolean;
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
sort_order: number;
|
|
10
|
+
created_at: Date;
|
|
11
|
+
updated_at: Date;
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
import { AGENT_CHAT_STATUS } from "../enum";
|
|
3
|
+
import { ITeam } from "./team";
|
|
4
|
+
import { IUser } from "./user";
|
|
5
|
+
export interface IAgentChat extends Document {
|
|
6
|
+
user_id: IUser | Types.ObjectId;
|
|
7
|
+
team_id: ITeam | Types.ObjectId | null;
|
|
8
|
+
title: string;
|
|
9
|
+
tokens_used: number;
|
|
10
|
+
status: AGENT_CHAT_STATUS;
|
|
11
|
+
created_at: Date;
|
|
12
|
+
updated_at: Date;
|
|
13
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -90,3 +90,7 @@ export type { IStorageBucket, IStorageObject, IStorageUpload, IStorageToken, ISt
|
|
|
90
90
|
export type { ICoupon } from "./coupon";
|
|
91
91
|
export type { ICouponRedemption } from "./coupon-redemption";
|
|
92
92
|
export type { ITicket } from "./ticket";
|
|
93
|
+
export type { IAgentChat } from "./agent-chat";
|
|
94
|
+
export type { IAgentChatMessage } from "./agent-chat-message";
|
|
95
|
+
export type { IAgentChatFile } from "./agent-chat-file";
|
|
96
|
+
export type { IAgentChatModel } from "./agent-chat-model";
|
|
@@ -61,4 +61,7 @@ export interface IPlanConfiguration extends Document {
|
|
|
61
61
|
sandbox_max_volumes: number;
|
|
62
62
|
backup_storage_gb_threshold: number;
|
|
63
63
|
backup_retention_days: number;
|
|
64
|
+
agent_chat_enabled: boolean;
|
|
65
|
+
agent_chat_tokens_per_session: number;
|
|
66
|
+
agent_chats_per_day: number;
|
|
64
67
|
}
|
package/dist/types/user.d.ts
CHANGED
package/dist/user.js
CHANGED