herdrchat 1.3.1 → 1.3.3

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,7 +2,7 @@
2
2
 
3
3
  # herdrchat
4
4
 
5
- Every terminal hc runs, in the chat app you already use: Feishu or Telegram.
5
+ A chat front-end for [herdr](https://herdr.dev): every terminal it runs, in Feishu or Telegram.
6
6
 
7
7
  [English](README.md) · [简体中文](README.zh.md)
8
8
 
@@ -31,7 +31,9 @@ until herdrchat learns to read their conversations too.
31
31
 
32
32
  ## You need
33
33
 
34
- - **hc** running on this machine, with at least one session ([herdr.dev](https://herdr.dev)).
34
+ - **herdr**: herdrchat is built on it and does nothing without it. Install it from
35
+ [herdr.dev](https://herdr.dev) first; its **hc** must run on this machine, with at least
36
+ one session.
35
37
  - **Node.js 20** or newer, on **macOS or Linux**.
36
38
  - **Feishu**: a Feishu team (not Lark) where you may create a custom app and publish it.
37
39
  **Telegram**: a Telegram account. Use one app, or both at once.
package/README.zh.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # herdrchat
4
4
 
5
- hc 跑的每个终端,都能在你常用的聊天软件里看到和回复:飞书或 Telegram。
5
+ [herdr](https://herdr.dev) 的聊天前端:它跑的每个终端,都能在飞书或 Telegram 里看到和回复。
6
6
 
7
7
  [English](README.md) · [简体中文](README.zh.md)
8
8
 
@@ -27,7 +27,8 @@ agent 干活时说的话实时可见,它问你的问题点按钮就能回答
27
27
 
28
28
  ## 需要什么
29
29
 
30
- - 这台机器上在跑 **hc**,至少有一个 session([herdr.dev](https://herdr.dev))。
30
+ - **herdr**:herdrchat 是基于它做的,没有它什么都做不了。请先从 [herdr.dev](https://herdr.dev) 安装;
31
+ 它的 **hc** 要在这台机器上跑着,至少有一个 session。
31
32
  - **Node.js 20** 或更新版本,系统是 **macOS 或 Linux**。
32
33
  - **飞书**:一个能创建并发布企业自建应用的飞书团队(暂不支持 Lark 国际版)。
33
34
  **Telegram**:一个 Telegram 账号。可以只用一个,也可以两个同时用。
package/bin/cli.mjs CHANGED
@@ -21,7 +21,10 @@ import { fileURLToPath } from 'node:url';
21
21
 
22
22
  const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
23
23
  const GUIDE = 'https://github.com/zhangxiangliang/herdrchat/blob/main/docs/guide.md';
24
- const USAGE = `herdrchat <command> [--profile <name>]
24
+ const HERDR = 'herdrchat is built on herdr: it mirrors the terminals that hc (herdr-core) runs.\nIt needs hc on this machine: install herdr first, from https://herdr.dev';
25
+ const USAGE = `herdrchat: herdr's terminals in Feishu or Telegram. Needs herdr (https://herdr.dev).
26
+
27
+ herdrchat <command> [--profile <name>]
25
28
 
26
29
  init make the profile's config.env (--chat feishu|telegram picks the app)
27
30
  start start (or restart) it: the service, or else its own hc terminal
@@ -155,7 +158,7 @@ async function waitConnected(since) {
155
158
  // Nothing else, so no agent's variables come along.
156
159
  function botEnv() {
157
160
  const hcPath = findHc();
158
- if (!hcPath) throw new Error('hc is not on PATH: install herdr-core first (https://herdr.dev)');
161
+ if (!hcPath) throw new Error(`hc is not on PATH. ${HERDR}`);
159
162
  const env = { HERDRCHAT_HC: hcPath, HERDRCHAT_PROFILE: places.profile };
160
163
  for (const k of ['PATH', 'HERDRCHAT_HOME', 'XDG_CONFIG_HOME', 'XDG_STATE_HOME']) if (process.env[k]) env[k] = process.env[k];
161
164
  return env;
@@ -182,6 +185,8 @@ const commands = {
182
185
  init() {
183
186
  const chatName = chatFlag || 'feishu';
184
187
  if (!chatNames().includes(chatName)) fail(`--chat ${chatName}: the chat apps are ${chatNames().join(', ')}`);
188
+ // the settings can be made first, but nothing works without herdr: said before anything
189
+ if (!findHc()) console.log(`⚠️ hc is not on PATH. ${HERDR}\n`);
185
190
  makeDirs();
186
191
  if (fs.existsSync(CONFIG_FILE)) {
187
192
  console.log(`${CONFIG_FILE} is there already; open it and edit it, then run \`herdrchat start${again}\`.`);
@@ -269,7 +274,7 @@ const commands = {
269
274
  // how it runs: the service, an hc terminal, or not at all
270
275
  const svc = hcThere ? service() : null;
271
276
  if (!hcThere) {
272
- console.log('running unknown: hc is not on PATH (install herdr-core: https://herdr.dev)');
277
+ console.log('running unknown: hc is not on PATH; herdrchat is built on herdr: install it from https://herdr.dev');
273
278
  } else {
274
279
  const inTerminal = cfg.sessions.length ? (await terminalState(cfg.sessions[0])) === 'live' : false;
275
280
  if (svc?.installed()) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "herdrchat",
3
- "version": "1.3.1",
4
- "description": "Chat front-ends for hc: every terminal hc runs, in the chat app you use",
3
+ "version": "1.3.3",
4
+ "description": "A chat front-end for herdr: every terminal hc runs, in Feishu or Telegram",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/zhangxiangliang/herdrchat.git"
@@ -37,6 +37,19 @@
37
37
  "devDependencies": {
38
38
  "@semantic-release/changelog": "^7.0.0",
39
39
  "@semantic-release/git": "^11.0.1",
40
- "semantic-release": "^25.0.9"
41
- }
40
+ "semantic-release": "^25.0.9",
41
+ "yaml": "^2.9.1"
42
+ },
43
+ "keywords": [
44
+ "herdr",
45
+ "hc",
46
+ "herdr-core",
47
+ "feishu",
48
+ "lark",
49
+ "telegram",
50
+ "chatops",
51
+ "claude-code",
52
+ "agents",
53
+ "terminal"
54
+ ]
42
55
  }
@@ -1,6 +1,13 @@
1
1
  ---
2
2
  name: herdrchat
3
- description: Set up, run and look after herdrchat, which mirrors every herdr-app (hc) tab into Feishu (a group per tab) or Telegram (a topic per tab): first setup of either app, start, stop, status, logs, running it as a service, settings, fixing problems, the Feishu developer console and @BotFather. Use for anything about herdrchat or its Feishu or Telegram bot, even "set up the Telegram bot", "is it running", "it does not post" or "mute the workers". Trigger with "/herdrchat", "/herdrchat setup", "/herdrchat status", "/herdrchat fix".
3
+ description: >-
4
+ Set up, run and look after herdrchat, which mirrors every herdr-app (hc) tab into
5
+ Feishu (a group per tab) or Telegram (a topic per tab): first setup of either app,
6
+ start, stop, status, logs, running it as a service, settings, fixing problems, the
7
+ Feishu developer console and @BotFather. Use for anything about herdrchat or its
8
+ Feishu or Telegram bot, even "set up the Telegram bot", "is it running", "it does not
9
+ post" or "mute the workers". Trigger with "/herdrchat", "/herdrchat setup",
10
+ "/herdrchat status", "/herdrchat fix".
4
11
  ---
5
12
 
6
13
  # herdrchat
@@ -22,7 +29,7 @@ from the package (`config.env.example`, `docs/guide.md`) are in the installed pa
22
29
 
23
30
  | Command | Do |
24
31
  |---|---|
25
- | `/herdrchat setup` | First ask which chat app (Feishu, Telegram, or both: the second one on its own profile). Telegram: `/herdrchat telegram setup`. Feishu, in this order: create the app, the bot ability and the scopes (`references/feishu.md`); `herdrchat init` and fill `config.env` with the user (App ID, App Secret, `HERDR_SESSIONS`: `ls ~/.local/state/herdr-core` lists the sessions); `herdrchat start` (the console's long-connection check needs it running); events and callbacks; publish a version; the user messages the bot and adds the `FEISHU_OWNER_OPEN_ID` line it answers with; `herdrchat start` again; offer `/herdrchat auth` and `herdrchat install`. |
32
+ | `/herdrchat setup` | First check herdr is there (`command -v hc`): herdrchat is built on herdr and does nothing without it; when it is missing, say so, point to https://herdr.dev, and stop until it is installed. Then ask which chat app (Feishu, Telegram, or both: the second one on its own profile). Telegram: `/herdrchat telegram setup`. Feishu, in this order: create the app, the bot ability and the scopes (`references/feishu.md`); `herdrchat init` and fill `config.env` with the user (App ID, App Secret, `HERDR_SESSIONS`: `ls ~/.local/state/herdr-core` lists the sessions); `herdrchat start` (the console's long-connection check needs it running); events and callbacks; publish a version; the user messages the bot and adds the `FEISHU_OWNER_OPEN_ID` line it answers with; `herdrchat start` again; offer `/herdrchat auth` and `herdrchat install`. |
26
33
  | `/herdrchat status` | `herdrchat status`; explain each line; on errors, `/herdrchat fix`. |
27
34
  | `/herdrchat start`, `/herdrchat stop` | Read `config.env` (its `HERDR_SESSIONS`) in one step, then `herdrchat start` / `stop` in the next; never both at once. With a service installed they go through it. |
28
35
  | `/herdrchat install`, `/herdrchat uninstall` | Run it as a service of the system (launchd on macOS, systemd on Linux): it starts at login and comes back after a crash, whatever happens to the hc cores. Recommended once it works. Read the config first; after a node upgrade, install again (`herdrchat status` says so). |