module RabbotMetaPlanSession
Constants
- PENDING_KEY
- PLUGIN
Public Instance Methods
Source
# File lib/rabbot_meta_plan_session.rb, line 78 def admin_allowed?(network:, channel:, nick:, is_op:, store: RabbotDb) AiPlanSession.admin_allowed?(network: network, channel: channel, nick: nick, is_op: is_op, store: store) end
Source
# File lib/rabbot_meta_plan_session.rb, line 82 def admin_denial_message AiPlanSession.admin_denial_message end
Source
# File lib/rabbot_meta_plan_session.rb, line 64 def clear_pending!(network:, channel:, store: RabbotDb) network = store.normalize_network(network) channel = store.normalize_channel(channel) return if channel.empty? store.set_plugin_json( plugin: PLUGIN, key: PENDING_KEY, value: nil, network: network, channel: channel ) end
Source
# File lib/rabbot_meta_plan_session.rb, line 39 def pending(network:, channel:, store: RabbotDb) network = store.normalize_network(network) channel = store.normalize_channel(channel) return nil if channel.empty? raw = store.get_plugin_json( plugin: PLUGIN, key: PENDING_KEY, network: network, channel: channel, default: nil ) session_id = raw.is_a?(Hash) ? raw["session_id"].to_s.strip : "" return nil if session_id.empty? { session_id: raw["session_id"].to_s, asker: raw["asker"].to_s, description: raw["description"].to_s, questions: AiPlanSession.deserialize_questions(raw["questions"]), model: raw["model"].to_s, build_state: raw["build_state"].is_a?(Hash) ? raw["build_state"] : {} } end
Source
# File lib/rabbot_meta_plan_session.rb, line 86 def resolve_answer(text, questions:) AiPlanSession.resolve_answer(text, questions: questions) end
Source
# File lib/rabbot_meta_plan_session.rb, line 17 def save_pending!(network:, channel:, session_id:, asker:, description:, questions:, model:, build_state:, store: RabbotDb) network = store.normalize_network(network) channel = store.normalize_channel(channel) return if network.empty? || channel.empty? || session_id.to_s.strip.empty? store.set_plugin_json( plugin: PLUGIN, key: PENDING_KEY, value: { "session_id" => session_id.to_s, "asker" => asker.to_s.strip, "description" => description.to_s.strip, "questions" => AiPlanSession.serialize_questions(questions), "model" => model.to_s.strip, "build_state" => build_state }, network: network, channel: channel ) end