@agent-e/server 1.5.13 → 1.6.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/README.md +87 -0
- package/dist/AgentEServer-H3FWDCYM.mjs +7 -0
- package/dist/chunk-OALXQFKY.mjs +1574 -0
- package/dist/chunk-OALXQFKY.mjs.map +1 -0
- package/dist/cli.js +1065 -6
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1069 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/AgentEServer-CBG5JMN4.mjs +0 -7
- package/dist/chunk-OXHIY4RU.mjs +0 -515
- package/dist/chunk-OXHIY4RU.mjs.map +0 -1
- /package/dist/{AgentEServer-CBG5JMN4.mjs.map → AgentEServer-H3FWDCYM.mjs.map} +0 -0
package/README.md
CHANGED
|
@@ -31,6 +31,93 @@ const server = new AgentEServer({
|
|
|
31
31
|
await server.start();
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
+
## Dashboard
|
|
35
|
+
|
|
36
|
+
The server includes a built-in developer dashboard at `GET /`. Start the server and open `http://localhost:3100` in your browser.
|
|
37
|
+
|
|
38
|
+
The dashboard shows:
|
|
39
|
+
- **Health & Metrics** — real-time line charts for economy health, gini, net flow, satisfaction
|
|
40
|
+
- **Decision Feed** — terminal-style log of every AgentE decision
|
|
41
|
+
- **Active Alerts** — live violation cards sorted by severity
|
|
42
|
+
- **Violation History** — sortable table of all past violations
|
|
43
|
+
- **Persona Distribution** — horizontal bar chart of agent archetypes
|
|
44
|
+
- **Parameter Registry** — tracked principles
|
|
45
|
+
|
|
46
|
+
The dashboard connects via WebSocket for real-time updates, with HTTP polling fallback when WebSocket is unavailable.
|
|
47
|
+
|
|
48
|
+
To disable the dashboard:
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
const server = new AgentEServer({
|
|
52
|
+
serveDashboard: false,
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Advisor Mode
|
|
57
|
+
|
|
58
|
+
In advisor mode, AgentE recommends parameter changes but does not apply them. Use the dashboard or HTTP API to approve or reject recommendations.
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
const server = new AgentEServer({
|
|
62
|
+
agentE: { mode: 'advisor' },
|
|
63
|
+
});
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### GET /pending
|
|
67
|
+
|
|
68
|
+
List pending recommendations waiting for approval.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
curl http://localhost:3100/pending
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"mode": "advisor",
|
|
77
|
+
"pending": [{ "id": "decision_100_trade_tax", "tick": 100, ... }],
|
|
78
|
+
"count": 1
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### POST /approve
|
|
83
|
+
|
|
84
|
+
Approve a pending recommendation. AgentE will apply the parameter change.
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
curl -X POST http://localhost:3100/approve \
|
|
88
|
+
-H 'Content-Type: application/json' \
|
|
89
|
+
-d '{"decisionId": "decision_100_trade_tax"}'
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### POST /reject
|
|
93
|
+
|
|
94
|
+
Reject a pending recommendation with an optional reason.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
curl -X POST http://localhost:3100/reject \
|
|
98
|
+
-H 'Content-Type: application/json' \
|
|
99
|
+
-d '{"decisionId": "decision_100_trade_tax", "reason": "too aggressive"}'
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### GET /metrics
|
|
103
|
+
|
|
104
|
+
Latest metrics snapshot plus recent history for charting.
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"latest": { "tick": 100, "giniCoefficient": 0.35, ... },
|
|
109
|
+
"history": [{ "tick": 1, "health": 100, "giniCoefficient": 0.0, ... }, ...]
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### GET /metrics/personas
|
|
114
|
+
|
|
115
|
+
Persona distribution from the latest metrics.
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{ "distribution": { "Whale": 3, "ActiveTrader": 12, ... }, "total": 50 }
|
|
119
|
+
```
|
|
120
|
+
|
|
34
121
|
## API Reference
|
|
35
122
|
|
|
36
123
|
### POST /tick
|