morpheus-cli 0.2.2 → 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 +346 -282
- package/dist/cli/commands/init.js +14 -14
- package/dist/config/manager.js +1 -1
- package/dist/config/schemas.js +2 -2
- package/dist/http/api.js +66 -1
- package/dist/runtime/memory/sati/index.js +0 -1
- package/dist/runtime/memory/sati/repository.js +69 -62
- package/dist/runtime/memory/sati/service.js +2 -2
- package/dist/runtime/memory/sati/system-prompts.js +3 -1
- package/dist/ui/assets/index-BLLLlr0w.css +1 -0
- package/dist/ui/assets/index-Ccml5qIL.js +50 -0
- package/dist/ui/index.html +2 -2
- package/package.json +1 -1
- package/dist/ui/assets/index-Ddyo4FWH.js +0 -50
- package/dist/ui/assets/index-tz0YVye-.css +0 -1
package/README.md
CHANGED
|
@@ -1,282 +1,346 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<img src="./assets/logo.png" alt="Morpheus Logo" width="220" />
|
|
3
|
-
</div>
|
|
4
|
-
|
|
5
|
-
# Morpheus
|
|
6
|
-
|
|
7
|
-
> **Morpheus is a local-first AI operator that bridges developers and machines.**
|
|
8
|
-
|
|
9
|
-
Morpheus is a local AI agent for developers, running as a CLI daemon that connects to **LLMs**, **local tools**, and **MCPs**, enabling interaction via **Terminal, Telegram, and Discord**. Inspired by the character Morpheus from *The Matrix*, the project acts as an **intelligent orchestrator**, bridging the gap between the developer and complex systems.
|
|
10
|
-
|
|
11
|
-
## Installation
|
|
12
|
-
|
|
13
|
-
Install Morpheus globally via npm:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install -g morpheus-cli
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Quick Start
|
|
20
|
-
|
|
21
|
-
### 1. Initialize
|
|
22
|
-
|
|
23
|
-
Set up your configuration (API keys, preferences):
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
morpheus init
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### 2. Start the Agent
|
|
30
|
-
|
|
31
|
-
Run the background daemon and Web UI:
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
morpheus start
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
This will:
|
|
38
|
-
- Start the agent process
|
|
39
|
-
- Launch the Web UI at http://localhost:3333
|
|
40
|
-
|
|
41
|
-
### Other Commands
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
# Check if Morpheus is running
|
|
45
|
-
morpheus status
|
|
46
|
-
|
|
47
|
-
# Stop the agent
|
|
48
|
-
morpheus stop
|
|
49
|
-
|
|
50
|
-
# Diagnose issues
|
|
51
|
-
morpheus doctor
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Troubleshooting
|
|
55
|
-
|
|
56
|
-
### Command not found
|
|
57
|
-
|
|
58
|
-
If you installed successfully but can't run the `morpheus` command:
|
|
59
|
-
|
|
60
|
-
1. **Check your PATH**: Ensure your global npm bin directory is in your system PATH.
|
|
61
|
-
- Run `npm bin -g` to see the folder.
|
|
62
|
-
- On Windows, this is usually `%APPDATA%\npm`.
|
|
63
|
-
- On Linux/Mac, verify `echo $PATH`.
|
|
64
|
-
2. **Restart Terminal**: New installations might not be visible until you restart your shell.
|
|
65
|
-
|
|
66
|
-
## Using NPX
|
|
67
|
-
You can run Morpheus without installing it globally using `npx`:
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
|
|
71
|
-
npx morpheus-cli init
|
|
72
|
-
|
|
73
|
-
npx morpheus-cli start
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## Technical Overview
|
|
78
|
-
|
|
79
|
-
Morpheus is built with **Node.js** and **TypeScript**, using **LangChain** as the orchestration engine. It runs as a background daemon process, managing connections to LLM providers (OpenAI, Anthropic, Ollama) and external channels (Telegram, Discord).
|
|
80
|
-
|
|
81
|
-
### Core Components
|
|
82
|
-
|
|
83
|
-
- **Runtime (`src/runtime/`)**: The heart of the application. Manages the Oracle (agent) lifecycle, provider instantiation, and command execution.
|
|
84
|
-
- **CLI (`src/cli/`)**: Built with `commander`, handles user interaction, configuration, and daemon control (`start`, `stop`, `status`).
|
|
85
|
-
- **Configuration (`src/config/`)**: Singleton-based configuration manager using `zod` for validation and `js-yaml` for persistence (`~/.morpheus/zaion.yaml`).
|
|
86
|
-
- **Channels (`src/channels/`)**: Adapters for external communication. Currently supports Telegram (`telegraf`) with strict user whitelisting.
|
|
87
|
-
|
|
88
|
-
## Features
|
|
89
|
-
|
|
90
|
-
### 🖥️ Web Dashboard
|
|
91
|
-
Local React-based UI to manage recordings, chat history, and system status across your agent instances.
|
|
92
|
-
|
|
93
|
-
#### 🔒 UI Authentication
|
|
94
|
-
To protect your Web UI, use the `THE_ARCHITECT_PASS` environment variable. This ensures only authorized users can access the dashboard and API.
|
|
95
|
-
|
|
96
|
-
**Option 1: Using a `.env` file**
|
|
97
|
-
Create a `.env` file in the root of your project:
|
|
98
|
-
|
|
99
|
-
```env
|
|
100
|
-
THE_ARCHITECT_PASS="your-secure-password"
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
**Option 2: Using Shell export**
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
export THE_ARCHITECT_PASS="your-secure-password"
|
|
107
|
-
morpheus start
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
When enabled:
|
|
111
|
-
- The Web UI will redirect to a Login page.
|
|
112
|
-
- API requests require the `x-architect-pass` header.
|
|
113
|
-
- The session is persisted locally in your browser.
|
|
114
|
-
|
|
115
|
-
### 🧩 MCP Support (Model Context Protocol)
|
|
116
|
-
Full integration with [Model Context Protocol](https://modelcontextprotocol.io/), allowing Morpheus to use standardized tools from any MCP-compatible server.
|
|
117
|
-
|
|
118
|
-
### 🧠 Sati (Long-Term Memory)
|
|
119
|
-
Morpheus features a dedicated middleware system called **Sati** (Mindfulness) that provides long-term memory capabilities.
|
|
120
|
-
- **Automated Storage**: Automatically extracts and saves preferences, project details, and facts from conversations.
|
|
121
|
-
- **Contextual Retrieval**: Injects relevant memories into the context based on your current query.
|
|
122
|
-
- **Data Privacy**: Stored in a local, independent SQLite database (`santi-memory.db`), ensuring sensitive data is handled securely and reducing context window usage.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
- **
|
|
143
|
-
- **
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
"
|
|
223
|
-
"
|
|
224
|
-
"
|
|
225
|
-
|
|
226
|
-
"
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
"
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="./assets/logo.png" alt="Morpheus Logo" width="220" />
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
# Morpheus
|
|
6
|
+
|
|
7
|
+
> **Morpheus is a local-first AI operator that bridges developers and machines.**
|
|
8
|
+
|
|
9
|
+
Morpheus is a local AI agent for developers, running as a CLI daemon that connects to **LLMs**, **local tools**, and **MCPs**, enabling interaction via **Terminal, Telegram, and Discord**. Inspired by the character Morpheus from *The Matrix*, the project acts as an **intelligent orchestrator**, bridging the gap between the developer and complex systems.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
Install Morpheus globally via npm:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g morpheus-cli
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
### 1. Initialize
|
|
22
|
+
|
|
23
|
+
Set up your configuration (API keys, preferences):
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
morpheus init
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 2. Start the Agent
|
|
30
|
+
|
|
31
|
+
Run the background daemon and Web UI:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
morpheus start
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
This will:
|
|
38
|
+
- Start the agent process
|
|
39
|
+
- Launch the Web UI at http://localhost:3333
|
|
40
|
+
|
|
41
|
+
### Other Commands
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Check if Morpheus is running
|
|
45
|
+
morpheus status
|
|
46
|
+
|
|
47
|
+
# Stop the agent
|
|
48
|
+
morpheus stop
|
|
49
|
+
|
|
50
|
+
# Diagnose issues
|
|
51
|
+
morpheus doctor
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Troubleshooting
|
|
55
|
+
|
|
56
|
+
### Command not found
|
|
57
|
+
|
|
58
|
+
If you installed successfully but can't run the `morpheus` command:
|
|
59
|
+
|
|
60
|
+
1. **Check your PATH**: Ensure your global npm bin directory is in your system PATH.
|
|
61
|
+
- Run `npm bin -g` to see the folder.
|
|
62
|
+
- On Windows, this is usually `%APPDATA%\npm`.
|
|
63
|
+
- On Linux/Mac, verify `echo $PATH`.
|
|
64
|
+
2. **Restart Terminal**: New installations might not be visible until you restart your shell.
|
|
65
|
+
|
|
66
|
+
## Using NPX
|
|
67
|
+
You can run Morpheus without installing it globally using `npx`:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
|
|
71
|
+
npx morpheus-cli init
|
|
72
|
+
|
|
73
|
+
npx morpheus-cli start
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Technical Overview
|
|
78
|
+
|
|
79
|
+
Morpheus is built with **Node.js** and **TypeScript**, using **LangChain** as the orchestration engine. It runs as a background daemon process, managing connections to LLM providers (OpenAI, Anthropic, Ollama) and external channels (Telegram, Discord).
|
|
80
|
+
|
|
81
|
+
### Core Components
|
|
82
|
+
|
|
83
|
+
- **Runtime (`src/runtime/`)**: The heart of the application. Manages the Oracle (agent) lifecycle, provider instantiation, and command execution.
|
|
84
|
+
- **CLI (`src/cli/`)**: Built with `commander`, handles user interaction, configuration, and daemon control (`start`, `stop`, `status`).
|
|
85
|
+
- **Configuration (`src/config/`)**: Singleton-based configuration manager using `zod` for validation and `js-yaml` for persistence (`~/.morpheus/zaion.yaml`).
|
|
86
|
+
- **Channels (`src/channels/`)**: Adapters for external communication. Currently supports Telegram (`telegraf`) with strict user whitelisting.
|
|
87
|
+
|
|
88
|
+
## Features
|
|
89
|
+
|
|
90
|
+
### 🖥️ Web Dashboard
|
|
91
|
+
Local React-based UI to manage recordings, chat history, and system status across your agent instances.
|
|
92
|
+
|
|
93
|
+
#### 🔒 UI Authentication
|
|
94
|
+
To protect your Web UI, use the `THE_ARCHITECT_PASS` environment variable. This ensures only authorized users can access the dashboard and API.
|
|
95
|
+
|
|
96
|
+
**Option 1: Using a `.env` file**
|
|
97
|
+
Create a `.env` file in the root of your project:
|
|
98
|
+
|
|
99
|
+
```env
|
|
100
|
+
THE_ARCHITECT_PASS="your-secure-password"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Option 2: Using Shell export**
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
export THE_ARCHITECT_PASS="your-secure-password"
|
|
107
|
+
morpheus start
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
When enabled:
|
|
111
|
+
- The Web UI will redirect to a Login page.
|
|
112
|
+
- API requests require the `x-architect-pass` header.
|
|
113
|
+
- The session is persisted locally in your browser.
|
|
114
|
+
|
|
115
|
+
### 🧩 MCP Support (Model Context Protocol)
|
|
116
|
+
Full integration with [Model Context Protocol](https://modelcontextprotocol.io/), allowing Morpheus to use standardized tools from any MCP-compatible server.
|
|
117
|
+
|
|
118
|
+
### 🧠 Sati (Long-Term Memory)
|
|
119
|
+
Morpheus features a dedicated middleware system called **Sati** (Mindfulness) that provides long-term memory capabilities.
|
|
120
|
+
- **Automated Storage**: Automatically extracts and saves preferences, project details, and facts from conversations.
|
|
121
|
+
- **Contextual Retrieval**: Injects relevant memories into the context based on your current query.
|
|
122
|
+
- **Data Privacy**: Stored in a local, independent SQLite database (`santi-memory.db`), ensuring sensitive data is handled securely and reducing context window usage.
|
|
123
|
+
- **Memory Management**: View and manage your long-term memories through the Web UI or via API endpoints.
|
|
124
|
+
|
|
125
|
+
### 📊 Usage Analytics
|
|
126
|
+
Track your token usage across different providers and models directly from the Web UI. View detailed breakdowns of input/output tokens and message counts to monitor costs and activity.
|
|
127
|
+
|
|
128
|
+
### 🎙️ Audio Transcription (Telegram)
|
|
129
|
+
Send voice messages directly to the Telegram bot. Morpheus will:
|
|
130
|
+
1. Transcribe the audio using **Google Gemini**.
|
|
131
|
+
2. Process the text as a standard prompt.
|
|
132
|
+
3. Reply with the answer.
|
|
133
|
+
|
|
134
|
+
*Requires a Google Gemini API Key.*
|
|
135
|
+
|
|
136
|
+
## Development Setup
|
|
137
|
+
|
|
138
|
+
This guide is for developers contributing to the Morpheus codebase.
|
|
139
|
+
|
|
140
|
+
### Prerequisites
|
|
141
|
+
|
|
142
|
+
- **Node.js**: >= 18.x
|
|
143
|
+
- **npm**: >= 9.x
|
|
144
|
+
- **TypeScript**: >= 5.x
|
|
145
|
+
|
|
146
|
+
### 1. Clone & Install
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
git clone https://github.com/your-org/morpheus.git
|
|
150
|
+
cd morpheus
|
|
151
|
+
npm install
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### 2. Build
|
|
155
|
+
|
|
156
|
+
Compile TypeScript source to `dist/` and build the Web UI.
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
npm run build
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### 3. Run the CLI
|
|
163
|
+
|
|
164
|
+
You can run the CLI directly from the source using `npm start`.
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# Initialize configuration (creates ~/.morpheus)
|
|
168
|
+
npm start -- init
|
|
169
|
+
|
|
170
|
+
# Start the daemon
|
|
171
|
+
npm start -- start
|
|
172
|
+
|
|
173
|
+
# Check status
|
|
174
|
+
npm start -- status
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### 4. Configuration
|
|
178
|
+
|
|
179
|
+
The configuration file is located at `~/.morpheus/zaion.yaml`. You can edit it manually or use the `morpheus config` command.
|
|
180
|
+
|
|
181
|
+
```yaml
|
|
182
|
+
agent:
|
|
183
|
+
name: "Morpheus"
|
|
184
|
+
personality: "stoic, wise, and helpful"
|
|
185
|
+
llm:
|
|
186
|
+
provider: "openai" # options: openai, anthropic, ollama, gemini
|
|
187
|
+
model: "gpt-4-turbo"
|
|
188
|
+
temperature: 0.7
|
|
189
|
+
context_window: 100 # Number of messages to load into LLM context
|
|
190
|
+
api_key: "sk-..."
|
|
191
|
+
santi: # Optional: Sati (Long-Term Memory) specific settings
|
|
192
|
+
provider: "openai" # defaults to llm.provider
|
|
193
|
+
model: "gpt-4o"
|
|
194
|
+
memory_limit: 1000 # Number of messages/items to retrieve
|
|
195
|
+
channels:
|
|
196
|
+
telegram:
|
|
197
|
+
enabled: true
|
|
198
|
+
token: "YOUR_TELEGRAM_BOT_TOKEN"
|
|
199
|
+
allowedUsers: ["123456789"] # Your Telegram User ID
|
|
200
|
+
discord:
|
|
201
|
+
enabled: false # Coming soon
|
|
202
|
+
|
|
203
|
+
# Web UI Dashboard
|
|
204
|
+
ui:
|
|
205
|
+
enabled: true
|
|
206
|
+
port: 3333
|
|
207
|
+
|
|
208
|
+
# Audio Transcription Support
|
|
209
|
+
audio:
|
|
210
|
+
enabled: true
|
|
211
|
+
apiKey: "YOUR_GEMINI_API_KEY" # Optional if llm.provider is 'gemini'
|
|
212
|
+
maxDurationSeconds: 300
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### 5. MCP Configuration
|
|
216
|
+
|
|
217
|
+
Morpheus supports external tools via **MCP (Model Context Protocol)**. Configure your MCP servers in `~/.morpheus/mcps.json`:
|
|
218
|
+
|
|
219
|
+
```json
|
|
220
|
+
{
|
|
221
|
+
"coolify": {
|
|
222
|
+
"transport": "stdio",
|
|
223
|
+
"command": "npx",
|
|
224
|
+
"args": ["-y", "@coolify/mcp-server"],
|
|
225
|
+
"env": {
|
|
226
|
+
"COOLIFY_URL": "https://app.coolify.io",
|
|
227
|
+
"COOLIFY_TOKEN": "your-token"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"coingecko": {
|
|
231
|
+
"transport": "http",
|
|
232
|
+
"url": "https://mcps.mnunes.xyz/coingecko/mcp"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## API Endpoints
|
|
238
|
+
|
|
239
|
+
Morpheus exposes several API endpoints for programmatic access to its features:
|
|
240
|
+
|
|
241
|
+
### Sati Memories Endpoints
|
|
242
|
+
|
|
243
|
+
#### GET `/api/sati/memories`
|
|
244
|
+
Retrieve all memories stored by the Sati agent (long-term memory).
|
|
245
|
+
|
|
246
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
247
|
+
* **Response:**
|
|
248
|
+
```json
|
|
249
|
+
[
|
|
250
|
+
{
|
|
251
|
+
"id": "unique-id",
|
|
252
|
+
"category": "work",
|
|
253
|
+
"importance": "high",
|
|
254
|
+
"summary": "Memory summary",
|
|
255
|
+
"details": "Additional details of the memory",
|
|
256
|
+
"hash": "unique-hash",
|
|
257
|
+
"source": "source",
|
|
258
|
+
"created_at": "2023-01-01T00:00:00.000Z",
|
|
259
|
+
"updated_at": "2023-01-01T00:00:00.000Z",
|
|
260
|
+
"last_accessed_at": "2023-01-01T00:00:00.000Z",
|
|
261
|
+
"access_count": 5,
|
|
262
|
+
"version": 1,
|
|
263
|
+
"archived": false
|
|
264
|
+
}
|
|
265
|
+
]
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
#### DELETE `/api/sati/memories/:id`
|
|
269
|
+
Archive (soft delete) a specific memory from the Sati agent.
|
|
270
|
+
|
|
271
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
272
|
+
* **Parameters:** `id` - ID of the memory to archive.
|
|
273
|
+
* **Response:**
|
|
274
|
+
```json
|
|
275
|
+
{
|
|
276
|
+
"success": true,
|
|
277
|
+
"message": "Memory archived successfully"
|
|
278
|
+
}
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
#### POST `/api/sati/memories/bulk-delete`
|
|
282
|
+
Archive (soft delete) multiple memories from the Sati agent at once.
|
|
283
|
+
|
|
284
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
285
|
+
* **Body:**
|
|
286
|
+
```json
|
|
287
|
+
{
|
|
288
|
+
"ids": ["id1", "id2", "id3"]
|
|
289
|
+
}
|
|
290
|
+
```
|
|
291
|
+
* **Response:**
|
|
292
|
+
```json
|
|
293
|
+
{
|
|
294
|
+
"success": true,
|
|
295
|
+
"message": "X memories archived successfully",
|
|
296
|
+
"deletedCount": X
|
|
297
|
+
}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
## Testing
|
|
301
|
+
|
|
302
|
+
We use **Vitest** for testing.
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
# Run unit tests
|
|
306
|
+
npm test
|
|
307
|
+
|
|
308
|
+
# Run tests in watch mode
|
|
309
|
+
npm run test:watch
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
## Project Structure
|
|
313
|
+
|
|
314
|
+
```text
|
|
315
|
+
.
|
|
316
|
+
├── assets/ # Static assets
|
|
317
|
+
├── bin/ # CLI entry point (morpheus.js)
|
|
318
|
+
├── specs/ # Technical specifications & documentation
|
|
319
|
+
├── src/
|
|
320
|
+
│ ├── channels/ # Communication adapters (Telegram, etc.)
|
|
321
|
+
│ ├── cli/ # CLI commands and logic
|
|
322
|
+
│ ├── config/ # Configuration management
|
|
323
|
+
│ ├── runtime/ # Core agent logic, lifecycle, and providers
|
|
324
|
+
│ ├── types/ # Shared TypeScript definitions
|
|
325
|
+
│ └── ui/ # React Web UI Dashboard
|
|
326
|
+
└── package.json
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
## Roadmap
|
|
330
|
+
|
|
331
|
+
- [x] **Web Dashboard**: Local UI for management and logs.
|
|
332
|
+
- [x] **MCP Support**: Full integration with Model Context Protocol.
|
|
333
|
+
- [ ] **Discord Adapter**: Support for Discord interactions.
|
|
334
|
+
- [ ] **Plugin System**: Extend functionality via external modules.
|
|
335
|
+
|
|
336
|
+
## Contributing
|
|
337
|
+
|
|
338
|
+
1. Fork the repository.
|
|
339
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`).
|
|
340
|
+
3. Commit your changes (`git commit -m 'feat: Add amazing feature'`).
|
|
341
|
+
4. Push to the branch (`git push origin feature/amazing-feature`).
|
|
342
|
+
5. Open a Pull Request.
|
|
343
|
+
|
|
344
|
+
## License
|
|
345
|
+
|
|
346
|
+
MIT
|