tiger-agent 0.2.1 → 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 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 # First-time setup wizard (run once)
48
- tiger start # Start CLI chat
59
+ tiger onboard
49
60
  ```
50
61
 
51
- CLI exit: `/exit` or `/quit`
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
- **Telegram bot:**
72
+ ### 2. Start
54
73
 
74
+ **CLI chat:**
55
75
  ```bash
56
- tiger telegram # Start in foreground
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
- ## 📋 Requirements
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
- - Node.js 18+ (20+ recommended)
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 | Use Case |
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` | Kill background daemon |
80
- | **Status** | `tiger status` | Check if daemon is running |
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` creates and configures:
111
+ `tiger onboard` writes `~/.tiger/.env` with all settings. You can re-run it at any time to update config.
89
112
 
90
- - `~/.tiger/.env` settings and provider config
91
- - `~/.tiger/.env.secrets` — API keys (mode 600, gitignored)
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
- Setup options:
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiger-agent",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Cognitive AI agent with persistent memory, multi-provider LLM, and Telegram bot",
5
5
  "type": "commonjs",
6
6
  "main": "src/cli.js",
@@ -42,7 +42,7 @@ async function askHidden(prompt) {
42
42
  buf += ch; stdout.write('*');
43
43
  }
44
44
  }
45
- function cleanup() { stdin.off('data', onData); stdin.setRawMode(false); stdin.pause(); }
45
+ function cleanup() { stdin.off('data', onData); stdin.setRawMode(false); stdin.resume(); }
46
46
  stdin.on('data', onData);
47
47
  });
48
48
  }
@@ -181,7 +181,7 @@ Config will be saved to: ${TIGER_HOME}
181
181
  }
182
182
 
183
183
  // ── Active provider ────────────────────────────────────────────────────────
184
- console.log('\nAvailable providers: kimi, zai (Zhipu GLM-5), minimax, claude, moonshot');
184
+ console.log('\nAvailable providers: kimi, zai (Zhipu GLM-4.7), minimax, claude, moonshot');
185
185
  const activeProv = (await ask('Active provider (zai): ')).trim() || 'zai';
186
186
  const provOrder = (await ask(`Provider fallback order (${activeProv},claude,kimi,minimax,moonshot): `)).trim()
187
187
  || `${activeProv},claude,kimi,minimax,moonshot`;
@@ -231,8 +231,8 @@ Config will be saved to: ${TIGER_HOME}
231
231
  '',
232
232
  '# ── Z.ai (Zhipu GLM)',
233
233
  envLine('ZAI_API_KEY', zaiKey),
234
- envLine('ZAI_BASE_URL', 'https://open.bigmodel.cn/api/paas/v4'),
235
- envLine('ZAI_MODEL', 'glm-5'),
234
+ envLine('ZAI_BASE_URL', 'https://api.z.ai/api/coding/paas/v4'),
235
+ envLine('ZAI_MODEL', 'glm-4.7'),
236
236
  envLine('ZAI_TIMEOUT_MS', '30000'),
237
237
  '',
238
238
  '# ── MiniMax',
@@ -4,7 +4,8 @@ const { execFile } = require('child_process');
4
4
  const { promisify } = require('util');
5
5
 
6
6
  const execFileAsync = promisify(execFile);
7
- const localClawhubBin = path.resolve(process.cwd(), 'node_modules', '.bin', 'clawhub');
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 [];
@@ -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 skillsDir = path.resolve('./skills');
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 || process.cwd(),
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 || process.cwd(),
128
+ workdir: args.workdir || rootDir,
128
129
  dir: args.dir || 'skills',
129
130
  timeout_ms: args.timeout_ms
130
131
  });