@trentapps/manager-protocol 1.1.1
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/LICENSE +21 -0
- package/README.md +446 -0
- package/dist/analyzers/ArchitectureDetector.d.ts +44 -0
- package/dist/analyzers/ArchitectureDetector.d.ts.map +1 -0
- package/dist/analyzers/ArchitectureDetector.js +218 -0
- package/dist/analyzers/ArchitectureDetector.js.map +1 -0
- package/dist/analyzers/CSSAnalyzer.d.ts +104 -0
- package/dist/analyzers/CSSAnalyzer.d.ts.map +1 -0
- package/dist/analyzers/CSSAnalyzer.js +578 -0
- package/dist/analyzers/CSSAnalyzer.js.map +1 -0
- package/dist/analyzers/index.d.ts +5 -0
- package/dist/analyzers/index.d.ts.map +1 -0
- package/dist/analyzers/index.js +5 -0
- package/dist/analyzers/index.js.map +1 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +174 -0
- package/dist/cli.js.map +1 -0
- package/dist/design-system/index.d.ts +6 -0
- package/dist/design-system/index.d.ts.map +1 -0
- package/dist/design-system/index.js +6 -0
- package/dist/design-system/index.js.map +1 -0
- package/dist/design-system/tokens.d.ts +106 -0
- package/dist/design-system/tokens.d.ts.map +1 -0
- package/dist/design-system/tokens.js +554 -0
- package/dist/design-system/tokens.js.map +1 -0
- package/dist/engine/AppMonitor.d.ts +162 -0
- package/dist/engine/AppMonitor.d.ts.map +1 -0
- package/dist/engine/AppMonitor.js +754 -0
- package/dist/engine/AppMonitor.js.map +1 -0
- package/dist/engine/AuditLogger.d.ts +138 -0
- package/dist/engine/AuditLogger.d.ts.map +1 -0
- package/dist/engine/AuditLogger.js +448 -0
- package/dist/engine/AuditLogger.js.map +1 -0
- package/dist/engine/GitHubApprovalManager.d.ts +106 -0
- package/dist/engine/GitHubApprovalManager.d.ts.map +1 -0
- package/dist/engine/GitHubApprovalManager.js +315 -0
- package/dist/engine/GitHubApprovalManager.js.map +1 -0
- package/dist/engine/RateLimiter.d.ts +79 -0
- package/dist/engine/RateLimiter.d.ts.map +1 -0
- package/dist/engine/RateLimiter.js +232 -0
- package/dist/engine/RateLimiter.js.map +1 -0
- package/dist/engine/RulesEngine.d.ts +77 -0
- package/dist/engine/RulesEngine.d.ts.map +1 -0
- package/dist/engine/RulesEngine.js +400 -0
- package/dist/engine/RulesEngine.js.map +1 -0
- package/dist/engine/TaskManager.d.ts +173 -0
- package/dist/engine/TaskManager.d.ts.map +1 -0
- package/dist/engine/TaskManager.js +678 -0
- package/dist/engine/TaskManager.js.map +1 -0
- package/dist/engine/index.d.ts +9 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/index.js +9 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/rules/architecture.d.ts +9 -0
- package/dist/rules/architecture.d.ts.map +1 -0
- package/dist/rules/architecture.js +322 -0
- package/dist/rules/architecture.js.map +1 -0
- package/dist/rules/azure.d.ts +7 -0
- package/dist/rules/azure.d.ts.map +1 -0
- package/dist/rules/azure.js +138 -0
- package/dist/rules/azure.js.map +1 -0
- package/dist/rules/compliance.d.ts +9 -0
- package/dist/rules/compliance.d.ts.map +1 -0
- package/dist/rules/compliance.js +304 -0
- package/dist/rules/compliance.js.map +1 -0
- package/dist/rules/css.d.ts +10 -0
- package/dist/rules/css.d.ts.map +1 -0
- package/dist/rules/css.js +1239 -0
- package/dist/rules/css.js.map +1 -0
- package/dist/rules/flask.d.ts +7 -0
- package/dist/rules/flask.d.ts.map +1 -0
- package/dist/rules/flask.js +155 -0
- package/dist/rules/flask.js.map +1 -0
- package/dist/rules/index.d.ts +607 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +401 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/ml-ai.d.ts +7 -0
- package/dist/rules/ml-ai.d.ts.map +1 -0
- package/dist/rules/ml-ai.js +150 -0
- package/dist/rules/ml-ai.js.map +1 -0
- package/dist/rules/operational.d.ts +9 -0
- package/dist/rules/operational.d.ts.map +1 -0
- package/dist/rules/operational.js +318 -0
- package/dist/rules/operational.js.map +1 -0
- package/dist/rules/security.d.ts +9 -0
- package/dist/rules/security.d.ts.map +1 -0
- package/dist/rules/security.js +287 -0
- package/dist/rules/security.js.map +1 -0
- package/dist/rules/storage.d.ts +7 -0
- package/dist/rules/storage.d.ts.map +1 -0
- package/dist/rules/storage.js +134 -0
- package/dist/rules/storage.js.map +1 -0
- package/dist/rules/stripe.d.ts +7 -0
- package/dist/rules/stripe.d.ts.map +1 -0
- package/dist/rules/stripe.js +140 -0
- package/dist/rules/stripe.js.map +1 -0
- package/dist/rules/testing.d.ts +7 -0
- package/dist/rules/testing.d.ts.map +1 -0
- package/dist/rules/testing.js +135 -0
- package/dist/rules/testing.js.map +1 -0
- package/dist/rules/ux.d.ts +9 -0
- package/dist/rules/ux.d.ts.map +1 -0
- package/dist/rules/ux.js +280 -0
- package/dist/rules/ux.js.map +1 -0
- package/dist/rules/websocket.d.ts +7 -0
- package/dist/rules/websocket.d.ts.map +1 -0
- package/dist/rules/websocket.js +136 -0
- package/dist/rules/websocket.js.map +1 -0
- package/dist/server.d.ts +49 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +2330 -0
- package/dist/server.js.map +1 -0
- package/dist/supervisor/AgentSupervisor.d.ts +235 -0
- package/dist/supervisor/AgentSupervisor.d.ts.map +1 -0
- package/dist/supervisor/AgentSupervisor.js +596 -0
- package/dist/supervisor/AgentSupervisor.js.map +1 -0
- package/dist/supervisor/ManagedServerRegistry.d.ts +48 -0
- package/dist/supervisor/ManagedServerRegistry.d.ts.map +1 -0
- package/dist/supervisor/ManagedServerRegistry.js +145 -0
- package/dist/supervisor/ManagedServerRegistry.js.map +1 -0
- package/dist/supervisor/ProjectTracker.d.ts +188 -0
- package/dist/supervisor/ProjectTracker.d.ts.map +1 -0
- package/dist/supervisor/ProjectTracker.js +617 -0
- package/dist/supervisor/ProjectTracker.js.map +1 -0
- package/dist/supervisor/index.d.ts +6 -0
- package/dist/supervisor/index.d.ts.map +1 -0
- package/dist/supervisor/index.js +6 -0
- package/dist/supervisor/index.js.map +1 -0
- package/dist/types/index.d.ts +1176 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +391 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/errors.d.ts +86 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +171 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/shell.d.ts +22 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +29 -0
- package/dist/utils/shell.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,596 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enterprise Agent Supervisor - Main Supervisor Class
|
|
3
|
+
*
|
|
4
|
+
* Orchestrates all governance components for agent supervision.
|
|
5
|
+
*/
|
|
6
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
7
|
+
import { RulesEngine } from '../engine/RulesEngine.js';
|
|
8
|
+
import { RateLimiter } from '../engine/RateLimiter.js';
|
|
9
|
+
import { AuditLogger } from '../engine/AuditLogger.js';
|
|
10
|
+
import { GitHubApprovalManager } from '../engine/GitHubApprovalManager.js';
|
|
11
|
+
import { AppMonitor } from '../engine/AppMonitor.js';
|
|
12
|
+
import { ArchitectureDetector } from '../analyzers/ArchitectureDetector.js';
|
|
13
|
+
import { allBuiltInRules, defaultRateLimits, rulePresets } from '../rules/index.js';
|
|
14
|
+
export class AgentSupervisor {
|
|
15
|
+
config;
|
|
16
|
+
rulesEngine;
|
|
17
|
+
rateLimiter;
|
|
18
|
+
auditLogger;
|
|
19
|
+
approvalManager;
|
|
20
|
+
appMonitor;
|
|
21
|
+
initialized = false;
|
|
22
|
+
constructor(options = {}) {
|
|
23
|
+
// Initialize with defaults
|
|
24
|
+
this.config = this.buildConfig(options.config);
|
|
25
|
+
this.rulesEngine = new RulesEngine();
|
|
26
|
+
this.rateLimiter = new RateLimiter();
|
|
27
|
+
this.auditLogger = new AuditLogger(options.auditOptions);
|
|
28
|
+
this.approvalManager = new GitHubApprovalManager(options.approvalOptions);
|
|
29
|
+
this.appMonitor = new AppMonitor(options.appMonitorOptions);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Initialize the supervisor with configuration
|
|
33
|
+
*/
|
|
34
|
+
async initialize(preset) {
|
|
35
|
+
if (this.initialized) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
// Initialize audit logger (loads from file if configured)
|
|
39
|
+
await this.auditLogger.initialize();
|
|
40
|
+
// Load preset if specified
|
|
41
|
+
if (preset && rulePresets[preset]) {
|
|
42
|
+
const presetConfig = rulePresets[preset];
|
|
43
|
+
this.rulesEngine.registerRules(presetConfig.rules);
|
|
44
|
+
this.rateLimiter.registerLimits(presetConfig.rateLimits);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
// Load from config
|
|
48
|
+
this.rulesEngine.registerRules(this.config.rules);
|
|
49
|
+
this.rateLimiter.registerLimits(this.config.rateLimits);
|
|
50
|
+
}
|
|
51
|
+
// Log initialization
|
|
52
|
+
await this.auditLogger.log({
|
|
53
|
+
eventType: 'system_event',
|
|
54
|
+
action: 'supervisor_initialized',
|
|
55
|
+
outcome: 'success',
|
|
56
|
+
details: {
|
|
57
|
+
environment: this.config.environment,
|
|
58
|
+
rulesLoaded: this.rulesEngine.getRules().length,
|
|
59
|
+
rateLimitsLoaded: this.rateLimiter.getConfigs().length,
|
|
60
|
+
preset
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
this.initialized = true;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Evaluate an agent action
|
|
67
|
+
* Main entry point for action governance
|
|
68
|
+
*/
|
|
69
|
+
async evaluateAction(action, context) {
|
|
70
|
+
await this.ensureInitialized();
|
|
71
|
+
const actionId = action.id || uuidv4();
|
|
72
|
+
const enrichedAction = { ...action, id: actionId };
|
|
73
|
+
// Check rate limits first
|
|
74
|
+
if (this.config.features.rateLimiting) {
|
|
75
|
+
const rateLimitCheck = this.rateLimiter.checkLimit({
|
|
76
|
+
agentId: context?.agentId || action.agentId,
|
|
77
|
+
sessionId: context?.sessionId || action.sessionId,
|
|
78
|
+
userId: context?.userId,
|
|
79
|
+
actionCategory: action.category,
|
|
80
|
+
actionType: action.name
|
|
81
|
+
});
|
|
82
|
+
if (!rateLimitCheck.allowed) {
|
|
83
|
+
await this.auditLogger.logRateLimitHit(action.name, rateLimitCheck.limitId, action.agentId);
|
|
84
|
+
return {
|
|
85
|
+
actionId,
|
|
86
|
+
status: 'rate_limited',
|
|
87
|
+
riskScore: 0,
|
|
88
|
+
riskLevel: 'minimal',
|
|
89
|
+
allowed: false,
|
|
90
|
+
violations: [],
|
|
91
|
+
warnings: [`Rate limit exceeded: ${rateLimitCheck.limitId}`],
|
|
92
|
+
appliedRules: [],
|
|
93
|
+
requiresHumanApproval: false,
|
|
94
|
+
rateLimitInfo: rateLimitCheck.state ? {
|
|
95
|
+
limited: true,
|
|
96
|
+
remaining: rateLimitCheck.state.remaining,
|
|
97
|
+
resetAt: rateLimitCheck.state.resetAt
|
|
98
|
+
} : undefined,
|
|
99
|
+
evaluatedAt: new Date().toISOString()
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// Evaluate rules
|
|
104
|
+
const evaluation = this.rulesEngine.evaluateAction(enrichedAction, context);
|
|
105
|
+
// Check risk threshold for auto-approval requirement
|
|
106
|
+
if (this.config.features.humanApproval &&
|
|
107
|
+
evaluation.riskScore >= this.config.requireApprovalAboveRisk &&
|
|
108
|
+
!evaluation.requiresHumanApproval) {
|
|
109
|
+
evaluation.requiresHumanApproval = true;
|
|
110
|
+
evaluation.approvalReason = `Risk score (${evaluation.riskScore}) exceeds threshold (${this.config.requireApprovalAboveRisk})`;
|
|
111
|
+
evaluation.status = 'pending_approval';
|
|
112
|
+
}
|
|
113
|
+
// Strict mode enforcement
|
|
114
|
+
if (this.config.strictMode && evaluation.riskScore >= this.config.defaultRiskThreshold) {
|
|
115
|
+
evaluation.allowed = false;
|
|
116
|
+
evaluation.status = 'denied';
|
|
117
|
+
}
|
|
118
|
+
// Architecture change detection
|
|
119
|
+
if (this.config.features.architectureValidation) {
|
|
120
|
+
const archUpdate = ArchitectureDetector.detectChanges(enrichedAction, context);
|
|
121
|
+
if (archUpdate) {
|
|
122
|
+
evaluation.claudeMdUpdate = archUpdate;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// Record the request for rate limiting
|
|
126
|
+
if (this.config.features.rateLimiting) {
|
|
127
|
+
this.rateLimiter.recordRequest({
|
|
128
|
+
agentId: context?.agentId || action.agentId,
|
|
129
|
+
sessionId: context?.sessionId || action.sessionId,
|
|
130
|
+
userId: context?.userId,
|
|
131
|
+
actionCategory: action.category,
|
|
132
|
+
actionType: action.name
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
// Audit logging
|
|
136
|
+
if (this.config.features.auditLogging) {
|
|
137
|
+
await this.auditLogger.logActionEvaluated(action.name, evaluation.allowed ? 'success' : 'failure', {
|
|
138
|
+
actionId,
|
|
139
|
+
category: action.category,
|
|
140
|
+
riskScore: evaluation.riskScore,
|
|
141
|
+
riskLevel: evaluation.riskLevel,
|
|
142
|
+
status: evaluation.status,
|
|
143
|
+
violationCount: evaluation.violations.length,
|
|
144
|
+
rulesApplied: evaluation.appliedRules.length
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
return evaluation;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Apply business rules to a context
|
|
151
|
+
*/
|
|
152
|
+
async applyBusinessRules(context) {
|
|
153
|
+
await this.ensureInitialized();
|
|
154
|
+
const result = this.rulesEngine.applyBusinessRules(context);
|
|
155
|
+
if (this.config.features.auditLogging) {
|
|
156
|
+
await this.auditLogger.log({
|
|
157
|
+
eventType: 'action_evaluated',
|
|
158
|
+
action: 'apply_business_rules',
|
|
159
|
+
outcome: 'success',
|
|
160
|
+
agentId: context.agentId,
|
|
161
|
+
sessionId: context.sessionId,
|
|
162
|
+
userId: context.userId,
|
|
163
|
+
details: {
|
|
164
|
+
contextId: result.contextId,
|
|
165
|
+
rulesApplied: result.rulesApplied.length,
|
|
166
|
+
constraintsFound: result.constraints.length,
|
|
167
|
+
riskScore: result.aggregateRiskScore
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
return result;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Request human approval for an action via GitHub issue
|
|
175
|
+
*/
|
|
176
|
+
async requireHumanApproval(params) {
|
|
177
|
+
await this.ensureInitialized();
|
|
178
|
+
const actionId = params.actionId || `action-${Date.now()}`;
|
|
179
|
+
const detailsObj = typeof params.details === 'string'
|
|
180
|
+
? { description: params.details }
|
|
181
|
+
: params.details;
|
|
182
|
+
const approval = await this.approvalManager.createApprovalIssue({
|
|
183
|
+
repo: params.repo,
|
|
184
|
+
actionId,
|
|
185
|
+
action: params.action || 'Unspecified action',
|
|
186
|
+
reason: params.reason,
|
|
187
|
+
details: detailsObj,
|
|
188
|
+
priority: params.priority,
|
|
189
|
+
riskScore: params.riskScore,
|
|
190
|
+
violations: params.violations,
|
|
191
|
+
warnings: params.warnings,
|
|
192
|
+
context: params.context
|
|
193
|
+
});
|
|
194
|
+
// Log the approval request
|
|
195
|
+
await this.auditLogger.log({
|
|
196
|
+
eventType: 'approval_requested',
|
|
197
|
+
action: params.action || 'approval_requested',
|
|
198
|
+
outcome: 'pending',
|
|
199
|
+
details: {
|
|
200
|
+
requestId: approval.requestId,
|
|
201
|
+
issueNumber: approval.issueNumber,
|
|
202
|
+
issueUrl: approval.issueUrl,
|
|
203
|
+
reason: params.reason,
|
|
204
|
+
riskScore: params.riskScore
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
return approval;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Log an event
|
|
211
|
+
*/
|
|
212
|
+
async logEvent(params) {
|
|
213
|
+
return this.auditLogger.log({
|
|
214
|
+
eventType: params.eventType || 'custom',
|
|
215
|
+
action: params.action,
|
|
216
|
+
outcome: params.outcome || 'success',
|
|
217
|
+
agentId: params.agentId,
|
|
218
|
+
sessionId: params.sessionId,
|
|
219
|
+
userId: params.userId,
|
|
220
|
+
metadata: params.metadata
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
// ============================================================================
|
|
224
|
+
// RULE MANAGEMENT
|
|
225
|
+
// ============================================================================
|
|
226
|
+
/**
|
|
227
|
+
* Add a custom rule
|
|
228
|
+
*/
|
|
229
|
+
addRule(rule) {
|
|
230
|
+
this.rulesEngine.registerRule(rule);
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Remove a rule
|
|
234
|
+
*/
|
|
235
|
+
removeRule(ruleId) {
|
|
236
|
+
return this.rulesEngine.unregisterRule(ruleId);
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Get all rules
|
|
240
|
+
*/
|
|
241
|
+
getRules() {
|
|
242
|
+
return this.rulesEngine.getRules();
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Add rate limit configuration
|
|
246
|
+
*/
|
|
247
|
+
addRateLimit(config) {
|
|
248
|
+
this.rateLimiter.registerLimit(config);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Remove rate limit
|
|
252
|
+
*/
|
|
253
|
+
removeRateLimit(configId) {
|
|
254
|
+
return this.rateLimiter.removeLimit(configId);
|
|
255
|
+
}
|
|
256
|
+
// ============================================================================
|
|
257
|
+
// APPROVAL MANAGEMENT
|
|
258
|
+
// ============================================================================
|
|
259
|
+
/**
|
|
260
|
+
* Approve a pending request via GitHub
|
|
261
|
+
* @param requestIdOrIssueNumber - Either "approval-123" or just "123" (issue number)
|
|
262
|
+
*/
|
|
263
|
+
async approveRequest(requestIdOrIssueNumber, approverId, comments, repo) {
|
|
264
|
+
const issueNumber = typeof requestIdOrIssueNumber === 'string'
|
|
265
|
+
? parseInt(requestIdOrIssueNumber.replace('approval-', ''))
|
|
266
|
+
: requestIdOrIssueNumber;
|
|
267
|
+
await this.approvalManager.approveRequest({
|
|
268
|
+
repo,
|
|
269
|
+
issueNumber,
|
|
270
|
+
approverId,
|
|
271
|
+
comments
|
|
272
|
+
});
|
|
273
|
+
await this.auditLogger.log({
|
|
274
|
+
eventType: 'approval_granted',
|
|
275
|
+
action: `Approval granted for issue #${issueNumber}`,
|
|
276
|
+
outcome: 'success',
|
|
277
|
+
userId: approverId,
|
|
278
|
+
details: { issueNumber, comments }
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Deny a pending request via GitHub
|
|
283
|
+
* @param requestIdOrIssueNumber - Either "approval-123" or just "123" (issue number)
|
|
284
|
+
*/
|
|
285
|
+
async denyRequest(requestIdOrIssueNumber, denierId, reason, repo) {
|
|
286
|
+
const issueNumber = typeof requestIdOrIssueNumber === 'string'
|
|
287
|
+
? parseInt(requestIdOrIssueNumber.replace('approval-', ''))
|
|
288
|
+
: requestIdOrIssueNumber;
|
|
289
|
+
await this.approvalManager.denyRequest({
|
|
290
|
+
repo,
|
|
291
|
+
issueNumber,
|
|
292
|
+
denierId,
|
|
293
|
+
reason
|
|
294
|
+
});
|
|
295
|
+
await this.auditLogger.log({
|
|
296
|
+
eventType: 'approval_denied',
|
|
297
|
+
action: `Approval denied for issue #${issueNumber}`,
|
|
298
|
+
outcome: 'success',
|
|
299
|
+
userId: denierId,
|
|
300
|
+
details: { issueNumber, reason }
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Get pending approvals from GitHub
|
|
305
|
+
* Returns empty array if no repo is provided and no default is configured
|
|
306
|
+
*/
|
|
307
|
+
async getPendingApprovals(repo) {
|
|
308
|
+
try {
|
|
309
|
+
return await this.approvalManager.getPendingApprovals(repo);
|
|
310
|
+
}
|
|
311
|
+
catch (error) {
|
|
312
|
+
// If no repo is available, return empty array
|
|
313
|
+
if (error.message === 'Repository required') {
|
|
314
|
+
return [];
|
|
315
|
+
}
|
|
316
|
+
throw error;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Check if request is approved via GitHub
|
|
321
|
+
* @param requestIdOrIssueNumber - Either "approval-123" or just "123" (issue number)
|
|
322
|
+
*/
|
|
323
|
+
async isApproved(requestIdOrIssueNumber, repo) {
|
|
324
|
+
const issueNumber = typeof requestIdOrIssueNumber === 'string'
|
|
325
|
+
? parseInt(requestIdOrIssueNumber.replace('approval-', ''))
|
|
326
|
+
: requestIdOrIssueNumber;
|
|
327
|
+
const status = await this.approvalManager.checkApprovalStatus({
|
|
328
|
+
repo,
|
|
329
|
+
issueNumber
|
|
330
|
+
});
|
|
331
|
+
return status.status === 'approved';
|
|
332
|
+
}
|
|
333
|
+
// ============================================================================
|
|
334
|
+
// AUDIT & REPORTING
|
|
335
|
+
// ============================================================================
|
|
336
|
+
/**
|
|
337
|
+
* Get audit events
|
|
338
|
+
*/
|
|
339
|
+
getAuditEvents(filter) {
|
|
340
|
+
return this.auditLogger.getEvents(filter);
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Get audit statistics
|
|
344
|
+
*/
|
|
345
|
+
getAuditStats(since) {
|
|
346
|
+
return this.auditLogger.getStats(since);
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Export audit log
|
|
350
|
+
*/
|
|
351
|
+
exportAuditLog(filter) {
|
|
352
|
+
return this.auditLogger.exportEvents(filter);
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Get approval statistics
|
|
356
|
+
*/
|
|
357
|
+
async getApprovalStats(repo) {
|
|
358
|
+
const approvals = await this.getPendingApprovals(repo);
|
|
359
|
+
const byPriority = {};
|
|
360
|
+
for (const approval of approvals) {
|
|
361
|
+
byPriority[approval.priority] = (byPriority[approval.priority] || 0) + 1;
|
|
362
|
+
}
|
|
363
|
+
return {
|
|
364
|
+
total: approvals.length,
|
|
365
|
+
pending: approvals.length,
|
|
366
|
+
byPriority
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
// ============================================================================
|
|
370
|
+
// CONFIGURATION
|
|
371
|
+
// ============================================================================
|
|
372
|
+
/**
|
|
373
|
+
* Get current configuration
|
|
374
|
+
*/
|
|
375
|
+
getConfig() {
|
|
376
|
+
return { ...this.config };
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Update configuration
|
|
380
|
+
*/
|
|
381
|
+
async updateConfig(updates) {
|
|
382
|
+
const oldConfig = { ...this.config };
|
|
383
|
+
this.config = { ...this.config, ...updates };
|
|
384
|
+
await this.auditLogger.logConfigChanged('update_supervisor_config', 'config_update', {
|
|
385
|
+
changes: Object.keys(updates),
|
|
386
|
+
oldValues: oldConfig,
|
|
387
|
+
newValues: this.config
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Load preset configuration
|
|
392
|
+
*/
|
|
393
|
+
async loadPreset(preset) {
|
|
394
|
+
const presetConfig = rulePresets[preset];
|
|
395
|
+
if (!presetConfig) {
|
|
396
|
+
throw new Error(`Unknown preset: ${preset}`);
|
|
397
|
+
}
|
|
398
|
+
// Clear existing and load preset
|
|
399
|
+
this.rulesEngine = new RulesEngine();
|
|
400
|
+
this.rateLimiter.clearBuckets();
|
|
401
|
+
this.rulesEngine.registerRules(presetConfig.rules);
|
|
402
|
+
this.rateLimiter.registerLimits(presetConfig.rateLimits);
|
|
403
|
+
await this.auditLogger.logConfigChanged('load_preset', 'preset_loaded', { preset });
|
|
404
|
+
}
|
|
405
|
+
// ============================================================================
|
|
406
|
+
// APP MONITORING
|
|
407
|
+
// ============================================================================
|
|
408
|
+
/**
|
|
409
|
+
* Add a production app to monitor
|
|
410
|
+
*/
|
|
411
|
+
async addMonitoredApp(config) {
|
|
412
|
+
const app = await this.appMonitor.addApp(config);
|
|
413
|
+
await this.auditLogger.log({
|
|
414
|
+
eventType: 'system_event',
|
|
415
|
+
action: 'app_added',
|
|
416
|
+
outcome: 'success',
|
|
417
|
+
details: {
|
|
418
|
+
appId: app.id,
|
|
419
|
+
appName: app.name,
|
|
420
|
+
port: app.port,
|
|
421
|
+
path: app.path
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
return app;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Remove a monitored app
|
|
428
|
+
*/
|
|
429
|
+
async removeMonitoredApp(appId) {
|
|
430
|
+
const app = this.appMonitor.getApp(appId);
|
|
431
|
+
const result = this.appMonitor.removeApp(appId);
|
|
432
|
+
if (result && app) {
|
|
433
|
+
await this.auditLogger.log({
|
|
434
|
+
eventType: 'system_event',
|
|
435
|
+
action: 'app_removed',
|
|
436
|
+
outcome: 'success',
|
|
437
|
+
details: {
|
|
438
|
+
appId,
|
|
439
|
+
appName: app.name
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
return result;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Get a monitored app by ID
|
|
447
|
+
*/
|
|
448
|
+
getMonitoredApp(appId) {
|
|
449
|
+
return this.appMonitor.getApp(appId);
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Get a monitored app by name
|
|
453
|
+
*/
|
|
454
|
+
getMonitoredAppByName(name) {
|
|
455
|
+
return this.appMonitor.getAppByName(name);
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Get all monitored apps
|
|
459
|
+
*/
|
|
460
|
+
getAllMonitoredApps() {
|
|
461
|
+
return this.appMonitor.getAllApps();
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Update a monitored app configuration
|
|
465
|
+
*/
|
|
466
|
+
async updateMonitoredApp(appId, updates) {
|
|
467
|
+
const result = this.appMonitor.updateApp(appId, updates);
|
|
468
|
+
if (result) {
|
|
469
|
+
await this.auditLogger.log({
|
|
470
|
+
eventType: 'config_changed',
|
|
471
|
+
action: 'app_updated',
|
|
472
|
+
outcome: 'success',
|
|
473
|
+
details: {
|
|
474
|
+
appId,
|
|
475
|
+
appName: result.name,
|
|
476
|
+
updates: Object.keys(updates)
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
return result;
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Check health of a specific app
|
|
484
|
+
*/
|
|
485
|
+
async checkAppHealth(appId) {
|
|
486
|
+
return this.appMonitor.checkAppHealth(appId);
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Check health of all monitored apps
|
|
490
|
+
*/
|
|
491
|
+
async checkAllAppsHealth() {
|
|
492
|
+
return this.appMonitor.checkAllApps();
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Get last health check result for an app
|
|
496
|
+
*/
|
|
497
|
+
getLastAppHealthCheck(appId) {
|
|
498
|
+
return this.appMonitor.getLastCheckResult(appId);
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Get status history for an app
|
|
502
|
+
*/
|
|
503
|
+
getAppStatusHistory(appId, limit) {
|
|
504
|
+
return this.appMonitor.getStatusHistory(appId, limit);
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Enable/disable app monitoring
|
|
508
|
+
*/
|
|
509
|
+
setAppMonitoringEnabled(appId, enabled) {
|
|
510
|
+
return this.appMonitor.setAppEnabled(appId, enabled);
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* Get app monitoring statistics
|
|
514
|
+
*/
|
|
515
|
+
getAppMonitorStats() {
|
|
516
|
+
return this.appMonitor.getStats();
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Find apps by tag
|
|
520
|
+
*/
|
|
521
|
+
findAppsByTag(tag) {
|
|
522
|
+
return this.appMonitor.findAppsByTag(tag);
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Get apps that are currently offline
|
|
526
|
+
*/
|
|
527
|
+
getOfflineApps() {
|
|
528
|
+
return this.appMonitor.getOfflineApps();
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Get apps that are in degraded state
|
|
532
|
+
*/
|
|
533
|
+
getDegradedApps() {
|
|
534
|
+
return this.appMonitor.getDegradedApps();
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* Scan production directory for potential apps
|
|
538
|
+
*/
|
|
539
|
+
async scanForApps() {
|
|
540
|
+
return this.appMonitor.scanForApps();
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* Get logs for a monitored app
|
|
544
|
+
*/
|
|
545
|
+
async getAppLogs(appId, lines) {
|
|
546
|
+
return this.appMonitor.getAppLogs(appId, lines);
|
|
547
|
+
}
|
|
548
|
+
// ============================================================================
|
|
549
|
+
// HELPERS
|
|
550
|
+
// ============================================================================
|
|
551
|
+
buildConfig(partial) {
|
|
552
|
+
return {
|
|
553
|
+
version: partial?.version || '1.1.1',
|
|
554
|
+
name: partial?.name || 'Agent Supervisor',
|
|
555
|
+
environment: partial?.environment || 'development',
|
|
556
|
+
strictMode: partial?.strictMode ?? false,
|
|
557
|
+
defaultRiskThreshold: partial?.defaultRiskThreshold ?? 70,
|
|
558
|
+
requireApprovalAboveRisk: partial?.requireApprovalAboveRisk ?? 80,
|
|
559
|
+
features: {
|
|
560
|
+
riskScoring: partial?.features?.riskScoring ?? true,
|
|
561
|
+
rateLimiting: partial?.features?.rateLimiting ?? true,
|
|
562
|
+
auditLogging: partial?.features?.auditLogging ?? true,
|
|
563
|
+
humanApproval: partial?.features?.humanApproval ?? true,
|
|
564
|
+
complianceChecks: partial?.features?.complianceChecks ?? true,
|
|
565
|
+
uxValidation: partial?.features?.uxValidation ?? true,
|
|
566
|
+
architectureValidation: partial?.features?.architectureValidation ?? true
|
|
567
|
+
},
|
|
568
|
+
rateLimits: partial?.rateLimits ?? defaultRateLimits,
|
|
569
|
+
rules: partial?.rules ?? allBuiltInRules,
|
|
570
|
+
complianceFrameworks: partial?.complianceFrameworks ?? [],
|
|
571
|
+
notifications: {
|
|
572
|
+
enabled: partial?.notifications?.enabled ?? false,
|
|
573
|
+
webhookUrl: partial?.notifications?.webhookUrl,
|
|
574
|
+
alertOnRiskLevel: partial?.notifications?.alertOnRiskLevel ?? 'high'
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
async ensureInitialized() {
|
|
579
|
+
if (!this.initialized) {
|
|
580
|
+
await this.initialize();
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* Reload audit log from file (for dashboard refresh)
|
|
585
|
+
*/
|
|
586
|
+
async reloadAuditLog() {
|
|
587
|
+
await this.auditLogger.reload();
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
// Export singleton for convenience with shared audit database
|
|
591
|
+
export const supervisor = new AgentSupervisor({
|
|
592
|
+
auditOptions: {
|
|
593
|
+
dbPath: process.env.AUDIT_DB_PATH || '/tmp/agent-supervisor/audit.db'
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
//# sourceMappingURL=AgentSupervisor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentSupervisor.js","sourceRoot":"","sources":["../../src/supervisor/AgentSupervisor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,WAAW,EAA2B,MAAM,0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ows registering servers (ip + sourceDir) and checking online status.
|
|
5
|
+
*/
|
|
6
|
+
export interface ManagedServer {
|
|
7
|
+
id: string;
|
|
8
|
+
ip: string;
|
|
9
|
+
sourceDir: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
port?: number;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ServerStatus {
|
|
15
|
+
id?: string;
|
|
16
|
+
ip: string;
|
|
17
|
+
online: boolean;
|
|
18
|
+
ports: Record<number, boolean>;
|
|
19
|
+
sourceDir: string;
|
|
20
|
+
sourceDirExists: boolean;
|
|
21
|
+
checkedAt: string;
|
|
22
|
+
}
|
|
23
|
+
export declare class ManagedServerRegistry {
|
|
24
|
+
private filePath;
|
|
25
|
+
private servers;
|
|
26
|
+
private loaded;
|
|
27
|
+
constructor(filePath?: string);
|
|
28
|
+
private ensureLoaded;
|
|
29
|
+
private persist;
|
|
30
|
+
addServer(params: {
|
|
31
|
+
ip: string;
|
|
32
|
+
sourceDir: string;
|
|
33
|
+
name?: string;
|
|
34
|
+
port?: number;
|
|
35
|
+
}): Promise<ManagedServer>;
|
|
36
|
+
removeServer(id: string): Promise<boolean>;
|
|
37
|
+
listServers(): Promise<ManagedServer[]>;
|
|
38
|
+
getServer(id: string): Promise<ManagedServer | undefined>;
|
|
39
|
+
checkStatus(input: {
|
|
40
|
+
id?: string;
|
|
41
|
+
ip?: string;
|
|
42
|
+
sourceDir?: string;
|
|
43
|
+
ports?: number[];
|
|
44
|
+
}): Promise<ServerStatus>;
|
|
45
|
+
private tcpCheck;
|
|
46
|
+
}
|
|
47
|
+
export declare const managedServerRegistry: ManagedServerRegistry;
|
|
48
|
+
//# sourceMappingURL=ManagedServerRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ManagedServerRegistry.d.ts","sourceRoot":"","sources":["../../src/supervisor/ManagedServerRegistry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,MAAM,WAAW,aA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