sxn 0.2.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.
Files changed (156) hide show
  1. checksums.yaml +7 -0
  2. data/.gem_rbs_collection/addressable/2.8/.rbs_meta.yaml +9 -0
  3. data/.gem_rbs_collection/addressable/2.8/addressable.rbs +62 -0
  4. data/.gem_rbs_collection/async/2.12/.rbs_meta.yaml +9 -0
  5. data/.gem_rbs_collection/async/2.12/async.rbs +119 -0
  6. data/.gem_rbs_collection/async/2.12/kernel.rbs +5 -0
  7. data/.gem_rbs_collection/async/2.12/manifest.yaml +7 -0
  8. data/.gem_rbs_collection/bcrypt/3.1/.rbs_meta.yaml +9 -0
  9. data/.gem_rbs_collection/bcrypt/3.1/bcrypt.rbs +47 -0
  10. data/.gem_rbs_collection/bcrypt/3.1/manifest.yaml +2 -0
  11. data/.gem_rbs_collection/bigdecimal/3.1/.rbs_meta.yaml +9 -0
  12. data/.gem_rbs_collection/bigdecimal/3.1/bigdecimal-math.rbs +119 -0
  13. data/.gem_rbs_collection/bigdecimal/3.1/bigdecimal.rbs +1630 -0
  14. data/.gem_rbs_collection/concurrent-ruby/1.1/.rbs_meta.yaml +9 -0
  15. data/.gem_rbs_collection/concurrent-ruby/1.1/array.rbs +4 -0
  16. data/.gem_rbs_collection/concurrent-ruby/1.1/executor.rbs +26 -0
  17. data/.gem_rbs_collection/concurrent-ruby/1.1/hash.rbs +4 -0
  18. data/.gem_rbs_collection/concurrent-ruby/1.1/map.rbs +65 -0
  19. data/.gem_rbs_collection/concurrent-ruby/1.1/promises.rbs +249 -0
  20. data/.gem_rbs_collection/concurrent-ruby/1.1/utility/processor_counter.rbs +5 -0
  21. data/.gem_rbs_collection/diff-lcs/1.5/.rbs_meta.yaml +9 -0
  22. data/.gem_rbs_collection/diff-lcs/1.5/diff-lcs.rbs +11 -0
  23. data/.gem_rbs_collection/listen/3.9/.rbs_meta.yaml +9 -0
  24. data/.gem_rbs_collection/listen/3.9/listen.rbs +25 -0
  25. data/.gem_rbs_collection/listen/3.9/listener.rbs +24 -0
  26. data/.gem_rbs_collection/mini_mime/0.1/.rbs_meta.yaml +9 -0
  27. data/.gem_rbs_collection/mini_mime/0.1/mini_mime.rbs +14 -0
  28. data/.gem_rbs_collection/parallel/1.20/.rbs_meta.yaml +9 -0
  29. data/.gem_rbs_collection/parallel/1.20/parallel.rbs +86 -0
  30. data/.gem_rbs_collection/rake/13.0/.rbs_meta.yaml +9 -0
  31. data/.gem_rbs_collection/rake/13.0/manifest.yaml +2 -0
  32. data/.gem_rbs_collection/rake/13.0/rake.rbs +39 -0
  33. data/.gem_rbs_collection/rubocop-ast/1.46/.rbs_meta.yaml +9 -0
  34. data/.gem_rbs_collection/rubocop-ast/1.46/rubocop-ast.rbs +822 -0
  35. data/.gem_rbs_collection/sqlite3/2.0/.rbs_meta.yaml +9 -0
  36. data/.gem_rbs_collection/sqlite3/2.0/database.rbs +20 -0
  37. data/.gem_rbs_collection/sqlite3/2.0/pragmas.rbs +5 -0
  38. data/.rspec +4 -0
  39. data/.rubocop.yml +121 -0
  40. data/.simplecov +51 -0
  41. data/CHANGELOG.md +49 -0
  42. data/Gemfile +24 -0
  43. data/Gemfile.lock +329 -0
  44. data/LICENSE.txt +21 -0
  45. data/README.md +225 -0
  46. data/Rakefile +54 -0
  47. data/Steepfile +50 -0
  48. data/bin/sxn +6 -0
  49. data/lib/sxn/CLI.rb +275 -0
  50. data/lib/sxn/commands/init.rb +137 -0
  51. data/lib/sxn/commands/projects.rb +350 -0
  52. data/lib/sxn/commands/rules.rb +435 -0
  53. data/lib/sxn/commands/sessions.rb +300 -0
  54. data/lib/sxn/commands/worktrees.rb +416 -0
  55. data/lib/sxn/commands.rb +13 -0
  56. data/lib/sxn/config/config_cache.rb +295 -0
  57. data/lib/sxn/config/config_discovery.rb +242 -0
  58. data/lib/sxn/config/config_validator.rb +562 -0
  59. data/lib/sxn/config.rb +259 -0
  60. data/lib/sxn/core/config_manager.rb +290 -0
  61. data/lib/sxn/core/project_manager.rb +307 -0
  62. data/lib/sxn/core/rules_manager.rb +306 -0
  63. data/lib/sxn/core/session_manager.rb +336 -0
  64. data/lib/sxn/core/worktree_manager.rb +281 -0
  65. data/lib/sxn/core.rb +13 -0
  66. data/lib/sxn/database/errors.rb +29 -0
  67. data/lib/sxn/database/session_database.rb +691 -0
  68. data/lib/sxn/database.rb +24 -0
  69. data/lib/sxn/errors.rb +76 -0
  70. data/lib/sxn/rules/base_rule.rb +367 -0
  71. data/lib/sxn/rules/copy_files_rule.rb +346 -0
  72. data/lib/sxn/rules/errors.rb +28 -0
  73. data/lib/sxn/rules/project_detector.rb +871 -0
  74. data/lib/sxn/rules/rules_engine.rb +485 -0
  75. data/lib/sxn/rules/setup_commands_rule.rb +307 -0
  76. data/lib/sxn/rules/template_rule.rb +262 -0
  77. data/lib/sxn/rules.rb +148 -0
  78. data/lib/sxn/runtime_validations.rb +96 -0
  79. data/lib/sxn/security/secure_command_executor.rb +364 -0
  80. data/lib/sxn/security/secure_file_copier.rb +478 -0
  81. data/lib/sxn/security/secure_path_validator.rb +258 -0
  82. data/lib/sxn/security.rb +15 -0
  83. data/lib/sxn/templates/common/gitignore.liquid +99 -0
  84. data/lib/sxn/templates/common/session-info.md.liquid +58 -0
  85. data/lib/sxn/templates/errors.rb +36 -0
  86. data/lib/sxn/templates/javascript/README.md.liquid +59 -0
  87. data/lib/sxn/templates/javascript/session-info.md.liquid +206 -0
  88. data/lib/sxn/templates/rails/CLAUDE.md.liquid +78 -0
  89. data/lib/sxn/templates/rails/database.yml.liquid +31 -0
  90. data/lib/sxn/templates/rails/session-info.md.liquid +144 -0
  91. data/lib/sxn/templates/template_engine.rb +346 -0
  92. data/lib/sxn/templates/template_processor.rb +279 -0
  93. data/lib/sxn/templates/template_security.rb +410 -0
  94. data/lib/sxn/templates/template_variables.rb +713 -0
  95. data/lib/sxn/templates.rb +28 -0
  96. data/lib/sxn/ui/output.rb +103 -0
  97. data/lib/sxn/ui/progress_bar.rb +91 -0
  98. data/lib/sxn/ui/prompt.rb +116 -0
  99. data/lib/sxn/ui/table.rb +183 -0
  100. data/lib/sxn/ui.rb +12 -0
  101. data/lib/sxn/version.rb +5 -0
  102. data/lib/sxn.rb +63 -0
  103. data/rbs_collection.lock.yaml +180 -0
  104. data/rbs_collection.yaml +39 -0
  105. data/scripts/test.sh +31 -0
  106. data/sig/external/liquid.rbs +116 -0
  107. data/sig/external/thor.rbs +99 -0
  108. data/sig/external/tty.rbs +71 -0
  109. data/sig/sxn/cli.rbs +46 -0
  110. data/sig/sxn/commands/init.rbs +38 -0
  111. data/sig/sxn/commands/projects.rbs +72 -0
  112. data/sig/sxn/commands/rules.rbs +95 -0
  113. data/sig/sxn/commands/sessions.rbs +62 -0
  114. data/sig/sxn/commands/worktrees.rbs +82 -0
  115. data/sig/sxn/commands.rbs +6 -0
  116. data/sig/sxn/config/config_cache.rbs +67 -0
  117. data/sig/sxn/config/config_discovery.rbs +64 -0
  118. data/sig/sxn/config/config_validator.rbs +64 -0
  119. data/sig/sxn/config.rbs +74 -0
  120. data/sig/sxn/core/config_manager.rbs +67 -0
  121. data/sig/sxn/core/project_manager.rbs +52 -0
  122. data/sig/sxn/core/rules_manager.rbs +54 -0
  123. data/sig/sxn/core/session_manager.rbs +59 -0
  124. data/sig/sxn/core/worktree_manager.rbs +50 -0
  125. data/sig/sxn/core.rbs +87 -0
  126. data/sig/sxn/database/errors.rbs +37 -0
  127. data/sig/sxn/database/session_database.rbs +151 -0
  128. data/sig/sxn/database.rbs +83 -0
  129. data/sig/sxn/errors.rbs +89 -0
  130. data/sig/sxn/rules/base_rule.rbs +137 -0
  131. data/sig/sxn/rules/copy_files_rule.rbs +65 -0
  132. data/sig/sxn/rules/errors.rbs +33 -0
  133. data/sig/sxn/rules/project_detector.rbs +115 -0
  134. data/sig/sxn/rules/rules_engine.rbs +118 -0
  135. data/sig/sxn/rules/setup_commands_rule.rbs +60 -0
  136. data/sig/sxn/rules/template_rule.rbs +44 -0
  137. data/sig/sxn/rules.rbs +287 -0
  138. data/sig/sxn/runtime_validations.rbs +16 -0
  139. data/sig/sxn/security/secure_command_executor.rbs +63 -0
  140. data/sig/sxn/security/secure_file_copier.rbs +79 -0
  141. data/sig/sxn/security/secure_path_validator.rbs +30 -0
  142. data/sig/sxn/security.rbs +128 -0
  143. data/sig/sxn/templates/errors.rbs +43 -0
  144. data/sig/sxn/templates/template_engine.rbs +50 -0
  145. data/sig/sxn/templates/template_processor.rbs +44 -0
  146. data/sig/sxn/templates/template_security.rbs +62 -0
  147. data/sig/sxn/templates/template_variables.rbs +103 -0
  148. data/sig/sxn/templates.rbs +104 -0
  149. data/sig/sxn/ui/output.rbs +50 -0
  150. data/sig/sxn/ui/progress_bar.rbs +39 -0
  151. data/sig/sxn/ui/prompt.rbs +38 -0
  152. data/sig/sxn/ui/table.rbs +43 -0
  153. data/sig/sxn/ui.rbs +63 -0
  154. data/sig/sxn/version.rbs +5 -0
  155. data/sig/sxn.rbs +29 -0
  156. metadata +635 -0
@@ -0,0 +1,50 @@
1
+ # TypeProf 0.21.3
2
+
3
+ module Sxn
4
+ module Templates
5
+ class TemplateEngine
6
+ # Built-in template directory
7
+ TEMPLATES_DIR: String
8
+
9
+ @session: untyped
10
+ @project: untyped
11
+ @config: untyped
12
+ @processor: TemplateProcessor
13
+ @variables_collector: TemplateVariables
14
+ @security: TemplateSecurity
15
+ @template_cache: Hash[untyped, untyped]
16
+
17
+ def initialize: (?session: untyped, ?project: untyped, ?config: untyped) -> void
18
+
19
+ def process_template: (String template_name, String destination_path, ?Hash[untyped, untyped] custom_variables, ?Hash[Symbol, untyped] options) -> String
20
+
21
+ def list_templates: (?String? category) -> Array[String]
22
+
23
+ def template_categories: () -> Array[String]
24
+
25
+ def template_exists?: (String template_name, ?String? template_dir) -> bool
26
+
27
+ def template_info: (String template_name, ?String? template_dir) -> Hash[Symbol, untyped]
28
+
29
+ def validate_template_syntax: (String template_name, ?String? template_dir) -> bool
30
+
31
+ def available_variables: (?Hash[untyped, untyped] custom_variables) -> Hash[untyped, untyped]
32
+
33
+ def refresh_variables!: () -> Hash[untyped, untyped]
34
+
35
+ def clear_cache!: () -> void
36
+
37
+ def process_string: (String template_content, ?Hash[untyped, untyped] custom_variables, ?Hash[Symbol, untyped] options) -> String
38
+
39
+ def render_template: (String template_name, ?Hash[untyped, untyped] variables, ?Hash[Symbol, untyped] options) -> String
40
+
41
+ def apply_template_set: (String template_set, String destination_dir, ?Hash[untyped, untyped] custom_variables, ?Hash[Symbol, untyped] options) -> Array[String]
42
+
43
+ private
44
+
45
+ def find_template: (String template_name, ?String? custom_template_dir) -> String
46
+
47
+ def collect_variables: (?Hash[untyped, untyped] custom_variables) -> Hash[untyped, untyped]
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,44 @@
1
+ # TypeProf 0.21.3
2
+
3
+ module Sxn
4
+ module Templates
5
+ class TemplateProcessor
6
+ # Maximum template size in bytes to prevent memory exhaustion
7
+ MAX_TEMPLATE_SIZE: Integer
8
+
9
+ # Maximum rendering time in seconds to prevent infinite loops
10
+ MAX_RENDER_TIME: Integer
11
+
12
+ # Allowed Liquid filters for security
13
+ ALLOWED_FILTERS: Array[String]
14
+
15
+ def initialize: () -> void
16
+
17
+ def process: (String template_content, ?Hash[untyped, untyped] variables, ?Hash[Symbol, untyped] options) -> String
18
+
19
+ def process_file: (String | Pathname template_path, ?Hash[untyped, untyped] variables, ?Hash[Symbol, untyped] options) -> String
20
+
21
+ def validate_syntax: (String template_content) -> bool
22
+
23
+ def extract_variables: (String template_content) -> Array[String]
24
+
25
+ private
26
+
27
+ def create_secure_liquid_environment: () -> bool
28
+
29
+ def validate_template_size!: (String template_content) -> void
30
+
31
+ def parse_template: (String template_content, ?validate: bool) -> untyped
32
+
33
+ def sanitize_variables: (Hash[untyped, untyped] variables) -> Hash[String, untyped]
34
+
35
+ def sanitize_key: (untyped key) -> String
36
+
37
+ def sanitize_value: (untyped value) -> untyped
38
+
39
+ def render_with_timeout: (untyped template, Hash[String, untyped] variables, Hash[Symbol, untyped] options) -> String
40
+
41
+ alias validate_template validate_syntax
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,62 @@
1
+ # TypeProf 0.21.3
2
+
3
+ module Sxn
4
+ module Templates
5
+ class TemplateSecurity
6
+ # Maximum allowed template complexity (nested structures)
7
+ MAX_TEMPLATE_DEPTH: Integer
8
+
9
+ # Maximum number of variables allowed in a template
10
+ MAX_VARIABLE_COUNT: Integer
11
+
12
+ # Dangerous patterns that should not appear in templates
13
+ DANGEROUS_PATTERNS: Array[Regexp]
14
+
15
+ # Whitelisted variable namespaces
16
+ ALLOWED_VARIABLE_NAMESPACES: Array[String]
17
+
18
+ # Whitelisted filters (subset of Liquid's standard filters)
19
+ SAFE_FILTERS: Array[String]
20
+
21
+ @validation_cache: Hash[String, untyped]
22
+
23
+ def initialize: () -> void
24
+
25
+ def validate_template: (String template_content, ?Hash[untyped, untyped] variables) -> bool
26
+
27
+ def sanitize_variables: (Hash[untyped, untyped] variables) -> Hash[String, untyped]
28
+
29
+ def safe_filter?: (String filter_name) -> bool
30
+
31
+ def clear_cache!: () -> void
32
+
33
+ def validate_template_content: (String template_content) -> bool
34
+
35
+ def validate_template_path: (String | Pathname template_path) -> bool
36
+
37
+ private
38
+
39
+ def validate_template_variables: (Hash[untyped, untyped] variables) -> bool
40
+
41
+ def validate_template_complexity: (String template_content) -> bool
42
+
43
+ def validate_variable_key: (untyped key) -> bool
44
+
45
+ def validate_variable_value: (untyped value, ?depth: Integer) -> bool
46
+
47
+ def validate_string_value: (String str) -> bool
48
+
49
+ def sanitize_variable_key: (untyped key) -> String
50
+
51
+ def valid_variable_namespace?: (String key) -> bool
52
+
53
+ def sanitize_variable_value: (untyped value, ?depth: Integer) -> untyped
54
+
55
+ def sanitize_string_value: (String str) -> String
56
+
57
+ def count_total_variables: (Hash[untyped, untyped] variables, ?Integer count) -> Integer
58
+
59
+ def generate_cache_key: (String template_content, Hash[untyped, untyped] variables) -> String
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,103 @@
1
+ # TypeProf 0.21.3
2
+
3
+ module Sxn
4
+ module Templates
5
+ class TemplateVariables
6
+ # Git command timeout in seconds
7
+ GIT_TIMEOUT: Integer
8
+
9
+ @session: untyped
10
+ @project: untyped
11
+ @config: untyped
12
+ @cached_variables: Hash[Symbol, untyped]
13
+
14
+ def initialize: (?untyped session, ?untyped project, ?untyped config) -> void
15
+
16
+ def collect: () -> Hash[Symbol, untyped]
17
+
18
+ alias build_variables collect
19
+
20
+ def refresh!: () -> Hash[Symbol, untyped]
21
+
22
+ def get_category: (Symbol category) -> Hash[untyped, untyped]
23
+
24
+ def add_custom_variables: (Hash[untyped, untyped] custom_vars) -> void
25
+
26
+ def collect_session_variables: () -> Hash[untyped, untyped]
27
+
28
+ def collect_project_variables: () -> Hash[untyped, untyped]
29
+
30
+ def collect_git_variables: () -> Hash[untyped, untyped]
31
+
32
+ def collect_environment_variables: () -> Hash[untyped, untyped]
33
+
34
+ def collect_user_variables: () -> Hash[untyped, untyped]
35
+
36
+ def collect_timestamp_variables: () -> Hash[untyped, untyped]
37
+
38
+ def detect_ruby_version: () -> String
39
+
40
+ def detect_rails_version: () -> String?
41
+
42
+ def detect_node_version: () -> String?
43
+
44
+ private
45
+
46
+ def validate_collected_variables: (Hash[Symbol, untyped] variables) -> Hash[Symbol, untyped]
47
+
48
+ def _collect_session_variables: () -> Hash[Symbol, untyped]
49
+
50
+ def _collect_git_variables: () -> Hash[Symbol, untyped]
51
+
52
+ def _collect_project_variables: () -> Hash[Symbol, untyped]
53
+
54
+ def _collect_environment_variables: () -> Hash[Symbol, untyped]
55
+
56
+ def _collect_user_variables: () -> Hash[Symbol, untyped]
57
+
58
+ def _collect_timestamp_variables: () -> Hash[Symbol, untyped]
59
+
60
+ def format_timestamp: (untyped timestamp) -> String?
61
+
62
+ def find_git_directory: () -> untyped
63
+
64
+ def git_repository?: (untyped path) -> bool
65
+
66
+ def collect_git_branch_info: (untyped git_dir) -> Hash[Symbol, untyped]
67
+
68
+ def collect_git_author_info: (untyped git_dir) -> Hash[Symbol, untyped]
69
+
70
+ def collect_git_commit_info: (untyped git_dir) -> Hash[Symbol, untyped]
71
+
72
+ def collect_git_remote_info: (untyped git_dir) -> Hash[Symbol, untyped]
73
+
74
+ def collect_git_status_info: (untyped git_dir) -> Hash[Symbol, untyped]
75
+
76
+ def collect_git_user_config: () -> Hash[Symbol, untyped]
77
+
78
+ def execute_git_command: (untyped directory, *String args) { (String) -> void } -> String?
79
+
80
+ def detect_project_type: (untyped project_path) -> String
81
+
82
+ def collect_rails_project_info: () -> Hash[Symbol, untyped]
83
+
84
+ def collect_js_project_info: () -> Hash[Symbol, untyped]
85
+
86
+ def collect_ruby_project_info: () -> Hash[Symbol, untyped]
87
+
88
+ def detect_package_manager: () -> String
89
+
90
+ def rails_available?: () -> bool
91
+
92
+ def collect_rails_version: () -> Hash[Symbol, untyped]
93
+
94
+ def node_available?: () -> bool
95
+
96
+ def collect_node_version: () -> Hash[Symbol, untyped]
97
+
98
+ def collect_database_info: () -> Hash[Symbol, untyped]
99
+
100
+ alias collect_all_variables collect
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,104 @@
1
+ module Sxn
2
+ module Templates
3
+ # Template engine for processing Liquid templates
4
+ class TemplateEngine
5
+ @templates_dir: Pathname
6
+ @cache: Hash[String, Liquid::Template]
7
+
8
+ def initialize: (?templates_dir: String?) -> void
9
+ def render: (String template_name, ?Hash[String, untyped] variables) -> String
10
+ def template_exists?: (String template_name) -> bool
11
+ def list_templates: () -> Array[String]
12
+ def clear_cache: () -> void
13
+
14
+ private
15
+ def find_template: (String name) -> Pathname?
16
+ def load_template: (String path) -> Liquid::Template
17
+ def search_paths: (String name) -> Array[Pathname]
18
+ end
19
+
20
+ # Template processor that handles template rendering with variables
21
+ class TemplateProcessor
22
+ @engine: TemplateEngine
23
+ @security: TemplateSecurity
24
+ @variables: TemplateVariables
25
+
26
+ def initialize: (?engine: TemplateEngine?, ?security: TemplateSecurity?, ?variables: TemplateVariables?) -> void
27
+ def process: (String template_name, ?Hash[String, untyped] additional_vars) -> String
28
+ def process_directory: (String template_dir, String output_dir, ?Hash[String, untyped] variables) -> void
29
+ def available_templates: () -> Array[String]
30
+
31
+ private
32
+ def safe_variables: (Hash[String, untyped] vars) -> Hash[String, untyped]
33
+ def merge_variables: (Hash[String, untyped] base, Hash[String, untyped] additional) -> Hash[String, untyped]
34
+ end
35
+
36
+ # Template security for validating template operations
37
+ class TemplateSecurity
38
+ MAX_TEMPLATE_SIZE: Integer
39
+ MAX_RENDER_TIME: Integer
40
+ SAFE_LIQUID_TAGS: Array[String]
41
+
42
+ def validate_template: (String content) -> void
43
+ def validate_path: (String path) -> void
44
+ def validate_variables: (Hash[String, untyped] variables) -> void
45
+ def sanitize_output: (String output) -> String
46
+
47
+ private
48
+ def check_template_size: (String content) -> void
49
+ def check_dangerous_tags: (String content) -> void
50
+ def check_path_traversal: (String path) -> void
51
+ end
52
+
53
+ # Template variables collector
54
+ class TemplateVariables
55
+ @session: untyped
56
+ @project: untyped
57
+ @config: untyped
58
+ @cached_variables: Hash[String, untyped]
59
+
60
+ def initialize: (?untyped session, ?untyped project, ?untyped config) -> void
61
+ def collect: () -> Hash[String, untyped]
62
+ def clear_cache: () -> void
63
+
64
+ private
65
+ def collect_session_variables: () -> Hash[String, untyped]
66
+ def _collect_session_variables: () -> Hash[String, untyped]
67
+ def collect_git_variables: () -> Hash[String, untyped]
68
+ def _collect_git_variables: () -> Hash[String, untyped]
69
+ def find_git_directory: () -> Pathname?
70
+ def git_repository?: (untyped path) -> bool
71
+ def collect_git_branch_info: (Pathname git_dir) -> Hash[String, untyped]
72
+ def collect_git_commit_info: (Pathname git_dir) -> Hash[String, untyped]
73
+ def collect_git_author_info: (Pathname git_dir) -> Hash[String, untyped]
74
+ def execute_git_command: (Pathname? directory, *String args) ?{ (String) -> void } -> String?
75
+ def collect_project_variables: () -> Hash[String, untyped]
76
+ def _collect_project_variables: () -> Hash[String, untyped]
77
+ def collect_environment_variables: () -> Hash[String, untyped]
78
+ def _collect_environment_variables: () -> Hash[String, untyped]
79
+ def collect_ruby_version: () -> Hash[String, untyped]
80
+ def collect_rails_version: () -> Hash[String, untyped]
81
+ def node_available?: () -> bool
82
+ def collect_node_version: () -> Hash[String, untyped]
83
+ def collect_user_variables: () -> Hash[String, untyped]
84
+ def _collect_user_variables: () -> Hash[String, untyped]
85
+ def get_git_config: (String key) -> String?
86
+ end
87
+
88
+ # Module errors
89
+ class Error < ::StandardError
90
+ end
91
+
92
+ class TemplateNotFoundError < Error
93
+ end
94
+
95
+ class TemplateRenderError < Error
96
+ end
97
+
98
+ class TemplateSecurityError < Error
99
+ end
100
+
101
+ class TemplateVariableError < Error
102
+ end
103
+ end
104
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sxn
4
+ module UI
5
+ # Formatted output with colors and status indicators
6
+ class Output
7
+ @pastel: untyped
8
+
9
+ def initialize: () -> void
10
+
11
+ def success: (String message) -> void
12
+
13
+ def error: (String message) -> void
14
+
15
+ def warning: (String message) -> void
16
+
17
+ def info: (String message) -> void
18
+
19
+ def debug: (String message) -> void
20
+
21
+ def status: (String | Symbol label, String message, ?Symbol color) -> void
22
+
23
+ def section: (String title) -> void
24
+
25
+ def subsection: (String | Symbol title) -> void
26
+
27
+ def list_item: (String item, ?String? description) -> void
28
+
29
+ def empty_state: (String message) -> void
30
+
31
+ def key_value: (String key, String value, ?indent: Integer) -> void
32
+
33
+ def progress_start: (String message) -> void
34
+
35
+ def progress_done: () -> void
36
+
37
+ def progress_failed: () -> void
38
+
39
+ def newline: () -> void
40
+
41
+ def recovery_suggestion: (String message) -> void
42
+
43
+ def command_example: (String command, ?String? description) -> void
44
+
45
+ private
46
+
47
+ def debug_mode?: () -> bool
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sxn
4
+ module UI
5
+ # Progress bars for long-running operations
6
+ class ProgressBar
7
+ @bar: untyped
8
+
9
+ def initialize: (String title, ?total: Integer, ?format: Symbol) -> void
10
+
11
+ def advance: (?Integer step) -> void
12
+
13
+ def finish: () -> void
14
+
15
+ def current: () -> Integer
16
+
17
+ def total: () -> Integer
18
+
19
+ def percent: () -> Integer
20
+
21
+ def log: (String message) -> void
22
+
23
+ def self.with_progress: [T] (String title, Array[T] items, ?format: Symbol) { (T item, ProgressBar progress) -> untyped } -> Array[untyped]
24
+
25
+ def self.for_operation: [T] (String title, ?total_steps: Integer) { (Stepper stepper) -> T } -> T
26
+
27
+ # Helper class for step-by-step operations
28
+ class Stepper
29
+ @progress: ProgressBar
30
+
31
+ def initialize: (ProgressBar progress_bar) -> void
32
+
33
+ def step: (?String? message) -> void
34
+
35
+ def log: (String message) -> void
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sxn
4
+ module UI
5
+ # Interactive prompts with validation
6
+ class Prompt
7
+ @prompt: untyped
8
+
9
+ def initialize: () -> void
10
+
11
+ def ask: [T] (String message, ?Hash[Symbol, untyped] options) ?{ (untyped) -> void } -> T
12
+
13
+ def ask_yes_no: (String message, ?default: bool) -> bool
14
+
15
+ def select: [T] (String message, Array[T] | Hash[String, T] choices, ?Hash[Symbol, untyped] options) -> T
16
+
17
+ def multi_select: [T] (String message, Array[T] | Hash[String, T] choices, ?Hash[Symbol, untyped] options) -> Array[T]
18
+
19
+ def folder_name: (?String message, ?default: String?) -> String
20
+
21
+ def session_name: (?String message, ?existing_sessions: Array[String]) -> String
22
+
23
+ def project_name: (?String message) -> String
24
+
25
+ def project_path: (?String message) -> String
26
+
27
+ def branch_name: (?String message, ?default: String?) -> String
28
+
29
+ def confirm_deletion: (String item_name, ?String item_type) -> bool
30
+
31
+ def rule_type: () -> String
32
+
33
+ def sessions_folder_setup: () -> String
34
+
35
+ def project_detection_confirm: (Array[Hash[Symbol, String]] detected_projects) -> bool
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sxn
4
+ module UI
5
+ # Table formatting for lists and data display
6
+ class Table
7
+ @pastel: untyped
8
+
9
+ def initialize: () -> void
10
+
11
+ def sessions: (Array[Hash[Symbol, untyped]] sessions) -> void
12
+
13
+ def projects: (Array[Hash[Symbol, untyped]] projects) -> void
14
+
15
+ def worktrees: (Array[Hash[Symbol, untyped]] worktrees) -> void
16
+
17
+ def rules: (Array[Hash[Symbol, untyped]] rules, ?String? project_filter) -> void
18
+
19
+ def config_summary: (Hash[Symbol, untyped] config) -> void
20
+
21
+ # Add a header to the table output
22
+ def header: (String title) -> void
23
+
24
+ private
25
+
26
+ def render_table: (Array[String] headers, Array[Array[String]] rows) -> void
27
+
28
+ def empty_table: (String message) -> void
29
+
30
+ def status_indicator: (String status) -> String
31
+
32
+ def worktree_status: (Hash[Symbol, untyped] worktree) -> String
33
+
34
+ def git_clean?: (String path) -> bool
35
+
36
+ def format_date: (String? date_string) -> String
37
+
38
+ def truncate_path: (String? path, ?max_length: Integer) -> String
39
+
40
+ def truncate_config: (untyped config, ?max_length: Integer) -> String
41
+ end
42
+ end
43
+ end
data/sig/sxn/ui.rbs ADDED
@@ -0,0 +1,63 @@
1
+ module Sxn
2
+ module UI
3
+ class Output
4
+ @pastel: untyped # Pastel instance
5
+ @quiet: bool
6
+ @verbose: bool
7
+
8
+ def initialize: (?quiet: bool, ?verbose: bool) -> void
9
+ def say: (String message, ?color: Symbol?) -> void
10
+ def success: (String message) -> void
11
+ def error: (String message) -> void
12
+ def warning: (String message) -> void
13
+ def info: (String message) -> void
14
+ def debug: (String message) -> void
15
+ def newline: () -> void
16
+ def print: (String message) -> void
17
+ def puts: (String message) -> void
18
+
19
+ private
20
+ def format_message: (String message, ?Symbol? color) -> String
21
+ def should_output?: (?Symbol? level) -> bool
22
+ end
23
+
24
+ class Prompt
25
+ @prompt: untyped # TTY::Prompt instance
26
+
27
+ def initialize: () -> void
28
+ def ask: (String question, ?Hash[Symbol, untyped] options) -> String
29
+ def yes?: (String question) -> bool
30
+ def no?: (String question) -> bool
31
+ def select: (String question, Array[untyped] choices, ?Hash[Symbol, untyped] options) -> untyped
32
+ def multi_select: (String question, Array[untyped] choices, ?Hash[Symbol, untyped] options) -> Array[untyped]
33
+ def mask: (String question) -> String
34
+ def keypress: (String message, ?Hash[Symbol, untyped] options) -> String
35
+ end
36
+
37
+ class Table
38
+ @table: untyped # TTY::Table instance
39
+
40
+ def initialize: (Array[Array[untyped]] data, ?Array[String]? headers) -> void
41
+ def render: (?Hash[Symbol, untyped] options) -> String
42
+ def add_row: (Array[untyped] row) -> void
43
+ def clear: () -> void
44
+
45
+ private
46
+ def format_table: () -> untyped
47
+ end
48
+
49
+ class ProgressBar
50
+ @bar: untyped # TTY::ProgressBar instance
51
+
52
+ def initialize: (String format, ?Hash[Symbol, untyped] options) -> void
53
+ def advance: (?Integer step) -> void
54
+ def update: (Hash[Symbol, untyped] tokens) -> void
55
+ def finish: () -> void
56
+ def reset: () -> void
57
+ def complete?: () -> bool
58
+ def current: () -> Integer
59
+ def total: () -> Integer
60
+ def total=: (Integer value) -> void
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sxn
4
+ VERSION: String
5
+ end
data/sig/sxn.rbs ADDED
@@ -0,0 +1,29 @@
1
+ # Main Sxn module providing session management for multi-repository development
2
+ module Sxn
3
+ # VERSION is defined in sig/sxn/version.rbs
4
+
5
+ # Type aliases for common patterns
6
+ type config_hash = Hash[String, untyped]
7
+ type logger_level = :debug | :info | :warn | :error | Symbol
8
+
9
+ # Module singleton methods
10
+ def self.logger: () -> ::Logger?
11
+ def self.logger=: (::Logger new_logger) -> ::Logger
12
+
13
+ def self.config: () -> config_hash?
14
+ def self.config=: (config_hash new_config) -> config_hash
15
+
16
+ def self.root: () -> String
17
+ def self.lib_root: () -> String
18
+ def self.version: () -> String
19
+
20
+ def self.load_config: () -> config_hash?
21
+ def self.setup_logger: (?level: logger_level) -> ::Logger
22
+
23
+ # Module instance variables
24
+ @logger: ::Logger?
25
+ @config: config_hash?
26
+ end
27
+
28
+ # Global variable declarations
29
+ $CHILD_STATUS: Process::Status