-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
42 lines (35 loc) · 1.37 KB
/
__init__.py
File metadata and controls
42 lines (35 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""nostrcalendar plugin for Hermes Agent."""
from __future__ import annotations
import sys
from pathlib import Path
_HERE = Path(__file__).resolve().parent
if str(_HERE) not in sys.path:
sys.path.insert(0, str(_HERE))
from .tools import ( # noqa: E402
CALENDAR_ADD_EVENT_SCHEMA,
CALENDAR_FREE_SLOTS_SCHEMA,
CALENDAR_INIT_SCHEMA,
CALENDAR_LIST_EVENTS_SCHEMA,
CALENDAR_SET_AVAILABILITY_SCHEMA,
handle_calendar_add_event,
handle_calendar_free_slots,
handle_calendar_init,
handle_calendar_list_events,
handle_calendar_set_availability,
)
_TOOLS = (
("calendar_init", CALENDAR_INIT_SCHEMA, handle_calendar_init, "📅"),
("calendar_set_availability", CALENDAR_SET_AVAILABILITY_SCHEMA, handle_calendar_set_availability, "🕒"),
("calendar_add_event", CALENDAR_ADD_EVENT_SCHEMA, handle_calendar_add_event, "➕"),
("calendar_list_events", CALENDAR_LIST_EVENTS_SCHEMA, handle_calendar_list_events, "📋"),
("calendar_free_slots", CALENDAR_FREE_SLOTS_SCHEMA, handle_calendar_free_slots, "🟢"),
)
def register(ctx) -> None:
for name, schema, handler, emoji in _TOOLS:
ctx.register_tool(
name=name,
toolset="nostrcalendar",
schema=schema,
handler=handler,
emoji=emoji,
)