0xray 2.0.1 → 2.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/codex.codex +1 -1
- package/AGENTS.md +1 -1
- package/dist/AGENTS.md +1 -1
- package/dist/benchmark/performance-benchmark.d.ts +2 -2
- package/dist/benchmark/performance-benchmark.js +3 -3
- 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 +2 -2
- package/dist/cli/index.js +8 -8
- package/dist/cli/server.js +1 -1
- package/dist/core/agent-spawn-gate.d.ts +1 -1
- package/dist/core/agent-spawn-gate.js +1 -1
- package/dist/core/boot-orchestrator.d.ts +4 -4
- package/dist/core/boot-orchestrator.js +26 -26
- package/dist/core/bridge.mjs +22 -22
- package/dist/core/codex-formatter.js +2 -2
- package/dist/core/codex-injector.d.ts +4 -3
- package/dist/core/codex-injector.js +11 -10
- package/dist/core/config-loader.d.ts +5 -4
- package/dist/core/config-loader.js +4 -2
- package/dist/core/config-paths.d.ts +9 -8
- package/dist/core/config-paths.js +24 -23
- package/dist/core/context-loader.d.ts +4 -3
- package/dist/core/context-loader.js +7 -5
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/orchestrator.d.ts +1 -0
- package/dist/core/orchestrator.js +3 -2
- package/dist/core/system-prompt-generator.js +2 -2
- package/dist/core/xray-activation.d.ts +4 -4
- package/dist/core/xray-activation.js +29 -24
- package/dist/delegation/agent-delegator.d.ts +3 -3
- package/dist/delegation/agent-delegator.js +3 -3
- package/dist/delegation/metrics-aggregator.d.ts +11 -11
- package/dist/delegation/session-coordinator.d.ts +3 -3
- package/dist/delegation/voting-coordinator.d.ts +3 -3
- package/dist/enforcement/enforcer-tools.js +2 -2
- package/dist/enforcement/loaders/codex-loader.d.ts +1 -1
- package/dist/enforcement/loaders/codex-loader.js +2 -2
- package/dist/index.d.ts +5 -5
- package/dist/index.js +6 -6
- package/dist/inference/deploy-verifier.js +1 -1
- package/dist/inference/inference-cycle.js +7 -7
- package/dist/integrations/base/README.md +2 -2
- package/dist/integrations/governance/index.js +1 -1
- package/dist/integrations/grok/grok-cli.d.ts +1 -1
- package/dist/integrations/grok/grok-cli.js +6 -6
- package/dist/integrations/grok/hooks/pre-tool-use.js +1 -1
- package/dist/integrations/grok/plugin/0xray/.mcp.json +3 -3
- package/dist/integrations/grok/plugin/0xray/hooks/hooks.json +2 -2
- package/dist/integrations/hermes-agent/__init__.py +77 -71
- package/dist/integrations/hermes-agent/__pycache__/__init__.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/conftest.cpython-313-pytest-9.0.2.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/schemas.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/test_plugin.cpython-313-pytest-9.0.2.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/test_plugin.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/tools.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/after-install.md +14 -14
- package/dist/integrations/hermes-agent/bridge.mjs +14 -14
- package/dist/integrations/hermes-agent/logs/framework/routing-outcomes.json +1 -0
- 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 +128 -125
- package/dist/integrations/hermes-agent/tools.py +85 -23
- package/dist/integrations/openclaw/README.md +16 -16
- package/dist/integrations/openclaw/api-server.d.ts +4 -4
- package/dist/integrations/openclaw/api-server.js +9 -9
- package/dist/integrations/openclaw/config.js +1 -1
- package/dist/integrations/openclaw/hooks/{strray-hooks.d.ts → xray-hooks.d.ts} +4 -4
- package/dist/integrations/openclaw/index.d.ts +4 -4
- package/dist/integrations/openclaw/index.js +4 -4
- package/dist/integrations/openclaw/types.d.ts +1 -1
- package/dist/integrations/plugins/plugin-registry.js +2 -2
- package/dist/mcps/architect-tools.server.d.ts +2 -2
- package/dist/mcps/architect-tools.server.js +3 -3
- package/dist/mcps/auto-format.server.d.ts +2 -2
- package/dist/mcps/auto-format.server.js +3 -3
- package/dist/mcps/boot-orchestrator.server.d.ts +2 -2
- package/dist/mcps/boot-orchestrator.server.js +3 -3
- package/dist/mcps/config/server-config-registry.d.ts +1 -1
- package/dist/mcps/config/server-config-registry.js +7 -7
- package/dist/mcps/connection/mcp-connection.js +1 -1
- package/dist/mcps/enforcer-tools.server.d.ts +2 -2
- package/dist/mcps/enforcer-tools.server.js +3 -3
- package/dist/mcps/framework-compliance-audit.server.d.ts +2 -2
- package/dist/mcps/framework-compliance-audit.server.js +3 -3
- package/dist/mcps/framework-help.server.js +6 -6
- package/dist/mcps/in-process-skill-registry.js +6 -6
- package/dist/mcps/knowledge-skills/api-design.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/api-design.server.js +3 -3
- package/dist/mcps/knowledge-skills/architecture-patterns.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/architecture-patterns.server.js +3 -3
- package/dist/mcps/knowledge-skills/code-review.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/code-review.server.js +3 -3
- package/dist/mcps/knowledge-skills/database-design.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/database-design.server.js +3 -3
- package/dist/mcps/knowledge-skills/devops-deployment.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/devops-deployment.server.js +3 -3
- package/dist/mcps/knowledge-skills/git-workflow.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/git-workflow.server.js +3 -3
- package/dist/mcps/knowledge-skills/mobile-development.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/mobile-development.server.js +3 -3
- package/dist/mcps/knowledge-skills/performance-optimization.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/performance-optimization.server.js +3 -3
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +3 -3
- package/dist/mcps/knowledge-skills/security-audit.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/security-audit.server.js +3 -3
- package/dist/mcps/knowledge-skills/tech-writer.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/tech-writer.server.js +3 -3
- package/dist/mcps/knowledge-skills/testing-best-practices.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/testing-best-practices.server.js +3 -3
- package/dist/mcps/knowledge-skills/testing-strategy.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/testing-strategy.server.js +3 -3
- package/dist/mcps/knowledge-skills/ui-ux-design.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js +5 -5
- package/dist/mcps/lint.server.d.ts +2 -2
- package/dist/mcps/lint.server.js +5 -5
- package/dist/mcps/mcp-client.js +3 -3
- package/dist/mcps/model-health-check.server.d.ts +2 -2
- package/dist/mcps/model-health-check.server.js +3 -3
- package/dist/mcps/orchestrator/server.js +2 -2
- package/dist/mcps/performance-analysis.server.d.ts +2 -2
- package/dist/mcps/performance-analysis.server.js +3 -3
- package/dist/mcps/processor-pipeline.server.d.ts +2 -2
- package/dist/mcps/processor-pipeline.server.js +3 -3
- package/dist/mcps/researcher.server.d.ts +3 -3
- package/dist/mcps/researcher.server.js +4 -4
- package/dist/mcps/security-scan.server.d.ts +2 -2
- package/dist/mcps/security-scan.server.js +3 -3
- package/dist/mcps/simulation/server-simulations.js +3 -3
- package/dist/metrics/agent-metrics.d.ts +4 -4
- package/dist/metrics/agent-metrics.js +1 -1
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.d.ts +2 -2
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.js +2 -2
- package/dist/orchestrator/intelligent-commit-batcher.d.ts +1 -1
- package/dist/orchestrator/intelligent-commit-batcher.js +3 -3
- package/dist/orchestrator/multi-agent-orchestration-coordinator.d.ts +3 -3
- package/dist/orchestrator/multi-agent-orchestration-coordinator.js +9 -9
- package/dist/orchestrator/orchestrator.d.ts +3 -2
- package/dist/orchestrator/orchestrator.js +8 -6
- package/dist/plugin/xray-codex-injection.d.ts +1 -1
- package/dist/plugin/xray-codex-injection.js +8 -7
- package/dist/postprocessor/PostProcessor.d.ts +2 -2
- package/dist/postprocessor/PostProcessor.js +1 -1
- package/dist/postprocessor/monitoring/MonitoringEngine.d.ts +2 -2
- 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 +2 -2
- package/dist/processors/implementations/log-protection-processor.d.ts +1 -1
- package/dist/processors/implementations/log-protection-processor.js +2 -2
- package/dist/processors/implementations/publish-preflight-processor.d.ts +1 -1
- 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 +2 -2
- package/dist/processors/implementations/storytelling-trigger-processor.js +2 -2
- package/dist/processors/processor-manager.d.ts +2 -2
- package/dist/public/about.html +6 -6
- package/dist/public/enterprise.html +1 -1
- package/dist/public/features.html +2 -2
- package/dist/public/index.html +4 -4
- package/dist/reporting/report-formatter.js +1 -1
- package/dist/scripts/activate-kernel-pipeline.js +2 -2
- package/dist/scripts/pre-command +1 -1
- package/dist/services/inference-tuner.js +2 -2
- package/dist/session/session-cleanup-manager.d.ts +3 -3
- package/dist/session/session-monitor.d.ts +3 -3
- package/dist/session/session-state-manager.d.ts +3 -3
- package/dist/skills/hermes-agent/SKILL.md +11 -11
- package/dist/skills/storyteller/SKILL.md +1 -1
- package/dist/skills/xray-orchestrator/SKILL.md +141 -0
- package/dist/skills/xray-orchestrator/index.d.ts +13 -0
- package/dist/skills/xray-orchestrator/index.js +224 -0
- package/dist/state/index.d.ts +2 -1
- package/dist/state/index.js +2 -1
- package/dist/state/state-manager.d.ts +2 -2
- package/dist/state/state-manager.js +5 -4
- package/dist/utils/import-resolver.js +1 -1
- package/dist/utils/path-resolver.js +2 -2
- package/dist/utils/token-manager.js +1 -1
- package/dist/validation/estimation-validator.js +1 -1
- package/package.json +2 -2
- package/scripts/hooks/pre-command +1 -1
- package/scripts/hooks/run-hook.js +2 -2
- package/scripts/node/auto-reflection-generator.mjs +2 -2
- package/scripts/node/postinstall.cjs +1 -1
- package/scripts/node/release.js +6 -6
- package/scripts/node/release.mjs +10 -10
- package/scripts/node/version-manager.mjs +1 -1
- package/src/integrations/grok/plugin/0xray/.mcp.json +3 -3
- package/src/integrations/grok/plugin/0xray/hooks/hooks.json +2 -2
- package/src/mcps/architect-tools.server.ts +3 -3
- package/src/mcps/auto-format.server.ts +3 -3
- package/src/mcps/boot-orchestrator.server.ts +3 -3
- package/src/mcps/config/server-config-registry.ts +7 -7
- package/src/mcps/connection/mcp-connection.ts +1 -1
- package/src/mcps/enforcer-tools.server.ts +3 -3
- package/src/mcps/framework-compliance-audit.server.ts +3 -3
- package/src/mcps/framework-help.server.ts +6 -6
- package/src/mcps/in-process-skill-registry.ts +6 -6
- package/src/mcps/knowledge-skills/api-design.server.test.ts +8 -8
- package/src/mcps/knowledge-skills/api-design.server.ts +3 -3
- package/src/mcps/knowledge-skills/architecture-patterns.server.ts +3 -3
- package/src/mcps/knowledge-skills/code-review.server.ts +3 -3
- package/src/mcps/knowledge-skills/database-design.server.ts +3 -3
- package/src/mcps/knowledge-skills/devops-deployment.server.ts +3 -3
- package/src/mcps/knowledge-skills/git-workflow.server.ts +3 -3
- package/src/mcps/knowledge-skills/mobile-development.server.ts +3 -3
- package/src/mcps/knowledge-skills/performance-optimization.server.ts +3 -3
- package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +3 -3
- package/src/mcps/knowledge-skills/security-audit.server.test.ts +23 -23
- package/src/mcps/knowledge-skills/security-audit.server.ts +3 -3
- package/src/mcps/knowledge-skills/tech-writer.server.ts +3 -3
- package/src/mcps/knowledge-skills/testing-best-practices.server.test.ts +28 -28
- package/src/mcps/knowledge-skills/testing-best-practices.server.ts +3 -3
- package/src/mcps/knowledge-skills/testing-strategy.server.test.ts +19 -19
- package/src/mcps/knowledge-skills/testing-strategy.server.ts +3 -3
- package/src/mcps/knowledge-skills/ui-ux-design.server.ts +5 -5
- package/src/mcps/lint.server.ts +5 -5
- package/src/mcps/mcp-client.ts +3 -3
- package/src/mcps/model-health-check.server.ts +3 -3
- package/src/mcps/orchestrator/server.ts +2 -2
- package/src/mcps/performance-analysis.server.ts +3 -3
- package/src/mcps/processor-pipeline.server.ts +3 -3
- package/src/mcps/researcher.server.ts +4 -4
- package/src/mcps/security-scan.server.ts +3 -3
- package/src/mcps/simulation/server-simulations.ts +3 -3
- package/src/opencode/codex.codex +1 -1
- package/src/skills/hermes-agent/SKILL.md +11 -11
- package/src/skills/storyteller/SKILL.md +1 -1
- package/src/skills/xray-orchestrator/SKILL.md +141 -0
- package/src/skills/xray-orchestrator/index.ts +268 -0
- package/scripts/validate-stringray-comprehensive.js +0 -636
- /package/dist/integrations/openclaw/hooks/{strray-hooks.js → xray-hooks.js} +0 -0
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @version 1.0.0
|
|
8
8
|
* @since 2026-01-07
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import { XrayStateManager } from "../state/state-manager.js";
|
|
11
11
|
import { DelegationResult } from "./agent-delegator.js";
|
|
12
12
|
export interface SessionContext {
|
|
13
13
|
sessionId: string;
|
|
@@ -63,7 +63,7 @@ export interface SessionMetrics {
|
|
|
63
63
|
export declare class SessionCoordinator {
|
|
64
64
|
private stateManager;
|
|
65
65
|
private sessions;
|
|
66
|
-
constructor(stateManager:
|
|
66
|
+
constructor(stateManager: XrayStateManager);
|
|
67
67
|
/**
|
|
68
68
|
* Get read-only view of all sessions - avoids breaking encapsulation
|
|
69
69
|
*/
|
|
@@ -130,4 +130,4 @@ export declare class SessionCoordinator {
|
|
|
130
130
|
cleanupSession(sessionId: string): void;
|
|
131
131
|
private updateSessionMetrics;
|
|
132
132
|
}
|
|
133
|
-
export declare const createSessionCoordinator: (stateManager:
|
|
133
|
+
export declare const createSessionCoordinator: (stateManager: XrayStateManager) => SessionCoordinator;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import type { VotingSession, VotingResult, StrategySelectionContext, VotingHistoryEntry, VotingMetrics, ConflictResolutionRequest, ConflictResolutionResponse } from "./voting-types.js";
|
|
14
14
|
import { SessionCoordinator } from "./session-coordinator.js";
|
|
15
15
|
import { WeightedVotingAggregator } from "./weighted-voting-aggregator.js";
|
|
16
|
-
import {
|
|
16
|
+
import { XrayStateManager } from "../state/state-manager.js";
|
|
17
17
|
export interface VotingCoordinatorConfig {
|
|
18
18
|
enableHistoryTracking: boolean;
|
|
19
19
|
enableLearning: boolean;
|
|
@@ -28,7 +28,7 @@ export declare class VotingCoordinator {
|
|
|
28
28
|
private metrics;
|
|
29
29
|
private config;
|
|
30
30
|
private aggregator;
|
|
31
|
-
constructor(stateManager:
|
|
31
|
+
constructor(stateManager: XrayStateManager, sessionCoordinator?: SessionCoordinator, config?: Partial<VotingCoordinatorConfig>);
|
|
32
32
|
initiateVoting(sessionId: string, topic: string, description: string, participants: string[], context?: StrategySelectionContext): Promise<string>;
|
|
33
33
|
submitVote(voteId: string, agentName: string, vote: string, confidence: number, reasoning?: string): boolean;
|
|
34
34
|
resolveVoting(voteId: string): VotingResult | null;
|
|
@@ -46,4 +46,4 @@ export declare class VotingCoordinator {
|
|
|
46
46
|
private initializeMetrics;
|
|
47
47
|
private updateMetricsAfterVote;
|
|
48
48
|
}
|
|
49
|
-
export declare const createVotingCoordinator: (stateManager:
|
|
49
|
+
export declare const createVotingCoordinator: (stateManager: XrayStateManager, sessionCoordinator?: SessionCoordinator) => VotingCoordinator;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { ruleEnforcer, } from "./rule-enforcer.js";
|
|
6
6
|
import { frameworkLogger } from "../core/framework-logger.js";
|
|
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 * as fs from "fs";
|
|
11
11
|
import * as path from "path";
|
|
@@ -325,7 +325,7 @@ async function executeReleaseWorkflow(operation, context, jobId, routing) {
|
|
|
325
325
|
async function delegateToAgent(agentName, operation, context, jobId) {
|
|
326
326
|
try {
|
|
327
327
|
// Create a minimal state manager and config loader for the delegator
|
|
328
|
-
const stateManager = new
|
|
328
|
+
const stateManager = new XrayStateManager();
|
|
329
329
|
// Create the delegator
|
|
330
330
|
const delegator = new AgentDelegator(stateManager, strRayConfigLoader);
|
|
331
331
|
// Build task description for the delegated agent
|
|
@@ -28,7 +28,7 @@ export declare class CodexLoader extends BaseLoader {
|
|
|
28
28
|
readonly name = "codex";
|
|
29
29
|
/**
|
|
30
30
|
* Path to the codex.json file.
|
|
31
|
-
|
|
31
|
+
* Uses the standard config-paths resolver which checks .xray/, .opencode/xray/, etc.
|
|
32
32
|
*/
|
|
33
33
|
private get codexPath();
|
|
34
34
|
/**
|
|
@@ -30,13 +30,13 @@ export class CodexLoader extends BaseLoader {
|
|
|
30
30
|
name = "codex";
|
|
31
31
|
/**
|
|
32
32
|
* Path to the codex.json file.
|
|
33
|
-
|
|
33
|
+
* Uses the standard config-paths resolver which checks .xray/, .opencode/xray/, etc.
|
|
34
34
|
*/
|
|
35
35
|
get codexPath() {
|
|
36
36
|
const candidates = resolveCodexPath();
|
|
37
37
|
const found = candidates.find((p) => existsSync(p));
|
|
38
38
|
// Fallback to primary path even if not found yet
|
|
39
|
-
return found ?? candidates[0] ?? this.resolvePath(".opencode/
|
|
39
|
+
return found ?? candidates[0] ?? this.resolvePath(".opencode/xray/codex.json");
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Check if codex.json exists.
|
package/dist/index.d.ts
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
* This is the main entry point for the 0xRay framework.
|
|
5
5
|
* It exports the core initialization function and key components.
|
|
6
6
|
*/
|
|
7
|
-
export { StringRayOrchestrator } from "./orchestrator/orchestrator.js";
|
|
8
|
-
export { StringRayStateManager } from "./state/index.js";
|
|
7
|
+
export { XrayOrchestrator, XrayOrchestrator as StringRayOrchestrator } from "./orchestrator/orchestrator.js";
|
|
8
|
+
export { XrayStateManager, XrayStateManager as StringRayStateManager } from "./state/index.js";
|
|
9
9
|
export { AgentDelegator } from "./delegation/index.js";
|
|
10
10
|
export { frameworkLogger } from "./core/framework-logger.js";
|
|
11
11
|
export { BUILTIN_CODEX } from "./core/codex-formatter.js";
|
|
12
|
-
import {
|
|
13
|
-
export { defaultStringRayConfig };
|
|
12
|
+
import { defaultXrayConfig } from "./core/index.js";
|
|
13
|
+
export { defaultXrayConfig, defaultXrayConfig as defaultStringRayConfig };
|
|
14
14
|
export { OpenClawIntegration, initializeOpenClawIntegration, getOpenClawIntegration, shutdownOpenClawIntegration } from "./integrations/openclaw/index.js";
|
|
15
15
|
export type { OpenClawIntegrationConfig } from "./integrations/openclaw/types.js";
|
|
16
|
-
export declare function
|
|
16
|
+
export declare function initializeXray(config?: {}): {
|
|
17
17
|
success: boolean;
|
|
18
18
|
config: {
|
|
19
19
|
enableOrchestrator: boolean;
|
package/dist/index.js
CHANGED
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
* This is the main entry point for the 0xRay framework.
|
|
5
5
|
* It exports the core initialization function and key components.
|
|
6
6
|
*/
|
|
7
|
-
export { StringRayOrchestrator } from "./orchestrator/orchestrator.js";
|
|
8
|
-
export { StringRayStateManager } from "./state/index.js";
|
|
7
|
+
export { XrayOrchestrator, XrayOrchestrator as StringRayOrchestrator } from "./orchestrator/orchestrator.js";
|
|
8
|
+
export { XrayStateManager, XrayStateManager as StringRayStateManager } from "./state/index.js";
|
|
9
9
|
export { AgentDelegator } from "./delegation/index.js";
|
|
10
10
|
export { frameworkLogger } from "./core/framework-logger.js";
|
|
11
11
|
export { BUILTIN_CODEX } from "./core/codex-formatter.js";
|
|
12
|
-
import {
|
|
13
|
-
export { defaultStringRayConfig };
|
|
12
|
+
import { defaultXrayConfig } from "./core/index.js";
|
|
13
|
+
export { defaultXrayConfig, defaultXrayConfig as defaultStringRayConfig };
|
|
14
14
|
export { OpenClawIntegration, initializeOpenClawIntegration, getOpenClawIntegration, shutdownOpenClawIntegration } from "./integrations/openclaw/index.js";
|
|
15
15
|
// Main initialization function
|
|
16
|
-
export function
|
|
17
|
-
const mergedConfig = { ...
|
|
16
|
+
export function initializeXray(config = {}) {
|
|
17
|
+
const mergedConfig = { ...defaultXrayConfig, ...config };
|
|
18
18
|
// Return a standardized initialization result
|
|
19
19
|
return {
|
|
20
20
|
success: true,
|
|
@@ -43,7 +43,7 @@ export class DeployVerifier {
|
|
|
43
43
|
if (!packCheck.passed) {
|
|
44
44
|
return this.result(false, version, tarballPath, installDir, checks, startTime);
|
|
45
45
|
}
|
|
46
|
-
installDir = fs.mkdtempSync(path.join(os.tmpdir(), "
|
|
46
|
+
installDir = fs.mkdtempSync(path.join(os.tmpdir(), "xray-deploy-verify-"));
|
|
47
47
|
const installCheck = this.runCheck("npm-install-fresh", () => {
|
|
48
48
|
this.exec(`npm install ${tarballPath} --no-save`, installDir, 60000);
|
|
49
49
|
return "Fresh install succeeded";
|
|
@@ -3,7 +3,7 @@ import * as path from "path";
|
|
|
3
3
|
import { shouldTriggerCycle, accumulateCorpus } from "./inference-accumulator.js";
|
|
4
4
|
import { DeployVerifier } from "./deploy-verifier.js";
|
|
5
5
|
import { VotingCoordinator } from "../delegation/voting-coordinator.js";
|
|
6
|
-
import {
|
|
6
|
+
import { XrayStateManager } from "../state/state-manager.js";
|
|
7
7
|
import { frameworkLogger } from "../core/framework-logger.js";
|
|
8
8
|
import { getGovernanceIntegration } from "../integrations/governance/index.js";
|
|
9
9
|
import { featuresConfigLoader } from "../core/features-config.js";
|
|
@@ -50,7 +50,7 @@ export class InferenceCycle {
|
|
|
50
50
|
constructor(projectRoot, agentInvoker, options) {
|
|
51
51
|
this.projectRoot = projectRoot || process.cwd();
|
|
52
52
|
this.inferenceDir = path.join(this.projectRoot, "docs", "inference");
|
|
53
|
-
this.stateDir = path.join(this.projectRoot, ".
|
|
53
|
+
this.stateDir = path.join(this.projectRoot, ".xray", "inference");
|
|
54
54
|
this.agentInvoker = agentInvoker ?? null;
|
|
55
55
|
this.options = options ?? {};
|
|
56
56
|
}
|
|
@@ -353,7 +353,7 @@ export class InferenceCycle {
|
|
|
353
353
|
``,
|
|
354
354
|
`1. Read the relevant source files`,
|
|
355
355
|
`2. Add the missing guard, validation, or edge case handling`,
|
|
356
|
-
`3. If this is a codex rule, add the term to .opencode/
|
|
356
|
+
`3. If this is a codex rule, add the term to .opencode/xray/codex.json`,
|
|
357
357
|
`4. Make minimal, surgical changes`,
|
|
358
358
|
].join("\n");
|
|
359
359
|
try {
|
|
@@ -922,7 +922,7 @@ Respond with EXACTLY one of:
|
|
|
922
922
|
fs.mkdirSync(this.stateDir, { recursive: true });
|
|
923
923
|
}
|
|
924
924
|
const stateFile = path.join(this.stateDir, "governance-state.json");
|
|
925
|
-
const stateManager = new
|
|
925
|
+
const stateManager = new XrayStateManager();
|
|
926
926
|
if (fs.existsSync(stateFile)) {
|
|
927
927
|
try {
|
|
928
928
|
const data = JSON.parse(fs.readFileSync(stateFile, "utf-8"));
|
|
@@ -975,10 +975,10 @@ Respond with EXACTLY one of:
|
|
|
975
975
|
return texts.join("\n").trim();
|
|
976
976
|
}
|
|
977
977
|
resolveOpencodeRoot() {
|
|
978
|
-
// Use the provider-agnostic config path resolver (prefers .
|
|
978
|
+
// Use the provider-agnostic config path resolver (prefers .xray/, falls back to .opencode/xray/)
|
|
979
979
|
const configDir = getConfigDir(this.projectRoot);
|
|
980
|
-
// If we resolved to a .
|
|
981
|
-
if (configDir.includes(".
|
|
980
|
+
// If we resolved to a .xray or custom dir, use its parent as the "root"
|
|
981
|
+
if (configDir.includes(".xray") || configDir.includes("xray")) {
|
|
982
982
|
return path.dirname(configDir);
|
|
983
983
|
}
|
|
984
984
|
// Legacy fallback
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Integration Base System
|
|
2
2
|
|
|
3
|
-
The Integration Base System provides a standardized foundation for creating and managing
|
|
3
|
+
The Integration Base System provides a standardized foundation for creating and managing Xray integrations. It includes the `BaseIntegration` class, `IntegrationRegistry`, and supporting types that ensure consistent lifecycle management, event handling, and configuration across all integrations.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
@@ -21,7 +21,7 @@ src/integrations/
|
|
|
21
21
|
│ ├── ExampleIntegration.ts # Example implementation
|
|
22
22
|
│ └── index.ts # Module exports
|
|
23
23
|
├── core/ # Core framework integrations
|
|
24
|
-
│ └──
|
|
24
|
+
│ └── xray-integration.ts # Cross-framework integration
|
|
25
25
|
└── openclaw/ # External service integrations
|
|
26
26
|
├── index.ts
|
|
27
27
|
├── client.ts
|
|
@@ -283,7 +283,7 @@ export class InferenceGovernanceIntegration extends BaseIntegration {
|
|
|
283
283
|
*/
|
|
284
284
|
async loadConfig() {
|
|
285
285
|
try {
|
|
286
|
-
const configPath = path.join(process.cwd(), '.opencode', '
|
|
286
|
+
const configPath = path.join(process.cwd(), '.opencode', 'xray', 'features.json');
|
|
287
287
|
if (!fs.existsSync(configPath)) {
|
|
288
288
|
await this.log('warning', 'features.json not found, using defaults');
|
|
289
289
|
return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Grok CLI Integration for
|
|
2
|
+
* Grok CLI Integration for 0xRay
|
|
3
3
|
*
|
|
4
4
|
* This module provides the integration points for using 0xRay with the official Grok CLI.
|
|
5
5
|
*
|
|
@@ -60,14 +60,14 @@ export async function installForGrokCLI(options = {}) {
|
|
|
60
60
|
const govMcpPath = path.resolve(__dirname, '..', '..', '..', 'dist/mcps/governance.server.js');
|
|
61
61
|
const skillsMcpPath = path.resolve(__dirname, '..', '..', '..', 'dist/mcps/knowledge-skills/skill-invocation.server.js');
|
|
62
62
|
try {
|
|
63
|
-
execSync(`grok mcp add
|
|
64
|
-
execSync(`grok mcp add
|
|
65
|
-
console.log('\x1b[32m✓ Registered
|
|
63
|
+
execSync(`grok mcp add xray-governance --command node --args "${govMcpPath}" --env "STRRAY_FORCE_MCP_GOVERNANCE=true" --env "STRRAY_ROOT=${process.cwd()}"`, { stdio: 'pipe' });
|
|
64
|
+
execSync(`grok mcp add xray-skills --command node --args "${skillsMcpPath}" --env "STRRAY_ROOT=${process.cwd()}"`, { stdio: 'pipe' });
|
|
65
|
+
console.log('\x1b[32m✓ Registered xray MCP servers with Grok CLI\x1b[0m');
|
|
66
66
|
}
|
|
67
67
|
catch {
|
|
68
68
|
console.log('\nCould not auto-register MCP servers. Run manually:');
|
|
69
|
-
console.log(` grok mcp add
|
|
70
|
-
console.log(` grok mcp add
|
|
69
|
+
console.log(` grok mcp add xray-governance --command node --args "${govMcpPath}"`);
|
|
70
|
+
console.log(` grok mcp add xray-skills --command node --args "${skillsMcpPath}"`);
|
|
71
71
|
}
|
|
72
72
|
console.log('\n✅ 0xRay is now installed as a first-class Grok CLI plugin!');
|
|
73
73
|
console.log('Restart Grok or run `grok` to load the new hooks and MCP servers.');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* Grok CLI PreToolUse Hook Handler for
|
|
3
|
+
* Grok CLI PreToolUse Hook Handler for 0xRay — First Class Citizen
|
|
4
4
|
*
|
|
5
5
|
* Real governance enforcement hook.
|
|
6
6
|
* When Grok is about to execute a tool (write_file, edit, terminal cmd, etc.),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"mcpServers": {
|
|
3
|
-
"
|
|
3
|
+
"xray-governance": {
|
|
4
4
|
"command": "npx",
|
|
5
5
|
"args": ["-y", "0xray", "mcp", "governance"],
|
|
6
6
|
"env": {
|
|
7
|
-
"
|
|
7
|
+
"XRAY_FORCE_MCP_GOVERNANCE": "true"
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
|
-
"
|
|
10
|
+
"xray-skills": {
|
|
11
11
|
"command": "npx",
|
|
12
12
|
"args": ["-y", "0xray", "mcp", "skills"]
|
|
13
13
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"type": "command",
|
|
9
9
|
"command": "node",
|
|
10
10
|
"args": [
|
|
11
|
-
"${
|
|
11
|
+
"${XRAY_PATH:-node_modules/0xray}/dist/integrations/grok/hooks/pre-tool-use.js"
|
|
12
12
|
],
|
|
13
13
|
"timeout": 30000
|
|
14
14
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
{
|
|
22
22
|
"type": "command",
|
|
23
23
|
"command": "echo",
|
|
24
|
-
"args": ["[0xRay] Grok session started with
|
|
24
|
+
"args": ["[0xRay] Grok session started with 0xRay governance enabled"]
|
|
25
25
|
}
|
|
26
26
|
]
|
|
27
27
|
}
|