omnius 1.0.342 → 1.0.344
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 +41 -1
- package/dist/index.js +2256 -740
- package/docs/reference/rest-api.md +4 -1
- package/npm-shrinkwrap.json +16 -15
- package/package.json +17 -2
package/README.md
CHANGED
|
@@ -225,13 +225,53 @@ The complete endpoint inventory follows. It is kept in lockstep with the served
|
|
|
225
225
|
| `GET` | `/v1/skills` · `/v1/skills/{name}` | List · load skill content |
|
|
226
226
|
| `GET` | `/v1/commands` | List slash commands |
|
|
227
227
|
| `POST` | `/v1/commands/{cmd}` | Execute slash command |
|
|
228
|
-
| `GET` | `/v1/tools` · `/v1/tools/{name}` | List · tool metadata |
|
|
228
|
+
| `GET` | `/v1/tools` · `/v1/tools/{name}` | List (built-in + external) · tool metadata |
|
|
229
|
+
| `POST` | `/v1/tools/register` | Register an application-specific external tool |
|
|
230
|
+
| `DELETE` | `/v1/tools/{name}` | Unregister an external tool |
|
|
229
231
|
| `POST` | `/v1/tools/{name}/call` | Call tool |
|
|
232
|
+
| `POST` | `/v1/tools/{name}/eval` | Evaluate an external tool against test cases |
|
|
230
233
|
| `GET` | `/v1/mcps` · `/v1/mcps/{name}` | List · MCP server details |
|
|
231
234
|
| `POST` | `/v1/mcps/{name}/call` | Call MCP tool |
|
|
232
235
|
| `GET` | `/v1/hooks` · `/v1/agents` | Hook registry · agent type registry |
|
|
233
236
|
| `GET` | `/v1/codegraph/snapshot` · `/v1/codegraph/events` | Code graph snapshot · SSE |
|
|
234
237
|
|
|
238
|
+
### Registering application-specific tools
|
|
239
|
+
|
|
240
|
+
Agents integrating Omnius into their own stack can register tools at runtime so the Omnius agent loop can call them alongside built-ins. Registration is a single unified contract — `transport.type` selects how Omnius reaches the implementation:
|
|
241
|
+
|
|
242
|
+
- **`http`** — Omnius POSTs `{name, args, session_id}` to a `callback_url` your app hosts and relays the response.
|
|
243
|
+
- **`mcp`** — the tool proxies to a named tool on an MCP server (auto-connected when you pass `connect`).
|
|
244
|
+
|
|
245
|
+
Registered tools are persisted per working directory (`.omnius/external-tools.json`), surface in `GET /v1/tools`, and respect the same scope/off-device security gate as built-ins. Registration needs `run` scope (remote callers need `admin`).
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
# Register an HTTP-backed tool
|
|
249
|
+
curl -s -X POST localhost:11435/v1/tools/register -H 'content-type: application/json' -d '{
|
|
250
|
+
"name": "lookup_order",
|
|
251
|
+
"description": "Look up an order by id in the billing system",
|
|
252
|
+
"parameters": {"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},
|
|
253
|
+
"security": {"requires_scope":"run","risk":"low"},
|
|
254
|
+
"transport": {"type":"http","callback_url":"https://app.internal/tools/lookup_order","auth_header":"Bearer …"}
|
|
255
|
+
}'
|
|
256
|
+
|
|
257
|
+
# It now appears in the registry and is directly callable
|
|
258
|
+
curl -s localhost:11435/v1/tools/lookup_order
|
|
259
|
+
curl -s -X POST localhost:11435/v1/tools/lookup_order/call -H 'content-type: application/json' -d '{"args":{"id":"A-1001"}}'
|
|
260
|
+
|
|
261
|
+
# Evaluate it against cases during development (pass/fail + metrics)
|
|
262
|
+
curl -s -X POST localhost:11435/v1/tools/lookup_order/eval -H 'content-type: application/json' -d '{
|
|
263
|
+
"cases": [
|
|
264
|
+
{"name":"known order","args":{"id":"A-1001"},"expect":{"success":true,"output_contains":"A-1001"}},
|
|
265
|
+
{"name":"missing order","args":{"id":"nope"},"expect":{"success":false}}
|
|
266
|
+
]
|
|
267
|
+
}'
|
|
268
|
+
|
|
269
|
+
# Unregister when done
|
|
270
|
+
curl -s -X DELETE localhost:11435/v1/tools/lookup_order
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
The same registration accepts an MCP transport, e.g. `"transport":{"type":"mcp","server":"acme","tool":"search","connect":{"url":"https://app.internal/mcp","transport":"streamable-http"}}`.
|
|
274
|
+
|
|
235
275
|
### AIWG
|
|
236
276
|
|
|
237
277
|
| Method | Path | Purpose |
|