Initial Netx Ops DSH agent preset (UME + managed CLI).

Portable persona and playbooks for DeepSeek Harness; tools via netx MCP.
This commit is contained in:
hansjone 2026-09-04 21:22:25 +08:00
commit 6677e36424
18 changed files with 746 additions and 0 deletions

58
docs/INSTALL.md Normal file
View file

@ -0,0 +1,58 @@
# Install Netx Ops on DeepSeek Harness
## Prerequisites
1. **DeepSeek Harness** (`dsh`) installed or a local checkout (see [local debug](../examples/local-debug/README.md)).
2. **netx API** reachable (default `http://127.0.0.1:8890`).
3. **Python 3.11+** on the same machine as `dsh`, with `netx_mcp` importable:
```powershell
pip install "git+https://github.com/hansjone/netx.git#subdirectory=packages/netx-mcp"
python -c "import netx_mcp; print('ok')"
```
4. Environment (optional if defaults match):
| Variable | Default | Purpose |
|----------|---------|---------|
| `NETX_API_URL` | `http://127.0.0.1:8890` | netx REST root |
| `NETX_API_TOKEN` | (empty / auto file) | Bearer token |
| `NETX_LANG` | `zh` | API locale |
## Install the agent preset (recommended)
Clone this repo, then link or copy the preset directory into the DSH user preset root:
```powershell
git clone https://github.com/hansjone/netxops.git
# Windows (developer junction — editable in place):
powershell -File .\scripts\link-preset.ps1
# Or copy:
# Copy-Item -Recurse .\presets\netxops $env:USERPROFILE\.dsh\.agent-presets\netxops
```
Unix:
```bash
git clone https://github.com/hansjone/netxops.git
./scripts/link-preset.sh
# Or: cp -R presets/netxops ~/.dsh/.agent-presets/netxops
```
Restart / open `dsh web`, create a session, choose preset **Netx Ops** (`netxops`).
## Optional: `dsh plugin add`
```bash
dsh plugin --profile <name> add github:hansjone/netxops
```
v1’s host `cordis.patch.yml` is empty (MCP stays inside the preset). You still need the preset link/copy above.
## Verify
1. Session tools include `mcp__netx__queryUmeAlarms` (and siblings).
2. Ask: “Critical Top 10 by host” → expect `aggregateUmeAlarms` + Result/Evidence shell.
3. Ask a single `host_name` alarm query → host-scoped tools only.
See [TOOL_MAP.md](TOOL_MAP.md).

23
docs/PORTING.md Normal file
View file

@ -0,0 +1,23 @@
# Porting notes (oclaw → netxops)
## In v1
| Source (oclaw) | Destination |
|----------------|-------------|
| `runtime/workspaces/ops/ROLE_SYSTEM.md` | `presets/netxops/PERSONA.md` + persona text in `agent.cordis.yml` (brand **Netx Ops**) |
| `skills/_workspace/ops/ops-netx-ume-playbook/` | `presets/netxops/skills/ops-netx-ume-playbook/` |
| `skills/_workspace/ops/ops-netx-managed-ne-playbook/` | `presets/netxops/skills/ops-netx-managed-ne-playbook/` |
| netx MCP contract | `agent.cordis.yml` → `dsh-mcp-client` |
Adaptations: removed oclaw Admin / WhatsApp / `ume_alarm_xlsx_report` / wiki capture / skill_auto_install lanes; fiber/offline recipes use Raw/aggregate MCP only.
## Stay in oclaw
Gateway, WhatsApp/Weixin, Admin MCP UI, specialist router, memory-wiki, ops-ai HTTP, schedulers.
## Phase 2 candidates
- `ume_alarm_xlsx_report` + thin HTTP client as a DSH tool plugin
- UME sync context inject
- `ops-ip-knowledge-playbook` + KB content
- `netx-topology` MCP + topology skill

28
docs/TOOL_MAP.md Normal file
View file

@ -0,0 +1,28 @@
# Netx MCP tool map (v1)
Tools are registered by `@deepseek-ai/dsh-mcp-client` with `serverName: netx`.
Model-facing name: `mcp__netx__<tool>`.
| Tool | Role |
|------|------|
| `queryUmeAlarms` | Paged current alarms |
| `aggregateUmeAlarms` | Severity / Top NE aggregate |
| `runUmeDiagnostics` | Diagnostics + freshness meta |
| `queryUmeNeInventory` | UME NE list |
| `getUmeNe` | Single UME NE detail |
| `queryUmeAlarmsRaw` | Raw / evidence fields |
| `aggregateUmeAlarmsRaw` | Dynamic group_by |
| `listUmeAlarmFields` | Field catalog |
| `sqlQueryUme` | Read-only SELECT |
| `findTopologyPaths` | Shortest path between UME NEs (path query only; no canvas layout in v1) |
| `listManagedNe` | Managed device list |
| `getManagedNe` | Managed device detail |
| `execManagedNe` | Read-only CLI (batch-first) |
| `listCliTargets` | CLI target index (managed + ume) |
stdio entry: `python -m netx_mcp` → HTTP `NETX_API_URL`.
Upstream package: [netx `packages/netx-mcp`](https://github.com/hansjone/netx/tree/main/packages/netx-mcp).
**Out of v1:** `netx-topology` MCP / topology canvas skills.