teleton 0.7.1 → 0.7.3
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/{chunk-ND2X5FWB.js → chunk-5PLZ3KSO.js} +16 -3
- package/dist/{chunk-HZNZT4TG.js → chunk-A4GCOHCE.js} +283 -104
- package/dist/{chunk-3YM57ZAV.js → chunk-BU453WX4.js} +416 -612
- package/dist/{chunk-NERLQY2H.js → chunk-DAMCNMYL.js} +64 -6
- package/dist/chunk-JQDLW7IE.js +107 -0
- package/dist/{chunk-LRCPA7SC.js → chunk-RMLQS3X6.js} +15 -3
- package/dist/{chunk-UDD7FYOU.js → chunk-WIKM24GZ.js} +1 -18
- package/dist/cli/index.js +77 -14
- package/dist/{client-3VWE7NC4.js → client-RTNALK7W.js} +3 -2
- package/dist/{get-my-gifts-RI7FAXAL.js → get-my-gifts-TPVUGUWT.js} +1 -1
- package/dist/index.js +7 -8
- package/dist/{server-DS5OARW6.js → server-FOC5P7U6.js} +5 -9
- package/dist/{setup-server-C7ZTPHD5.js → setup-server-BVVD2PR6.js} +83 -14
- package/dist/web/assets/index-By_fs4Jl.js +72 -0
- package/dist/web/assets/{index.es-D81xLR29.js → index.es-7MTSV5SL.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/chunk-EHEV7FJ7.js +0 -157
- package/dist/chunk-QUAPFI2N.js +0 -42
- package/dist/endpoint-FLYNEZ2F.js +0 -7
- package/dist/format-transactions-FD74HI5N.js +0 -9
- package/dist/web/assets/index-BqwoDycr.js +0 -72
|
@@ -8,13 +8,16 @@ import {
|
|
|
8
8
|
isNewWorkspace,
|
|
9
9
|
saveWallet,
|
|
10
10
|
walletExists
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import
|
|
11
|
+
} from "./chunk-DAMCNMYL.js";
|
|
12
|
+
import {
|
|
13
|
+
getClaudeCodeApiKey,
|
|
14
|
+
isClaudeCodeTokenValid
|
|
15
|
+
} from "./chunk-JQDLW7IE.js";
|
|
13
16
|
import {
|
|
14
17
|
getProviderMetadata,
|
|
15
18
|
getSupportedProviders,
|
|
16
19
|
validateApiKeyFormat
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-RMLQS3X6.js";
|
|
18
21
|
import "./chunk-XBKSS6DM.js";
|
|
19
22
|
import {
|
|
20
23
|
TELEGRAM_MAX_MESSAGE_LENGTH
|
|
@@ -74,7 +77,31 @@ var TelegramAuthManager = class {
|
|
|
74
77
|
baseLogger: gramLogger
|
|
75
78
|
});
|
|
76
79
|
await client.connect();
|
|
77
|
-
const result = await client.
|
|
80
|
+
const result = await client.invoke(
|
|
81
|
+
new Api.auth.SendCode({
|
|
82
|
+
phoneNumber: phone,
|
|
83
|
+
apiId,
|
|
84
|
+
apiHash,
|
|
85
|
+
settings: new Api.CodeSettings({})
|
|
86
|
+
})
|
|
87
|
+
);
|
|
88
|
+
if (result instanceof Api.auth.SentCodeSuccess) {
|
|
89
|
+
await client.disconnect();
|
|
90
|
+
throw new Error("Account already authenticated (SentCodeSuccess)");
|
|
91
|
+
}
|
|
92
|
+
let codeDelivery = "sms";
|
|
93
|
+
let fragmentUrl;
|
|
94
|
+
let codeLength;
|
|
95
|
+
if (result.type instanceof Api.auth.SentCodeTypeApp) {
|
|
96
|
+
codeDelivery = "app";
|
|
97
|
+
codeLength = result.type.length;
|
|
98
|
+
} else if (result.type instanceof Api.auth.SentCodeTypeFragmentSms) {
|
|
99
|
+
codeDelivery = "fragment";
|
|
100
|
+
fragmentUrl = result.type.url;
|
|
101
|
+
codeLength = result.type.length;
|
|
102
|
+
} else if ("length" in result.type) {
|
|
103
|
+
codeLength = result.type.length;
|
|
104
|
+
}
|
|
78
105
|
const id = randomBytes(16).toString("hex");
|
|
79
106
|
const expiresAt = Date.now() + SESSION_TTL_MS;
|
|
80
107
|
this.session = {
|
|
@@ -83,6 +110,8 @@ var TelegramAuthManager = class {
|
|
|
83
110
|
phone,
|
|
84
111
|
phoneCodeHash: result.phoneCodeHash,
|
|
85
112
|
state: "code_sent",
|
|
113
|
+
fragmentUrl,
|
|
114
|
+
codeLength,
|
|
86
115
|
codeAttempts: 0,
|
|
87
116
|
passwordAttempts: 0,
|
|
88
117
|
createdAt: Date.now(),
|
|
@@ -91,7 +120,7 @@ var TelegramAuthManager = class {
|
|
|
91
120
|
timer: setTimeout(() => this.cleanup(), SESSION_TTL_MS)
|
|
92
121
|
};
|
|
93
122
|
log.info("Telegram verification code sent");
|
|
94
|
-
return { authSessionId: id,
|
|
123
|
+
return { authSessionId: id, codeDelivery, fragmentUrl, codeLength, expiresAt };
|
|
95
124
|
}
|
|
96
125
|
/**
|
|
97
126
|
* Verify the code entered by the user
|
|
@@ -182,10 +211,24 @@ var TelegramAuthManager = class {
|
|
|
182
211
|
if (result instanceof Api.auth.SentCode) {
|
|
183
212
|
session.phoneCodeHash = result.phoneCodeHash;
|
|
184
213
|
session.codeAttempts = 0;
|
|
185
|
-
|
|
186
|
-
|
|
214
|
+
let codeDelivery = "sms";
|
|
215
|
+
let fragmentUrl;
|
|
216
|
+
let codeLength;
|
|
217
|
+
if (result.type instanceof Api.auth.SentCodeTypeApp) {
|
|
218
|
+
codeDelivery = "app";
|
|
219
|
+
codeLength = result.type.length;
|
|
220
|
+
} else if (result.type instanceof Api.auth.SentCodeTypeFragmentSms) {
|
|
221
|
+
codeDelivery = "fragment";
|
|
222
|
+
fragmentUrl = result.type.url;
|
|
223
|
+
codeLength = result.type.length;
|
|
224
|
+
} else if ("length" in result.type) {
|
|
225
|
+
codeLength = result.type.length;
|
|
226
|
+
}
|
|
227
|
+
session.fragmentUrl = fragmentUrl;
|
|
228
|
+
session.codeLength = codeLength;
|
|
229
|
+
return { codeDelivery, fragmentUrl, codeLength };
|
|
187
230
|
}
|
|
188
|
-
return {
|
|
231
|
+
return { codeDelivery: "sms" };
|
|
189
232
|
}
|
|
190
233
|
/**
|
|
191
234
|
* Cancel and clean up session
|
|
@@ -244,10 +287,15 @@ var TelegramAuthManager = class {
|
|
|
244
287
|
var log2 = createLogger("Setup");
|
|
245
288
|
var MODEL_OPTIONS = {
|
|
246
289
|
anthropic: [
|
|
290
|
+
{
|
|
291
|
+
value: "claude-opus-4-6",
|
|
292
|
+
name: "Claude Opus 4.6",
|
|
293
|
+
description: "Most capable, 1M ctx, $5/M"
|
|
294
|
+
},
|
|
247
295
|
{
|
|
248
296
|
value: "claude-opus-4-5-20251101",
|
|
249
297
|
name: "Claude Opus 4.5",
|
|
250
|
-
description: "
|
|
298
|
+
description: "Previous gen, 200K ctx, $5/M"
|
|
251
299
|
},
|
|
252
300
|
{ value: "claude-sonnet-4-0", name: "Claude Sonnet 4", description: "Balanced, $3/M" },
|
|
253
301
|
{
|
|
@@ -256,9 +304,9 @@ var MODEL_OPTIONS = {
|
|
|
256
304
|
description: "Fast & cheap, $1/M"
|
|
257
305
|
},
|
|
258
306
|
{
|
|
259
|
-
value: "claude-
|
|
260
|
-
name: "Claude
|
|
261
|
-
description: "
|
|
307
|
+
value: "claude-haiku-4-5-20251001",
|
|
308
|
+
name: "Claude Haiku 4.5",
|
|
309
|
+
description: "Fast & cheap, $1/M"
|
|
262
310
|
}
|
|
263
311
|
],
|
|
264
312
|
openai: [
|
|
@@ -390,14 +438,16 @@ function createSetupRoutes() {
|
|
|
390
438
|
toolLimit: p.toolLimit,
|
|
391
439
|
keyPrefix: p.keyPrefix,
|
|
392
440
|
consoleUrl: p.consoleUrl,
|
|
393
|
-
requiresApiKey: p.id !== "cocoon" && p.id !== "local",
|
|
441
|
+
requiresApiKey: p.id !== "cocoon" && p.id !== "local" && p.id !== "claude-code",
|
|
442
|
+
autoDetectsKey: p.id === "claude-code",
|
|
394
443
|
requiresBaseUrl: p.id === "local"
|
|
395
444
|
}));
|
|
396
445
|
return c.json({ success: true, data: providers });
|
|
397
446
|
});
|
|
398
447
|
app.get("/models/:provider", (c) => {
|
|
399
448
|
const provider = c.req.param("provider");
|
|
400
|
-
const
|
|
449
|
+
const modelKey = provider === "claude-code" ? "anthropic" : provider;
|
|
450
|
+
const models = MODEL_OPTIONS[modelKey] || [];
|
|
401
451
|
const result = [
|
|
402
452
|
...models,
|
|
403
453
|
{
|
|
@@ -409,6 +459,25 @@ function createSetupRoutes() {
|
|
|
409
459
|
];
|
|
410
460
|
return c.json({ success: true, data: result });
|
|
411
461
|
});
|
|
462
|
+
app.get("/detect-claude-code-key", (c) => {
|
|
463
|
+
try {
|
|
464
|
+
const key = getClaudeCodeApiKey();
|
|
465
|
+
const masked = key;
|
|
466
|
+
return c.json({
|
|
467
|
+
success: true,
|
|
468
|
+
data: {
|
|
469
|
+
found: true,
|
|
470
|
+
maskedKey: masked,
|
|
471
|
+
valid: isClaudeCodeTokenValid()
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
} catch {
|
|
475
|
+
return c.json({
|
|
476
|
+
success: true,
|
|
477
|
+
data: { found: false, maskedKey: null, valid: false }
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
});
|
|
412
481
|
app.post("/validate/api-key", async (c) => {
|
|
413
482
|
try {
|
|
414
483
|
const body = await c.req.json();
|