Class: Llmemory::Cli::Commands::ForgetLog
- Defined in:
- lib/llmemory/cli/commands/forget_log.rb
Instance Method Summary collapse
Methods inherited from Base
#option_parser, #parse_options, #run
Instance Method Details
#execute(argv, _opts) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/llmemory/cli/commands/forget_log.rb', line 9 def execute(argv, _opts) user_id = argv.first unless user_id $stderr.puts "Usage: llmemory forget-log USER_ID" exit 1 end entries = Llmemory::ForgetLog.new(store: short_term_store).entries(user_id) if entries.empty? puts "No forget audit entries for user #{user_id}." return end entries.each do |e| type = e[:memory_type] || e["memory_type"] count = e[:count] || e["count"] reason = e[:reason] || e["reason"] at = e[:at] || e["at"] ids = e[:ids] || e["ids"] || [] reason_str = reason ? " — #{reason}" : "" puts "[#{at}] #{type}: removed #{count} (#{ids.join(', ')})#{reason_str}" end end |