teleton 0.8.3 → 0.8.4

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.
@@ -3,11 +3,9 @@ import {
3
3
  } from "./chunk-NVKBBTI6.js";
4
4
  import {
5
5
  configExists,
6
+ ensureWorkspace,
6
7
  getDefaultConfigPath
7
- } from "./chunk-AEHTQI3H.js";
8
- import {
9
- ensureWorkspace
10
- } from "./chunk-AERHOXGC.js";
8
+ } from "./chunk-NH2CNRKJ.js";
11
9
  import "./chunk-C4NKJT2Z.js";
12
10
  import "./chunk-6OOHHJ4N.js";
13
11
  import {
@@ -44,7 +42,7 @@ async function startApiOnly(options) {
44
42
  marketplace: null,
45
43
  userHookEvaluator: null
46
44
  };
47
- const { ApiServer } = await import("./server-JF6FX772.js");
45
+ const { ApiServer } = await import("./server-WWGVDFPW.js");
48
46
  const apiConfig = {
49
47
  enabled: true,
50
48
  port: parseInt(options.apiPort || process.env.TELETON_API_PORT || "7778"),
@@ -5,15 +5,17 @@ import {
5
5
  generateWallet,
6
6
  getWalletAddress,
7
7
  importWallet,
8
+ readRawConfig,
8
9
  saveWallet,
9
- walletExists
10
- } from "./chunk-FUNF6H4W.js";
10
+ walletExists,
11
+ writeRawConfig
12
+ } from "./chunk-JROBTXWY.js";
11
13
  import {
12
14
  ConfigSchema,
13
15
  DealsConfigSchema,
14
16
  ensureWorkspace,
15
17
  isNewWorkspace
16
- } from "./chunk-AERHOXGC.js";
18
+ } from "./chunk-NH2CNRKJ.js";
17
19
  import {
18
20
  TELEGRAM_MAX_MESSAGE_LENGTH
19
21
  } from "./chunk-C4NKJT2Z.js";
@@ -380,7 +382,16 @@ var TelegramAuthManager = class {
380
382
  mkdirSync(dir, { recursive: true });
381
383
  }
382
384
  writeFileSync(sessionPath, sessionString, { mode: 384 });
383
- log.info("Telegram session saved");
385
+ const configPath = join(TELETON_ROOT, "config.yaml");
386
+ const raw = readRawConfig(configPath);
387
+ raw.telegram = raw.telegram ?? {};
388
+ raw.telegram.api_id = session.apiId;
389
+ raw.telegram.api_hash = session.apiHash;
390
+ if (session.type === "phone") {
391
+ raw.telegram.phone = session.phone;
392
+ }
393
+ writeRawConfig(raw, configPath);
394
+ log.info("Telegram session and credentials saved");
384
395
  }
385
396
  };
386
397
 
@@ -2,25 +2,20 @@ import {
2
2
  getModelsForProvider
3
3
  } from "./chunk-WFTC3JJW.js";
4
4
  import {
5
- CONFIGURABLE_KEYS,
6
5
  TonProxyManager,
7
6
  WorkspaceSecurityError,
8
7
  adaptPlugin,
9
8
  clearPromptCache,
10
- deleteNestedValue,
11
9
  deletePluginSecret,
12
10
  ensurePluginDeps,
13
11
  getBlocklistConfig,
14
- getNestedValue,
15
12
  getPluginPriorities,
16
13
  getTokenUsage,
17
14
  getTonProxyManager,
18
15
  getTriggersConfig,
19
16
  listPluginSecretKeys,
20
- readRawConfig,
21
17
  resetPluginPriority,
22
18
  setBlocklistConfig,
23
- setNestedValue,
24
19
  setPluginPriority,
25
20
  setTonProxyManager,
26
21
  setTriggersConfig,
@@ -28,14 +23,19 @@ import {
28
23
  validatePath,
29
24
  validateReadPath,
30
25
  validateWritePath,
31
- writePluginSecret,
32
- writeRawConfig
33
- } from "./chunk-7MWKT67G.js";
26
+ writePluginSecret
27
+ } from "./chunk-LZQOX6YY.js";
34
28
  import {
29
+ CONFIGURABLE_KEYS,
30
+ deleteNestedValue,
31
+ getNestedValue,
35
32
  invalidateEndpointCache,
36
33
  invalidateTonClientCache,
37
- setToncenterApiKey
38
- } from "./chunk-FUNF6H4W.js";
34
+ readRawConfig,
35
+ setNestedValue,
36
+ setToncenterApiKey,
37
+ writeRawConfig
38
+ } from "./chunk-JROBTXWY.js";
39
39
  import {
40
40
  getErrorMessage
41
41
  } from "./chunk-3UFPFWYP.js";