aicodeswitch 5.1.3 → 5.2.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.
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KeyResolver = void 0;
4
+ class KeyResolver {
5
+ constructor(keyManager, policyManager) {
6
+ Object.defineProperty(this, "keyManager", {
7
+ enumerable: true,
8
+ configurable: true,
9
+ writable: true,
10
+ value: void 0
11
+ });
12
+ Object.defineProperty(this, "policyManager", {
13
+ enumerable: true,
14
+ configurable: true,
15
+ writable: true,
16
+ value: void 0
17
+ });
18
+ this.keyManager = keyManager;
19
+ this.policyManager = policyManager;
20
+ }
21
+ /**
22
+ * 尝试解析请求中的 API Key
23
+ * @returns 如果是 sk_ 开头的 Key,尝试解析;否则返回 null(走现有流程)
24
+ */
25
+ resolve(apiKeyValue) {
26
+ if (!apiKeyValue.startsWith('sk_')) {
27
+ return null; // 不是 AccessKey,走现有流程
28
+ }
29
+ // 查找 AccessKey
30
+ const accessKey = this.keyManager.findByApiKey(apiKeyValue);
31
+ if (!accessKey) {
32
+ return { error: { type: 'authentication_error', code: 'INVALID_API_KEY', message: '无效的 API Key', httpStatus: 401 } };
33
+ }
34
+ // 状态检查
35
+ if (accessKey.status !== 'active') {
36
+ return { error: { type: 'permission_error', code: 'KEY_DISABLED', message: '密钥已停用', httpStatus: 403 } };
37
+ }
38
+ // 策略检查
39
+ if (!accessKey.policyId) {
40
+ return { error: { type: 'permission_error', code: 'NO_POLICY_CONFIGURED', message: '密钥未配置策略', httpStatus: 403 } };
41
+ }
42
+ const policy = this.policyManager.get(accessKey.policyId);
43
+ if (!policy) {
44
+ return { error: { type: 'permission_error', code: 'POLICY_NOT_FOUND', message: '策略不存在', httpStatus: 403 } };
45
+ }
46
+ // 更新最后活跃时间
47
+ this.keyManager.updateLastActive(accessKey.id);
48
+ return { accessKey, policy };
49
+ }
50
+ }
51
+ exports.KeyResolver = KeyResolver;
@@ -0,0 +1,217 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.KeySessionTracker = void 0;
16
+ /**
17
+ * Key 级会话追踪器
18
+ * 每个 AccessKey 有独立的会话存储空间,与全局会话系统完全隔离
19
+ */
20
+ const path_1 = __importDefault(require("path"));
21
+ const promises_1 = __importDefault(require("fs/promises"));
22
+ class KeySessionTracker {
23
+ constructor(dataPath) {
24
+ Object.defineProperty(this, "dataPath", {
25
+ enumerable: true,
26
+ configurable: true,
27
+ writable: true,
28
+ value: void 0
29
+ });
30
+ /** 内存缓存 keyId → AccessKeySession[] */
31
+ Object.defineProperty(this, "cache", {
32
+ enumerable: true,
33
+ configurable: true,
34
+ writable: true,
35
+ value: new Map()
36
+ });
37
+ /** 写入锁 */
38
+ Object.defineProperty(this, "writeLocks", {
39
+ enumerable: true,
40
+ configurable: true,
41
+ writable: true,
42
+ value: new Map()
43
+ });
44
+ this.dataPath = dataPath;
45
+ }
46
+ /** 初始化 */
47
+ initialize() {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ const sessionsDir = path_1.default.join(this.dataPath, 'key-sessions');
50
+ yield promises_1.default.mkdir(sessionsDir, { recursive: true });
51
+ });
52
+ }
53
+ /** 创建或更新会话 */
54
+ upsertSession(keyId, session) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ return this.withWriteLock(keyId, () => __awaiter(this, void 0, void 0, function* () {
57
+ const sessions = yield this.loadSessions(keyId);
58
+ const existing = sessions.find(s => s.id === session.id);
59
+ if (existing) {
60
+ // 更新已有会话
61
+ existing.requestCount += 1;
62
+ existing.totalTokens += session.totalTokens;
63
+ existing.lastRequestAt = session.lastRequestAt;
64
+ // 更新供应商/服务/模型信息为最新
65
+ if (session.vendorId)
66
+ existing.vendorId = session.vendorId;
67
+ if (session.vendorName)
68
+ existing.vendorName = session.vendorName;
69
+ if (session.serviceId)
70
+ existing.serviceId = session.serviceId;
71
+ if (session.serviceName)
72
+ existing.serviceName = session.serviceName;
73
+ if (session.model)
74
+ existing.model = session.model;
75
+ // 标题仅在新会话时设置(保留第一次的标题)
76
+ }
77
+ else {
78
+ // 创建新会话
79
+ sessions.push({
80
+ id: session.id,
81
+ targetType: session.targetType,
82
+ title: session.title,
83
+ firstRequestAt: session.firstRequestAt,
84
+ lastRequestAt: session.lastRequestAt,
85
+ requestCount: 1,
86
+ totalTokens: session.totalTokens,
87
+ vendorId: session.vendorId,
88
+ vendorName: session.vendorName,
89
+ serviceId: session.serviceId,
90
+ serviceName: session.serviceName,
91
+ model: session.model,
92
+ });
93
+ }
94
+ yield this.saveSessions(keyId, sessions);
95
+ }));
96
+ });
97
+ }
98
+ /** 获取密钥的会话列表(支持过滤+分页) */
99
+ getSessions(keyId, options) {
100
+ return __awaiter(this, void 0, void 0, function* () {
101
+ const sessions = yield this.loadSessions(keyId);
102
+ // 过滤
103
+ let filtered = sessions;
104
+ if (options.targetType) {
105
+ filtered = filtered.filter(s => s.targetType === options.targetType);
106
+ }
107
+ if (options.search) {
108
+ const q = options.search.toLowerCase();
109
+ filtered = filtered.filter(s => (s.title && s.title.toLowerCase().includes(q)) ||
110
+ s.id.toLowerCase().includes(q));
111
+ }
112
+ // 按 lastRequestAt 降序
113
+ filtered.sort((a, b) => b.lastRequestAt - a.lastRequestAt);
114
+ const total = filtered.length;
115
+ const offset = (options.page - 1) * options.pageSize;
116
+ const data = filtered.slice(offset, offset + options.pageSize);
117
+ return { data, total };
118
+ });
119
+ }
120
+ /** 获取密钥的会话总数 */
121
+ getSessionsCount(keyId, targetType) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ const sessions = yield this.loadSessions(keyId);
124
+ if (!targetType)
125
+ return sessions.length;
126
+ return sessions.filter(s => s.targetType === targetType).length;
127
+ });
128
+ }
129
+ /** 获取单个会话 */
130
+ getSession(keyId, sessionId) {
131
+ return __awaiter(this, void 0, void 0, function* () {
132
+ const sessions = yield this.loadSessions(keyId);
133
+ return sessions.find(s => s.id === sessionId) || null;
134
+ });
135
+ }
136
+ /** 删除单个会话 */
137
+ deleteSession(keyId, sessionId) {
138
+ return __awaiter(this, void 0, void 0, function* () {
139
+ let deleted = false;
140
+ yield this.withWriteLock(keyId, () => __awaiter(this, void 0, void 0, function* () {
141
+ const sessions = yield this.loadSessions(keyId);
142
+ const index = sessions.findIndex(s => s.id === sessionId);
143
+ if (index === -1)
144
+ return;
145
+ sessions.splice(index, 1);
146
+ deleted = true;
147
+ yield this.saveSessions(keyId, sessions);
148
+ }));
149
+ return deleted;
150
+ });
151
+ }
152
+ /** 清空密钥的所有会话 */
153
+ clearSessions(keyId) {
154
+ return __awaiter(this, void 0, void 0, function* () {
155
+ return this.withWriteLock(keyId, () => __awaiter(this, void 0, void 0, function* () {
156
+ this.cache.set(keyId, []);
157
+ yield this.saveSessions(keyId, []);
158
+ }));
159
+ });
160
+ }
161
+ // ---- helpers ----
162
+ getKeySessionDir(keyId) {
163
+ return path_1.default.join(this.dataPath, 'key-sessions', keyId);
164
+ }
165
+ getKeySessionFilePath(keyId) {
166
+ return path_1.default.join(this.getKeySessionDir(keyId), 'sessions.json');
167
+ }
168
+ loadSessions(keyId) {
169
+ return __awaiter(this, void 0, void 0, function* () {
170
+ if (this.cache.has(keyId)) {
171
+ return this.cache.get(keyId);
172
+ }
173
+ try {
174
+ const filePath = this.getKeySessionFilePath(keyId);
175
+ const data = yield promises_1.default.readFile(filePath, 'utf-8');
176
+ const sessions = JSON.parse(data);
177
+ this.cache.set(keyId, sessions);
178
+ return sessions;
179
+ }
180
+ catch (_a) {
181
+ const sessions = [];
182
+ this.cache.set(keyId, sessions);
183
+ return sessions;
184
+ }
185
+ });
186
+ }
187
+ saveSessions(keyId, sessions) {
188
+ return __awaiter(this, void 0, void 0, function* () {
189
+ this.cache.set(keyId, sessions);
190
+ const dir = this.getKeySessionDir(keyId);
191
+ yield promises_1.default.mkdir(dir, { recursive: true });
192
+ const filePath = this.getKeySessionFilePath(keyId);
193
+ const tmpPath = filePath + '.tmp';
194
+ yield promises_1.default.writeFile(tmpPath, JSON.stringify(sessions, null, 2), 'utf-8');
195
+ yield promises_1.default.rename(tmpPath, filePath);
196
+ });
197
+ }
198
+ withWriteLock(keyId, fn) {
199
+ return __awaiter(this, void 0, void 0, function* () {
200
+ // 等待现有写入完成
201
+ while (this.writeLocks.has(keyId)) {
202
+ yield this.writeLocks.get(keyId);
203
+ }
204
+ const writePromise = (() => __awaiter(this, void 0, void 0, function* () {
205
+ try {
206
+ yield fn();
207
+ }
208
+ finally {
209
+ this.writeLocks.delete(keyId);
210
+ }
211
+ }))();
212
+ this.writeLocks.set(keyId, writePromise);
213
+ yield writePromise;
214
+ });
215
+ }
216
+ }
217
+ exports.KeySessionTracker = KeySessionTracker;
@@ -0,0 +1,206 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AccessKeyManager = void 0;
7
+ /**
8
+ * AccessKey 管理器
9
+ * 负责接入密钥的 CRUD 操作
10
+ */
11
+ const crypto_1 = __importDefault(require("crypto"));
12
+ class AccessKeyManager {
13
+ constructor() {
14
+ Object.defineProperty(this, "keys", {
15
+ enumerable: true,
16
+ configurable: true,
17
+ writable: true,
18
+ value: []
19
+ });
20
+ /** apiKeyHash → AccessKey 索引,用于 O(1) 查找 */
21
+ Object.defineProperty(this, "hashIndex", {
22
+ enumerable: true,
23
+ configurable: true,
24
+ writable: true,
25
+ value: new Map()
26
+ });
27
+ }
28
+ /** 从持久化数据加载 */
29
+ load(data) {
30
+ this.keys = data;
31
+ this.rebuildIndex();
32
+ }
33
+ /** 导出用于持久化 */
34
+ dump() {
35
+ return this.keys;
36
+ }
37
+ /** 重建内存索引 */
38
+ rebuildIndex() {
39
+ this.hashIndex.clear();
40
+ for (const key of this.keys) {
41
+ this.hashIndex.set(key.apiKeyHash, key);
42
+ }
43
+ }
44
+ /** 通过 apiKeyHash 查找 AccessKey */
45
+ findByHash(hash) {
46
+ return this.hashIndex.get(hash);
47
+ }
48
+ /** 通过 apiKey 值查找 AccessKey(计算 hash 后查找) */
49
+ findByApiKey(apiKey) {
50
+ const hash = AccessKeyManager.hashApiKey(apiKey);
51
+ return this.hashIndex.get(hash);
52
+ }
53
+ /** 获取所有密钥列表 */
54
+ list(filters) {
55
+ let result = this.keys;
56
+ if (filters === null || filters === void 0 ? void 0 : filters.status) {
57
+ result = result.filter(k => k.status === filters.status);
58
+ }
59
+ if (filters === null || filters === void 0 ? void 0 : filters.policyId) {
60
+ result = result.filter(k => k.policyId === filters.policyId);
61
+ }
62
+ if (filters === null || filters === void 0 ? void 0 : filters.search) {
63
+ const q = filters.search.toLowerCase();
64
+ result = result.filter(k => k.name.toLowerCase().includes(q) ||
65
+ (k.remark && k.remark.toLowerCase().includes(q)));
66
+ }
67
+ return result;
68
+ }
69
+ /** 获取密钥详情 */
70
+ get(id) {
71
+ return this.keys.find(k => k.id === id);
72
+ }
73
+ /** 创建密钥 */
74
+ create(data) {
75
+ const apiKey = AccessKeyManager.generateApiKey();
76
+ const apiKeyHash = AccessKeyManager.hashApiKey(apiKey);
77
+ const now = Date.now();
78
+ const key = {
79
+ id: `key_${crypto_1.default.randomUUID().replace(/-/g, '').slice(0, 12)}`,
80
+ name: data.name,
81
+ remark: data.remark,
82
+ apiKey,
83
+ apiKeyHash,
84
+ policyId: data.policyId,
85
+ status: 'active',
86
+ createdAt: now,
87
+ updatedAt: now,
88
+ };
89
+ this.keys.push(key);
90
+ this.hashIndex.set(apiKeyHash, key);
91
+ return { key, apiKey };
92
+ }
93
+ /** 更新密钥 */
94
+ update(id, data) {
95
+ const key = this.keys.find(k => k.id === id);
96
+ if (!key)
97
+ return null;
98
+ if (data.name !== undefined)
99
+ key.name = data.name;
100
+ if (data.remark !== undefined)
101
+ key.remark = data.remark;
102
+ if (data.policyId !== undefined)
103
+ key.policyId = data.policyId;
104
+ if (data.status !== undefined)
105
+ key.status = data.status;
106
+ key.updatedAt = Date.now();
107
+ return key;
108
+ }
109
+ /** 删除密钥 */
110
+ delete(id) {
111
+ const index = this.keys.findIndex(k => k.id === id);
112
+ if (index === -1)
113
+ return false;
114
+ const key = this.keys[index];
115
+ this.hashIndex.delete(key.apiKeyHash);
116
+ this.keys.splice(index, 1);
117
+ return true;
118
+ }
119
+ /** 重新生成 API Key */
120
+ regenerate(id) {
121
+ const key = this.keys.find(k => k.id === id);
122
+ if (!key)
123
+ return null;
124
+ // 移除旧索引
125
+ this.hashIndex.delete(key.apiKeyHash);
126
+ // 生成新的
127
+ const apiKey = AccessKeyManager.generateApiKey();
128
+ const apiKeyHash = AccessKeyManager.hashApiKey(apiKey);
129
+ key.apiKey = apiKey;
130
+ key.apiKeyHash = apiKeyHash;
131
+ key.updatedAt = Date.now();
132
+ // 添加新索引
133
+ this.hashIndex.set(apiKeyHash, key);
134
+ return { apiKey, apiKeyHash };
135
+ }
136
+ /** 批量更新状态 */
137
+ batchUpdateStatus(keyIds, status) {
138
+ let count = 0;
139
+ for (const id of keyIds) {
140
+ const key = this.keys.find(k => k.id === id);
141
+ if (key) {
142
+ key.status = status;
143
+ key.updatedAt = Date.now();
144
+ count++;
145
+ }
146
+ }
147
+ return count;
148
+ }
149
+ /** 批量绑定策略 */
150
+ batchBindPolicy(keyIds, policyId) {
151
+ let count = 0;
152
+ for (const id of keyIds) {
153
+ const key = this.keys.find(k => k.id === id);
154
+ if (key) {
155
+ key.policyId = policyId;
156
+ key.updatedAt = Date.now();
157
+ count++;
158
+ }
159
+ }
160
+ return count;
161
+ }
162
+ /** 批量删除 */
163
+ batchDelete(keyIds) {
164
+ let count = 0;
165
+ for (const id of keyIds) {
166
+ const index = this.keys.findIndex(k => k.id === id);
167
+ if (index !== -1) {
168
+ const key = this.keys[index];
169
+ this.hashIndex.delete(key.apiKeyHash);
170
+ this.keys.splice(index, 1);
171
+ count++;
172
+ }
173
+ }
174
+ return count;
175
+ }
176
+ /** 更新最后活跃时间 */
177
+ updateLastActive(id) {
178
+ const key = this.keys.find(k => k.id === id);
179
+ if (key) {
180
+ key.lastActiveAt = Date.now();
181
+ }
182
+ }
183
+ /** 获取使用指定策略的密钥数量 */
184
+ countByPolicyId(policyId) {
185
+ return this.keys.filter(k => k.policyId === policyId).length;
186
+ }
187
+ /** 获取使用指定策略的密钥列表 */
188
+ listByPolicyId(policyId) {
189
+ return this.keys.filter(k => k.policyId === policyId);
190
+ }
191
+ /** 掩码化 API Key */
192
+ static maskApiKey(apiKey) {
193
+ if (apiKey.length <= 8)
194
+ return 'sk_****';
195
+ return apiKey.slice(0, 4) + '****' + apiKey.slice(-4);
196
+ }
197
+ /** 生成 sk_ 前缀的 API Key */
198
+ static generateApiKey() {
199
+ return 'sk_' + crypto_1.default.randomBytes(24).toString('hex');
200
+ }
201
+ /** 计算 API Key 的哈希值 */
202
+ static hashApiKey(apiKey) {
203
+ return crypto_1.default.createHash('sha256').update(apiKey).digest('hex').slice(0, 16);
204
+ }
205
+ }
206
+ exports.AccessKeyManager = AccessKeyManager;
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.PolicyManager = void 0;
18
+ /**
19
+ * Policy 策略管理器
20
+ * 负责策略的 CRUD 操作
21
+ */
22
+ const crypto_1 = __importDefault(require("crypto"));
23
+ class PolicyManager {
24
+ constructor() {
25
+ Object.defineProperty(this, "policies", {
26
+ enumerable: true,
27
+ configurable: true,
28
+ writable: true,
29
+ value: []
30
+ });
31
+ }
32
+ /** 从持久化数据加载 */
33
+ load(data) {
34
+ this.policies = data;
35
+ }
36
+ /** 导出用于持久化 */
37
+ dump() {
38
+ return this.policies;
39
+ }
40
+ /** 获取所有策略 */
41
+ list() {
42
+ return this.policies;
43
+ }
44
+ /** 获取策略详情 */
45
+ get(id) {
46
+ return this.policies.find(p => p.id === id);
47
+ }
48
+ /** 创建策略 */
49
+ create(data) {
50
+ const now = Date.now();
51
+ const policy = Object.assign(Object.assign({}, data), { id: `pol_${crypto_1.default.randomUUID().replace(/-/g, '').slice(0, 12)}`, createdAt: now, updatedAt: now });
52
+ this.policies.push(policy);
53
+ return policy;
54
+ }
55
+ /** 更新策略 */
56
+ update(id, data) {
57
+ const policy = this.policies.find(p => p.id === id);
58
+ if (!policy)
59
+ return null;
60
+ // 更新字段
61
+ const updatableFields = [
62
+ 'name', 'description', 'routeId',
63
+ 'dailyTokenLimit', 'weeklyTokenLimit', 'monthlyTokenLimit',
64
+ 'customTokenLimit', 'customTokenResetHours',
65
+ 'dailyRequestLimit', 'weeklyRequestLimit', 'monthlyRequestLimit',
66
+ 'customRequestLimit', 'customRequestResetHours',
67
+ 'rpmLimit', 'concurrentLimit',
68
+ 'allowedModels', 'blockedModels',
69
+ ];
70
+ for (const field of updatableFields) {
71
+ if (data[field] !== undefined) {
72
+ policy[field] = data[field];
73
+ }
74
+ }
75
+ policy.updatedAt = Date.now();
76
+ return policy;
77
+ }
78
+ /** 删除策略 */
79
+ delete(id) {
80
+ const index = this.policies.findIndex(p => p.id === id);
81
+ if (index === -1)
82
+ return false;
83
+ this.policies.splice(index, 1);
84
+ return true;
85
+ }
86
+ /** 复制策略 */
87
+ duplicate(id) {
88
+ const source = this.policies.find(p => p.id === id);
89
+ if (!source)
90
+ return null;
91
+ const { id: _id, createdAt: _ca, updatedAt: _ua } = source, rest = __rest(source, ["id", "createdAt", "updatedAt"]);
92
+ return this.create(Object.assign(Object.assign({}, rest), { name: `${source.name} (副本)` }));
93
+ }
94
+ /** 获取策略预览信息 */
95
+ getPreview(id) {
96
+ const policy = this.policies.find(p => p.id === id);
97
+ if (!policy)
98
+ return null;
99
+ return { policy };
100
+ }
101
+ /** 获取预置策略模板 */
102
+ static getTemplates() {
103
+ return [
104
+ {
105
+ name: '不限策略',
106
+ description: '不限制任何用量,适合信任用户',
107
+ config: { name: '不限策略' },
108
+ },
109
+ {
110
+ name: '轻度限制',
111
+ description: '月 Token 限额 5000k,日请求 500 次',
112
+ config: {
113
+ name: '轻度限制',
114
+ monthlyTokenLimit: 5000,
115
+ dailyRequestLimit: 500,
116
+ },
117
+ },
118
+ {
119
+ name: '中度限制',
120
+ description: '月 Token 限额 2000k,日 Token 限额 200k,日请求 200 次,RPM 10',
121
+ config: {
122
+ name: '中度限制',
123
+ dailyTokenLimit: 200,
124
+ monthlyTokenLimit: 2000,
125
+ dailyRequestLimit: 200,
126
+ rpmLimit: 10,
127
+ },
128
+ },
129
+ {
130
+ name: '严格限制',
131
+ description: '月 Token 限额 500k,日 Token 限额 50k,日请求 50 次,RPM 5,并发 2',
132
+ config: {
133
+ name: '严格限制',
134
+ dailyTokenLimit: 50,
135
+ monthlyTokenLimit: 500,
136
+ dailyRequestLimit: 50,
137
+ rpmLimit: 5,
138
+ concurrentLimit: 2,
139
+ },
140
+ },
141
+ ];
142
+ }
143
+ }
144
+ exports.PolicyManager = PolicyManager;