0xray 3.0.14 → 3.1.0
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/.opencode/hooks/post-commit +1 -1
- package/.opencode/init.sh +4 -4
- package/AGENTS.md +2 -2
- package/dist/AGENTS.md +2 -2
- package/dist/CHANGELOG.md +9 -0
- package/dist/benchmark/performance-benchmark.js +4 -2
- package/dist/cli/commands/hermes-install.js +4 -4
- package/dist/cli/commands/mcp-install.js +1 -1
- package/dist/cli/commands/openclaw-install.js +1 -1
- package/dist/cli/commands/plugin-commands.js +2 -2
- package/dist/cli/commands/publish-agent.js +5 -5
- package/dist/cli/commands/skill-install.js +1 -1
- package/dist/cli/commands/status.js +3 -3
- package/dist/cli/commands/storyteller.js +1 -1
- package/dist/cli/index.js +6 -6
- package/dist/cli/server.js +4 -4
- package/dist/core/boot-orchestrator.js +24 -24
- package/dist/core/bridge.mjs +22 -22
- package/dist/core/codex-formatter.js +2 -2
- package/dist/core/codex-injector.js +5 -5
- package/dist/core/config-loader.js +4 -2
- package/dist/core/config-paths.js +14 -14
- package/dist/core/context-loader.js +8 -5
- package/dist/core/index.js +1 -1
- package/dist/core/orchestrator.js +1 -1
- package/dist/core/system-prompt-generator.js +2 -2
- package/dist/core/xray-activation.js +42 -40
- package/dist/delegation/agent-delegator.js +2 -2
- package/dist/enforcement/enforcer-tools.js +2 -2
- package/dist/enforcement/loaders/codex-loader.js +2 -2
- package/dist/governance/llm-governance-provider.js +210 -0
- package/dist/index.js +8 -6
- package/dist/inference/deploy-verifier.js +1 -1
- package/dist/inference/inference-cycle.js +7 -7
- package/dist/integrations/hermes-agent/__init__.py +72 -72
- package/dist/integrations/hermes-agent/after-install.md +14 -14
- package/dist/integrations/hermes-agent/bridge.mjs +24 -24
- package/dist/integrations/hermes-agent/plugin.yaml +5 -5
- package/dist/integrations/hermes-agent/schemas.py +12 -12
- package/dist/integrations/hermes-agent/test_plugin.py +117 -117
- package/dist/integrations/hermes-agent/tools.py +25 -25
- package/dist/integrations/plugins/plugin-registry.js +2 -2
- package/dist/mcps/config/server-config-registry.js +10 -10
- package/dist/mcps/connection/mcp-connection.js +1 -1
- package/dist/mcps/framework-help.server.js +6 -6
- package/dist/mcps/knowledge-skills/code-review.server.js +12 -37
- package/dist/mcps/knowledge-skills/security-audit.server.js +12 -42
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js +2 -2
- package/dist/mcps/lint.server.js +2 -2
- package/dist/mcps/mcp-client.js +5 -5
- package/dist/mcps/orchestrator/server.js +2 -2
- package/dist/mcps/researcher.server.js +12 -37
- package/dist/mcps/simulation/server-simulations.js +3 -3
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.js +2 -2
- package/dist/orchestrator/intelligent-commit-batcher.js +3 -3
- package/dist/orchestrator/multi-agent-orchestration-coordinator.js +9 -9
- package/dist/orchestrator/orchestrator.js +10 -8
- package/dist/orchestrator/universal-registry-bridge.js +3 -3
- package/dist/plugin/xray-codex-injection.js +21 -21
- package/dist/postprocessor/PostProcessor.js +5 -5
- package/dist/postprocessor/services/RegressionAnalysisService.js +2 -2
- package/dist/postprocessor/triggers/GitHookTrigger.js +14 -14
- package/dist/processors/implementations/agents-md-validation-processor.js +2 -2
- package/dist/processors/implementations/inference-improvement-processor.js +1 -1
- package/dist/processors/implementations/log-protection-processor.js +2 -2
- package/dist/processors/implementations/publish-preflight-processor.js +3 -3
- package/dist/processors/implementations/regression-testing-processor.js +2 -2
- package/dist/processors/implementations/session-summary-processor.js +1 -1
- package/dist/processors/implementations/storytelling-trigger-processor.js +1 -1
- package/dist/reporting/report-formatter.js +1 -1
- package/dist/scripts/activate-kernel-pipeline.js +2 -2
- package/dist/services/inference-tuner.js +2 -2
- package/dist/skills/hermes-agent/SKILL.md +42 -42
- package/dist/skills/storyteller/SKILL.md +1 -1
- package/dist/state/index.js +2 -1
- package/dist/state/state-manager.js +3 -3
- package/dist/utils/token-manager.js +1 -1
- package/dist/validation/estimation-validator.js +1 -1
- package/package.json +1 -1
- package/scripts/node/pre-publish-guard.js +13 -9
- package/scripts/node/universal-version-manager.js +2 -2
- package/src/mcps/config/__tests__/server-config-registry.test.ts +12 -12
- package/src/mcps/config/server-config-registry.ts +10 -10
- package/src/mcps/connection/mcp-connection.ts +1 -1
- package/src/mcps/framework-help.server.ts +6 -6
- package/src/mcps/knowledge-skills/code-review.server.ts +19 -34
- package/src/mcps/knowledge-skills/security-audit.server.ts +19 -38
- package/src/mcps/knowledge-skills/ui-ux-design.server.ts +2 -2
- package/src/mcps/lint.server.ts +2 -2
- package/src/mcps/mcp-client.ts +5 -5
- package/src/mcps/orchestrator/server.ts +2 -2
- package/src/mcps/researcher.server.ts +19 -34
- package/src/mcps/simulation/server-simulations.ts +3 -3
- package/src/skills/hermes-agent/SKILL.md +42 -42
- package/src/skills/storyteller/SKILL.md +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Intelligent Commit Batcher - Batches related changes for optimal commit history
|
|
3
3
|
* Implements configurable thresholds for file count, time windows, and risk levels
|
|
4
4
|
*
|
|
5
|
-
* Configuration is read from .
|
|
5
|
+
* Configuration is read from .xray/features.json -> commit_cycle
|
|
6
6
|
*/
|
|
7
7
|
import * as fs from "fs";
|
|
8
8
|
import * as path from "path";
|
|
@@ -36,8 +36,8 @@ export class IntelligentCommitBatcher {
|
|
|
36
36
|
loadFeaturesConfig() {
|
|
37
37
|
try {
|
|
38
38
|
const configPaths = [
|
|
39
|
-
path.join(process.cwd(), ".
|
|
40
|
-
path.join(process.cwd(), ".opencode", "
|
|
39
|
+
path.join(process.cwd(), ".xray", "features.json"),
|
|
40
|
+
path.join(process.cwd(), ".opencode", "xray", "features.json"),
|
|
41
41
|
];
|
|
42
42
|
for (const configPath of configPaths) {
|
|
43
43
|
if (fs.existsSync(configPath)) {
|
|
@@ -10,22 +10,22 @@
|
|
|
10
10
|
import { KernelOrchestrator } from "../core/orchestrator.js";
|
|
11
11
|
import { enhancedMultiAgentOrchestrator } from "./enhanced-multi-agent-orchestrator.js";
|
|
12
12
|
import { createAgentDelegator } from "../delegation/agent-delegator.js";
|
|
13
|
-
import {
|
|
13
|
+
import { XrayStateManager } from "../state/state-manager.js";
|
|
14
14
|
import { frameworkLogger } from "../core/framework-logger.js";
|
|
15
15
|
import { ComplexityAnalyzer } from "../delegation/complexity-analyzer.js";
|
|
16
|
-
import { strRayConfigLoader } from "../core/config-loader.js";
|
|
16
|
+
import { strRayConfigLoader as xrayConfigLoader } from "../core/config-loader.js";
|
|
17
17
|
export class MultiAgentOrchestrationCoordinator {
|
|
18
|
-
|
|
18
|
+
xrayOrchestrator;
|
|
19
19
|
enhancedOrchestrator;
|
|
20
20
|
agentDelegator;
|
|
21
21
|
stateManager;
|
|
22
22
|
complexityAnalyzer;
|
|
23
23
|
coordinationMetrics;
|
|
24
24
|
constructor(stateManager) {
|
|
25
|
-
this.stateManager = stateManager || new
|
|
26
|
-
this.
|
|
25
|
+
this.stateManager = stateManager || new XrayStateManager();
|
|
26
|
+
this.xrayOrchestrator = new KernelOrchestrator();
|
|
27
27
|
this.enhancedOrchestrator = enhancedMultiAgentOrchestrator;
|
|
28
|
-
this.agentDelegator = createAgentDelegator(this.stateManager,
|
|
28
|
+
this.agentDelegator = createAgentDelegator(this.stateManager, xrayConfigLoader);
|
|
29
29
|
this.complexityAnalyzer = new ComplexityAnalyzer();
|
|
30
30
|
this.coordinationMetrics = {
|
|
31
31
|
totalWorkflows: 0,
|
|
@@ -43,7 +43,7 @@ export class MultiAgentOrchestrationCoordinator {
|
|
|
43
43
|
initializeCoordinationSystem() {
|
|
44
44
|
// Register coordination components in state manager
|
|
45
45
|
this.stateManager.set("coordination:main_coordinator", this);
|
|
46
|
-
this.stateManager.set("coordination:
|
|
46
|
+
this.stateManager.set("coordination:xray_orchestrator", this.xrayOrchestrator);
|
|
47
47
|
this.stateManager.set("coordination:enhanced_orchestrator", this.enhancedOrchestrator);
|
|
48
48
|
this.stateManager.set("coordination:agent_delegator", this.agentDelegator);
|
|
49
49
|
this.stateManager.set("coordination:metrics", this.coordinationMetrics);
|
|
@@ -175,7 +175,7 @@ export class MultiAgentOrchestrationCoordinator {
|
|
|
175
175
|
dependencies: [],
|
|
176
176
|
subagentType: "orchestrator",
|
|
177
177
|
};
|
|
178
|
-
const result = await this.
|
|
178
|
+
const result = await this.xrayOrchestrator.executeComplexTask(task.description, [task]);
|
|
179
179
|
result.forEach((r) => {
|
|
180
180
|
taskResults.push({
|
|
181
181
|
success: r.success,
|
|
@@ -448,7 +448,7 @@ export class MultiAgentOrchestrationCoordinator {
|
|
|
448
448
|
async shutdown() {
|
|
449
449
|
frameworkLogger.log("orchestration-coordinator", "Shutting down multi-agent orchestration coordinator", "info");
|
|
450
450
|
await this.enhancedOrchestrator.shutdown();
|
|
451
|
-
await this.
|
|
451
|
+
await this.xrayOrchestrator.getStatus(); // Just get status, no actual shutdown method
|
|
452
452
|
frameworkLogger.log("orchestration-coordinator", "Multi-agent orchestration coordinator shutdown complete", "info");
|
|
453
453
|
}
|
|
454
454
|
}
|
|
@@ -13,9 +13,9 @@ import { routingOutcomeTracker } from "../delegation/analytics/outcome-tracker.j
|
|
|
13
13
|
import { patternPerformanceTracker } from "../analytics/pattern-performance-tracker.js";
|
|
14
14
|
import { VotingCoordinator } from "../delegation/voting-coordinator.js";
|
|
15
15
|
import { getAgentExpertiseLevel } from "../delegation/agent-expertise.js";
|
|
16
|
-
import {
|
|
16
|
+
import { XrayStateManager } from "../state/state-manager.js";
|
|
17
17
|
import fs from "fs";
|
|
18
|
-
export class
|
|
18
|
+
export class XrayOrchestrator {
|
|
19
19
|
config;
|
|
20
20
|
activeTasks = new Map();
|
|
21
21
|
taskToAgentMap = new Map();
|
|
@@ -28,7 +28,7 @@ export class StringRayOrchestrator {
|
|
|
28
28
|
conflictResolutionStrategy: loadedConfig?.conflictResolutionStrategy ?? "majority_vote",
|
|
29
29
|
...config,
|
|
30
30
|
};
|
|
31
|
-
this.votingCoordinator = new VotingCoordinator(new
|
|
31
|
+
this.votingCoordinator = new VotingCoordinator(new XrayStateManager());
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Load orchestrator config from features.json
|
|
@@ -36,8 +36,8 @@ export class StringRayOrchestrator {
|
|
|
36
36
|
loadOrchestratorConfig() {
|
|
37
37
|
try {
|
|
38
38
|
const configPaths = [
|
|
39
|
-
".
|
|
40
|
-
".opencode/
|
|
39
|
+
".xray/features.json",
|
|
40
|
+
".opencode/xray/features.json",
|
|
41
41
|
];
|
|
42
42
|
for (const configPath of configPaths) {
|
|
43
43
|
if (fs.existsSync(configPath)) {
|
|
@@ -151,7 +151,7 @@ export class StringRayOrchestrator {
|
|
|
151
151
|
// Execute post-processors for agent task completion logging
|
|
152
152
|
try {
|
|
153
153
|
// Get processor manager from global state
|
|
154
|
-
const globalStateManager = globalThis.
|
|
154
|
+
const globalStateManager = globalThis.xrayStateManager;
|
|
155
155
|
frameworkLogger.log("orchestrator", "global-state-check", "debug", {
|
|
156
156
|
jobId,
|
|
157
157
|
exists: !!globalStateManager,
|
|
@@ -200,7 +200,7 @@ export class StringRayOrchestrator {
|
|
|
200
200
|
await frameworkLogger.log("orchestrator", "task-execution-failed", "error", { taskId: task.id, duration, error: String(error) });
|
|
201
201
|
// Execute post-processors even on failure for error logging
|
|
202
202
|
try {
|
|
203
|
-
const globalStateManager = globalThis.
|
|
203
|
+
const globalStateManager = globalThis.xrayStateManager;
|
|
204
204
|
const processorManager = globalStateManager?.get("processor:manager");
|
|
205
205
|
if (processorManager) {
|
|
206
206
|
const agentContext = {
|
|
@@ -654,4 +654,6 @@ export class StringRayOrchestrator {
|
|
|
654
654
|
}
|
|
655
655
|
}
|
|
656
656
|
// Export singleton instance
|
|
657
|
-
export const
|
|
657
|
+
export const xrayOrchestrator = new XrayOrchestrator();
|
|
658
|
+
// Backward compatibility alias
|
|
659
|
+
export { XrayOrchestrator as StringRayOrchestrator };
|
|
@@ -164,8 +164,8 @@ export class UniversalRegistryBridge {
|
|
|
164
164
|
}
|
|
165
165
|
const pkg = await response.json();
|
|
166
166
|
// Look for agent definitions in package exports
|
|
167
|
-
if (pkg.
|
|
168
|
-
return pkg.
|
|
167
|
+
if (pkg.xray?.agents) {
|
|
168
|
+
return pkg.xray.agents;
|
|
169
169
|
}
|
|
170
170
|
return [];
|
|
171
171
|
}
|
|
@@ -214,7 +214,7 @@ export class UniversalRegistryBridge {
|
|
|
214
214
|
* Create a bridge from integration config
|
|
215
215
|
*/
|
|
216
216
|
export async function createRegistryBridge(configPath) {
|
|
217
|
-
const defaultPath = resolve(process.cwd(), ".
|
|
217
|
+
const defaultPath = resolve(process.cwd(), ".xray/integration/registries.json");
|
|
218
218
|
const path = configPath || defaultPath;
|
|
219
219
|
let registries = [];
|
|
220
220
|
if (existsSync(path)) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Consumer runtime compat shim from prior
|
|
2
|
+
* Consumer runtime compat shim from prior 0xRay releases (1-line min per Scope Rule; xray codex injection + XRAY_||STRRAY_ env + .xray fallbacks).
|
|
3
3
|
*/
|
|
4
4
|
import * as fs from "fs";
|
|
5
5
|
import * as path from "path";
|
|
@@ -12,7 +12,7 @@ let _resolveStateDir = null;
|
|
|
12
12
|
let _frameworkLogger = null;
|
|
13
13
|
let _systemPromptGenerator = null;
|
|
14
14
|
let _ProcessorManager = null;
|
|
15
|
-
let
|
|
15
|
+
let _XrayStateManager = null;
|
|
16
16
|
let _featuresConfigLoader = null;
|
|
17
17
|
let _detectTaskType = null;
|
|
18
18
|
// ---------------------------------------------------------------------------
|
|
@@ -100,8 +100,8 @@ function validateModulePath(resolvedPath, allowedPrefix) {
|
|
|
100
100
|
throw new Error(`Module path validation failed: ${normalized} is outside allowed path ${allowed}`);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
async function
|
|
104
|
-
if (_ProcessorManager &&
|
|
103
|
+
async function loadXrayComponents() {
|
|
104
|
+
if (_ProcessorManager && _XrayStateManager && _featuresConfigLoader)
|
|
105
105
|
return;
|
|
106
106
|
const logger = await getOrCreateLogger(process.cwd());
|
|
107
107
|
try {
|
|
@@ -116,7 +116,7 @@ async function loadStringRayComponents() {
|
|
|
116
116
|
const stateModule = await import(`${root}/dist/state/state-manager.js`);
|
|
117
117
|
const featuresModule = await import(`${root}/dist/core/features-config.js`);
|
|
118
118
|
_ProcessorManager = procModule.ProcessorManager;
|
|
119
|
-
|
|
119
|
+
_XrayStateManager = stateModule.XrayStateManager ?? stateModule.StrRayStateManager;
|
|
120
120
|
_featuresConfigLoader = featuresModule.featuresConfigLoader;
|
|
121
121
|
_detectTaskType = featuresModule.detectTaskType;
|
|
122
122
|
logger.log(`✅ Loaded from cwd/dist/`);
|
|
@@ -126,7 +126,7 @@ async function loadStringRayComponents() {
|
|
|
126
126
|
const message = e instanceof Error ? e.message : String(e);
|
|
127
127
|
logger.log(`❌ Failed to load from cwd/dist/: ${message}`);
|
|
128
128
|
}
|
|
129
|
-
const pluginPaths = ["0xray"
|
|
129
|
+
const pluginPaths = ["0xray"];
|
|
130
130
|
for (const pluginPath of pluginPaths) {
|
|
131
131
|
try {
|
|
132
132
|
// FIXED: Avoided hardcoded /dist/ in node_modules paths to prevent build corruption
|
|
@@ -138,7 +138,7 @@ async function loadStringRayComponents() {
|
|
|
138
138
|
const sm = await import(`${process.cwd()}/node_modules/${pluginPath}/dist/state/state-manager.js`);
|
|
139
139
|
const fm = await import(`${process.cwd()}/node_modules/${pluginPath}/dist/core/features-config.js`);
|
|
140
140
|
_ProcessorManager = pm.ProcessorManager;
|
|
141
|
-
|
|
141
|
+
_XrayStateManager = sm.XrayStateManager ?? sm.StrRayStateManager;
|
|
142
142
|
_featuresConfigLoader = fm.featuresConfigLoader;
|
|
143
143
|
_detectTaskType = fm.detectTaskType;
|
|
144
144
|
logger.log(`✅ Loaded from node_modules/${pluginPath}/dist/`);
|
|
@@ -186,7 +186,7 @@ class PluginLogger {
|
|
|
186
186
|
fs.mkdirSync(logsDir, { recursive: true });
|
|
187
187
|
}
|
|
188
188
|
const today = new Date().toISOString().split("T")[0];
|
|
189
|
-
this.logPath = path.join(logsDir, `
|
|
189
|
+
this.logPath = path.join(logsDir, `xray-plugin-${today}.log`);
|
|
190
190
|
}
|
|
191
191
|
async logAsync(message) {
|
|
192
192
|
try {
|
|
@@ -337,7 +337,7 @@ let cachedCodexContexts = null;
|
|
|
337
337
|
async function getCodexFileLocations(directory) {
|
|
338
338
|
const root = directory || process.cwd();
|
|
339
339
|
const resolved = await resolveCodexPath(root);
|
|
340
|
-
resolved.push(path.join(root, ".opencode", "codex.codex"), path.join(root, ".
|
|
340
|
+
resolved.push(path.join(root, ".opencode", "codex.codex"), path.join(root, ".xray", "agents_template.md"), path.join(root, ".opencode", "xray", "agents_template.md"), path.join(root, "AGENTS.md"));
|
|
341
341
|
return resolved;
|
|
342
342
|
}
|
|
343
343
|
function readFileContent(filePath) {
|
|
@@ -467,7 +467,7 @@ function isWriteEditOperation(tool) {
|
|
|
467
467
|
return tool === "write" || tool === "edit" || tool === "multiedit";
|
|
468
468
|
}
|
|
469
469
|
function isPublishOperation(tool) {
|
|
470
|
-
return tool === "publish" || tool === "release" || tool === "npm-publish" || tool === "
|
|
470
|
+
return tool === "publish" || tool === "release" || tool === "npm-publish" || tool === "xray-release";
|
|
471
471
|
}
|
|
472
472
|
function resolveAgentName(input) {
|
|
473
473
|
const globalAgent = globalThis.currentAgent;
|
|
@@ -533,7 +533,7 @@ function logTestAutoCreationResult(results, logger) {
|
|
|
533
533
|
// ---------------------------------------------------------------------------
|
|
534
534
|
// Main plugin function
|
|
535
535
|
// ---------------------------------------------------------------------------
|
|
536
|
-
export default async function
|
|
536
|
+
export default async function xrayCodexPlugin(input) {
|
|
537
537
|
const { directory: inputDirectory } = input;
|
|
538
538
|
const directory = inputDirectory || process.cwd();
|
|
539
539
|
return {
|
|
@@ -568,7 +568,7 @@ export default async function strrayCodexPlugin(input) {
|
|
|
568
568
|
const logger = await getOrCreateLogger(directory);
|
|
569
569
|
logger.log(`🚀 TOOL EXECUTE BEFORE HOOK FIRED: ${input.tool}`);
|
|
570
570
|
logger.log(`📥 Full input: ${JSON.stringify(input)}`);
|
|
571
|
-
await
|
|
571
|
+
await loadXrayComponents();
|
|
572
572
|
if (_featuresConfigLoader && _detectTaskType) {
|
|
573
573
|
try {
|
|
574
574
|
const config = _featuresConfigLoader.loadConfig();
|
|
@@ -595,21 +595,21 @@ export default async function strrayCodexPlugin(input) {
|
|
|
595
595
|
}
|
|
596
596
|
logger.log(`✅ Quality gate passed for ${tool}`);
|
|
597
597
|
if (isWriteEditOperation(tool)) {
|
|
598
|
-
if (!_ProcessorManager || !
|
|
599
|
-
logger.error("ProcessorManager or
|
|
598
|
+
if (!_ProcessorManager || !_XrayStateManager) {
|
|
599
|
+
logger.error("ProcessorManager or XrayStateManager not loaded");
|
|
600
600
|
return;
|
|
601
601
|
}
|
|
602
602
|
let stateManager;
|
|
603
603
|
let processorManager;
|
|
604
|
-
const globalState = globalThis.
|
|
604
|
+
const globalState = globalThis.xrayStateManager;
|
|
605
605
|
if (globalState) {
|
|
606
606
|
logger.log("🔗 Connecting to booted 0xRay framework");
|
|
607
607
|
stateManager = globalState;
|
|
608
608
|
}
|
|
609
609
|
else {
|
|
610
610
|
logger.log("🚀 0xRay framework not booted, initializing...");
|
|
611
|
-
stateManager = new
|
|
612
|
-
globalThis.
|
|
611
|
+
stateManager = new _XrayStateManager(await resolveStateDir(directory));
|
|
612
|
+
globalThis.xrayStateManager = stateManager;
|
|
613
613
|
}
|
|
614
614
|
processorManager = stateManager.get("processor:manager") ?? null;
|
|
615
615
|
if (!processorManager) {
|
|
@@ -667,7 +667,7 @@ export default async function strrayCodexPlugin(input) {
|
|
|
667
667
|
},
|
|
668
668
|
"tool.execute.after": async (input, _output) => {
|
|
669
669
|
const logger = await getOrCreateLogger(directory);
|
|
670
|
-
await
|
|
670
|
+
await loadXrayComponents();
|
|
671
671
|
const { tool, args, result } = input;
|
|
672
672
|
try {
|
|
673
673
|
const { routingOutcomeTracker } = await import("../delegation/analytics/outcome-tracker.js");
|
|
@@ -699,9 +699,9 @@ export default async function strrayCodexPlugin(input) {
|
|
|
699
699
|
}
|
|
700
700
|
logger.log(`📥 After hook input: ${JSON.stringify({ tool, hasArgs: !!args, args, hasResult: !!result }).slice(0, 200)}`);
|
|
701
701
|
if (isWriteEditOperation(tool)) {
|
|
702
|
-
if (!_ProcessorManager || !
|
|
702
|
+
if (!_ProcessorManager || !_XrayStateManager)
|
|
703
703
|
return;
|
|
704
|
-
const stateManager = new
|
|
704
|
+
const stateManager = new _XrayStateManager(await resolveStateDir(directory));
|
|
705
705
|
const processorManager = new _ProcessorManager(stateManager);
|
|
706
706
|
registerAfterPostProcessors(processorManager);
|
|
707
707
|
try {
|
|
@@ -816,7 +816,7 @@ export default async function strrayCodexPlugin(input) {
|
|
|
816
816
|
}
|
|
817
817
|
},
|
|
818
818
|
config: async (_config) => {
|
|
819
|
-
const lockFile = path.join(directory, ".opencode", "logs", ".
|
|
819
|
+
const lockFile = path.join(directory, ".opencode", "logs", ".xray-init.lock");
|
|
820
820
|
const now = Date.now();
|
|
821
821
|
try {
|
|
822
822
|
if (fs.existsSync(lockFile)) {
|
|
@@ -208,7 +208,7 @@ export class PostProcessor {
|
|
|
208
208
|
const fs = await import("fs");
|
|
209
209
|
const path = await import("path");
|
|
210
210
|
try {
|
|
211
|
-
const configPath = resolveConfigPath("features.json") ?? path.join(process.cwd(), ".opencode", "
|
|
211
|
+
const configPath = resolveConfigPath("features.json") ?? path.join(process.cwd(), ".opencode", "xray", "features.json");
|
|
212
212
|
if (fs.existsSync(configPath)) {
|
|
213
213
|
const config = JSON.parse(fs.readFileSync(configPath, "utf-8"));
|
|
214
214
|
return config.processors || {};
|
|
@@ -225,7 +225,7 @@ export class PostProcessor {
|
|
|
225
225
|
* Initialize the post-processor system
|
|
226
226
|
*/
|
|
227
227
|
async initialize() {
|
|
228
|
-
await frameworkLogger.log("-post-processor", "-initializing-
|
|
228
|
+
await frameworkLogger.log("-post-processor", "-initializing-xray-post-processor-", "info", { message: "🚀 Initializing 0xRay Post-Processor..." });
|
|
229
229
|
// Initialize monitoring
|
|
230
230
|
if (this.config.monitoring.enabled) {
|
|
231
231
|
await this.monitoringEngine.initialize();
|
|
@@ -337,9 +337,9 @@ export class PostProcessor {
|
|
|
337
337
|
const postProcessor = globalThis.strRayPostProcessor;
|
|
338
338
|
if (!stateManager) {
|
|
339
339
|
try {
|
|
340
|
-
const {
|
|
341
|
-
const tempStateManager = new
|
|
342
|
-
globalThis.
|
|
340
|
+
const { XrayStateManager } = await import("../state/state-manager.js");
|
|
341
|
+
const tempStateManager = new XrayStateManager();
|
|
342
|
+
globalThis.xrayStateManager = tempStateManager;
|
|
343
343
|
return {
|
|
344
344
|
passed: true,
|
|
345
345
|
message: "System integrity verified (graceful mode)",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { getKernel } from '../../core/kernel-patterns.js';
|
|
12
12
|
import { createAgentDelegator } from '../../delegation/agent-delegator.js';
|
|
13
13
|
import { frameworkLogger } from '../../core/framework-logger.js';
|
|
14
|
-
import {
|
|
14
|
+
import { XrayStateManager } from '../../state/state-manager.js';
|
|
15
15
|
import { strRayConfigLoader } from '../../core/config-loader.js';
|
|
16
16
|
/**
|
|
17
17
|
* Main service for systematic regression analysis
|
|
@@ -94,7 +94,7 @@ export class RegressionAnalysisService {
|
|
|
94
94
|
conferenceType: 'regression-investigation'
|
|
95
95
|
};
|
|
96
96
|
// Create agent delegator for this operation
|
|
97
|
-
const stateManager = new
|
|
97
|
+
const stateManager = new XrayStateManager();
|
|
98
98
|
const agentDelegator = createAgentDelegator(stateManager, strRayConfigLoader);
|
|
99
99
|
// Analyze delegation strategy
|
|
100
100
|
const analysis = await agentDelegator.analyzeDelegation(delegationRequest);
|
|
@@ -314,7 +314,7 @@ if [ -z "$COMMIT_SHA" ]; then
|
|
|
314
314
|
fi
|
|
315
315
|
|
|
316
316
|
# Get repository info
|
|
317
|
-
REPO="
|
|
317
|
+
REPO="0xRayAI/xray" # Placeholder for now
|
|
318
318
|
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
319
319
|
AUTHOR=$(git log -1 --pretty=format:'%an <%ae>')
|
|
320
320
|
|
|
@@ -330,25 +330,25 @@ fi
|
|
|
330
330
|
cd "$(dirname "$0")/../.." # Navigate to project root
|
|
331
331
|
|
|
332
332
|
# Find the 0xRay plugin in node_modules or current project (development)
|
|
333
|
-
|
|
334
|
-
if [ -d "node_modules/
|
|
335
|
-
|
|
336
|
-
elif [ -d "node_modules/@
|
|
337
|
-
|
|
338
|
-
elif [ -d "node_modules/OpenCode/plugins/
|
|
339
|
-
|
|
333
|
+
XRAY_PLUGIN=""
|
|
334
|
+
if [ -d "node_modules/0xray" ]; then
|
|
335
|
+
XRAY_PLUGIN="node_modules/0xray"
|
|
336
|
+
elif [ -d "node_modules/@0xray/xray" ]; then
|
|
337
|
+
XRAY_PLUGIN="node_modules/@0xray/xray"
|
|
338
|
+
elif [ -d "node_modules/OpenCode/plugins/0xray" ]; then
|
|
339
|
+
XRAY_PLUGIN="node_modules/OpenCode/plugins/0xray"
|
|
340
340
|
elif [ -f "dist/postprocessor/PostProcessor.js" ]; then
|
|
341
341
|
# Development mode - use current project
|
|
342
|
-
|
|
342
|
+
XRAY_PLUGIN="."
|
|
343
343
|
fi
|
|
344
344
|
|
|
345
|
-
if command -v node >/dev/null 2>&1 && [ -n "$
|
|
345
|
+
if command -v node >/dev/null 2>&1 && [ -n "$XRAY_PLUGIN" ]; then
|
|
346
346
|
# Call a separate script to avoid bash variable issues
|
|
347
347
|
export COMMIT_SHA="$COMMIT_SHA"
|
|
348
348
|
export REPO="$REPO"
|
|
349
349
|
export BRANCH="$BRANCH"
|
|
350
350
|
export AUTHOR="$AUTHOR"
|
|
351
|
-
export
|
|
351
|
+
export XRAY_PLUGIN="$XRAY_PLUGIN"
|
|
352
352
|
export MONITORING_LEVEL="$MONITORING_LEVEL"
|
|
353
353
|
export IS_FULL_MONITORING="$([ "$MONITORING_LEVEL" = "full" ] && echo "true" || echo "false")"
|
|
354
354
|
|
|
@@ -422,7 +422,7 @@ fi
|
|
|
422
422
|
// Core inference/logging - NEVER DELETE
|
|
423
423
|
'activity.log',
|
|
424
424
|
'framework-activity-',
|
|
425
|
-
'
|
|
425
|
+
'xray-plugin-',
|
|
426
426
|
|
|
427
427
|
// Analysis & reflections - Contains inference data
|
|
428
428
|
'kernel-',
|
|
@@ -441,8 +441,8 @@ fi
|
|
|
441
441
|
'reflections/',
|
|
442
442
|
|
|
443
443
|
// Init logs can be cleaned but keep recent
|
|
444
|
-
'
|
|
445
|
-
'
|
|
444
|
+
'xray-init-2026-01-2', // Keep Jan 20s
|
|
445
|
+
'xray-init-2026-01-3', // Keep Jan 30s
|
|
446
446
|
|
|
447
447
|
// Other important files
|
|
448
448
|
'current-session.log',
|
|
@@ -212,7 +212,7 @@ export class AgentsMdValidationProcessor {
|
|
|
212
212
|
"",
|
|
213
213
|
"## Available Skills",
|
|
214
214
|
"",
|
|
215
|
-
"
|
|
215
|
+
"0xRay ships with 30 framework skills and provides a registry of 10 curated community sources.",
|
|
216
216
|
"",
|
|
217
217
|
"```bash",
|
|
218
218
|
"npx 0xray skill:install # Show starter packs + available sources",
|
|
@@ -225,7 +225,7 @@ export class AgentsMdValidationProcessor {
|
|
|
225
225
|
"",
|
|
226
226
|
"## Codex",
|
|
227
227
|
"",
|
|
228
|
-
`
|
|
228
|
+
`0xRay enforces Universal Development Codex (60 terms) for systematic error prevention.`,
|
|
229
229
|
"",
|
|
230
230
|
].join("\n"),
|
|
231
231
|
"## CLI Commands": [
|
|
@@ -38,7 +38,7 @@ export class InferenceImprovementProcessor extends PostProcessor {
|
|
|
38
38
|
loadInferenceConfig() {
|
|
39
39
|
try {
|
|
40
40
|
const configPaths = [
|
|
41
|
-
path.join(process.cwd(), ".
|
|
41
|
+
path.join(process.cwd(), ".xray", "features.json"),
|
|
42
42
|
path.join(process.cwd(), ".opencode", "strray", "features.json"),
|
|
43
43
|
];
|
|
44
44
|
for (const configPath of configPaths) {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Protected files:
|
|
8
8
|
* - routing-outcomes.json (routing analytics - NEVER delete)
|
|
9
9
|
* - activity.log (framework activity - NEVER delete)
|
|
10
|
-
* -
|
|
10
|
+
* - xray-plugin-*.log (plugin logs)
|
|
11
11
|
*
|
|
12
12
|
* Archival flow is ALLOWED:
|
|
13
13
|
* - framework-activity-*.log.gz (archived/compressed logs)
|
|
@@ -31,7 +31,7 @@ const ACTIVE_LOG_PATTERNS = [
|
|
|
31
31
|
*/
|
|
32
32
|
const ARCHIVE_PATTERNS = [
|
|
33
33
|
/framework-activity-.+\.log\.gz$/,
|
|
34
|
-
/
|
|
34
|
+
/xray-plugin-.+\.log\.gz$/,
|
|
35
35
|
];
|
|
36
36
|
/**
|
|
37
37
|
* Directories/files that are protected
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Ensures README.md, AGENTS.md, and reflection documents are up-to-date
|
|
6
6
|
* before allowing npm publish.
|
|
7
7
|
*
|
|
8
|
-
* Configuration is read from .
|
|
8
|
+
* Configuration is read from .xray/features.json
|
|
9
9
|
*
|
|
10
10
|
* @processor_type post
|
|
11
11
|
* @priority 10 (runs early after post-processing starts)
|
|
@@ -45,8 +45,8 @@ export class PublishPreflightProcessor extends PostProcessor {
|
|
|
45
45
|
loadConfig() {
|
|
46
46
|
try {
|
|
47
47
|
const configPaths = [
|
|
48
|
-
path.join(process.cwd(), ".
|
|
49
|
-
path.join(process.cwd(), ".opencode", "
|
|
48
|
+
path.join(process.cwd(), ".xray", "features.json"),
|
|
49
|
+
path.join(process.cwd(), ".opencode", "xray", "features.json"),
|
|
50
50
|
];
|
|
51
51
|
for (const configPath of configPaths) {
|
|
52
52
|
if (fs.existsSync(configPath)) {
|
|
@@ -14,7 +14,7 @@ export class RegressionTestingProcessor extends PostProcessor {
|
|
|
14
14
|
};
|
|
15
15
|
try {
|
|
16
16
|
const projectRoot = process.cwd();
|
|
17
|
-
const testCountPath = path.join(projectRoot, ".opencode", "
|
|
17
|
+
const testCountPath = path.join(projectRoot, ".opencode", "xray", "test-count.json");
|
|
18
18
|
if (!fs.existsSync(testCountPath)) {
|
|
19
19
|
frameworkLogger.log("regression-testing-processor", "no-baseline", "info", { message: "No test-count.json baseline found" });
|
|
20
20
|
return result;
|
|
@@ -46,7 +46,7 @@ export class RegressionTestingProcessor extends PostProcessor {
|
|
|
46
46
|
}
|
|
47
47
|
getCurrentTestCount(projectRoot) {
|
|
48
48
|
try {
|
|
49
|
-
const testCountPath = path.join(projectRoot, ".opencode", "
|
|
49
|
+
const testCountPath = path.join(projectRoot, ".opencode", "xray", "test-count.json");
|
|
50
50
|
if (!fs.existsSync(testCountPath))
|
|
51
51
|
return 0;
|
|
52
52
|
const data = JSON.parse(fs.readFileSync(testCountPath, "utf-8"));
|
|
@@ -31,7 +31,7 @@ export class SessionSummaryProcessor extends PostProcessor {
|
|
|
31
31
|
loadConfig() {
|
|
32
32
|
try {
|
|
33
33
|
const featuresPath = path.join(process.cwd(), ".opencode", "strray", "features.json");
|
|
34
|
-
const altPath = path.join(process.cwd(), ".
|
|
34
|
+
const altPath = path.join(process.cwd(), ".xray", "features.json");
|
|
35
35
|
const configPath = fs.existsSync(featuresPath) ? featuresPath :
|
|
36
36
|
fs.existsSync(altPath) ? altPath : null;
|
|
37
37
|
if (configPath) {
|
|
@@ -34,7 +34,7 @@ export class StorytellingTriggerProcessor extends PostProcessor {
|
|
|
34
34
|
}
|
|
35
35
|
resolveConfigPath(filename) {
|
|
36
36
|
const candidates = [
|
|
37
|
-
path.join(process.cwd(), ".
|
|
37
|
+
path.join(process.cwd(), ".xray", filename),
|
|
38
38
|
path.join(process.cwd(), ".opencode", "strray", filename),
|
|
39
39
|
];
|
|
40
40
|
for (const candidate of candidates) {
|
|
@@ -98,7 +98,7 @@ ${data.recommendations.map((rec) => `- ${rec}`).join("\n")}
|
|
|
98
98
|
4. **Performance Monitoring**: Track rule enforcement effectiveness metrics
|
|
99
99
|
|
|
100
100
|
---
|
|
101
|
-
*Consumer runtime compat shim from prior
|
|
101
|
+
*Consumer runtime compat shim from prior 0xRay releases (1-line min per Scope Rule; primary xray paths + XRAY_||STRRAY_ env + .xray fallbacks)*
|
|
102
102
|
*Framework Status: Operational*
|
|
103
103
|
`;
|
|
104
104
|
}
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* Observes the full pipeline in action.
|
|
6
6
|
*/
|
|
7
7
|
import { AgentDelegator } from '../delegation/agent-delegator.js';
|
|
8
|
-
import {
|
|
8
|
+
import { XrayStateManager } from '../state/state-manager.js';
|
|
9
9
|
import { strRayConfigLoader } from '../core/config-loader.js';
|
|
10
10
|
import { routingOutcomeTracker } from '../delegation/analytics/outcome-tracker.js';
|
|
11
11
|
import { patternPerformanceTracker } from '../analytics/pattern-performance-tracker.js';
|
|
12
|
-
const stateManager = new
|
|
12
|
+
const stateManager = new XrayStateManager();
|
|
13
13
|
const delegator = new AgentDelegator(stateManager, strRayConfigLoader);
|
|
14
14
|
console.log('=== KERNEL PIPELINE ACTIVATION TEST ===\n');
|
|
15
15
|
// Test cases designed to trigger kernel patterns
|
|
@@ -181,9 +181,9 @@ export class InferenceTuner {
|
|
|
181
181
|
*/
|
|
182
182
|
resolveMappingsPath() {
|
|
183
183
|
const candidates = [
|
|
184
|
-
path.resolve(process.cwd(), ".
|
|
184
|
+
path.resolve(process.cwd(), ".xray/routing-mappings.json"),
|
|
185
185
|
path.resolve(process.cwd(), "xray/routing-mappings.json"),
|
|
186
|
-
path.resolve(process.cwd(), ".opencode/
|
|
186
|
+
path.resolve(process.cwd(), ".opencode/xray/routing-mappings.json"),
|
|
187
187
|
path.resolve(process.cwd(), "routing-mappings.json"),
|
|
188
188
|
];
|
|
189
189
|
for (const p of candidates) {
|