mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage-server
synced 2026-04-11 18:08:16 +00:00
feat: rules engine — json-rules-engine integration with worklist scoring
- Self-contained NestJS module: types, storage (Redis+JSON), fact providers, action handlers - PriorityConfig CRUD (slider values for task weights, campaign weights, source weights) - Score action handler with SLA multiplier + campaign multiplier formula - Worklist consumer: scores and ranks items before returning - Hospital starter template (7 rules) - REST API: /api/rules/* (CRUD, priority-config, evaluate, templates) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
18
src/rules-engine/facts/agent-facts.provider.ts
Normal file
18
src/rules-engine/facts/agent-facts.provider.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
// src/rules-engine/facts/agent-facts.provider.ts
|
||||
|
||||
import type { FactProvider, FactValue } from '../types/fact.types';
|
||||
|
||||
export class AgentFactsProvider implements FactProvider {
|
||||
name = 'agent';
|
||||
|
||||
async resolveFacts(agent: any): Promise<Record<string, FactValue>> {
|
||||
return {
|
||||
'agent.status': agent.status ?? 'OFFLINE',
|
||||
'agent.activeCallCount': agent.activeCallCount ?? 0,
|
||||
'agent.todayCallCount': agent.todayCallCount ?? 0,
|
||||
'agent.skills': agent.skills ?? [],
|
||||
'agent.campaigns': agent.campaigns ?? [],
|
||||
'agent.idleMinutes': agent.idleMinutes ?? 0,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user