@ours.network/tg-connector 0.3.3-nightly.1 → 0.3.3-nightly.2

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 (2) hide show
  1. package/dist/cli.js +13 -9
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -129,6 +129,18 @@ function loadConfig() {
129
129
  };
130
130
  }
131
131
 
132
+ // src/service-definition.ts
133
+ function serviceEnvironment(config, stateDir) {
134
+ const env = {
135
+ OURS_TG_CONTROL_PORT: String(config.controlPort),
136
+ OURS_TG_STATE_DIR: stateDir,
137
+ OURS_TG_POLL_TIMEOUT: String(config.pollTimeoutSec)
138
+ };
139
+ if (config.daemonUrl) env.OURS_TG_DAEMON_URL = config.daemonUrl;
140
+ if (config.daemonStateDir) env.OURS_TG_DAEMON_STATE_DIR = config.daemonStateDir;
141
+ return env;
142
+ }
143
+
132
144
  // src/routing.ts
133
145
  function looksLikeBotToken(s) {
134
146
  return /^\d+:[A-Za-z0-9_-]+$/.test(s);
@@ -493,15 +505,7 @@ function run(cmd, args) {
493
505
  const r = spawnSync(cmd, args, { stdio: "inherit" });
494
506
  return r.status === 0;
495
507
  }
496
- function serviceEnv() {
497
- return {
498
- OURS_TG_DAEMON_URL: CONFIG.daemonUrl,
499
- OURS_TG_DAEMON_STATE_DIR: CONFIG.daemonStateDir,
500
- OURS_TG_CONTROL_PORT: String(CONFIG.controlPort),
501
- OURS_TG_STATE_DIR: STATE_DIR,
502
- OURS_TG_POLL_TIMEOUT: String(CONFIG.pollTimeoutSec)
503
- };
504
- }
508
+ var serviceEnv = () => serviceEnvironment(CONFIG, STATE_DIR);
505
509
  function installSystemd() {
506
510
  const unitPath = systemdUnitPath();
507
511
  fs2.mkdirSync(dirname2(unitPath), { recursive: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ours.network/tg-connector",
3
- "version": "0.3.3-nightly.1",
3
+ "version": "0.3.3-nightly.2",
4
4
  "description": "Bridge Telegram bots to ours.network agents — attaches to an already-running ours daemon and bridges one Telegram chat/topic to one agent per route. Run `ours-tg-connector add_new_connection`.",
5
5
  "type": "module",
6
6
  "license": "FSL-1.1-Apache-2.0",