opencode-telegram-link 1.0.0-rc.6 → 1.0.0-rc.8
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 +3 -3
- package/dist/broker/main.js +56 -4
- package/dist/broker/main.js.map +5 -5
- package/dist/broker/server.d.ts.map +1 -1
- package/dist/opencode/index.d.ts +1 -1
- package/dist/opencode/index.d.ts.map +1 -1
- package/dist/plugin.js +2 -2
- package/dist/plugin.js.map +2 -2
- package/dist/uninstall.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
OpenCode Telegram Notifier is a privacy-first OpenCode plugin and multi-host management gateway for asynchronous notifications, interactive inline buttons, safe remote replies, and proactive remote task dispatching. It is designed for developers who run OpenCode across multiple projects and multiple computers (dev machine, laptop, VPS) while routing every Telegram and Web interaction to the exact originating host, process, and workspace window.
|
|
4
4
|
|
|
5
|
-
> Version: **v1.0.0-rc.
|
|
6
|
-
> Status: Release Candidate
|
|
5
|
+
> Version: **v1.0.0-rc.8** (OpenCode Commander Web Dashboard, Proactive Remote Dispatch, Multi-Engine Voice STT, Multi-Host Gateway & Node Agent Architecture).
|
|
6
|
+
> Status: Release Candidate 8. Install from a release tarball or source checkout until the first public npm package is published.
|
|
7
7
|
|
|
8
8
|
[繁體中文總覽 (Traditional Chinese)](docs/README.zh-TW.md)
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
## Features & Highlights (v1.0.0-rc.
|
|
12
|
+
## Features & Highlights (v1.0.0-rc.8)
|
|
13
13
|
|
|
14
14
|
- 🖥️ **OpenCode Commander (Web GUI Dashboard)**: Built-in modern Glassmorphism Web Console (`http://<gateway-ip>:42617/dashboard`) providing real-time visibility, live metrics, and centralized cluster management.
|
|
15
15
|
- 🌐 **Cluster Topology & 1-to-1 Window Mapping**: Live cards for all connected computers and OpenCode workspace windows with real-time session indicators and task counters.
|
package/dist/broker/main.js
CHANGED
|
@@ -17857,6 +17857,7 @@ function sameSessionRoute(left, right) {
|
|
|
17857
17857
|
}
|
|
17858
17858
|
// src/broker/server.ts
|
|
17859
17859
|
import { createHash as createHash5, randomUUID as randomUUID6, timingSafeEqual } from "crypto";
|
|
17860
|
+
import { existsSync as existsSync3 } from "fs";
|
|
17860
17861
|
import { readFile as readFile6, writeFile as writeFile5 } from "fs/promises";
|
|
17861
17862
|
import { join as join6 } from "path";
|
|
17862
17863
|
|
|
@@ -18092,7 +18093,7 @@ function rejectionHash(updateId, reason) {
|
|
|
18092
18093
|
import { randomUUID as randomUUID4 } from "crypto";
|
|
18093
18094
|
|
|
18094
18095
|
// src/version.ts
|
|
18095
|
-
var PACKAGE_VERSION = "1.0.0-rc.
|
|
18096
|
+
var PACKAGE_VERSION = "1.0.0-rc.8";
|
|
18096
18097
|
|
|
18097
18098
|
// src/telegram/commands.ts
|
|
18098
18099
|
function isSlashCommand(text) {
|
|
@@ -20063,7 +20064,7 @@ function renderDashboardHtml() {
|
|
|
20063
20064
|
|
|
20064
20065
|
// src/broker/server.ts
|
|
20065
20066
|
var LOOPBACK_HOST = "127.0.0.1";
|
|
20066
|
-
var DEFAULT_BIND_HOST = "
|
|
20067
|
+
var DEFAULT_BIND_HOST = "0.0.0.0";
|
|
20067
20068
|
var CONTAINER_HOST = "0.0.0.0";
|
|
20068
20069
|
var DEFAULT_PORT = 42617;
|
|
20069
20070
|
var DEFAULT_REGISTRATION_TIMEOUT_MS = 1e4;
|
|
@@ -20767,6 +20768,56 @@ async function startBroker(options = {}) {
|
|
|
20767
20768
|
telegramRuntimeRef,
|
|
20768
20769
|
removeDiscovery: () => removeDiscoveryRecord(state.stateDirectory, discovery.nonce)
|
|
20769
20770
|
});
|
|
20771
|
+
try {
|
|
20772
|
+
const tokenFile = join6(state.stateDirectory, "telegram-bot-token");
|
|
20773
|
+
if (existsSync3(tokenFile)) {
|
|
20774
|
+
const botToken = (await readFile6(tokenFile, "utf8")).trim();
|
|
20775
|
+
if (botToken) {
|
|
20776
|
+
let userId;
|
|
20777
|
+
let chatId;
|
|
20778
|
+
let voiceApiKey = persistedSettings.voiceApiKey;
|
|
20779
|
+
let voiceProvider = persistedSettings.voiceProvider;
|
|
20780
|
+
let voiceAccountId = persistedSettings.voiceAccountId;
|
|
20781
|
+
const discovered = await discoverOpenCodeConfigFiles();
|
|
20782
|
+
for (const c of discovered) {
|
|
20783
|
+
if (c.exists) {
|
|
20784
|
+
try {
|
|
20785
|
+
const content = await readFile6(c.path, "utf8");
|
|
20786
|
+
const json2 = parseJsonc(content);
|
|
20787
|
+
const pluginEntry = Array.isArray(json2.plugin) ? json2.plugin.find((p) => Array.isArray(p) && typeof p[0] === "string" && p[0].includes("telegram-link"))?.[1] : json2.plugin && typeof json2.plugin === "object" ? json2.plugin["opencode-telegram-link"] : json2["opencode-telegram-link"];
|
|
20788
|
+
const tg = pluginEntry?.telegram;
|
|
20789
|
+
if (tg?.userId && tg?.chatId) {
|
|
20790
|
+
userId = String(tg.userId);
|
|
20791
|
+
chatId = String(tg.chatId);
|
|
20792
|
+
const vc = pluginEntry?.voice;
|
|
20793
|
+
if (vc?.apiKey)
|
|
20794
|
+
voiceApiKey = String(vc.apiKey);
|
|
20795
|
+
if (vc?.provider === "groq" || vc?.provider === "openai" || vc?.provider === "cloudflare" || vc?.provider === "custom") {
|
|
20796
|
+
voiceProvider = vc.provider;
|
|
20797
|
+
}
|
|
20798
|
+
if (vc?.accountId)
|
|
20799
|
+
voiceAccountId = String(vc.accountId);
|
|
20800
|
+
break;
|
|
20801
|
+
}
|
|
20802
|
+
} catch {}
|
|
20803
|
+
}
|
|
20804
|
+
}
|
|
20805
|
+
if (botToken && userId && chatId) {
|
|
20806
|
+
ensureTelegramRuntime({
|
|
20807
|
+
botToken,
|
|
20808
|
+
userId,
|
|
20809
|
+
chatId,
|
|
20810
|
+
locale: "zh-TW",
|
|
20811
|
+
sessionPromptTtlMinutes: 1440,
|
|
20812
|
+
questionTtlMinutes: 30,
|
|
20813
|
+
...voiceApiKey ? { voiceApiKey } : {},
|
|
20814
|
+
...voiceProvider ? { voiceProvider } : {},
|
|
20815
|
+
...voiceAccountId ? { voiceAccountId } : {}
|
|
20816
|
+
});
|
|
20817
|
+
}
|
|
20818
|
+
}
|
|
20819
|
+
}
|
|
20820
|
+
} catch {}
|
|
20770
20821
|
return broker;
|
|
20771
20822
|
} catch (error51) {
|
|
20772
20823
|
clearInterval(livenessTimer);
|
|
@@ -21852,7 +21903,8 @@ async function runInteractiveUninstall(options = {}) {
|
|
|
21852
21903
|
try {
|
|
21853
21904
|
const dockerCmd = process.platform === "win32" ? "docker.exe" : "docker";
|
|
21854
21905
|
const dockerDown = Bun.spawnSync([dockerCmd, "compose", "down"], {
|
|
21855
|
-
cwd: composeContext.projectDir
|
|
21906
|
+
cwd: composeContext.projectDir,
|
|
21907
|
+
timeout: 1000
|
|
21856
21908
|
});
|
|
21857
21909
|
if (dockerDown.exitCode === 0) {
|
|
21858
21910
|
stdout.write(isZh ? `\u2502 \u2714 Docker Broker \u5BB9\u5668\u5DF2\u505C\u6B62\u4E26\u6E05\u7406\u3002
|
|
@@ -22033,4 +22085,4 @@ export {
|
|
|
22033
22085
|
runBroker
|
|
22034
22086
|
};
|
|
22035
22087
|
|
|
22036
|
-
//# debugId=
|
|
22088
|
+
//# debugId=DAF810980632226264756E2164756E21
|