Class: Silas::Inbox::InvocationsController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- Silas::Inbox::InvocationsController
- Defined in:
- app/controllers/silas/inbox/invocations_controller.rb
Overview
Approve/decline from the UI — the SAME code path as the Slack buttons and email links (invocation.approve!/decline!). Writes always require real auth, even when reads are public.
Instance Method Summary collapse
-
#answer ⇒ Object
ask_question's verdict: the operator's text becomes the tool result.
- #approve ⇒ Object
- #decline ⇒ Object
Instance Method Details
#answer ⇒ Object
ask_question's verdict: the operator's text becomes the tool result.
28 29 30 31 32 33 |
# File 'app/controllers/silas/inbox/invocations_controller.rb', line 28 def answer @invocation.answer!(text: params[:text].to_s.strip, by: current_actor) respond_resolved rescue Silas::Error => e respond_error(e) end |
#approve ⇒ Object
10 11 12 13 14 15 |
# File 'app/controllers/silas/inbox/invocations_controller.rb', line 10 def approve @invocation.approve!(by: current_actor) respond_resolved rescue Silas::Error => e respond_error(e) end |
#decline ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/silas/inbox/invocations_controller.rb', line 17 def decline # decline-with-note: the textarea's reason becomes {denied: reason}, # which the model sees as the tool result. reason = params[:reason].presence || "declined from inbox" @invocation.decline!(reason: reason, by: current_actor) respond_resolved rescue Silas::Error => e respond_error(e) end |