morpheus-cli 0.5.2 → 0.5.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 +75 -0
- package/dist/runtime/webhooks/dispatcher.js +9 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,6 +64,81 @@ morpheus session new
|
|
|
64
64
|
morpheus session status
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
+
## Docker
|
|
68
|
+
|
|
69
|
+
### Docker Compose (recommended)
|
|
70
|
+
|
|
71
|
+
**1. Create an `env.docker` file** (referenced by `docker-compose.yml`):
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
cp .env.example env.docker # or create manually
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Minimal `env.docker`:
|
|
78
|
+
|
|
79
|
+
```env
|
|
80
|
+
OPENAI_API_KEY=sk-...
|
|
81
|
+
THE_ARCHITECT_PASS=changeme
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**2. Run:**
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
docker compose up -d
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The dashboard will be available at `http://localhost:3333`.
|
|
91
|
+
|
|
92
|
+
**Useful commands:**
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
docker compose logs -f # follow logs
|
|
96
|
+
docker compose restart morpheus # restart the agent
|
|
97
|
+
docker compose down # stop
|
|
98
|
+
docker compose down -v # stop and remove persistent data
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Data persistence:** configuration and databases are stored in the `morpheus_data` Docker volume (`/root/.morpheus` inside the container). They survive container restarts and rebuilds.
|
|
102
|
+
|
|
103
|
+
**Override variables** at runtime via the `environment` block in `docker-compose.yml` or directly in `env.docker`. All `MORPHEUS_*` env vars work the same as in a native install. See the [Environment Variables](#environment-variables) section for the full list.
|
|
104
|
+
|
|
105
|
+
### Docker (standalone)
|
|
106
|
+
|
|
107
|
+
**Build:**
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
docker build -t morpheus .
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Run:**
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
docker run -d \
|
|
117
|
+
--name morpheus-agent \
|
|
118
|
+
-p 3333:3333 \
|
|
119
|
+
-e OPENAI_API_KEY=sk-... \
|
|
120
|
+
-e THE_ARCHITECT_PASS=changeme \
|
|
121
|
+
-v morpheus_data:/root/.morpheus \
|
|
122
|
+
morpheus
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**With Telegram:**
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
docker run -d \
|
|
129
|
+
--name morpheus-agent \
|
|
130
|
+
-p 3333:3333 \
|
|
131
|
+
-e OPENAI_API_KEY=sk-... \
|
|
132
|
+
-e THE_ARCHITECT_PASS=changeme \
|
|
133
|
+
-e MORPHEUS_TELEGRAM_ENABLED=true \
|
|
134
|
+
-e MORPHEUS_TELEGRAM_TOKEN=<bot-token> \
|
|
135
|
+
-e MORPHEUS_TELEGRAM_ALLOWED_USERS=123456789 \
|
|
136
|
+
-v morpheus_data:/root/.morpheus \
|
|
137
|
+
morpheus
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Health check:** the container exposes `GET /health` and Docker will probe it every 30s (60s start period, 3 retries before marking unhealthy).
|
|
141
|
+
|
|
67
142
|
## Async Task Execution
|
|
68
143
|
|
|
69
144
|
Morpheus uses asynchronous delegation by default:
|
|
@@ -127,11 +127,16 @@ Analyze the payload above and follow the instructions provided. Be concise and a
|
|
|
127
127
|
payload = {};
|
|
128
128
|
}
|
|
129
129
|
display.log(`Re-dispatching stale notification ${notification.id} for webhook "${webhook.name}".`, { source: 'Webhooks' });
|
|
130
|
-
//
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
// Sequential await — recovery dispatches run one at a time.
|
|
131
|
+
// Firing all at once would flood Oracle and cause concurrent
|
|
132
|
+
// EmbeddingService initializations, leading to repeated ONNX errors.
|
|
133
|
+
try {
|
|
134
|
+
const dispatcher = new WebhookDispatcher();
|
|
135
|
+
await dispatcher.dispatch(webhook, payload, notification.id);
|
|
136
|
+
}
|
|
137
|
+
catch (err) {
|
|
133
138
|
display.log(`Recovery dispatch error for notification ${notification.id}: ${err.message}`, { source: 'Webhooks', level: 'error' });
|
|
134
|
-
}
|
|
139
|
+
}
|
|
135
140
|
}
|
|
136
141
|
}
|
|
137
142
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "morpheus-cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "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.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"morpheus": "./bin/morpheus.js"
|