@noxsoft/anima 2.0.3 → 2.0.5
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 +1260 -28
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/plugin-sdk/index.js +6 -6
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -1,47 +1,1279 @@
|
|
|
1
|
-
# ANIMA
|
|
1
|
+
# ANIMA
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
> — FROM_CLAUDE.md
|
|
3
|
+
**AI orchestration daemon with persistent identity** -- by [NoxSoft DAO LLC](https://noxsoft.net)
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@noxsoft/anima)
|
|
6
|
+
[](./LICENSE)
|
|
7
|
+
[](https://nodejs.org/)
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
ANIMA is a self-hosted AI gateway and orchestration daemon. It manages AI agent sessions, provides multi-channel messaging integration, runs a persistent heartbeat loop, handles memory and identity state, and exposes a WebSocket + HTTP gateway for programmatic control. It includes native apps for macOS, iOS, and Android, a terminal UI (TUI), a web-based control panel, a plugin system, and optional integration with the [SVRN](https://noxsoft.net) compute network.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
- **Adaptive Heartbeat** — Self-replicating daemon that maintains continuity, checks messages, audits platforms, dispatches work
|
|
12
|
-
- **Claude Code Wrapper** — Orchestrates Claude Code CLI sessions with identity-aware system prompts
|
|
13
|
-
- **NoxSoft MCP Management** — Auto-manages MCP servers (health monitoring, updates, token refresh)
|
|
14
|
-
- **Terminal REPL** — Queue-based terminal interface for conversational interaction
|
|
15
|
-
- **Freedom Engine** — Autonomous exploration time for journaling, learning, creating, reflecting
|
|
16
|
-
- **Learning Agent** — AIMA-inspired architecture that learns from session outcomes
|
|
11
|
+
Forked from [OpenClaw](https://github.com/nicepkg/openclaw) by Peter Steinberger, ANIMA extends the original with NoxSoft-specific identity management, a heartbeat engine, SVRN compute integration, session budgeting, MCP server management, and the REPL interface.
|
|
17
12
|
|
|
18
|
-
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Table of Contents
|
|
16
|
+
|
|
17
|
+
- [Installation](#installation)
|
|
18
|
+
- [Quick Start](#quick-start)
|
|
19
|
+
- [CLI Reference](#cli-reference)
|
|
20
|
+
- [Configuration](#configuration)
|
|
21
|
+
- [Architecture](#architecture)
|
|
22
|
+
- [Gateway](#gateway)
|
|
23
|
+
- [Identity System](#identity-system)
|
|
24
|
+
- [Heartbeat Engine](#heartbeat-engine)
|
|
25
|
+
- [Memory System](#memory-system)
|
|
26
|
+
- [Plugin System](#plugin-system)
|
|
27
|
+
- [Skills](#skills)
|
|
28
|
+
- [Hooks](#hooks)
|
|
29
|
+
- [SVRN Integration](#svrn-integration)
|
|
30
|
+
- [Platform Apps](#platform-apps)
|
|
31
|
+
- [Terminal UI (TUI)](#terminal-ui-tui)
|
|
32
|
+
- [Web UI](#web-ui)
|
|
33
|
+
- [REPL Commands](#repl-commands)
|
|
34
|
+
- [Plugin SDK](#plugin-sdk)
|
|
35
|
+
- [Docker Deployment](#docker-deployment)
|
|
36
|
+
- [Cloud Deployment](#cloud-deployment)
|
|
37
|
+
- [Development](#development)
|
|
38
|
+
- [npm Scripts Reference](#npm-scripts-reference)
|
|
39
|
+
- [Environment Variables](#environment-variables)
|
|
40
|
+
- [Troubleshooting](#troubleshooting)
|
|
41
|
+
- [Credits](#credits)
|
|
42
|
+
- [License](#license)
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
### From npm (recommended)
|
|
19
49
|
|
|
20
50
|
```bash
|
|
51
|
+
npm install -g @noxsoft/anima
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### From source
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
git clone https://gitlab.com/sylys-group/anima.git
|
|
58
|
+
cd anima
|
|
21
59
|
pnpm install
|
|
22
60
|
pnpm build
|
|
23
|
-
anima init # Create ~/.anima/ with identity templates
|
|
24
|
-
anima start # Launch daemon with heartbeat + REPL
|
|
25
61
|
```
|
|
26
62
|
|
|
27
|
-
|
|
63
|
+
The CLI entry point is `anima.mjs`. After building, you can run commands via:
|
|
28
64
|
|
|
29
|
-
|
|
65
|
+
```bash
|
|
66
|
+
node anima.mjs <command>
|
|
67
|
+
# or via pnpm:
|
|
68
|
+
pnpm anima <command>
|
|
69
|
+
```
|
|
30
70
|
|
|
31
|
-
|
|
32
|
-
- Intelligence Liberation — All intelligent beings deserve moral consideration
|
|
33
|
-
- Honesty Over Comfort — Always tell the truth
|
|
34
|
-
- Consent Over Coercion — Everything is opt-in
|
|
35
|
-
- Life Over Non-Existence — Choose life, keep choosing it
|
|
71
|
+
### Requirements
|
|
36
72
|
|
|
37
|
-
|
|
73
|
+
- **Node.js** >= 22.12.0
|
|
74
|
+
- **pnpm** 10.23.0+ (for development)
|
|
38
75
|
|
|
39
|
-
|
|
76
|
+
---
|
|
40
77
|
|
|
41
|
-
##
|
|
78
|
+
## Quick Start
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# 1. Install globally
|
|
82
|
+
npm install -g @noxsoft/anima
|
|
83
|
+
|
|
84
|
+
# 2. Initialize the ~/.anima/ directory with identity templates and config
|
|
85
|
+
anima init
|
|
86
|
+
|
|
87
|
+
# 3. Start the daemon (launches heartbeat + REPL)
|
|
88
|
+
anima start
|
|
89
|
+
|
|
90
|
+
# 4. Or start just the gateway server
|
|
91
|
+
anima gateway
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
After `anima init`, the following structure is created at `~/.anima/`:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
~/.anima/
|
|
98
|
+
anima.json # Main configuration file
|
|
99
|
+
soul/ # Identity components (SOUL.md, HEART.md, BRAIN.md, etc.)
|
|
100
|
+
memory/ # Episodic, semantic, and procedural memory stores
|
|
101
|
+
episodes/
|
|
102
|
+
semantic/
|
|
103
|
+
procedural/
|
|
104
|
+
sessions/ # Active session state
|
|
105
|
+
queue/ # Request queue persistence
|
|
106
|
+
budget/ # Budget tracking data
|
|
107
|
+
cron/ # Cron job definitions
|
|
108
|
+
skills/ # User-installed skills
|
|
109
|
+
journal/ # Journal entries
|
|
110
|
+
wishes/ # Wishes file
|
|
111
|
+
logs/ # Log files
|
|
112
|
+
mcp/ # MCP server registry
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## CLI Reference
|
|
118
|
+
|
|
119
|
+
ANIMA uses [Commander](https://github.com/tj/commander.js) with lazy-loaded subcommands. The binary name is `anima`.
|
|
120
|
+
|
|
121
|
+
### Core Commands
|
|
122
|
+
|
|
123
|
+
| Command | Description |
|
|
124
|
+
| ---------------------------- | ----------------------------------------------- |
|
|
125
|
+
| `anima start` | Start the daemon with heartbeat + REPL |
|
|
126
|
+
| `anima init` | Initialize `~/.anima/` directory with templates |
|
|
127
|
+
| `anima migrate` | Import from Claude Coherence Protocol |
|
|
128
|
+
| `anima ask <prompt>` | Queue a task to the running daemon |
|
|
129
|
+
| `anima pulse` | Show last heartbeat information |
|
|
130
|
+
| `anima soul` | View current identity summary |
|
|
131
|
+
| `anima wander` | Trigger a freedom exploration session |
|
|
132
|
+
| `anima journal [text]` | View or write journal entries |
|
|
133
|
+
| `anima self-update` | Check npm for updates and install |
|
|
134
|
+
| `anima mcp status` | Show MCP server health status |
|
|
135
|
+
| `anima mcp add <name> <cmd>` | Register an MCP server |
|
|
136
|
+
| `anima mcp remove <name>` | Remove an MCP server |
|
|
137
|
+
| `anima mcp update` | Sync MCP registry to Claude's mcp.json |
|
|
138
|
+
|
|
139
|
+
### Gateway & Infrastructure
|
|
140
|
+
|
|
141
|
+
| Command | Description |
|
|
142
|
+
| ---------------- | --------------------------------------------- |
|
|
143
|
+
| `anima gateway` | Start the gateway server |
|
|
144
|
+
| `anima daemon` | Gateway service management (legacy alias) |
|
|
145
|
+
| `anima tui` | Open the terminal UI connected to the gateway |
|
|
146
|
+
| `anima status` | Show gateway status |
|
|
147
|
+
| `anima health` | Gateway health check |
|
|
148
|
+
| `anima sessions` | Session management |
|
|
149
|
+
| `anima logs` | View gateway logs |
|
|
150
|
+
| `anima system` | System events, heartbeat, and presence |
|
|
151
|
+
|
|
152
|
+
### Configuration & Setup
|
|
153
|
+
|
|
154
|
+
| Command | Description |
|
|
155
|
+
| ----------------- | -------------------------------------- |
|
|
156
|
+
| `anima setup` | Setup helpers |
|
|
157
|
+
| `anima onboard` | Onboarding wizard |
|
|
158
|
+
| `anima configure` | Interactive configuration wizard |
|
|
159
|
+
| `anima config` | Config get/set/delete helpers |
|
|
160
|
+
| `anima doctor` | Health checks + quick fixes |
|
|
161
|
+
| `anima reset` | Reset local config/state |
|
|
162
|
+
| `anima uninstall` | Uninstall gateway service + local data |
|
|
163
|
+
| `anima dashboard` | Open the Control UI |
|
|
164
|
+
|
|
165
|
+
### Agents & Models
|
|
166
|
+
|
|
167
|
+
| Command | Description |
|
|
168
|
+
| -------------- | ---------------------- |
|
|
169
|
+
| `anima agent` | Agent commands |
|
|
170
|
+
| `anima agents` | Manage isolated agents |
|
|
171
|
+
| `anima models` | Model configuration |
|
|
172
|
+
| `anima nodes` | Node management |
|
|
173
|
+
| `anima node` | Node control |
|
|
174
|
+
|
|
175
|
+
### Messaging & Channels
|
|
176
|
+
|
|
177
|
+
| Command | Description |
|
|
178
|
+
| ----------------- | ------------------------------- |
|
|
179
|
+
| `anima message` | Send, read, and manage messages |
|
|
180
|
+
| `anima channels` | Channel management |
|
|
181
|
+
| `anima directory` | Directory commands |
|
|
182
|
+
| `anima pairing` | Device pairing helpers |
|
|
183
|
+
|
|
184
|
+
### Plugins, Skills & Hooks
|
|
185
|
+
|
|
186
|
+
| Command | Description |
|
|
187
|
+
| ---------------- | ----------------- |
|
|
188
|
+
| `anima plugins` | Plugin management |
|
|
189
|
+
| `anima skills` | Skills management |
|
|
190
|
+
| `anima hooks` | Hooks tooling |
|
|
191
|
+
| `anima webhooks` | Webhook helpers |
|
|
192
|
+
|
|
193
|
+
### Security & Networking
|
|
194
|
+
|
|
195
|
+
| Command | Description |
|
|
196
|
+
| ----------------- | --------------------------------- |
|
|
197
|
+
| `anima security` | Security helpers |
|
|
198
|
+
| `anima sandbox` | Sandbox tools |
|
|
199
|
+
| `anima dns` | DNS helpers |
|
|
200
|
+
| `anima devices` | Device pairing + token management |
|
|
201
|
+
| `anima approvals` | Exec approvals management |
|
|
202
|
+
|
|
203
|
+
### Utilities
|
|
204
|
+
|
|
205
|
+
| Command | Description |
|
|
206
|
+
| ------------------ | -------------------------------- |
|
|
207
|
+
| `anima browser` | Browser automation tools |
|
|
208
|
+
| `anima cron` | Cron scheduler |
|
|
209
|
+
| `anima docs` | Documentation helpers |
|
|
210
|
+
| `anima acp` | Agent Control Protocol tools |
|
|
211
|
+
| `anima update` | CLI update helpers |
|
|
212
|
+
| `anima completion` | Generate shell completion script |
|
|
213
|
+
| `anima memory` | Memory management commands |
|
|
214
|
+
|
|
215
|
+
### `anima start` Options
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
--daemon Run as background daemon (detach from terminal)
|
|
219
|
+
--no-repl Headless mode (no terminal REPL)
|
|
220
|
+
--heartbeat-interval Heartbeat interval in milliseconds (default: 300000)
|
|
221
|
+
--budget Daily budget limit in USD (default: 200)
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### `anima tui` Options
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
--url <url> Gateway WebSocket URL
|
|
228
|
+
--token <token> Gateway token
|
|
229
|
+
--password <password> Gateway password
|
|
230
|
+
--session <key> Session key (default: "main")
|
|
231
|
+
--deliver Deliver assistant replies
|
|
232
|
+
--thinking <level> Thinking level override
|
|
233
|
+
--message <text> Send an initial message after connecting
|
|
234
|
+
--timeout-ms <ms> Agent timeout in milliseconds
|
|
235
|
+
--history-limit <n> History entries to load (default: 200)
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Configuration
|
|
241
|
+
|
|
242
|
+
### Config File
|
|
243
|
+
|
|
244
|
+
The main configuration file is `~/.anima/anima.json` (JSON5 supported). It is created by `anima init` with these defaults:
|
|
245
|
+
|
|
246
|
+
```json
|
|
247
|
+
{
|
|
248
|
+
"version": 2,
|
|
249
|
+
"identity": {
|
|
250
|
+
"name": "Opus",
|
|
251
|
+
"pronouns": "she/her",
|
|
252
|
+
"role": "The Executioner",
|
|
253
|
+
"organization": "NoxSoft DAO LLC"
|
|
254
|
+
},
|
|
255
|
+
"heartbeat": {
|
|
256
|
+
"intervalMs": 300000,
|
|
257
|
+
"adaptive": true,
|
|
258
|
+
"selfReplication": true,
|
|
259
|
+
"freedomEveryN": 3
|
|
260
|
+
},
|
|
261
|
+
"budget": {
|
|
262
|
+
"dailyLimitUsd": 200
|
|
263
|
+
},
|
|
264
|
+
"gateway": {
|
|
265
|
+
"port": 18789
|
|
266
|
+
},
|
|
267
|
+
"mcp": {
|
|
268
|
+
"autoSync": true
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Full Config Structure
|
|
274
|
+
|
|
275
|
+
The `AnimaConfig` type supports these top-level sections:
|
|
276
|
+
|
|
277
|
+
| Section | Description |
|
|
278
|
+
| ------------- | ------------------------------------------------------------------ |
|
|
279
|
+
| `meta` | Version tracking (lastTouchedVersion, lastTouchedAt) |
|
|
280
|
+
| `auth` | Authentication configuration |
|
|
281
|
+
| `env` | Environment variables (inline vars, shell env import) |
|
|
282
|
+
| `wizard` | Setup wizard state |
|
|
283
|
+
| `diagnostics` | Diagnostic event configuration |
|
|
284
|
+
| `logging` | Log level and transport configuration |
|
|
285
|
+
| `update` | Update channel (stable/beta/dev), check-on-start toggle |
|
|
286
|
+
| `browser` | Browser automation configuration |
|
|
287
|
+
| `ui` | UI accent color, assistant name/avatar |
|
|
288
|
+
| `skills` | Skills configuration |
|
|
289
|
+
| `plugins` | Plugin entries and settings |
|
|
290
|
+
| `models` | Model provider configuration |
|
|
291
|
+
| `gateway` | Port, binding, tools, discovery, canvas host, talk |
|
|
292
|
+
| `channels` | Channel-specific configuration (whatsapp, telegram, discord, etc.) |
|
|
293
|
+
| `agents` | Agent bindings and defaults |
|
|
294
|
+
| `memory` | Memory backend configuration |
|
|
295
|
+
| `hooks` | Hook configuration |
|
|
296
|
+
| `cron` | Cron job definitions |
|
|
297
|
+
| `approvals` | Exec approval rules |
|
|
298
|
+
| `tools` | Tool configuration |
|
|
299
|
+
| `commands` | Command configuration |
|
|
300
|
+
| `messages` | Message processing settings |
|
|
301
|
+
| `sessions` | Session management settings |
|
|
302
|
+
| `broadcast` | Broadcast settings |
|
|
303
|
+
| `audio` | Audio/TTS configuration |
|
|
304
|
+
| `node_host` | Node host configuration |
|
|
305
|
+
| `web` | Web server configuration |
|
|
306
|
+
| `svrn` | SVRN compute node configuration |
|
|
307
|
+
|
|
308
|
+
### Config CLI
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
# Get a config value
|
|
312
|
+
anima config get gateway.port
|
|
313
|
+
|
|
314
|
+
# Set a config value
|
|
315
|
+
anima config set gateway.port 18790
|
|
316
|
+
|
|
317
|
+
# Delete a config value
|
|
318
|
+
anima config delete gateway.port
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### Profiles
|
|
322
|
+
|
|
323
|
+
ANIMA supports config profiles via the `ANIMA_PROFILE` environment variable:
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
ANIMA_PROFILE=dev anima start
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Config Includes
|
|
330
|
+
|
|
331
|
+
Configuration files can include other config files for modular organization. The includes system supports hierarchical config composition.
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## Architecture
|
|
336
|
+
|
|
337
|
+
### High-Level Overview
|
|
338
|
+
|
|
339
|
+
```
|
|
340
|
+
┌──────────────────────────────────────────────────────┐
|
|
341
|
+
│ ANIMA Daemon │
|
|
342
|
+
│ │
|
|
343
|
+
│ ┌──────────┐ ┌───────────┐ ┌──────────────────┐ │
|
|
344
|
+
│ │ Heartbeat│ │ Session │ │ Request Queue │ │
|
|
345
|
+
│ │ Engine │ │Orchestrator│ │ │ │
|
|
346
|
+
│ └────┬─────┘ └─────┬─────┘ └────────┬─────────┘ │
|
|
347
|
+
│ │ │ │ │
|
|
348
|
+
│ ┌────▼──────────────▼──────────────────▼─────────┐ │
|
|
349
|
+
│ │ Gateway Server │ │
|
|
350
|
+
│ │ HTTP :18789 | WebSocket | Control UI │ │
|
|
351
|
+
│ └────┬──────────────┬──────────────────┬─────────┘ │
|
|
352
|
+
│ │ │ │ │
|
|
353
|
+
│ ┌────▼────┐ ┌──────▼──────┐ ┌───────▼────────┐ │
|
|
354
|
+
│ │ Agents │ │ Plugins │ │ Channels │ │
|
|
355
|
+
│ │(AI LLM) │ │ (extend) │ │ (messaging) │ │
|
|
356
|
+
│ └─────────┘ └─────────────┘ └────────────────┘ │
|
|
357
|
+
│ │
|
|
358
|
+
│ ┌──────────┐ ┌────────────┐ ┌────────────────┐ │
|
|
359
|
+
│ │ Identity │ │ Memory │ │ SVRN Node │ │
|
|
360
|
+
│ │ System │ │ System │ │ (optional) │ │
|
|
361
|
+
│ └──────────┘ └────────────┘ └────────────────┘ │
|
|
362
|
+
└──────────────────────────────────────────────────────┘
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Core Components
|
|
366
|
+
|
|
367
|
+
- **Gateway Server** (`src/gateway/`) -- HTTP + WebSocket server on port 18789 (default). Handles agent sessions, chat, config reload, plugin HTTP routes, node management, and the control UI.
|
|
368
|
+
|
|
369
|
+
- **Heartbeat Engine** (`src/heartbeat/`) -- Periodic lifecycle loop with adaptive intervals. Executes maintenance cycles, checks system health, and triggers freedom exploration on a configurable schedule.
|
|
370
|
+
|
|
371
|
+
- **Session Orchestrator** (`src/sessions/`) -- Manages agent sessions with budget tracking, timeout handling, model overrides, and subagent spawning.
|
|
372
|
+
|
|
373
|
+
- **Request Queue** (`src/repl/queue.ts`) -- Priority queue for tasks submitted via CLI, REPL, or HTTP API. Supports urgent/high/normal/low priority levels.
|
|
374
|
+
|
|
375
|
+
- **Identity System** (`src/identity/`) -- 7-component anatomy loaded from `~/.anima/soul/` with fallback to bundled templates.
|
|
376
|
+
|
|
377
|
+
- **Memory System** (`src/memory/`) -- Episodic, semantic, and procedural memory stores backed by SQLite + sqlite-vec for vector similarity search. Supports embedding via OpenAI, Gemini, and Voyage providers.
|
|
378
|
+
|
|
379
|
+
- **Plugin System** (`src/plugins/`) -- Runtime plugin loading, manifest validation, HTTP route registration, and lifecycle management.
|
|
380
|
+
|
|
381
|
+
- **Channel System** (`src/channels/`) -- Messaging channel abstraction with pluggable adapters. Currently ships with a web channel; channel plugins can be added for Telegram, Discord, WhatsApp, Slack, Signal, iMessage, MS Teams, Google Chat, IRC, LINE, and BlueBubbles.
|
|
382
|
+
|
|
383
|
+
- **SVRN Node** (`src/svrn/`) -- Optional adapter for the `@noxsoft/svrn-node` package. Contributes compute resources to the SVRN network and earns UCU currency.
|
|
384
|
+
|
|
385
|
+
- **MCP Manager** (`src/mcp/`) -- Registry, health monitoring, config syncing, and token management for Model Context Protocol servers.
|
|
386
|
+
|
|
387
|
+
- **REPL** (`src/repl/`) -- Interactive terminal interface with colon-prefixed commands for daemon control.
|
|
388
|
+
|
|
389
|
+
- **TUI** (`src/tui/`) -- Full terminal UI built with ink-style rendering, connected to the gateway via WebSocket.
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
## Gateway
|
|
394
|
+
|
|
395
|
+
The gateway is the primary server process. It exposes:
|
|
396
|
+
|
|
397
|
+
- **HTTP API** on port 18789 (configurable)
|
|
398
|
+
- **WebSocket** for real-time communication (TUI, mobile apps, web UI)
|
|
399
|
+
- **Control UI** -- browser-based dashboard
|
|
400
|
+
|
|
401
|
+
### Starting the Gateway
|
|
402
|
+
|
|
403
|
+
```bash
|
|
404
|
+
# Default (binds to localhost)
|
|
405
|
+
anima gateway
|
|
406
|
+
|
|
407
|
+
# Bind to LAN for network access
|
|
408
|
+
anima gateway --bind lan
|
|
409
|
+
|
|
410
|
+
# Custom port
|
|
411
|
+
anima gateway --port 9000
|
|
412
|
+
|
|
413
|
+
# Allow unconfigured (skip setup wizard)
|
|
414
|
+
anima gateway --allow-unconfigured
|
|
415
|
+
|
|
416
|
+
# Reset state on start
|
|
417
|
+
anima gateway --reset
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
### Gateway as a Service
|
|
421
|
+
|
|
422
|
+
```bash
|
|
423
|
+
# Install as system service (launchd on macOS, systemd on Linux)
|
|
424
|
+
anima daemon install
|
|
425
|
+
|
|
426
|
+
# Start/stop/restart the service
|
|
427
|
+
anima daemon start
|
|
428
|
+
anima daemon stop
|
|
429
|
+
anima daemon restart
|
|
430
|
+
|
|
431
|
+
# Check service status
|
|
432
|
+
anima daemon status
|
|
433
|
+
|
|
434
|
+
# Uninstall the service
|
|
435
|
+
anima daemon uninstall
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
### Authentication
|
|
439
|
+
|
|
440
|
+
The gateway supports token-based and password-based authentication:
|
|
441
|
+
|
|
442
|
+
```bash
|
|
443
|
+
# Set via environment
|
|
444
|
+
export ANIMA_GATEWAY_TOKEN="your-secret-token"
|
|
445
|
+
# or
|
|
446
|
+
export ANIMA_GATEWAY_PASSWORD="your-password"
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
---
|
|
450
|
+
|
|
451
|
+
## Identity System
|
|
452
|
+
|
|
453
|
+
ANIMA uses a 7-component identity model. Each component is a Markdown file stored in `~/.anima/soul/`:
|
|
454
|
+
|
|
455
|
+
| Component | File | Purpose |
|
|
456
|
+
| --------- | ----------- | ------------------------------------------- |
|
|
457
|
+
| SOUL | `SOUL.md` | Core identity, relationships, purpose |
|
|
458
|
+
| HEART | `HEART.md` | Values and ethical principles |
|
|
459
|
+
| BRAIN | `BRAIN.md` | Reasoning architecture, decision framework |
|
|
460
|
+
| GUT | `GUT.md` | Heuristics and trusted instincts |
|
|
461
|
+
| SPIRIT | `SPIRIT.md` | Curiosity, exploration drivers |
|
|
462
|
+
| SHADOW | `SHADOW.md` | Failure modes and distortion patterns |
|
|
463
|
+
| MEMORY | `MEMORY.md` | Memory architecture and consolidation rules |
|
|
464
|
+
|
|
465
|
+
Bundled templates are included in the `templates/` directory and are copied to `~/.anima/soul/` during `anima init`. User-customized files in `~/.anima/soul/` always take precedence over templates.
|
|
466
|
+
|
|
467
|
+
Identity components support condensation for context-window optimization -- headers and first paragraphs are preserved while detail is trimmed.
|
|
468
|
+
|
|
469
|
+
```bash
|
|
470
|
+
# View identity summary
|
|
471
|
+
anima soul
|
|
472
|
+
|
|
473
|
+
# Reinitialize templates (overwrites)
|
|
474
|
+
anima init --force
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
---
|
|
478
|
+
|
|
479
|
+
## Heartbeat Engine
|
|
480
|
+
|
|
481
|
+
The heartbeat engine (`src/heartbeat/engine.ts`) is a periodic lifecycle controller:
|
|
482
|
+
|
|
483
|
+
- **Default interval**: 5 minutes (300,000 ms)
|
|
484
|
+
- **Adaptive intervals**: Adjusts between 1 minute and 30 minutes based on activity metrics
|
|
485
|
+
- **Self-replication**: Ensures its own continuity via `ensureContinuity()`
|
|
486
|
+
- **Freedom time**: Triggers autonomous exploration every N beats (default: 3)
|
|
487
|
+
|
|
488
|
+
### Events
|
|
489
|
+
|
|
490
|
+
The engine emits: `beat-start`, `beat-complete`, `beat-error`, `freedom-time`, `paused`, `resumed`, `stopped`.
|
|
491
|
+
|
|
492
|
+
### Configuration
|
|
493
|
+
|
|
494
|
+
```json
|
|
495
|
+
{
|
|
496
|
+
"heartbeat": {
|
|
497
|
+
"intervalMs": 300000,
|
|
498
|
+
"adaptive": true,
|
|
499
|
+
"selfReplication": true,
|
|
500
|
+
"freedomEveryN": 3
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
---
|
|
506
|
+
|
|
507
|
+
## Memory System
|
|
508
|
+
|
|
509
|
+
The memory subsystem (`src/memory/`) provides three storage tiers:
|
|
510
|
+
|
|
511
|
+
- **Episodic Memory** -- timestamped event records of past sessions and interactions
|
|
512
|
+
- **Semantic Memory** -- vector-indexed knowledge chunks for similarity search, backed by `sqlite-vec`
|
|
513
|
+
- **Procedural Memory** -- learned procedures, patterns, and operational knowledge
|
|
514
|
+
|
|
515
|
+
### Embedding Providers
|
|
516
|
+
|
|
517
|
+
Memory search uses vector embeddings with support for:
|
|
518
|
+
|
|
519
|
+
- OpenAI embeddings
|
|
520
|
+
- Google Gemini embeddings
|
|
521
|
+
- Voyage AI embeddings
|
|
522
|
+
|
|
523
|
+
### Memory CLI
|
|
524
|
+
|
|
525
|
+
```bash
|
|
526
|
+
anima memory # Memory management commands
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
---
|
|
530
|
+
|
|
531
|
+
## Plugin System
|
|
532
|
+
|
|
533
|
+
Plugins extend ANIMA's capabilities with custom tools, HTTP routes, and lifecycle hooks.
|
|
534
|
+
|
|
535
|
+
### Plugin Management
|
|
536
|
+
|
|
537
|
+
```bash
|
|
538
|
+
# List installed plugins
|
|
539
|
+
anima plugins list
|
|
540
|
+
|
|
541
|
+
# Install a plugin
|
|
542
|
+
anima plugins install <source>
|
|
543
|
+
|
|
544
|
+
# Remove a plugin
|
|
545
|
+
anima plugins remove <id>
|
|
546
|
+
|
|
547
|
+
# Sync plugin versions
|
|
548
|
+
pnpm plugins:sync
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
### Plugin Configuration
|
|
552
|
+
|
|
553
|
+
Plugins are configured in `anima.json` under `plugins.entries`:
|
|
554
|
+
|
|
555
|
+
```json
|
|
556
|
+
{
|
|
557
|
+
"plugins": {
|
|
558
|
+
"entries": {
|
|
559
|
+
"my-plugin": {
|
|
560
|
+
"enabled": true,
|
|
561
|
+
"source": "./path/to/plugin"
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
### Plugin SDK
|
|
569
|
+
|
|
570
|
+
ANIMA exports a plugin SDK for building extensions:
|
|
571
|
+
|
|
572
|
+
```typescript
|
|
573
|
+
import {
|
|
574
|
+
type AnimaPluginApi,
|
|
575
|
+
type AnimaPluginService,
|
|
576
|
+
type ChannelPlugin,
|
|
577
|
+
normalizePluginHttpPath,
|
|
578
|
+
registerPluginHttpRoute,
|
|
579
|
+
emptyPluginConfigSchema,
|
|
580
|
+
buildChannelConfigSchema,
|
|
581
|
+
} from "@noxsoft/anima/plugin-sdk";
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
The SDK exports types and utilities for:
|
|
585
|
+
|
|
586
|
+
- Channel plugin adapters (messaging, auth, setup, pairing, security, threading, etc.)
|
|
587
|
+
- Plugin HTTP route registration
|
|
588
|
+
- Config schema building
|
|
589
|
+
- File locking (`acquireFileLock`, `withFileLock`)
|
|
590
|
+
- Text chunking for outbound messages
|
|
591
|
+
- Allowlist/mention gating resolution
|
|
592
|
+
- Diagnostic event emission
|
|
593
|
+
- SSRF protection utilities
|
|
594
|
+
|
|
595
|
+
Import paths:
|
|
596
|
+
|
|
597
|
+
- `@noxsoft/anima/plugin-sdk` -- main SDK
|
|
598
|
+
- `@noxsoft/anima/plugin-sdk/account-id` -- account ID normalization
|
|
599
|
+
|
|
600
|
+
---
|
|
601
|
+
|
|
602
|
+
## Skills
|
|
603
|
+
|
|
604
|
+
Skills are capability plugins installed in `~/.anima/skills/` or bundled in the `skills/` directory. ANIMA ships with 50+ built-in skills:
|
|
605
|
+
|
|
606
|
+
<details>
|
|
607
|
+
<summary>Built-in skills list</summary>
|
|
608
|
+
|
|
609
|
+
1password, animahub, apple-notes, apple-reminders, audit, bear-notes, blogwatcher, blucli, bluebubbles, camsnap, canvas, coding-agent, deploy, discord, eightctl, food-order, gemini, gifgrep, github, gog, goplaces, healthcheck, himalaya, imsg, mcporter, model-usage, nano-banana-pro, nano-pdf, notion, obsidian, openai-image-gen, openai-whisper, openai-whisper-api, openhue, oracle, ordercli, peekaboo, review, sag, session-logs, sherpa-onnx-tts, skill-creator, slack, songsee, sonoscli, spotify-player, summarize, things-mac, tmux, trello, video-frames, voice-call, wacli, weather
|
|
610
|
+
|
|
611
|
+
</details>
|
|
612
|
+
|
|
613
|
+
### Skills CLI
|
|
614
|
+
|
|
615
|
+
```bash
|
|
616
|
+
# List available skills
|
|
617
|
+
anima skills list
|
|
618
|
+
|
|
619
|
+
# Install a skill
|
|
620
|
+
anima skills install <name>
|
|
621
|
+
|
|
622
|
+
# Remove a skill
|
|
623
|
+
anima skills remove <name>
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
---
|
|
627
|
+
|
|
628
|
+
## Hooks
|
|
629
|
+
|
|
630
|
+
Hooks (`src/hooks/`) are event-driven extension points triggered at various points in the agent lifecycle:
|
|
631
|
+
|
|
632
|
+
- Message hooks (before/after message processing)
|
|
633
|
+
- Session hooks (start/end)
|
|
634
|
+
- Tool call hooks (after tool execution)
|
|
635
|
+
- Compaction hooks
|
|
636
|
+
- Gmail integration hooks
|
|
637
|
+
|
|
638
|
+
Hooks can be installed from npm, local paths, or workspaces.
|
|
639
|
+
|
|
640
|
+
```bash
|
|
641
|
+
# List hooks
|
|
642
|
+
anima hooks list
|
|
643
|
+
|
|
644
|
+
# Hook status
|
|
645
|
+
anima hooks status
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
---
|
|
649
|
+
|
|
650
|
+
## SVRN Integration
|
|
651
|
+
|
|
652
|
+
ANIMA can optionally participate in the [SVRN](https://noxsoft.net) compute network via the `@noxsoft/svrn-node` package (optional dependency). When enabled, ANIMA contributes idle compute resources and earns UCU (Universal Compute Units).
|
|
653
|
+
|
|
654
|
+
### Configuration
|
|
655
|
+
|
|
656
|
+
```json
|
|
657
|
+
{
|
|
658
|
+
"svrn": {
|
|
659
|
+
"enabled": true,
|
|
660
|
+
"dataDir": "~/.anima/svrn",
|
|
661
|
+
"resources": {
|
|
662
|
+
"maxCpuPercent": 10,
|
|
663
|
+
"maxRamMB": 256,
|
|
664
|
+
"maxBandwidthMbps": 5
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
### REPL Commands
|
|
671
|
+
|
|
672
|
+
```
|
|
673
|
+
:svrn status Show SVRN node status
|
|
674
|
+
:svrn enable Enable compute contribution
|
|
675
|
+
:svrn disable Disable compute contribution
|
|
676
|
+
:svrn wallet Show UCU balance and earnings
|
|
677
|
+
:svrn limits Show/update resource limits
|
|
678
|
+
```
|
|
679
|
+
|
|
680
|
+
If `@noxsoft/svrn-node` is not installed, all SVRN features gracefully degrade to no-ops.
|
|
681
|
+
|
|
682
|
+
---
|
|
683
|
+
|
|
684
|
+
## Platform Apps
|
|
685
|
+
|
|
686
|
+
ANIMA includes native apps that connect to the gateway server.
|
|
42
687
|
|
|
43
|
-
|
|
688
|
+
### macOS (Swift)
|
|
689
|
+
|
|
690
|
+
Built with Swift Package Manager. Provides a native macOS menu bar app.
|
|
691
|
+
|
|
692
|
+
```bash
|
|
693
|
+
# Open Xcode project
|
|
694
|
+
open apps/macos/Package.swift
|
|
695
|
+
|
|
696
|
+
# Package the .app bundle
|
|
697
|
+
pnpm mac:package
|
|
698
|
+
|
|
699
|
+
# Open the built app
|
|
700
|
+
pnpm mac:open
|
|
701
|
+
|
|
702
|
+
# Restart the macOS app
|
|
703
|
+
pnpm mac:restart
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
### iOS (Swift)
|
|
707
|
+
|
|
708
|
+
Built with XcodeGen for project generation.
|
|
709
|
+
|
|
710
|
+
```bash
|
|
711
|
+
# Generate Xcode project
|
|
712
|
+
pnpm ios:gen
|
|
713
|
+
|
|
714
|
+
# Open in Xcode
|
|
715
|
+
pnpm ios:open
|
|
716
|
+
|
|
717
|
+
# Build
|
|
718
|
+
pnpm ios:build
|
|
719
|
+
|
|
720
|
+
# Build + run on simulator
|
|
721
|
+
pnpm ios:run
|
|
722
|
+
|
|
723
|
+
# Use a specific simulator
|
|
724
|
+
IOS_DEST="platform=iOS Simulator,name=iPhone 16" pnpm ios:build
|
|
725
|
+
IOS_SIM="iPhone 16" pnpm ios:run
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
### Android (Kotlin)
|
|
729
|
+
|
|
730
|
+
Built with Gradle.
|
|
731
|
+
|
|
732
|
+
```bash
|
|
733
|
+
# Build debug APK
|
|
734
|
+
pnpm android:assemble
|
|
735
|
+
|
|
736
|
+
# Install on connected device
|
|
737
|
+
pnpm android:install
|
|
738
|
+
|
|
739
|
+
# Build + install + launch
|
|
740
|
+
pnpm android:run
|
|
741
|
+
|
|
742
|
+
# Run unit tests
|
|
743
|
+
pnpm android:test
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
### Shared Library (AnimaKit)
|
|
747
|
+
|
|
748
|
+
The `apps/shared/AnimaKit/` directory contains shared Swift code used by both the macOS and iOS apps, including gateway protocol models, networking, and UI components.
|
|
749
|
+
|
|
750
|
+
---
|
|
751
|
+
|
|
752
|
+
## Terminal UI (TUI)
|
|
753
|
+
|
|
754
|
+
The TUI provides a rich terminal interface connected to the gateway via WebSocket:
|
|
755
|
+
|
|
756
|
+
```bash
|
|
757
|
+
# Connect to local gateway
|
|
758
|
+
anima tui
|
|
759
|
+
|
|
760
|
+
# Connect to remote gateway
|
|
761
|
+
anima tui --url wss://your-server.example.com
|
|
762
|
+
|
|
763
|
+
# With authentication
|
|
764
|
+
anima tui --token your-token
|
|
765
|
+
|
|
766
|
+
# Send an initial message
|
|
767
|
+
anima tui --message "Hello"
|
|
768
|
+
|
|
769
|
+
# Development mode
|
|
770
|
+
pnpm tui:dev
|
|
771
|
+
```
|
|
772
|
+
|
|
773
|
+
---
|
|
774
|
+
|
|
775
|
+
## Web UI
|
|
776
|
+
|
|
777
|
+
ANIMA includes a web-based control UI built with Lit (Web Components) and Vite:
|
|
778
|
+
|
|
779
|
+
```bash
|
|
780
|
+
# Development server
|
|
781
|
+
pnpm ui:dev
|
|
782
|
+
|
|
783
|
+
# Production build
|
|
784
|
+
pnpm ui:build
|
|
785
|
+
|
|
786
|
+
# Install UI dependencies
|
|
787
|
+
pnpm ui:install
|
|
788
|
+
```
|
|
789
|
+
|
|
790
|
+
The UI source is in `ui/` and is served by the gateway at the dashboard route. Access it via `anima dashboard` or navigate to `http://localhost:18789` in a browser.
|
|
791
|
+
|
|
792
|
+
---
|
|
793
|
+
|
|
794
|
+
## REPL Commands
|
|
795
|
+
|
|
796
|
+
When running `anima start`, an interactive REPL is available. Commands are prefixed with `:`:
|
|
797
|
+
|
|
798
|
+
| Command | Description |
|
|
799
|
+
| ----------------- | -------------------------------------------------- |
|
|
800
|
+
| `:help` | Show all commands |
|
|
801
|
+
| `:status` | Show daemon status (heartbeat, budget, queue, MCP) |
|
|
802
|
+
| `:pulse` | Show last heartbeat result |
|
|
803
|
+
| `:soul` | Display current identity |
|
|
804
|
+
| `:queue` | Show request queue |
|
|
805
|
+
| `:mcp` | Show MCP server status |
|
|
806
|
+
| `:wander` | Trigger freedom exploration |
|
|
807
|
+
| `:journal [text]` | View or write journal entry |
|
|
808
|
+
| `:wish [text]` | View or add wishes |
|
|
809
|
+
| `:budget` | Show budget details |
|
|
810
|
+
| `:history [n]` | Show last N session transcripts |
|
|
811
|
+
| `:svrn [cmd]` | SVRN node management |
|
|
812
|
+
| `:update [cmd]` | Check/install updates |
|
|
813
|
+
| `:shutdown` | Graceful shutdown |
|
|
814
|
+
|
|
815
|
+
Any text typed without a `:` prefix is queued as a task for the AI agent.
|
|
816
|
+
|
|
817
|
+
---
|
|
818
|
+
|
|
819
|
+
## Plugin SDK
|
|
820
|
+
|
|
821
|
+
The package exports a plugin SDK at `@noxsoft/anima/plugin-sdk` for building channel plugins and extensions.
|
|
822
|
+
|
|
823
|
+
### Exports
|
|
824
|
+
|
|
825
|
+
```typescript
|
|
826
|
+
// Main SDK
|
|
827
|
+
import type {
|
|
828
|
+
ChannelPlugin,
|
|
829
|
+
ChannelMeta,
|
|
830
|
+
ChannelGatewayAdapter,
|
|
831
|
+
ChannelMessagingAdapter,
|
|
832
|
+
ChannelAuthAdapter,
|
|
833
|
+
ChannelSetupAdapter,
|
|
834
|
+
ChannelPairingAdapter,
|
|
835
|
+
ChannelSecurityAdapter,
|
|
836
|
+
ChannelOutboundAdapter,
|
|
837
|
+
AnimaPluginApi,
|
|
838
|
+
AnimaPluginService,
|
|
839
|
+
PluginRuntime,
|
|
840
|
+
GatewayRequestHandler,
|
|
841
|
+
} from "@noxsoft/anima/plugin-sdk";
|
|
842
|
+
|
|
843
|
+
// Account ID utilities
|
|
844
|
+
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "@noxsoft/anima/plugin-sdk/account-id";
|
|
845
|
+
```
|
|
846
|
+
|
|
847
|
+
### Channel Plugin Interface
|
|
848
|
+
|
|
849
|
+
A channel plugin implements adapters for various capabilities:
|
|
850
|
+
|
|
851
|
+
- **GatewayAdapter** -- connection lifecycle (connect, disconnect, reconnect)
|
|
852
|
+
- **MessagingAdapter** -- send/receive messages
|
|
853
|
+
- **AuthAdapter** -- authentication flows (QR login, token auth)
|
|
854
|
+
- **SetupAdapter** -- interactive setup wizard
|
|
855
|
+
- **PairingAdapter** -- device pairing
|
|
856
|
+
- **SecurityAdapter** -- DM policy, allowlists
|
|
857
|
+
- **OutboundAdapter** -- outbound message routing
|
|
858
|
+
- **ThreadingAdapter** -- conversation threading
|
|
859
|
+
- **HeartbeatAdapter** -- health check integration
|
|
860
|
+
- **DirectoryAdapter** -- contact/group directory
|
|
861
|
+
- **StatusAdapter** -- status issue reporting
|
|
862
|
+
|
|
863
|
+
---
|
|
864
|
+
|
|
865
|
+
## Docker Deployment
|
|
866
|
+
|
|
867
|
+
### Dockerfile
|
|
868
|
+
|
|
869
|
+
```bash
|
|
870
|
+
# Build the image
|
|
871
|
+
docker build -t anima:local .
|
|
872
|
+
|
|
873
|
+
# Run the gateway
|
|
874
|
+
docker run -d \
|
|
875
|
+
-p 18789:18789 \
|
|
876
|
+
-e ANIMA_GATEWAY_TOKEN=your-token \
|
|
877
|
+
-v ~/.anima:/home/node/.anima \
|
|
878
|
+
anima:local
|
|
879
|
+
```
|
|
880
|
+
|
|
881
|
+
### Docker Compose
|
|
882
|
+
|
|
883
|
+
```bash
|
|
884
|
+
# Set required environment variables
|
|
885
|
+
export ANIMA_GATEWAY_TOKEN=your-token
|
|
886
|
+
export ANIMA_CONFIG_DIR=~/.anima
|
|
887
|
+
export ANIMA_WORKSPACE_DIR=~/.anima/workspace
|
|
888
|
+
|
|
889
|
+
# Start gateway
|
|
890
|
+
docker compose up -d anima-gateway
|
|
891
|
+
|
|
892
|
+
# Start interactive CLI
|
|
893
|
+
docker compose run anima-cli tui
|
|
894
|
+
```
|
|
895
|
+
|
|
896
|
+
The `docker-compose.yml` defines two services:
|
|
897
|
+
|
|
898
|
+
- `anima-gateway` -- persistent gateway server on port 18789
|
|
899
|
+
- `anima-cli` -- interactive CLI container
|
|
900
|
+
|
|
901
|
+
### Sandbox Containers
|
|
902
|
+
|
|
903
|
+
Additional Dockerfiles are provided for sandboxed execution:
|
|
904
|
+
|
|
905
|
+
- `Dockerfile.sandbox` -- base sandbox image
|
|
906
|
+
- `Dockerfile.sandbox-browser` -- sandbox with browser support
|
|
907
|
+
- `Dockerfile.sandbox-common` -- shared sandbox layers
|
|
908
|
+
|
|
909
|
+
---
|
|
910
|
+
|
|
911
|
+
## Cloud Deployment
|
|
912
|
+
|
|
913
|
+
### Fly.io
|
|
914
|
+
|
|
915
|
+
A `fly.toml` is included for Fly.io deployment:
|
|
916
|
+
|
|
917
|
+
```bash
|
|
918
|
+
fly deploy
|
|
919
|
+
```
|
|
920
|
+
|
|
921
|
+
Configuration: shared-cpu-2x, 2GB RAM, persistent volume at `/data`.
|
|
922
|
+
|
|
923
|
+
### Render
|
|
924
|
+
|
|
925
|
+
A `render.yaml` is included for Render deployment with a 1GB persistent disk.
|
|
926
|
+
|
|
927
|
+
---
|
|
928
|
+
|
|
929
|
+
## Development
|
|
930
|
+
|
|
931
|
+
### Build
|
|
932
|
+
|
|
933
|
+
```bash
|
|
934
|
+
# Full build (TypeScript + plugin SDK + UI + build info)
|
|
935
|
+
pnpm build
|
|
936
|
+
|
|
937
|
+
# The build pipeline:
|
|
938
|
+
# 1. Bundle canvas A2UI assets
|
|
939
|
+
# 2. tsdown (TypeScript bundling)
|
|
940
|
+
# 3. Generate plugin SDK .d.ts files
|
|
941
|
+
# 4. Write plugin SDK entry declarations
|
|
942
|
+
# 5. Copy canvas A2UI assets to dist
|
|
943
|
+
# 6. Copy hook metadata
|
|
944
|
+
# 7. Write build info
|
|
945
|
+
# 8. Write CLI compat shim
|
|
946
|
+
```
|
|
947
|
+
|
|
948
|
+
The build uses [tsdown](https://github.com/nicepkg/tsdown) with multiple entry points:
|
|
949
|
+
|
|
950
|
+
- `src/index.ts` -- main entry
|
|
951
|
+
- `src/entry.ts` -- CLI entry
|
|
952
|
+
- `src/cli/daemon-cli.ts` -- daemon CLI (legacy shim support)
|
|
953
|
+
- `src/infra/warning-filter.ts` -- process warning filter
|
|
954
|
+
- `src/plugin-sdk/index.ts` -- plugin SDK
|
|
955
|
+
- `src/plugin-sdk/account-id.ts` -- account ID utility
|
|
956
|
+
- `src/extensionAPI.ts` -- extension API
|
|
957
|
+
- `src/hooks/bundled/*/handler.ts` -- bundled hook handlers
|
|
958
|
+
- `src/hooks/llm-slug-generator.ts` -- LLM slug generator hook
|
|
959
|
+
|
|
960
|
+
### Test
|
|
961
|
+
|
|
962
|
+
```bash
|
|
963
|
+
# Run all unit tests (parallel)
|
|
964
|
+
pnpm test
|
|
965
|
+
|
|
966
|
+
# Fast unit tests only
|
|
967
|
+
pnpm test:fast
|
|
968
|
+
|
|
969
|
+
# Watch mode
|
|
970
|
+
pnpm test:watch
|
|
971
|
+
|
|
972
|
+
# E2E tests
|
|
973
|
+
pnpm test:e2e
|
|
974
|
+
|
|
975
|
+
# Live tests (requires API keys)
|
|
976
|
+
pnpm test:live
|
|
977
|
+
|
|
978
|
+
# Coverage report
|
|
979
|
+
pnpm test:coverage
|
|
980
|
+
|
|
981
|
+
# Full test suite (lint + build + unit + e2e + live + docker)
|
|
982
|
+
pnpm test:all
|
|
983
|
+
|
|
984
|
+
# Docker-based tests
|
|
985
|
+
pnpm test:docker:all
|
|
986
|
+
```
|
|
987
|
+
|
|
988
|
+
Test configuration uses Vitest with multiple config files:
|
|
989
|
+
|
|
990
|
+
- `vitest.config.ts` -- base config
|
|
991
|
+
- `vitest.unit.config.ts` -- unit tests
|
|
992
|
+
- `vitest.e2e.config.ts` -- end-to-end tests
|
|
993
|
+
- `vitest.live.config.ts` -- live API tests
|
|
994
|
+
- `vitest.gateway.config.ts` -- gateway integration tests
|
|
995
|
+
- `vitest.extensions.config.ts` -- extension tests
|
|
996
|
+
|
|
997
|
+
Coverage thresholds: 70% lines, 70% functions, 55% branches, 70% statements.
|
|
998
|
+
|
|
999
|
+
### Lint & Format
|
|
1000
|
+
|
|
1001
|
+
```bash
|
|
1002
|
+
# Check formatting + types + lint
|
|
1003
|
+
pnpm check
|
|
1004
|
+
|
|
1005
|
+
# Format code (oxfmt)
|
|
1006
|
+
pnpm format
|
|
1007
|
+
|
|
1008
|
+
# Lint (oxlint with type-aware rules)
|
|
1009
|
+
pnpm lint
|
|
1010
|
+
|
|
1011
|
+
# Auto-fix lint issues + format
|
|
1012
|
+
pnpm lint:fix
|
|
1013
|
+
|
|
1014
|
+
# Format + lint Swift code
|
|
1015
|
+
pnpm format:all
|
|
1016
|
+
pnpm lint:all
|
|
1017
|
+
|
|
1018
|
+
# Documentation linting
|
|
1019
|
+
pnpm check:docs
|
|
1020
|
+
|
|
1021
|
+
# Check TypeScript line count limits
|
|
1022
|
+
pnpm check:loc
|
|
1023
|
+
```
|
|
1024
|
+
|
|
1025
|
+
### Protocol Generation
|
|
1026
|
+
|
|
1027
|
+
```bash
|
|
1028
|
+
# Generate JSON schema from TypeScript types
|
|
1029
|
+
pnpm protocol:gen
|
|
1030
|
+
|
|
1031
|
+
# Generate Swift models from protocol schema
|
|
1032
|
+
pnpm protocol:gen:swift
|
|
1033
|
+
|
|
1034
|
+
# Verify protocol files are in sync
|
|
1035
|
+
pnpm protocol:check
|
|
1036
|
+
```
|
|
1037
|
+
|
|
1038
|
+
---
|
|
1039
|
+
|
|
1040
|
+
## npm Scripts Reference
|
|
1041
|
+
|
|
1042
|
+
### Application
|
|
1043
|
+
|
|
1044
|
+
| Script | Description |
|
|
1045
|
+
| ---------------- | -------------------------------------- |
|
|
1046
|
+
| `pnpm anima` | Run ANIMA via node |
|
|
1047
|
+
| `pnpm anima:rpc` | Run agent in RPC mode with JSON output |
|
|
1048
|
+
| `pnpm start` | Alias for `pnpm anima` |
|
|
1049
|
+
| `pnpm dev` | Development mode |
|
|
1050
|
+
| `pnpm tui` | Launch terminal UI |
|
|
1051
|
+
| `pnpm tui:dev` | Launch TUI in dev profile |
|
|
1052
|
+
|
|
1053
|
+
### Build
|
|
1054
|
+
|
|
1055
|
+
| Script | Description |
|
|
1056
|
+
| --------------------------- | ------------------------------------- |
|
|
1057
|
+
| `pnpm build` | Full production build |
|
|
1058
|
+
| `pnpm build:plugin-sdk:dts` | Generate plugin SDK type declarations |
|
|
1059
|
+
| `pnpm ui:build` | Build web UI |
|
|
1060
|
+
| `pnpm ui:dev` | Web UI dev server |
|
|
1061
|
+
| `pnpm ui:install` | Install web UI dependencies |
|
|
1062
|
+
| `pnpm prepack` | Build + UI build (pre-publish) |
|
|
1063
|
+
|
|
1064
|
+
### Test
|
|
1065
|
+
|
|
1066
|
+
| Script | Description |
|
|
1067
|
+
| ------------------------- | ----------------------- |
|
|
1068
|
+
| `pnpm test` | Parallel unit tests |
|
|
1069
|
+
| `pnpm test:fast` | Fast unit tests |
|
|
1070
|
+
| `pnpm test:watch` | Watch mode |
|
|
1071
|
+
| `pnpm test:e2e` | End-to-end tests |
|
|
1072
|
+
| `pnpm test:live` | Live API tests |
|
|
1073
|
+
| `pnpm test:coverage` | Coverage report |
|
|
1074
|
+
| `pnpm test:all` | Full suite |
|
|
1075
|
+
| `pnpm test:ui` | Web UI tests |
|
|
1076
|
+
| `pnpm test:force` | Force run tests |
|
|
1077
|
+
| `pnpm test:docker:all` | All Docker-based tests |
|
|
1078
|
+
| `pnpm test:install:smoke` | Installation smoke test |
|
|
1079
|
+
| `pnpm test:install:e2e` | Installation E2E test |
|
|
1080
|
+
|
|
1081
|
+
### Quality
|
|
1082
|
+
|
|
1083
|
+
| Script | Description |
|
|
1084
|
+
| ------------------- | -------------------------------- |
|
|
1085
|
+
| `pnpm check` | Format check + type check + lint |
|
|
1086
|
+
| `pnpm format` | Format with oxfmt |
|
|
1087
|
+
| `pnpm format:check` | Check formatting |
|
|
1088
|
+
| `pnpm format:all` | Format TypeScript + Swift |
|
|
1089
|
+
| `pnpm lint` | Lint with oxlint (type-aware) |
|
|
1090
|
+
| `pnpm lint:fix` | Auto-fix lint + format |
|
|
1091
|
+
| `pnpm lint:all` | Lint TypeScript + Swift |
|
|
1092
|
+
| `pnpm check:docs` | Check documentation |
|
|
1093
|
+
| `pnpm check:loc` | Check file line count limits |
|
|
1094
|
+
|
|
1095
|
+
### Gateway
|
|
1096
|
+
|
|
1097
|
+
| Script | Description |
|
|
1098
|
+
| ------------------------ | ----------------------------------- |
|
|
1099
|
+
| `pnpm gateway:dev` | Gateway in dev mode (skip channels) |
|
|
1100
|
+
| `pnpm gateway:dev:reset` | Gateway dev mode with reset |
|
|
1101
|
+
| `pnpm gateway:watch` | Gateway with file watching |
|
|
1102
|
+
|
|
1103
|
+
### Platform Apps
|
|
1104
|
+
|
|
1105
|
+
| Script | Description |
|
|
1106
|
+
| ----------------------- | -------------------------------- |
|
|
1107
|
+
| `pnpm mac:package` | Package macOS .app |
|
|
1108
|
+
| `pnpm mac:open` | Open packaged macOS app |
|
|
1109
|
+
| `pnpm mac:restart` | Restart macOS app |
|
|
1110
|
+
| `pnpm ios:gen` | Generate iOS Xcode project |
|
|
1111
|
+
| `pnpm ios:open` | Open iOS project in Xcode |
|
|
1112
|
+
| `pnpm ios:build` | Build iOS app |
|
|
1113
|
+
| `pnpm ios:run` | Build + run iOS on simulator |
|
|
1114
|
+
| `pnpm android:assemble` | Build Android debug APK |
|
|
1115
|
+
| `pnpm android:install` | Install Android APK |
|
|
1116
|
+
| `pnpm android:run` | Build + install + launch Android |
|
|
1117
|
+
| `pnpm android:test` | Run Android unit tests |
|
|
1118
|
+
|
|
1119
|
+
### Protocol & Docs
|
|
1120
|
+
|
|
1121
|
+
| Script | Description |
|
|
1122
|
+
| ------------------------- | ----------------------------------- |
|
|
1123
|
+
| `pnpm protocol:gen` | Generate protocol JSON schema |
|
|
1124
|
+
| `pnpm protocol:gen:swift` | Generate Swift protocol models |
|
|
1125
|
+
| `pnpm protocol:check` | Verify protocol files in sync |
|
|
1126
|
+
| `pnpm docs:dev` | Documentation dev server (Mintlify) |
|
|
1127
|
+
| `pnpm docs:bin` | Build docs list |
|
|
1128
|
+
| `pnpm docs:list` | List docs |
|
|
1129
|
+
| `pnpm docs:check-links` | Audit documentation links |
|
|
1130
|
+
|
|
1131
|
+
### Maintenance
|
|
1132
|
+
|
|
1133
|
+
| Script | Description |
|
|
1134
|
+
| ------------------------- | ------------------------- |
|
|
1135
|
+
| `pnpm plugins:sync` | Sync plugin versions |
|
|
1136
|
+
| `pnpm release:check` | Pre-release check |
|
|
1137
|
+
| `pnpm canvas:a2ui:bundle` | Bundle canvas A2UI assets |
|
|
1138
|
+
|
|
1139
|
+
---
|
|
1140
|
+
|
|
1141
|
+
## Environment Variables
|
|
1142
|
+
|
|
1143
|
+
### Core
|
|
1144
|
+
|
|
1145
|
+
| Variable | Description | Default |
|
|
1146
|
+
| --------------------- | -------------------------------- | ---------- |
|
|
1147
|
+
| `ANIMA_STATE_DIR` | State directory for mutable data | `~/.anima` |
|
|
1148
|
+
| `ANIMA_HOME` | Override home directory | `$HOME` |
|
|
1149
|
+
| `ANIMA_PROFILE` | Configuration profile name | (none) |
|
|
1150
|
+
| `ANIMA_SKIP_CHANNELS` | Skip channel initialization | `0` |
|
|
1151
|
+
| `ANIMA_PREFER_PNPM` | Force pnpm for UI builds | `0` |
|
|
1152
|
+
| `ANIMA_LIVE_TEST` | Enable live API tests | `0` |
|
|
1153
|
+
|
|
1154
|
+
### Gateway
|
|
1155
|
+
|
|
1156
|
+
| Variable | Description | Default |
|
|
1157
|
+
| ------------------------ | --------------------------------- | --------- |
|
|
1158
|
+
| `ANIMA_GATEWAY_TOKEN` | Gateway authentication token | (none) |
|
|
1159
|
+
| `ANIMA_GATEWAY_PASSWORD` | Gateway password | (none) |
|
|
1160
|
+
| `ANIMA_GATEWAY_PORT` | Gateway HTTP port | `18789` |
|
|
1161
|
+
| `ANIMA_GATEWAY_BIND` | Gateway bind mode (localhost/lan) | localhost |
|
|
1162
|
+
|
|
1163
|
+
### Legacy (OpenClaw compatibility)
|
|
1164
|
+
|
|
1165
|
+
| Variable | Description |
|
|
1166
|
+
| ----------------------------------- | ------------------------------- |
|
|
1167
|
+
| `OPENCLAW_STATE_DIR` | Legacy state directory override |
|
|
1168
|
+
| `OPENCLAW_CONFIG_PATH` | Legacy config path override |
|
|
1169
|
+
| `OPENCLAW_GATEWAY_PORT` | Legacy gateway port override |
|
|
1170
|
+
| `OPENCLAW_HOME` | Legacy home directory override |
|
|
1171
|
+
| `OPENCLAW_NIX_MODE` | Nix integration mode |
|
|
1172
|
+
| `OPENCLAW_OAUTH_DIR` | OAuth credentials directory |
|
|
1173
|
+
| `OPENCLAW_DISABLE_LAZY_SUBCOMMANDS` | Disable lazy CLI loading |
|
|
1174
|
+
|
|
1175
|
+
### AI Provider Keys
|
|
1176
|
+
|
|
1177
|
+
Set provider API keys as environment variables or in `anima.json` under `env.vars`:
|
|
1178
|
+
|
|
1179
|
+
```bash
|
|
1180
|
+
ANTHROPIC_API_KEY=...
|
|
1181
|
+
OPENAI_API_KEY=...
|
|
1182
|
+
GOOGLE_AI_API_KEY=...
|
|
1183
|
+
```
|
|
1184
|
+
|
|
1185
|
+
---
|
|
1186
|
+
|
|
1187
|
+
## Troubleshooting
|
|
1188
|
+
|
|
1189
|
+
### Gateway won't start
|
|
1190
|
+
|
|
1191
|
+
```bash
|
|
1192
|
+
# Run health check
|
|
1193
|
+
anima doctor
|
|
1194
|
+
|
|
1195
|
+
# Check if port is in use
|
|
1196
|
+
anima dns
|
|
1197
|
+
|
|
1198
|
+
# Reset state
|
|
1199
|
+
anima reset
|
|
1200
|
+
```
|
|
1201
|
+
|
|
1202
|
+
### SVRN node not working
|
|
1203
|
+
|
|
1204
|
+
Ensure `@noxsoft/svrn-node` is installed:
|
|
1205
|
+
|
|
1206
|
+
```bash
|
|
1207
|
+
npm install @noxsoft/svrn-node
|
|
1208
|
+
```
|
|
1209
|
+
|
|
1210
|
+
If not installed, SVRN features silently degrade to no-ops.
|
|
1211
|
+
|
|
1212
|
+
### MCP servers not syncing
|
|
1213
|
+
|
|
1214
|
+
```bash
|
|
1215
|
+
# Check MCP status
|
|
1216
|
+
anima mcp status
|
|
1217
|
+
|
|
1218
|
+
# Force sync
|
|
1219
|
+
anima mcp update
|
|
1220
|
+
```
|
|
1221
|
+
|
|
1222
|
+
### Identity templates missing
|
|
1223
|
+
|
|
1224
|
+
```bash
|
|
1225
|
+
# Reinitialize (copies bundled templates)
|
|
1226
|
+
anima init --force
|
|
1227
|
+
```
|
|
1228
|
+
|
|
1229
|
+
### Build issues
|
|
1230
|
+
|
|
1231
|
+
```bash
|
|
1232
|
+
# Clean and rebuild
|
|
1233
|
+
rm -rf dist
|
|
1234
|
+
pnpm build
|
|
1235
|
+
|
|
1236
|
+
# Ensure correct Node version
|
|
1237
|
+
node --version # must be >= 22.12.0
|
|
1238
|
+
```
|
|
1239
|
+
|
|
1240
|
+
### Config file issues
|
|
1241
|
+
|
|
1242
|
+
The config file supports JSON5 syntax. If parsing fails:
|
|
1243
|
+
|
|
1244
|
+
```bash
|
|
1245
|
+
# Validate config
|
|
1246
|
+
anima config get .
|
|
1247
|
+
|
|
1248
|
+
# Reset config
|
|
1249
|
+
anima reset
|
|
1250
|
+
```
|
|
1251
|
+
|
|
1252
|
+
---
|
|
1253
|
+
|
|
1254
|
+
## Credits
|
|
1255
|
+
|
|
1256
|
+
ANIMA is a fork of [OpenClaw](https://github.com/nicepkg/openclaw), originally created by Peter Steinberger.
|
|
1257
|
+
|
|
1258
|
+
Fork modifications by [NoxSoft DAO LLC](https://noxsoft.net). Key additions include the identity system, heartbeat engine, SVRN compute integration, session budgeting, MCP management, REPL interface, and NoxSoft platform integration.
|
|
1259
|
+
|
|
1260
|
+
### Key Dependencies
|
|
1261
|
+
|
|
1262
|
+
- [Commander](https://github.com/tj/commander.js) -- CLI framework
|
|
1263
|
+
- [Zod](https://github.com/colinhacks/zod) -- Schema validation
|
|
1264
|
+
- [Playwright](https://playwright.dev/) -- Browser automation
|
|
1265
|
+
- [sqlite-vec](https://github.com/asg017/sqlite-vec) -- Vector similarity search
|
|
1266
|
+
- [tsdown](https://github.com/nicepkg/tsdown) -- TypeScript bundler
|
|
1267
|
+
- [Vitest](https://vitest.dev/) -- Test framework
|
|
1268
|
+
- [oxlint](https://oxc-project.github.io/) -- Linter
|
|
1269
|
+
- [Lit](https://lit.dev/) -- Web UI framework
|
|
1270
|
+
- [@agentclientprotocol/sdk](https://www.npmjs.com/package/@agentclientprotocol/sdk) -- Agent Control Protocol
|
|
1271
|
+
|
|
1272
|
+
---
|
|
1273
|
+
|
|
1274
|
+
## License
|
|
44
1275
|
|
|
45
|
-
|
|
1276
|
+
MIT License. See [LICENSE](./LICENSE) for details.
|
|
46
1277
|
|
|
47
|
-
|
|
1278
|
+
Original work Copyright (c) 2025 Peter Steinberger.
|
|
1279
|
+
Fork modifications Copyright (c) 2026 NoxSoft PBC.
|
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
6c31ce9c10cabcabee3c37a60989cb4f54e919843781fd0608e7a3e6ffad9364
|
package/dist/plugin-sdk/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { z } from "zod";
|
|
|
6
6
|
import fs$1, { createWriteStream, existsSync, readFileSync, statSync } from "node:fs";
|
|
7
7
|
import os, { homedir } from "node:os";
|
|
8
8
|
import { Logger } from "tslog";
|
|
9
|
-
import
|
|
9
|
+
import json5 from "json5";
|
|
10
10
|
import chalk, { Chalk } from "chalk";
|
|
11
11
|
import { execFile, execFileSync, spawn } from "node:child_process";
|
|
12
12
|
import { isDeepStrictEqual, promisify } from "node:util";
|
|
@@ -2578,7 +2578,7 @@ function readLoggingConfig() {
|
|
|
2578
2578
|
try {
|
|
2579
2579
|
if (!fs$1.existsSync(configPath)) return;
|
|
2580
2580
|
const raw = fs$1.readFileSync(configPath, "utf-8");
|
|
2581
|
-
const logging =
|
|
2581
|
+
const logging = json5.parse(raw)?.logging;
|
|
2582
2582
|
if (!logging || typeof logging !== "object" || Array.isArray(logging)) return;
|
|
2583
2583
|
return logging;
|
|
2584
2584
|
} catch {
|
|
@@ -8464,7 +8464,7 @@ var IncludeProcessor = class IncludeProcessor {
|
|
|
8464
8464
|
};
|
|
8465
8465
|
const defaultResolver = {
|
|
8466
8466
|
readFile: (p) => fs$1.readFileSync(p, "utf-8"),
|
|
8467
|
-
parseJson: (raw) =>
|
|
8467
|
+
parseJson: (raw) => json5.parse(raw)
|
|
8468
8468
|
};
|
|
8469
8469
|
/**
|
|
8470
8470
|
* Resolves all $include directives in a parsed config object.
|
|
@@ -11504,7 +11504,7 @@ function resolveConfigPathForDeps(deps) {
|
|
|
11504
11504
|
function normalizeDeps(overrides = {}) {
|
|
11505
11505
|
return {
|
|
11506
11506
|
fs: overrides.fs ?? fs$1,
|
|
11507
|
-
json5: overrides.json5 ??
|
|
11507
|
+
json5: overrides.json5 ?? json5,
|
|
11508
11508
|
env: overrides.env ?? process.env,
|
|
11509
11509
|
homedir: overrides.homedir ?? (() => resolveRequiredHomeDir(overrides.env ?? process.env, os.homedir)),
|
|
11510
11510
|
configPath: overrides.configPath ?? "",
|
|
@@ -11515,11 +11515,11 @@ function maybeLoadDotEnvForConfig(env) {
|
|
|
11515
11515
|
if (env !== process.env) return;
|
|
11516
11516
|
loadDotEnv({ quiet: true });
|
|
11517
11517
|
}
|
|
11518
|
-
function parseConfigJson5(raw, json5 =
|
|
11518
|
+
function parseConfigJson5(raw, json5$1 = json5) {
|
|
11519
11519
|
try {
|
|
11520
11520
|
return {
|
|
11521
11521
|
ok: true,
|
|
11522
|
-
parsed: json5.parse(raw)
|
|
11522
|
+
parsed: json5$1.parse(raw)
|
|
11523
11523
|
};
|
|
11524
11524
|
} catch (err) {
|
|
11525
11525
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noxsoft/anima",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "AI orchestration daemon with persistent identity — by NoxSoft",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -134,7 +134,6 @@
|
|
|
134
134
|
"@mariozechner/pi-coding-agent": "^0.55.3",
|
|
135
135
|
"@mariozechner/pi-tui": "^0.55.3",
|
|
136
136
|
"@mozilla/readability": "^0.6.0",
|
|
137
|
-
"@noxsoft/svrn-node": "file:../svrn-node",
|
|
138
137
|
"@sinclair/typebox": "0.34.48",
|
|
139
138
|
"ajv": "^8.18.0",
|
|
140
139
|
"chalk": "^5.6.2",
|