13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/legion/mcp/cold_start.rb', line 13
def (path: nil)
log.debug("[mcp][cold_start] action=load_community_patterns store_empty=#{Patterns::Store.empty?}")
return { skipped: true, reason: 'store not empty' } unless Patterns::Store.empty?
path ||= configured_path
return { skipped: true, reason: 'no path configured' } unless path
log.debug("[mcp][cold_start] action=load_community_patterns path=#{path}")
Patterns::Exchange.import_from_file(path, trust_level: :community)
rescue StandardError => e
handle_exception(e, level: :error, operation: 'legion.mcp.cold_start.load_community_patterns')
{ error: e.message, imported: 0 }
end
|