Class: Ask::AppServer::EmittingApprovalQueue
- Inherits:
-
Ask::Agent::ApprovalQueue
- Object
- Ask::Agent::ApprovalQueue
- Ask::AppServer::EmittingApprovalQueue
- Defined in:
- lib/ask/app_server/agent_adapter.rb
Overview
Approval queue that emits canonical approval events through the session's EventTranslator whenever actions are submitted or change status, so clients can stream approval state in real time.
The session wires its own apply/reject/submit callbacks onto the queue (see Session#build_approval); this subclass only adds observation hooks on top, using its own listeners so the session's on_submit (pending-tool registration) is never clobbered.
Instance Method Summary collapse
-
#initialize(on_submit: nil, on_status: nil, **kwargs) ⇒ EmittingApprovalQueue
constructor
A new instance of EmittingApprovalQueue.
- #submit(tool_call_id:, tool_name:, args: {}, auto_approvable: false, message: nil) ⇒ Object
Constructor Details
#initialize(on_submit: nil, on_status: nil, **kwargs) ⇒ EmittingApprovalQueue
Returns a new instance of EmittingApprovalQueue.
368 369 370 371 372 |
# File 'lib/ask/app_server/agent_adapter.rb', line 368 def initialize(on_submit: nil, on_status: nil, **kwargs) @on_action_submitted = on_submit @on_status = on_status super(**kwargs) end |
Instance Method Details
#submit(tool_call_id:, tool_name:, args: {}, auto_approvable: false, message: nil) ⇒ Object
374 375 376 377 378 |
# File 'lib/ask/app_server/agent_adapter.rb', line 374 def submit(tool_call_id:, tool_name:, args: {}, auto_approvable: false, message: nil) id = super @on_action_submitted&.call(self[id]) id end |