factorix 0.5.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 (202) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +20 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +105 -0
  5. data/completion/_factorix.bash +202 -0
  6. data/completion/_factorix.fish +197 -0
  7. data/completion/_factorix.zsh +376 -0
  8. data/doc/factorix.1 +377 -0
  9. data/exe/factorix +20 -0
  10. data/lib/factorix/api/category.rb +69 -0
  11. data/lib/factorix/api/image.rb +35 -0
  12. data/lib/factorix/api/license.rb +71 -0
  13. data/lib/factorix/api/mod_download_api.rb +66 -0
  14. data/lib/factorix/api/mod_info.rb +166 -0
  15. data/lib/factorix/api/mod_management_api.rb +237 -0
  16. data/lib/factorix/api/mod_portal_api.rb +204 -0
  17. data/lib/factorix/api/release.rb +49 -0
  18. data/lib/factorix/api/tag.rb +95 -0
  19. data/lib/factorix/api.rb +7 -0
  20. data/lib/factorix/api_credential.rb +54 -0
  21. data/lib/factorix/application.rb +218 -0
  22. data/lib/factorix/cache/file_system.rb +307 -0
  23. data/lib/factorix/cli/commands/backup_support.rb +46 -0
  24. data/lib/factorix/cli/commands/base.rb +90 -0
  25. data/lib/factorix/cli/commands/cache/evict.rb +180 -0
  26. data/lib/factorix/cli/commands/cache/stat.rb +201 -0
  27. data/lib/factorix/cli/commands/command_wrapper.rb +71 -0
  28. data/lib/factorix/cli/commands/completion.rb +83 -0
  29. data/lib/factorix/cli/commands/confirmable.rb +53 -0
  30. data/lib/factorix/cli/commands/download_support.rb +123 -0
  31. data/lib/factorix/cli/commands/launch.rb +79 -0
  32. data/lib/factorix/cli/commands/man.rb +29 -0
  33. data/lib/factorix/cli/commands/mod/check.rb +99 -0
  34. data/lib/factorix/cli/commands/mod/disable.rb +188 -0
  35. data/lib/factorix/cli/commands/mod/download.rb +291 -0
  36. data/lib/factorix/cli/commands/mod/edit.rb +114 -0
  37. data/lib/factorix/cli/commands/mod/enable.rb +216 -0
  38. data/lib/factorix/cli/commands/mod/image/add.rb +47 -0
  39. data/lib/factorix/cli/commands/mod/image/edit.rb +41 -0
  40. data/lib/factorix/cli/commands/mod/image/list.rb +74 -0
  41. data/lib/factorix/cli/commands/mod/install.rb +443 -0
  42. data/lib/factorix/cli/commands/mod/list.rb +372 -0
  43. data/lib/factorix/cli/commands/mod/search.rb +134 -0
  44. data/lib/factorix/cli/commands/mod/settings/dump.rb +88 -0
  45. data/lib/factorix/cli/commands/mod/settings/restore.rb +101 -0
  46. data/lib/factorix/cli/commands/mod/show.rb +202 -0
  47. data/lib/factorix/cli/commands/mod/sync.rb +299 -0
  48. data/lib/factorix/cli/commands/mod/uninstall.rb +325 -0
  49. data/lib/factorix/cli/commands/mod/update.rb +222 -0
  50. data/lib/factorix/cli/commands/mod/upload.rb +90 -0
  51. data/lib/factorix/cli/commands/path.rb +79 -0
  52. data/lib/factorix/cli/commands/requires_game_stopped.rb +32 -0
  53. data/lib/factorix/cli/commands/version.rb +25 -0
  54. data/lib/factorix/cli.rb +42 -0
  55. data/lib/factorix/dependency/edge.rb +89 -0
  56. data/lib/factorix/dependency/entry.rb +124 -0
  57. data/lib/factorix/dependency/graph/builder.rb +108 -0
  58. data/lib/factorix/dependency/graph.rb +210 -0
  59. data/lib/factorix/dependency/list.rb +244 -0
  60. data/lib/factorix/dependency/mod_version_requirement.rb +73 -0
  61. data/lib/factorix/dependency/node.rb +60 -0
  62. data/lib/factorix/dependency/parser.rb +148 -0
  63. data/lib/factorix/dependency/validation_result.rb +138 -0
  64. data/lib/factorix/dependency/validator.rb +190 -0
  65. data/lib/factorix/errors.rb +112 -0
  66. data/lib/factorix/formatting.rb +56 -0
  67. data/lib/factorix/game_version.rb +98 -0
  68. data/lib/factorix/http/cache_decorator.rb +106 -0
  69. data/lib/factorix/http/cached_response.rb +37 -0
  70. data/lib/factorix/http/client.rb +187 -0
  71. data/lib/factorix/http/response.rb +31 -0
  72. data/lib/factorix/http/retry_decorator.rb +59 -0
  73. data/lib/factorix/http/retry_strategy.rb +80 -0
  74. data/lib/factorix/info_json.rb +90 -0
  75. data/lib/factorix/installed_mod.rb +239 -0
  76. data/lib/factorix/mod.rb +55 -0
  77. data/lib/factorix/mod_list.rb +174 -0
  78. data/lib/factorix/mod_settings.rb +278 -0
  79. data/lib/factorix/mod_state.rb +34 -0
  80. data/lib/factorix/mod_version.rb +99 -0
  81. data/lib/factorix/portal.rb +185 -0
  82. data/lib/factorix/progress/download_handler.rb +46 -0
  83. data/lib/factorix/progress/multi_presenter.rb +45 -0
  84. data/lib/factorix/progress/presenter.rb +67 -0
  85. data/lib/factorix/progress/presenter_adapter.rb +46 -0
  86. data/lib/factorix/progress/scan_handler.rb +33 -0
  87. data/lib/factorix/progress/upload_handler.rb +33 -0
  88. data/lib/factorix/runtime/base.rb +233 -0
  89. data/lib/factorix/runtime/linux.rb +32 -0
  90. data/lib/factorix/runtime/mac_os.rb +53 -0
  91. data/lib/factorix/runtime/user_configurable.rb +69 -0
  92. data/lib/factorix/runtime/windows.rb +85 -0
  93. data/lib/factorix/runtime/wsl.rb +118 -0
  94. data/lib/factorix/runtime.rb +32 -0
  95. data/lib/factorix/save_file.rb +178 -0
  96. data/lib/factorix/ser_des/deserializer.rb +198 -0
  97. data/lib/factorix/ser_des/serializer.rb +231 -0
  98. data/lib/factorix/ser_des/signed_integer.rb +63 -0
  99. data/lib/factorix/ser_des/unsigned_integer.rb +65 -0
  100. data/lib/factorix/service_credential.rb +127 -0
  101. data/lib/factorix/transfer/downloader.rb +162 -0
  102. data/lib/factorix/transfer/uploader.rb +232 -0
  103. data/lib/factorix/version.rb +6 -0
  104. data/lib/factorix.rb +38 -0
  105. data/sig/dry/auto_inject.rbs +15 -0
  106. data/sig/dry/cli.rbs +19 -0
  107. data/sig/dry/configurable.rbs +13 -0
  108. data/sig/dry/core/container.rbs +17 -0
  109. data/sig/dry/events/publisher.rbs +22 -0
  110. data/sig/dry/logger.rbs +16 -0
  111. data/sig/factorix/api/category.rbs +15 -0
  112. data/sig/factorix/api/image.rbs +15 -0
  113. data/sig/factorix/api/license.rbs +20 -0
  114. data/sig/factorix/api/mod_download_api.rbs +18 -0
  115. data/sig/factorix/api/mod_info.rbs +67 -0
  116. data/sig/factorix/api/mod_management_api.rbs +25 -0
  117. data/sig/factorix/api/mod_portal_api.rbs +31 -0
  118. data/sig/factorix/api/release.rbs +27 -0
  119. data/sig/factorix/api/tag.rbs +15 -0
  120. data/sig/factorix/api.rbs +8 -0
  121. data/sig/factorix/api_credential.rbs +17 -0
  122. data/sig/factorix/application.rbs +86 -0
  123. data/sig/factorix/cache/file_system.rbs +35 -0
  124. data/sig/factorix/cli/commands/base.rbs +13 -0
  125. data/sig/factorix/cli/commands/cache/evict.rbs +17 -0
  126. data/sig/factorix/cli/commands/cache/stat.rbs +17 -0
  127. data/sig/factorix/cli/commands/command_wrapper.rbs +13 -0
  128. data/sig/factorix/cli/commands/completion/zsh.rbs +15 -0
  129. data/sig/factorix/cli/commands/confirmable.rbs +12 -0
  130. data/sig/factorix/cli/commands/download_support.rbs +12 -0
  131. data/sig/factorix/cli/commands/launch.rbs +15 -0
  132. data/sig/factorix/cli/commands/mod/check.rbs +18 -0
  133. data/sig/factorix/cli/commands/mod/disable.rbs +20 -0
  134. data/sig/factorix/cli/commands/mod/download.rbs +18 -0
  135. data/sig/factorix/cli/commands/mod/edit.rbs +30 -0
  136. data/sig/factorix/cli/commands/mod/enable.rbs +20 -0
  137. data/sig/factorix/cli/commands/mod/image/add.rbs +19 -0
  138. data/sig/factorix/cli/commands/mod/image/edit.rbs +19 -0
  139. data/sig/factorix/cli/commands/mod/image/list.rbs +19 -0
  140. data/sig/factorix/cli/commands/mod/install.rbs +19 -0
  141. data/sig/factorix/cli/commands/mod/list.rbs +30 -0
  142. data/sig/factorix/cli/commands/mod/search.rbs +18 -0
  143. data/sig/factorix/cli/commands/mod/settings/dump.rbs +17 -0
  144. data/sig/factorix/cli/commands/mod/settings/restore.rbs +17 -0
  145. data/sig/factorix/cli/commands/mod/sync.rbs +19 -0
  146. data/sig/factorix/cli/commands/mod/uninstall.rbs +20 -0
  147. data/sig/factorix/cli/commands/mod/update.rbs +19 -0
  148. data/sig/factorix/cli/commands/mod/upload.rbs +24 -0
  149. data/sig/factorix/cli/commands/path.rbs +18 -0
  150. data/sig/factorix/cli/commands/requires_game_stopped.rbs +13 -0
  151. data/sig/factorix/cli/commands/version.rbs +13 -0
  152. data/sig/factorix/cli.rbs +11 -0
  153. data/sig/factorix/dependency/edge.rbs +32 -0
  154. data/sig/factorix/dependency/entry.rbs +30 -0
  155. data/sig/factorix/dependency/graph/builder.rbs +17 -0
  156. data/sig/factorix/dependency/graph.rbs +39 -0
  157. data/sig/factorix/dependency/list.rbs +69 -0
  158. data/sig/factorix/dependency/mod_version_requirement.rbs +18 -0
  159. data/sig/factorix/dependency/node.rbs +24 -0
  160. data/sig/factorix/dependency/parser.rbs +11 -0
  161. data/sig/factorix/dependency/validation_result.rbs +56 -0
  162. data/sig/factorix/dependency/validator.rbs +13 -0
  163. data/sig/factorix/errors.rbs +132 -0
  164. data/sig/factorix/formatting.rbs +8 -0
  165. data/sig/factorix/game_version.rbs +24 -0
  166. data/sig/factorix/http/cache_decorator.rbs +64 -0
  167. data/sig/factorix/http/client.rbs +55 -0
  168. data/sig/factorix/http/response.rbs +28 -0
  169. data/sig/factorix/http/retry_decorator.rbs +44 -0
  170. data/sig/factorix/http/retry_strategy.rbs +42 -0
  171. data/sig/factorix/info_json.rbs +19 -0
  172. data/sig/factorix/installed_mod.rbs +34 -0
  173. data/sig/factorix/mod.rbs +20 -0
  174. data/sig/factorix/mod_list.rbs +44 -0
  175. data/sig/factorix/mod_settings.rbs +47 -0
  176. data/sig/factorix/mod_state.rbs +18 -0
  177. data/sig/factorix/mod_version.rbs +23 -0
  178. data/sig/factorix/portal.rbs +37 -0
  179. data/sig/factorix/progress/download_handler.rbs +19 -0
  180. data/sig/factorix/progress/multi_presenter.rbs +15 -0
  181. data/sig/factorix/progress/presenter.rbs +17 -0
  182. data/sig/factorix/progress/presenter_adapter.rbs +17 -0
  183. data/sig/factorix/progress/scan_handler.rbs +16 -0
  184. data/sig/factorix/progress/upload_handler.rbs +17 -0
  185. data/sig/factorix/runtime/base.rbs +45 -0
  186. data/sig/factorix/runtime/linux.rbs +15 -0
  187. data/sig/factorix/runtime/mac_os.rbs +15 -0
  188. data/sig/factorix/runtime/user_configurable.rbs +13 -0
  189. data/sig/factorix/runtime/windows.rbs +23 -0
  190. data/sig/factorix/runtime/wsl.rbs +19 -0
  191. data/sig/factorix/runtime.rbs +9 -0
  192. data/sig/factorix/save_file.rbs +40 -0
  193. data/sig/factorix/ser_des/deserializer.rbs +49 -0
  194. data/sig/factorix/ser_des/serializer.rbs +45 -0
  195. data/sig/factorix/ser_des/signed_integer.rbs +37 -0
  196. data/sig/factorix/ser_des/unsigned_integer.rbs +37 -0
  197. data/sig/factorix/service_credential.rbs +19 -0
  198. data/sig/factorix/transfer/downloader.rbs +15 -0
  199. data/sig/factorix/transfer/uploader.rbs +21 -0
  200. data/sig/factorix.rbs +9 -0
  201. data/sig/tty/progressbar.rbs +18 -0
  202. metadata +431 -0
@@ -0,0 +1,32 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module Dependency
7
+ class Edge
8
+ REQUIRED: Symbol
9
+ OPTIONAL: Symbol
10
+ HIDDEN_OPTIONAL: Symbol
11
+ INCOMPATIBLE: Symbol
12
+ LOAD_NEUTRAL: Symbol
13
+
14
+ attr_reader from_mod: MOD
15
+ attr_reader to_mod: MOD
16
+ attr_reader type: Symbol
17
+ attr_reader version_requirement: MODVersionRequirement?
18
+
19
+ def initialize: (from_mod: MOD, to_mod: MOD, type: Symbol, ?version_requirement: MODVersionRequirement?) -> void
20
+
21
+ def required?: () -> bool
22
+ def optional?: () -> bool
23
+ def incompatible?: () -> bool
24
+ def load_neutral?: () -> bool
25
+
26
+ def satisfied_by?: (MODVersion version) -> bool
27
+
28
+ def to_s: () -> String
29
+ def inspect: () -> String
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,30 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module Dependency
7
+ class Entry
8
+ REQUIRED: Symbol
9
+ OPTIONAL: Symbol
10
+ HIDDEN_OPTIONAL: Symbol
11
+ INCOMPATIBLE: Symbol
12
+ LOAD_NEUTRAL: Symbol
13
+
14
+ attr_reader mod: MOD
15
+ attr_reader type: Symbol
16
+ attr_reader version_requirement: MODVersionRequirement?
17
+
18
+ def initialize: (mod: MOD, type: Symbol, ?version_requirement: MODVersionRequirement?) -> void
19
+
20
+ def required?: () -> bool
21
+ def optional?: () -> bool
22
+ def incompatible?: () -> bool
23
+ def load_neutral?: () -> bool
24
+
25
+ def satisfied_by?: (MODVersion version) -> bool
26
+
27
+ def to_s: () -> String
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,17 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module Dependency
7
+ class Graph
8
+ class Builder
9
+ def self.build: (installed_mods: Array[InstalledMOD], mod_list: MODList) -> Graph
10
+
11
+ def initialize: (installed_mods: Array[InstalledMOD], mod_list: MODList) -> void
12
+
13
+ def build: () -> Graph
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,39 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module Dependency
7
+ class Graph
8
+ def initialize: () -> void
9
+
10
+ def add_node: (Node node) -> void
11
+ def set_node_operation: (MOD mod, Symbol? operation) -> Node?
12
+ def add_edge: (Edge edge) -> void
13
+ def add_uninstalled_mod: (API::MODInfo mod_info, API::Release release, ?operation: Symbol) -> void
14
+
15
+ def node: (MOD mod) -> Node?
16
+ def nodes: () -> Array[Node]
17
+
18
+ def edges_from: (MOD mod) -> Array[Edge]
19
+ def edges_to: (MOD mod) -> Array[Edge]
20
+ def find_enabled_dependents: (MOD mod) -> Array[MOD]
21
+ def edges: () -> Array[Edge]
22
+
23
+ def node?: (MOD mod) -> bool
24
+
25
+ def size: () -> Integer
26
+ def empty?: () -> bool
27
+
28
+ def topological_order: () -> Array[MOD]
29
+ def cyclic?: () -> bool
30
+ def strongly_connected_components: () -> Array[Array[MOD]]
31
+
32
+ def tsort_each_node: () { (MOD) -> void } -> void
33
+ def tsort_each_child: (MOD mod) { (MOD) -> void } -> void
34
+
35
+ def to_s: () -> String
36
+ def inspect: () -> String
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,69 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module Dependency
7
+ # Represents a collection of MOD dependencies
8
+ class List
9
+ include Enumerable[Entry]
10
+
11
+ @dependencies: Array[Entry]
12
+
13
+ # Create List from an array of dependency strings
14
+ def self.from_strings: (Array[String] dependency_strings) -> List
15
+
16
+ # Initialize a List collection
17
+ def initialize: (?Array[Entry] dependencies) -> void
18
+
19
+ # Iterate through all dependencies
20
+ def each: () { (Entry) -> void } -> List
21
+ | () -> Enumerator[Entry, void]
22
+
23
+ # Get all required dependencies
24
+ def required: () -> Array[Entry]
25
+
26
+ # Get all optional dependencies (including hidden optional)
27
+ def optional: () -> Array[Entry]
28
+
29
+ # Get all incompatible dependencies
30
+ def incompatible: () -> Array[Entry]
31
+
32
+ # Get all load-neutral dependencies
33
+ def load_neutral: () -> Array[Entry]
34
+
35
+ # Check if this collection depends on a specific MOD
36
+ def depends_on?: (String | MOD mod_name_or_mod) -> bool
37
+
38
+ # Check if this collection marks a MOD as incompatible
39
+ def incompatible_with?: (String | MOD mod_name_or_mod) -> bool
40
+
41
+ # Check if the collection is empty
42
+ def empty?: () -> bool
43
+
44
+ # Get the total number of dependencies
45
+ def size: () -> Integer
46
+
47
+ # Check if all required dependencies are satisfied
48
+ def satisfied_by?: (Hash[String, MODVersion] available_mods) -> bool
49
+
50
+ # Get list of incompatible MODs that are present
51
+ def conflicts_with?: (Hash[String, MODVersion] available_mods) -> Array[String]
52
+
53
+ # Get list of missing required dependencies
54
+ def missing_required: (Hash[String, MODVersion] available_mods) -> Array[String]
55
+
56
+ # Get list of dependencies with unsatisfied version requirements
57
+ def unsatisfied_versions: (Hash[String, MODVersion] available_mods) -> Hash[String, Hash[Symbol, String]]
58
+
59
+ # Detect circular dependencies in a collection of MOD dependencies
60
+ def self.detect_circular: (Hash[String, List] mod_dependencies_map) -> Array[Array[String]]
61
+
62
+ # Convert to array of dependency strings
63
+ def to_a: () -> Array[String]
64
+
65
+ # Convert to hash keyed by MOD name
66
+ def to_h: () -> Hash[String, Entry]
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,18 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module Dependency
7
+ class MODVersionRequirement
8
+ attr_reader operator: String
9
+ attr_reader version: MODVersion
10
+
11
+ def initialize: (operator: String, version: MODVersion) -> void
12
+
13
+ def satisfied_by?: (MODVersion mod_version) -> bool
14
+
15
+ def to_s: () -> String
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,24 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module Dependency
7
+ class Node
8
+ attr_reader mod: MOD
9
+ attr_reader version: MODVersion
10
+ attr_accessor enabled: bool
11
+ attr_accessor installed: bool
12
+ attr_accessor operation: Symbol?
13
+
14
+ def initialize: (mod: MOD, version: MODVersion, ?enabled: bool, ?installed: bool, ?operation: Symbol?) -> void
15
+
16
+ def enabled?: () -> bool
17
+ def installed?: () -> bool
18
+ def operation?: () -> bool
19
+
20
+ def to_s: () -> String
21
+ def inspect: () -> String
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,11 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module Dependency
7
+ class Parser
8
+ def parse: (String dependency_string) -> Entry
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,56 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module Dependency
7
+ class ValidationResult
8
+ class Error
9
+ attr_reader type: Symbol
10
+ attr_reader message: String
11
+ attr_reader mod: MOD?
12
+ attr_reader dependency: MOD?
13
+
14
+ def initialize: (type: Symbol, message: String, ?mod: MOD?, ?dependency: MOD?) -> void
15
+ end
16
+
17
+ class Warning
18
+ attr_reader type: Symbol
19
+ attr_reader message: String
20
+ attr_reader mod: MOD?
21
+
22
+ def initialize: (type: Symbol, message: String, ?mod: MOD?) -> void
23
+ end
24
+
25
+ class Suggestion
26
+ attr_reader message: String
27
+ attr_reader mod: MOD
28
+ attr_reader version: MODVersion
29
+
30
+ def initialize: (message: String, mod: MOD, version: MODVersion) -> void
31
+ end
32
+
33
+ MISSING_DEPENDENCY: Symbol
34
+ DISABLED_DEPENDENCY: Symbol
35
+ VERSION_MISMATCH: Symbol
36
+ CONFLICT: Symbol
37
+ CIRCULAR_DEPENDENCY: Symbol
38
+
39
+ MOD_IN_LIST_NOT_INSTALLED: Symbol
40
+ MOD_INSTALLED_NOT_IN_LIST: Symbol
41
+
42
+ attr_reader errors: Array[Error]
43
+ attr_reader warnings: Array[Warning]
44
+ attr_reader suggestions: Array[Suggestion]
45
+
46
+ def initialize: () -> void
47
+ def add_error: (type: Symbol, message: String, ?mod: MOD?, ?dependency: MOD?) -> void
48
+ def add_warning: (type: Symbol, message: String, ?mod: MOD?) -> void
49
+ def add_suggestion: (message: String, mod: MOD, version: MODVersion) -> void
50
+ def errors?: () -> bool
51
+ def warnings?: () -> bool
52
+ def suggestions?: () -> bool
53
+ def valid?: () -> bool
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,13 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module Dependency
7
+ class Validator
8
+ def initialize: (graph: Graph, mod_list: MODList, installed_mods: Array[InstalledMOD]) -> void
9
+
10
+ def validate: () -> ValidationResult
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,132 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ class Error < StandardError
7
+ end
8
+
9
+ # =====================================
10
+ # Infrastructure layer errors
11
+ # =====================================
12
+ class InfrastructureError < Error
13
+ end
14
+
15
+ class ConfigurationError < InfrastructureError
16
+ end
17
+
18
+ class CredentialError < ConfigurationError
19
+ end
20
+
21
+ class ShellError < ConfigurationError
22
+ end
23
+
24
+ class DirectoryNotFoundError < ConfigurationError
25
+ end
26
+
27
+ class URLError < InfrastructureError
28
+ end
29
+
30
+ class PlatformError < InfrastructureError
31
+ end
32
+
33
+ class UnsupportedPlatformError < PlatformError
34
+ end
35
+
36
+ class HTTPError < InfrastructureError
37
+ end
38
+
39
+ class HTTPClientError < HTTPError
40
+ attr_reader api_error: String?
41
+ attr_reader api_message: String?
42
+
43
+ def initialize: (?String? message, ?api_error: String?, ?api_message: String?) -> void
44
+ end
45
+
46
+ class HTTPNotFoundError < HTTPClientError
47
+ end
48
+
49
+ class HTTPServerError < HTTPError
50
+ end
51
+
52
+ class DigestMismatchError < InfrastructureError
53
+ end
54
+
55
+ class CommandNotFoundError < InfrastructureError
56
+ end
57
+
58
+ class FileFormatError < InfrastructureError
59
+ end
60
+
61
+ class BinaryFormatError < FileFormatError
62
+ end
63
+
64
+ class InvalidLengthError < BinaryFormatError
65
+ end
66
+
67
+ class UnknownPropertyType < BinaryFormatError
68
+ end
69
+
70
+ class ExtraDataError < BinaryFormatError
71
+ end
72
+
73
+ class MODSectionNotFoundError < FileFormatError
74
+ end
75
+
76
+ # =====================================
77
+ # Domain layer errors
78
+ # =====================================
79
+ class DomainError < Error
80
+ end
81
+
82
+ class MODNotFoundError < DomainError
83
+ end
84
+
85
+ class MODNotOnPortalError < MODNotFoundError
86
+ end
87
+
88
+ class BundledMODError < DomainError
89
+ end
90
+
91
+ class MODConflictError < DomainError
92
+ end
93
+
94
+ class MODSettingsError < DomainError
95
+ end
96
+
97
+ class InvalidOperationError < DomainError
98
+ end
99
+
100
+ class InvalidArgumentError < DomainError
101
+ end
102
+
103
+ class VersionParseError < DomainError
104
+ end
105
+
106
+ class DependencyParseError < DomainError
107
+ end
108
+
109
+ class DependencyGraphError < DomainError
110
+ end
111
+
112
+ class DependencyError < DomainError
113
+ end
114
+
115
+ class CircularDependencyError < DependencyError
116
+ end
117
+
118
+ class DependencyMissingError < DependencyError
119
+ end
120
+
121
+ class DependencyVersionError < DependencyError
122
+ end
123
+
124
+ class DependencyViolationError < DependencyError
125
+ end
126
+
127
+ class ValidationError < DomainError
128
+ end
129
+
130
+ class GameRunningError < DomainError
131
+ end
132
+ end
@@ -0,0 +1,8 @@
1
+ # RBS type signature file
2
+
3
+ module Factorix
4
+ module Formatting
5
+ def format_size: (Integer? size) -> String
6
+ def format_duration: (Integer | Float | nil seconds) -> String
7
+ end
8
+ end
@@ -0,0 +1,24 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ class GameVersion
7
+ include Comparable
8
+
9
+ attr_reader major: Integer
10
+ attr_reader minor: Integer
11
+ attr_reader patch: Integer
12
+ attr_reader build: Integer
13
+
14
+ def self.from_string: (String str) -> GameVersion
15
+
16
+ def self.from_numbers: (Integer major, Integer minor, Integer patch, ?Integer build) -> GameVersion
17
+
18
+ def to_s: () -> String
19
+
20
+ def to_a: () -> Array[Integer]
21
+
22
+ def <=>: (GameVersion other) -> Integer?
23
+ end
24
+ end
@@ -0,0 +1,64 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module HTTP
7
+ # Adds caching for GET requests
8
+ #
9
+ # Stores successful GET responses in FileSystem cache.
10
+ # Only caches non-streaming requests (no block given).
11
+ class CacheDecorator
12
+ attr_reader client: Client
13
+ attr_reader cache: Cache::FileSystem
14
+ attr_reader logger: Dry::Logger::Dispatcher
15
+
16
+ # Execute an HTTP request (only caches GET without block)
17
+ #
18
+ # @param method [Symbol] HTTP method
19
+ # @param uri [URI::HTTPS] target URI
20
+ # @param headers [Hash<String, String>] request headers
21
+ # @param body [String, IO, nil] request body
22
+ # @yield [Net::HTTPResponse] for streaming responses
23
+ # @return [Response, Object] response object or parsed data
24
+ def request: (Symbol method, URI::HTTPS uri, ?headers: Hash[String, String], ?body: String | IO | nil) ?{ (Net::HTTPResponse) -> void } -> (Response | CachedResponse)
25
+
26
+ # Execute a GET request with caching
27
+ #
28
+ # @param uri [URI::HTTPS] target URI
29
+ # @param headers [Hash<String, String>] request headers
30
+ # @yield [Net::HTTPResponse] for streaming responses
31
+ # @return [Response, Object] response object or parsed data
32
+ def get: (URI::HTTPS uri, ?headers: Hash[String, String]) ?{ (Net::HTTPResponse) -> void } -> (Response | CachedResponse)
33
+
34
+ # Execute a POST request (never cached)
35
+ #
36
+ # @param uri [URI::HTTPS] target URI
37
+ # @param body [String, IO] request body
38
+ # @param headers [Hash<String, String>] request headers
39
+ # @param content_type [String, nil] Content-Type header
40
+ # @return [Response] response object
41
+ def post: (URI::HTTPS uri, body: String | IO, ?headers: Hash[String, String], ?content_type: String?) -> Response
42
+ end
43
+
44
+ # Response wrapper for cached data
45
+ class CachedResponse
46
+ attr_reader body: String
47
+ attr_reader code: Integer
48
+ attr_reader headers: Hash[String, Array[String]]
49
+
50
+ # @param body [String] cached response body
51
+ def initialize: (String body) -> void
52
+
53
+ # Always returns true for cached responses
54
+ #
55
+ # @return [Boolean] true
56
+ def success?: () -> true
57
+
58
+ # Get content length from body size
59
+ #
60
+ # @return [Integer] body size in bytes
61
+ def content_length: () -> Integer
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,55 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module HTTP
7
+ # Low-level HTTP client using Net::HTTP
8
+ #
9
+ # Responsibilities:
10
+ # - Create and configure Net::HTTP instances
11
+ # - Execute HTTP methods (GET, POST)
12
+ # - Handle redirects (up to MAX_REDIRECTS)
13
+ # - Parse response codes and raise appropriate errors
14
+ # - Stream reading/writing for large files
15
+ #
16
+ # Does NOT handle:
17
+ # - Retry logic (delegated to RetryDecorator)
18
+ # - Progress events (delegated to EventDecorator)
19
+ # - Caching (delegated to CacheDecorator)
20
+ # - JSON parsing (handled by API clients)
21
+ class Client
22
+ attr_reader logger: Dry::Logger::Dispatcher
23
+ attr_reader masked_params: Array[String]
24
+
25
+ def initialize: (?masked_params: Array[String]) -> void
26
+
27
+ # Execute an HTTP request
28
+ #
29
+ # @param method [Symbol] HTTP method (:get, :post, :put, :delete)
30
+ # @param uri [URI::HTTPS] target URI
31
+ # @param headers [Hash<String, String>] request headers
32
+ # @param body [String, IO, nil] request body
33
+ # @yield [Net::HTTPResponse] for streaming responses
34
+ # @return [Response] response object
35
+ def request: (Symbol method, URI::HTTPS uri, ?headers: Hash[String, String], ?body: String | IO | nil) ?{ (Net::HTTPResponse) -> void } -> Response
36
+
37
+ # Execute a GET request
38
+ #
39
+ # @param uri [URI::HTTPS] target URI
40
+ # @param headers [Hash<String, String>] request headers
41
+ # @yield [Net::HTTPResponse] for streaming responses
42
+ # @return [Response] response object
43
+ def get: (URI::HTTPS uri, ?headers: Hash[String, String]) ?{ (Net::HTTPResponse) -> void } -> Response
44
+
45
+ # Execute a POST request
46
+ #
47
+ # @param uri [URI::HTTPS] target URI
48
+ # @param body [String, IO] request body
49
+ # @param headers [Hash<String, String>] request headers
50
+ # @param content_type [String, nil] Content-Type header
51
+ # @return [Response] response object
52
+ def post: (URI::HTTPS uri, body: String | IO, ?headers: Hash[String, String], ?content_type: String?) -> Response
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,28 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module HTTP
7
+ # Simple response wrapper for Net::HTTP responses
8
+ class Response
9
+ attr_reader code: Integer
10
+ attr_reader body: String
11
+ attr_reader headers: Hash[String, Array[String]]
12
+ attr_reader raw_response: Net::HTTPResponse
13
+
14
+ # @param net_http_response [Net::HTTPResponse] Raw Net::HTTP response
15
+ def initialize: (Net::HTTPResponse net_http_response) -> void
16
+
17
+ # Check if response is successful (2xx)
18
+ #
19
+ # @return [Boolean] true if 2xx response
20
+ def success?: () -> bool
21
+
22
+ # Get Content-Length from headers
23
+ #
24
+ # @return [Integer, nil] content length in bytes, or nil if not present
25
+ def content_length: () -> Integer?
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,44 @@
1
+ # RBS type signature file
2
+ # NOTE: Do not include private method definitions in RBS files.
3
+ # Only public interfaces should be documented here.
4
+
5
+ module Factorix
6
+ module HTTP
7
+ # Decorator that adds retry functionality to an HTTP client
8
+ #
9
+ # Automatically retries transient errors (timeouts, connection issues)
10
+ # using an exponential backoff strategy with randomization.
11
+ class RetryDecorator
12
+ attr_reader client: Client
13
+ attr_reader retry_strategy: RetryStrategy
14
+ attr_reader logger: Dry::Logger::Dispatcher
15
+
16
+ # Execute an HTTP request with retry logic
17
+ #
18
+ # @param method [Symbol] HTTP method
19
+ # @param uri [URI::HTTPS] target URI
20
+ # @param headers [Hash<String, String>] request headers
21
+ # @param body [String, IO, nil] request body
22
+ # @yield [Net::HTTPResponse] for streaming responses
23
+ # @return [Response] response object
24
+ def request: (Symbol method, URI::HTTPS uri, ?headers: Hash[String, String], ?body: String | IO | nil) ?{ (Net::HTTPResponse) -> void } -> Response
25
+
26
+ # Execute a GET request with retry logic
27
+ #
28
+ # @param uri [URI::HTTPS] target URI
29
+ # @param headers [Hash<String, String>] request headers
30
+ # @yield [Net::HTTPResponse] for streaming responses
31
+ # @return [Response] response object
32
+ def get: (URI::HTTPS uri, ?headers: Hash[String, String]) ?{ (Net::HTTPResponse) -> void } -> Response
33
+
34
+ # Execute a POST request with retry logic
35
+ #
36
+ # @param uri [URI::HTTPS] target URI
37
+ # @param body [String, IO] request body
38
+ # @param headers [Hash<String, String>] request headers
39
+ # @param content_type [String, nil] Content-Type header
40
+ # @return [Response] response object
41
+ def post: (URI::HTTPS uri, body: String | IO, ?headers: Hash[String, String], ?content_type: String?) -> Response
42
+ end
43
+ end
44
+ end