Module: Sxn
- Defined in:
- lib/sxn.rb,
lib/sxn/ui.rb,
lib/sxn/CLI.rb,
lib/sxn/mcp.rb,
lib/sxn/core.rb,
lib/sxn/rules.rb,
lib/sxn/config.rb,
lib/sxn/errors.rb,
lib/sxn/version.rb,
lib/sxn/commands.rb,
lib/sxn/database.rb,
lib/sxn/security.rb,
lib/sxn/ui/table.rb,
lib/sxn/templates.rb,
lib/sxn/ui/output.rb,
lib/sxn/ui/prompt.rb,
lib/sxn/mcp/server.rb,
lib/sxn/commands/mcp.rb,
lib/sxn/rules/errors.rb,
lib/sxn/commands/init.rb,
lib/sxn/commands/rules.rb,
lib/sxn/database/errors.rb,
lib/sxn/mcp/tools/rules.rb,
lib/sxn/rules/base_rule.rb,
lib/sxn/ui/progress_bar.rb,
lib/sxn/templates/errors.rb,
lib/sxn/commands/projects.rb,
lib/sxn/commands/sessions.rb,
lib/sxn/commands/templates.rb,
lib/sxn/commands/worktrees.rb,
lib/sxn/core/rules_manager.rb,
lib/sxn/mcp/tools/projects.rb,
lib/sxn/mcp/tools/sessions.rb,
lib/sxn/rules/rules_engine.rb,
lib/sxn/config/config_cache.rb,
lib/sxn/core/config_manager.rb,
lib/sxn/core/session_config.rb,
lib/sxn/mcp/tools/base_tool.rb,
lib/sxn/mcp/tools/templates.rb,
lib/sxn/mcp/tools/worktrees.rb,
lib/sxn/rules/template_rule.rb,
lib/sxn/runtime_validations.rb,
lib/sxn/core/project_manager.rb,
lib/sxn/core/session_manager.rb,
lib/sxn/core/template_manager.rb,
lib/sxn/core/worktree_manager.rb,
lib/sxn/rules/copy_files_rule.rb,
lib/sxn/rules/project_detector.rb,
lib/sxn/config/config_discovery.rb,
lib/sxn/config/config_validator.rb,
lib/sxn/config/templates_config.rb,
lib/sxn/database/session_database.rb,
lib/sxn/rules/setup_commands_rule.rb,
lib/sxn/templates/template_engine.rb,
lib/sxn/security/secure_file_copier.rb,
lib/sxn/templates/template_security.rb,
lib/sxn/mcp/prompts/workflow_prompts.rb,
lib/sxn/templates/template_processor.rb,
lib/sxn/templates/template_variables.rb,
lib/sxn/security/secure_path_validator.rb,
lib/sxn/mcp/resources/session_resources.rb,
lib/sxn/security/secure_command_executor.rb
Overview
MCP module is loaded on demand via require "sxn/mcp"
Defined Under Namespace
Modules: Commands, Config, Core, Database, MCP, Rules, RuntimeValidations, Security, Templates, UI
Classes: ApplicationError, BranchError, CLI, CommandExecutionError, ConfigurationError, DatabaseConnectionError, DatabaseError, DatabaseMigrationError, Error, GitError, InvalidProjectNameError, InvalidProjectPathError, InvalidRuleConfigError, InvalidRuleTypeError, InvalidSessionNameError, MCPError, MCPServerError, MCPValidationError, NoActiveSessionError, PathValidationError, ProjectAlreadyExistsError, ProjectError, ProjectExistsError, ProjectInUseError, ProjectNotFoundError, RollbackError, RuleError, RuleExecutionError, RuleNotFoundError, RuleValidationError, SecurityError, SessionAlreadyExistsError, SessionError, SessionExistsError, SessionHasChangesError, SessionNotFoundError, SessionTemplateApplicationError, SessionTemplateError, SessionTemplateNotFoundError, SessionTemplateValidationError, TemplateError, TemplateNotFoundError, TemplateProcessingError, ValidationError, WorktreeCreationError, WorktreeError, WorktreeExistsError, WorktreeNotFoundError, WorktreeRemovalError
Constant Summary
collapse
- VERSION =
"0.4.0"
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.config ⇒ Object
Returns the value of attribute config.
20
21
22
|
# File 'lib/sxn.rb', line 20
def config
@config
end
|
.logger ⇒ Object
Returns the value of attribute logger.
20
21
22
|
# File 'lib/sxn.rb', line 20
def logger
@logger
end
|
Class Method Details
.lib_root ⇒ Object
26
27
28
|
# File 'lib/sxn.rb', line 26
def lib_root
File.expand_path(__dir__)
end
|
.load_config ⇒ Object
34
35
36
|
# File 'lib/sxn.rb', line 34
def load_config
@config = Config.current
end
|
.root ⇒ Object
22
23
24
|
# File 'lib/sxn.rb', line 22
def root
File.expand_path("..", __dir__)
end
|
.setup_logger(level: :info) ⇒ Object
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/sxn.rb', line 38
def setup_logger(level: :info)
require "logger"
@logger = Logger.new($stdout)
level = level.to_sym if level.is_a?(String)
@logger.level = case level
when :debug then Logger::DEBUG
when :info then Logger::INFO
when :warn then Logger::WARN
when :error then Logger::ERROR
else Logger::INFO
end
@logger.formatter = proc do |severity, datetime, _progname, msg|
"[#{datetime.strftime("%Y-%m-%d %H:%M:%S")}] #{severity}: #{msg}\n"
end
@logger
end
|
.version ⇒ Object
30
31
32
|
# File 'lib/sxn.rb', line 30
def version
VERSION
end
|