mente-agent 0.11.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 +21 -0
- package/README.md +229 -0
- package/README.zh.md +230 -0
- package/npm/installer/bin/mente.cjs +83 -0
- package/npm/installer/lib/paths.cjs +95 -0
- package/npm/installer/lib/publish-check.cjs +59 -0
- package/package.json +45 -0
- package/scripts/install.cmd +28 -0
- package/scripts/install.ps1 +997 -0
- package/scripts/install.sh +1660 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Nous Research
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/mente-agent-banner.png" alt="Mente Agent" width="100%">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<strong>English</strong> · <a href="./README.zh.md">中文</a>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
# Mente Agent ☤
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://chemany.github.io/Mente/docs/"><img src="https://img.shields.io/badge/Docs-chemany.github.io%2FMente%2Fdocs-FFD700?style=for-the-badge" alt="Documentation"></a>
|
|
13
|
+
<a href="https://discord.gg/NousResearch"><img src="https://img.shields.io/badge/Discord-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Discord"></a>
|
|
14
|
+
<a href="https://github.com/chemany/Mente/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-green?style=for-the-badge" alt="License: MIT"></a>
|
|
15
|
+
<a href="https://github.com/chemany/Mente"><img src="https://img.shields.io/badge/GitHub-chemany%2FMente-111827?style=for-the-badge&logo=github&logoColor=white" alt="GitHub Repository"></a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
**Mente is a unified AI agent for coding, automation, gateway workflows, and long-term memory.** It creates skills from experience, improves them during use, nudges itself to persist knowledge, searches its own past conversations, and builds a deepening model of who you are across sessions. Run it on a $5 VPS, a GPU cluster, or serverless infrastructure that costs nearly nothing when idle. It's not tied to your laptop — talk to it from Telegram while it works on a cloud VM.
|
|
19
|
+
|
|
20
|
+
This branch also completes a product-surface consolidation pass:
|
|
21
|
+
|
|
22
|
+
- **External surface is uniformly Mente** across CLI, gateway progress, messaging, and user-facing replies.
|
|
23
|
+
- **Internal execution still runs on the Codex-backed executor** — the rename is presentation-layer cleanup, not a runtime downgrade.
|
|
24
|
+
- **Gateway progress is visible again** with Mente-facing step names while preserving detailed command/tool activity.
|
|
25
|
+
- **Config/admin operations are now explicit** through a dedicated Mente skill for API keys, provider auth, `.env`, `config.yaml`, and gateway restart rules.
|
|
26
|
+
|
|
27
|
+
<p align="center">
|
|
28
|
+
<img src="assets/mente-stack.svg" alt="Mente product surface with Codex-backed core and npm bootstrap installer" width="100%">
|
|
29
|
+
</p>
|
|
30
|
+
|
|
31
|
+
Use any model you want — [Nous Portal](https://portal.nousresearch.com), [OpenRouter](https://openrouter.ai) (200+ models), [NVIDIA NIM](https://build.nvidia.com) (Nemotron), [Xiaomi MiMo](https://platform.xiaomimimo.com), [z.ai/GLM](https://z.ai), [Kimi/Moonshot](https://platform.moonshot.ai), [MiniMax](https://www.minimax.io), [Hugging Face](https://huggingface.co), OpenAI, or your own endpoint. Switch with `mente model` — no code changes, no lock-in.
|
|
32
|
+
|
|
33
|
+
<table>
|
|
34
|
+
<tr><td><b>A real terminal interface</b></td><td>Full TUI with multiline editing, slash-command autocomplete, conversation history, interrupt-and-redirect, and streaming tool output.</td></tr>
|
|
35
|
+
<tr><td><b>Lives where you do</b></td><td>Telegram, Discord, Slack, WhatsApp, Signal, and CLI — all from a single gateway process. Voice memo transcription, cross-platform conversation continuity.</td></tr>
|
|
36
|
+
<tr><td><b>A closed learning loop</b></td><td>Agent-curated memory with periodic nudges. Autonomous skill creation after complex tasks. Skills self-improve during use. FTS5 session search with LLM summarization for cross-session recall. <a href="https://github.com/plastic-labs/honcho">Honcho</a> dialectic user modeling. Compatible with the <a href="https://agentskills.io">agentskills.io</a> open standard.</td></tr>
|
|
37
|
+
<tr><td><b>Scheduled automations</b></td><td>Built-in cron scheduler with delivery to any platform. Daily reports, nightly backups, weekly audits — all in natural language, running unattended.</td></tr>
|
|
38
|
+
<tr><td><b>Delegates and parallelizes</b></td><td>Spawn isolated subagents for parallel workstreams. Write Python scripts that call tools via RPC, collapsing multi-step pipelines into zero-context-cost turns.</td></tr>
|
|
39
|
+
<tr><td><b>Runs anywhere, not just your laptop</b></td><td>Six terminal backends — local, Docker, SSH, Daytona, Singularity, and Modal. Daytona and Modal offer serverless persistence — your agent's environment hibernates when idle and wakes on demand, costing nearly nothing between sessions. Run it on a $5 VPS or a GPU cluster.</td></tr>
|
|
40
|
+
<tr><td><b>Research-ready</b></td><td>Batch trajectory generation, Atropos RL environments, trajectory compression for training the next generation of tool-calling models.</td></tr>
|
|
41
|
+
</table>
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Quick Install
|
|
46
|
+
|
|
47
|
+
### Option 1: direct installer
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
curl -fsSL https://raw.githubusercontent.com/chemany/Mente/main/scripts/install.sh | bash
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Works on Linux, macOS, WSL2, and Android via Termux. The one-click installer is release-pinned by default and can also bootstrap a matching vendored Codex runtime from local/offline assets via `--runtime-artifact-manifest` and `--runtime-wheel`.
|
|
54
|
+
|
|
55
|
+
### Option 2: npm bootstrapper
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm install -g mente-agent
|
|
59
|
+
mente
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The npm package is intentionally **thin**. It publishes only the launcher and installer scripts, then bootstraps the full Mente runtime on first run. By default the bootstrapper installs from the repo's `main` branch, and you can force a tagged release with `MENTE_BOOTSTRAP_RELEASE=<tag> mente`. It does **not** publish your local `.env`, `auth.json`, `~/.mente`, `~/.hermes`, sessions, logs, or other machine-local state.
|
|
63
|
+
|
|
64
|
+
At the moment, the repository is **ready for npm publish but not yet live on the npm registry**. Until the first public npm release is published, use Option 1 above. Once the package is published, the `npm install -g mente-agent` flow becomes the primary one-line install path.
|
|
65
|
+
|
|
66
|
+
Release operators can use the short npm runbook here: [docs/releasing/npm.md](docs/releasing/npm.md).
|
|
67
|
+
|
|
68
|
+
> **Android / Termux:** The tested manual path is documented in the [Termux guide](https://chemany.github.io/Mente/docs/getting-started/termux). On Termux, Mente installs a curated `.[termux]` extra because the full `.[all]` extra currently pulls Android-incompatible voice dependencies.
|
|
69
|
+
>
|
|
70
|
+
> **Windows:** Native Windows is not supported. Please install [WSL2](https://learn.microsoft.com/en-us/windows/wsl/install) and run the command above.
|
|
71
|
+
>
|
|
72
|
+
> **Developers / source checkouts:** use `./setup-hermes.sh` after cloning the repo manually. That path is for editable development, not the frozen end-user release install.
|
|
73
|
+
|
|
74
|
+
After installation:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
source ~/.bashrc # reload shell (or: source ~/.zshrc)
|
|
78
|
+
mente # start chatting!
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Getting Started
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
mente # Interactive CLI — start a conversation
|
|
87
|
+
mente model # Choose your LLM provider and model
|
|
88
|
+
mente tools # Configure which tools are enabled
|
|
89
|
+
mente config set # Set individual config values
|
|
90
|
+
mente gateway # Start the messaging gateway (Telegram, Discord, etc.)
|
|
91
|
+
mente setup # Run the full setup wizard (configures everything at once)
|
|
92
|
+
mente claw migrate # Migrate from OpenClaw (if coming from OpenClaw)
|
|
93
|
+
mente update # Update to the latest version
|
|
94
|
+
mente doctor # Diagnose any issues
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
📖 **[Full documentation →](https://chemany.github.io/Mente/docs/)**
|
|
98
|
+
|
|
99
|
+
## What This Refresh Changes
|
|
100
|
+
|
|
101
|
+
This README tracks the current Mente packaging and runtime direction:
|
|
102
|
+
|
|
103
|
+
- **One current install command for GitHub visitors:** `curl -fsSL https://raw.githubusercontent.com/chemany/Mente/main/scripts/install.sh | bash`
|
|
104
|
+
- **One intended npm install command after publish:** `npm install -g mente-agent`
|
|
105
|
+
- **One visible agent identity:** user-facing replies and progress now present as `Mente`
|
|
106
|
+
- **Same execution depth under the hood:** complex coding and tool work still route through the Codex-backed executor
|
|
107
|
+
- **Safer operations surface:** packaging is whitelist-based, and config/admin actions now have explicit handling for API keys, provider auth, and restart boundaries
|
|
108
|
+
|
|
109
|
+
If you are evaluating Mente from GitHub, the practical model is:
|
|
110
|
+
|
|
111
|
+
1. Install Mente with the direct installer.
|
|
112
|
+
2. Launch `mente`.
|
|
113
|
+
3. Let the bootstrap flow finish preparing the full runtime.
|
|
114
|
+
4. Use Mente normally from CLI or gateway surfaces.
|
|
115
|
+
|
|
116
|
+
## CLI vs Messaging Quick Reference
|
|
117
|
+
|
|
118
|
+
Mente has two entry points: start the terminal UI with `mente`, or run the gateway and talk to it from Telegram, Discord, Slack, WhatsApp, Signal, or Email. Once you're in a conversation, many slash commands are shared across both interfaces.
|
|
119
|
+
|
|
120
|
+
| Action | CLI | Messaging platforms |
|
|
121
|
+
|---------|-----|---------------------|
|
|
122
|
+
| Start chatting | `mente` | Run `mente gateway setup` + `mente gateway start`, then send the bot a message |
|
|
123
|
+
| Start fresh conversation | `/new` or `/reset` | `/new` or `/reset` |
|
|
124
|
+
| Change model | `/model [provider:model]` | `/model [provider:model]` |
|
|
125
|
+
| Set a personality | `/personality [name]` | `/personality [name]` |
|
|
126
|
+
| Retry or undo the last turn | `/retry`, `/undo` | `/retry`, `/undo` |
|
|
127
|
+
| Compress context / check usage | `/compress`, `/usage`, `/insights [--days N]` | `/compress`, `/usage`, `/insights [days]` |
|
|
128
|
+
| Browse skills | `/skills` or `/<skill-name>` | `/<skill-name>` |
|
|
129
|
+
| Interrupt current work | `Ctrl+C` or send a new message | `/stop` or send a new message |
|
|
130
|
+
| Platform-specific status | `/platforms` | `/status`, `/sethome` |
|
|
131
|
+
|
|
132
|
+
For the full command lists, see the [CLI guide](https://chemany.github.io/Mente/docs/user-guide/cli) and the [Messaging Gateway guide](https://chemany.github.io/Mente/docs/user-guide/messaging).
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Documentation
|
|
137
|
+
|
|
138
|
+
All documentation lives at **[chemany.github.io/Mente/docs](https://chemany.github.io/Mente/docs/)**:
|
|
139
|
+
|
|
140
|
+
| Section | What's Covered |
|
|
141
|
+
|---------|---------------|
|
|
142
|
+
| [Quickstart](https://chemany.github.io/Mente/docs/getting-started/quickstart) | Install → setup → first conversation in 2 minutes |
|
|
143
|
+
| [CLI Usage](https://chemany.github.io/Mente/docs/user-guide/cli) | Commands, keybindings, personalities, sessions |
|
|
144
|
+
| [Configuration](https://chemany.github.io/Mente/docs/user-guide/configuration) | Config file, providers, models, all options |
|
|
145
|
+
| [Messaging Gateway](https://chemany.github.io/Mente/docs/user-guide/messaging) | Telegram, Discord, Slack, WhatsApp, Signal, Home Assistant |
|
|
146
|
+
| [Security](https://chemany.github.io/Mente/docs/user-guide/security) | Command approval, DM pairing, container isolation |
|
|
147
|
+
| [Tools & Toolsets](https://chemany.github.io/Mente/docs/user-guide/features/tools) | 40+ tools, toolset system, terminal backends |
|
|
148
|
+
| [Skills System](https://chemany.github.io/Mente/docs/user-guide/features/skills) | Procedural memory, Skills Hub, creating skills |
|
|
149
|
+
| [Memory](https://chemany.github.io/Mente/docs/user-guide/features/memory) | Persistent memory, user profiles, best practices |
|
|
150
|
+
| [MCP Integration](https://chemany.github.io/Mente/docs/user-guide/features/mcp) | Connect any MCP server for extended capabilities |
|
|
151
|
+
| [Cron Scheduling](https://chemany.github.io/Mente/docs/user-guide/features/cron) | Scheduled tasks with platform delivery |
|
|
152
|
+
| [Context Files](https://chemany.github.io/Mente/docs/user-guide/features/context-files) | Project context that shapes every conversation |
|
|
153
|
+
| [Architecture](https://chemany.github.io/Mente/docs/developer-guide/architecture) | Project structure, agent loop, key classes |
|
|
154
|
+
| [Contributing](https://chemany.github.io/Mente/docs/developer-guide/contributing) | Development setup, PR process, code style |
|
|
155
|
+
| [CLI Reference](https://chemany.github.io/Mente/docs/reference/cli-commands) | All commands and flags |
|
|
156
|
+
| [Environment Variables](https://chemany.github.io/Mente/docs/reference/environment-variables) | Complete env var reference |
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Migrating from OpenClaw
|
|
161
|
+
|
|
162
|
+
If you're coming from OpenClaw, Mente can automatically import your settings, memories, skills, and API keys.
|
|
163
|
+
|
|
164
|
+
**During first-time setup:** The setup wizard (`mente setup`) automatically detects `~/.openclaw` and offers to migrate before configuration begins.
|
|
165
|
+
|
|
166
|
+
**Anytime after install:**
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
mente claw migrate # Interactive migration (full preset)
|
|
170
|
+
mente claw migrate --dry-run # Preview what would be migrated
|
|
171
|
+
mente claw migrate --preset user-data # Migrate without secrets
|
|
172
|
+
mente claw migrate --overwrite # Overwrite existing conflicts
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
What gets imported:
|
|
176
|
+
- **SOUL.md** — persona file
|
|
177
|
+
- **Memories** — MEMORY.md and USER.md entries
|
|
178
|
+
- **Skills** — user-created skills → `~/.hermes/skills/openclaw-imports/`
|
|
179
|
+
- **Command allowlist** — approval patterns
|
|
180
|
+
- **Messaging settings** — platform configs, allowed users, working directory
|
|
181
|
+
- **API keys** — allowlisted secrets (Telegram, OpenRouter, OpenAI, Anthropic, ElevenLabs)
|
|
182
|
+
- **TTS assets** — workspace audio files
|
|
183
|
+
- **Workspace instructions** — AGENTS.md (with `--workspace-target`)
|
|
184
|
+
|
|
185
|
+
See `mente claw migrate --help` for all options, or use the `openclaw-migration` skill for an interactive agent-guided migration with dry-run previews.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Contributing
|
|
190
|
+
|
|
191
|
+
We welcome contributions! See the [Contributing Guide](https://chemany.github.io/Mente/docs/developer-guide/contributing) for development setup, code style, and PR process.
|
|
192
|
+
|
|
193
|
+
Quick start for contributors — clone and go with `setup-hermes.sh`:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
git clone https://github.com/chemany/Mente.git
|
|
197
|
+
cd Mente
|
|
198
|
+
./setup-hermes.sh # installs uv, creates venv, installs .[all], symlinks ~/.local/bin/mente
|
|
199
|
+
./mente # auto-detects the venv, no need to `source` first
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Manual path (equivalent to the above):
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
206
|
+
uv venv venv --python 3.11
|
|
207
|
+
source venv/bin/activate
|
|
208
|
+
uv pip install -e ".[all,dev]"
|
|
209
|
+
scripts/run_tests.sh
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
> **RL Training (optional):** The RL/Atropos integration (`environments/`) ships via the `atroposlib` and `tinker` dependencies pulled in by `.[all,dev]` — no submodule setup required.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Community
|
|
217
|
+
|
|
218
|
+
- 💬 [Discord](https://discord.gg/NousResearch)
|
|
219
|
+
- 📚 [Skills Hub](https://agentskills.io)
|
|
220
|
+
- 🐛 [Issues](https://github.com/chemany/Mente/issues)
|
|
221
|
+
- 🔌 [HermesClaw](https://github.com/AaronWong1999/hermesclaw) — Community WeChat bridge: Run Mente and OpenClaw on the same WeChat account.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## License
|
|
226
|
+
|
|
227
|
+
MIT — see [LICENSE](LICENSE).
|
|
228
|
+
|
|
229
|
+
Built for the Mente project.
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/mente-agent-banner.png" alt="Mente Agent" width="100%">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="./README.md">English</a> · <strong>中文</strong>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
# Mente Agent ☤
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://chemany.github.io/Mente/docs/"><img src="https://img.shields.io/badge/Docs-chemany.github.io%2FMente%2Fdocs-FFD700?style=for-the-badge" alt="Documentation"></a>
|
|
13
|
+
<a href="https://discord.gg/NousResearch"><img src="https://img.shields.io/badge/Discord-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Discord"></a>
|
|
14
|
+
<a href="https://github.com/chemany/Mente/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-green?style=for-the-badge" alt="License: MIT"></a>
|
|
15
|
+
<a href="https://github.com/chemany/Mente"><img src="https://img.shields.io/badge/GitHub-chemany%2FMente-111827?style=for-the-badge&logo=github&logoColor=white" alt="GitHub Repository"></a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
**Mente 是一个统一的 AI agent,覆盖编码、自动化、网关工作流和长期记忆。** 它会从经验中沉淀技能,在使用过程中持续优化,主动推动自己保留有价值的知识,检索历史对话,并在跨会话中逐步形成对你的长期理解。你可以把它跑在一台每月几美元的 VPS、GPU 集群,或者几乎闲置零成本的 serverless 基础设施上。它不被绑在你的本地电脑里,你甚至可以在 Telegram 上和它对话,同时让它在云端机器上持续工作。
|
|
19
|
+
|
|
20
|
+
这个分支还完成了一轮产品公开面的统一收边:
|
|
21
|
+
|
|
22
|
+
- **对外统一使用 Mente**,CLI、网关进度、消息平台和用户可见回复都不再混用旧品牌。
|
|
23
|
+
- **内部执行仍然使用 Codex 支撑的执行器**,这次调整是展示层收口,不是能力降级。
|
|
24
|
+
- **网关执行进度重新可见**,对外显示为 Mente 的步骤名称,同时保留底层命令和工具活动明细。
|
|
25
|
+
- **配置和管理类操作已经明确化**,通过专门的 Mente skill 处理 API key、provider 鉴权、`.env`、`config.yaml` 与网关重启边界。
|
|
26
|
+
|
|
27
|
+
<p align="center">
|
|
28
|
+
<img src="assets/mente-stack.svg" alt="Mente product surface with Codex-backed core and npm bootstrap installer" width="100%">
|
|
29
|
+
</p>
|
|
30
|
+
|
|
31
|
+
你可以接任意模型和任意推理服务:[Nous Portal](https://portal.nousresearch.com)、[OpenRouter](https://openrouter.ai)(200+ 模型)、[NVIDIA NIM](https://build.nvidia.com)(Nemotron)、[Xiaomi MiMo](https://platform.xiaomimimo.com)、[z.ai/GLM](https://z.ai)、[Kimi/Moonshot](https://platform.moonshot.ai)、[MiniMax](https://www.minimax.io)、[Hugging Face](https://huggingface.co)、OpenAI,或者你自己的兼容端点。通过 `mente model` 就能切换,不需要改代码,也不会被供应商锁定。
|
|
32
|
+
|
|
33
|
+
<table>
|
|
34
|
+
<tr><td><b>真正可用的终端界面</b></td><td>完整 TUI,支持多行输入、斜杠命令补全、会话历史、打断并改向,以及实时工具输出流。</td></tr>
|
|
35
|
+
<tr><td><b>跟着你工作的入口</b></td><td>Telegram、Discord、Slack、WhatsApp、Signal 和 CLI 共用同一个网关进程。支持语音转写,也支持跨平台连续对话。</td></tr>
|
|
36
|
+
<tr><td><b>闭环学习能力</b></td><td>带周期性提醒的 agent 记忆系统;复杂任务后自动产出技能;技能在使用中持续改进;基于 FTS5 的会话检索与 LLM 摘要;集成 <a href="https://github.com/plastic-labs/honcho">Honcho</a> 用户建模;兼容 <a href="https://agentskills.io">agentskills.io</a> 开放标准。</td></tr>
|
|
37
|
+
<tr><td><b>定时自动化</b></td><td>内置 cron 调度,可把结果投递到任意平台。日报、夜间备份、每周审计都能用自然语言配置后无人值守执行。</td></tr>
|
|
38
|
+
<tr><td><b>委派与并行</b></td><td>可以生成隔离子代理并行工作,也可以写 Python 脚本通过 RPC 调工具,把多步流程压缩成零上下文成本的单回合执行。</td></tr>
|
|
39
|
+
<tr><td><b>不只跑在你的笔记本上</b></td><td>内置六种终端后端:local、Docker、SSH、Daytona、Singularity、Modal。Daytona 和 Modal 支持类 serverless 持久环境,空闲时休眠、需要时唤醒,几乎不花闲置成本。既能跑在 $5 VPS,也能跑在 GPU 集群。</td></tr>
|
|
40
|
+
<tr><td><b>适合研究与训练</b></td><td>支持批量轨迹生成、Atropos RL 环境,以及用于训练下一代工具调用模型的轨迹压缩。</td></tr>
|
|
41
|
+
</table>
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 快速安装
|
|
46
|
+
|
|
47
|
+
### 方案 1:直接使用安装脚本
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
curl -fsSL https://raw.githubusercontent.com/chemany/Mente/main/scripts/install.sh | bash
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
支持 Linux、macOS、WSL2,以及 Android 的 Termux。这个一键安装器默认按 release 版本固定安装,也能通过 `--runtime-artifact-manifest` 和 `--runtime-wheel` 从本地或离线资源引导匹配的 vendored runtime。
|
|
54
|
+
|
|
55
|
+
### 方案 2:npm 引导安装
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm install -g mente-agent
|
|
59
|
+
mente
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
这个 npm 包刻意保持 **很薄**。它只发布 launcher 和 installer 脚本,第一次运行时再自动引导完整的 Mente runtime。默认会从仓库的 `main` 分支完成 bootstrap,你也可以通过 `MENTE_BOOTSTRAP_RELEASE=<tag> mente` 强制安装某个发布版本。它 **不会** 把你本机的 `.env`、`auth.json`、`~/.mente`、`~/.hermes`、sessions、logs 或其它机器私有状态打进包里。
|
|
63
|
+
|
|
64
|
+
目前仓库里的 npm 包已经 **具备可发布状态,但还没有真正发布到 npm registry**。在首个公开 npm 版本上线前,请先使用上面的方案 1。等包真正发布后,`npm install -g mente-agent` 才是对外的一键安装主路径。
|
|
65
|
+
|
|
66
|
+
如果你是发布操作人,最短 npm 发布说明见:[docs/releasing/npm.md](docs/releasing/npm.md)。
|
|
67
|
+
|
|
68
|
+
> **Android / Termux:** 已验证的手动安装路径见 [Termux 指南](https://chemany.github.io/Mente/docs/getting-started/termux)。在 Termux 上,Mente 会安装精简过的 `.[termux]` 依赖集合,因为完整的 `.[all]` 目前会拉到 Android 不兼容的语音依赖。
|
|
69
|
+
>
|
|
70
|
+
> **Windows:** 暂不支持原生 Windows。请先安装 [WSL2](https://learn.microsoft.com/en-us/windows/wsl/install),再在 WSL2 里执行上面的命令。
|
|
71
|
+
>
|
|
72
|
+
> **开发者 / 源码用户:** 如果你是手动克隆仓库,请使用 `./setup-hermes.sh`。这是面向可编辑开发环境的路径,不是面向最终用户的冻结发布安装方式。
|
|
73
|
+
|
|
74
|
+
安装完成后:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
source ~/.bashrc # 重新加载 shell(或 source ~/.zshrc)
|
|
78
|
+
mente # 开始对话
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 快速开始
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
mente # 启动交互式 CLI
|
|
87
|
+
mente model # 选择 LLM provider 和模型
|
|
88
|
+
mente tools # 配置启用哪些工具
|
|
89
|
+
mente config set # 设置单个配置项
|
|
90
|
+
mente gateway # 启动消息网关(Telegram、Discord 等)
|
|
91
|
+
mente setup # 跑完整初始化向导
|
|
92
|
+
mente claw migrate # 从 OpenClaw 迁移(如有)
|
|
93
|
+
mente update # 更新到最新版本
|
|
94
|
+
mente doctor # 检查并诊断问题
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
📖 **[完整文档 →](https://chemany.github.io/Mente/docs/)**
|
|
98
|
+
|
|
99
|
+
## 这一轮刷新带来了什么
|
|
100
|
+
|
|
101
|
+
当前 README 反映的是 Mente 最新的打包和 runtime 方向:
|
|
102
|
+
|
|
103
|
+
- **GitHub 访客当前可用的一条安装命令:** `curl -fsSL https://raw.githubusercontent.com/chemany/Mente/main/scripts/install.sh | bash`
|
|
104
|
+
- **npm 发布后的目标一条安装命令:** `npm install -g mente-agent`
|
|
105
|
+
- **统一的可见 agent 身份:** 对外回复和进度统一呈现为 `Mente`
|
|
106
|
+
- **同样深度的底层执行能力:** 复杂编码和工具执行仍然走 Codex-backed executor
|
|
107
|
+
- **更安全的运维表面:** 打包采用白名单方式,配置/管理操作也有 API key、provider 鉴权和重启边界的明确处理
|
|
108
|
+
|
|
109
|
+
如果你是从 GitHub 第一次接触 Mente,最实用的理解方式是:
|
|
110
|
+
|
|
111
|
+
1. 先通过直接安装脚本安装 Mente。
|
|
112
|
+
2. 执行 `mente`。
|
|
113
|
+
3. 让 bootstrap 流程完成完整 runtime 的准备。
|
|
114
|
+
4. 再从 CLI 或消息网关里正常使用 Mente。
|
|
115
|
+
|
|
116
|
+
## CLI 与消息网关速查
|
|
117
|
+
|
|
118
|
+
Mente 有两个主要入口:直接运行 `mente` 打开终端 UI,或者启动网关后从 Telegram、Discord、Slack、WhatsApp、Signal、Email 等入口和它对话。进入会话后,很多斜杠命令在两类入口中是共通的。
|
|
119
|
+
|
|
120
|
+
| 操作 | CLI | 消息平台 |
|
|
121
|
+
|---------|-----|---------------------|
|
|
122
|
+
| 开始聊天 | `mente` | 运行 `mente gateway setup` + `mente gateway start`,然后给机器人发消息 |
|
|
123
|
+
| 开启全新会话 | `/new` 或 `/reset` | `/new` 或 `/reset` |
|
|
124
|
+
| 切换模型 | `/model [provider:model]` | `/model [provider:model]` |
|
|
125
|
+
| 设置人格 | `/personality [name]` | `/personality [name]` |
|
|
126
|
+
| 重试或撤销上一轮 | `/retry`, `/undo` | `/retry`, `/undo` |
|
|
127
|
+
| 压缩上下文 / 查看用量 | `/compress`, `/usage`, `/insights [--days N]` | `/compress`, `/usage`, `/insights [days]` |
|
|
128
|
+
| 浏览技能 | `/skills` 或 `/<skill-name>` | `/<skill-name>` |
|
|
129
|
+
| 打断当前工作 | `Ctrl+C` 或直接发新消息 | `/stop` 或直接发新消息 |
|
|
130
|
+
| 平台侧状态 | `/platforms` | `/status`, `/sethome` |
|
|
131
|
+
|
|
132
|
+
完整命令列表见 [CLI 指南](https://chemany.github.io/Mente/docs/user-guide/cli) 和 [消息网关指南](https://chemany.github.io/Mente/docs/user-guide/messaging)。
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 文档导航
|
|
137
|
+
|
|
138
|
+
所有文档都在 **[chemany.github.io/Mente/docs](https://chemany.github.io/Mente/docs/)**:
|
|
139
|
+
|
|
140
|
+
| 板块 | 内容 |
|
|
141
|
+
|---------|---------------|
|
|
142
|
+
| [Quickstart](https://chemany.github.io/Mente/docs/getting-started/quickstart) | 2 分钟完成安装、配置和第一次对话 |
|
|
143
|
+
| [CLI Usage](https://chemany.github.io/Mente/docs/user-guide/cli) | 命令、快捷键、人格、会话 |
|
|
144
|
+
| [Configuration](https://chemany.github.io/Mente/docs/user-guide/configuration) | 配置文件、provider、模型与全部选项 |
|
|
145
|
+
| [Messaging Gateway](https://chemany.github.io/Mente/docs/user-guide/messaging) | Telegram、Discord、Slack、WhatsApp、Signal、Home Assistant |
|
|
146
|
+
| [Security](https://chemany.github.io/Mente/docs/user-guide/security) | 命令审批、私聊绑定、容器隔离 |
|
|
147
|
+
| [Tools & Toolsets](https://chemany.github.io/Mente/docs/user-guide/features/tools) | 40+ 工具、toolset 系统、终端后端 |
|
|
148
|
+
| [Skills System](https://chemany.github.io/Mente/docs/user-guide/features/skills) | 程序化记忆、Skills Hub、技能创建 |
|
|
149
|
+
| [Memory](https://chemany.github.io/Mente/docs/user-guide/features/memory) | 持久记忆、用户画像、最佳实践 |
|
|
150
|
+
| [MCP Integration](https://chemany.github.io/Mente/docs/user-guide/features/mcp) | 连接任意 MCP server 扩展能力 |
|
|
151
|
+
| [Cron Scheduling](https://chemany.github.io/Mente/docs/user-guide/features/cron) | 支持跨平台投递的定时任务 |
|
|
152
|
+
| [Context Files](https://chemany.github.io/Mente/docs/user-guide/features/context-files) | 影响每次对话的项目上下文 |
|
|
153
|
+
| [Architecture](https://chemany.github.io/Mente/docs/developer-guide/architecture) | 项目结构、agent loop、关键类 |
|
|
154
|
+
| [Contributing](https://chemany.github.io/Mente/docs/developer-guide/contributing) | 开发环境、PR 流程、代码风格 |
|
|
155
|
+
| [CLI Reference](https://chemany.github.io/Mente/docs/reference/cli-commands) | 全量命令与参数说明 |
|
|
156
|
+
| [Environment Variables](https://chemany.github.io/Mente/docs/reference/environment-variables) | 完整环境变量参考 |
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## 从 OpenClaw 迁移
|
|
161
|
+
|
|
162
|
+
如果你来自 OpenClaw,Mente 可以自动导入你的配置、记忆、技能和 API key。
|
|
163
|
+
|
|
164
|
+
**第一次 setup 时:** `mente setup` 会自动检测 `~/.openclaw`,并在正式配置前询问是否迁移。
|
|
165
|
+
|
|
166
|
+
**任意时间手动迁移:**
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
mente claw migrate # 交互式迁移(完整预设)
|
|
170
|
+
mente claw migrate --dry-run # 先预览会迁移什么
|
|
171
|
+
mente claw migrate --preset user-data # 不迁移 secrets
|
|
172
|
+
mente claw migrate --overwrite # 覆盖已有冲突项
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
会导入的内容包括:
|
|
176
|
+
|
|
177
|
+
- **SOUL.md**:人格文件
|
|
178
|
+
- **Memories**:MEMORY.md 与 USER.md 记录
|
|
179
|
+
- **Skills**:用户自建技能,导入到 `~/.hermes/skills/openclaw-imports/`
|
|
180
|
+
- **命令白名单**:审批模式和允许规则
|
|
181
|
+
- **消息平台配置**:平台设置、允许用户、工作目录
|
|
182
|
+
- **API keys**:允许迁移的 secrets(Telegram、OpenRouter、OpenAI、Anthropic、ElevenLabs)
|
|
183
|
+
- **TTS 资源**:工作区音频文件
|
|
184
|
+
- **工作区指令**:AGENTS.md(支持 `--workspace-target`)
|
|
185
|
+
|
|
186
|
+
更多参数见 `mente claw migrate --help`,或者直接使用 `openclaw-migration` skill,让 agent 以带 dry-run 预览的方式引导你完成迁移。
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 贡献
|
|
191
|
+
|
|
192
|
+
欢迎贡献。开发环境、代码风格和 PR 流程请看 [Contributing Guide](https://chemany.github.io/Mente/docs/developer-guide/contributing)。
|
|
193
|
+
|
|
194
|
+
贡献者的快速开始路径如下,克隆后直接跑 `setup-hermes.sh`:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
git clone https://github.com/chemany/Mente.git
|
|
198
|
+
cd Mente
|
|
199
|
+
./setup-hermes.sh # 安装 uv、创建 venv、安装 .[all]、把 ~/.local/bin/mente 软链好
|
|
200
|
+
./mente # 会自动识别 venv,不需要先 source
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
手动安装路径如下,效果等同:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
207
|
+
uv venv venv --python 3.11
|
|
208
|
+
source venv/bin/activate
|
|
209
|
+
uv pip install -e ".[all,dev]"
|
|
210
|
+
scripts/run_tests.sh
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
> **RL Training(可选):** `environments/` 下的 RL / Atropos 集成会通过 `.[all,dev]` 自动拉入 `atroposlib` 和 `tinker`,不需要额外处理 submodule。
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## 社区
|
|
218
|
+
|
|
219
|
+
- 💬 [Discord](https://discord.gg/NousResearch)
|
|
220
|
+
- 📚 [Skills Hub](https://agentskills.io)
|
|
221
|
+
- 🐛 [Issues](https://github.com/chemany/Mente/issues)
|
|
222
|
+
- 🔌 [HermesClaw](https://github.com/AaronWong1999/hermesclaw) — 社区维护的微信桥接工具,可让 Mente 和 OpenClaw 共用同一个微信账号。
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## 许可证
|
|
227
|
+
|
|
228
|
+
MIT,见 [LICENSE](LICENSE)。
|
|
229
|
+
|
|
230
|
+
为 Mente 项目而构建。
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('node:fs');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
const { spawnSync } = require('node:child_process');
|
|
6
|
+
|
|
7
|
+
const {
|
|
8
|
+
findInstalledMenteBinary,
|
|
9
|
+
getBootstrapInstallArgs,
|
|
10
|
+
getBundledInstallPowerShellScript,
|
|
11
|
+
getBundledInstallScript,
|
|
12
|
+
} = require('../lib/paths.cjs');
|
|
13
|
+
|
|
14
|
+
function isSameExecutable(a, b) {
|
|
15
|
+
if (!a || !b) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
return fs.realpathSync(a) === fs.realpathSync(b);
|
|
20
|
+
} catch {
|
|
21
|
+
return path.resolve(a) === path.resolve(b);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function run(command, args, options = {}) {
|
|
26
|
+
const result = spawnSync(command, args, {
|
|
27
|
+
stdio: 'inherit',
|
|
28
|
+
env: process.env,
|
|
29
|
+
...options,
|
|
30
|
+
});
|
|
31
|
+
if (result.error) {
|
|
32
|
+
throw result.error;
|
|
33
|
+
}
|
|
34
|
+
return result.status ?? 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function bootstrapInstall() {
|
|
38
|
+
if (process.platform === 'win32') {
|
|
39
|
+
const powershellScript = getBundledInstallPowerShellScript();
|
|
40
|
+
return run('powershell', [
|
|
41
|
+
'-ExecutionPolicy',
|
|
42
|
+
'Bypass',
|
|
43
|
+
'-File',
|
|
44
|
+
powershellScript,
|
|
45
|
+
...getBootstrapInstallArgs(),
|
|
46
|
+
]);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const installScript = getBundledInstallScript();
|
|
50
|
+
return run('bash', [installScript, ...getBootstrapInstallArgs()]);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function main() {
|
|
54
|
+
const selfPath = process.argv[1];
|
|
55
|
+
const menteBinary = findInstalledMenteBinary({
|
|
56
|
+
skip: [selfPath],
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
if (menteBinary && !isSameExecutable(menteBinary, selfPath)) {
|
|
60
|
+
const exitCode = run(menteBinary, process.argv.slice(2));
|
|
61
|
+
process.exit(exitCode);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
console.error('Mente runtime not found. Bootstrapping the full installer...');
|
|
65
|
+
const installExitCode = bootstrapInstall();
|
|
66
|
+
if (installExitCode !== 0) {
|
|
67
|
+
process.exit(installExitCode);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const installedBinary = findInstalledMenteBinary({
|
|
71
|
+
skip: [selfPath],
|
|
72
|
+
});
|
|
73
|
+
if (!installedBinary || isSameExecutable(installedBinary, selfPath)) {
|
|
74
|
+
console.error('Mente installer completed, but the runtime binary could not be located.');
|
|
75
|
+
console.error(`Expected install script: ${getBundledInstallScript()}`);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const exitCode = run(installedBinary, process.argv.slice(2));
|
|
80
|
+
process.exit(exitCode);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
main();
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
const fs = require('node:fs');
|
|
2
|
+
const path = require('node:path');
|
|
3
|
+
|
|
4
|
+
function getPackageRoot() {
|
|
5
|
+
return path.resolve(__dirname, '../../..');
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function getBundledInstallScript() {
|
|
9
|
+
return path.join(getPackageRoot(), 'scripts', 'install.sh');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function getBundledInstallPowerShellScript() {
|
|
13
|
+
return path.join(getPackageRoot(), 'scripts', 'install.ps1');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function getBundledInstallCmdScript() {
|
|
17
|
+
return path.join(getPackageRoot(), 'scripts', 'install.cmd');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function getBootstrapInstallArgs(env = process.env) {
|
|
21
|
+
const release = String(env.MENTE_BOOTSTRAP_RELEASE || '').trim();
|
|
22
|
+
if (release) {
|
|
23
|
+
return ['--release', release];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const branch = String(env.MENTE_BOOTSTRAP_BRANCH || '').trim() || 'main';
|
|
27
|
+
return ['--branch', branch];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function getEffectiveMenteHome(env = process.env) {
|
|
31
|
+
const menteHome = String(env.MENTE_HOME || '').trim();
|
|
32
|
+
if (menteHome) {
|
|
33
|
+
return menteHome;
|
|
34
|
+
}
|
|
35
|
+
const hermesHome = String(env.HERMES_HOME || '').trim();
|
|
36
|
+
if (hermesHome) {
|
|
37
|
+
return hermesHome;
|
|
38
|
+
}
|
|
39
|
+
const home = String(env.HOME || '').trim();
|
|
40
|
+
return home ? path.join(home, '.mente') : '';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function getInstalledBinaryCandidates(env = process.env) {
|
|
44
|
+
const candidates = [];
|
|
45
|
+
const menteHome = getEffectiveMenteHome(env);
|
|
46
|
+
if (menteHome) {
|
|
47
|
+
candidates.push(path.join(menteHome, 'mente-agent', 'venv', 'bin', 'mente'));
|
|
48
|
+
candidates.push(path.join(menteHome, 'mente-agent', '.venv', 'bin', 'mente'));
|
|
49
|
+
candidates.push(path.join(menteHome, 'mente-agent', 'venv', 'Scripts', 'mente.exe'));
|
|
50
|
+
candidates.push(path.join(menteHome, 'mente-agent', '.venv', 'Scripts', 'mente.exe'));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const pathEntries = String(env.PATH || '')
|
|
54
|
+
.split(path.delimiter)
|
|
55
|
+
.map((entry) => entry.trim())
|
|
56
|
+
.filter(Boolean);
|
|
57
|
+
|
|
58
|
+
for (const entry of pathEntries) {
|
|
59
|
+
candidates.push(path.join(entry, 'mente'));
|
|
60
|
+
candidates.push(path.join(entry, 'mente.exe'));
|
|
61
|
+
candidates.push(path.join(entry, 'mente.cmd'));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
candidates.push('/usr/local/bin/mente');
|
|
65
|
+
|
|
66
|
+
return [...new Set(candidates)];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function findInstalledMenteBinary(options = {}) {
|
|
70
|
+
const env = options.env || process.env;
|
|
71
|
+
const existsSync = options.existsSync || fs.existsSync;
|
|
72
|
+
const skip = new Set((options.skip || []).map((candidate) => path.resolve(candidate)));
|
|
73
|
+
|
|
74
|
+
for (const candidate of getInstalledBinaryCandidates(env)) {
|
|
75
|
+
const resolved = path.resolve(candidate);
|
|
76
|
+
if (skip.has(resolved)) {
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (existsSync(candidate)) {
|
|
80
|
+
return candidate;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
module.exports = {
|
|
87
|
+
findInstalledMenteBinary,
|
|
88
|
+
getBundledInstallCmdScript,
|
|
89
|
+
getBundledInstallPowerShellScript,
|
|
90
|
+
getBundledInstallScript,
|
|
91
|
+
getBootstrapInstallArgs,
|
|
92
|
+
getEffectiveMenteHome,
|
|
93
|
+
getInstalledBinaryCandidates,
|
|
94
|
+
getPackageRoot,
|
|
95
|
+
};
|