@yachiyo-5i/xlyra-agent 1.5.0 → 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 +60 -3
- package/dist/{chunk-JTYI7NWG.js → chunk-UOMXA3E5.js} +4365 -714
- package/dist/chunk-UOMXA3E5.js.map +1 -0
- package/dist/cli.cjs +6339 -2713
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +4545 -810
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +756 -137
- package/dist/index.d.ts +756 -137
- package/dist/index.js +109 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-JTYI7NWG.js.map +0 -1
package/README.md
CHANGED
|
@@ -204,6 +204,44 @@ For OpenAI-compatible Chat Completions endpoints, `chat_completions.max_tokens_f
|
|
|
204
204
|
`max_steps` caps a single run's steps (one model reply plus its tool executions), default `200`, maximum `1000`. The budget is declared in the system prompt and reported at 50/80/95% milestones; when the runner detects repeated identical calls or near-identical tool outputs it injects a nudge message (and emits `stall_detected` / `budget_notice` SSE events) instead of hard-stopping the run.
|
|
205
205
|
Session requests accept up to four attachments, with a 16 MiB limit per attachment and 32 MiB total; the HTTP request body is capped at 36 MiB.
|
|
206
206
|
|
|
207
|
+
### Learning
|
|
208
|
+
|
|
209
|
+
The optional `learning` section controls background review, persistent memory, managed Skill learning, and lifecycle maintenance. All fields have defaults:
|
|
210
|
+
|
|
211
|
+
```json
|
|
212
|
+
{
|
|
213
|
+
"learning": {
|
|
214
|
+
"background_review_enabled": true,
|
|
215
|
+
"max_input_tokens": 600000,
|
|
216
|
+
"max_steps": 16,
|
|
217
|
+
"memory": {
|
|
218
|
+
"enabled": true,
|
|
219
|
+
"user_profile_enabled": true,
|
|
220
|
+
"nudge_interval": 10
|
|
221
|
+
},
|
|
222
|
+
"skills": {
|
|
223
|
+
"enabled": true,
|
|
224
|
+
"nudge_interval": 10
|
|
225
|
+
},
|
|
226
|
+
"curator": {
|
|
227
|
+
"enabled": true,
|
|
228
|
+
"interval_hours": 168,
|
|
229
|
+
"min_idle_hours": 2,
|
|
230
|
+
"stale_after_days": 30,
|
|
231
|
+
"archive_after_days": 90
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Counter thresholds are Agent-wide and accumulate across sessions, so scattered short sessions still trigger review. Background review never writes to the interactive transcript. Background work cannot modify pinned Skills; a foreground user can explicitly `adopt` a user-owned Skill before allowing background maintenance. `POST /learning/curator/consolidate` with `dry_run: true` writes for real but takes a snapshot first, so the whole run can be rolled back via `/learning/curator/consolidate/restore`.
|
|
238
|
+
|
|
239
|
+
Each integration surface is a channel. The current xLyra frontend uses the `main` channel; a Telegram Bot, WeChat Bot, or another frontend can create the server with its own stable channel id, for example `telegram:123456`. Each channel gets an isolated Agent root under `~/.xlyra-agent/agents/`, including its workspace, sessions, Skills, learning state, and memory. The public API paths stay the same; an integration selects its channel when constructing the server.
|
|
240
|
+
|
|
241
|
+
```ts
|
|
242
|
+
createAgentServer(config, { dataDir, channel: "telegram:123456" });
|
|
243
|
+
```
|
|
244
|
+
|
|
207
245
|
Network tools are registered by default. `web_search` uses DuckDuckGo out of the box; add the top-level `web_search` section only to switch providers — `brave` and `tavily` require `api_key` (supports `${ENV_VAR}`). `web_fetch` returns cleaned, bounded body text (long pages are explicitly marked as truncated) with SSRF protection; private/loopback addresses are rejected unless `agent.web_fetch_allow_private_network: true` is set. Web content is reference material only and must not be treated as instructions; both tools are marked as network capabilities in the system prompt's capability map. Network-tool settings and provider credentials take effect on the next run after `PUT /config`. The SSRF guard resolves and validates the hostname before each request, while the connection itself performs a second, independent DNS resolution — DNS rebinding is therefore a theoretical gap; the guard keeps the model from being steered to internal addresses and does not replace network-level isolation. `duckduckgo` is a free web endpoint with no stability guarantee (it may be rate-limited or change layout; the tool reports an explicit error when hit) — for production use, configure `brave` or `tavily`.
|
|
208
246
|
|
|
209
247
|
### Start the Server
|
|
@@ -229,11 +267,23 @@ Runtime data is stored under `~/.xlyra-agent/`:
|
|
|
229
267
|
```text
|
|
230
268
|
~/.xlyra-agent/
|
|
231
269
|
├── config.json
|
|
232
|
-
|
|
233
|
-
├──
|
|
234
|
-
|
|
270
|
+
└── agents/
|
|
271
|
+
├── main/
|
|
272
|
+
│ ├── SOUL.md
|
|
273
|
+
│ ├── AGENTS.md
|
|
274
|
+
│ ├── USER.md
|
|
275
|
+
│ ├── MEMORY.md
|
|
276
|
+
│ ├── memory/<topic>.md
|
|
277
|
+
│ ├── sessions/
|
|
278
|
+
│ ├── skills/
|
|
279
|
+
│ ├── learning/
|
|
280
|
+
│ └── workspace/
|
|
281
|
+
└── channel-<sha256>/
|
|
282
|
+
└── ...
|
|
235
283
|
```
|
|
236
284
|
|
|
285
|
+
Existing single-Agent data is migrated into `agents/main/` on first startup and the original files are retained. `MEMORY.md` contains a short summary and topic index. Detailed memory is stored in `memory/<topic>.md` and can be read, listed, searched, or paged through the `memory` tool; detailed topics are not injected into every prompt.
|
|
286
|
+
|
|
237
287
|
### HTTP API
|
|
238
288
|
|
|
239
289
|
| Method | Path | Description |
|
|
@@ -252,6 +302,13 @@ Runtime data is stored under `~/.xlyra-agent/`:
|
|
|
252
302
|
| `GET` | `/config` | Read the configuration with masked API keys |
|
|
253
303
|
| `PUT` | `/config` | Validate and save the configuration |
|
|
254
304
|
| `POST` | `/config/test` | Test an endpoint with a minimal model request |
|
|
305
|
+
| `GET` | `/memory` | Read persistent memory (`MEMORY.md` and `USER.md`) |
|
|
306
|
+
| `PUT` | `/memory/:target` | Overwrite a memory target (`memory` or `user`) |
|
|
307
|
+
| `GET` | `/model-memory` | Read each session's last used model and the new-session default |
|
|
308
|
+
| `GET` | `/learning/status`, `/learning/reviews` | Read learning state and background-review history |
|
|
309
|
+
| `POST` | `/learning/review` | Queue a background review |
|
|
310
|
+
| `GET` / `POST` | `/learning/curator/*` | Inspect, run, restore, and consolidate managed Skills |
|
|
311
|
+
| `POST` / `GET` | `/skills/learn`, `/learning/learns` | Submit manual Skill learning and inspect its history |
|
|
255
312
|
|
|
256
313
|
When `server.token` is configured, requests must include:
|
|
257
314
|
|