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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e67d5abaf8c274cad673af9996e29577949a9e945c66ee099b1c8e23eeff4a3f
4
- data.tar.gz: 4c3113323f086005de660cd84128036d59919ee2f2482ce84a855334bab007c4
3
+ metadata.gz: 52f5c8d830d3bd42ee91a5058a5fb3a81de3b40dde9de4fc15f0aa5d71cf5f5c
4
+ data.tar.gz: 25039551a8e8f44aff39165f3b672abfeb6fb8a6c211ae86b13731c085061322
5
5
  SHA512:
6
- metadata.gz: d221a3d63b90d155b24fabd47594aef550467d6136a96092208a7f710455f87f416ae4110815e323c7bfcb83aec13ec4c41dff7b2db14b0846dafbe55ca9be66
7
- data.tar.gz: b495e7daddcbb0e5cbda7c93f152ca285e044972ee8b74c9d432f91e97c4536d1087539f7b8daf784910cb359935453b6aa1f9e972c8d81b688d55c8986e2f34
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
- path = ConfigImport.write_config(config, force: options[:force])
67
- results[:config_written] = path
68
- out.success("Config written to #{path}") unless options[:json]
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
- path = ConfigImport.write_config(config, force: options[:force])
195
+ paths = ConfigImport.write_config(config, force: options[:force])
196
196
  summary = ConfigImport.summary(config)
197
197
 
198
- out.success("Config written to #{path}")
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
- IMPORT_FILE = 'imported.json'
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
- path = File.join(SETTINGS_DIR, IMPORT_FILE)
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
- if File.exist?(path) && !force
62
- existing = ::JSON.parse(File.read(path), symbolize_names: true)
63
- config = deep_merge(existing, config)
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
- File.write(path, ::JSON.pretty_generate(config))
67
- path
92
+ written
68
93
  end
69
94
 
70
95
  def deep_merge(base, overlay)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Legion
4
- VERSION = '1.6.9'
4
+ VERSION = '1.6.10'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legionio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.9
4
+ version: 1.6.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity