opencode-telegram-link 1.0.0-rc.3 → 1.0.0-rc.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.
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.3** (OpenCode Commander Web Dashboard, Proactive Remote Dispatch, Multi-Engine Voice STT, Multi-Host Gateway & Node Agent Architecture).
6
- > Status: Release Candidate 3. Install from a release tarball or source checkout until the first public npm package is published.
5
+ > Version: **v1.0.0-rc.4** (OpenCode Commander Web Dashboard, Proactive Remote Dispatch, Multi-Engine Voice STT, Multi-Host Gateway & Node Agent Architecture).
6
+ > Status: Release Candidate 4. 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.3)
12
+ ## Features & Highlights (v1.0.0-rc.4)
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.
@@ -15781,14 +15781,11 @@ async function injectOpenCodeConfig(targetPath, config2) {
15781
15781
  chatId: config2.telegram.chatId
15782
15782
  };
15783
15783
  }
15784
+ delete existingJson["opencode-telegram-link"];
15785
+ delete existingJson["telegram-link"];
15784
15786
  const isMatch = (entry) => {
15785
- if (typeof entry === "string") {
15786
- return entry === "opencode-telegram-link" || entry.endsWith("opencode-telegram-link");
15787
- }
15788
- if (Array.isArray(entry) && typeof entry[0] === "string") {
15789
- return entry[0] === "opencode-telegram-link" || entry[0].endsWith("opencode-telegram-link");
15790
- }
15791
- return false;
15787
+ const name = typeof entry === "string" ? entry : Array.isArray(entry) && typeof entry[0] === "string" ? entry[0] : "";
15788
+ return name === "opencode-telegram-link" || name.startsWith("opencode-telegram-link") || name.includes("opencode-telegram-link") || name.includes("opencode_notification") || name.includes("telegram-link");
15792
15789
  };
15793
15790
  function mergePluginOptions(existing, updated) {
15794
15791
  const existingObj = existing && typeof existing === "object" && !Array.isArray(existing) ? existing : {};
@@ -15811,19 +15808,15 @@ async function injectOpenCodeConfig(targetPath, config2) {
15811
15808
  return merged;
15812
15809
  }
15813
15810
  if (Array.isArray(existingJson.plugin)) {
15814
- const index = existingJson.plugin.findIndex(isMatch);
15815
- if (index >= 0) {
15816
- const existingEntry = existingJson.plugin[index];
15817
- const existingOptions = Array.isArray(existingEntry) ? existingEntry[1] : undefined;
15818
- const pluginName = Array.isArray(existingEntry) && typeof existingEntry[0] === "string" ? existingEntry[0] : "opencode-telegram-link";
15819
- existingJson.plugin[index] = [pluginName, mergePluginOptions(existingOptions, pluginConfig)];
15820
- } else {
15821
- existingJson.plugin.push(["opencode-telegram-link", pluginConfig]);
15822
- }
15811
+ const existingEntry = existingJson.plugin.find(isMatch);
15812
+ const existingOptions = Array.isArray(existingEntry) ? existingEntry[1] : undefined;
15813
+ const mergedOptions = mergePluginOptions(existingOptions, pluginConfig);
15814
+ const cleanedPlugins = existingJson.plugin.filter((p) => !isMatch(p));
15815
+ cleanedPlugins.push(["opencode-telegram-link", mergedOptions]);
15816
+ existingJson.plugin = cleanedPlugins;
15823
15817
  } else if (Array.isArray(existingJson.plugins)) {
15824
- if (!existingJson.plugins.includes("opencode-telegram-link")) {
15825
- existingJson.plugins.push("opencode-telegram-link");
15826
- }
15818
+ const plugins = existingJson.plugins;
15819
+ existingJson.plugins = [...plugins.filter((p) => !isMatch(p)), "opencode-telegram-link"];
15827
15820
  const existingPluginMap = existingJson.plugin && typeof existingJson.plugin === "object" ? existingJson.plugin : {};
15828
15821
  existingPluginMap["opencode-telegram-link"] = mergePluginOptions(existingPluginMap["opencode-telegram-link"], pluginConfig);
15829
15822
  existingJson.plugin = existingPluginMap;
@@ -15845,14 +15838,17 @@ async function removeOpenCodeConfig(targetPath) {
15845
15838
  const existingJson = parseJsonc(existingContent);
15846
15839
  let modified = false;
15847
15840
  const isPluginMatch = (entry) => {
15848
- if (typeof entry === "string") {
15849
- return entry === "opencode-telegram-link" || entry.endsWith("opencode_notification") || entry.endsWith("opencode-telegram-link");
15850
- }
15851
- if (Array.isArray(entry) && typeof entry[0] === "string") {
15852
- return isPluginMatch(entry[0]);
15853
- }
15854
- return false;
15841
+ const name = typeof entry === "string" ? entry : Array.isArray(entry) && typeof entry[0] === "string" ? entry[0] : "";
15842
+ return name === "opencode-telegram-link" || name.startsWith("opencode-telegram-link") || name.includes("opencode-telegram-link") || name.includes("opencode_notification") || name.includes("telegram-link");
15855
15843
  };
15844
+ if ("opencode-telegram-link" in existingJson) {
15845
+ delete existingJson["opencode-telegram-link"];
15846
+ modified = true;
15847
+ }
15848
+ if ("telegram-link" in existingJson) {
15849
+ delete existingJson["telegram-link"];
15850
+ modified = true;
15851
+ }
15856
15852
  if (Array.isArray(existingJson.plugin)) {
15857
15853
  const originalLength = existingJson.plugin.length;
15858
15854
  const filtered = existingJson.plugin.filter((p) => !isPluginMatch(p));
@@ -17986,7 +17982,7 @@ function rejectionHash(updateId, reason) {
17986
17982
  import { randomUUID as randomUUID4 } from "crypto";
17987
17983
 
17988
17984
  // src/version.ts
17989
- var PACKAGE_VERSION = "1.0.0-rc.3";
17985
+ var PACKAGE_VERSION = "1.0.0-rc.4";
17990
17986
 
17991
17987
  // src/telegram/commands.ts
17992
17988
  function isSlashCommand(text) {
@@ -21740,15 +21736,20 @@ async function runInteractiveUninstall(options = {}) {
21740
21736
  stdout.write(isZh ? `\u25C7 [1/4] \u6B63\u5728\u6AA2\u67E5\u4E26\u505C\u6B62\u57F7\u884C\u4E2D\u7684 Broker (\u672C\u6A5F\u7A0B\u5E8F\u6216 Docker \u5BB9\u5668)...
21741
21737
  ` : `\u25C7 [1/4] Checking and stopping running Broker (native process or Docker container)...
21742
21738
  `);
21743
- try {
21744
- const dockerCmd = process.platform === "win32" ? "docker.exe" : "docker";
21745
- const dockerDown = Bun.spawnSync([dockerCmd, "compose", "down"], { cwd });
21746
- if (dockerDown.exitCode === 0) {
21747
- stdout.write(isZh ? `\u2502 \u2714 Docker Broker \u5BB9\u5668\u5DF2\u505C\u6B62\u4E26\u6E05\u7406\u3002
21739
+ const composeContext = resolveDockerComposeContext(cwd);
21740
+ if (composeContext) {
21741
+ try {
21742
+ const dockerCmd = process.platform === "win32" ? "docker.exe" : "docker";
21743
+ const dockerDown = Bun.spawnSync([dockerCmd, "compose", "down"], {
21744
+ cwd: composeContext.projectDir
21745
+ });
21746
+ if (dockerDown.exitCode === 0) {
21747
+ stdout.write(isZh ? `\u2502 \u2714 Docker Broker \u5BB9\u5668\u5DF2\u505C\u6B62\u4E26\u6E05\u7406\u3002
21748
21748
  ` : `\u2502 \u2714 Docker Broker container stopped and cleaned up.
21749
21749
  `);
21750
- }
21751
- } catch {}
21750
+ }
21751
+ } catch {}
21752
+ }
21752
21753
  try {
21753
21754
  const identity = await loadOrCreateStateIdentity(stateDirectory);
21754
21755
  const isRunning = await probeBroker(42617, identity.brokerSecret);
@@ -21913,4 +21914,4 @@ export {
21913
21914
  runBroker
21914
21915
  };
21915
21916
 
21916
- //# debugId=4DA37A84D8B98D2764756E2164756E21
21917
+ //# debugId=81AE8738AC7A8E1264756E2164756E21