@cosmicstack/mercury-agent 1.0.5 → 1.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/README.md +74 -3
- package/dist/index.js +199 -129
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/card-dark.png">
|
|
4
|
+
<source media="(prefers-color-scheme: light)" srcset="docs/card-light.png">
|
|
5
|
+
<img alt="Mercury — Soul-Driven AI Agent" src="docs/card-light.png" width="600">
|
|
6
|
+
</picture>
|
|
3
7
|
</p>
|
|
4
8
|
|
|
5
9
|
<p align="center">
|
|
@@ -258,6 +262,73 @@ MIT © [Cosmic Stack](https://github.com/cosmicstack-labs)
|
|
|
258
262
|
|
|
259
263
|
---
|
|
260
264
|
|
|
261
|
-
##
|
|
265
|
+
## Contributing
|
|
262
266
|
|
|
263
|
-
|
|
267
|
+
We're open to contributions! Mercury is built to evolve, and we welcome help from the community. Whether it's fixing a bug, adding a tool, improving memory, or refining the soul — all quality contributions are appreciated.
|
|
268
|
+
|
|
269
|
+
### 🎯 Agentic Expertise — Must-Have for Contributors
|
|
270
|
+
|
|
271
|
+
Mercury isn't just another open-source project — it's a **soul-driven agent** that runs 24/7, manages permissions, remembers context, and interacts across channels. If you're contributing, you must think like an agent builder, not just a library contributor. These are non-negotiable principles every contributor should internalize:
|
|
272
|
+
|
|
273
|
+
| Principle | What It Means |
|
|
274
|
+
|-----------|---------------|
|
|
275
|
+
| 🧠 **Think in loops** | Mercury operates in a 10-step agentic loop. Your tool or feature will be called multiple times per conversation. Make it idempotent where possible. |
|
|
276
|
+
| 🔐 **Permission-first** | Every action that touches the outside world (files, shell, network, git) must go through the permission system. Never assume approval. |
|
|
277
|
+
| 💾 **Memory-aware** | If your feature generates facts about the user, consider hooking into the Second Brain. If it reads user data, check memory first. |
|
|
278
|
+
| 📏 **Token-conscious** | Mercury has a daily token budget. Logging, verbose outputs, and large context dumps burn tokens fast. Keep it lean. |
|
|
279
|
+
| 🔌 **Channel-agnostic** | Tools should work identically on CLI and Telegram. Don't assume a terminal, a keyboard, or even a human on the other end. |
|
|
280
|
+
| 🔁 **Graceful degradation** | If a provider fails, a tool errors, or a file doesn't exist — Mercury should recover, not crash. Always handle edge cases. |
|
|
281
|
+
| 📋 **Self-documenting** | Your tool's name and description are what Mercury reads to decide when to use it. Make them clear, specific, and action-oriented. |
|
|
282
|
+
| 🧪 **Test the loop, not just the function** | A tool that works in isolation may fail in the agentic loop (e.g., returns too much data, blocks the next step). Test end-to-end. |
|
|
283
|
+
|
|
284
|
+
### Code Quality — Dos
|
|
285
|
+
|
|
286
|
+
| Do | Why |
|
|
287
|
+
|----|-----|
|
|
288
|
+
| ✅ Write clean, readable TypeScript with explicit types | Mercury's codebase is type-safe — keep it that way |
|
|
289
|
+
| ✅ Add JSDoc comments on public functions and tools | Helps other contributors and the agent understand intent |
|
|
290
|
+
| ✅ Keep functions small and single-purpose | Easier to test, review, and reason about |
|
|
291
|
+
| ✅ Use async/await over raw promises | Consistent error handling and readability |
|
|
292
|
+
| ✅ Write tests for new tools and memory features | Reliability matters for a 24/7 agent |
|
|
293
|
+
| ✅ Follow the existing project structure (`src/tools/`, `src/memory/`, `src/channels/`) | Keeps the codebase navigable |
|
|
294
|
+
| ✅ Use the Agent Skills spec for new skill-based features | Ensures compatibility with the skills ecosystem |
|
|
295
|
+
| ✅ Document breaking changes in PR descriptions | Helps maintainers version properly |
|
|
296
|
+
|
|
297
|
+
### Code Quality — Don'ts
|
|
298
|
+
|
|
299
|
+
| Don't | Why |
|
|
300
|
+
|-------|-----|
|
|
301
|
+
| ❌ Don't add dependencies without discussion | Mercury is lean — every dep adds surface area |
|
|
302
|
+
| ❌ Don't hardcode API keys, tokens, or paths | Use config/env vars like the rest of the codebase |
|
|
303
|
+
| ❌ Don't bypass the permission system | Tools must ask before acting — that's Mercury's core promise |
|
|
304
|
+
| ❌ Don't introduce sync/blocking I/O in hot paths | Mercury is async-first for a reason |
|
|
305
|
+
| ❌ Don't commit large binary files or secrets | Use `.gitignore` and env files |
|
|
306
|
+
| ❌ Don't change the soul/persona system without discussion | It's the heart of Mercury — changes need care |
|
|
307
|
+
| ❌ Don't submit untested Telegram or daemon changes | These are hard to debug post-merge |
|
|
308
|
+
| ❌ Don't ignore the token budget system | Every tool should be mindful of token consumption |
|
|
309
|
+
|
|
310
|
+
### Getting Started
|
|
311
|
+
|
|
312
|
+
1. Fork the repo
|
|
313
|
+
2. Run `npm install`
|
|
314
|
+
3. Make your changes
|
|
315
|
+
4. Run `npm run build` to verify it compiles
|
|
316
|
+
5. Test with `mercury` locally
|
|
317
|
+
6. Open a PR with a clear description of what you changed and why
|
|
318
|
+
|
|
319
|
+
### PR Guidelines
|
|
320
|
+
|
|
321
|
+
- Keep PRs focused — one feature/fix per PR
|
|
322
|
+
- Include before/after behavior in the description
|
|
323
|
+
- Tag related issues if applicable
|
|
324
|
+
- Be responsive to review feedback
|
|
325
|
+
|
|
326
|
+
### Need Help?
|
|
327
|
+
|
|
328
|
+
Open an issue or reach out at [mercury@cosmicstack.org](mailto:mercury@cosmicstack.org). We're friendly.
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## Community
|
|
333
|
+
|
|
334
|
+
1. **Discord** — [Join the Mercury Agent Discord](https://discord.gg/5emMpMJy5J) for real-time chat, support, and community discussions.
|