tiger-agent 0.2.2 → 0.2.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 +55 -29
- package/package.json +1 -1
- package/src/agent/skills.js +2 -1
- package/src/agent/toolbox.js +4 -3
package/README.md
CHANGED
|
@@ -33,68 +33,94 @@ Made by **AI Research Group, Department of Civil Engineering, KMUTT**
|
|
|
33
33
|
|
|
34
34
|
---
|
|
35
35
|
|
|
36
|
+
## 📋 Requirements
|
|
37
|
+
|
|
38
|
+
- Node.js 18+ (20+ recommended)
|
|
39
|
+
- npm
|
|
40
|
+
- Python 3 (for SQLite memory helper)
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
36
44
|
## 📦 Installation
|
|
37
45
|
|
|
38
46
|
```bash
|
|
39
47
|
npm install -g tiger-agent
|
|
40
48
|
```
|
|
41
49
|
|
|
50
|
+
All config and runtime data is stored in `~/.tiger/` — nothing written to the npm global directory.
|
|
51
|
+
|
|
42
52
|
---
|
|
43
53
|
|
|
44
54
|
## 🚀 Quick Start
|
|
45
55
|
|
|
56
|
+
### 1. Run the setup wizard
|
|
57
|
+
|
|
46
58
|
```bash
|
|
47
|
-
tiger onboard
|
|
48
|
-
tiger start # Start CLI chat
|
|
59
|
+
tiger onboard
|
|
49
60
|
```
|
|
50
61
|
|
|
51
|
-
|
|
62
|
+
The wizard will ask for:
|
|
63
|
+
- **Active provider** — which LLM to use by default (e.g. `zai`, `claude`)
|
|
64
|
+
- **Fallback order** — comma-separated list tried when the active provider is rate-limited
|
|
65
|
+
- **API keys** — enter only the providers you have keys for; others are skipped automatically
|
|
66
|
+
- **Telegram bot token** — from [@BotFather](https://t.me/BotFather) on Telegram
|
|
67
|
+
- **Daily token limits** — per-provider caps (0 = unlimited); auto-switches on breach
|
|
68
|
+
- **Shell / skill-install** — optional tool permissions
|
|
69
|
+
|
|
70
|
+
Config is saved to `~/.tiger/.env` (mode 600).
|
|
52
71
|
|
|
53
|
-
|
|
72
|
+
### 2. Start
|
|
54
73
|
|
|
74
|
+
**CLI chat:**
|
|
55
75
|
```bash
|
|
56
|
-
tiger
|
|
57
|
-
tiger telegram --background # Start as background daemon
|
|
58
|
-
tiger stop # Stop daemon
|
|
59
|
-
tiger status # Check daemon status
|
|
76
|
+
tiger start
|
|
60
77
|
```
|
|
78
|
+
Exit with `/exit` or `/quit`.
|
|
61
79
|
|
|
62
|
-
|
|
80
|
+
**Telegram bot (foreground):**
|
|
81
|
+
```bash
|
|
82
|
+
tiger telegram
|
|
83
|
+
```
|
|
63
84
|
|
|
64
|
-
|
|
85
|
+
**Telegram bot (background daemon):**
|
|
86
|
+
```bash
|
|
87
|
+
tiger telegram --background # start
|
|
88
|
+
tiger status # check if running
|
|
89
|
+
tiger stop # stop
|
|
90
|
+
```
|
|
65
91
|
|
|
66
|
-
|
|
67
|
-
- npm
|
|
68
|
-
- Python 3 (for SQLite memory helper)
|
|
92
|
+
Logs: `~/.tiger/logs/telegram.out.log`
|
|
69
93
|
|
|
70
94
|
---
|
|
71
95
|
|
|
72
96
|
## 🎮 Run Modes
|
|
73
97
|
|
|
74
|
-
| Mode | Command |
|
|
75
|
-
|
|
98
|
+
| Mode | Command | Description |
|
|
99
|
+
|------|---------|-------------|
|
|
76
100
|
| **CLI** | `tiger start` | Interactive terminal chat |
|
|
77
101
|
| **Telegram** | `tiger telegram` | Telegram bot (foreground) |
|
|
78
|
-
| **Background** | `tiger telegram --background` | 24/7 daemon |
|
|
79
|
-
| **Stop** | `tiger stop` |
|
|
80
|
-
| **Status** | `tiger status` | Check
|
|
81
|
-
|
|
82
|
-
Background logs: `~/.tiger/logs/telegram-supervisor.log`
|
|
102
|
+
| **Background** | `tiger telegram --background` | 24/7 daemon with auto-restart |
|
|
103
|
+
| **Stop** | `tiger stop` | Stop background daemon |
|
|
104
|
+
| **Status** | `tiger status` | Check daemon status |
|
|
105
|
+
| **Onboard** | `tiger onboard` | Re-run setup wizard |
|
|
83
106
|
|
|
84
107
|
---
|
|
85
108
|
|
|
86
|
-
## 🔧 Setup Wizard
|
|
109
|
+
## 🔧 Setup Wizard Details
|
|
87
110
|
|
|
88
|
-
`tiger onboard`
|
|
111
|
+
`tiger onboard` writes `~/.tiger/.env` with all settings. You can re-run it at any time to update config.
|
|
89
112
|
|
|
90
|
-
|
|
91
|
-
|
|
113
|
+
| Wizard prompt | What it sets |
|
|
114
|
+
|---------------|-------------|
|
|
115
|
+
| Active provider | `ACTIVE_PROVIDER` |
|
|
116
|
+
| Fallback order | `PROVIDER_ORDER` |
|
|
117
|
+
| API keys | `ZAI_API_KEY`, `CLAUDE_API_KEY`, etc. |
|
|
118
|
+
| Telegram token | `TELEGRAM_BOT_TOKEN` |
|
|
119
|
+
| Token limits | `ZAI_TOKEN_LIMIT`, `CLAUDE_TOKEN_LIMIT`, etc. |
|
|
120
|
+
| Shell tool | `ALLOW_SHELL` |
|
|
121
|
+
| Skill install | `ALLOW_SKILL_INSTALL` |
|
|
92
122
|
|
|
93
|
-
|
|
94
|
-
- Choose LLM provider and API keys
|
|
95
|
-
- Persistent vs temporary vector DB
|
|
96
|
-
- Optional `sqlite-vec` acceleration
|
|
97
|
-
- Optional encrypted secrets file
|
|
123
|
+
> **Tip:** You can also edit `~/.tiger/.env` directly and restart the bot to apply changes.
|
|
98
124
|
|
|
99
125
|
---
|
|
100
126
|
|
package/package.json
CHANGED
package/src/agent/skills.js
CHANGED
|
@@ -4,7 +4,8 @@ const { execFile } = require('child_process');
|
|
|
4
4
|
const { promisify } = require('util');
|
|
5
5
|
|
|
6
6
|
const execFileAsync = promisify(execFile);
|
|
7
|
-
|
|
7
|
+
// Resolve clawhub from the package's own node_modules (works for both global and local installs)
|
|
8
|
+
const localClawhubBin = path.resolve(__dirname, '..', '..', 'node_modules', '.bin', 'clawhub');
|
|
8
9
|
|
|
9
10
|
function listSkills(baseDir) {
|
|
10
11
|
if (!fs.existsSync(baseDir)) return [];
|
package/src/agent/toolbox.js
CHANGED
|
@@ -7,7 +7,8 @@ const { listSkills, loadSkill, clawhubSearch, clawhubInstall } = require('./skil
|
|
|
7
7
|
const { runSubAgentBatch } = require('./subAgent');
|
|
8
8
|
|
|
9
9
|
const execAsync = promisify(exec);
|
|
10
|
-
const
|
|
10
|
+
const rootDir = process.env.TIGER_HOME || process.cwd();
|
|
11
|
+
const skillsDir = path.resolve(rootDir, 'skills');
|
|
11
12
|
|
|
12
13
|
function toAbsolutePath(inputPath) {
|
|
13
14
|
return path.resolve(String(inputPath || '.'));
|
|
@@ -113,7 +114,7 @@ async function clawhubSearchTool(args = {}) {
|
|
|
113
114
|
return clawhubSearch({
|
|
114
115
|
query: args.query,
|
|
115
116
|
limit: args.limit,
|
|
116
|
-
workdir: args.workdir ||
|
|
117
|
+
workdir: args.workdir || rootDir,
|
|
117
118
|
dir: args.dir || 'skills',
|
|
118
119
|
timeout_ms: args.timeout_ms
|
|
119
120
|
});
|
|
@@ -124,7 +125,7 @@ async function clawhubInstallTool(args = {}) {
|
|
|
124
125
|
slug: args.slug,
|
|
125
126
|
version: args.version,
|
|
126
127
|
force: args.force,
|
|
127
|
-
workdir: args.workdir ||
|
|
128
|
+
workdir: args.workdir || rootDir,
|
|
128
129
|
dir: args.dir || 'skills',
|
|
129
130
|
timeout_ms: args.timeout_ms
|
|
130
131
|
});
|