0xray 2.2.3 → 3.0.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/AGENTS.md +5 -5
- package/README.md +54 -16
- package/dist/AGENTS.md +5 -5
- package/dist/CHANGELOG.md +152 -0
- package/dist/README.md +54 -16
- package/dist/agents/architect.js +1 -0
- package/dist/agents/architect.js.map +1 -0
- package/dist/agents/backend-engineer.js +1 -0
- package/dist/agents/backend-engineer.js.map +1 -0
- package/dist/agents/bug-triage-specialist.js +1 -0
- package/dist/agents/bug-triage-specialist.js.map +1 -0
- package/dist/agents/code-analyzer.js +1 -0
- package/dist/agents/code-analyzer.js.map +1 -0
- package/dist/agents/code-reviewer.js +1 -0
- package/dist/agents/code-reviewer.js.map +1 -0
- package/dist/agents/content-creator.js +1 -0
- package/dist/agents/content-creator.js.map +1 -0
- package/dist/agents/database-engineer.js +1 -0
- package/dist/agents/database-engineer.js.map +1 -0
- package/dist/agents/devops-engineer.js +1 -0
- package/dist/agents/devops-engineer.js.map +1 -0
- package/dist/agents/frontend-engineer.js +1 -0
- package/dist/agents/frontend-engineer.js.map +1 -0
- package/dist/agents/frontend-ui-ux-engineer.js +1 -0
- package/dist/agents/frontend-ui-ux-engineer.js.map +1 -0
- package/dist/agents/growth-strategist.js +1 -0
- package/dist/agents/growth-strategist.js.map +1 -0
- package/dist/agents/index.js +1 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/librarian-agents-updater.js +1 -0
- package/dist/agents/librarian-agents-updater.js.map +1 -0
- package/dist/agents/log-monitor.js +1 -0
- package/dist/agents/log-monitor.js.map +1 -0
- package/dist/agents/mobile-developer.js +1 -0
- package/dist/agents/mobile-developer.js.map +1 -0
- package/dist/agents/performance-engineer.js +1 -0
- package/dist/agents/performance-engineer.js.map +1 -0
- package/dist/agents/refactorer.js +1 -0
- package/dist/agents/refactorer.js.map +1 -0
- package/dist/agents/registry.js +1 -0
- package/dist/agents/registry.js.map +1 -0
- package/dist/agents/researcher.js +1 -0
- package/dist/agents/researcher.js.map +1 -0
- package/dist/agents/security-auditor.js +1 -0
- package/dist/agents/security-auditor.js.map +1 -0
- package/dist/agents/seo-consultant.js +1 -0
- package/dist/agents/seo-consultant.js.map +1 -0
- package/dist/agents/strategist.js +1 -0
- package/dist/agents/strategist.js.map +1 -0
- package/dist/agents/tech-writer.js +1 -0
- package/dist/agents/tech-writer.js.map +1 -0
- package/dist/agents/testing-lead.js +1 -0
- package/dist/agents/testing-lead.js.map +1 -0
- package/dist/agents/types.js +1 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/analytics/emerging-pattern-detector.js +1 -0
- package/dist/analytics/emerging-pattern-detector.js.map +1 -0
- package/dist/analytics/pattern-learning-engine.js +1 -0
- package/dist/analytics/pattern-learning-engine.js.map +1 -0
- package/dist/analytics/pattern-performance-tracker.js +1 -0
- package/dist/analytics/pattern-performance-tracker.js.map +1 -0
- package/dist/analytics/predictive-analytics.js +1 -0
- package/dist/analytics/predictive-analytics.js.map +1 -0
- package/dist/analytics/prompt-pattern-analyzer.js +1 -0
- package/dist/analytics/prompt-pattern-analyzer.js.map +1 -0
- package/dist/analytics/routing-performance-analyzer.js +1 -0
- package/dist/analytics/routing-performance-analyzer.js.map +1 -0
- package/dist/analytics/routing-refiner.js +1 -0
- package/dist/analytics/routing-refiner.js.map +1 -0
- package/dist/architect/architect-tools.js +1 -0
- package/dist/architect/architect-tools.js.map +1 -0
- package/dist/architect/architectural-integrity.js +1 -0
- package/dist/architect/architectural-integrity.js.map +1 -0
- package/dist/cli/commands/antigravity-status.js +1 -0
- package/dist/cli/commands/antigravity-status.js.map +1 -0
- package/dist/cli/commands/archive-logs.js +1 -0
- package/dist/cli/commands/archive-logs.js.map +1 -0
- package/dist/cli/commands/credible-init.js +1 -0
- package/dist/cli/commands/credible-init.js.map +1 -0
- package/dist/cli/commands/govern.js +1 -3
- package/dist/cli/commands/govern.js.map +1 -0
- package/dist/cli/commands/grok-install.js +1 -0
- package/dist/cli/commands/grok-install.js.map +1 -0
- package/dist/cli/commands/hermes-install.js +1 -0
- package/dist/cli/commands/hermes-install.js.map +1 -0
- package/dist/cli/commands/mcp-install.js +1 -0
- package/dist/cli/commands/mcp-install.js.map +1 -0
- package/dist/cli/commands/openclaw-install.js +1 -0
- package/dist/cli/commands/openclaw-install.js.map +1 -0
- package/dist/cli/commands/opencode-install.js +1 -0
- package/dist/cli/commands/opencode-install.js.map +1 -0
- package/dist/cli/commands/plugin-commands.js +1 -0
- package/dist/cli/commands/plugin-commands.js.map +1 -0
- package/dist/cli/commands/publish-agent.js +1 -0
- package/dist/cli/commands/publish-agent.js.map +1 -0
- package/dist/cli/commands/security-audit.js +1 -0
- package/dist/cli/commands/security-audit.js.map +1 -0
- package/dist/cli/commands/skill-install.js +1 -0
- package/dist/cli/commands/skill-install.js.map +1 -0
- package/dist/cli/commands/status.js +17 -2
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/storyteller.js +1 -0
- package/dist/cli/commands/storyteller.js.map +1 -0
- package/dist/cli/index.js +1 -4
- package/dist/cli/index.js.map +1 -0
- package/dist/config/default-agents.js +1 -0
- package/dist/config/default-agents.js.map +1 -0
- package/dist/config/routing-mappings.d.ts +21 -0
- package/dist/config/routing-mappings.js +133 -0
- package/dist/config/routing-mappings.js.map +1 -0
- package/dist/core/activity-logger.js +1 -0
- package/dist/core/activity-logger.js.map +1 -0
- package/dist/core/adaptive-kernel.js +1 -0
- package/dist/core/adaptive-kernel.js.map +1 -0
- package/dist/core/agent-spawn-gate.js +1 -0
- package/dist/core/agent-spawn-gate.js.map +1 -0
- package/dist/core/boot-orchestrator.js +1 -0
- package/dist/core/boot-orchestrator.js.map +1 -0
- package/dist/core/codex-formatter.js +1 -0
- package/dist/core/codex-formatter.js.map +1 -0
- package/dist/core/codex-injector.js +1 -0
- package/dist/core/codex-injector.js.map +1 -0
- package/dist/core/config-loader.js +1 -0
- package/dist/core/config-loader.js.map +1 -0
- package/dist/core/config-paths.js +2 -1
- package/dist/core/config-paths.js.map +1 -0
- package/dist/core/context-loader.js +1 -0
- package/dist/core/context-loader.js.map +1 -0
- package/dist/core/context-validator.js +1 -0
- package/dist/core/context-validator.js.map +1 -0
- package/dist/core/features-config.js +1 -0
- package/dist/core/features-config.js.map +1 -0
- package/dist/core/framework-logger.js +1 -0
- package/dist/core/framework-logger.js.map +1 -0
- package/dist/core/index.js +2 -1
- package/dist/core/index.js.map +1 -0
- package/dist/core/kernel-patterns.js +1 -0
- package/dist/core/kernel-patterns.js.map +1 -0
- package/dist/core/model-router.js +1 -0
- package/dist/core/model-router.js.map +1 -0
- package/dist/core/orchestrator.d.ts +11 -10
- package/dist/core/orchestrator.js +27 -171
- package/dist/core/orchestrator.js.map +1 -0
- package/dist/core/system-prompt-generator.js +1 -0
- package/dist/core/system-prompt-generator.js.map +1 -0
- package/dist/core/xray-activation.js +2 -1
- package/dist/core/xray-activation.js.map +1 -0
- package/dist/delegation/agent-delegator.js +1 -0
- package/dist/delegation/agent-delegator.js.map +1 -0
- package/dist/delegation/agent-expertise.js +1 -0
- package/dist/delegation/agent-expertise.js.map +1 -0
- package/dist/delegation/analytics/index.js +1 -0
- package/dist/delegation/analytics/index.js.map +1 -0
- package/dist/delegation/analytics/learning-engine.js +1 -0
- package/dist/delegation/analytics/learning-engine.js.map +1 -0
- package/dist/delegation/analytics/outcome-tracker.js +1 -0
- package/dist/delegation/analytics/outcome-tracker.js.map +1 -0
- package/dist/delegation/analytics/routing-analytics.js +1 -0
- package/dist/delegation/analytics/routing-analytics.js.map +1 -0
- package/dist/delegation/ast-code-parser.js +1 -0
- package/dist/delegation/ast-code-parser.js.map +1 -0
- package/dist/delegation/codebase-context-analyzer.js +1 -0
- package/dist/delegation/codebase-context-analyzer.js.map +1 -0
- package/dist/delegation/complexity-analyzer.js +1 -0
- package/dist/delegation/complexity-analyzer.js.map +1 -0
- package/dist/delegation/complexity-core.js +1 -0
- package/dist/delegation/complexity-core.js.map +1 -0
- package/dist/delegation/config/types.js +1 -0
- package/dist/delegation/config/types.js.map +1 -0
- package/dist/delegation/dependency-graph-builder.js +1 -0
- package/dist/delegation/dependency-graph-builder.js.map +1 -0
- package/dist/delegation/index.d.ts +3 -0
- package/dist/delegation/index.js +4 -0
- package/dist/delegation/index.js.map +1 -0
- package/dist/delegation/metrics-aggregator.js +1 -0
- package/dist/delegation/metrics-aggregator.js.map +1 -0
- package/dist/delegation/session-coordinator.js +1 -0
- package/dist/delegation/session-coordinator.js.map +1 -0
- package/dist/delegation/strategy-selector.js +1 -0
- package/dist/delegation/strategy-selector.js.map +1 -0
- package/dist/delegation/voting-types.js +1 -0
- package/dist/delegation/voting-types.js.map +1 -0
- package/dist/delegation/weighted-voting-aggregator.js +1 -0
- package/dist/delegation/weighted-voting-aggregator.js.map +1 -0
- package/dist/enforcement/core/index.js +1 -0
- package/dist/enforcement/core/index.js.map +1 -0
- package/dist/enforcement/core/rule-executor.js +1 -0
- package/dist/enforcement/core/rule-executor.js.map +1 -0
- package/dist/enforcement/core/rule-hierarchy.js +1 -0
- package/dist/enforcement/core/rule-hierarchy.js.map +1 -0
- package/dist/enforcement/core/rule-registry.js +1 -0
- package/dist/enforcement/core/rule-registry.js.map +1 -0
- package/dist/enforcement/core/violation-fixer.js +1 -0
- package/dist/enforcement/core/violation-fixer.js.map +1 -0
- package/dist/enforcement/enforcer-tools.js +2 -123
- package/dist/enforcement/enforcer-tools.js.map +1 -0
- package/dist/enforcement/index.js +1 -0
- package/dist/enforcement/index.js.map +1 -0
- package/dist/enforcement/loaders/agent-triage-loader.js +1 -0
- package/dist/enforcement/loaders/agent-triage-loader.js.map +1 -0
- package/dist/enforcement/loaders/agents-md-validation-loader.js +1 -0
- package/dist/enforcement/loaders/agents-md-validation-loader.js.map +1 -0
- package/dist/enforcement/loaders/base-loader.js +1 -0
- package/dist/enforcement/loaders/base-loader.js.map +1 -0
- package/dist/enforcement/loaders/codex-loader.js +1 -0
- package/dist/enforcement/loaders/codex-loader.js.map +1 -0
- package/dist/enforcement/loaders/index.js +1 -0
- package/dist/enforcement/loaders/index.js.map +1 -0
- package/dist/enforcement/loaders/loader-orchestrator.js +1 -0
- package/dist/enforcement/loaders/loader-orchestrator.js.map +1 -0
- package/dist/enforcement/loaders/processor-loader.js +1 -0
- package/dist/enforcement/loaders/processor-loader.js.map +1 -0
- package/dist/enforcement/rule-enforcer.js +1 -0
- package/dist/enforcement/rule-enforcer.js.map +1 -0
- package/dist/enforcement/types.js +1 -0
- package/dist/enforcement/types.js.map +1 -0
- package/dist/enforcement/validators/architecture-validators.d.ts +17 -0
- package/dist/enforcement/validators/architecture-validators.js +81 -0
- package/dist/enforcement/validators/architecture-validators.js.map +1 -0
- package/dist/enforcement/validators/base-validator.js +1 -0
- package/dist/enforcement/validators/base-validator.js.map +1 -0
- package/dist/enforcement/validators/code-quality-validators.d.ts +1 -0
- package/dist/enforcement/validators/code-quality-validators.js +46 -14
- package/dist/enforcement/validators/code-quality-validators.js.map +1 -0
- package/dist/enforcement/validators/index.js +1 -0
- package/dist/enforcement/validators/index.js.map +1 -0
- package/dist/enforcement/validators/security-validators.js +1 -0
- package/dist/enforcement/validators/security-validators.js.map +1 -0
- package/dist/enforcement/validators/testing-validators.js +1 -0
- package/dist/enforcement/validators/testing-validators.js.map +1 -0
- package/dist/enforcement/validators/validator-registry.js +3 -1
- package/dist/enforcement/validators/validator-registry.js.map +1 -0
- package/dist/execution/opencode-cli-invoker.js +6 -23
- package/dist/execution/opencode-cli-invoker.js.map +1 -0
- package/dist/execution/proposal-applier.js +1 -0
- package/dist/execution/proposal-applier.js.map +1 -0
- package/dist/governance/codex-policy.service.js +1 -0
- package/dist/governance/codex-policy.service.js.map +1 -0
- package/dist/governance/governance-core.js +1 -0
- package/dist/governance/governance-core.js.map +1 -0
- package/dist/governance/governance-service.d.ts +8 -2
- package/dist/governance/governance-service.js +64 -76
- package/dist/governance/governance-service.js.map +1 -0
- package/dist/governance/governance-types.d.ts +4 -0
- package/dist/governance/governance-types.js +1 -0
- package/dist/governance/governance-types.js.map +1 -0
- package/dist/index.d.ts +4 -6
- package/dist/index.js +4 -13
- package/dist/index.js.map +1 -0
- package/dist/inference/deploy-verifier.js +1 -0
- package/dist/inference/deploy-verifier.js.map +1 -0
- package/dist/inference/index.js +1 -0
- package/dist/inference/index.js.map +1 -0
- package/dist/inference/inference-accumulator.js +1 -0
- package/dist/inference/inference-accumulator.js.map +1 -0
- package/dist/inference/inference-cycle.d.ts +0 -6
- package/dist/inference/inference-cycle.js +77 -278
- package/dist/inference/inference-cycle.js.map +1 -0
- package/dist/inference/semantic-patterns.js +1 -0
- package/dist/inference/semantic-patterns.js.map +1 -0
- package/dist/inference/session-capture.js +1 -0
- package/dist/inference/session-capture.js.map +1 -0
- package/dist/integrations/base/Integration.js +1 -0
- package/dist/integrations/base/Integration.js.map +1 -0
- package/dist/integrations/base/index.js +1 -0
- package/dist/integrations/base/index.js.map +1 -0
- package/dist/integrations/base/registry.js +1 -0
- package/dist/integrations/base/registry.js.map +1 -0
- package/dist/integrations/base/types.js +1 -0
- package/dist/integrations/base/types.js.map +1 -0
- package/dist/integrations/enforcement-gate.d.ts +44 -0
- package/dist/integrations/enforcement-gate.js +351 -0
- package/dist/integrations/enforcement-gate.js.map +1 -0
- package/dist/integrations/governance/governance-client.d.ts +4 -1
- package/dist/integrations/governance/governance-client.js +8 -1
- package/dist/integrations/governance/governance-client.js.map +1 -0
- package/dist/integrations/governance/index.d.ts +2 -2
- package/dist/integrations/governance/index.js +26 -5
- package/dist/integrations/governance/index.js.map +1 -0
- package/dist/integrations/governance/types.d.ts +26 -0
- package/dist/integrations/governance/types.js +11 -5
- package/dist/integrations/governance/types.js.map +1 -0
- package/dist/integrations/grok/grok-cli.js +2 -1
- package/dist/integrations/grok/grok-cli.js.map +1 -0
- package/dist/integrations/grok/hooks/pre-tool-use.d.ts +18 -0
- package/dist/integrations/grok/hooks/pre-tool-use.js.map +1 -0
- package/dist/integrations/grok/plugin/0xray/.mcp.json +1 -4
- package/dist/integrations/hermes-agent/bridge.mjs +11 -34
- package/dist/integrations/hermes-agent/hermes-agent-integration.d.ts +133 -0
- package/dist/integrations/hermes-agent/hermes-agent-integration.js +504 -0
- package/dist/integrations/hermes-agent/hermes-agent-integration.js.map +1 -0
- package/dist/integrations/hermes-agent/index.d.ts +11 -0
- package/dist/integrations/hermes-agent/index.js +12 -0
- package/dist/integrations/hermes-agent/index.js.map +1 -0
- package/dist/integrations/hermes-agent/types.d.ts +227 -0
- package/dist/integrations/hermes-agent/types.js +11 -0
- package/dist/integrations/hermes-agent/types.js.map +1 -0
- package/dist/integrations/openclaw/api-server.js +1 -0
- package/dist/integrations/openclaw/api-server.js.map +1 -0
- package/dist/integrations/openclaw/client.js +1 -0
- package/dist/integrations/openclaw/client.js.map +1 -0
- package/dist/integrations/openclaw/config.js +1 -0
- package/dist/integrations/openclaw/config.js.map +1 -0
- package/dist/integrations/openclaw/hooks/xray-hooks.d.ts +11 -0
- package/dist/integrations/openclaw/hooks/xray-hooks.js +1 -0
- package/dist/integrations/openclaw/hooks/xray-hooks.js.map +1 -0
- package/dist/integrations/openclaw/index.js +24 -0
- package/dist/integrations/openclaw/index.js.map +1 -0
- package/dist/integrations/openclaw/types.js +1 -0
- package/dist/integrations/openclaw/types.js.map +1 -0
- package/dist/integrations/plugins/index.js +1 -0
- package/dist/integrations/plugins/index.js.map +1 -0
- package/dist/integrations/plugins/plugin-integration.js +1 -0
- package/dist/integrations/plugins/plugin-integration.js.map +1 -0
- package/dist/integrations/plugins/plugin-registry.js +1 -0
- package/dist/integrations/plugins/plugin-registry.js.map +1 -0
- package/dist/mcps/agent-resolver.js +1 -0
- package/dist/mcps/agent-resolver.js.map +1 -0
- package/dist/mcps/architect-tools.server.js +1 -0
- package/dist/mcps/architect-tools.server.js.map +1 -0
- package/dist/mcps/auto-format.server.js +1 -0
- package/dist/mcps/auto-format.server.js.map +1 -0
- package/dist/mcps/boot-orchestrator.server.d.ts +3 -30
- package/dist/mcps/boot-orchestrator.server.js +32 -537
- package/dist/mcps/boot-orchestrator.server.js.map +1 -0
- package/dist/mcps/config/config-loader.js +1 -0
- package/dist/mcps/config/config-loader.js.map +1 -0
- package/dist/mcps/config/config-validator.js +1 -0
- package/dist/mcps/config/config-validator.js.map +1 -0
- package/dist/mcps/config/index.js +1 -0
- package/dist/mcps/config/index.js.map +1 -0
- package/dist/mcps/config/plugin-server-registry.js +1 -0
- package/dist/mcps/config/plugin-server-registry.js.map +1 -0
- package/dist/mcps/config/server-config-registry.js +1 -0
- package/dist/mcps/config/server-config-registry.js.map +1 -0
- package/dist/mcps/connection/connection-pool.js +1 -0
- package/dist/mcps/connection/connection-pool.js.map +1 -0
- package/dist/mcps/connection/mcp-connection.js +1 -0
- package/dist/mcps/connection/mcp-connection.js.map +1 -0
- package/dist/mcps/connection/process-spawner.js +1 -0
- package/dist/mcps/connection/process-spawner.js.map +1 -0
- package/dist/mcps/enforcer-tools.server.js +1 -0
- package/dist/mcps/enforcer-tools.server.js.map +1 -0
- package/dist/mcps/estimation.server.js +1 -0
- package/dist/mcps/estimation.server.js.map +1 -0
- package/dist/mcps/framework-compliance-audit.server.js +1 -0
- package/dist/mcps/framework-compliance-audit.server.js.map +1 -0
- package/dist/mcps/framework-help.server.js +1 -0
- package/dist/mcps/framework-help.server.js.map +1 -0
- package/dist/mcps/governance.server.d.ts +2 -1
- package/dist/mcps/governance.server.js +67 -16
- package/dist/mcps/governance.server.js.map +1 -0
- package/dist/mcps/in-process-skill-registry.js +17 -0
- package/dist/mcps/in-process-skill-registry.js.map +1 -0
- package/dist/mcps/index.d.ts +17 -0
- package/dist/mcps/index.js +65 -0
- package/dist/mcps/index.js.map +1 -0
- package/dist/mcps/knowledge-skills/api-design.server.js +1 -0
- package/dist/mcps/knowledge-skills/api-design.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/architecture-patterns.server.js +1 -0
- package/dist/mcps/knowledge-skills/architecture-patterns.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/bug-triage-specialist.server.js +1 -0
- package/dist/mcps/knowledge-skills/bug-triage-specialist.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/code-analyzer.server.js +1 -0
- package/dist/mcps/knowledge-skills/code-analyzer.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/code-review.server.js +1 -0
- package/dist/mcps/knowledge-skills/code-review.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/content-creator.server.js +1 -0
- package/dist/mcps/knowledge-skills/content-creator.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/database-design.server.js +1 -0
- package/dist/mcps/knowledge-skills/database-design.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/devops-deployment.server.js +1 -0
- package/dist/mcps/knowledge-skills/devops-deployment.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/git-workflow.server.js +1 -0
- package/dist/mcps/knowledge-skills/git-workflow.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/growth-strategist.server.js +1 -0
- package/dist/mcps/knowledge-skills/growth-strategist.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/log-monitor.server.js +1 -0
- package/dist/mcps/knowledge-skills/log-monitor.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/mobile-development.server.js +1 -0
- package/dist/mcps/knowledge-skills/mobile-development.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/multimodal-looker.server.js +1 -0
- package/dist/mcps/knowledge-skills/multimodal-looker.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/performance-optimization.server.js +1 -0
- package/dist/mcps/knowledge-skills/performance-optimization.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/project-analysis.server.js +1 -0
- package/dist/mcps/knowledge-skills/project-analysis.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +1 -0
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/security-audit.server.js +1 -0
- package/dist/mcps/knowledge-skills/security-audit.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/seo-consultant.server.js +1 -0
- package/dist/mcps/knowledge-skills/seo-consultant.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/session-management.server.js +1 -0
- package/dist/mcps/knowledge-skills/session-management.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/skill-invocation.server.d.ts +1 -0
- package/dist/mcps/knowledge-skills/skill-invocation.server.js +18 -4
- package/dist/mcps/knowledge-skills/skill-invocation.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/strategist.server.js +1 -0
- package/dist/mcps/knowledge-skills/strategist.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/tech-writer.server.js +1 -0
- package/dist/mcps/knowledge-skills/tech-writer.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/testing-strategy.server.js +1 -0
- package/dist/mcps/knowledge-skills/testing-strategy.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js +1 -0
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js.map +1 -0
- package/dist/mcps/lint.server.js +1 -0
- package/dist/mcps/lint.server.js.map +1 -0
- package/dist/mcps/mcp-client.js +3 -2
- package/dist/mcps/mcp-client.js.map +1 -0
- package/dist/mcps/model-health-check.server.js +1 -0
- package/dist/mcps/model-health-check.server.js.map +1 -0
- package/dist/mcps/orchestrator/config/agent-capabilities.js +1 -0
- package/dist/mcps/orchestrator/config/agent-capabilities.js.map +1 -0
- package/dist/mcps/orchestrator/execution/execution-planner.js +1 -0
- package/dist/mcps/orchestrator/execution/execution-planner.js.map +1 -0
- package/dist/mcps/orchestrator/handlers/complexity-handler.js +1 -0
- package/dist/mcps/orchestrator/handlers/complexity-handler.js.map +1 -0
- package/dist/mcps/orchestrator/handlers/status-handler.js +1 -0
- package/dist/mcps/orchestrator/handlers/status-handler.js.map +1 -0
- package/dist/mcps/orchestrator/handlers/task-handler.js +1 -0
- package/dist/mcps/orchestrator/handlers/task-handler.js.map +1 -0
- package/dist/mcps/orchestrator/server.js +1 -0
- package/dist/mcps/orchestrator/server.js.map +1 -0
- package/dist/mcps/orchestrator/types.js +1 -0
- package/dist/mcps/orchestrator/types.js.map +1 -0
- package/dist/mcps/performance-analysis.server.js +1 -0
- package/dist/mcps/performance-analysis.server.js.map +1 -0
- package/dist/mcps/processor-pipeline.server.js +1 -0
- package/dist/mcps/processor-pipeline.server.js.map +1 -0
- package/dist/mcps/protocol/protocol-constants.js +1 -0
- package/dist/mcps/protocol/protocol-constants.js.map +1 -0
- package/dist/mcps/researcher.server.js +1 -0
- package/dist/mcps/researcher.server.js.map +1 -0
- package/dist/mcps/security-scan.server.js +1 -0
- package/dist/mcps/security-scan.server.js.map +1 -0
- package/dist/mcps/shared/knowledge-skill-base.js +1 -0
- package/dist/mcps/shared/knowledge-skill-base.js.map +1 -0
- package/dist/mcps/shared/prompt-security-validator.js +1 -0
- package/dist/mcps/shared/prompt-security-validator.js.map +1 -0
- package/dist/mcps/shared/security-scanner.js +1 -0
- package/dist/mcps/shared/security-scanner.js.map +1 -0
- package/dist/mcps/simulation/index.js +1 -0
- package/dist/mcps/simulation/index.js.map +1 -0
- package/dist/mcps/simulation/server-simulations.js +1 -0
- package/dist/mcps/simulation/server-simulations.js.map +1 -0
- package/dist/mcps/simulation/simulation-engine.js +1 -0
- package/dist/mcps/simulation/simulation-engine.js.map +1 -0
- package/dist/mcps/state-manager.server.js +1 -0
- package/dist/mcps/state-manager.server.js.map +1 -0
- package/dist/mcps/tools/index.js +1 -0
- package/dist/mcps/tools/index.js.map +1 -0
- package/dist/mcps/tools/tool-cache.js +1 -0
- package/dist/mcps/tools/tool-cache.js.map +1 -0
- package/dist/mcps/tools/tool-discovery.js +1 -0
- package/dist/mcps/tools/tool-discovery.js.map +1 -0
- package/dist/mcps/tools/tool-executor.js +1 -0
- package/dist/mcps/tools/tool-executor.js.map +1 -0
- package/dist/mcps/tools/tool-registry.js +1 -0
- package/dist/mcps/tools/tool-registry.js.map +1 -0
- package/dist/mcps/types/index.js +1 -0
- package/dist/mcps/types/index.js.map +1 -0
- package/dist/mcps/types/json-rpc.types.js +1 -0
- package/dist/mcps/types/json-rpc.types.js.map +1 -0
- package/dist/mcps/types/mcp.types.js +1 -0
- package/dist/mcps/types/mcp.types.js.map +1 -0
- package/dist/metrics/agent-metrics.js +2 -1
- package/dist/metrics/agent-metrics.js.map +1 -0
- package/dist/metrics/index.js +1 -0
- package/dist/metrics/index.js.map +1 -0
- package/dist/monitoring/advanced-profiler.js +1 -0
- package/dist/monitoring/advanced-profiler.js.map +1 -0
- package/dist/monitoring/memory-monitor.js +1 -0
- package/dist/monitoring/memory-monitor.js.map +1 -0
- package/dist/monitoring/nudge-watchdog.js +1 -0
- package/dist/monitoring/nudge-watchdog.js.map +1 -0
- package/dist/monitoring/test-auto-generation-monitor.js +1 -0
- package/dist/monitoring/test-auto-generation-monitor.js.map +1 -0
- package/dist/nucleus/default-plugins.d.ts +17 -0
- package/dist/nucleus/default-plugins.js +146 -0
- package/dist/nucleus/default-plugins.js.map +1 -0
- package/dist/nucleus/govern-http.js +1 -0
- package/dist/nucleus/govern-http.js.map +1 -0
- package/dist/nucleus/index.d.ts +8 -4
- package/dist/nucleus/index.js +5 -1
- package/dist/nucleus/index.js.map +1 -0
- package/dist/nucleus/kernel.d.ts +1 -1
- package/dist/nucleus/kernel.js +1 -0
- package/dist/nucleus/kernel.js.map +1 -0
- package/dist/nucleus/orchestrator.d.ts +97 -0
- package/dist/nucleus/orchestrator.js +480 -0
- package/dist/nucleus/orchestrator.js.map +1 -0
- package/dist/nucleus/plugin-registry.d.ts +28 -0
- package/dist/nucleus/plugin-registry.js +33 -4
- package/dist/nucleus/plugin-registry.js.map +1 -0
- package/dist/nucleus/thin-dispatch.d.ts +28 -0
- package/dist/nucleus/thin-dispatch.js +58 -0
- package/dist/nucleus/thin-dispatch.js.map +1 -0
- package/dist/orchestrator/agent-spawn-governor.js +1 -0
- package/dist/orchestrator/agent-spawn-governor.js.map +1 -0
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.js +1 -0
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.js.map +1 -0
- package/dist/orchestrator/intelligent-commit-batcher.js +1 -0
- package/dist/orchestrator/intelligent-commit-batcher.js.map +1 -0
- package/dist/orchestrator/multi-agent-orchestration-coordinator.js +1 -0
- package/dist/orchestrator/multi-agent-orchestration-coordinator.js.map +1 -0
- package/dist/orchestrator/orchestrator.js +1 -0
- package/dist/orchestrator/orchestrator.js.map +1 -0
- package/dist/plugin/xray-codex-injection.js +28 -262
- package/dist/plugin/xray-codex-injection.js.map +1 -0
- package/dist/postprocessor/PostProcessor.d.ts +1 -1
- package/dist/postprocessor/PostProcessor.js +79 -1
- package/dist/postprocessor/PostProcessor.js.map +1 -0
- package/dist/postprocessor/analysis/CodeChangeAnalyzer.js +1 -0
- package/dist/postprocessor/analysis/CodeChangeAnalyzer.js.map +1 -0
- package/dist/postprocessor/analysis/FailureAnalysisEngine.js +1 -0
- package/dist/postprocessor/analysis/FailureAnalysisEngine.js.map +1 -0
- package/dist/postprocessor/autofix/AutoFixEngine.js +1 -0
- package/dist/postprocessor/autofix/AutoFixEngine.js.map +1 -0
- package/dist/postprocessor/autofix/FixValidator.js +1 -0
- package/dist/postprocessor/autofix/FixValidator.js.map +1 -0
- package/dist/postprocessor/compliance/ArchitecturalComplianceChecker.js +1 -0
- package/dist/postprocessor/compliance/ArchitecturalComplianceChecker.js.map +1 -0
- package/dist/postprocessor/config/ProcessorConfigLoader.js +1 -0
- package/dist/postprocessor/config/ProcessorConfigLoader.js.map +1 -0
- package/dist/postprocessor/config.js +1 -0
- package/dist/postprocessor/config.js.map +1 -0
- package/dist/postprocessor/escalation/EscalationEngine.js +1 -0
- package/dist/postprocessor/escalation/EscalationEngine.js.map +1 -0
- package/dist/postprocessor/metamorphosis/SelfProposalEngine.d.ts +20 -1
- package/dist/postprocessor/metamorphosis/SelfProposalEngine.js +106 -4
- package/dist/postprocessor/metamorphosis/SelfProposalEngine.js.map +1 -0
- package/dist/postprocessor/metamorphosis/index.d.ts +2 -0
- package/dist/postprocessor/metamorphosis/index.js +2 -0
- package/dist/postprocessor/metamorphosis/index.js.map +1 -0
- package/dist/postprocessor/monitoring/MonitoringEngine.js +1 -0
- package/dist/postprocessor/monitoring/MonitoringEngine.js.map +1 -0
- package/dist/postprocessor/redeploy/RedeployCoordinator.js +1 -0
- package/dist/postprocessor/redeploy/RedeployCoordinator.js.map +1 -0
- package/dist/postprocessor/reporting/PostProcessorReporter.js +1 -0
- package/dist/postprocessor/reporting/PostProcessorReporter.js.map +1 -0
- package/dist/postprocessor/services/RegressionAnalysisService.js +1 -0
- package/dist/postprocessor/services/RegressionAnalysisService.js.map +1 -0
- package/dist/postprocessor/success/SuccessHandler.js +1 -0
- package/dist/postprocessor/success/SuccessHandler.js.map +1 -0
- package/dist/postprocessor/triggers/APITrigger.js +1 -0
- package/dist/postprocessor/triggers/APITrigger.js.map +1 -0
- package/dist/postprocessor/triggers/GitHookTrigger.js +1 -0
- package/dist/postprocessor/triggers/GitHookTrigger.js.map +1 -0
- package/dist/postprocessor/triggers/WebhookTrigger.js +1 -0
- package/dist/postprocessor/triggers/WebhookTrigger.js.map +1 -0
- package/dist/postprocessor/types.d.ts +6 -0
- package/dist/postprocessor/types.js +1 -0
- package/dist/postprocessor/types.js.map +1 -0
- package/dist/postprocessor/validation/HookMetricsCollector.d.ts +47 -0
- package/dist/postprocessor/validation/HookMetricsCollector.js +188 -0
- package/dist/postprocessor/validation/HookMetricsCollector.js.map +1 -0
- package/dist/postprocessor/validation/LightweightValidator.d.ts +46 -0
- package/dist/postprocessor/validation/LightweightValidator.js +271 -0
- package/dist/postprocessor/validation/LightweightValidator.js.map +1 -0
- package/dist/processors/doc-write-guard.js +1 -0
- package/dist/processors/doc-write-guard.js.map +1 -0
- package/dist/processors/implementations/agents-md-validation-processor.js +1 -0
- package/dist/processors/implementations/agents-md-validation-processor.js.map +1 -0
- package/dist/processors/implementations/async-pattern-processor.js +1 -0
- package/dist/processors/implementations/async-pattern-processor.js.map +1 -0
- package/dist/processors/implementations/codex-compliance-processor.js +1 -0
- package/dist/processors/implementations/codex-compliance-processor.js.map +1 -0
- package/dist/processors/implementations/commit-batcher-processor.js +1 -0
- package/dist/processors/implementations/commit-batcher-processor.js.map +1 -0
- package/dist/processors/implementations/console-log-guard-processor.js +1 -0
- package/dist/processors/implementations/console-log-guard-processor.js.map +1 -0
- package/dist/processors/implementations/coverage-analysis-processor.js +1 -0
- package/dist/processors/implementations/coverage-analysis-processor.js.map +1 -0
- package/dist/processors/implementations/error-boundary-processor.js +1 -0
- package/dist/processors/implementations/error-boundary-processor.js.map +1 -0
- package/dist/processors/implementations/inference-improvement-processor.js +1 -0
- package/dist/processors/implementations/inference-improvement-processor.js.map +1 -0
- package/dist/processors/implementations/log-protection-processor.js +1 -0
- package/dist/processors/implementations/log-protection-processor.js.map +1 -0
- package/dist/processors/implementations/nudge-processor.js +1 -0
- package/dist/processors/implementations/nudge-processor.js.map +1 -0
- package/dist/processors/implementations/performance-budget-processor.js +1 -0
- package/dist/processors/implementations/performance-budget-processor.js.map +1 -0
- package/dist/processors/implementations/postprocessor-chain-validator.js +1 -0
- package/dist/processors/implementations/postprocessor-chain-validator.js.map +1 -0
- package/dist/processors/implementations/pre-validate-processor.js +1 -0
- package/dist/processors/implementations/pre-validate-processor.js.map +1 -0
- package/dist/processors/implementations/publish-preflight-processor.js +1 -0
- package/dist/processors/implementations/publish-preflight-processor.js.map +1 -0
- package/dist/processors/implementations/refactoring-logging-processor-wrapper.js +1 -0
- package/dist/processors/implementations/refactoring-logging-processor-wrapper.js.map +1 -0
- package/dist/processors/implementations/regression-testing-processor.js +1 -0
- package/dist/processors/implementations/regression-testing-processor.js.map +1 -0
- package/dist/processors/implementations/session-summary-processor.js +1 -0
- package/dist/processors/implementations/session-summary-processor.js.map +1 -0
- package/dist/processors/implementations/spawn-governance-processor.js +1 -0
- package/dist/processors/implementations/spawn-governance-processor.js.map +1 -0
- package/dist/processors/implementations/state-validation-processor.js +1 -0
- package/dist/processors/implementations/state-validation-processor.js.map +1 -0
- package/dist/processors/implementations/storytelling-trigger-processor.js +1 -0
- package/dist/processors/implementations/storytelling-trigger-processor.js.map +1 -0
- package/dist/processors/implementations/test-auto-creation-processor.js +1 -0
- package/dist/processors/implementations/test-auto-creation-processor.js.map +1 -0
- package/dist/processors/implementations/test-execution-processor.js +1 -0
- package/dist/processors/implementations/test-execution-processor.js.map +1 -0
- package/dist/processors/implementations/typescript-compilation-processor.js +1 -0
- package/dist/processors/implementations/typescript-compilation-processor.js.map +1 -0
- package/dist/processors/implementations/version-compliance-processor.js +1 -0
- package/dist/processors/implementations/version-compliance-processor.js.map +1 -0
- package/dist/processors/processor-interfaces.js +1 -0
- package/dist/processors/processor-interfaces.js.map +1 -0
- package/dist/processors/processor-manager.js +1 -0
- package/dist/processors/processor-manager.js.map +1 -0
- package/dist/processors/processor-types.js +1 -0
- package/dist/processors/processor-types.js.map +1 -0
- package/dist/public/XrayService.d.ts +17 -0
- package/dist/public/XrayService.js +41 -0
- package/dist/public/XrayService.js.map +1 -0
- package/dist/public/index.d.ts +4 -0
- package/dist/public/index.js +3 -0
- package/dist/public/index.js.map +1 -0
- package/dist/reporting/framework-reporting-system.js +1 -0
- package/dist/reporting/framework-reporting-system.js.map +1 -0
- package/dist/reporting/log-parser.js +1 -0
- package/dist/reporting/log-parser.js.map +1 -0
- package/dist/reporting/metrics.js +1 -0
- package/dist/reporting/metrics.js.map +1 -0
- package/dist/reporting/report-formatter.js +1 -0
- package/dist/reporting/report-formatter.js.map +1 -0
- package/dist/reporting/types.js +1 -0
- package/dist/reporting/types.js.map +1 -0
- package/dist/scripts/integration.js +1 -0
- package/dist/scripts/integration.js.map +1 -0
- package/dist/security/comprehensive-security-audit.js +1 -0
- package/dist/security/comprehensive-security-audit.js.map +1 -0
- package/dist/security/security-hardener.js +1 -0
- package/dist/security/security-hardener.js.map +1 -0
- package/dist/security/security-headers.js +1 -0
- package/dist/security/security-headers.js.map +1 -0
- package/dist/services/inference-tuner.js +1 -0
- package/dist/services/inference-tuner.js.map +1 -0
- package/dist/session/index.js +1 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session/session-cleanup-manager.js +1 -0
- package/dist/session/session-cleanup-manager.js.map +1 -0
- package/dist/session/session-monitor.js +1 -0
- package/dist/session/session-monitor.js.map +1 -0
- package/dist/session/session-state-manager.js +1 -0
- package/dist/session/session-state-manager.js.map +1 -0
- package/dist/skills/xray-orchestrator/index.js +1 -0
- package/dist/skills/xray-orchestrator/index.js.map +1 -0
- package/dist/state/index.js +1 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/state-manager.js +1 -0
- package/dist/state/state-manager.js.map +1 -0
- package/dist/tools/assess-complexity-tool.d.ts +28 -0
- package/dist/tools/assess-complexity-tool.js +45 -0
- package/dist/tools/assess-complexity-tool.js.map +1 -0
- package/dist/tools/query-routing-tool.d.ts +17 -0
- package/dist/tools/query-routing-tool.js +60 -0
- package/dist/tools/query-routing-tool.js.map +1 -0
- package/dist/{postprocessor/metamorphosis/MetamorphosisEngine.d.ts → types/metamorphosis.d.ts} +2 -6
- package/dist/types/metamorphosis.js +7 -0
- package/dist/types/metamorphosis.js.map +1 -0
- package/dist/utils/codex-parser.js +1 -0
- package/dist/utils/codex-parser.js.map +1 -0
- package/dist/utils/command-runner.js +1 -0
- package/dist/utils/command-runner.js.map +1 -0
- package/dist/utils/import-resolver.js +1 -0
- package/dist/utils/import-resolver.js.map +1 -0
- package/dist/utils/language-detector.js +1 -0
- package/dist/utils/language-detector.js.map +1 -0
- package/dist/utils/path-resolver.js +1 -0
- package/dist/utils/path-resolver.js.map +1 -0
- package/dist/utils/shutdown-handler.js +1 -0
- package/dist/utils/shutdown-handler.js.map +1 -0
- package/dist/utils/task-graph.d.ts +29 -0
- package/dist/utils/task-graph.js +107 -0
- package/dist/utils/task-graph.js.map +1 -0
- package/dist/validation/estimation-validator.js +1 -0
- package/dist/validation/estimation-validator.js.map +1 -0
- package/dist/validation/report-content-validator.js +1 -0
- package/dist/validation/report-content-validator.js.map +1 -0
- package/package.json +25 -3
- package/scripts/hooks/install-hooks.cjs +100 -0
- package/scripts/hooks/run-hook.js +185 -72
- package/scripts/node/postinstall.cjs +21 -7
- package/scripts/node/prepare-consumer.cjs +6 -5
- package/scripts/node/release.mjs +28 -17
- package/scripts/node/setup.cjs +19 -6
- package/scripts/node/universal-version-manager.js +2 -2
- package/src/integrations/grok/plugin/0xray/.mcp.json +1 -4
- package/src/mcps/boot-orchestrator.server.ts +38 -690
- package/src/mcps/governance.server.ts +74 -17
- package/src/mcps/in-process-skill-registry.ts +16 -0
- package/src/mcps/index.ts +79 -0
- package/src/mcps/knowledge-skills/skill-invocation.server.ts +15 -4
- package/src/mcps/mcp-client.ts +2 -2
- package/xray/features.json +17 -1
- package/dist/agents/multimodal-looker.d.ts +0 -9
- package/dist/agents/multimodal-looker.js +0 -93
- package/dist/benchmark/performance-benchmark.d.ts +0 -103
- package/dist/benchmark/performance-benchmark.js +0 -372
- package/dist/mcps/connection/connection-manager.d.ts +0 -39
- package/dist/mcps/connection/connection-manager.js +0 -79
- package/dist/postprocessor/metamorphosis/MetamorphosisEngine.js +0 -10
- package/dist/testing/memory-regression-suite.d.ts +0 -105
- package/dist/testing/memory-regression-suite.js +0 -258
- package/src/mcps/connection/connection-manager.ts +0 -91
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* install-hooks.cjs — Installs xray pre-commit hook into the consumer project's .git/hooks/.
|
|
4
|
+
*
|
|
5
|
+
* Called from setup.cjs or standalone via:
|
|
6
|
+
* node scripts/hooks/install-hooks.cjs
|
|
7
|
+
*
|
|
8
|
+
* Creates a consumer-aware pre-commit hook that references the installed
|
|
9
|
+
* package's run-hook.js and LightweightValidator via node_modules/ paths.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const fs = require("fs");
|
|
13
|
+
const path = require("path");
|
|
14
|
+
const { execSync } = require("child_process");
|
|
15
|
+
|
|
16
|
+
const packageRoot = path.resolve(path.join(__dirname, "..", ".."));
|
|
17
|
+
|
|
18
|
+
// Determine the target project root (where .git/ lives)
|
|
19
|
+
let targetDir;
|
|
20
|
+
try {
|
|
21
|
+
targetDir = execSync("git rev-parse --show-toplevel 2>/dev/null", {
|
|
22
|
+
encoding: "utf-8",
|
|
23
|
+
stdio: "pipe",
|
|
24
|
+
}).trim();
|
|
25
|
+
} catch {
|
|
26
|
+
console.warn("⚠️ Not a git repository — cannot install hooks");
|
|
27
|
+
process.exit(0);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const gitHooksDir = path.join(targetDir, ".git", "hooks");
|
|
31
|
+
if (!fs.existsSync(gitHooksDir)) {
|
|
32
|
+
console.warn("⚠️ No .git/hooks/ directory found");
|
|
33
|
+
process.exit(0);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Check if we're in a consumer install (via node_modules) or dev
|
|
37
|
+
const isConsumer = packageRoot.includes("node_modules");
|
|
38
|
+
|
|
39
|
+
// Resolve run-hook.js path
|
|
40
|
+
// In dev: scripts/hooks/run-hook.js (relative to project root)
|
|
41
|
+
// In consumer: node_modules/0xray/scripts/hooks/run-hook.js (relative to project root)
|
|
42
|
+
const runHookRelativePath = isConsumer
|
|
43
|
+
? "node_modules/0xray/scripts/hooks/run-hook.js"
|
|
44
|
+
: "scripts/hooks/run-hook.js";
|
|
45
|
+
|
|
46
|
+
const hookContent = `#!/bin/bash
|
|
47
|
+
# 0xRay Pre-Commit Hook — Consumer Install
|
|
48
|
+
# Installed by xray setup on $(new Date().toISOString().split('T')[0])
|
|
49
|
+
# Runs TypeScript check, linting, and Codex validation before commit
|
|
50
|
+
# BLOCKS the commit if validation fails
|
|
51
|
+
|
|
52
|
+
set -e
|
|
53
|
+
|
|
54
|
+
PROJECT_ROOT=$(git rev-parse --show-toplevel)
|
|
55
|
+
|
|
56
|
+
# Get staged files (only source files)
|
|
57
|
+
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\\.(ts|tsx|js|jsx|mjs)$' || true)
|
|
58
|
+
|
|
59
|
+
if [ -z "$STAGED_FILES" ]; then
|
|
60
|
+
exit 0
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
# Run the Node.js hook runner
|
|
64
|
+
if command -v node >/dev/null 2>&1; then
|
|
65
|
+
export HOOK_TYPE="pre-commit"
|
|
66
|
+
export STAGED_FILES="$STAGED_FILES"
|
|
67
|
+
export PROJECT_ROOT="$PROJECT_ROOT"
|
|
68
|
+
if [ -f "$PROJECT_ROOT/${runHookRelativePath}" ]; then
|
|
69
|
+
node "$PROJECT_ROOT/${runHookRelativePath}" pre-commit
|
|
70
|
+
exit $?
|
|
71
|
+
else
|
|
72
|
+
echo "Warning: xray hook runner not found — install may be incomplete"
|
|
73
|
+
exit 0
|
|
74
|
+
fi
|
|
75
|
+
else
|
|
76
|
+
echo "Warning: Node.js not found, skipping xray pre-commit validation"
|
|
77
|
+
exit 0
|
|
78
|
+
fi
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
const hookPath = path.join(gitHooksDir, "pre-commit");
|
|
82
|
+
const existing = fs.existsSync(hookPath);
|
|
83
|
+
if (existing) {
|
|
84
|
+
const existingContent = fs.readFileSync(hookPath, "utf-8");
|
|
85
|
+
if (existingContent.includes("0xRay") || existingContent.includes("xray")) {
|
|
86
|
+
console.log("ℹ️ Pre-commit hook already installed by xray — skipping");
|
|
87
|
+
process.exit(0);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
try {
|
|
92
|
+
fs.writeFileSync(hookPath, hookContent, { mode: 0o755 });
|
|
93
|
+
if (existing) {
|
|
94
|
+
console.log("✅ Pre-commit hook updated for xray validation");
|
|
95
|
+
} else {
|
|
96
|
+
console.log("✅ Pre-commit hook installed — runs Codex validation on every commit");
|
|
97
|
+
}
|
|
98
|
+
} catch (e) {
|
|
99
|
+
console.warn(`⚠️ Failed to install pre-commit hook: ${e.message}`);
|
|
100
|
+
}
|
|
@@ -168,10 +168,129 @@ function runTypeScriptCheck(files) {
|
|
|
168
168
|
|
|
169
169
|
// ── Codex validation ─────────────────────────────────────────
|
|
170
170
|
|
|
171
|
+
/**
|
|
172
|
+
* Try to load the framework's ConsoleLogUsageValidator.
|
|
173
|
+
* Falls back gracefully if the framework dist is not available.
|
|
174
|
+
*/
|
|
175
|
+
async function tryLoadConsoleValidator() {
|
|
176
|
+
const distPaths = [
|
|
177
|
+
join(projectRoot, "dist", "enforcement", "validators", "code-quality-validators.js"),
|
|
178
|
+
join(projectRoot, "node_modules", "xray", "dist", "enforcement", "validators", "code-quality-validators.js"),
|
|
179
|
+
];
|
|
180
|
+
for (const distPath of distPaths) {
|
|
181
|
+
if (existsSync(distPath)) {
|
|
182
|
+
try {
|
|
183
|
+
const mod = await import(distPath);
|
|
184
|
+
if (mod.ConsoleLogUsageValidator) {
|
|
185
|
+
return new mod.ConsoleLogUsageValidator();
|
|
186
|
+
}
|
|
187
|
+
} catch {
|
|
188
|
+
// Fall through to next dist path
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Try to load the framework's LightweightValidator.
|
|
197
|
+
* Falls back gracefully if the framework dist is not available.
|
|
198
|
+
*/
|
|
199
|
+
async function tryLoadLightweightValidator() {
|
|
200
|
+
const distPaths = [
|
|
201
|
+
join(projectRoot, "dist", "postprocessor", "validation", "LightweightValidator.js"),
|
|
202
|
+
join(projectRoot, "node_modules", "0xray", "dist", "postprocessor", "validation", "LightweightValidator.js"),
|
|
203
|
+
];
|
|
204
|
+
for (const distPath of distPaths) {
|
|
205
|
+
if (existsSync(distPath)) {
|
|
206
|
+
try {
|
|
207
|
+
const mod = await import(distPath);
|
|
208
|
+
if (mod.runLightweightPreCommitValidation) {
|
|
209
|
+
return mod.runLightweightPreCommitValidation;
|
|
210
|
+
}
|
|
211
|
+
} catch {}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return null;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Try to load the enforcement gate's beforeToolHook.
|
|
219
|
+
* Falls back gracefully if the framework dist is not available.
|
|
220
|
+
*/
|
|
221
|
+
async function tryLoadGate() {
|
|
222
|
+
const distPaths = [
|
|
223
|
+
join(projectRoot, "dist", "integrations", "enforcement-gate.js"),
|
|
224
|
+
join(projectRoot, "node_modules", "0xray", "dist", "integrations", "enforcement-gate.js"),
|
|
225
|
+
];
|
|
226
|
+
for (const distPath of distPaths) {
|
|
227
|
+
if (existsSync(distPath)) {
|
|
228
|
+
try {
|
|
229
|
+
const mod = await import(distPath);
|
|
230
|
+
if (mod.beforeToolHook) {
|
|
231
|
+
return mod.beforeToolHook;
|
|
232
|
+
}
|
|
233
|
+
} catch {}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Check a single file for console.log/warn/error violations using the
|
|
241
|
+
* framework validator when available, falling back to inline regex.
|
|
242
|
+
*
|
|
243
|
+
* Delegates to ConsoleLogUsageValidator (from dist/) when available to
|
|
244
|
+
* ensure consistent CLI-exemption logic with the framework's registry.
|
|
245
|
+
*/
|
|
246
|
+
async function checkConsoleViolations(filePath, content) {
|
|
247
|
+
const frameworkValidator = await tryLoadConsoleValidator();
|
|
248
|
+
if (frameworkValidator) {
|
|
249
|
+
try {
|
|
250
|
+
const result = await frameworkValidator.validate({
|
|
251
|
+
operation: "write",
|
|
252
|
+
files: [filePath],
|
|
253
|
+
newCode: content,
|
|
254
|
+
});
|
|
255
|
+
if (!result.passed) {
|
|
256
|
+
return { errors: [`${filePath}: ${result.message}`], warnings: [] };
|
|
257
|
+
}
|
|
258
|
+
return { errors: [], warnings: [] };
|
|
259
|
+
} catch {
|
|
260
|
+
// Fall through to inline check
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// Inline fallback (same logic as framework validator for consistency)
|
|
265
|
+
const codeWithoutComments = content
|
|
266
|
+
.replace(/\/\/.*$/gm, "")
|
|
267
|
+
.replace(/\/\*[\s\S]*?\*\//g, "");
|
|
268
|
+
|
|
269
|
+
const isCLIFile = filePath.includes("/cli/") || filePath.includes("src\\cli\\");
|
|
270
|
+
const violations = [];
|
|
271
|
+
|
|
272
|
+
const consolePatterns = [
|
|
273
|
+
{ pattern: /\bconsole\.log\s*\(/g, name: "console.log" },
|
|
274
|
+
{ pattern: /\bconsole\.warn\s*\(/g, name: "console.warn" },
|
|
275
|
+
{ pattern: /\bconsole\.error\s*\(/g, name: "console.error" },
|
|
276
|
+
];
|
|
277
|
+
for (const { pattern, name } of consolePatterns) {
|
|
278
|
+
const matches = codeWithoutComments.match(pattern);
|
|
279
|
+
if (matches && matches.length > 0) {
|
|
280
|
+
violations.push(`${matches.length} use(s) of ${name}`);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
if (violations.length > 0 && !isCLIFile) {
|
|
285
|
+
return { errors: [`${filePath}: ${violations.join("; ")}`], warnings: [] };
|
|
286
|
+
}
|
|
287
|
+
return { errors: [], warnings: [] };
|
|
288
|
+
}
|
|
289
|
+
|
|
171
290
|
async function runCodexValidation(files) {
|
|
172
291
|
/**
|
|
173
292
|
* Run lightweight codex validation on files.
|
|
174
|
-
* Uses dynamic import of framework
|
|
293
|
+
* Uses dynamic import of ConsoleLogUsageValidator from framework when available.
|
|
175
294
|
*/
|
|
176
295
|
log("Running Codex validation...");
|
|
177
296
|
|
|
@@ -182,7 +301,6 @@ async function runCodexValidation(files) {
|
|
|
182
301
|
return { passed: true, warnings: [], errors: [] };
|
|
183
302
|
}
|
|
184
303
|
|
|
185
|
-
// Quick static checks without framework dependency
|
|
186
304
|
const errors = [];
|
|
187
305
|
const warnings = [];
|
|
188
306
|
|
|
@@ -194,49 +312,36 @@ async function runCodexValidation(files) {
|
|
|
194
312
|
const content = readFileSync(filePath, "utf-8");
|
|
195
313
|
const lines = content.split("\n");
|
|
196
314
|
|
|
197
|
-
//
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
if (
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
// Check for TODO/FIXME
|
|
209
|
-
const todoLines = lines.reduce((acc, line, i) => {
|
|
210
|
-
if (/\/\/\s*(TODO|FIXME|HACK|XXX)\b/i.test(line)) {
|
|
211
|
-
acc.push(i + 1);
|
|
212
|
-
}
|
|
213
|
-
return acc;
|
|
214
|
-
}, []);
|
|
215
|
-
if (todoLines.length > 0) {
|
|
216
|
-
warnings.push(`${file}: ${todoLines.length} TODO/FIXME comment(s) found`);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
// Check for @ts-ignore
|
|
220
|
-
const tsIgnoreLines = lines.reduce((acc, line, i) => {
|
|
221
|
-
if (/@ts-ignore|@ts-nocheck|@ts-expect-error/.test(line)) {
|
|
222
|
-
acc.push(i + 1);
|
|
223
|
-
}
|
|
224
|
-
return acc;
|
|
225
|
-
}, []);
|
|
226
|
-
if (tsIgnoreLines.length > 0) {
|
|
227
|
-
warnings.push(`${file}: ${tsIgnoreLines.length} @ts-ignore/@ts-nocheck found`);
|
|
315
|
+
// Console check via framework validator (with inline fallback)
|
|
316
|
+
const consoleResult = await checkConsoleViolations(file, content);
|
|
317
|
+
errors.push(...consoleResult.errors);
|
|
318
|
+
warnings.push(...consoleResult.warnings);
|
|
319
|
+
|
|
320
|
+
// LightweightValidator for TODO/@ts-ignore/any/security/syntax (replaces inline regex)
|
|
321
|
+
const lwValidate = await tryLoadLightweightValidator();
|
|
322
|
+
if (lwValidate) {
|
|
323
|
+
const lwResult = await lwValidate([filePath]);
|
|
324
|
+
errors.push(...lwResult.errors);
|
|
325
|
+
warnings.push(...lwResult.warnings);
|
|
228
326
|
}
|
|
229
327
|
|
|
230
|
-
//
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
328
|
+
// Full registry gate call (same path as TUI/CLI hooks)
|
|
329
|
+
const beforeHook = await tryLoadGate();
|
|
330
|
+
if (beforeHook) {
|
|
331
|
+
try {
|
|
332
|
+
const gateResult = await beforeHook("write", { filePath, content });
|
|
333
|
+
if (!gateResult.allowed && gateResult.violations) {
|
|
334
|
+
for (const v of gateResult.violations) {
|
|
335
|
+
const msg = `${file}: ${v.message || v.ruleId}`;
|
|
336
|
+
if (v.severity === "error" || v.severity === "blocking") {
|
|
337
|
+
errors.push(msg);
|
|
338
|
+
} else {
|
|
339
|
+
warnings.push(msg);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
235
342
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
if (anyLines.length > 3) {
|
|
239
|
-
warnings.push(`${file}: ${anyLines.length} uses of 'any' type`);
|
|
343
|
+
} catch (gateErr) {
|
|
344
|
+
logError(`Gate call failed for ${file}: ${gateErr.message}`);
|
|
240
345
|
}
|
|
241
346
|
}
|
|
242
347
|
} catch {
|
|
@@ -398,34 +503,38 @@ async function handlePreCommit() {
|
|
|
398
503
|
// TypeScript check (blocking)
|
|
399
504
|
const tsResult = runTypeScriptCheck(stagedFiles);
|
|
400
505
|
if (!tsResult.passed) {
|
|
401
|
-
|
|
402
|
-
tsResult.errors.slice(0, 10).forEach((e) =>
|
|
506
|
+
process.stderr.write("\n❌ TypeScript validation failed:\n");
|
|
507
|
+
tsResult.errors.slice(0, 10).forEach((e) => process.stderr.write(` ${e}\n`));
|
|
403
508
|
if (tsResult.errors.length > 10) {
|
|
404
|
-
|
|
509
|
+
process.stderr.write(` ... and ${tsResult.errors.length - 10} more\n`);
|
|
405
510
|
}
|
|
406
|
-
|
|
407
|
-
|
|
511
|
+
process.stderr.write("\nFix TypeScript errors before committing.\n");
|
|
512
|
+
process.stderr.write("Run: npx tsc --noEmit\n");
|
|
408
513
|
process.exit(1);
|
|
409
514
|
}
|
|
410
515
|
|
|
411
516
|
// Codex validation (blocking)
|
|
412
517
|
const codexResult = await runCodexValidation(stagedFiles);
|
|
413
518
|
if (!codexResult.passed) {
|
|
414
|
-
|
|
415
|
-
codexResult.errors.slice(0, 10).forEach((e) =>
|
|
416
|
-
|
|
417
|
-
|
|
519
|
+
logError("Codex validation failed:");
|
|
520
|
+
codexResult.errors.slice(0, 10).forEach((e) => logError(` ${e}`));
|
|
521
|
+
process.stderr.write("\n❌ Codex validation failed:\n");
|
|
522
|
+
codexResult.errors.slice(0, 10).forEach((e) => process.stderr.write(` ${e}\n`));
|
|
523
|
+
process.stderr.write("\nFix Codex violations before committing.\n");
|
|
524
|
+
process.stderr.write("Run: npx xray validate\n\n");
|
|
418
525
|
process.exit(1);
|
|
419
526
|
}
|
|
420
527
|
|
|
421
528
|
// Warnings (non-blocking)
|
|
422
529
|
if (codexResult.warnings.length > 0) {
|
|
423
|
-
|
|
424
|
-
codexResult.warnings.slice(0, 5).forEach((w) =>
|
|
425
|
-
|
|
530
|
+
log("Codex warnings:");
|
|
531
|
+
codexResult.warnings.slice(0, 5).forEach((w) => log(` ${w}`));
|
|
532
|
+
process.stderr.write("\n⚠️ Codex warnings:\n");
|
|
533
|
+
codexResult.warnings.slice(0, 5).forEach((w) => process.stderr.write(` ${w}\n`));
|
|
534
|
+
process.stderr.write("\n");
|
|
426
535
|
}
|
|
427
536
|
|
|
428
|
-
|
|
537
|
+
log(`\n✅ Pre-commit validation passed (${stagedFiles.length} files)\n`);
|
|
429
538
|
process.exit(0);
|
|
430
539
|
}
|
|
431
540
|
|
|
@@ -461,41 +570,45 @@ async function handlePrePush() {
|
|
|
461
570
|
const result = await runFullValidation(changedFiles);
|
|
462
571
|
|
|
463
572
|
if (!result.passed) {
|
|
464
|
-
|
|
573
|
+
logError("Pre-push validation failed:");
|
|
574
|
+
process.stderr.write("\n❌ Pre-push validation failed:\n");
|
|
465
575
|
|
|
466
576
|
if (!result.typescript.passed) {
|
|
467
|
-
|
|
577
|
+
process.stderr.write("TypeScript errors:\n");
|
|
468
578
|
result.typescript.errors.slice(0, 10).forEach((e) =>
|
|
469
|
-
|
|
579
|
+
process.stderr.write(` ${e}\n`)
|
|
470
580
|
);
|
|
471
|
-
|
|
581
|
+
process.stderr.write("\n");
|
|
472
582
|
}
|
|
473
583
|
|
|
474
584
|
if (!result.codex.passed) {
|
|
475
|
-
|
|
585
|
+
process.stderr.write("Codex violations:\n");
|
|
476
586
|
result.codex.errors.slice(0, 10).forEach((e) =>
|
|
477
|
-
|
|
587
|
+
process.stderr.write(` ${e}\n`)
|
|
478
588
|
);
|
|
479
|
-
|
|
589
|
+
process.stderr.write("\n");
|
|
480
590
|
}
|
|
481
591
|
|
|
482
|
-
|
|
483
|
-
|
|
592
|
+
process.stderr.write("Fix all errors before pushing.\n");
|
|
593
|
+
process.stderr.write("Run: npx tsc --noEmit && npx xray validate\n\n");
|
|
484
594
|
process.exit(1);
|
|
485
595
|
}
|
|
486
596
|
|
|
487
597
|
// Warnings
|
|
488
598
|
if (result.codex.warnings.length > 0) {
|
|
489
|
-
|
|
490
|
-
result.codex.warnings.slice(0, 5).forEach((w) =>
|
|
491
|
-
|
|
599
|
+
log("Codex warnings:");
|
|
600
|
+
result.codex.warnings.slice(0, 5).forEach((w) => log(` ${w}`));
|
|
601
|
+
process.stderr.write("\n⚠️ Codex warnings:\n");
|
|
602
|
+
result.codex.warnings.slice(0, 5).forEach((w) => process.stderr.write(` ${w}\n`));
|
|
603
|
+
process.stderr.write("\n");
|
|
492
604
|
}
|
|
493
605
|
|
|
494
606
|
if (result.testWarning) {
|
|
495
|
-
|
|
607
|
+
log(`Pre-push test warning: ${result.testWarning}`);
|
|
608
|
+
process.stderr.write(`\n⚠️ ${result.testWarning}\n\n`);
|
|
496
609
|
}
|
|
497
610
|
|
|
498
|
-
|
|
611
|
+
log(`\n✅ Pre-push validation passed (${changedFiles.length} files)\n`);
|
|
499
612
|
process.exit(0);
|
|
500
613
|
}
|
|
501
614
|
|
|
@@ -551,8 +664,8 @@ const handlers = {
|
|
|
551
664
|
|
|
552
665
|
const handler = handlers[hookType];
|
|
553
666
|
if (!handler) {
|
|
554
|
-
|
|
555
|
-
|
|
667
|
+
process.stderr.write(`Unknown hook type: ${hookType}\n`);
|
|
668
|
+
process.stderr.write(`Valid types: ${Object.keys(handlers).join(", ")}\n`);
|
|
556
669
|
process.exit(1);
|
|
557
670
|
}
|
|
558
671
|
|
|
@@ -565,6 +678,6 @@ handler()
|
|
|
565
678
|
})
|
|
566
679
|
.catch((err) => {
|
|
567
680
|
logError(`Hook crashed: ${err.message}`);
|
|
568
|
-
|
|
681
|
+
process.stderr.write(`0xRay hook error: ${err.message}\n`);
|
|
569
682
|
process.exit(1);
|
|
570
683
|
});
|
|
@@ -11,14 +11,18 @@ function structuredLog(component, action, status, details) {
|
|
|
11
11
|
console.log(`${ts} [${component}] ${action} - ${String(status).toUpperCase()}${detailsPart}`);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const packageRoot = path.
|
|
14
|
+
const packageRoot = path.resolve(__dirname, "..", "..");
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
// Consumer-friendly targetDir resolution:
|
|
17
|
+
// - In node_modules/0xray (or legacy xray): walk up until outside node_modules to reach consumer project root.
|
|
18
|
+
// - Otherwise (dev): use cwd.
|
|
19
|
+
let targetDir = process.env.PWD || process.cwd();
|
|
20
|
+
if (packageRoot.includes("node_modules")) {
|
|
21
|
+
let current = packageRoot;
|
|
22
|
+
while (current.includes("node_modules")) {
|
|
23
|
+
current = path.dirname(current);
|
|
24
|
+
}
|
|
25
|
+
targetDir = current;
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
const resolvedPackage = path.resolve(packageRoot);
|
|
@@ -73,6 +77,16 @@ if (resolvedPackage !== resolvedTarget) {
|
|
|
73
77
|
}
|
|
74
78
|
}
|
|
75
79
|
|
|
80
|
+
// Install pre-commit hook (LightweightValidator + gate, if git repo)
|
|
81
|
+
try {
|
|
82
|
+
const installHooks = path.join(packageRoot, "scripts", "hooks", "install-hooks.cjs");
|
|
83
|
+
if (fs.existsSync(installHooks)) {
|
|
84
|
+
execSync(`node "${installHooks}"`, { stdio: 'pipe' });
|
|
85
|
+
}
|
|
86
|
+
} catch (_e) {
|
|
87
|
+
// Non-git or install failure — not blocking
|
|
88
|
+
}
|
|
89
|
+
|
|
76
90
|
if (resolvedPackage !== resolvedTarget) {
|
|
77
91
|
structuredLog('postinstall', 'xray v2 framework installed. Run `npx xray setup` for full configuration (hooks, Hermes, symlinks).', 'success');
|
|
78
92
|
}
|
|
@@ -33,12 +33,13 @@ function updatePathsInFile(filePath) {
|
|
|
33
33
|
let content = fs.readFileSync(filePath, 'utf-8');
|
|
34
34
|
let updated = false;
|
|
35
35
|
|
|
36
|
-
// Transform development paths back to consumer paths
|
|
37
|
-
//
|
|
38
|
-
if
|
|
36
|
+
// Transform development paths back to consumer paths.
|
|
37
|
+
// Use 0xray (current published name). Keep xray for any legacy consumer configs.
|
|
38
|
+
// Only transform if it's not already a consumer path.
|
|
39
|
+
if (content.includes('dist/plugin/mcps/') && !content.includes('node_modules/0xray/dist/plugin/mcps/') && !content.includes('node_modules/xray/dist/plugin/mcps/')) {
|
|
39
40
|
content = content.replace(
|
|
40
41
|
/dist\/plugin\/mcps\//g,
|
|
41
|
-
'node_modules/
|
|
42
|
+
'node_modules/0xray/dist/plugin/mcps/'
|
|
42
43
|
);
|
|
43
44
|
updated = true;
|
|
44
45
|
}
|
|
@@ -47,7 +48,7 @@ function updatePathsInFile(filePath) {
|
|
|
47
48
|
if (content.includes('../../../dist/plugin/')) {
|
|
48
49
|
content = content.replace(
|
|
49
50
|
/\.\.\/\.\.\/\.\.\/dist\/plugin\//g,
|
|
50
|
-
'node_modules/
|
|
51
|
+
'node_modules/0xray/dist/plugin/'
|
|
51
52
|
);
|
|
52
53
|
updated = true;
|
|
53
54
|
}
|
package/scripts/node/release.mjs
CHANGED
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
* 2. npm version (bumps package.json, triggers preversion → version scripts)
|
|
9
9
|
* 3. Build
|
|
10
10
|
* 4. Consumer verification (npm pack + fresh install + 4 bridge E2Es)
|
|
11
|
-
* 5. Commit
|
|
12
|
-
* 6.
|
|
13
|
-
* 7. Push commit + tag
|
|
11
|
+
* 5. Commit
|
|
12
|
+
* 6. Tag
|
|
13
|
+
* 7. Push commit + tag to remote
|
|
14
|
+
* 8. npm publish (triggers prepublishOnly → prepare-consumer + build)
|
|
14
15
|
*
|
|
15
16
|
* Usage:
|
|
16
17
|
* npm run release:patch # patch bump (default)
|
|
@@ -151,26 +152,36 @@ async function main() {
|
|
|
151
152
|
}
|
|
152
153
|
}
|
|
153
154
|
|
|
154
|
-
// Step 7:
|
|
155
|
-
step(7, '
|
|
155
|
+
// Step 7: Push (git state before registry)
|
|
156
|
+
step(7, 'Push to remote');
|
|
156
157
|
if (!dryRun) {
|
|
157
|
-
if (!run('
|
|
158
|
-
|
|
159
|
-
if (!run('npm publish --access public --ignore-scripts', `Publish 0xray@${newVersion} (fallback)`)) {
|
|
160
|
-
process.exit(1);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
158
|
+
if (!run('git push', 'Push commits')) process.exit(1);
|
|
159
|
+
if (!run(`git push origin v${newVersion}`, 'Push tag')) process.exit(1);
|
|
163
160
|
} else {
|
|
164
|
-
log(` ~`, 'Would
|
|
161
|
+
log(` ~`, 'Would push commits + tag', YELLOW);
|
|
165
162
|
}
|
|
166
163
|
|
|
167
|
-
// Step 8:
|
|
168
|
-
step(8, '
|
|
164
|
+
// Step 8: Publish (prepublishOnly runs prepare-consumer + build)
|
|
165
|
+
step(8, 'Publish to npm');
|
|
169
166
|
if (!dryRun) {
|
|
170
|
-
|
|
171
|
-
if (!
|
|
167
|
+
const publishResult = run('npm publish --access public', `Publish 0xray@${newVersion}`);
|
|
168
|
+
if (!publishResult) {
|
|
169
|
+
// Check if the version was already published (non-fatal — previous attempt may have timed out)
|
|
170
|
+
try {
|
|
171
|
+
const published = execSync(`npm view 0xray@${newVersion} version`, { encoding: 'utf-8', timeout: 15000 }).trim();
|
|
172
|
+
if (published === newVersion) {
|
|
173
|
+
log(` ✓`, `Already published 0xray@${newVersion}`, GREEN);
|
|
174
|
+
} else {
|
|
175
|
+
log(` ✗`, 'Publish failed', RED);
|
|
176
|
+
process.exit(1);
|
|
177
|
+
}
|
|
178
|
+
} catch {
|
|
179
|
+
log(` ✗`, 'Publish failed — cannot verify', RED);
|
|
180
|
+
process.exit(1);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
172
183
|
} else {
|
|
173
|
-
log(` ~`, 'Would
|
|
184
|
+
log(` ~`, 'Would publish: npm publish --access public', YELLOW);
|
|
174
185
|
}
|
|
175
186
|
|
|
176
187
|
console.log(`\n${BOLD}${GREEN}✅ Released 0xray@${newVersion}${RESET}\n`);
|
package/scripts/node/setup.cjs
CHANGED
|
@@ -3,14 +3,17 @@
|
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
const path = require("path");
|
|
5
5
|
|
|
6
|
-
const packageRoot = path.
|
|
6
|
+
const packageRoot = path.resolve(__dirname, "..", "..");
|
|
7
7
|
const homeDir = require("os").homedir();
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
// Consumer-friendly targetDir (same logic as postinstall)
|
|
10
|
+
let targetDir = process.env.PWD || process.cwd();
|
|
11
|
+
if (packageRoot.includes("node_modules")) {
|
|
12
|
+
let current = packageRoot;
|
|
13
|
+
while (current.includes("node_modules")) {
|
|
14
|
+
current = path.dirname(current);
|
|
15
|
+
}
|
|
16
|
+
targetDir = current;
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
console.log("🔧 xray Setup: Full configuration...\n");
|
|
@@ -243,4 +246,14 @@ if (fs.existsSync(hermesSkillSource)) {
|
|
|
243
246
|
} catch (e) { console.warn(`⚠️ Hermes skill: ${e.message}`); }
|
|
244
247
|
}
|
|
245
248
|
|
|
249
|
+
// 8. Install pre-commit hook (LightweightValidator + gate + registry)
|
|
250
|
+
const installHooksPath = path.join(packageRoot, "scripts", "hooks", "install-hooks.cjs");
|
|
251
|
+
if (fs.existsSync(installHooksPath)) {
|
|
252
|
+
try {
|
|
253
|
+
require("child_process").execSync(`node "${installHooksPath}"`, { stdio: "inherit" });
|
|
254
|
+
} catch (e) {
|
|
255
|
+
console.warn(`⚠️ Hook installation: ${e.message}`);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
246
259
|
console.log("\n✅ xray setup complete.\n");
|
|
@@ -155,9 +155,9 @@ const detectedCodex = detectCodexInfo();
|
|
|
155
155
|
const OFFICIAL_VERSIONS = {
|
|
156
156
|
// Framework version
|
|
157
157
|
framework: {
|
|
158
|
-
version: "
|
|
158
|
+
version: "3.0.0",
|
|
159
159
|
displayName: "xray: Self-Healing AI Governance OS",
|
|
160
|
-
lastUpdated: "2026-06-
|
|
160
|
+
lastUpdated: "2026-06-12",
|
|
161
161
|
// Counts (auto-calculated, but can be overridden)
|
|
162
162
|
...CALCULATED_COUNTS,
|
|
163
163
|
},
|