@ducci/jarvis 1.0.62 → 1.0.64
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 +56 -91
- package/package.json +5 -1
- package/src/server/tools.js +0 -56
package/README.md
CHANGED
|
@@ -1,121 +1,86 @@
|
|
|
1
1
|
# Jarvis
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A self-hosted AI agent that runs as a background server. Chat with it via a web UI or Telegram, give it tools to run shell commands and manage files, and schedule recurring tasks — all powered by any model on OpenRouter, z.ai, or the Anthropic API.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Agent loop** — runs tools autonomously, hands off to a fresh context when it hits the iteration limit, and keeps going until the task is done
|
|
8
|
+
- **Web UI** — built-in chat interface served at `http://localhost:18008`
|
|
9
|
+
- **Telegram** — optional channel adapter; chat from your phone, send photos, get proactive notifications
|
|
10
|
+
- **Cron scheduler** — schedule recurring or one-time tasks in plain English; agent runs them autonomously and can notify you via Telegram
|
|
11
|
+
- **Skills** — Markdown-defined workflows the agent discovers and follows for specific task types
|
|
12
|
+
- **Custom tools** — define tools in JSON (name, description, JS code); the agent picks them up without a restart
|
|
13
|
+
- **Multi-provider** — OpenRouter, z.ai, or Anthropic directly (with prompt caching)
|
|
14
|
+
- **Persistent sessions** — full conversation history per session, sliding context window
|
|
6
15
|
|
|
7
|
-
|
|
8
|
-
- CLI and Server Lifecycle: [docs/cli.md](./docs/cli.md)
|
|
9
|
-
- Agent system details: [docs/agent.md](./docs/agent.md)
|
|
10
|
-
- UI implementation: [docs/ui.md](./docs/ui.md)
|
|
11
|
-
- Evaluation guide: [docs/evaluation.md](./docs/evaluation.md)
|
|
12
|
-
|
|
13
|
-
## Principles (early draft)
|
|
14
|
-
|
|
15
|
-
- Minimal surface area in v1
|
|
16
|
-
- Clear defaults and predictable behavior
|
|
17
|
-
- Simple local data model
|
|
18
|
-
- No hidden automation
|
|
19
|
-
|
|
20
|
-
## end goal (how i wish the system will be onced finished)
|
|
21
|
-
- following what jarvis is doing is super easy to understand for a human
|
|
22
|
-
- everything that goes wrong e.g. failed tool calls, or errors from exec calls should be easy to understand for a human
|
|
23
|
-
- transparency is very important, without this we can not easily debug or improve the system
|
|
24
|
-
- it should work autonomously, i.e. it does not need any instructions from me on decicions but instead decide itself how to achieve whatever its doing
|
|
25
|
-
- when working autonomously on a task its given it should know when to stop (task is done in a good quality)
|
|
26
|
-
|
|
27
|
-
## Implementation Roadmap
|
|
28
|
-
|
|
29
|
-
To reach v1, we will follow this order:
|
|
30
|
-
|
|
31
|
-
1. **Phase 1: Project Skeleton [x]**
|
|
32
|
-
- Scaffolding (`package.json`, folder structure).
|
|
33
|
-
- Basic HTTP server on port `18008`.
|
|
34
|
-
2. **Phase 2: Onboarding & Config [x]**
|
|
35
|
-
- `jarvis setup` CLI command.
|
|
36
|
-
- Persistence for API keys (`.env`) and settings (`settings.json`).
|
|
37
|
-
3. **Phase 3: Core Agent Loop [x]**
|
|
38
|
-
- Request/Response flow with OpenRouter.
|
|
39
|
-
- Serial tool execution logic (`new Function`).
|
|
40
|
-
- Basic session persistence.
|
|
41
|
-
- Seed tool: `list_dir` (runs `ls -la`) to verify the full loop end-to-end.
|
|
42
|
-
4. **Phase 4: Lifecycle Management [x]**
|
|
43
|
-
- CLI `start/stop/status` using programmatic PM2.
|
|
44
|
-
- Pre-flight configuration checks.
|
|
45
|
-
5. **Phase 5: Tools & Refinement [x]**
|
|
46
|
-
- Implementation of built-in tools (`exec`, `user_info`).
|
|
47
|
-
- Standardized logging (JSONL).
|
|
48
|
-
6. **Phase 6: UI [x]**
|
|
49
|
-
- Vite + React + Tailwind chat interface in `ui/`.
|
|
50
|
-
- Server serves built UI as static files.
|
|
51
|
-
|
|
52
|
-
## Usage
|
|
53
|
-
|
|
54
|
-
### First-time setup
|
|
16
|
+
## Quick start
|
|
55
17
|
|
|
56
18
|
```
|
|
57
|
-
npm
|
|
58
|
-
|
|
19
|
+
npm i -g @ducci/jarvis
|
|
20
|
+
jarvis setup # configure API key, model, and optionally Telegram
|
|
21
|
+
jarvis start # start the background server (auto-restarts on crash)
|
|
59
22
|
```
|
|
60
23
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
### Running in production (background via PM2)
|
|
24
|
+
Open `http://localhost:18008` to use the chat UI.
|
|
64
25
|
|
|
65
26
|
```
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
npm run stop # stop the background server
|
|
27
|
+
jarvis stop # stop the server
|
|
28
|
+
jarvis status # show PID, uptime, restart count
|
|
69
29
|
```
|
|
70
30
|
|
|
71
|
-
|
|
31
|
+
## Recommended models
|
|
72
32
|
|
|
73
|
-
|
|
33
|
+
Any OpenRouter model works, but here's what's worth trying right now:
|
|
74
34
|
|
|
75
|
-
|
|
35
|
+
| Model | Provider | Notes |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| `glm-5` | [z.ai](https://z.ai) directly | Personal pick — strong at coding and tool use, great value |
|
|
76
38
|
|
|
77
|
-
|
|
78
|
-
npm run dev # start the server with nodemon (auto-reload on file changes)
|
|
79
|
-
```
|
|
39
|
+
**z.ai tip**: z.ai offers a "Coding Plan Pro" subscription that gives you direct, high-rate access to GLM-5. If you do a lot of agentic coding tasks, it's worth it. Run `jarvis setup` and select z.ai as your provider — it will configure the endpoint and model automatically.
|
|
80
40
|
|
|
81
|
-
|
|
41
|
+
Fallback recommendation: set `fallbackModel` to `openrouter/auto` in `settings.json` so failed requests automatically retry on a capable free model.
|
|
82
42
|
|
|
83
|
-
|
|
84
|
-
cd ui
|
|
85
|
-
npm install # first time only
|
|
86
|
-
npm run dev # starts Vite on port 5173, proxies /api to localhost:18008
|
|
87
|
-
```
|
|
43
|
+
## Docs
|
|
88
44
|
|
|
89
|
-
|
|
45
|
+
- [Setup and configuration](./docs/setup.md)
|
|
46
|
+
- [CLI and server lifecycle](./docs/cli.md)
|
|
47
|
+
- [Agent system](./docs/agent.md)
|
|
48
|
+
- [Telegram channel](./docs/telegram.md)
|
|
49
|
+
- [Cron scheduler](./docs/crons.md)
|
|
50
|
+
- [Skills](./docs/skills.md)
|
|
51
|
+
- [Identity and persona](./docs/identity.md)
|
|
52
|
+
- [UI](./docs/ui.md)
|
|
90
53
|
|
|
91
|
-
|
|
54
|
+
## Development
|
|
92
55
|
|
|
93
56
|
```
|
|
94
|
-
|
|
95
|
-
npm run build
|
|
57
|
+
npm run dev # start server with nodemon (auto-reload)
|
|
96
58
|
```
|
|
97
59
|
|
|
98
|
-
|
|
60
|
+
For UI hot-reload, run both the server and the Vite dev server:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
npm run dev # server on :18008
|
|
64
|
+
cd ui && npm install && npm run dev # UI on :5173, proxies /api to :18008
|
|
65
|
+
```
|
|
99
66
|
|
|
100
|
-
|
|
67
|
+
Build the UI for production:
|
|
101
68
|
|
|
102
69
|
```
|
|
103
|
-
npm
|
|
104
|
-
jarvis setup
|
|
105
|
-
jarvis start
|
|
106
|
-
jarvis stop
|
|
107
|
-
jarvis status
|
|
70
|
+
cd ui && npm run build # outputs to ui/dist/, served automatically by the server
|
|
108
71
|
```
|
|
109
72
|
|
|
110
|
-
## Security
|
|
73
|
+
## Security
|
|
74
|
+
|
|
75
|
+
Jarvis is designed for **local or private server use only**. The API has no authentication — do not expose port `18008` to the public internet. The `exec` tool runs shell commands with the same permissions as the server process.
|
|
76
|
+
|
|
77
|
+
## Data
|
|
111
78
|
|
|
112
|
-
|
|
79
|
+
All runtime data lives in `~/.jarvis/` and is never stored in the repo:
|
|
113
80
|
|
|
114
|
-
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
- Phase 6 (UI) is implemented.
|
|
121
|
-
- the scope is only this jarvis folder and each file in it. no parent folders or any other outside of this
|
|
81
|
+
- `~/.jarvis/.env` — API keys
|
|
82
|
+
- `~/.jarvis/data/config/settings.json` — model, port, channel config
|
|
83
|
+
- `~/.jarvis/data/conversations/` — session history
|
|
84
|
+
- `~/.jarvis/data/tools/tools.json` — tool registry
|
|
85
|
+
- `~/.jarvis/data/skills/` — skill definitions
|
|
86
|
+
- `~/.jarvis/logs/` — per-session JSONL logs, cron logs, PM2 stdout
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ducci/jarvis",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.64",
|
|
4
4
|
"description": "A fully automated agent system that lives on a server.",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
"cli",
|
|
31
31
|
"server"
|
|
32
32
|
],
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/duc-gp/-ducci-jarvis.git"
|
|
36
|
+
},
|
|
33
37
|
"author": "ducci",
|
|
34
38
|
"engines": {
|
|
35
39
|
"node": ">=18"
|
package/src/server/tools.js
CHANGED
|
@@ -206,62 +206,6 @@ const SEED_TOOLS = {
|
|
|
206
206
|
return { answer, citations };
|
|
207
207
|
`,
|
|
208
208
|
},
|
|
209
|
-
zai_web_search: {
|
|
210
|
-
requires: 'ZAI_API_KEY',
|
|
211
|
-
definition: {
|
|
212
|
-
type: 'function',
|
|
213
|
-
function: {
|
|
214
|
-
name: 'zai_web_search',
|
|
215
|
-
description: 'Search the web using Z.AI web search. Returns real-time search results with titles, URLs, and summaries. Use this for current events, factual lookups, or research questions. Use sparingly — at most 3 searches per topic. Do not repeat the same query with minor variations; if an initial search does not yield what you need, switch to a different approach.',
|
|
216
|
-
parameters: {
|
|
217
|
-
type: 'object',
|
|
218
|
-
properties: {
|
|
219
|
-
query: {
|
|
220
|
-
type: 'string',
|
|
221
|
-
description: 'The search query or question.',
|
|
222
|
-
},
|
|
223
|
-
},
|
|
224
|
-
required: ['query'],
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
code: `
|
|
229
|
-
const https = require('https');
|
|
230
|
-
const body = JSON.stringify({
|
|
231
|
-
jsonrpc: '2.0',
|
|
232
|
-
id: 1,
|
|
233
|
-
method: 'tools/call',
|
|
234
|
-
params: { name: 'webSearchPrime', arguments: { query: args.query } },
|
|
235
|
-
});
|
|
236
|
-
const result = await new Promise((resolve, reject) => {
|
|
237
|
-
const req = https.request({
|
|
238
|
-
hostname: 'api.z.ai',
|
|
239
|
-
path: '/api/mcp/web_search_prime/mcp',
|
|
240
|
-
method: 'POST',
|
|
241
|
-
headers: {
|
|
242
|
-
'Authorization': 'Bearer ' + process.env.ZAI_API_KEY,
|
|
243
|
-
'Content-Type': 'application/json',
|
|
244
|
-
'Content-Length': Buffer.byteLength(body),
|
|
245
|
-
},
|
|
246
|
-
}, (res) => {
|
|
247
|
-
let data = '';
|
|
248
|
-
res.on('data', chunk => data += chunk);
|
|
249
|
-
res.on('end', () => {
|
|
250
|
-
try { resolve(JSON.parse(data)); }
|
|
251
|
-
catch (e) { reject(new Error('Invalid JSON response: ' + data.slice(0, 200))); }
|
|
252
|
-
});
|
|
253
|
-
});
|
|
254
|
-
req.on('error', reject);
|
|
255
|
-
req.write(body);
|
|
256
|
-
req.end();
|
|
257
|
-
});
|
|
258
|
-
if (result.error) return { status: 'error', error: result.error.message };
|
|
259
|
-
const content = result.result?.content;
|
|
260
|
-
if (!content) return { status: 'error', error: 'Empty response from Z.AI' };
|
|
261
|
-
const text = Array.isArray(content) ? content.map(c => c.text || '').join('\\n') : String(content);
|
|
262
|
-
return { status: 'ok', results: text };
|
|
263
|
-
`,
|
|
264
|
-
},
|
|
265
209
|
system_install: {
|
|
266
210
|
timeout: 300_000, // 5 minutes — package downloads and installs routinely exceed 60s
|
|
267
211
|
definition: {
|