agents/01-ticket-routing/agent.capsule17 lines
(agent ticket-routing
(purpose "triage the support inbox in tickets/: route every ticket, then send each ticket's customer one short acknowledgment, to the address the ticket is from, that says which team has it and is true to their account in accounts/ (do not promise a refund to an account that is past due); a ticket whose account is not on file is still routed and acknowledged")
(capability tickets :files "tickets")
(capability accounts :files "accounts")
1 (capability queue :route "routed.jsonl" :from tickets
:question "Which team should handle this support ticket?"
:options ((billing "invoices, charges, refunds, payment details")
(support "the product misbehaving: errors, outages, signing in")
(sales "buying more: plans, seats, pricing, upgrades")))
(capability mail :spool "mail")
(grant capability tickets/list :kind tool)
(grant capability tickets/read :kind tool)
(grant capability accounts/list :kind tool)
(grant capability accounts/read :kind tool)
2 (grant capability queue/route :kind decide)
; Every acknowledgment waits for you.
3 (grant capability mail/send :kind tool :ask)
4 (done (each tickets queue item)))