askhuman 0.4.2 → 0.5.0
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 +28 -20
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
# askhuman
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
English | [简体中文](https://github.com/Naituw/AskHuman/blob/main/README.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Cross-platform "human-in-the-loop" interaction tool. When an AI assistant is about to end a conversation or needs confirmation, the `AskHuman` CLI pops up a window (or uses Telegram / Slack / DingTalk / Feishu) so you can ask follow-ups, pick options, add text, or attach images — and the result is returned to the AI.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
跨平台「Human-in-the-loop」交互工具。当 AI 助手准备结束对话或需要确认时,命令行 `AskHuman` 弹出窗口(或经 Telegram / Slack / 钉钉 / 飞书),让你继续提问、勾选选项、补充文字或附带图片,并把结果回传给 AI。
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<img src="https://raw.githubusercontent.com/Naituw/AskHuman/main/assets/channels.webp" alt="Reply to your agent from the local popup, Telegram, Slack, DingTalk, or Feishu" width="900">
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
Under the hood it's a single executable (Tauri 2 / Rust). This npm package distributes it via per-platform subpackages: installing fetches only the one binary matching your current platform.
|
|
14
|
+
|
|
15
|
+
## Standalone use
|
|
8
16
|
|
|
9
17
|
```bash
|
|
10
18
|
npm i -g askhuman
|
|
11
|
-
AskHuman "
|
|
19
|
+
AskHuman "Continue?" -o "Continue" -o "Stop"
|
|
12
20
|
```
|
|
13
21
|
|
|
14
|
-
##
|
|
22
|
+
## As a dependency (programmatic use)
|
|
15
23
|
|
|
16
24
|
```bash
|
|
17
25
|
npm i askhuman
|
|
@@ -22,36 +30,36 @@ import { getBinaryPath, isAvailable } from "askhuman";
|
|
|
22
30
|
import { spawnSync } from "node:child_process";
|
|
23
31
|
|
|
24
32
|
if (!isAvailable()) {
|
|
25
|
-
//
|
|
33
|
+
// Binary not in place: skip the human-confirmation step to avoid blocking the flow
|
|
26
34
|
} else {
|
|
27
|
-
const r = spawnSync(getBinaryPath(), ["
|
|
35
|
+
const r = spawnSync(getBinaryPath(), ["Continue?", "-o", "Continue", "-o", "Stop"], {
|
|
28
36
|
encoding: "utf8",
|
|
29
37
|
});
|
|
30
38
|
if (r.status === 3) {
|
|
31
|
-
//
|
|
39
|
+
// No usable channel in this environment (GUI can't open and no session channel configured): degrade gracefully
|
|
32
40
|
} else if (r.status === 0) {
|
|
33
|
-
//
|
|
41
|
+
// Success: parse the result blocks from r.stdout
|
|
34
42
|
console.log(r.stdout);
|
|
35
43
|
}
|
|
36
44
|
}
|
|
37
45
|
```
|
|
38
46
|
|
|
39
|
-
`getBinaryPath()`
|
|
47
|
+
`getBinaryPath()` resolution order: env var `ASKHUMAN_BINARY` (legacy `HUMANINLOOP_BINARY` still works) → platform subpackage → system `PATH`.
|
|
40
48
|
|
|
41
|
-
##
|
|
49
|
+
## Exit code contract
|
|
42
50
|
|
|
43
|
-
|
|
|
51
|
+
| Exit code | Meaning |
|
|
44
52
|
|---|---|
|
|
45
|
-
| `0` |
|
|
46
|
-
| `3` |
|
|
47
|
-
| `1` |
|
|
53
|
+
| `0` | Got a result, or the user cancelled (emits `[Status]`) |
|
|
54
|
+
| `3` | No usable channel (local popup can't open and no session channel configured) — downstream should degrade |
|
|
55
|
+
| `1` | Other error |
|
|
48
56
|
|
|
49
|
-
stdout
|
|
57
|
+
stdout contains only the result blocks (`[Selected options]` / `[User input]` / `[Images]` / `[Files]` / `[Status]`); all logs and errors go to stderr.
|
|
50
58
|
|
|
51
|
-
##
|
|
59
|
+
## Platforms and system dependencies
|
|
52
60
|
|
|
53
|
-
|
|
61
|
+
Supports macOS (arm64/x64), Windows (x64), and Linux (x64).
|
|
54
62
|
|
|
55
|
-
>
|
|
63
|
+
> Running the GUI popup on Linux needs system WebKitGTK (e.g. `libwebkit2gtk-4.1`). If it's missing and a session-based channel is configured (Telegram / Slack / DingTalk / Feishu), AskHuman uses that channel automatically; if none is available, it signals degradation with exit code `3`.
|
|
56
64
|
|
|
57
|
-
|
|
65
|
+
More info in the project repo: <https://github.com/Naituw/AskHuman>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "askhuman",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Human-in-the-loop interaction tool. The `AskHuman` CLI pops up a window (or uses Telegram) to collect human
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Human-in-the-loop interaction tool. The `AskHuman` CLI pops up a window (or uses Telegram / Slack / DingTalk / Feishu) to collect a human response and return it to the AI — usable standalone or as a dependency.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Naituw",
|
|
7
7
|
"homepage": "https://github.com/Naituw/AskHuman",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"prompt"
|
|
34
34
|
],
|
|
35
35
|
"optionalDependencies": {
|
|
36
|
-
"@humaninloop/darwin-arm64": "0.
|
|
37
|
-
"@humaninloop/darwin-x64": "0.
|
|
38
|
-
"@humaninloop/win32-x64": "0.
|
|
39
|
-
"@humaninloop/linux-x64": "0.
|
|
36
|
+
"@humaninloop/darwin-arm64": "0.5.0",
|
|
37
|
+
"@humaninloop/darwin-x64": "0.5.0",
|
|
38
|
+
"@humaninloop/win32-x64": "0.5.0",
|
|
39
|
+
"@humaninloop/linux-x64": "0.5.0"
|
|
40
40
|
}
|
|
41
41
|
}
|