0xray 4.0.34 → 4.0.36

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.
Files changed (160) hide show
  1. package/.grok-plugin/plugin.json +1 -1
  2. package/.xray/codex.json +12 -4
  3. package/.xray/features.json +1 -1
  4. package/AGENTS-consumer.md +6 -6
  5. package/AGENTS.md +5 -5
  6. package/README.md +2 -2
  7. package/dist/AGENTS.md +5 -5
  8. package/dist/CHANGELOG.md +26 -0
  9. package/dist/README.md +2 -2
  10. package/dist/cli/index.js +2 -5
  11. package/dist/governance/governance-service.js +1 -1
  12. package/dist/integrations/base/README.md +1 -9
  13. package/dist/integrations/base/index.d.ts +0 -1
  14. package/dist/integrations/base/index.js +0 -2
  15. package/dist/integrations/governance/index.js +31 -8
  16. package/dist/integrations/grok/hooks/grok-hook-utils.js +1 -1
  17. package/dist/integrations/grok/hooks/session-start.js +12 -0
  18. package/dist/integrations/grok/plugin/0xray/hooks/hooks.json +6 -6
  19. package/dist/integrations/hooks/goggles-mcp.mjs +10 -3
  20. package/dist/integrations/hooks/goggles-pipeline.mjs +110 -23
  21. package/dist/integrations/hooks/host-truth.mjs +74 -0
  22. package/dist/integrations/hooks/station-hook-runtime.cjs +3 -0
  23. package/dist/integrations/openclaw/plugin/xray-pre-tool/package.json +1 -1
  24. package/dist/mcps/knowledge-skills/storyteller.server.js +0 -1
  25. package/dist/nucleus/delegation-gate.d.ts +2 -2
  26. package/dist/nucleus/delegation-gate.js +13 -2
  27. package/dist/nucleus/work-freshness.mjs +189 -0
  28. package/dist/processors/implementations/agents-md-validation-processor.js +1 -1
  29. package/docs-site/docs/plates/boot.md +17 -2
  30. package/docs-site/docs/plates/governance.md +3 -2
  31. package/docs-site/docs/plates/index.md +3 -1
  32. package/docs-site/docs/plates/memory-recall.md +26 -35
  33. package/docs-site/docs/plates/orchestration.md +39 -35
  34. package/docs-site/docs/plates/processor.md +34 -36
  35. package/docs-site/docs/plates/reporting.md +3 -8
  36. package/docs-site/docs/plates/routing.md +22 -11
  37. package/package.json +3 -2
  38. package/scripts/foundry/release.mjs +48 -5
  39. package/scripts/mjs/run-grok-hook.mjs +50 -0
  40. package/scripts/mjs/test-consumer-readiness.mjs +1 -0
  41. package/scripts/mjs/test-mcp-functionality.mjs +14 -9
  42. package/scripts/node/basic-security-audit.cjs +0 -1
  43. package/scripts/node/bridge-mcp-wiring.cjs +66 -3
  44. package/scripts/node/install-bridges.cjs +3 -3
  45. package/scripts/node/postinstall.cjs +1 -1
  46. package/scripts/node/prepare-consumer.cjs +11 -7
  47. package/scripts/node/setup-dev.cjs +18 -26
  48. package/scripts/node/validate-mcp-connectivity.js +2 -1
  49. package/src/integrations/grok/plugin/0xray/hooks/hooks.json +6 -6
  50. package/src/integrations/openclaw/plugin/xray-pre-tool/package.json +1 -1
  51. package/src/mcps/knowledge-skills/storyteller.server.ts +0 -1
  52. package/xray/agents_template.md +5 -5
  53. package/xray/codex.json +12 -4
  54. package/xray/features.json +1 -1
  55. package/dist/agents/known-names.d.ts +0 -26
  56. package/dist/agents/known-names.js +0 -72
  57. package/dist/analytics/consent-manager.d.ts +0 -92
  58. package/dist/analytics/consent-manager.js +0 -257
  59. package/dist/benchmark/performance-benchmark.d.ts +0 -103
  60. package/dist/benchmark/performance-benchmark.js +0 -373
  61. package/dist/cli/commands/analytics-disable.d.ts +0 -9
  62. package/dist/cli/commands/analytics-disable.js +0 -72
  63. package/dist/cli/commands/analytics-enable-action.d.ts +0 -8
  64. package/dist/cli/commands/analytics-enable-action.js +0 -82
  65. package/dist/cli/commands/analytics-preview.d.ts +0 -9
  66. package/dist/cli/commands/analytics-preview.js +0 -106
  67. package/dist/cli/commands/analytics-status.d.ts +0 -9
  68. package/dist/cli/commands/analytics-status.js +0 -68
  69. package/dist/cli/commands/enforce.d.ts +0 -12
  70. package/dist/cli/commands/enforce.js +0 -78
  71. package/dist/cli/commands/govern.d.ts +0 -29
  72. package/dist/cli/commands/govern.js +0 -149
  73. package/dist/cli/commands/security-audit.d.ts +0 -23
  74. package/dist/cli/commands/security-audit.js +0 -219
  75. package/dist/cli/server.d.ts +0 -1
  76. package/dist/cli/server.js +0 -147
  77. package/dist/config/routing-mappings.d.ts +0 -26
  78. package/dist/config/routing-mappings.js +0 -151
  79. package/dist/core/bridge.mjs +0 -922
  80. package/dist/core/trace-context.d.ts +0 -12
  81. package/dist/core/trace-context.js +0 -33
  82. package/dist/enforcement/index.d.ts +0 -22
  83. package/dist/enforcement/index.js +0 -40
  84. package/dist/enforcement/loaders/index.d.ts +0 -36
  85. package/dist/enforcement/loaders/index.js +0 -39
  86. package/dist/enforcement/test-auto-healing.d.ts +0 -83
  87. package/dist/enforcement/test-auto-healing.js +0 -325
  88. package/dist/inference/index.d.ts +0 -10
  89. package/dist/inference/index.js +0 -5
  90. package/dist/infrastructure/iac-validator.d.ts +0 -150
  91. package/dist/infrastructure/iac-validator.js +0 -465
  92. package/dist/infrastructure/schemas/cloud-schemas.d.ts +0 -482
  93. package/dist/infrastructure/schemas/cloud-schemas.js +0 -488
  94. package/dist/integrations/base/ExampleIntegration.d.ts +0 -46
  95. package/dist/integrations/base/ExampleIntegration.js +0 -180
  96. package/dist/integrations/enforcement-gate.d.ts +0 -44
  97. package/dist/integrations/enforcement-gate.js +0 -348
  98. package/dist/mcps/connection/connection-manager.d.ts +0 -39
  99. package/dist/mcps/connection/connection-manager.js +0 -79
  100. package/dist/mcps/index.d.ts +0 -17
  101. package/dist/mcps/index.js +0 -65
  102. package/dist/mcps/orchestrator/index.d.ts +0 -6
  103. package/dist/mcps/orchestrator/index.js +0 -5
  104. package/dist/metrics/index.d.ts +0 -6
  105. package/dist/metrics/index.js +0 -6
  106. package/dist/orchestrator/self-direction-activation.d.ts +0 -108
  107. package/dist/orchestrator/self-direction-activation.js +0 -244
  108. package/dist/orchestrator/universal-registry-bridge.d.ts +0 -84
  109. package/dist/orchestrator/universal-registry-bridge.js +0 -246
  110. package/dist/performance/performance-budget-enforcer.d.ts +0 -157
  111. package/dist/performance/performance-budget-enforcer.js +0 -433
  112. package/dist/performance/performance-regression-tester.d.ts +0 -107
  113. package/dist/performance/performance-regression-tester.js +0 -341
  114. package/dist/postprocessor/analysis/CodeChangeAnalyzer.d.ts +0 -11
  115. package/dist/postprocessor/analysis/CodeChangeAnalyzer.js +0 -50
  116. package/dist/postprocessor/config/ProcessorConfigLoader.d.ts +0 -44
  117. package/dist/postprocessor/config/ProcessorConfigLoader.js +0 -16
  118. package/dist/postprocessor/integration.d.ts +0 -156
  119. package/dist/postprocessor/integration.js +0 -194
  120. package/dist/postprocessor/metamorphosis/index.d.ts +0 -2
  121. package/dist/postprocessor/metamorphosis/index.js +0 -1
  122. package/dist/postprocessor/redeploy/RetryHandler.d.ts +0 -49
  123. package/dist/postprocessor/redeploy/RetryHandler.js +0 -118
  124. package/dist/processors/implementations/session-capture-processor.d.ts +0 -14
  125. package/dist/processors/implementations/session-capture-processor.js +0 -37
  126. package/dist/public/XrayService.d.ts +0 -17
  127. package/dist/public/XrayService.js +0 -40
  128. package/dist/public/index.d.ts +0 -4
  129. package/dist/public/index.js +0 -2
  130. package/dist/security/comprehensive-security-audit.d.ts +0 -157
  131. package/dist/security/comprehensive-security-audit.js +0 -1004
  132. package/dist/security/index.d.ts +0 -13
  133. package/dist/security/index.js +0 -13
  134. package/dist/security/security-agent-coordinator.d.ts +0 -71
  135. package/dist/security/security-agent-coordinator.js +0 -203
  136. package/dist/security/security-hardening-system.d.ts +0 -238
  137. package/dist/security/security-hardening-system.js +0 -726
  138. package/dist/security/security-orchestration-layer.d.ts +0 -118
  139. package/dist/security/security-orchestration-layer.js +0 -495
  140. package/dist/testing/memory-regression-suite.d.ts +0 -105
  141. package/dist/testing/memory-regression-suite.js +0 -258
  142. package/dist/tools/assess-complexity-tool.d.ts +0 -28
  143. package/dist/tools/assess-complexity-tool.js +0 -44
  144. package/dist/tools/query-routing-tool.d.ts +0 -17
  145. package/dist/tools/query-routing-tool.js +0 -59
  146. package/dist/utils/batch-operations.d.ts +0 -25
  147. package/dist/utils/batch-operations.js +0 -292
  148. package/dist/utils/task-graph.d.ts +0 -29
  149. package/dist/utils/task-graph.js +0 -106
  150. package/dist/utils/test-template-generator.d.ts +0 -25
  151. package/dist/utils/test-template-generator.js +0 -178
  152. package/dist/utils/token-manager.d.ts +0 -48
  153. package/dist/utils/token-manager.js +0 -163
  154. package/dist/validation/agent-config-validator.d.ts +0 -110
  155. package/dist/validation/agent-config-validator.js +0 -280
  156. package/dist/validation/orchestration-flow-validator.d.ts +0 -87
  157. package/dist/validation/orchestration-flow-validator.js +0 -606
  158. package/src/mcps/connection/connection-manager.ts +0 -91
  159. package/src/mcps/index.ts +0 -80
  160. package/src/mcps/orchestrator/index.ts +0 -29
@@ -1,257 +0,0 @@
1
- /**
2
- * Consent Manager for 0xRay Central Analytics
3
- *
4
- * Manages user consent for analytics data submission with granular
5
- * control over what categories can be shared.
6
- *
7
- * @since 2026-03-06
8
- */
9
- import * as fs from "fs/promises";
10
- import * as path from "path";
11
- import { frameworkLogger } from "../core/framework-logger.js";
12
- import { getConfigDir, resolveConfigPath } from "../core/config-paths.js";
13
- export class ConsentManager {
14
- configPath;
15
- config = null;
16
- submissionQueue = [];
17
- constructor(configPath = undefined) {
18
- this.configPath = configPath || resolveConfigPath("consent.json") || path.join(getConfigDir(), "consent.json");
19
- }
20
- /**
21
- * Initialize consent manager - load existing config or create default
22
- */
23
- async initialize() {
24
- try {
25
- await this.loadConfig();
26
- if (!this.config) {
27
- // Create default disabled configuration
28
- this.config = this.createDefaultConfig();
29
- await this.saveConfig();
30
- }
31
- return this.config;
32
- }
33
- catch (error) {
34
- // If config doesn't exist, create default
35
- this.config = this.createDefaultConfig();
36
- await this.saveConfig();
37
- return this.config;
38
- }
39
- }
40
- /**
41
- * Enable analytics (opt-in)
42
- */
43
- async enableConsent(categories) {
44
- if (!this.config) {
45
- await this.initialize();
46
- }
47
- if (!this.config) {
48
- throw new Error("Failed to initialize consent configuration");
49
- }
50
- // Enable all categories if none specified
51
- const categoriesToEnable = categories || Object.keys(this.config.categories);
52
- // Enable main analytics flag
53
- this.config.analyticsEnabled = true;
54
- this.config.consentDate = new Date();
55
- this.config.consentVersion = "1.0";
56
- // Enable specified categories
57
- categoriesToEnable.forEach(cat => {
58
- if (this.config && cat in this.config.categories) {
59
- this.config.categories[cat] = true;
60
- }
61
- });
62
- // Generate project ID if not exists
63
- if (!this.config.projectId || this.config.projectId === "") {
64
- this.config.projectId = this.generateProjectId();
65
- }
66
- await this.saveConfig();
67
- }
68
- /**
69
- * Disable analytics (opt-out)
70
- */
71
- async disableConsent() {
72
- if (!this.config) {
73
- await this.initialize();
74
- }
75
- if (!this.config) {
76
- throw new Error("Failed to initialize consent configuration");
77
- }
78
- // Disable all analytics
79
- this.config.analyticsEnabled = false;
80
- this.config.lastOptOut = new Date();
81
- // Disable all categories
82
- Object.keys(this.config.categories).forEach(cat => {
83
- this.config.categories[cat] = false;
84
- });
85
- await this.saveConfig();
86
- // Clear submission queue
87
- await this.clearSubmissionQueue();
88
- }
89
- /**
90
- * Check if submission is allowed for a category
91
- */
92
- canSubmit(category) {
93
- if (!this.config) {
94
- return false;
95
- }
96
- return this.config.analyticsEnabled &&
97
- this.config.categories[category] === true;
98
- }
99
- /**
100
- * Get current consent status
101
- */
102
- async getStatus() {
103
- if (!this.config) {
104
- await this.initialize();
105
- }
106
- if (!this.config) {
107
- throw new Error("Failed to load consent configuration");
108
- }
109
- return { ...this.config };
110
- }
111
- /**
112
- * Enable specific category
113
- */
114
- async enableCategory(category) {
115
- if (!this.config) {
116
- await this.initialize();
117
- }
118
- if (!this.config || !(category in this.config.categories)) {
119
- throw new Error(`Invalid category: ${category}`);
120
- }
121
- this.config.categories[category] = true;
122
- await this.saveConfig();
123
- }
124
- /**
125
- * Disable specific category
126
- */
127
- async disableCategory(category) {
128
- if (!this.config) {
129
- await this.initialize();
130
- }
131
- if (!this.config || !(category in this.config.categories)) {
132
- throw new Error(`Invalid category: ${category}`);
133
- }
134
- this.config.categories[category] = false;
135
- await this.saveConfig();
136
- }
137
- /**
138
- * Get all categories with their status
139
- */
140
- getCategories() {
141
- if (!this.config) {
142
- return [];
143
- }
144
- const categoryInfo = {
145
- reflections: "Anonymized reflection data for pattern learning",
146
- logs: "Framework activity logs for performance analysis",
147
- metrics: "Agent performance and routing metrics",
148
- patterns: "P9 pattern learning data and insights"
149
- };
150
- return Object.entries(this.config.categories).map(([name, enabled]) => ({
151
- name,
152
- description: categoryInfo[name] || "",
153
- enabled: enabled
154
- }));
155
- }
156
- /**
157
- * Generate anonymous project ID
158
- */
159
- generateProjectId() {
160
- // Generate UUID-like identifier
161
- const timestamp = Date.now().toString(36);
162
- const random = Math.random().toString(36).substring(2, 8);
163
- return `project-${timestamp}-${random}`;
164
- }
165
- /**
166
- * Create default disabled configuration
167
- */
168
- createDefaultConfig() {
169
- return {
170
- analyticsEnabled: false,
171
- consentDate: new Date(),
172
- consentVersion: "1.0",
173
- lastOptOut: undefined,
174
- categories: {
175
- reflections: false,
176
- logs: false,
177
- metrics: false,
178
- patterns: false
179
- },
180
- projectId: this.generateProjectId()
181
- };
182
- }
183
- /**
184
- * Load configuration from file
185
- */
186
- async loadConfig() {
187
- try {
188
- const configData = await fs.readFile(this.configPath, "utf-8");
189
- this.config = JSON.parse(configData);
190
- // Convert date strings back to Date objects
191
- if (this.config.consentDate) {
192
- this.config.consentDate = new Date(this.config.consentDate);
193
- }
194
- if (this.config.lastOptOut) {
195
- this.config.lastOptOut = new Date(this.config.lastOptOut);
196
- }
197
- }
198
- catch (error) {
199
- // Config doesn't exist or is invalid
200
- this.config = null;
201
- }
202
- }
203
- /**
204
- * Save configuration to file
205
- */
206
- async saveConfig() {
207
- if (!this.config) {
208
- throw new Error("No configuration to save");
209
- }
210
- // Ensure directory exists
211
- const configDir = path.dirname(this.configPath);
212
- try {
213
- await fs.mkdir(configDir, { recursive: true });
214
- }
215
- catch {
216
- // Directory already exists
217
- }
218
- await fs.writeFile(this.configPath, JSON.stringify(this.config, null, 2), "utf-8");
219
- }
220
- /**
221
- * Clear submission queue
222
- */
223
- async clearSubmissionQueue() {
224
- const queuePath = path.join(path.dirname(this.configPath), "analytics", "submission-queue.json");
225
- try {
226
- await fs.writeFile(queuePath, "[]", "utf-8");
227
- this.submissionQueue = [];
228
- }
229
- catch (error) {
230
- // Queue directory doesn't exist yet, which is fine
231
- }
232
- }
233
- /**
234
- * Add item to submission queue
235
- */
236
- async queueSubmission(data) {
237
- if (!this.canSubmit("all")) {
238
- throw new Error("Analytics is disabled or category not enabled");
239
- }
240
- this.submissionQueue.push(data);
241
- await this.saveSubmissionQueue();
242
- }
243
- /**
244
- * Save submission queue to file
245
- */
246
- async saveSubmissionQueue() {
247
- const queueDir = path.join(path.dirname(this.configPath), "analytics");
248
- const queuePath = path.join(queueDir, "submission-queue.json");
249
- try {
250
- await fs.mkdir(queueDir, { recursive: true });
251
- await fs.writeFile(queuePath, JSON.stringify(this.submissionQueue, null, 2), "utf-8");
252
- }
253
- catch (error) {
254
- frameworkLogger.log("consent-manager", "save-queue-failed", "error", { error, message: "Failed to save submission queue" });
255
- }
256
- }
257
- }
@@ -1,103 +0,0 @@
1
- export interface BenchmarkResult {
2
- operation: string;
3
- startTime: number;
4
- endTime: number;
5
- duration: number;
6
- success: boolean;
7
- metadata: Record<string, any>;
8
- error?: string | undefined;
9
- }
10
- export interface PerformanceMetrics {
11
- totalOperations: number;
12
- successfulOperations: number;
13
- failedOperations: number;
14
- averageDuration: number;
15
- medianDuration: number;
16
- p95Duration: number;
17
- p99Duration: number;
18
- minDuration: number;
19
- maxDuration: number;
20
- throughput: number;
21
- }
22
- export interface BootBenchmarkResult {
23
- totalBootTime: number;
24
- phaseTimings: Record<string, number>;
25
- componentLoadTimes: Record<string, number>;
26
- memoryUsage: {
27
- beforeBoot: number;
28
- afterBoot: number;
29
- peakDuringBoot: number;
30
- };
31
- success: boolean;
32
- errors: string[];
33
- orchestratorLoadTime?: number;
34
- delegationInitTime?: number;
35
- sessionManagementInitTime?: number;
36
- processorActivationTime?: number;
37
- agentLoadingTime?: number;
38
- enforcementActivationTime?: number;
39
- codexComplianceActivationTime?: number;
40
- }
41
- export interface OrchestratorBenchmarkResult {
42
- taskExecutionTimes: number[];
43
- delegationLatencies: number[];
44
- conflictResolutionTimes: number[];
45
- concurrentTaskThroughput: number;
46
- dependencyResolutionTime: number;
47
- overallSuccess: boolean;
48
- }
49
- export interface SessionBenchmarkResult {
50
- stateShareLatencies: number[];
51
- dependencyUpdateTimes: number[];
52
- groupOperationTimes: number[];
53
- migrationTimes: number[];
54
- failoverTimes: number[];
55
- concurrentSessionOperations: number;
56
- }
57
- export declare class XrayPerformanceBenchmark {
58
- private results;
59
- private activeBenchmarks;
60
- /**
61
- * Start a benchmark measurement
62
- */
63
- startBenchmark(operation: string, metadata?: Record<string, any>): string;
64
- /**
65
- * End a benchmark measurement
66
- */
67
- endBenchmark(benchmarkId: string, success?: boolean, error?: string): BenchmarkResult | null;
68
- /**
69
- * Benchmark boot sequence performance
70
- */
71
- benchmarkBootSequence(_bootOrchestrator: unknown): Promise<BootBenchmarkResult>;
72
- /**
73
- * Benchmark orchestrator task execution
74
- */
75
- benchmarkOrchestratorTasks(_orchestrator: unknown, taskCount?: number, concurrentTasks?: number): Promise<OrchestratorBenchmarkResult>;
76
- /**
77
- * Benchmark session management operations
78
- */
79
- benchmarkSessionOperations(_sessionStateManager: unknown, operationCount?: number): Promise<SessionBenchmarkResult>;
80
- /**
81
- * Calculate performance metrics from benchmark results
82
- */
83
- calculateMetrics(operationFilter?: string): PerformanceMetrics;
84
- /**
85
- * Generate comprehensive benchmark report
86
- */
87
- generateReport(): {
88
- summary: PerformanceMetrics;
89
- bootBenchmark?: BootBenchmarkResult;
90
- orchestratorBenchmark?: OrchestratorBenchmarkResult;
91
- sessionBenchmark?: SessionBenchmarkResult;
92
- recommendations: string[];
93
- };
94
- /**
95
- * Clear all benchmark results
96
- */
97
- clearResults(): void;
98
- /**
99
- * Export results for external analysis
100
- */
101
- exportResults(): BenchmarkResult[];
102
- }
103
- export declare const performanceBenchmark: XrayPerformanceBenchmark;