0xray 4.0.33 → 4.0.35
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/.grok-plugin/plugin.json +1 -1
- package/.xray/codex.json +12 -4
- package/.xray/features.json +1 -1
- package/AGENTS-consumer.md +6 -6
- package/AGENTS.md +5 -5
- package/README.md +2 -2
- package/dist/AGENTS.md +5 -5
- package/dist/CHANGELOG.md +25 -0
- package/dist/README.md +2 -2
- package/dist/cli/index.js +2 -5
- package/dist/governance/governance-service.js +1 -1
- package/dist/integrations/base/README.md +1 -9
- package/dist/integrations/base/index.d.ts +0 -1
- package/dist/integrations/base/index.js +0 -2
- package/dist/integrations/governance/index.js +31 -8
- package/dist/integrations/grok/hooks/grok-hook-utils.js +1 -1
- package/dist/integrations/grok/hooks/session-start.js +12 -0
- package/dist/integrations/hooks/goggles-pipeline.mjs +108 -22
- package/dist/integrations/hooks/goggles-planes.json +23 -0
- package/dist/integrations/hooks/host-truth.mjs +74 -0
- package/dist/integrations/hooks/station-hook-runtime.cjs +3 -0
- package/dist/integrations/openclaw/plugin/xray-pre-tool/package.json +1 -1
- package/dist/mcps/knowledge-skills/storyteller.server.js +0 -1
- package/dist/nucleus/delegation-gate.d.ts +2 -2
- package/dist/nucleus/delegation-gate.js +13 -2
- package/dist/nucleus/work-freshness.mjs +189 -0
- package/dist/processors/implementations/agents-md-validation-processor.js +1 -1
- package/docs-site/docs/plates/boot.md +17 -2
- package/docs-site/docs/plates/governance.md +3 -2
- package/docs-site/docs/plates/index.md +3 -1
- package/docs-site/docs/plates/memory-recall.md +26 -35
- package/docs-site/docs/plates/orchestration.md +39 -35
- package/docs-site/docs/plates/processor.md +34 -36
- package/docs-site/docs/plates/reporting.md +3 -8
- package/docs-site/docs/plates/routing.md +22 -11
- package/package.json +2 -2
- package/scripts/foundry/release.mjs +48 -5
- package/scripts/mjs/test-consumer-readiness.mjs +1 -0
- package/scripts/mjs/test-mcp-functionality.mjs +14 -9
- package/scripts/node/basic-security-audit.cjs +0 -1
- package/scripts/node/bridge-mcp-wiring.cjs +66 -3
- package/scripts/node/postinstall.cjs +1 -1
- package/scripts/node/prepare-consumer.cjs +11 -7
- package/scripts/node/setup-dev.cjs +18 -26
- package/scripts/node/validate-mcp-connectivity.js +2 -1
- package/src/integrations/openclaw/plugin/xray-pre-tool/package.json +1 -1
- package/src/mcps/knowledge-skills/storyteller.server.ts +0 -1
- package/xray/agents_template.md +5 -5
- package/xray/codex.json +12 -4
- package/xray/features.json +1 -1
- package/dist/agents/known-names.d.ts +0 -26
- package/dist/agents/known-names.js +0 -72
- package/dist/analytics/consent-manager.d.ts +0 -92
- package/dist/analytics/consent-manager.js +0 -257
- package/dist/benchmark/performance-benchmark.d.ts +0 -103
- package/dist/benchmark/performance-benchmark.js +0 -373
- package/dist/cli/commands/analytics-disable.d.ts +0 -9
- package/dist/cli/commands/analytics-disable.js +0 -72
- package/dist/cli/commands/analytics-enable-action.d.ts +0 -8
- package/dist/cli/commands/analytics-enable-action.js +0 -82
- package/dist/cli/commands/analytics-preview.d.ts +0 -9
- package/dist/cli/commands/analytics-preview.js +0 -106
- package/dist/cli/commands/analytics-status.d.ts +0 -9
- package/dist/cli/commands/analytics-status.js +0 -68
- package/dist/cli/commands/enforce.d.ts +0 -12
- package/dist/cli/commands/enforce.js +0 -78
- package/dist/cli/commands/govern.d.ts +0 -29
- package/dist/cli/commands/govern.js +0 -149
- package/dist/cli/commands/security-audit.d.ts +0 -23
- package/dist/cli/commands/security-audit.js +0 -219
- package/dist/cli/server.d.ts +0 -1
- package/dist/cli/server.js +0 -147
- package/dist/config/routing-mappings.d.ts +0 -26
- package/dist/config/routing-mappings.js +0 -151
- package/dist/core/bridge.mjs +0 -922
- package/dist/core/trace-context.d.ts +0 -12
- package/dist/core/trace-context.js +0 -33
- package/dist/enforcement/index.d.ts +0 -22
- package/dist/enforcement/index.js +0 -40
- package/dist/enforcement/loaders/index.d.ts +0 -36
- package/dist/enforcement/loaders/index.js +0 -39
- package/dist/enforcement/test-auto-healing.d.ts +0 -83
- package/dist/enforcement/test-auto-healing.js +0 -325
- package/dist/inference/index.d.ts +0 -10
- package/dist/inference/index.js +0 -5
- package/dist/infrastructure/iac-validator.d.ts +0 -150
- package/dist/infrastructure/iac-validator.js +0 -465
- package/dist/infrastructure/schemas/cloud-schemas.d.ts +0 -482
- package/dist/infrastructure/schemas/cloud-schemas.js +0 -488
- package/dist/integrations/base/ExampleIntegration.d.ts +0 -46
- package/dist/integrations/base/ExampleIntegration.js +0 -180
- package/dist/integrations/enforcement-gate.d.ts +0 -44
- package/dist/integrations/enforcement-gate.js +0 -348
- package/dist/mcps/connection/connection-manager.d.ts +0 -39
- package/dist/mcps/connection/connection-manager.js +0 -79
- package/dist/mcps/index.d.ts +0 -17
- package/dist/mcps/index.js +0 -65
- package/dist/mcps/orchestrator/index.d.ts +0 -6
- package/dist/mcps/orchestrator/index.js +0 -5
- package/dist/metrics/index.d.ts +0 -6
- package/dist/metrics/index.js +0 -6
- package/dist/orchestrator/self-direction-activation.d.ts +0 -108
- package/dist/orchestrator/self-direction-activation.js +0 -244
- package/dist/orchestrator/universal-registry-bridge.d.ts +0 -84
- package/dist/orchestrator/universal-registry-bridge.js +0 -246
- package/dist/performance/performance-budget-enforcer.d.ts +0 -157
- package/dist/performance/performance-budget-enforcer.js +0 -433
- package/dist/performance/performance-regression-tester.d.ts +0 -107
- package/dist/performance/performance-regression-tester.js +0 -341
- package/dist/postprocessor/analysis/CodeChangeAnalyzer.d.ts +0 -11
- package/dist/postprocessor/analysis/CodeChangeAnalyzer.js +0 -50
- package/dist/postprocessor/config/ProcessorConfigLoader.d.ts +0 -44
- package/dist/postprocessor/config/ProcessorConfigLoader.js +0 -16
- package/dist/postprocessor/integration.d.ts +0 -156
- package/dist/postprocessor/integration.js +0 -194
- package/dist/postprocessor/metamorphosis/index.d.ts +0 -2
- package/dist/postprocessor/metamorphosis/index.js +0 -1
- package/dist/postprocessor/redeploy/RetryHandler.d.ts +0 -49
- package/dist/postprocessor/redeploy/RetryHandler.js +0 -118
- package/dist/processors/implementations/session-capture-processor.d.ts +0 -14
- package/dist/processors/implementations/session-capture-processor.js +0 -37
- package/dist/public/XrayService.d.ts +0 -17
- package/dist/public/XrayService.js +0 -40
- package/dist/public/index.d.ts +0 -4
- package/dist/public/index.js +0 -2
- package/dist/security/comprehensive-security-audit.d.ts +0 -157
- package/dist/security/comprehensive-security-audit.js +0 -1004
- package/dist/security/index.d.ts +0 -13
- package/dist/security/index.js +0 -13
- package/dist/security/security-agent-coordinator.d.ts +0 -71
- package/dist/security/security-agent-coordinator.js +0 -203
- package/dist/security/security-hardening-system.d.ts +0 -238
- package/dist/security/security-hardening-system.js +0 -726
- package/dist/security/security-orchestration-layer.d.ts +0 -118
- package/dist/security/security-orchestration-layer.js +0 -495
- package/dist/testing/memory-regression-suite.d.ts +0 -105
- package/dist/testing/memory-regression-suite.js +0 -258
- package/dist/tools/assess-complexity-tool.d.ts +0 -28
- package/dist/tools/assess-complexity-tool.js +0 -44
- package/dist/tools/query-routing-tool.d.ts +0 -17
- package/dist/tools/query-routing-tool.js +0 -59
- package/dist/utils/batch-operations.d.ts +0 -25
- package/dist/utils/batch-operations.js +0 -292
- package/dist/utils/task-graph.d.ts +0 -29
- package/dist/utils/task-graph.js +0 -106
- package/dist/utils/test-template-generator.d.ts +0 -25
- package/dist/utils/test-template-generator.js +0 -178
- package/dist/utils/token-manager.d.ts +0 -48
- package/dist/utils/token-manager.js +0 -163
- package/dist/validation/agent-config-validator.d.ts +0 -110
- package/dist/validation/agent-config-validator.js +0 -280
- package/dist/validation/orchestration-flow-validator.d.ts +0 -87
- package/dist/validation/orchestration-flow-validator.js +0 -606
- package/src/mcps/connection/connection-manager.ts +0 -91
- package/src/mcps/index.ts +0 -80
- package/src/mcps/orchestrator/index.ts +0 -29
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Universal Registry Bridge
|
|
3
|
-
*
|
|
4
|
-
* Connects 0xRay to external agent registries.
|
|
5
|
-
* Enables dynamic agent configuration loading from external sources.
|
|
6
|
-
*
|
|
7
|
-
* @since 2026-02-14
|
|
8
|
-
*/
|
|
9
|
-
import { readFile } from "fs/promises";
|
|
10
|
-
import { existsSync } from "fs";
|
|
11
|
-
import { resolve, dirname, join } from "path";
|
|
12
|
-
import { fileURLToPath } from "url";
|
|
13
|
-
import { frameworkLogger } from "../core/framework-logger.js";
|
|
14
|
-
import { getConfigDir } from "../core/config-paths.js";
|
|
15
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
-
const __dirname = dirname(__filename);
|
|
17
|
-
export class UniversalRegistryBridge {
|
|
18
|
-
registries;
|
|
19
|
-
cacheDir;
|
|
20
|
-
autoRefresh;
|
|
21
|
-
cache = new Map();
|
|
22
|
-
logger = frameworkLogger;
|
|
23
|
-
constructor(options) {
|
|
24
|
-
this.registries = options.registries || [];
|
|
25
|
-
this.cacheDir =
|
|
26
|
-
options.cacheDir || join(getConfigDir(), "registry-cache");
|
|
27
|
-
this.autoRefresh = options.autoRefresh ?? true;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Load agents from all configured registries
|
|
31
|
-
*/
|
|
32
|
-
async loadAgents() {
|
|
33
|
-
const allAgents = [];
|
|
34
|
-
for (const registry of this.registries) {
|
|
35
|
-
try {
|
|
36
|
-
const agents = await this.fetchFromRegistry(registry);
|
|
37
|
-
allAgents.push(...agents);
|
|
38
|
-
this.logger.log("universal-registry-bridge", `Loaded ${agents.length} agents from ${registry.type} registry: ${registry.location}`, "info");
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
this.logger.log("universal-registry-bridge", `Failed to load from registry ${registry.location}: ${error}`, "info");
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return allAgents;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Fetch agents from a specific registry
|
|
48
|
-
*/
|
|
49
|
-
async fetchFromRegistry(registry) {
|
|
50
|
-
// Check cache first
|
|
51
|
-
const cacheKey = `${registry.type}:${registry.location}`;
|
|
52
|
-
const cached = this.cache.get(cacheKey);
|
|
53
|
-
if (cached && !this.autoRefresh) {
|
|
54
|
-
return cached;
|
|
55
|
-
}
|
|
56
|
-
let agents;
|
|
57
|
-
switch (registry.type) {
|
|
58
|
-
case "file":
|
|
59
|
-
agents = await this.loadFromFile(registry.location);
|
|
60
|
-
break;
|
|
61
|
-
case "http":
|
|
62
|
-
agents = await this.loadFromHttp(registry.location);
|
|
63
|
-
break;
|
|
64
|
-
case "npm":
|
|
65
|
-
agents = await this.loadFromNpm(registry.location);
|
|
66
|
-
break;
|
|
67
|
-
default:
|
|
68
|
-
this.logger.log("universal-registry-bridge", `Unknown registry type: ${registry.type}`, "info");
|
|
69
|
-
return [];
|
|
70
|
-
}
|
|
71
|
-
this.cache.set(cacheKey, agents);
|
|
72
|
-
return agents;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Load agents from a local file
|
|
76
|
-
*/
|
|
77
|
-
async loadFromFile(location) {
|
|
78
|
-
const filePath = resolve(location);
|
|
79
|
-
if (!existsSync(filePath)) {
|
|
80
|
-
throw new Error(`Registry file not found: ${filePath}`);
|
|
81
|
-
}
|
|
82
|
-
const content = await readFile(filePath, "utf-8");
|
|
83
|
-
const ext = location.toLowerCase();
|
|
84
|
-
if (ext.endsWith(".json")) {
|
|
85
|
-
return JSON.parse(content);
|
|
86
|
-
}
|
|
87
|
-
else if (ext.endsWith(".yaml") || ext.endsWith(".yml")) {
|
|
88
|
-
// Simple YAML parser for agent definitions
|
|
89
|
-
return this.parseYamlAgents(content);
|
|
90
|
-
}
|
|
91
|
-
throw new Error(`Unsupported file format: ${location}`);
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Simple YAML parser for agent definitions
|
|
95
|
-
* Handles basic agent registry format
|
|
96
|
-
*/
|
|
97
|
-
parseYamlAgents(content) {
|
|
98
|
-
const agents = [];
|
|
99
|
-
const lines = content.split("\n");
|
|
100
|
-
let currentAgent = null;
|
|
101
|
-
let inAgent = false;
|
|
102
|
-
for (const line of lines) {
|
|
103
|
-
const trimmed = line.trim();
|
|
104
|
-
if (trimmed.startsWith("agents:")) {
|
|
105
|
-
continue;
|
|
106
|
-
}
|
|
107
|
-
// Check for new agent entry (name: xxx)
|
|
108
|
-
const nameMatch = trimmed.match(/^-\s*name:\s*(.+)$/);
|
|
109
|
-
if (nameMatch && nameMatch[1]) {
|
|
110
|
-
if (inAgent && currentAgent) {
|
|
111
|
-
agents.push(currentAgent);
|
|
112
|
-
}
|
|
113
|
-
currentAgent = {
|
|
114
|
-
name: nameMatch[1].trim(),
|
|
115
|
-
description: "",
|
|
116
|
-
version: "",
|
|
117
|
-
};
|
|
118
|
-
inAgent = true;
|
|
119
|
-
continue;
|
|
120
|
-
}
|
|
121
|
-
if (inAgent && currentAgent) {
|
|
122
|
-
const descMatch = trimmed.match(/^description:\s*(.+)$/);
|
|
123
|
-
if (descMatch && descMatch[1]) {
|
|
124
|
-
currentAgent.description = descMatch[1].trim();
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
const versionMatch = trimmed.match(/^version:\s*(.+)$/);
|
|
128
|
-
if (versionMatch && versionMatch[1]) {
|
|
129
|
-
currentAgent.version = versionMatch[1].trim();
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
// Push last agent
|
|
135
|
-
if (inAgent && currentAgent) {
|
|
136
|
-
agents.push(currentAgent);
|
|
137
|
-
}
|
|
138
|
-
return agents;
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Load agents from HTTP endpoint
|
|
142
|
-
*/
|
|
143
|
-
async loadFromHttp(location) {
|
|
144
|
-
try {
|
|
145
|
-
const response = await fetch(location);
|
|
146
|
-
if (!response.ok) {
|
|
147
|
-
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
148
|
-
}
|
|
149
|
-
return await response.json();
|
|
150
|
-
}
|
|
151
|
-
catch (error) {
|
|
152
|
-
throw new Error(`Failed to fetch from ${location}: ${error}`);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Load agents from npm package
|
|
157
|
-
*/
|
|
158
|
-
async loadFromNpm(packageName) {
|
|
159
|
-
try {
|
|
160
|
-
const response = await fetch(`https://registry.npmjs.org/${packageName}/latest`);
|
|
161
|
-
if (!response.ok) {
|
|
162
|
-
throw new Error(`npm API error: ${response.status}`);
|
|
163
|
-
}
|
|
164
|
-
const pkg = await response.json();
|
|
165
|
-
// Look for agent definitions in package exports
|
|
166
|
-
if (pkg.xray?.agents) {
|
|
167
|
-
return pkg.xray.agents;
|
|
168
|
-
}
|
|
169
|
-
return [];
|
|
170
|
-
}
|
|
171
|
-
catch (error) {
|
|
172
|
-
throw new Error(`Failed to load npm package ${packageName}: ${error}`);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Convert registry definition to AgentConfig
|
|
177
|
-
*/
|
|
178
|
-
toAgentConfig(registryDef) {
|
|
179
|
-
return {
|
|
180
|
-
name: registryDef.name,
|
|
181
|
-
description: registryDef.description,
|
|
182
|
-
capabilities: registryDef.capabilities || [],
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Get cached agents from a specific registry
|
|
187
|
-
*/
|
|
188
|
-
getCached(registryType, location) {
|
|
189
|
-
return this.cache.get(`${registryType}:${location}`);
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Clear the cache
|
|
193
|
-
*/
|
|
194
|
-
clearCache() {
|
|
195
|
-
this.cache.clear();
|
|
196
|
-
this.logger.log("universal-registry-bridge", "Registry cache cleared", "info");
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Add a new registry dynamically
|
|
200
|
-
*/
|
|
201
|
-
addRegistry(registry) {
|
|
202
|
-
this.registries.push(registry);
|
|
203
|
-
this.logger.log("universal-registry-bridge", `Added registry: ${registry.type}:${registry.location}`, "info");
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Get all configured registries
|
|
207
|
-
*/
|
|
208
|
-
getRegistries() {
|
|
209
|
-
return [...this.registries];
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Create a bridge from integration config
|
|
214
|
-
*/
|
|
215
|
-
export async function createRegistryBridge(configPath) {
|
|
216
|
-
const defaultPath = resolve(process.cwd(), ".xray/integration/registries.json");
|
|
217
|
-
const path = configPath || defaultPath;
|
|
218
|
-
let registries = [];
|
|
219
|
-
if (existsSync(path)) {
|
|
220
|
-
try {
|
|
221
|
-
const content = await readFile(path, "utf-8");
|
|
222
|
-
const config = JSON.parse(content);
|
|
223
|
-
registries = config.registries || [];
|
|
224
|
-
}
|
|
225
|
-
catch (error) {
|
|
226
|
-
frameworkLogger.log("universal-registry-bridge", `Failed to load registry config from ${path}: ${error}`, "info");
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
return new UniversalRegistryBridge({
|
|
230
|
-
registries,
|
|
231
|
-
autoRefresh: true,
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Default bridge instance for quick access
|
|
236
|
-
*/
|
|
237
|
-
let defaultBridge = null;
|
|
238
|
-
export function getDefaultBridge() {
|
|
239
|
-
if (!defaultBridge) {
|
|
240
|
-
defaultBridge = new UniversalRegistryBridge({
|
|
241
|
-
registries: [],
|
|
242
|
-
autoRefresh: false,
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
return defaultBridge;
|
|
246
|
-
}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Performance Budget Enforcement System
|
|
3
|
-
*
|
|
4
|
-
* Comprehensive performance testing and monitoring system that enforces
|
|
5
|
-
* Universal Development Codex performance budget requirements.
|
|
6
|
-
*
|
|
7
|
-
* Performance Budget Requirements:
|
|
8
|
-
* - Bundle size <2MB (gzipped <700KB)
|
|
9
|
-
* - First Contentful Paint <2s
|
|
10
|
-
* - Time to Interactive <5s
|
|
11
|
-
*
|
|
12
|
-
* @since 2026-01-08
|
|
13
|
-
*/
|
|
14
|
-
import { EventEmitter } from "events";
|
|
15
|
-
export declare const PERFORMANCE_BUDGET: {
|
|
16
|
-
readonly bundleSize: {
|
|
17
|
-
readonly uncompressed: number;
|
|
18
|
-
readonly gzipped: number;
|
|
19
|
-
};
|
|
20
|
-
readonly webVitals: {
|
|
21
|
-
readonly firstContentfulPaint: 2000;
|
|
22
|
-
readonly timeToInteractive: 5000;
|
|
23
|
-
readonly largestContentfulPaint: 2500;
|
|
24
|
-
readonly cumulativeLayoutShift: 0.1;
|
|
25
|
-
readonly firstInputDelay: 100;
|
|
26
|
-
};
|
|
27
|
-
readonly runtime: {
|
|
28
|
-
readonly memoryUsage: number;
|
|
29
|
-
readonly startupTime: 100;
|
|
30
|
-
readonly testExecutionTime: 5000;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
export interface BundleSizeMetrics {
|
|
34
|
-
totalSize: number;
|
|
35
|
-
gzippedSize: number;
|
|
36
|
-
fileCount: number;
|
|
37
|
-
largestFile: {
|
|
38
|
-
name: string;
|
|
39
|
-
size: number;
|
|
40
|
-
gzippedSize: number;
|
|
41
|
-
};
|
|
42
|
-
breakdown: Array<{
|
|
43
|
-
name: string;
|
|
44
|
-
size: number;
|
|
45
|
-
gzippedSize: number;
|
|
46
|
-
percentage: number;
|
|
47
|
-
}>;
|
|
48
|
-
}
|
|
49
|
-
export interface WebVitalsMetrics {
|
|
50
|
-
firstContentfulPaint: number;
|
|
51
|
-
timeToInteractive: number;
|
|
52
|
-
largestContentfulPaint: number;
|
|
53
|
-
cumulativeLayoutShift: number;
|
|
54
|
-
firstInputDelay: number;
|
|
55
|
-
timestamp: number;
|
|
56
|
-
}
|
|
57
|
-
export interface RuntimePerformanceMetrics {
|
|
58
|
-
memoryUsage: {
|
|
59
|
-
rss: number;
|
|
60
|
-
heapUsed: number;
|
|
61
|
-
heapTotal: number;
|
|
62
|
-
external: number;
|
|
63
|
-
};
|
|
64
|
-
startupTime: number;
|
|
65
|
-
cpuUsage: number;
|
|
66
|
-
timestamp: number;
|
|
67
|
-
}
|
|
68
|
-
export interface PerformanceBudgetViolation {
|
|
69
|
-
metric: string;
|
|
70
|
-
actual: number;
|
|
71
|
-
budget: number;
|
|
72
|
-
percentage: number;
|
|
73
|
-
severity: "warning" | "error" | "critical";
|
|
74
|
-
recommendation: string;
|
|
75
|
-
}
|
|
76
|
-
export interface PerformanceReport {
|
|
77
|
-
timestamp: number;
|
|
78
|
-
bundleSize: BundleSizeMetrics;
|
|
79
|
-
webVitals: WebVitalsMetrics | null;
|
|
80
|
-
runtime: RuntimePerformanceMetrics;
|
|
81
|
-
violations: PerformanceBudgetViolation[];
|
|
82
|
-
recommendations: string[];
|
|
83
|
-
overallStatus: "pass" | "warning" | "fail";
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Comprehensive performance budget enforcement system
|
|
87
|
-
*/
|
|
88
|
-
export declare class PerformanceBudgetEnforcer extends EventEmitter {
|
|
89
|
-
private reports;
|
|
90
|
-
private monitoringActive;
|
|
91
|
-
private alertThresholds;
|
|
92
|
-
private started;
|
|
93
|
-
private boundViolation;
|
|
94
|
-
private boundBudgetExceeded;
|
|
95
|
-
constructor();
|
|
96
|
-
start(): void;
|
|
97
|
-
private setupEventHandlers;
|
|
98
|
-
destroy(): void;
|
|
99
|
-
/**
|
|
100
|
-
* Analyze bundle size against performance budget
|
|
101
|
-
*/
|
|
102
|
-
analyzeBundleSize(distPath?: string): Promise<BundleSizeMetrics>;
|
|
103
|
-
/**
|
|
104
|
-
* Measure web vitals (simulated for server-side framework)
|
|
105
|
-
* In a real web application, this would use the Web Vitals library
|
|
106
|
-
*/
|
|
107
|
-
measureWebVitals(): Promise<WebVitalsMetrics>;
|
|
108
|
-
/**
|
|
109
|
-
* Measure runtime performance metrics
|
|
110
|
-
*/
|
|
111
|
-
measureRuntimePerformance(): RuntimePerformanceMetrics;
|
|
112
|
-
/**
|
|
113
|
-
* Check performance budget compliance
|
|
114
|
-
*/
|
|
115
|
-
checkBudgetCompliance(bundleSize: BundleSizeMetrics, webVitals: WebVitalsMetrics | null, runtime: RuntimePerformanceMetrics): PerformanceBudgetViolation[];
|
|
116
|
-
/**
|
|
117
|
-
* Generate comprehensive performance report
|
|
118
|
-
*/
|
|
119
|
-
generatePerformanceReport(): Promise<PerformanceReport>;
|
|
120
|
-
/**
|
|
121
|
-
* Generate performance optimization recommendations
|
|
122
|
-
*/
|
|
123
|
-
private generateRecommendations;
|
|
124
|
-
/**
|
|
125
|
-
* Handle performance violations
|
|
126
|
-
*/
|
|
127
|
-
private handleViolation;
|
|
128
|
-
/**
|
|
129
|
-
* Handle budget exceeded events
|
|
130
|
-
*/
|
|
131
|
-
private handleBudgetExceeded;
|
|
132
|
-
/**
|
|
133
|
-
* Start continuous performance monitoring
|
|
134
|
-
*/
|
|
135
|
-
startMonitoring(intervalMs?: number): void;
|
|
136
|
-
/**
|
|
137
|
-
* Stop performance monitoring
|
|
138
|
-
*/
|
|
139
|
-
stopMonitoring(): void;
|
|
140
|
-
/**
|
|
141
|
-
* Get historical performance reports
|
|
142
|
-
*/
|
|
143
|
-
getReports(limit?: number): PerformanceReport[];
|
|
144
|
-
/**
|
|
145
|
-
* Export performance data for analysis
|
|
146
|
-
*/
|
|
147
|
-
exportPerformanceData(): {
|
|
148
|
-
reports: PerformanceReport[];
|
|
149
|
-
summary: {
|
|
150
|
-
totalReports: number;
|
|
151
|
-
averageViolations: number;
|
|
152
|
-
mostCommonViolation: string;
|
|
153
|
-
trend: "improving" | "stable" | "degrading";
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
export declare const performanceBudgetEnforcer: PerformanceBudgetEnforcer;
|