A Zulip bot agent to sit in our Black Sun. Ever evolving
at main 30 lines 1.1 kB view raw
1(*--------------------------------------------------------------------------- 2 Copyright (c) 2026 Anil Madhavapeddy <anil@recoil.org>. All rights reserved. 3 SPDX-License-Identifier: ISC 4 ---------------------------------------------------------------------------*) 5 6(** Poe bot message handler. *) 7 8val src : Logs.Src.t 9(** Log source for the handler. *) 10 11type 'a env = { 12 sw : Eio.Switch.t; 13 process_mgr : 'a Eio.Process.mgr; 14 clock : float Eio.Time.clock_ty Eio.Resource.t; 15 fs : Eio.Fs.dir_ty Eio.Path.t; 16} 17(** Environment required for the handler. *) 18 19val make_handler : _ env -> Config.t -> Zulip_bot.Bot.handler 20(** [make_handler env config] creates a bot handler with the given 21 environment and configuration. 22 23 The handler responds to: 24 - "help" or "?" - Shows help message 25 - "status" - Shows current configuration 26 - "broadcast", "post changes", "post", "changes" - Broadcasts daily changes 27 - Any other message - Passed to Claude for interpretation *) 28 29val ask_claude : _ env -> string -> string 30(** [ask_claude env prompt] sends a prompt to Claude and returns the response. *)