[grade=A] AI Intent Router — natural language → structured actions
CI / Test & Lint (push) Canceled after 0s
CI / Security audit (push) Canceled after 0s

POST /api/v1/ai/intent takes natural language and returns structured intent:
- 'Deploy Plex' → { intent: deploy, appId: plex, deployPlan }
- 'I want to stream movies' → { intent: recommend, categories: [media-streaming] }
- 'Why is Plex down?' → { intent: diagnose, serviceId: plex }
- 'Back up everything' → { intent: backup }
- 'Is everything OK?' → { intent: health }

GET /api/v1/ai/capabilities returns self-describing capabilities for agent discovery.

Pattern-based matching works offline (no LLM call needed). LLM_PROXY_URL env
var can be set for complex query delegation.

18 intent tests covering deploy, recommend, diagnose, backup, health, list,
and unknown intents. 1770 total tests pass.
This commit is contained in:
Hermes
2026-08-12 16:32:44 -07:00
parent 8f4883bfcd
commit 87dd2712a0
3 changed files with 464 additions and 0 deletions
+6
View File
@@ -68,6 +68,7 @@ const wizardRoutes = require('../routes/wizard');
const disasterRoutes = require('../routes/disaster-recovery');
const caddycodeRoutes = require('../routes/caddycode');
const fleetRoutes = require('../routes/fleet');
const aiIntentRoutes = require('../routes/ai-intent');
const configRoutes = require('../routes/config');
const dnsRoutes = require('../routes/dns');
const notificationRoutes = require('../routes/notifications');
@@ -655,6 +656,11 @@ async function createApp() {
log: ctx.log,
asyncHandler: ctx.asyncHandler,
}));
// AI-Native: Natural language intent router + MCP discovery
apiRouter.use(aiIntentRoutes({
asyncHandler: ctx.asyncHandler,
}));
apiRouter.use(updatesRoutes({
updateManager: ctx.updateManager,
selfUpdater: ctx.selfUpdater,