@cosmicstack/mercury-agent 0.1.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/LICENSE +9 -0
- package/README.md +110 -0
- package/dist/index.js +3531 -0
- package/dist/index.js.map +1 -0
- package/package.json +87 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright © 2026 Cosmic Stack
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<pre>
|
|
3
|
+
__ _____________ ________ ________ __
|
|
4
|
+
/ |/ / ____/ __ \/ ____/ / / / __ \ \/ /
|
|
5
|
+
/ /|_/ / __/ / /_/ / / / / / / /_/ /\ /
|
|
6
|
+
/ / / / /___/ _, _/ /___/ /_/ / _, _/ / /
|
|
7
|
+
/_/ /_/_____/_/ |_|\____/\____/_/ |_| /_/
|
|
8
|
+
</pre>
|
|
9
|
+
</h1>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<strong>Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access.</strong>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
Runs 24/7 from CLI or Telegram. 21 built-in tools. Extensible skills. Asks before it acts.
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<a href="https://www.npmjs.com/package/@cosmicstack/mercury-agent"><img src="https://img.shields.io/npm/v/@cosmicstack/mercury-agent" alt="npm"></a>
|
|
21
|
+
<a href="https://github.com/cosmicstack-labs/mercury-agent"><img src="https://img.shields.io/github/license/cosmicstack-labs/mercury-agent" alt="license"></a>
|
|
22
|
+
<a href="https://nodejs.org/"><img src="https://img.shields.io/node/v/@cosmicstack/mercury-agent" alt="node"></a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx @cosmicstack/mercury-agent
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or install globally:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm i -g @cosmicstack/mercury-agent
|
|
37
|
+
mercury
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
First run triggers the setup wizard — enter your name, an API key, and optionally a Telegram bot token. Takes 30 seconds.
|
|
41
|
+
|
|
42
|
+
## Why Mercury?
|
|
43
|
+
|
|
44
|
+
Every AI agent can read files, run commands, and fetch URLs. Most do it silently. **Mercury asks first.**
|
|
45
|
+
|
|
46
|
+
- **Permission-hardened** — Shell blocklist (`sudo`, `rm -rf /`, etc. never execute). Folder-level read/write scoping. Pending approval flow. Skill elevation with granular `allowed-tools`. No surprises.
|
|
47
|
+
- **Soul-driven** — Personality defined by markdown files you own (`soul.md`, `persona.md`, `taste.md`, `heartbeat.md`). No corporate wrapper.
|
|
48
|
+
- **Token-aware** — Daily budget enforcement. Auto-concise when over 70%. `/budget` command to check, reset, or override.
|
|
49
|
+
- **Multi-channel** — CLI with real-time streaming. Telegram with HTML formatting, file uploads, and typing indicators.
|
|
50
|
+
- **Always on** — Cron scheduling, delayed reminders, heartbeat monitoring, and proactive notifications.
|
|
51
|
+
- **Extensible** — Install community skills with a single command. Schedule skills as recurring tasks. Based on the [Agent Skills](https://agentskills.io) specification.
|
|
52
|
+
|
|
53
|
+
## Built-in Tools
|
|
54
|
+
|
|
55
|
+
| Category | Tools |
|
|
56
|
+
|----------|-------|
|
|
57
|
+
| **Filesystem** | `read_file`, `write_file`, `create_file`, `edit_file`, `list_dir`, `delete_file`, `send_file` |
|
|
58
|
+
| **Shell** | `run_command`, `approve_command` |
|
|
59
|
+
| **Git** | `git_status`, `git_diff`, `git_log`, `git_add`, `git_commit`, `git_push` |
|
|
60
|
+
| **Web** | `fetch_url` |
|
|
61
|
+
| **Skills** | `install_skill`, `list_skills`, `use_skill` |
|
|
62
|
+
| **Scheduler** | `schedule_task`, `list_scheduled_tasks`, `cancel_scheduled_task` |
|
|
63
|
+
| **System** | `budget_status` |
|
|
64
|
+
|
|
65
|
+
## Channels
|
|
66
|
+
|
|
67
|
+
| Channel | Features |
|
|
68
|
+
|---------|----------|
|
|
69
|
+
| **CLI** | Readline prompt, real-time text streaming, markdown rendering, file display |
|
|
70
|
+
| **Telegram** | HTML formatting, file uploads (photos, audio, video, documents), typing indicators, `/budget` commands |
|
|
71
|
+
|
|
72
|
+
## Scheduler
|
|
73
|
+
|
|
74
|
+
- **Recurring**: `schedule_task` with cron expressions (`0 9 * * *` for daily at 9am)
|
|
75
|
+
- **One-shot**: `schedule_task` with `delay_seconds` (e.g. 15 seconds)
|
|
76
|
+
- Tasks persist to `~/.mercury/schedules.yaml` and restore on restart
|
|
77
|
+
- Responses route back to the channel where the task was created
|
|
78
|
+
|
|
79
|
+
## Configuration
|
|
80
|
+
|
|
81
|
+
All runtime data lives in `~/.mercury/` — not in your project directory.
|
|
82
|
+
|
|
83
|
+
| Path | Purpose |
|
|
84
|
+
|------|---------|
|
|
85
|
+
| `~/.mercury/mercury.yaml` | Main config (providers, channels, budget) |
|
|
86
|
+
| `~/.mercury/soul/*.md` | Agent personality (soul, persona, taste, heartbeat) |
|
|
87
|
+
| `~/.mercury/permissions.yaml` | Capabilities and approval rules |
|
|
88
|
+
| `~/.mercury/skills/` | Installed skills |
|
|
89
|
+
| `~/.mercury/schedules.yaml` | Scheduled tasks |
|
|
90
|
+
| `~/.mercury/token-usage.json` | Daily token usage tracking |
|
|
91
|
+
| `~/.mercury/memory/` | Short-term, long-term, episodic memory |
|
|
92
|
+
|
|
93
|
+
## Provider Fallback
|
|
94
|
+
|
|
95
|
+
Configure multiple LLM providers. Mercury tries them in order and falls back automatically:
|
|
96
|
+
|
|
97
|
+
- **DeepSeek** — default, cost-effective
|
|
98
|
+
- **OpenAI** — GPT-4o-mini and others
|
|
99
|
+
- **Anthropic** — Claude and others
|
|
100
|
+
|
|
101
|
+
## Architecture
|
|
102
|
+
|
|
103
|
+
- **TypeScript + Node.js 20+** — ESM, tsup build, zero native dependencies
|
|
104
|
+
- **Vercel AI SDK v4** — `generateText` + `streamText`, 10-step agentic loop, provider fallback
|
|
105
|
+
- **grammY** — Telegram bot with typing indicators and file uploads
|
|
106
|
+
- **Flat-file persistence** — No database. YAML + JSON in `~/.mercury/`
|
|
107
|
+
|
|
108
|
+
## License
|
|
109
|
+
|
|
110
|
+
MIT © [Cosmic Stack](https://github.com/cosmicstack-labs)
|