@tt-a1i/hive 1.2.0 → 1.3.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.
Files changed (75) hide show
  1. package/CHANGELOG.md +119 -14
  2. package/README.en.md +63 -8
  3. package/README.md +37 -6
  4. package/assets/hive-team-view.png +0 -0
  5. package/dist/src/cli/hive-update.d.ts +15 -0
  6. package/dist/src/cli/hive-update.js +81 -0
  7. package/dist/src/cli/hive.js +21 -5
  8. package/dist/src/cli/team.d.ts +6 -0
  9. package/dist/src/cli/team.js +48 -0
  10. package/dist/src/server/agent-launch-cache.js +25 -6
  11. package/dist/src/server/agent-manager.d.ts +2 -2
  12. package/dist/src/server/agent-run-store.d.ts +1 -1
  13. package/dist/src/server/agent-runtime-contract.d.ts +3 -0
  14. package/dist/src/server/agent-runtime.js +3 -0
  15. package/dist/src/server/agent-startup-instructions.js +1 -1
  16. package/dist/src/server/agent-stdin-dispatcher.d.ts +4 -0
  17. package/dist/src/server/agent-stdin-dispatcher.js +12 -0
  18. package/dist/src/server/app.js +12 -1
  19. package/dist/src/server/dispatch-ledger-store.d.ts +22 -1
  20. package/dist/src/server/dispatch-ledger-store.js +34 -3
  21. package/dist/src/server/hive-team-guidance.js +3 -1
  22. package/dist/src/server/open-target-commands.js +0 -17
  23. package/dist/src/server/package-version.d.ts +15 -0
  24. package/dist/src/server/package-version.js +15 -0
  25. package/dist/src/server/route-types.d.ts +7 -0
  26. package/dist/src/server/routes-dispatches.js +4 -2
  27. package/dist/src/server/routes-runtime.js +1 -0
  28. package/dist/src/server/routes-team.js +22 -0
  29. package/dist/src/server/runtime-store-helpers.d.ts +2 -1
  30. package/dist/src/server/runtime-store-helpers.js +14 -4
  31. package/dist/src/server/runtime-store.d.ts +5 -8
  32. package/dist/src/server/runtime-store.js +1 -0
  33. package/dist/src/server/tasks-websocket-server.d.ts +2 -1
  34. package/dist/src/server/tasks-websocket-server.js +18 -2
  35. package/dist/src/server/team-authz.d.ts +1 -1
  36. package/dist/src/server/team-authz.js +1 -1
  37. package/dist/src/server/team-operations.d.ts +16 -1
  38. package/dist/src/server/team-operations.js +28 -1
  39. package/dist/src/server/terminal-input-profile.d.ts +10 -0
  40. package/dist/src/server/terminal-input-profile.js +15 -0
  41. package/dist/src/server/terminal-stream-hub.js +10 -2
  42. package/dist/src/server/terminal-ws-server.d.ts +2 -1
  43. package/dist/src/server/terminal-ws-server.js +2 -2
  44. package/dist/src/server/version-service.js +4 -1
  45. package/dist/src/server/workspace-shell-runtime.d.ts +2 -1
  46. package/dist/src/server/workspace-shell-runtime.js +37 -10
  47. package/dist/src/server/workspace-store-contract.d.ts +1 -0
  48. package/dist/src/server/workspace-store-mutations.d.ts +1 -0
  49. package/dist/src/server/workspace-store-mutations.js +1 -0
  50. package/dist/src/server/workspace-store.js +2 -1
  51. package/dist/src/shared/open-targets.d.ts +1 -1
  52. package/dist/src/shared/open-targets.js +9 -16
  53. package/package.json +2 -2
  54. package/web/dist/assets/AddWorkerDialog-D6-K1wJm.js +1 -0
  55. package/web/dist/assets/AddWorkspaceDialog-Du0lndJ0.js +1 -0
  56. package/web/dist/assets/FirstRunWizard-B8k7S5De.js +1 -0
  57. package/web/dist/assets/WorkerModal-B3XhIvAX.js +1 -0
  58. package/web/dist/assets/WorkspaceTaskDrawer-CjEoLJvS.js +1 -0
  59. package/web/dist/assets/chevron-right-BvbSCniy.js +1 -0
  60. package/web/dist/assets/finder-C4Jmsb0B.png +0 -0
  61. package/web/dist/assets/ghostty-D-Js4rdm.png +0 -0
  62. package/web/dist/assets/index-DB5fHAMI.js +81 -0
  63. package/web/dist/assets/index-Sbdu6Se0.css +1 -0
  64. package/web/dist/assets/zed-C5BQT8X3.png +0 -0
  65. package/web/dist/icons/apple-touch-icon-180.png +0 -0
  66. package/web/dist/icons/icon-192.png +0 -0
  67. package/web/dist/icons/icon-32.png +0 -0
  68. package/web/dist/icons/icon-512-maskable.png +0 -0
  69. package/web/dist/icons/icon-512.png +0 -0
  70. package/web/dist/index.html +11 -3
  71. package/web/dist/manifest.webmanifest +60 -0
  72. package/web/dist/screenshots/wide-overview.png +0 -0
  73. package/web/dist/sw.js +99 -0
  74. package/web/dist/assets/index-BgXxFsKj.css +0 -1
  75. package/web/dist/assets/index-VeKhgpe_.js +0 -66
package/CHANGELOG.md CHANGED
@@ -2,6 +2,118 @@
2
2
 
3
3
  All notable user-facing changes will be documented in this file.
4
4
 
5
+ ## 1.3.4 - 2026-05-21
6
+
7
+ Terminal performance and Tasks panel polish.
8
+
9
+ - Improves terminal responsiveness by keeping mounted terminal hosts stable,
10
+ lazy-loading heavier xterm addons, and reducing terminal-run polling churn.
11
+ - Fixes OpenCode TUI wheel and mouse handling by preserving binary input for
12
+ normal terminals while translating OpenCode legacy mouse reports into the
13
+ SGR format it handles correctly.
14
+ - Sends a current `.hive/tasks.md` snapshot when a Tasks websocket connects,
15
+ and guards that initial read so a missing or unreadable file does not break
16
+ the websocket session.
17
+ - Renames the visible Todo entry to **Tasks** and widens the Tasks side panel
18
+ to match the default Team Members pane width.
19
+ - Enlarges the Team Members header and count badge for better readability.
20
+
21
+ ## 1.3.3 - 2026-05-21
22
+
23
+ OpenCode terminal scrolling and small UI polish.
24
+
25
+ - Restores the Task Graph topbar entry so the graph view is available again
26
+ from the main shell.
27
+ - Updates generated worker names to use localized, role-scoped historical
28
+ figure name pools, making Chinese and English workspaces feel less generic.
29
+ - Fixes OpenCode TUI mouse-wheel scrolling inside Hive terminal panels. Hive now
30
+ tags each terminal run with an input profile and maps OpenCode wheel events to
31
+ the keys OpenCode's message viewport actually handles (`Ctrl+D` / `Ctrl+U`),
32
+ while leaving other alternate-screen TUIs on the existing arrow-key fallback.
33
+ - Preserves that OpenCode profile when the user selects the OpenCode preset but
34
+ starts it through a custom startup command such as `opencode --continue`.
35
+ - Keeps workspace shell terminals on the default input profile.
36
+ - Enlarges the Team Members header count for better readability.
37
+ - Documents that npm's `prebuild-install@7.1.3` deprecation warning comes from
38
+ the upstream native-binary installer chain and is safe to ignore.
39
+
40
+ ## 1.3.0 - 2026-05-20
41
+
42
+ Installable Hive: turns the web shell into a real PWA so Chrome / Edge can
43
+ launch it from a dock icon, in its own window, without a visible browser
44
+ chrome.
45
+
46
+ - Adds a web app manifest with icons (192, 512, maskable 512, apple-touch 180),
47
+ a wide screenshot, and shortcuts for "Add Workspace" and "Try Demo" so
48
+ right-clicking the dock icon jumps straight to those flows.
49
+ - Installation is driven entirely by the browser's omnibox install icon
50
+ (Chrome / Edge / Brave); Hive deliberately does not add a redundant topbar
51
+ button.
52
+ - Ships a service worker (`/sw.js`) that caches the SPA shell + hashed asset
53
+ chunks + static icons / sounds / cli-icons, but never intercepts `/api/*`,
54
+ `/ws/*`, or non-GET requests — auth cookies and WebSockets keep their
55
+ native paths. Each release writes to its own cache bucket and older buckets
56
+ are kept so tabs still controlled by the previous SW can resolve their
57
+ lazy-imported chunks.
58
+ - Surfaces shell updates as a bottom-right toast (`Web UI updated — Reload to
59
+ activate`) instead of forcing a refresh. The Reload button stays disabled
60
+ while any terminal run is still working so updates never interrupt an
61
+ in-flight agent.
62
+ - Routes service-worker auto-reloads through the same silent reload helper used
63
+ elsewhere in the app, so browser updates do not trip the close-confirmation
64
+ guard.
65
+ - Replaces the workspace area with a dedicated `Hive runtime is not running`
66
+ page when the initial bootstrap fails. The page pings `/api/version` every
67
+ three seconds and reloads automatically once the daemon comes back; a manual
68
+ Retry button is offered alongside.
69
+ - Hardens the server: `/sw.js` is served with `Cache-Control: no-store` and the
70
+ manifest with `Cache-Control: max-age=0, must-revalidate`, so SW updates
71
+ propagate the next time the browser checks instead of waiting on a stale
72
+ HTTP cache.
73
+ - Notes for first-time installers: the SW activates after the first reload
74
+ following install. On separate ports (`hive --port 4011` vs `--port 3000`)
75
+ Chrome treats Hive as two distinct PWAs because the install scope is keyed
76
+ by origin. To fully remove a PWA install, use
77
+ `chrome://apps` → right-click the Hive tile → Remove.
78
+ - Always asks the browser to confirm before closing the tab or PWA window so
79
+ Cmd-W on an installed app never closes silently. Modern browsers gate the
80
+ prompt on prior page interaction — opening the window and immediately
81
+ pressing Cmd-W still closes cleanly by browser policy.
82
+ - Open Workspace dropdown now uses each app's brand color for its icon
83
+ instead of the previous monochrome white treatment, and visually separates
84
+ VS Code from VS Code Insiders so users can tell their installed targets
85
+ apart at a glance.
86
+ - Workspace avatars in the sidebar stay the same size when the user drags
87
+ the sidebar wider. Previously the wide layout used a 22px avatar while the
88
+ collapsed layout used 32px, so expanding the sidebar made the avatars
89
+ smaller; both modes now render at 32px.
90
+ - Drops IntelliJ IDEA, Windsurf, and iTerm2 from the Open Workspace dropdown.
91
+ IntelliJ users typically launch from JetBrains Toolbox rather than a folder
92
+ picker; Windsurf overlaps with the existing Cursor / VS Code entries;
93
+ iTerm2 overlaps with the built-in macOS Terminal entry. macOS now exposes
94
+ seven targets (VS Code, VS Code Insiders, Cursor, Finder, Terminal,
95
+ Ghostty, Zed); Windows / Linux expose five (VS Code, VS Code Insiders,
96
+ Cursor, File Explorer / File Manager, Zed). A stored preference for any
97
+ removed target silently falls back to the platform default at load time.
98
+ - Swaps the Zed, Ghostty, and Finder dropdown icons for the apps' official
99
+ brand marks (Finder uses the macOS app icon, Ghostty 96×96 / Zed 64×64
100
+ raster) so each entry reads as the real application rather than an
101
+ abstract glyph. Ghostty's mark renders inside a generous safe-zone so its
102
+ display size is bumped 20% via CSS scale to balance the row visually.
103
+ - Replaces the Worker detail modal and Workspace shell dialog with a docked,
104
+ resizable, VSCode-style terminal panel inside the right column (under the
105
+ team members pane). Worker tabs and shell tabs share the strip; clicking a
106
+ member card opens that worker as a tab; the panel hides when no tabs are
107
+ open. Closing a worker tab keeps the underlying PTY running — worker
108
+ lifecycle is owned by the card hover cluster. Tab list, active tab, and
109
+ panel height all persist (height globally, tabs + active per-workspace).
110
+ Cmd-W (Ctrl-W on Windows / Linux) closes the active tab; a "+" button in
111
+ the tab strip starts a new shell. Start failures and shell-start failures
112
+ now surface as toasts instead of inline modal/dialog banners.
113
+ - Moves "Save as template" into the role-instructions toolbar in the Add Member
114
+ flow, keeping template actions closer to the prompt editor instead of adding
115
+ another standalone control in the dialog body.
116
+
5
117
  ## 1.2.0 - 2026-05-18
6
118
 
7
119
  Opens the active workspace in your editor, terminal, or file manager from
@@ -58,37 +170,30 @@ Brand polish.
58
170
 
59
171
  ## 1.1.2 - 2026-05-17
60
172
 
61
- Private-release workflow fix.
173
+ Release workflow fix.
62
174
 
63
175
  - Runs npm publish on Ubuntu instead of macOS. Publishing does not require
64
- macOS, and the Ubuntu runner avoids unnecessary private-repo Actions cost.
176
+ macOS, and the Ubuntu runner is a better fit for the publish step.
65
177
 
66
178
  ## 1.1.1 - 2026-05-17
67
179
 
68
- Private-release workflow fix.
180
+ Release workflow fix.
69
181
 
70
- - Publishes from the private product repository without npm provenance because
71
- npm provenance currently requires a public GitHub Actions source repository.
72
- The package contents are otherwise the same 1.1.x private-release line:
73
- Workspace terminal tabs, hidden dormant Blueprint entry, and no production
74
- source maps in the npm tarball.
182
+ - Publishes without production source maps in the npm tarball while keeping the
183
+ user-facing package contents unchanged.
75
184
 
76
185
  ## 1.1.0 - 2026-05-17
77
186
 
78
- Private-release line.
187
+ Workspace terminal release.
79
188
 
80
189
  - Added a Workspace terminal that opens from the active workspace and runs in
81
190
  the workspace directory. It supports multiple shell tabs, full-height terminal
82
191
  space, tab switching, and closing individual tabs without closing the whole
83
192
  dialog.
84
193
  - Kept the external install path unchanged. Users still install with
85
- `npm install -g @tt-a1i/hive` or run with `npx @tt-a1i/hive`; this release is
86
- built from the private product repository and published to the same npm
87
- package.
194
+ `npm install -g @tt-a1i/hive` or run with `npx @tt-a1i/hive`.
88
195
  - Hid the dormant task-graph / Blueprint entry from the main UI while keeping
89
196
  the underlying code in place for possible future use.
90
- - Documented the public/private repository split and release policy in
91
- `docs/private-release-strategy.md`.
92
197
 
93
198
  ## 1.0.0 - 2026-05-17
94
199
 
package/README.en.md CHANGED
@@ -1,3 +1,7 @@
1
+ <p align="center">
2
+ <img src="./assets/logo.png" width="120" alt="Hive logo" />
3
+ </p>
4
+
1
5
  # Hive
2
6
 
3
7
  <p align="center">
@@ -15,12 +19,12 @@ Code, research, drafts, translations — if a team can split the work, a hive ca
15
19
 
16
20
  [![npm](https://img.shields.io/npm/v/@tt-a1i/hive.svg)](https://www.npmjs.com/package/@tt-a1i/hive)
17
21
  [![ci](https://img.shields.io/github/actions/workflow/status/tt-a1i/hive/release.yml?branch=main&label=ci)](https://github.com/tt-a1i/hive/actions/workflows/release.yml)
18
- [![Website](https://img.shields.io/badge/website-hive--site.pages.dev-5a8a8a.svg)](https://hive-site.pages.dev)
22
+ [![Website](https://img.shields.io/badge/website-hivehq.dev-5a8a8a.svg)](https://hivehq.dev)
19
23
  [![Node](https://img.shields.io/badge/node-%3E%3D22-3c873a.svg)](https://nodejs.org/)
20
24
  [![License](https://img.shields.io/badge/license-BUSL--1.1-orange.svg)](./LICENSE.BSL)
21
25
  [![Platforms](https://img.shields.io/badge/platforms-macOS%20%C2%B7%20Linux%20%C2%B7%20Windows%20(best--effort)-lightgrey.svg)](#platform-support)
22
26
 
23
- 🌐 **Website**: [hive-site.pages.dev/en/](https://hive-site.pages.dev/en/) · [中文](https://hive-site.pages.dev/)
27
+ 🌐 **Website**: [hivehq.dev/en/](https://hivehq.dev/en/) · [中文](https://hivehq.dev/)
24
28
 
25
29
  English · [简体中文](./README.md)
26
30
 
@@ -29,6 +33,10 @@ English · [简体中文](./README.md)
29
33
  > [npm](https://www.npmjs.com/package/@tt-a1i/hive) and the badge above resolves
30
34
  > to it.
31
35
 
36
+ <p align="center">
37
+ <img src="./assets/hive-team-view.png" alt="Hive workbench with a 4-agent team — orchestrator dispatching while workers run" />
38
+ </p>
39
+
32
40
  ## Why Hive
33
41
 
34
42
  CLI agents are powerful, but coordinating several of them manually is
@@ -71,6 +79,39 @@ hive
71
79
  Open the printed local URL, usually `http://127.0.0.1:3000/`. Use
72
80
  `hive --port 4010` when you need a specific local port.
73
81
 
82
+ To upgrade in place:
83
+
84
+ ```bash
85
+ hive update
86
+ ```
87
+
88
+ `hive update` runs `npm install -g @tt-a1i/hive@latest` in place. Restart any
89
+ in-flight Hive process to pick up the new version. If you installed Hive with
90
+ pnpm or yarn, upgrade through the same package manager — otherwise the new
91
+ npm copy will shadow your existing install.
92
+
93
+ Install Hive as an app (optional):
94
+
95
+ Open `http://127.0.0.1:3000/` in Chrome, Edge, or Brave and click the install
96
+ icon at the right edge of the browser's omnibox. The PWA launches in its own
97
+ dock-anchored window without browser chrome and shows **Add Workspace** /
98
+ **Try Demo** shortcuts from the dock right-click menu. Firefox and Safari
99
+ currently don't implement the install-prompt protocol, so the omnibox icon
100
+ only appears in Chromium-based browsers.
101
+
102
+ The Hive daemon must still be running for the PWA to do anything; if the
103
+ runtime isn't reachable when you launch the app, you'll see a "Hive runtime
104
+ is not running" page that auto-reloads once `hive` is back on `127.0.0.1`.
105
+ The PWA install scope is keyed by origin, so `hive --port 4011` installs as
106
+ a separate app from `hive --port 3000`. To uninstall, visit `chrome://apps`,
107
+ right-click the Hive tile, and choose **Remove from Chrome…**.
108
+
109
+ Hive asks the browser to confirm before closing the tab or PWA window so an
110
+ accidental Cmd-W doesn't drop your session. Modern browsers gate that prompt
111
+ on prior page interaction — if you open the PWA and immediately press Cmd-W
112
+ without clicking or typing anywhere first, it still closes cleanly. That's a
113
+ browser policy, not a Hive bug.
114
+
74
115
  First-run flow:
75
116
 
76
117
  1. Create a workspace from a project folder.
@@ -203,6 +244,11 @@ Hive depends on `node-pty` and `better-sqlite3`, which use native binaries. Use
203
244
  Node.js 22+, keep your package manager cache clean, and verify your platform
204
245
  build tools are available.
205
246
 
247
+ If npm prints a deprecated warning for `prebuild-install@7.1.3`, it is safe to
248
+ ignore. The warning comes from `better-sqlite3`'s native binary download chain;
249
+ it is an upstream installer maintenance notice, not a Hive install failure, and
250
+ does not affect runtime behavior.
251
+
206
252
  **Folder picker does not open on Linux**
207
253
 
208
254
  Install `zenity`, or paste the workspace path manually.
@@ -267,12 +313,21 @@ verifies macOS, Ubuntu, and Windows, then publishes to npm with `NPM_TOKEN`.
267
313
 
268
314
  ## Status
269
315
 
270
- Hive is published as a stable release. Current work focuses on polishing the
271
- multi-agent collaboration workflow, Windows support, and clearer orchestration
272
- observability.
316
+ Hive is in alpha. The core flow is usable today; current work focuses on
317
+ polishing the multi-agent collaboration workflow, Windows support, and clearer
318
+ orchestration observability. Try it out and open issues — feedback shapes what
319
+ gets prioritized next.
273
320
 
274
- ## License
321
+ ## A different form factor: squad
322
+
323
+ If you'd rather have **pure CLI, zero background process, and the ability to
324
+ run on a remote SSH box**, [squad](https://github.com/mco-org/squad) takes the
325
+ same idea down a different path — SQLite as the protocol layer, one terminal
326
+ per agent. The two projects don't replace each other; pick by workflow:
275
327
 
276
- Hive is licensed under the Business Source License 1.1 (see [LICENSE.BSL](LICENSE.BSL)). BSL permits personal use, internal deployment, embedding in non-competitive products, and non-commercial forks; it **only prohibits** offering Hive as a hosted multi-agent orchestration service to third parties.
328
+ - **Hive** visual workbench, one-click restart, workspace sidebar, easier to demo to a team
329
+ - **squad** — lives in tmux, SSH remote dev, no extra background process, Windows servers
330
+
331
+ ## License
277
332
 
278
- See the Additional Use Grant in [LICENSE.BSL](LICENSE.BSL) for the exact boundary.
333
+ Hive is open source under the Business Source License 1.1. Personal use, internal deployment, embedding, and forks are permitted — see [LICENSE.BSL](LICENSE.BSL) for the exact boundary.
package/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ <p align="center">
2
+ <img src="./assets/logo.png" width="120" alt="Hive logo" />
3
+ </p>
4
+
1
5
  # Hive
2
6
 
3
7
  <p align="center">
@@ -10,17 +14,21 @@
10
14
 
11
15
  [![npm](https://img.shields.io/npm/v/@tt-a1i/hive.svg)](https://www.npmjs.com/package/@tt-a1i/hive)
12
16
  [![ci](https://img.shields.io/github/actions/workflow/status/tt-a1i/hive/release.yml?branch=main&label=ci)](https://github.com/tt-a1i/hive/actions/workflows/release.yml)
13
- [![Website](https://img.shields.io/badge/website-hive--site.pages.dev-5a8a8a.svg)](https://hive-site.pages.dev)
17
+ [![Website](https://img.shields.io/badge/website-hivehq.dev-5a8a8a.svg)](https://hivehq.dev)
14
18
  [![Node](https://img.shields.io/badge/node-%3E%3D22-3c873a.svg)](https://nodejs.org/)
15
19
  [![License](https://img.shields.io/badge/license-BUSL--1.1-orange.svg)](./LICENSE.BSL)
16
20
  [![Platforms](https://img.shields.io/badge/platforms-macOS%20%C2%B7%20Linux%20%C2%B7%20Windows%20(best--effort)-lightgrey.svg)](#平台支持)
17
21
 
18
- 🌐 **官网**:[hive-site.pages.dev](https://hive-site.pages.dev/)([English](https://hive-site.pages.dev/en/))
22
+ 🌐 **官网**:[hivehq.dev](https://hivehq.dev/)([English](https://hivehq.dev/en/))
19
23
 
20
24
  [English](./README.en.md) · 简体中文
21
25
 
22
26
  > Hive 是本机优先的工具,只监听 `127.0.0.1`,面向已经在用 CLI Agent 的人。最新稳定版本见 [npm](https://www.npmjs.com/package/@tt-a1i/hive),上面的 badge 会指向它。
23
27
 
28
+ <p align="center">
29
+ <img src="./assets/hive-team-view.png" alt="Hive 工作台:4 个 CLI Agent 团队,Orchestrator 派单、Worker 各自开工" />
30
+ </p>
31
+
24
32
  ## 为什么需要 Hive
25
33
 
26
34
  CLI Agent 各自都很强,但同时管几个就有点别扭:
@@ -52,6 +60,22 @@ hive
52
60
 
53
61
  打开终端打印出来的本机地址,通常是 `http://127.0.0.1:3000/`。如果你想指定端口,可以用 `hive --port 4010`。
54
62
 
63
+ 升级到最新版本:
64
+
65
+ ```bash
66
+ hive update
67
+ ```
68
+
69
+ `hive update` 会在原位运行 `npm install -g @tt-a1i/hive@latest`,完事后重启 Hive 就能用上新版。如果当初是用 pnpm / yarn 装的 Hive,请用同一个包管理器升级,避免装出第二份。
70
+
71
+ 把 Hive 装为应用(可选):
72
+
73
+ 在 Chrome / Edge / Brave 里打开 `http://127.0.0.1:3000/`,点浏览器地址栏右侧的安装图标即可。装好后 Hive 会以独立窗口启动、有自己的 dock 图标,且 dock 右键菜单上会显示 **添加 Workspace** / **试用演示** 两个快捷入口。Firefox 和 Safari 暂未实现 PWA install-prompt 协议,浏览器地址栏的安装图标只在 Chromium 系浏览器里出现。
74
+
75
+ PWA 只是 UI 壳,Hive 后端仍需要在终端里跑着。如果启动 PWA 时后端没起,会看到 “Hive 后端未启动” 页面,等你跑起 `hive` 后会自动刷新。PWA 的 install scope 按 origin(含端口)划分,所以 `hive --port 4011` 跟 `hive --port 3000` 在浏览器看来是两个独立应用。卸载方法:浏览器地址栏访问 `chrome://apps`,右键 Hive 图标,选 **从 Chrome 中移除…**。
76
+
77
+ 关闭 PWA 窗口或 tab 时 Hive 会主动请求浏览器弹原生确认对话框,避免 Cmd+W 误关丢失会话。但现代浏览器要求你跟页面"交互过"(点击 / 滚动 / 输入)才会真的弹这个对话框——刚打开 PWA 立刻按 Cmd+W 仍会直接关闭,这是浏览器策略,不是 Hive 的 bug。
78
+
55
79
  首次使用流程:
56
80
 
57
81
  1. 选择一个项目目录作为 workspace。
@@ -157,6 +181,8 @@ hive --port 4020
157
181
 
158
182
  Hive 依赖 `node-pty` 和 `better-sqlite3`,它们用原生二进制。确认 Node.js 22+,清干净 package manager 缓存,并准备好你平台的构建工具(macOS Xcode CLI、Linux build-essential + python3、Windows VS Build Tools)。
159
183
 
184
+ 安装时如果看到 `prebuild-install@7.1.3` 的 deprecated warning,可以忽略。它来自 `better-sqlite3` 的原生二进制下载链路,只是上游安装器维护状态提示,不代表 Hive 安装失败,也不会影响运行。
185
+
160
186
  **Linux 上目录选择器不弹**
161
187
 
162
188
  装 `zenity`,或者直接在对话框里粘路径。
@@ -213,10 +239,15 @@ pnpm release:dry
213
239
 
214
240
  ## 状态
215
241
 
216
- Hive 已发布稳定版。当前重点是继续打磨多 Agent 协作体验、Windows 支持和更清晰的调度可观测性。
242
+ Hive 目前处于 alpha 阶段,核心流程已可用。当前重点是继续打磨多 Agent 协作体验、Windows 支持和更清晰的调度可观测性。欢迎试用、提 issue——反馈会直接影响后续节奏。
217
243
 
218
- ## License
244
+ ## 另一种形态:squad
245
+
246
+ 如果你更喜欢 **纯 CLI、零后台进程、能直接在 SSH 进的远端服务器上跑** 的形态,[squad](https://github.com/mco-org/squad) 是同一个想法的另一条路线——SQLite 当通信层,每个 agent 各自开一个终端。两个项目互不替代,按工作流挑就行:
219
247
 
220
- Hive 使用 Business Source License 1.1([LICENSE.BSL](LICENSE.BSL))。BSL 允许个人使用、内部部署、嵌入其他产品、非商业 fork;**仅禁止**把 Hive 包装成多 agent 协作 SaaS 卖给第三方。
248
+ - **Hive** 想要可视化工作台、一键重启、侧边栏切 workspace、给团队演示
249
+ - **squad** — 活在 tmux 里、SSH 远端开发、不想跑额外后台进程、Windows server
250
+
251
+ ## License
221
252
 
222
- 详细边界见 [LICENSE.BSL](LICENSE.BSL) 的 Additional Use Grant
253
+ Hive 在 Business Source License 1.1 下开源。个人使用、内部部署、嵌入、fork 都可以;详细边界见 [LICENSE.BSL](LICENSE.BSL)。
Binary file
@@ -0,0 +1,15 @@
1
+ export declare const HIVE_UPDATE_USAGE: string;
2
+ export interface RunUpdateResult {
3
+ exitCode: number;
4
+ spawnError?: Error;
5
+ }
6
+ export type RunUpdate = (command: string, args: readonly string[]) => Promise<RunUpdateResult>;
7
+ export declare const defaultRunUpdate: RunUpdate;
8
+ interface RunHiveUpdateOptions {
9
+ /** Inject a fake spawn for tests. */
10
+ runUpdate?: RunUpdate;
11
+ /** Override platform detection for tests. */
12
+ platform?: NodeJS.Platform;
13
+ }
14
+ export declare const runHiveUpdateCommand: (argv: string[], options?: RunHiveUpdateOptions) => Promise<number>;
15
+ export {};
@@ -0,0 +1,81 @@
1
+ import { spawn } from 'node:child_process';
2
+ import { getNpmCommand, INSTALL_COMMAND_ARGS, INSTALL_COMMAND_DISPLAY, } from '../server/package-version.js';
3
+ export const HIVE_UPDATE_USAGE = [
4
+ 'Usage:',
5
+ ' hive update',
6
+ '',
7
+ `Runs \`${INSTALL_COMMAND_DISPLAY}\` to upgrade Hive in place.`,
8
+ 'Restart any running Hive process afterwards to pick up the new version.',
9
+ '',
10
+ 'Note: only npm-installed Hive can be upgraded this way. If you installed',
11
+ 'Hive via pnpm or yarn, upgrade through the same package manager instead;',
12
+ 'otherwise the npm copy will shadow your existing install.',
13
+ '',
14
+ 'Options:',
15
+ ' -h, --help Print this help.',
16
+ ].join('\n');
17
+ export const defaultRunUpdate = (command, args) => new Promise((resolve) => {
18
+ const child = spawn(command, [...args], { stdio: 'inherit' });
19
+ let resolved = false;
20
+ // Forward Ctrl+C / SIGTERM to the npm child so it can clean up rather
21
+ // than getting orphaned mid-install. The handlers are registered with
22
+ // `once` so they don't accumulate across invocations, and we also
23
+ // explicitly remove them when the child exits in case the user only
24
+ // sent one signal (Node would otherwise keep the handler alive).
25
+ const handleSignal = (signal) => () => {
26
+ child.kill(signal);
27
+ };
28
+ const handleSigint = handleSignal('SIGINT');
29
+ const handleSigterm = handleSignal('SIGTERM');
30
+ process.once('SIGINT', handleSigint);
31
+ process.once('SIGTERM', handleSigterm);
32
+ const finalize = (result) => {
33
+ if (resolved)
34
+ return;
35
+ resolved = true;
36
+ process.off('SIGINT', handleSigint);
37
+ process.off('SIGTERM', handleSigterm);
38
+ resolve(result);
39
+ };
40
+ child.on('error', (error) => {
41
+ finalize({ exitCode: 1, spawnError: error });
42
+ });
43
+ child.on('close', (code) => {
44
+ finalize({ exitCode: typeof code === 'number' ? code : 1 });
45
+ });
46
+ });
47
+ const printManualFallback = () => {
48
+ console.error(`You can run the upgrade manually: ${INSTALL_COMMAND_DISPLAY}`);
49
+ };
50
+ export const runHiveUpdateCommand = async (argv, options = {}) => {
51
+ if (argv.includes('--help') || argv.includes('-h')) {
52
+ console.log(HIVE_UPDATE_USAGE);
53
+ return 0;
54
+ }
55
+ // Reject unknown flags rather than silently ignoring them — keeps behavior
56
+ // consistent with how `parsePort` validates `hive` itself.
57
+ const extra = argv.find((arg) => arg !== '--help' && arg !== '-h');
58
+ if (extra !== undefined) {
59
+ console.error(`Unknown argument: ${extra}`);
60
+ console.error(HIVE_UPDATE_USAGE);
61
+ return 1;
62
+ }
63
+ const run = options.runUpdate ?? defaultRunUpdate;
64
+ const command = getNpmCommand(options.platform);
65
+ console.log(`Running: ${INSTALL_COMMAND_DISPLAY}`);
66
+ const result = await run(command, INSTALL_COMMAND_ARGS);
67
+ if (result.spawnError) {
68
+ console.error(`Failed to spawn npm: ${result.spawnError.message}`);
69
+ printManualFallback();
70
+ return 1;
71
+ }
72
+ if (result.exitCode === 0) {
73
+ console.log('Hive updated. Restart any running Hive process to pick up the new version.');
74
+ return 0;
75
+ }
76
+ console.error(`npm install exited with code ${result.exitCode}.`);
77
+ // Permission failures (EACCES on root-owned /usr/bin/npm) and other
78
+ // non-spawn errors leave the user with copy-paste recovery either way.
79
+ printManualFallback();
80
+ return result.exitCode;
81
+ };
@@ -9,14 +9,19 @@ import { createApp } from '../server/app.js';
9
9
  import { readPackageVersion } from '../server/package-version.js';
10
10
  import { createRuntimeStore } from '../server/runtime-store.js';
11
11
  import { createVersionService } from '../server/version-service.js';
12
+ import { runHiveUpdateCommand } from './hive-update.js';
12
13
  export const HIVE_USAGE = [
13
14
  'Usage:',
14
15
  ' hive [--port <port>]',
16
+ ' hive update',
15
17
  '',
16
18
  'Options:',
17
19
  ' --port <port> Bind the local runtime to a specific port (default: 3000).',
18
20
  ' -h, --help Print this help.',
19
21
  ' -v, --version Print the installed Hive version.',
22
+ '',
23
+ 'Commands:',
24
+ ' update Upgrade Hive in place via `npm install -g`.',
20
25
  ].join('\n');
21
26
  export const handleHiveInfoCommand = (argv) => {
22
27
  if (argv.includes('--help') || argv.includes('-h')) {
@@ -128,10 +133,21 @@ const isMainModule = process.argv[1]
128
133
  : false;
129
134
  if (isMainModule) {
130
135
  const argv = process.argv.slice(2);
131
- if (handleHiveInfoCommand(argv))
136
+ if (argv[0] === 'update') {
137
+ runHiveUpdateCommand(argv.slice(1))
138
+ .then((code) => process.exit(code))
139
+ .catch((error) => {
140
+ console.error(error);
141
+ process.exit(1);
142
+ });
143
+ }
144
+ else if (handleHiveInfoCommand(argv)) {
132
145
  process.exit(0);
133
- runHiveCommand(argv).catch((error) => {
134
- console.error(error);
135
- process.exit(1);
136
- });
146
+ }
147
+ else {
148
+ runHiveCommand(argv).catch((error) => {
149
+ console.error(error);
150
+ process.exit(1);
151
+ });
152
+ }
137
153
  }
@@ -1,3 +1,7 @@
1
+ interface ParsedCancelArgs {
2
+ dispatchId: string;
3
+ reason: string;
4
+ }
1
5
  export interface ParsedReportArgs {
2
6
  artifacts: string[];
3
7
  dispatchId: string | undefined;
@@ -5,5 +9,7 @@ export interface ParsedReportArgs {
5
9
  useStdin: boolean;
6
10
  }
7
11
  export declare const parseReportArgs: (args: string[], command?: string) => ParsedReportArgs;
12
+ export declare const parseCancelArgs: (args: string[]) => ParsedCancelArgs;
8
13
  export declare const readStdinToString: (command?: string) => Promise<string>;
9
14
  export declare const runTeamCommand: (argv: string[]) => Promise<void>;
15
+ export {};
@@ -10,6 +10,7 @@ const TEAM_USAGE = [
10
10
  'Usage:',
11
11
  ' team list',
12
12
  ' team send <worker-name> "<task>"',
13
+ ' team cancel --dispatch <dispatch-id> "<reason>"',
13
14
  ' team report "<result>" [--dispatch <dispatch-id>] [--artifact <path>]',
14
15
  ' team report --stdin [--dispatch <dispatch-id>] [--artifact <path>]',
15
16
  ' team status "<current status>" [--artifact <path>]',
@@ -80,6 +81,7 @@ const postJson = async (baseUrl, path, body) => {
80
81
  };
81
82
  const REPORT_USAGE = 'Usage: team report (<result> | --stdin) [--dispatch <dispatch-id>] [--artifact <path>]';
82
83
  const STATUS_USAGE = 'Usage: team status (<current status> | --stdin) [--artifact <path>]';
84
+ const CANCEL_USAGE = 'Usage: team cancel --dispatch <dispatch-id> <reason>';
83
85
  const usageFor = (command) => (command === 'status' ? STATUS_USAGE : REPORT_USAGE);
84
86
  const withUsage = (message, command) => `${message}\n\n${usageFor(command)}`;
85
87
  export const parseReportArgs = (args, command = 'report') => {
@@ -139,6 +141,39 @@ export const parseReportArgs = (args, command = 'report') => {
139
141
  }
140
142
  return { result: useStdin ? null : (positionals[0] ?? null), artifacts, dispatchId, useStdin };
141
143
  };
144
+ export const parseCancelArgs = (args) => {
145
+ const positionals = [];
146
+ let dispatchId;
147
+ for (let index = 0; index < args.length; index += 1) {
148
+ const arg = args[index];
149
+ if (arg === undefined)
150
+ continue;
151
+ if (arg === '--dispatch') {
152
+ const next = args[index + 1];
153
+ if (next === undefined || next.startsWith('--')) {
154
+ throw new Error(`--dispatch requires a value\n\n${CANCEL_USAGE}`);
155
+ }
156
+ dispatchId = next;
157
+ index += 1;
158
+ continue;
159
+ }
160
+ if (arg.startsWith('--')) {
161
+ throw new Error(`Unknown argument: ${arg}\n\n${CANCEL_USAGE}`);
162
+ }
163
+ positionals.push(arg);
164
+ }
165
+ if (!dispatchId) {
166
+ throw new Error(`Missing --dispatch <dispatch-id>\n\n${CANCEL_USAGE}`);
167
+ }
168
+ if (positionals.length === 0) {
169
+ throw new Error(`Missing <reason>\n\n${CANCEL_USAGE}`);
170
+ }
171
+ const reason = positionals.join(' ').trim();
172
+ if (!reason) {
173
+ throw new Error(`Missing <reason>\n\n${CANCEL_USAGE}`);
174
+ }
175
+ return { dispatchId, reason };
176
+ };
142
177
  export const readStdinToString = async (command = 'report') => {
143
178
  if (process.stdin.isTTY) {
144
179
  throw new Error(withUsage('--stdin requires piped input, but stdin is a TTY. Did you forget to pipe content in?', command));
@@ -194,6 +229,19 @@ export const runTeamCommand = async (argv) => {
194
229
  console.log(JSON.stringify(await response.json()));
195
230
  return;
196
231
  }
232
+ if (command === 'cancel') {
233
+ const cancel = parseCancelArgs(args);
234
+ const env = getHiveEnv();
235
+ const baseUrl = getBaseUrl(env);
236
+ await postJson(baseUrl, '/api/team/cancel', {
237
+ dispatch_id: cancel.dispatchId,
238
+ project_id: env.HIVE_PROJECT_ID,
239
+ from_agent_id: env.HIVE_AGENT_ID,
240
+ token: env.HIVE_AGENT_TOKEN,
241
+ reason: cancel.reason,
242
+ });
243
+ return;
244
+ }
197
245
  if (command === 'status') {
198
246
  const report = parseReportArgs(args, 'status');
199
247
  const body = report.useStdin ? await readStdinToString('status') : (report.result ?? '');