Commit cdee182

mo khan <mo@mokhan.ca>
2025-11-05 23:54:18
fix: fix the /context to take the current mode into account
1 parent d75b620
Changed files (2)
lib/elelem/agent.rb
@@ -41,7 +41,7 @@ module Elelem
           when "/clear"
             conversation.clear
             puts "  → Conversation cleared"
-          when "/context" then puts conversation.dump
+          when "/context" then puts conversation.dump(mode)
           else
             puts help_banner
           end
lib/elelem/conversation.rb
@@ -30,8 +30,8 @@ module Elelem
       @items = default_context
     end
 
-    def dump
-      JSON.pretty_generate(@items)
+    def dump(mode)
+      JSON.pretty_generate(history_for(mode))
     end
 
     private
@@ -52,11 +52,11 @@ module Elelem
         "#{base}\n\nUse shell commands creatively to understand and manipulate the system."
       when [:read, :write]
         "#{base}\n\nFirst understand, then build solutions that integrate well."
-      when [:read, :execute]
+      when [:execute, :read]
         "#{base}\n\nUse commands to deeply understand the system."
-      when [:write, :execute]
+      when [:execute, :write]
         "#{base}\n\nCreate and execute freely. Have fun. Be kind."
-      when [:read, :write, :execute]
+      when [:read, :execute, :write]
         "#{base}\n\nYou have all tools. Use them wisely."
       else
         base