teleton 0.7.5 → 0.8.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/README.md +35 -15
- package/dist/chunk-3RG5ZIWI.js +10 -0
- package/dist/{chunk-LCCVZ4D2.js → chunk-3S4GGLLR.js} +28 -26
- package/dist/{chunk-NUGDTPE4.js → chunk-4L66JHQE.js} +2 -1
- package/dist/{chunk-OGMVWDVU.js → chunk-5FNWBZ5K.js} +1826 -4992
- package/dist/{chunk-U7FQYCBQ.js → chunk-7TECSLJ4.js} +2 -2
- package/dist/{chunk-2GLHOJ5C.js → chunk-7U7BOHCL.js} +103 -36
- package/dist/{chunk-DMXTIRUW.js → chunk-AYWEJCDB.js} +20 -39
- package/dist/chunk-CGOXE4WP.js +11315 -0
- package/dist/{chunk-5UVXJMOX.js → chunk-KVXV7EF7.js} +4 -4
- package/dist/{chunk-QOQWUUA4.js → chunk-OJCLKU5Z.js} +68 -2
- package/dist/{chunk-CB2Y45HA.js → chunk-PHSAHTK4.js} +51 -3
- package/dist/{chunk-WIKM24GZ.js → chunk-QBHRXLZS.js} +5 -0
- package/dist/{chunk-OCLG5GKI.js → chunk-QV2GLOTK.js} +14 -3
- package/dist/{chunk-AVDWXYQ7.js → chunk-S6PHGKOC.js} +12 -1
- package/dist/{chunk-YP25WTQK.js → chunk-UP55PXFH.js} +6 -0
- package/dist/cli/index.js +21 -21
- package/dist/{client-O37XDCJB.js → client-MPHPIZB6.js} +4 -4
- package/dist/{get-my-gifts-TPVUGUWT.js → get-my-gifts-CC6HAVWB.js} +2 -2
- package/dist/index.js +14 -15
- package/dist/{memory-KQALFUV3.js → memory-UBHM7ILG.js} +5 -5
- package/dist/{migrate-UV3WEL5D.js → migrate-UBBEJ5BL.js} +5 -5
- package/dist/{multipart-parser-S3YC6NRJ.js → multipart-parser-UFQLJOV2.js} +2 -2
- package/dist/{paths-TMNTEDDD.js → paths-XA2RJH4S.js} +1 -1
- package/dist/{server-BHHJGUDF.js → server-3FHI2SEB.js} +398 -56
- package/dist/{setup-server-G7UG2DI3.js → setup-server-32XGDPE6.js} +161 -11
- package/dist/{store-H4XPNGC2.js → store-M5IMUQCL.js} +6 -6
- package/dist/{task-dependency-resolver-VMEVJRPO.js → task-dependency-resolver-RR2O5S7B.js} +3 -3
- package/dist/{task-executor-WWSPBJ4V.js → task-executor-6W5HRX5C.js} +3 -3
- package/dist/{tasks-QSCWSMPS.js → tasks-WQIKXDX5.js} +2 -2
- package/dist/{tool-adapter-Y3TCEQOC.js → tool-adapter-IH5VGBOO.js} +1 -1
- package/dist/{tool-index-2KH3OB6X.js → tool-index-PMAOXWUA.js} +9 -6
- package/dist/{transcript-UDJZP6NK.js → transcript-NGDPSNIH.js} +2 -2
- package/dist/web/assets/index-BfYCdwLI.js +80 -0
- package/dist/web/assets/{index-BrVqauzj.css → index-DmlyQVhR.css} +1 -1
- package/dist/web/assets/{index.es-Pet5-M13.js → index.es-DitvF-9H.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +12 -5
- package/dist/BigInteger-DQ33LTTE.js +0 -5
- package/dist/chunk-G2LLMJXJ.js +0 -5048
- package/dist/chunk-QGM4M3NI.js +0 -37
- package/dist/chunk-TSKJCWQQ.js +0 -1263
- package/dist/web/assets/index-Bx8JW3gV.js +0 -72
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDatabase
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7U7BOHCL.js";
|
|
4
4
|
import {
|
|
5
5
|
createLogger
|
|
6
6
|
} from "./chunk-RCMD3U65.js";
|
|
@@ -232,7 +232,7 @@ function shouldResetSession(session, policy) {
|
|
|
232
232
|
const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
233
233
|
const lastReset = session.lastResetDate || new Date(session.createdAt).toISOString().split("T")[0];
|
|
234
234
|
if (lastReset !== today) {
|
|
235
|
-
const currentHour = (/* @__PURE__ */ new Date()).
|
|
235
|
+
const currentHour = (/* @__PURE__ */ new Date()).getUTCHours();
|
|
236
236
|
const resetHour = policy.daily_reset_hour;
|
|
237
237
|
if (lastReset < today && currentHour >= resetHour) {
|
|
238
238
|
log.info(
|
|
@@ -255,8 +255,8 @@ function shouldResetSession(session, policy) {
|
|
|
255
255
|
}
|
|
256
256
|
return false;
|
|
257
257
|
}
|
|
258
|
-
function resetSessionWithPolicy(chatId,
|
|
259
|
-
|
|
258
|
+
function resetSessionWithPolicy(chatId, _policy) {
|
|
259
|
+
resetSession(chatId);
|
|
260
260
|
const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
261
261
|
return updateSession(chatId, {
|
|
262
262
|
lastResetDate: today
|
|
@@ -118,11 +118,11 @@ var MODEL_OPTIONS = {
|
|
|
118
118
|
{ value: "x-ai/grok-4", name: "Grok 4", description: "256K ctx, $3/M" }
|
|
119
119
|
],
|
|
120
120
|
moonshot: [
|
|
121
|
-
{ value: "
|
|
121
|
+
{ value: "k2p5", name: "Kimi K2.5", description: "Free, 262K ctx, multimodal" },
|
|
122
122
|
{
|
|
123
123
|
value: "kimi-k2-thinking",
|
|
124
124
|
name: "Kimi K2 Thinking",
|
|
125
|
-
description: "Free,
|
|
125
|
+
description: "Free, 262K ctx, reasoning"
|
|
126
126
|
}
|
|
127
127
|
],
|
|
128
128
|
mistral: [
|
|
@@ -146,6 +146,72 @@ var MODEL_OPTIONS = {
|
|
|
146
146
|
name: "Magistral Small",
|
|
147
147
|
description: "Reasoning, 128K ctx, $0.50/M"
|
|
148
148
|
}
|
|
149
|
+
],
|
|
150
|
+
cerebras: [
|
|
151
|
+
{
|
|
152
|
+
value: "qwen-3-235b-a22b-instruct-2507",
|
|
153
|
+
name: "Qwen 3 235B",
|
|
154
|
+
description: "131K ctx, $0.60/$1.20"
|
|
155
|
+
},
|
|
156
|
+
{ value: "gpt-oss-120b", name: "GPT OSS 120B", description: "Reasoning, 131K ctx, $0.25/M" },
|
|
157
|
+
{ value: "zai-glm-4.7", name: "ZAI GLM-4.7", description: "131K ctx, $2.25/M" },
|
|
158
|
+
{ value: "llama3.1-8b", name: "Llama 3.1 8B", description: "Fast & cheap, 32K ctx, $0.10/M" }
|
|
159
|
+
],
|
|
160
|
+
zai: [
|
|
161
|
+
{ value: "glm-4.7", name: "GLM-4.7", description: "204K ctx, $0.60/$2.20" },
|
|
162
|
+
{ value: "glm-5", name: "GLM-5", description: "Best quality, 204K ctx, $1.00/$3.20" },
|
|
163
|
+
{ value: "glm-4.6", name: "GLM-4.6", description: "204K ctx, $0.60/$2.20" },
|
|
164
|
+
{ value: "glm-4.7-flash", name: "GLM-4.7 Flash", description: "FREE, 200K ctx" },
|
|
165
|
+
{ value: "glm-4.5-flash", name: "GLM-4.5 Flash", description: "FREE, 131K ctx" },
|
|
166
|
+
{ value: "glm-4.5v", name: "GLM-4.5V", description: "Vision, 64K ctx, $0.60/$1.80" }
|
|
167
|
+
],
|
|
168
|
+
minimax: [
|
|
169
|
+
{ value: "MiniMax-M2.5", name: "MiniMax M2.5", description: "204K ctx, $0.30/$1.20" },
|
|
170
|
+
{
|
|
171
|
+
value: "MiniMax-M2.5-highspeed",
|
|
172
|
+
name: "MiniMax M2.5 Fast",
|
|
173
|
+
description: "204K ctx, $0.60/$2.40"
|
|
174
|
+
},
|
|
175
|
+
{ value: "MiniMax-M2.1", name: "MiniMax M2.1", description: "204K ctx, $0.30/$1.20" },
|
|
176
|
+
{ value: "MiniMax-M2", name: "MiniMax M2", description: "196K ctx, $0.30/$1.20" }
|
|
177
|
+
],
|
|
178
|
+
huggingface: [
|
|
179
|
+
{
|
|
180
|
+
value: "deepseek-ai/DeepSeek-V3.2",
|
|
181
|
+
name: "DeepSeek V3.2",
|
|
182
|
+
description: "163K ctx, $0.28/$0.40"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
value: "deepseek-ai/DeepSeek-R1-0528",
|
|
186
|
+
name: "DeepSeek R1",
|
|
187
|
+
description: "Reasoning, 163K ctx, $3/$5"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
value: "Qwen/Qwen3-235B-A22B-Thinking-2507",
|
|
191
|
+
name: "Qwen3 235B",
|
|
192
|
+
description: "Reasoning, 262K ctx, $0.30/$3"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
value: "Qwen/Qwen3-Coder-480B-A35B-Instruct",
|
|
196
|
+
name: "Qwen3 Coder 480B",
|
|
197
|
+
description: "Coding, 262K ctx, $2/$2"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
value: "Qwen/Qwen3-Next-80B-A3B-Instruct",
|
|
201
|
+
name: "Qwen3 Next 80B",
|
|
202
|
+
description: "262K ctx, $0.25/$1"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
value: "moonshotai/Kimi-K2.5",
|
|
206
|
+
name: "Kimi K2.5",
|
|
207
|
+
description: "262K ctx, $0.60/$3"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
value: "zai-org/GLM-4.7-Flash",
|
|
211
|
+
name: "GLM-4.7 Flash",
|
|
212
|
+
description: "FREE, 200K ctx"
|
|
213
|
+
},
|
|
214
|
+
{ value: "zai-org/GLM-5", name: "GLM-5", description: "202K ctx, $1/$3.20" }
|
|
149
215
|
]
|
|
150
216
|
};
|
|
151
217
|
function getModelsForProvider(provider) {
|
|
@@ -95,10 +95,10 @@ var PROVIDER_REGISTRY = {
|
|
|
95
95
|
keyPrefix: "sk-",
|
|
96
96
|
keyHint: "sk-...",
|
|
97
97
|
consoleUrl: "https://platform.moonshot.ai/",
|
|
98
|
-
defaultModel: "
|
|
99
|
-
utilityModel: "
|
|
98
|
+
defaultModel: "k2p5",
|
|
99
|
+
utilityModel: "k2p5",
|
|
100
100
|
toolLimit: 128,
|
|
101
|
-
piAiProvider: "
|
|
101
|
+
piAiProvider: "kimi-coding"
|
|
102
102
|
},
|
|
103
103
|
mistral: {
|
|
104
104
|
id: "mistral",
|
|
@@ -112,6 +112,54 @@ var PROVIDER_REGISTRY = {
|
|
|
112
112
|
toolLimit: 128,
|
|
113
113
|
piAiProvider: "mistral"
|
|
114
114
|
},
|
|
115
|
+
cerebras: {
|
|
116
|
+
id: "cerebras",
|
|
117
|
+
displayName: "Cerebras",
|
|
118
|
+
envVar: "CEREBRAS_API_KEY",
|
|
119
|
+
keyPrefix: "csk-",
|
|
120
|
+
keyHint: "csk-...",
|
|
121
|
+
consoleUrl: "https://cloud.cerebras.ai/",
|
|
122
|
+
defaultModel: "qwen-3-235b-a22b-instruct-2507",
|
|
123
|
+
utilityModel: "llama3.1-8b",
|
|
124
|
+
toolLimit: 128,
|
|
125
|
+
piAiProvider: "cerebras"
|
|
126
|
+
},
|
|
127
|
+
zai: {
|
|
128
|
+
id: "zai",
|
|
129
|
+
displayName: "ZAI (Zhipu)",
|
|
130
|
+
envVar: "ZAI_API_KEY",
|
|
131
|
+
keyPrefix: null,
|
|
132
|
+
keyHint: "...",
|
|
133
|
+
consoleUrl: "https://z.ai/manage-apikey/apikey-list",
|
|
134
|
+
defaultModel: "glm-4.7",
|
|
135
|
+
utilityModel: "glm-4.7-flash",
|
|
136
|
+
toolLimit: 128,
|
|
137
|
+
piAiProvider: "zai"
|
|
138
|
+
},
|
|
139
|
+
minimax: {
|
|
140
|
+
id: "minimax",
|
|
141
|
+
displayName: "MiniMax",
|
|
142
|
+
envVar: "MINIMAX_API_KEY",
|
|
143
|
+
keyPrefix: null,
|
|
144
|
+
keyHint: "Save your key \u2014 shown only once!",
|
|
145
|
+
consoleUrl: "https://platform.minimax.io/",
|
|
146
|
+
defaultModel: "MiniMax-M2.5",
|
|
147
|
+
utilityModel: "MiniMax-M2",
|
|
148
|
+
toolLimit: 128,
|
|
149
|
+
piAiProvider: "minimax"
|
|
150
|
+
},
|
|
151
|
+
huggingface: {
|
|
152
|
+
id: "huggingface",
|
|
153
|
+
displayName: "HuggingFace",
|
|
154
|
+
envVar: "HF_TOKEN",
|
|
155
|
+
keyPrefix: "hf_",
|
|
156
|
+
keyHint: "hf_...",
|
|
157
|
+
consoleUrl: "https://huggingface.co/settings/tokens",
|
|
158
|
+
defaultModel: "deepseek-ai/DeepSeek-V3.2",
|
|
159
|
+
utilityModel: "Qwen/Qwen3-Next-80B-A3B-Instruct",
|
|
160
|
+
toolLimit: 128,
|
|
161
|
+
piAiProvider: "huggingface"
|
|
162
|
+
},
|
|
115
163
|
cocoon: {
|
|
116
164
|
id: "cocoon",
|
|
117
165
|
displayName: "Cocoon Network (Decentralized)",
|
|
@@ -14,6 +14,7 @@ var CATALOG_CACHE_TTL_MS = 5 * 60 * 1e3;
|
|
|
14
14
|
function extractEmoji(sticker) {
|
|
15
15
|
if (!sticker?.attributes) return null;
|
|
16
16
|
const attr = sticker.attributes.find(
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- GramJS API response is untyped
|
|
17
18
|
(a) => a.className === "DocumentAttributeSticker" || a.className === "DocumentAttributeCustomEmoji"
|
|
18
19
|
);
|
|
19
20
|
return attr?.alt || null;
|
|
@@ -143,12 +144,15 @@ var telegramGetMyGiftsExecutor = async (params, context) => {
|
|
|
143
144
|
compactGift.slug = gift.slug;
|
|
144
145
|
compactGift.nftLink = `t.me/nft/${gift.slug}`;
|
|
145
146
|
const modelAttr = gift.attributes?.find(
|
|
147
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- GramJS API response is untyped
|
|
146
148
|
(a) => a.className === "StarGiftAttributeModel"
|
|
147
149
|
);
|
|
148
150
|
const patternAttr = gift.attributes?.find(
|
|
151
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- GramJS API response is untyped
|
|
149
152
|
(a) => a.className === "StarGiftAttributePattern"
|
|
150
153
|
);
|
|
151
154
|
const backdropAttr = gift.attributes?.find(
|
|
155
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- GramJS API response is untyped
|
|
152
156
|
(a) => a.className === "StarGiftAttributeBackdrop"
|
|
153
157
|
);
|
|
154
158
|
compactGift.model = extractAttrSummary(modelAttr);
|
|
@@ -183,6 +187,7 @@ var telegramGetMyGiftsExecutor = async (params, context) => {
|
|
|
183
187
|
limited: limited.length,
|
|
184
188
|
unlimited: unlimited.length,
|
|
185
189
|
collectibles: collectibles.length,
|
|
190
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- GramJS API response is untyped
|
|
186
191
|
canUpgrade: gifts.filter((g) => g.canUpgrade).length
|
|
187
192
|
},
|
|
188
193
|
totalCount: result.count
|
|
@@ -19,12 +19,13 @@ import {
|
|
|
19
19
|
import { join } from "path";
|
|
20
20
|
var log = createLogger("Session");
|
|
21
21
|
var SESSIONS_DIR = join(TELETON_ROOT, "sessions");
|
|
22
|
+
var transcriptCache = /* @__PURE__ */ new Map();
|
|
22
23
|
function getTranscriptPath(sessionId) {
|
|
23
24
|
return join(SESSIONS_DIR, `${sessionId}.jsonl`);
|
|
24
25
|
}
|
|
25
26
|
function ensureSessionsDir() {
|
|
26
27
|
if (!existsSync(SESSIONS_DIR)) {
|
|
27
|
-
mkdirSync(SESSIONS_DIR, { recursive: true });
|
|
28
|
+
mkdirSync(SESSIONS_DIR, { recursive: true, mode: 448 });
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
function appendToTranscript(sessionId, message) {
|
|
@@ -32,10 +33,14 @@ function appendToTranscript(sessionId, message) {
|
|
|
32
33
|
const transcriptPath = getTranscriptPath(sessionId);
|
|
33
34
|
const line = JSON.stringify(message) + "\n";
|
|
34
35
|
try {
|
|
35
|
-
appendFileSync(transcriptPath, line, "utf-8");
|
|
36
|
+
appendFileSync(transcriptPath, line, { encoding: "utf-8", mode: 384 });
|
|
36
37
|
} catch (error) {
|
|
37
38
|
log.error({ err: error }, `Failed to append to transcript ${sessionId}`);
|
|
38
39
|
}
|
|
40
|
+
const cached = transcriptCache.get(sessionId);
|
|
41
|
+
if (cached) {
|
|
42
|
+
cached.push(message);
|
|
43
|
+
}
|
|
39
44
|
}
|
|
40
45
|
function extractToolCallIds(msg) {
|
|
41
46
|
const ids = /* @__PURE__ */ new Set();
|
|
@@ -94,6 +99,8 @@ function sanitizeMessages(messages) {
|
|
|
94
99
|
return sanitized;
|
|
95
100
|
}
|
|
96
101
|
function readTranscript(sessionId) {
|
|
102
|
+
const cached = transcriptCache.get(sessionId);
|
|
103
|
+
if (cached) return [...cached];
|
|
97
104
|
const transcriptPath = getTranscriptPath(sessionId);
|
|
98
105
|
if (!existsSync(transcriptPath)) {
|
|
99
106
|
return [];
|
|
@@ -114,7 +121,9 @@ function readTranscript(sessionId) {
|
|
|
114
121
|
if (corruptCount > 0) {
|
|
115
122
|
log.warn(`${corruptCount} corrupt line(s) skipped in transcript ${sessionId}`);
|
|
116
123
|
}
|
|
117
|
-
|
|
124
|
+
const sanitized = sanitizeMessages(messages);
|
|
125
|
+
transcriptCache.set(sessionId, sanitized);
|
|
126
|
+
return sanitized;
|
|
118
127
|
} catch (error) {
|
|
119
128
|
log.error({ err: error }, `Failed to read transcript ${sessionId}`);
|
|
120
129
|
return [];
|
|
@@ -138,6 +147,7 @@ function deleteTranscript(sessionId) {
|
|
|
138
147
|
}
|
|
139
148
|
try {
|
|
140
149
|
unlinkSync(transcriptPath);
|
|
150
|
+
transcriptCache.delete(sessionId);
|
|
141
151
|
log.info(`Deleted transcript: ${sessionId}`);
|
|
142
152
|
return true;
|
|
143
153
|
} catch (error) {
|
|
@@ -154,6 +164,7 @@ function archiveTranscript(sessionId) {
|
|
|
154
164
|
}
|
|
155
165
|
try {
|
|
156
166
|
renameSync(transcriptPath, archivePath);
|
|
167
|
+
transcriptCache.delete(sessionId);
|
|
157
168
|
log.info(`Archived transcript: ${sessionId} \u2192 ${timestamp}.archived`);
|
|
158
169
|
return true;
|
|
159
170
|
} catch (error) {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-VFA7QMCZ.js";
|
|
5
5
|
import {
|
|
6
6
|
TELEGRAM_MAX_MESSAGE_LENGTH
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UP55PXFH.js";
|
|
8
8
|
import {
|
|
9
9
|
fetchWithTimeout
|
|
10
10
|
} from "./chunk-XQUHC3JZ.js";
|
|
@@ -260,6 +260,10 @@ var AgentConfigSchema = z.object({
|
|
|
260
260
|
"openrouter",
|
|
261
261
|
"moonshot",
|
|
262
262
|
"mistral",
|
|
263
|
+
"cerebras",
|
|
264
|
+
"zai",
|
|
265
|
+
"minimax",
|
|
266
|
+
"huggingface",
|
|
263
267
|
"cocoon",
|
|
264
268
|
"local"
|
|
265
269
|
]).default("anthropic"),
|
|
@@ -337,6 +341,12 @@ var _LoggingObject = z.object({
|
|
|
337
341
|
pretty: z.boolean().default(true).describe("Enable pino-pretty formatting (human-readable, colored output)")
|
|
338
342
|
});
|
|
339
343
|
var LoggingConfigSchema = _LoggingObject.default(_LoggingObject.parse({}));
|
|
344
|
+
var _TonProxyObject = z.object({
|
|
345
|
+
enabled: z.boolean().default(false).describe("Enable TON Proxy (Tonutils-Proxy) for .ton site access"),
|
|
346
|
+
port: z.number().min(1).max(65535).default(8080).describe("HTTP proxy port (default: 8080)"),
|
|
347
|
+
binary_path: z.string().optional().describe("Custom path to tonutils-proxy-cli binary (auto-downloaded if omitted)")
|
|
348
|
+
});
|
|
349
|
+
var TonProxyConfigSchema = _TonProxyObject.default(_TonProxyObject.parse({}));
|
|
340
350
|
var _DevObject = z.object({
|
|
341
351
|
hot_reload: z.boolean().default(false).describe("Enable plugin hot-reload (watches ~/.teleton/plugins/ for changes)")
|
|
342
352
|
});
|
|
@@ -400,6 +410,7 @@ var ConfigSchema = z.object({
|
|
|
400
410
|
dev: DevConfigSchema,
|
|
401
411
|
tool_rag: ToolRagConfigSchema,
|
|
402
412
|
capabilities: CapabilitiesConfigSchema,
|
|
413
|
+
ton_proxy: TonProxyConfigSchema,
|
|
403
414
|
mcp: McpConfigSchema,
|
|
404
415
|
plugins: z.record(z.string(), z.unknown()).default({}).describe("Per-plugin config (key = plugin name with underscores)"),
|
|
405
416
|
cocoon: z.object({
|
|
@@ -21,6 +21,7 @@ var DEBOUNCE_MAX_MULTIPLIER = 3;
|
|
|
21
21
|
var DEBOUNCE_MAX_BUFFER_SIZE = 20;
|
|
22
22
|
var CONTEXT_MAX_RECENT_MESSAGES = 10;
|
|
23
23
|
var CONTEXT_MAX_RELEVANT_CHUNKS = 5;
|
|
24
|
+
var FEED_MESSAGE_MAX_CHARS = 2e3;
|
|
24
25
|
var HYBRID_SEARCH_MIN_SCORE = 0.15;
|
|
25
26
|
var CONTEXT_OVERFLOW_SUMMARY_MESSAGES = 15;
|
|
26
27
|
var RATE_LIMIT_MAX_RETRIES = 3;
|
|
@@ -50,6 +51,8 @@ var ADAPTIVE_CHUNK_RATIO_TRIGGER = 0.1;
|
|
|
50
51
|
var SESSION_SLUG_RECENT_MESSAGES = 10;
|
|
51
52
|
var SESSION_SLUG_MAX_TOKENS = 50;
|
|
52
53
|
var MASKING_KEEP_RECENT_COUNT = 10;
|
|
54
|
+
var RESULT_TRUNCATION_THRESHOLD = 4e3;
|
|
55
|
+
var RESULT_TRUNCATION_KEEP_CHARS = 500;
|
|
53
56
|
var EMBEDDING_CACHE_EVICTION_RATIO = 0.1;
|
|
54
57
|
var WEB_FETCH_MAX_TEXT_LENGTH = 2e4;
|
|
55
58
|
var WEB_SEARCH_MAX_RESULTS = 10;
|
|
@@ -80,6 +83,7 @@ export {
|
|
|
80
83
|
DEBOUNCE_MAX_BUFFER_SIZE,
|
|
81
84
|
CONTEXT_MAX_RECENT_MESSAGES,
|
|
82
85
|
CONTEXT_MAX_RELEVANT_CHUNKS,
|
|
86
|
+
FEED_MESSAGE_MAX_CHARS,
|
|
83
87
|
HYBRID_SEARCH_MIN_SCORE,
|
|
84
88
|
CONTEXT_OVERFLOW_SUMMARY_MESSAGES,
|
|
85
89
|
RATE_LIMIT_MAX_RETRIES,
|
|
@@ -109,6 +113,8 @@ export {
|
|
|
109
113
|
SESSION_SLUG_RECENT_MESSAGES,
|
|
110
114
|
SESSION_SLUG_MAX_TOKENS,
|
|
111
115
|
MASKING_KEEP_RECENT_COUNT,
|
|
116
|
+
RESULT_TRUNCATION_THRESHOLD,
|
|
117
|
+
RESULT_TRUNCATION_KEEP_CHARS,
|
|
112
118
|
EMBEDDING_CACHE_EVICTION_RATIO,
|
|
113
119
|
WEB_FETCH_MAX_TEXT_LENGTH,
|
|
114
120
|
WEB_SEARCH_MAX_RESULTS,
|
package/dist/cli/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getModelsForProvider
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-OJCLKU5Z.js";
|
|
4
4
|
import {
|
|
5
5
|
TelegramUserClient,
|
|
6
6
|
main
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-U7FQYCBQ.js";
|
|
7
|
+
} from "../chunk-5FNWBZ5K.js";
|
|
8
|
+
import "../chunk-QBHRXLZS.js";
|
|
10
9
|
import {
|
|
11
10
|
CONFIGURABLE_KEYS,
|
|
12
11
|
configExists,
|
|
@@ -16,7 +15,7 @@ import {
|
|
|
16
15
|
readRawConfig,
|
|
17
16
|
setNestedValue,
|
|
18
17
|
writeRawConfig
|
|
19
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-CGOXE4WP.js";
|
|
20
19
|
import {
|
|
21
20
|
ConfigSchema,
|
|
22
21
|
DealsConfigSchema,
|
|
@@ -27,27 +26,27 @@ import {
|
|
|
27
26
|
loadWallet,
|
|
28
27
|
saveWallet,
|
|
29
28
|
walletExists
|
|
30
|
-
} from "../chunk-
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
29
|
+
} from "../chunk-S6PHGKOC.js";
|
|
30
|
+
import "../chunk-KVXV7EF7.js";
|
|
31
|
+
import "../chunk-7TECSLJ4.js";
|
|
33
32
|
import {
|
|
34
33
|
getErrorMessage
|
|
35
34
|
} from "../chunk-XBE4JB7C.js";
|
|
36
|
-
import "../chunk-
|
|
35
|
+
import "../chunk-AYWEJCDB.js";
|
|
37
36
|
import {
|
|
38
37
|
getClaudeCodeApiKey,
|
|
39
38
|
getProviderMetadata,
|
|
40
39
|
getSupportedProviders,
|
|
41
40
|
isClaudeCodeTokenValid,
|
|
42
41
|
validateApiKeyFormat
|
|
43
|
-
} from "../chunk-
|
|
44
|
-
import "../chunk-
|
|
45
|
-
import "../chunk-
|
|
46
|
-
import "../chunk-
|
|
42
|
+
} from "../chunk-PHSAHTK4.js";
|
|
43
|
+
import "../chunk-QV2GLOTK.js";
|
|
44
|
+
import "../chunk-7U7BOHCL.js";
|
|
45
|
+
import "../chunk-3S4GGLLR.js";
|
|
47
46
|
import "../chunk-VFA7QMCZ.js";
|
|
48
47
|
import {
|
|
49
48
|
TELEGRAM_MAX_MESSAGE_LENGTH
|
|
50
|
-
} from "../chunk-
|
|
49
|
+
} from "../chunk-UP55PXFH.js";
|
|
51
50
|
import {
|
|
52
51
|
fetchWithTimeout
|
|
53
52
|
} from "../chunk-XQUHC3JZ.js";
|
|
@@ -56,8 +55,8 @@ import {
|
|
|
56
55
|
TELETON_ROOT
|
|
57
56
|
} from "../chunk-EYWNOHMJ.js";
|
|
58
57
|
import "../chunk-RCMD3U65.js";
|
|
59
|
-
import "../chunk-
|
|
60
|
-
import "../chunk-
|
|
58
|
+
import "../chunk-4L66JHQE.js";
|
|
59
|
+
import "../chunk-3RG5ZIWI.js";
|
|
61
60
|
|
|
62
61
|
// src/cli/index.ts
|
|
63
62
|
import { Command } from "commander";
|
|
@@ -380,7 +379,7 @@ function sleep(ms) {
|
|
|
380
379
|
}
|
|
381
380
|
async function onboardCommand(options = {}) {
|
|
382
381
|
if (options.ui) {
|
|
383
|
-
const { SetupServer } = await import("../setup-server-
|
|
382
|
+
const { SetupServer } = await import("../setup-server-32XGDPE6.js");
|
|
384
383
|
const port = parseInt(options.uiPort || "7777") || 7777;
|
|
385
384
|
const url = `http://localhost:${port}/setup`;
|
|
386
385
|
const blue2 = "\x1B[34m";
|
|
@@ -403,9 +402,8 @@ ${blue2} \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25
|
|
|
403
402
|
`);
|
|
404
403
|
const server = new SetupServer(port);
|
|
405
404
|
await server.start();
|
|
406
|
-
process.on("SIGINT",
|
|
407
|
-
|
|
408
|
-
process.exit(0);
|
|
405
|
+
process.on("SIGINT", () => {
|
|
406
|
+
void server.stop().then(() => process.exit(0));
|
|
409
407
|
});
|
|
410
408
|
await server.waitForLaunch();
|
|
411
409
|
console.log("\n Launch signal received \u2014 stopping setup server");
|
|
@@ -1111,6 +1109,7 @@ Get it at: ${providerMeta.consoleUrl}`,
|
|
|
1111
1109
|
audit: { log_commands: true }
|
|
1112
1110
|
}
|
|
1113
1111
|
},
|
|
1112
|
+
ton_proxy: { enabled: false, port: 8080 },
|
|
1114
1113
|
plugins: {},
|
|
1115
1114
|
...selectedProvider === "cocoon" ? { cocoon: { port: cocoonInstance } } : {},
|
|
1116
1115
|
tonapi_key: tonapiKey,
|
|
@@ -1276,6 +1275,7 @@ async function runNonInteractiveOnboarding(options, prompter) {
|
|
|
1276
1275
|
audit: { log_commands: true }
|
|
1277
1276
|
}
|
|
1278
1277
|
},
|
|
1278
|
+
ton_proxy: { enabled: false, port: 8080 },
|
|
1279
1279
|
mcp: { servers: {} },
|
|
1280
1280
|
plugins: {},
|
|
1281
1281
|
tavily_api_key: options.tavilyApiKey
|
|
@@ -1684,7 +1684,7 @@ function ensureMcpSection(raw) {
|
|
|
1684
1684
|
return mcp2.servers;
|
|
1685
1685
|
}
|
|
1686
1686
|
function deriveServerName(pkg) {
|
|
1687
|
-
const unscoped = pkg.includes("/") ? pkg.split("/").pop() : pkg;
|
|
1687
|
+
const unscoped = pkg.includes("/") ? pkg.split("/").pop() ?? pkg : pkg;
|
|
1688
1688
|
return unscoped.replace(/^server-/, "").replace(/^mcp-server-/, "").replace(/^mcp-/, "");
|
|
1689
1689
|
}
|
|
1690
1690
|
async function mcpAddCommand(pkg, extraArgs, options) {
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
loadContextFromTranscript,
|
|
9
9
|
registerCocoonModels,
|
|
10
10
|
registerLocalModels
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-AYWEJCDB.js";
|
|
12
|
+
import "./chunk-PHSAHTK4.js";
|
|
13
|
+
import "./chunk-QV2GLOTK.js";
|
|
14
14
|
import "./chunk-XQUHC3JZ.js";
|
|
15
15
|
import "./chunk-R4YSJ4EY.js";
|
|
16
16
|
import "./chunk-EYWNOHMJ.js";
|
|
17
17
|
import "./chunk-RCMD3U65.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-3RG5ZIWI.js";
|
|
19
19
|
export {
|
|
20
20
|
chatWithContext,
|
|
21
21
|
createClient,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
telegramGetMyGiftsExecutor,
|
|
3
3
|
telegramGetMyGiftsTool
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QBHRXLZS.js";
|
|
5
5
|
import "./chunk-XBE4JB7C.js";
|
|
6
6
|
import "./chunk-RCMD3U65.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-3RG5ZIWI.js";
|
|
8
8
|
export {
|
|
9
9
|
telegramGetMyGiftsExecutor,
|
|
10
10
|
telegramGetMyGiftsTool
|
package/dist/index.js
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TeletonApp,
|
|
3
3
|
main
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-TSKJCWQQ.js";
|
|
4
|
+
} from "./chunk-5FNWBZ5K.js";
|
|
5
|
+
import "./chunk-QBHRXLZS.js";
|
|
6
|
+
import "./chunk-CGOXE4WP.js";
|
|
7
|
+
import "./chunk-S6PHGKOC.js";
|
|
8
|
+
import "./chunk-KVXV7EF7.js";
|
|
9
|
+
import "./chunk-7TECSLJ4.js";
|
|
11
10
|
import "./chunk-XBE4JB7C.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-AYWEJCDB.js";
|
|
12
|
+
import "./chunk-PHSAHTK4.js";
|
|
13
|
+
import "./chunk-QV2GLOTK.js";
|
|
14
|
+
import "./chunk-7U7BOHCL.js";
|
|
15
|
+
import "./chunk-3S4GGLLR.js";
|
|
17
16
|
import "./chunk-VFA7QMCZ.js";
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-UP55PXFH.js";
|
|
19
18
|
import "./chunk-XQUHC3JZ.js";
|
|
20
19
|
import "./chunk-R4YSJ4EY.js";
|
|
21
20
|
import "./chunk-EYWNOHMJ.js";
|
|
22
21
|
import "./chunk-RCMD3U65.js";
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-4L66JHQE.js";
|
|
23
|
+
import "./chunk-3RG5ZIWI.js";
|
|
25
24
|
export {
|
|
26
25
|
TeletonApp,
|
|
27
26
|
main
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
initializeMemory,
|
|
17
17
|
runMigrations,
|
|
18
18
|
setSchemaVersion
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-7U7BOHCL.js";
|
|
20
20
|
import {
|
|
21
21
|
AnthropicEmbeddingProvider,
|
|
22
22
|
CachedEmbeddingProvider,
|
|
@@ -26,9 +26,9 @@ import {
|
|
|
26
26
|
deserializeEmbedding,
|
|
27
27
|
hashText,
|
|
28
28
|
serializeEmbedding
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-3S4GGLLR.js";
|
|
30
30
|
import "./chunk-VFA7QMCZ.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-UP55PXFH.js";
|
|
32
32
|
import "./chunk-XQUHC3JZ.js";
|
|
33
33
|
import "./chunk-R4YSJ4EY.js";
|
|
34
34
|
import "./chunk-EYWNOHMJ.js";
|
|
@@ -36,8 +36,8 @@ import "./chunk-RCMD3U65.js";
|
|
|
36
36
|
import {
|
|
37
37
|
TaskStore,
|
|
38
38
|
getTaskStore
|
|
39
|
-
} from "./chunk-
|
|
40
|
-
import "./chunk-
|
|
39
|
+
} from "./chunk-4L66JHQE.js";
|
|
40
|
+
import "./chunk-3RG5ZIWI.js";
|
|
41
41
|
export {
|
|
42
42
|
AnthropicEmbeddingProvider,
|
|
43
43
|
CURRENT_SCHEMA_VERSION,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDatabase
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-7U7BOHCL.js";
|
|
4
|
+
import "./chunk-3S4GGLLR.js";
|
|
5
5
|
import "./chunk-VFA7QMCZ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-UP55PXFH.js";
|
|
7
7
|
import "./chunk-XQUHC3JZ.js";
|
|
8
8
|
import "./chunk-R4YSJ4EY.js";
|
|
9
9
|
import {
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
createLogger
|
|
14
14
|
} from "./chunk-RCMD3U65.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-4L66JHQE.js";
|
|
16
|
+
import "./chunk-3RG5ZIWI.js";
|
|
17
17
|
|
|
18
18
|
// src/session/migrate.ts
|
|
19
19
|
import { readFileSync, existsSync, renameSync } from "fs";
|