teleton 0.7.5 → 0.8.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.
Files changed (39) hide show
  1. package/README.md +7 -4
  2. package/dist/chunk-3RG5ZIWI.js +10 -0
  3. package/dist/{chunk-U7FQYCBQ.js → chunk-7TECSLJ4.js} +2 -2
  4. package/dist/{chunk-OGMVWDVU.js → chunk-H36RFKRI.js} +1587 -5086
  5. package/dist/{chunk-YP25WTQK.js → chunk-IJBWWQE4.js} +2 -0
  6. package/dist/{chunk-AVDWXYQ7.js → chunk-JHYZYFZJ.js} +5 -1
  7. package/dist/{chunk-QOQWUUA4.js → chunk-OJCLKU5Z.js} +68 -2
  8. package/dist/{chunk-OCLG5GKI.js → chunk-P36I6OIV.js} +2 -2
  9. package/dist/{chunk-CB2Y45HA.js → chunk-PHSAHTK4.js} +51 -3
  10. package/dist/{chunk-DMXTIRUW.js → chunk-QVBSUYVX.js} +10 -37
  11. package/dist/chunk-RQBAMUCV.js +10281 -0
  12. package/dist/{chunk-2GLHOJ5C.js → chunk-SD4NLLYG.js} +27 -7
  13. package/dist/{chunk-5UVXJMOX.js → chunk-TVRZJIZX.js} +2 -2
  14. package/dist/{chunk-LCCVZ4D2.js → chunk-U56QTM46.js} +1 -1
  15. package/dist/cli/index.js +14 -15
  16. package/dist/{client-O37XDCJB.js → client-LNZTDQSA.js} +4 -4
  17. package/dist/{get-my-gifts-TPVUGUWT.js → get-my-gifts-OMGKOEPM.js} +1 -1
  18. package/dist/index.js +12 -13
  19. package/dist/{memory-KQALFUV3.js → memory-AS7WKGTW.js} +4 -4
  20. package/dist/{migrate-UV3WEL5D.js → migrate-POHWYEIW.js} +4 -4
  21. package/dist/{multipart-parser-S3YC6NRJ.js → multipart-parser-UFQLJOV2.js} +2 -2
  22. package/dist/{paths-TMNTEDDD.js → paths-XA2RJH4S.js} +1 -1
  23. package/dist/{server-BHHJGUDF.js → server-H3QA252W.js} +14 -13
  24. package/dist/{setup-server-G7UG2DI3.js → setup-server-QXED3D2L.js} +6 -6
  25. package/dist/{store-H4XPNGC2.js → store-GAFULOOX.js} +5 -5
  26. package/dist/{task-dependency-resolver-VMEVJRPO.js → task-dependency-resolver-3FIKQ7Z6.js} +2 -2
  27. package/dist/{task-executor-WWSPBJ4V.js → task-executor-RUTFG6VG.js} +2 -2
  28. package/dist/{tasks-QSCWSMPS.js → tasks-BEZ4QRI2.js} +1 -1
  29. package/dist/{tool-adapter-Y3TCEQOC.js → tool-adapter-IH5VGBOO.js} +1 -1
  30. package/dist/{tool-index-2KH3OB6X.js → tool-index-H3SHOJC3.js} +3 -3
  31. package/dist/{transcript-UDJZP6NK.js → transcript-IMNE6KU3.js} +2 -2
  32. package/dist/web/assets/{index-Bx8JW3gV.js → index-DYeEkvJ6.js} +5 -5
  33. package/dist/web/assets/{index.es-Pet5-M13.js → index.es-DkU1GvWU.js} +1 -1
  34. package/dist/web/index.html +1 -1
  35. package/package.json +2 -2
  36. package/dist/BigInteger-DQ33LTTE.js +0 -5
  37. package/dist/chunk-G2LLMJXJ.js +0 -5048
  38. package/dist/chunk-QGM4M3NI.js +0 -37
  39. package/dist/chunk-TSKJCWQQ.js +0 -1263
@@ -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;
@@ -80,6 +81,7 @@ export {
80
81
  DEBOUNCE_MAX_BUFFER_SIZE,
81
82
  CONTEXT_MAX_RECENT_MESSAGES,
82
83
  CONTEXT_MAX_RELEVANT_CHUNKS,
84
+ FEED_MESSAGE_MAX_CHARS,
83
85
  HYBRID_SEARCH_MIN_SCORE,
84
86
  CONTEXT_OVERFLOW_SUMMARY_MESSAGES,
85
87
  RATE_LIMIT_MAX_RETRIES,
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-VFA7QMCZ.js";
5
5
  import {
6
6
  TELEGRAM_MAX_MESSAGE_LENGTH
7
- } from "./chunk-YP25WTQK.js";
7
+ } from "./chunk-IJBWWQE4.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"),
@@ -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: "kimi-k2.5", name: "Kimi K2.5", description: "Free, 256K ctx, multimodal" },
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, 256K ctx, reasoning"
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) {
@@ -24,7 +24,7 @@ function getTranscriptPath(sessionId) {
24
24
  }
25
25
  function ensureSessionsDir() {
26
26
  if (!existsSync(SESSIONS_DIR)) {
27
- mkdirSync(SESSIONS_DIR, { recursive: true });
27
+ mkdirSync(SESSIONS_DIR, { recursive: true, mode: 448 });
28
28
  }
29
29
  }
30
30
  function appendToTranscript(sessionId, message) {
@@ -32,7 +32,7 @@ function appendToTranscript(sessionId, message) {
32
32
  const transcriptPath = getTranscriptPath(sessionId);
33
33
  const line = JSON.stringify(message) + "\n";
34
34
  try {
35
- appendFileSync(transcriptPath, line, "utf-8");
35
+ appendFileSync(transcriptPath, line, { encoding: "utf-8", mode: 384 });
36
36
  } catch (error) {
37
37
  log.error({ err: error }, `Failed to append to transcript ${sessionId}`);
38
38
  }
@@ -95,10 +95,10 @@ var PROVIDER_REGISTRY = {
95
95
  keyPrefix: "sk-",
96
96
  keyHint: "sk-...",
97
97
  consoleUrl: "https://platform.moonshot.ai/",
98
- defaultModel: "kimi-k2.5",
99
- utilityModel: "kimi-k2.5",
98
+ defaultModel: "k2p5",
99
+ utilityModel: "k2p5",
100
100
  toolLimit: 128,
101
- piAiProvider: "moonshot"
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)",
@@ -2,11 +2,11 @@ import {
2
2
  getClaudeCodeApiKey,
3
3
  getProviderMetadata,
4
4
  refreshClaudeCodeApiKey
5
- } from "./chunk-CB2Y45HA.js";
5
+ } from "./chunk-PHSAHTK4.js";
6
6
  import {
7
7
  appendToTranscript,
8
8
  readTranscript
9
- } from "./chunk-OCLG5GKI.js";
9
+ } from "./chunk-P36I6OIV.js";
10
10
  import {
11
11
  fetchWithTimeout
12
12
  } from "./chunk-XQUHC3JZ.js";
@@ -183,31 +183,8 @@ async function registerLocalModels(baseUrl) {
183
183
  return [];
184
184
  }
185
185
  }
186
- var MOONSHOT_MODELS = {
187
- "kimi-k2.5": {
188
- id: "kimi-k2.5",
189
- name: "Kimi K2.5",
190
- api: "openai-completions",
191
- provider: "moonshot",
192
- baseUrl: "https://api.moonshot.ai/v1",
193
- reasoning: false,
194
- input: ["text", "image"],
195
- cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
196
- contextWindow: 256e3,
197
- maxTokens: 8192
198
- },
199
- "kimi-k2-thinking": {
200
- id: "kimi-k2-thinking",
201
- name: "Kimi K2 Thinking",
202
- api: "openai-completions",
203
- provider: "moonshot",
204
- baseUrl: "https://api.moonshot.ai/v1",
205
- reasoning: true,
206
- input: ["text"],
207
- cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
208
- contextWindow: 256e3,
209
- maxTokens: 8192
210
- }
186
+ var MOONSHOT_MODEL_ALIASES = {
187
+ "kimi-k2.5": "k2p5"
211
188
  };
212
189
  function getProviderModel(provider, modelId) {
213
190
  const cacheKey = `${provider}:${modelId}`;
@@ -238,12 +215,8 @@ function getProviderModel(provider, modelId) {
238
215
  }
239
216
  throw new Error("No local models available. Is the LLM server running?");
240
217
  }
241
- if (meta.piAiProvider === "moonshot") {
242
- const model = MOONSHOT_MODELS[modelId] ?? MOONSHOT_MODELS[meta.defaultModel];
243
- if (model) {
244
- modelCache.set(cacheKey, model);
245
- return model;
246
- }
218
+ if (provider === "moonshot" && MOONSHOT_MODEL_ALIASES[modelId]) {
219
+ modelId = MOONSHOT_MODEL_ALIASES[modelId];
247
220
  }
248
221
  try {
249
222
  const model = getModel(meta.piAiProvider, modelId);
@@ -289,7 +262,7 @@ async function chatWithContext(config, options) {
289
262
  systemPrompt = "/no_think\n" + systemPrompt;
290
263
  if (tools && tools.length > 0) {
291
264
  cocoonAllowedTools = new Set(tools.map((t) => t.name));
292
- const { injectToolsIntoSystemPrompt } = await import("./tool-adapter-Y3TCEQOC.js");
265
+ const { injectToolsIntoSystemPrompt } = await import("./tool-adapter-IH5VGBOO.js");
293
266
  systemPrompt = injectToolsIntoSystemPrompt(systemPrompt, tools);
294
267
  tools = void 0;
295
268
  }
@@ -299,7 +272,7 @@ async function chatWithContext(config, options) {
299
272
  systemPrompt,
300
273
  tools
301
274
  };
302
- const temperature = provider === "moonshot" ? 1 : options.temperature ?? config.temperature;
275
+ const temperature = options.temperature ?? config.temperature;
303
276
  const completeOptions = {
304
277
  apiKey: getEffectiveApiKey(provider, config.api_key),
305
278
  maxTokens: options.maxTokens ?? config.max_tokens,
@@ -308,7 +281,7 @@ async function chatWithContext(config, options) {
308
281
  cacheRetention: "long"
309
282
  };
310
283
  if (isCocoon) {
311
- const { stripCocoonPayload } = await import("./tool-adapter-Y3TCEQOC.js");
284
+ const { stripCocoonPayload } = await import("./tool-adapter-IH5VGBOO.js");
312
285
  completeOptions.onPayload = stripCocoonPayload;
313
286
  }
314
287
  let response = await complete(model, context, completeOptions);
@@ -323,7 +296,7 @@ async function chatWithContext(config, options) {
323
296
  if (isCocoon) {
324
297
  const textBlock = response.content.find((b) => b.type === "text");
325
298
  if (textBlock?.type === "text" && textBlock.text.includes("<tool_call>")) {
326
- const { parseToolCallsFromText, extractPlainText } = await import("./tool-adapter-Y3TCEQOC.js");
299
+ const { parseToolCallsFromText, extractPlainText } = await import("./tool-adapter-IH5VGBOO.js");
327
300
  const syntheticCalls = parseToolCallsFromText(textBlock.text, cocoonAllowedTools);
328
301
  if (syntheticCalls.length > 0) {
329
302
  const plainText = extractPlainText(textBlock.text);