summrise-agent 1.2.477 → 1.2.478

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/bin/summrise.js CHANGED
@@ -1687,13 +1687,24 @@ const commands = {
1687
1687
  let ti = args.indexOf("--tunnel");
1688
1688
  let tunnelHost = ti >= 0 ? args[ti + 1] : "";
1689
1689
  let wantTunnel = args.includes("--tunnel") || !!process.env.CLOUDFLARE_API_TOKEN;
1690
- // Device hostname for self-register: explicit --hostname, else default
1691
- // d1.agent.saisi.online. Written to summrise-agent.hostname (the agent's
1692
- // self-register reads it at boot).
1690
+ // Device hostname for self-register: explicit --hostname, else THIS MACHINE'S NAME.
1691
+ //
1692
+ // **THE DEFAULT USED TO BE `d1.agent.saisi.online` — THE DEVELOPER'S OWN DEVICE — AND EVERY
1693
+ // FRESH INSTALL INHERITED IT** (measured 2026-09-27 on a second Windows machine). The operator
1694
+ // asked the obvious question: *"为什么注册还是d1,新设备不是应该是其他的吗"*. Everything
1695
+ // downstream followed from that one string: the console registered the new machine as `d1`, and
1696
+ // the tunnel was named `summrise-agent-d1` — colliding with the real one, which this file's own
1697
+ // self-register path reports as `(hostname/token conflict — resolve via the console Devices
1698
+ // page)`. **A DEFAULT THAT NAMES SOMEBODY ELSE'S MACHINE IS NOT A DEFAULT.**
1699
+ //
1700
+ // `COMPUTERNAME` is what Windows calls the machine; lower-cased it is a valid DNS label, and
1701
+ // the suffix keeps it under the zone the tunnel route is created in. `SUMMRISE_HOSTNAME` still
1702
+ // wins when set, and `--hostname` still wins over both.
1693
1703
  const hi = args.indexOf("--hostname");
1704
+ const machineName = (process.env.COMPUTERNAME || "device").toLowerCase().replace(/[^a-z0-9-]/g, "-");
1694
1705
  const deviceHost = hi >= 0
1695
1706
  ? args[hi + 1]
1696
- : process.env.SUMMRISE_HOSTNAME || "d1.agent.saisi.online";
1707
+ : process.env.SUMMRISE_HOSTNAME || `${machineName}.agent.saisi.online`;
1697
1708
  // review #1 (HIGH): the hostname write ran BEFORE the mkdirSync below —
1698
1709
  // on a FRESH machine DIR doesn't exist yet → ENOENT throw → setup died
1699
1710
  // having installed nothing. Ensure the dir first.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "summrise-agent",
3
- "version": "1.2.477",
3
+ "version": "1.2.478",
4
4
  "description": "Summrise Agent — Windows device MCP server (terminal/SSH/serial) + panel. Self-hosted npm distribution.",
5
5
  "//build": "唯一构建路径:在本目录执行 npm run build。它是自包含的:经 npm exec 按需拉取 typescript@5,无需预装任何 node_modules(干净检出可跑;旧脚本引用 ../summrise-desktop-electron/node_modules/.bin/tsc,干净检出必 ENOENT)。必须用 npm exec --package … -- tsc 的形式:npx 会吃掉传给 tsc 的 -p/--outDir 等参数(round-435:npx 写法从未真正跑通过)。先编 electron TS(--noCheck 纯 emit,与 release.yml 一致)同步两处 src/*.js,再编 src/summrise.ts 到 bin/summrise.js 并校验 round-298 标记(弱 oracle,只证某次构建发生,新鲜性由 publish-release.sh 的 tsc 重编 + cmp 门保证)。",
6
6
  "bin": {
Binary file