herdrchat 1.3.2 → 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 +4 -2
- package/README.zh.md +3 -2
- package/bin/cli.mjs +8 -3
- package/package.json +15 -3
- package/skills/herdrchat/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# herdrchat
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
- **
|
|
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
|
-
|
|
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
|
-
-
|
|
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
|
|
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(
|
|
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
|
|
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.
|
|
4
|
-
"description": "
|
|
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"
|
|
@@ -39,5 +39,17 @@
|
|
|
39
39
|
"@semantic-release/git": "^11.0.1",
|
|
40
40
|
"semantic-release": "^25.0.9",
|
|
41
41
|
"yaml": "^2.9.1"
|
|
42
|
-
}
|
|
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
|
+
]
|
|
43
55
|
}
|
|
@@ -29,7 +29,7 @@ from the package (`config.env.example`, `docs/guide.md`) are in the installed pa
|
|
|
29
29
|
|
|
30
30
|
| Command | Do |
|
|
31
31
|
|---|---|
|
|
32
|
-
| `/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`. |
|
|
33
33
|
| `/herdrchat status` | `herdrchat status`; explain each line; on errors, `/herdrchat fix`. |
|
|
34
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. |
|
|
35
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). |
|