@yachiyo-5i/xlyra-agent 1.3.2 → 1.4.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 CHANGED
@@ -10,17 +10,17 @@
10
10
  <img src="https://img.shields.io/badge/license-AGPL--3.0-blue.svg" alt="License" />
11
11
  <img src="https://img.shields.io/badge/runtime-Node.js%2022%2B-339933.svg" alt="Runtime" />
12
12
  <img src="https://img.shields.io/badge/language-TypeScript-3178C6.svg" alt="Language" />
13
- <img src="https://img.shields.io/badge/protocols-OpenAI%20%7C%20Anthropic-6B5B95.svg" alt="Protocols" />
13
+ <img src="https://img.shields.io/badge/protocols-OpenAI%20Responses%20%7C%20Chat%20Completions%20%7C%20Anthropic-6B5B95.svg" alt="Protocols" />
14
14
  </p>
15
15
  </div>
16
16
 
17
- A streaming agent loop with OpenAI Responses and Anthropic Messages protocol adapters, sandboxed local tools, persistent sessions, and an optional REST/SSE service.
17
+ A streaming agent loop with OpenAI Responses, OpenAI Chat Completions, and Anthropic Messages protocol adapters, sandboxed local tools, persistent sessions, and an optional REST/SSE service.
18
18
 
19
19
 
20
20
  ## Features
21
21
 
22
22
  - **Streaming agent loop** — streams reasoning, text, tool calls, tool results, and terminal events through an async generator.
23
- - **Two LLM protocols** — supports OpenAI Responses and Anthropic Messages over direct HTTP with built-in SSE parsing.
23
+ - **Three LLM protocols** — supports OpenAI Responses, OpenAI Chat Completions, and Anthropic Messages over direct HTTP with built-in SSE parsing.
24
24
  - **Tool execution** — includes directory listing, file reading and search, file creation and editing, atomic writes, multi-file patches, and managed command processes.
25
25
  - **Safe concurrency** — runs consecutive read-only tools in parallel while preserving ordering barriers for writes and commands.
26
26
  - **Workspace sandbox** — blocks path traversal and symlink escapes; out-of-workspace access requires session-level approval.
@@ -148,7 +148,8 @@ Interactive configuration commands require a TTY. For automated environments, wr
148
148
  "default_model": "claude-sonnet-4-5",
149
149
  "models": {
150
150
  "claude-sonnet-4-5": {
151
- "context_window": 200000
151
+ "context_window": 200000,
152
+ "max_output_tokens": 64000
152
153
  }
153
154
  }
154
155
  },
@@ -158,6 +159,17 @@ Interactive configuration commands require a TTY. For automated environments, wr
158
159
  "base_url": "https://api.openai.com/v1",
159
160
  "api_key": "${OPENAI_API_KEY}",
160
161
  "default_model": "gpt-5"
162
+ },
163
+ {
164
+ "name": "openai-compatible",
165
+ "protocol": "openai-chat-completions",
166
+ "base_url": "https://api.example.com/v1",
167
+ "api_key": "${OPENAI_COMPATIBLE_API_KEY}",
168
+ "default_model": "o3-mini",
169
+ "chat_completions": {
170
+ "max_tokens_field": "max_completion_tokens",
171
+ "include_usage": false
172
+ }
161
173
  }
162
174
  ],
163
175
  "server": {
@@ -171,15 +183,27 @@ Interactive configuration commands require a TTY. For automated environments, wr
171
183
  "enable_command_execution": false,
172
184
  "enable_agents_md": true,
173
185
  "enable_skills": true,
174
- "skills_dirs": []
186
+ "skills_dirs": [],
187
+ "tool_profile": "full",
188
+ "compact_trigger_ratio": 0.9,
189
+ "max_steps": 200
175
190
  }
176
191
  }
177
192
  ```
178
193
 
179
194
  API keys support `${ENV_VAR}` interpolation. Configuration is validated at startup, and configuration writes use atomic replacement.
180
195
 
196
+ For OpenAI-compatible Chat Completions endpoints, `chat_completions.max_tokens_field` selects `max_tokens` (the default) or `max_completion_tokens`, and `chat_completions.include_usage` controls whether `stream_options.include_usage` is sent (the default is `true`). Set `include_usage` to `false` for older endpoints that reject `stream_options`.
197
+
181
198
  `enable_agents_md` / `enable_skills` default to enabled when omitted. Each run rescans the workdir. Opening an untrusted repository allows its `AGENTS.md` and project-level Skills to influence model instructions; command execution remains gated by `enable_command_execution` and escalation. Disable the corresponding flags if you only want user-level skills or no repository instructions.
182
199
 
200
+ `tool_profile` controls the exposed tool surface and defaults to `full`. `readonly` exposes listing, reading, searching (and `load_skill` when skills are available); `minimal` exposes only `read` and `search`. The profile is resolved for each run, so a configuration update takes effect without restarting the server.
201
+
202
+ `compact_trigger_ratio` is the automatic compaction watermark as a fraction of the model's context window (0–1, default `0.9`). The window size resolves from per-model `models.<model>.context_window`, then the global `agent.context_window`, then the built-in default of 200000 — compaction always applies once the watermark is reached, so an undersized estimate only compacts earlier rather than never. `max_output_tokens` declares the per-response output cap. Endpoint and agent configuration is re-read for each run: saving via `PUT /config` takes effect on the next run without restarting the server. A manual compaction can be triggered anytime with `POST /sessions/:id/compact-context`.
203
+
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
+ 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
+
183
207
  ### Start the Server
184
208
 
185
209
  ```bash
@@ -237,6 +261,8 @@ Without a token, the service is unauthenticated and must not be exposed to untru
237
261
 
238
262
  ## Built-in Tools
239
263
 
264
+ The runtime injects a capability map into the system prompt. Every tool keeps its JSON Schema, handler, safety annotations (`readOnly`, `parallelSafe`, approval/network hints), and optional capability metadata together. Tool failures can return a stable error code, retryability, next action, and host-only metadata; only the concise error text is sent back to the model.
265
+
240
266
  | Tool | Description |
241
267
  |---|---|
242
268
  | `list` | List files and directories with recursion and glob support |