@txzy/automatic-bridge 0.1.0 → 0.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@txzy/automatic-bridge",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Bridge Automatic channels to Hermes or Codex CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/config.mjs CHANGED
@@ -23,7 +23,7 @@ function normalizeConfig(raw) {
23
23
  : splitCommandLine(raw.agentArgs || raw.HERMES_CLI_ARGS || raw.CODEX_CLI_ARGS || defaultAgentArgs(agentKind).join(","));
24
24
 
25
25
  return {
26
- baseUrl: String(raw.baseUrl || raw.AUTOMATIC_BASE_URL || "http://127.0.0.1:3000").replace(/\/$/, ""),
26
+ baseUrl: String(raw.baseUrl || raw.AUTOMATIC_BASE_URL || "https://tool.auto.txzy.net").replace(/\/$/, ""),
27
27
  channelIds: normalizeChannelIds(raw.channelIds || raw.AUTOMATIC_CHANNEL_IDS || raw.AUTOMATIC_CHANNEL_ID),
28
28
  agentKind,
29
29
  agentBin,
package/src/detect.mjs CHANGED
@@ -3,15 +3,21 @@ import fs from "node:fs";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
5
 
6
+ const IS_WINDOWS = process.platform === "win32";
7
+
6
8
  const CANDIDATES = {
7
9
  hermes: [
8
10
  process.env.HERMES_CLI_BIN,
9
11
  "hermes",
12
+ IS_WINDOWS ? "hermes.exe" : null,
13
+ IS_WINDOWS ? "hermes.cmd" : null,
10
14
  path.join(os.homedir(), ".hermes", "hermes-agent", "venv", "bin", "hermes"),
11
15
  ],
12
16
  codex: [
13
17
  process.env.CODEX_CLI_BIN,
14
18
  "codex",
19
+ IS_WINDOWS ? "codex.exe" : null,
20
+ IS_WINDOWS ? "codex.cmd" : null,
15
21
  ],
16
22
  };
17
23
 
@@ -25,8 +31,13 @@ function isExecutable(filePath) {
25
31
  }
26
32
 
27
33
  function commandExists(command) {
28
- const result = spawnSync(command, ["--help"], { stdio: "ignore", shell: false });
29
- return !result.error && result.status !== 127;
34
+ if (!command) return false;
35
+ if (IS_WINDOWS) {
36
+ const result = spawnSync("where", [command], { stdio: "ignore", shell: false });
37
+ return !result.error && result.status === 0;
38
+ }
39
+ const result = spawnSync("sh", ["-lc", `command -v ${command}`], { stdio: "ignore", shell: false });
40
+ return !result.error && result.status === 0;
30
41
  }
31
42
 
32
43
  function probeCandidate(candidate) {