@christopherlittle51/postclaw 1.3.1 → 1.3.2
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 +69 -695
- package/dashboard/README.md +89 -0
- package/dashboard/public/app.js +903 -542
- package/dashboard/public/index.html +184 -73
- package/dashboard/public/styles.css +583 -126
- package/dist/dashboard/routes/graph.d.ts +2 -2
- package/dist/dashboard/routes/graph.d.ts.map +1 -1
- package/dist/dashboard/routes/graph.js +61 -23
- package/dist/dashboard/routes/graph.js.map +1 -1
- package/dist/dashboard/routes/memories.d.ts.map +1 -1
- package/dist/dashboard/routes/memories.js +66 -0
- package/dist/dashboard/routes/memories.js.map +1 -1
- package/dist/dashboard/routes/workspace.d.ts +4 -3
- package/dist/dashboard/routes/workspace.d.ts.map +1 -1
- package/dist/dashboard/routes/workspace.js +119 -7
- package/dist/dashboard/routes/workspace.js.map +1 -1
- package/dist/dashboard/server.js +1 -1
- package/dist/dashboard/server.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +84 -27
- package/dist/index.js.map +1 -1
- package/dist/schemas/validation.d.ts +32 -3
- package/dist/schemas/validation.d.ts.map +1 -1
- package/dist/schemas/validation.js +22 -4
- package/dist/schemas/validation.js.map +1 -1
- package/dist/scripts/setup-db.d.ts.map +1 -1
- package/dist/scripts/setup-db.js +28 -30
- package/dist/scripts/setup-db.js.map +1 -1
- package/dist/scripts/sleep_cycle.d.ts +1 -0
- package/dist/scripts/sleep_cycle.d.ts.map +1 -1
- package/dist/scripts/sleep_cycle.js +114 -21
- package/dist/scripts/sleep_cycle.js.map +1 -1
- package/dist/services/config.d.ts +1 -0
- package/dist/services/config.d.ts.map +1 -1
- package/dist/services/config.js +4 -22
- package/dist/services/config.js.map +1 -1
- package/dist/services/memoryService.d.ts +2 -1
- package/dist/services/memoryService.d.ts.map +1 -1
- package/dist/services/memoryService.js +90 -24
- package/dist/services/memoryService.js.map +1 -1
- package/dist/services/personaService.d.ts +25 -0
- package/dist/services/personaService.d.ts.map +1 -1
- package/dist/services/personaService.js +79 -0
- package/dist/services/personaService.js.map +1 -1
- package/dist/tests/dashboard-schemas.test.js +71 -1
- package/dist/tests/dashboard-schemas.test.js.map +1 -1
- package/package.json +1 -1
- package/schemas/README.md +64 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# PostClaw Dashboard Module
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The PostClaw Dashboard is an optional, lightweight web interface that provides a graphical front-end for managing your agent's PostgreSQL database. Instead of writing raw SQL queries to inspect the agent's state, developers and users can use this dashboard to visualize semantic memories, edit persona traits, and manually trigger maintenance scripts.
|
|
6
|
+
|
|
7
|
+
The dashboard runs as a standalone Express-style Node.js HTTP server. It relies on a Single Page Application (SPA) architecture, using `@ambientcss` for styling, and communicates with the underlying PostClaw abstractions via a robust REST API.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Running the Dashboard
|
|
12
|
+
|
|
13
|
+
You can instantiate the dashboard locally via the OpenClaw command-line interface. The server must be able to connect to the PostgreSQL instance defined in your `openclaw.json` configuration.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Start the dashboard on the default port (3333)
|
|
17
|
+
openclaw postclaw dashboard
|
|
18
|
+
|
|
19
|
+
# Start the dashboard on a custom port and bind address
|
|
20
|
+
openclaw postclaw dashboard --port 8080 --bind 0.0.0.0
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Configuration Flags
|
|
24
|
+
|
|
25
|
+
* `--port <number>`: Specifies the TCP port the HTTP server binds to (default is `3333`).
|
|
26
|
+
* `--bind <address>`: Specifies the network interface. Use `127.0.0.1` (localhost) to restrict access to your current machine. Use `0.0.0.0` to expose the dashboard to your local network.
|
|
27
|
+
|
|
28
|
+
> **Security Warning:** The dashboard currently implements **no authentication**. Binding to `0.0.0.0` on a public or untrusted network will expose your agent's memory database to unauthorized access. It is highly recommended to run this only on `127.0.0.1`.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Key Features
|
|
33
|
+
|
|
34
|
+
### 1. Memory Management
|
|
35
|
+
|
|
36
|
+
The dashboard provides a paginated view of **Semantic** (long-term) memories. Users can manually curate the agent's database by editing memory content, adjusting the memory's assigned category or tier, or hard-deleting irrelevant entries that the automated garbage collection missed.
|
|
37
|
+
|
|
38
|
+
### 2. Persona Configuration
|
|
39
|
+
|
|
40
|
+
Agents using PostClaw rely on dynamic persona traits injected into their context window. The dashboard features a dedicated Persona tab where you can view all active traits, their vector representations, and their "always active" status.
|
|
41
|
+
|
|
42
|
+
### 3. Knowledge Graph Visualization
|
|
43
|
+
|
|
44
|
+
The system tracks relationships across memories using the `entity_edges` table. The dashboard includes tools to visualize these directed relationships, showing how "Memory A" contextually supports or contradicts "Memory B."
|
|
45
|
+
|
|
46
|
+
### 4. Administrative Controls
|
|
47
|
+
|
|
48
|
+
Rather than waiting for the automated timer, users can execute the `sleep_cycle` maintenance routines directly from the dashboard UI. This forces the agent to immediately consolidate recent episodic logs and prune stale semantic entries.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Server Architecture
|
|
53
|
+
|
|
54
|
+
The dashboard code is organized into three primary layers:
|
|
55
|
+
|
|
56
|
+
1. **Server Initialization (`server.ts`):**
|
|
57
|
+
Handles HTTP server creation, TCP port binding, static file serving serving from `/public`, and fallback routing for the SPA index.
|
|
58
|
+
2. **API Router (`router.ts` & `/routes`):**
|
|
59
|
+
Defines the REST API endpoints (`/api/personas`, `/api/memories`, `/api/graph`, `/api/scripts`). Route handlers validate incoming requests and map them directly into executions of the core `memoryService.ts` and `personaService.ts` libraries.
|
|
60
|
+
3. **Frontend SPA (`/public`):**
|
|
61
|
+
Contains the static HTML, CSS, and Vanilla JavaScript (`app.js`) utilized by the browser.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Troubleshooting
|
|
66
|
+
|
|
67
|
+
### EADDRINUSE: port is already in use
|
|
68
|
+
|
|
69
|
+
This indicates another application (or an improperly closed instance of the dashboard) is already listening on your target port.
|
|
70
|
+
|
|
71
|
+
* **Fix:** Manually kill the outstanding Node.js process using the port, or supply a different port via `openclaw postclaw dashboard --port 4000`.
|
|
72
|
+
|
|
73
|
+
### Database Connection Refused / 500 API Errors
|
|
74
|
+
|
|
75
|
+
If the dashboard frontend loads but displays no data or throws 500 Internal Server Errors locally, the backend router cannot reach PostgreSQL.
|
|
76
|
+
|
|
77
|
+
* **Fix:** Verify that your PostgreSQL service is actively running on your host machine. Check your `openclaw.json` to ensure the `dbUrl` parameter points to the correct, authenticated database instance.
|
|
78
|
+
|
|
79
|
+
### Missing CSS or Vendor Files
|
|
80
|
+
|
|
81
|
+
If the dashboard UI appears entirely unstyled, the static router failed to locate the `@ambientcss` package.
|
|
82
|
+
|
|
83
|
+
* **Fix:** Ensure you have fully run `npm install` within the PostClaw plugin directory, as the dashboard serves these dependencies directly from the `node_modules` folder.
|
|
84
|
+
|
|
85
|
+
### Persona Updates Fail Meaninglessly (Browser Console: 500)
|
|
86
|
+
|
|
87
|
+
When editing a persona's content in the dashboard, the backend route (`routes/personas.ts`) immediately requests a new vector embedding for the updated text. If your LLM embedding server (e.g., LM Studio/Ollama) has crashed or timed out, the dashboard's API request will fail with a 500 Internal Server Error.
|
|
88
|
+
|
|
89
|
+
* **Fix:** Ensure your external embedding provider is running and reachable at the REST endpoint defined in your OpenClaw configuration.
|