legionio 1.6.9 → 1.6.10
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/legion/cli/bootstrap_command.rb +9 -3
- data/lib/legion/cli/config_command.rb +6 -2
- data/lib/legion/cli/config_import.rb +32 -7
- data/lib/legion/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 52f5c8d830d3bd42ee91a5058a5fb3a81de3b40dde9de4fc15f0aa5d71cf5f5c
|
|
4
|
+
data.tar.gz: 25039551a8e8f44aff39165f3b672abfeb6fb8a6c211ae86b13731c085061322
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 043ad66b0d3e94a98277cf7f3363fda0749ec743a7a22e11ae0702f3b1591cfd0dbe0291d243eaa57502b14afb3701648114d46887507c2c1b52bc6d01a64f2e
|
|
7
|
+
data.tar.gz: e4d85ead5e60258fca76e9a7c42614067af3d09c7ee2677efd47ed2bff1ac0bc146cf30bedc8e11965ee421843984a53549c3392743aface150dc99def1f0c6d
|
data/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,15 @@
|
|
|
15
15
|
- Move `Legion::LLM.chat` stub to `RSpec.configure before(:each)` block so it always intercepts regardless of whether the real `legion-llm` gem is loaded, preventing external LLM calls in integration tests
|
|
16
16
|
- Fix `service_setup_apollo_spec` "starts Apollo::Local" example: stub `Legion::Apollo.start` to prevent internal double-call of `Apollo::Local.start`
|
|
17
17
|
|
|
18
|
+
## [1.6.10] - 2026-03-26
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- `ConfigImport.write_config` now splits recognized subsystem keys (`microsoft_teams`, `rbac`, `api`, `logging`, `gaia`, `extensions`, `llm`, `data`, `cache_local`, `cache`, `transport`, `crypt`, `role`) into individual `{key}.json` files
|
|
22
|
+
- Remaining unrecognized keys written to `bootstrapped_settings.json` (replaces `imported.json`)
|
|
23
|
+
- Subsystem files are always overwritten on bootstrap; remainder file respects `--force` for merge behavior
|
|
24
|
+
- `write_config` returns an array of written paths instead of a single path
|
|
25
|
+
- `legion bootstrap` and `legion config import` updated to display per-file write confirmations
|
|
26
|
+
|
|
18
27
|
## [1.6.9] - 2026-03-26
|
|
19
28
|
|
|
20
29
|
### Added
|
|
@@ -63,9 +63,15 @@ module Legion
|
|
|
63
63
|
results[:packs_requested] = pack_names
|
|
64
64
|
|
|
65
65
|
# 4. Write config
|
|
66
|
-
|
|
67
|
-
results[:config_written] =
|
|
68
|
-
|
|
66
|
+
paths = ConfigImport.write_config(config, force: options[:force])
|
|
67
|
+
results[:config_written] = paths
|
|
68
|
+
unless options[:json]
|
|
69
|
+
if paths.empty?
|
|
70
|
+
out.warn('No config files were written (config was empty after removing packs).')
|
|
71
|
+
else
|
|
72
|
+
paths.each { |p| out.success("Written: #{p}") }
|
|
73
|
+
end
|
|
74
|
+
end
|
|
69
75
|
|
|
70
76
|
# 5. Scaffold missing subsystem files
|
|
71
77
|
results[:scaffold] = run_scaffold(out)
|
|
@@ -192,10 +192,14 @@ module Legion
|
|
|
192
192
|
out.info("Fetching config from #{source}...")
|
|
193
193
|
body = ConfigImport.fetch_source(source)
|
|
194
194
|
config = ConfigImport.parse_payload(body)
|
|
195
|
-
|
|
195
|
+
paths = ConfigImport.write_config(config, force: options[:force])
|
|
196
196
|
summary = ConfigImport.summary(config)
|
|
197
197
|
|
|
198
|
-
|
|
198
|
+
if paths.empty?
|
|
199
|
+
out.warn('No config files were written (empty configuration).')
|
|
200
|
+
else
|
|
201
|
+
paths.each { |p| out.success("Written: #{p}") }
|
|
202
|
+
end
|
|
199
203
|
out.info("Sections: #{summary[:sections].join(', ')}")
|
|
200
204
|
if summary[:vault_clusters].any?
|
|
201
205
|
out.info("Vault clusters: #{summary[:vault_clusters].join(', ')}")
|
|
@@ -10,7 +10,12 @@ module Legion
|
|
|
10
10
|
module CLI
|
|
11
11
|
module ConfigImport
|
|
12
12
|
SETTINGS_DIR = File.expand_path('~/.legionio/settings')
|
|
13
|
-
|
|
13
|
+
BOOTSTRAPPED_FILE = 'bootstrapped_settings.json'
|
|
14
|
+
|
|
15
|
+
SUBSYSTEM_KEYS = %i[
|
|
16
|
+
microsoft_teams rbac api logging gaia extensions
|
|
17
|
+
llm data cache_local cache transport crypt role
|
|
18
|
+
].freeze
|
|
14
19
|
|
|
15
20
|
module_function
|
|
16
21
|
|
|
@@ -56,15 +61,35 @@ module Legion
|
|
|
56
61
|
|
|
57
62
|
def write_config(config, force: false)
|
|
58
63
|
FileUtils.mkdir_p(SETTINGS_DIR)
|
|
59
|
-
|
|
64
|
+
written = []
|
|
65
|
+
remainder = config.dup
|
|
66
|
+
|
|
67
|
+
SUBSYSTEM_KEYS.each do |key|
|
|
68
|
+
next unless remainder.key?(key)
|
|
69
|
+
|
|
70
|
+
subsystem_data = remainder.delete(key)
|
|
71
|
+
path = File.join(SETTINGS_DIR, "#{key}.json")
|
|
72
|
+
to_write = { key => subsystem_data }
|
|
73
|
+
if File.exist?(path) && !force
|
|
74
|
+
existing = ::JSON.parse(File.read(path), symbolize_names: true)
|
|
75
|
+
existing_subsystem = existing[key]
|
|
76
|
+
to_write = { key => deep_merge(existing_subsystem, subsystem_data) } if existing_subsystem.is_a?(Hash) && subsystem_data.is_a?(Hash)
|
|
77
|
+
end
|
|
78
|
+
File.write(path, "#{::JSON.pretty_generate(to_write)}\n")
|
|
79
|
+
written << path
|
|
80
|
+
end
|
|
60
81
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
82
|
+
unless remainder.empty?
|
|
83
|
+
path = File.join(SETTINGS_DIR, BOOTSTRAPPED_FILE)
|
|
84
|
+
if File.exist?(path) && !force
|
|
85
|
+
existing = ::JSON.parse(File.read(path), symbolize_names: true)
|
|
86
|
+
remainder = deep_merge(existing, remainder)
|
|
87
|
+
end
|
|
88
|
+
File.write(path, "#{::JSON.pretty_generate(remainder)}\n")
|
|
89
|
+
written << path
|
|
64
90
|
end
|
|
65
91
|
|
|
66
|
-
|
|
67
|
-
path
|
|
92
|
+
written
|
|
68
93
|
end
|
|
69
94
|
|
|
70
95
|
def deep_merge(base, overlay)
|
data/lib/legion/version.rb
CHANGED