22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/legion/cli/plan_command.rb', line 22
def interactive
out = formatter
setup_connection
chat_obj = create_plan_chat
system_prompt = build_plan_prompt
require 'legion/cli/chat/session'
@session = Chat::Session.new(chat: chat_obj, system_prompt: system_prompt)
out.("Legion Plan Mode (#{@session.model_id})")
puts out.dim(' Read-only exploration. No file writes or shell commands.')
puts out.dim(' Type /save to save plan, /quit to exit')
puts
plan_repl(out)
rescue Interrupt
puts
puts out.dim('Interrupted.')
ensure
Connection.shutdown
end
|