-
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.14 KB
/
__init__.py
File metadata and controls
42 lines (35 loc) · 1.14 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
"""nostrsocial 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
SOCIAL_ADD_SCHEMA,
SOCIAL_INIT_SCHEMA,
SOCIAL_LIST_SCHEMA,
SOCIAL_PROMOTE_SCHEMA,
SOCIAL_SCREEN_SCHEMA,
handle_social_add,
handle_social_init,
handle_social_list,
handle_social_promote,
handle_social_screen,
)
_TOOLS = (
("social_init", SOCIAL_INIT_SCHEMA, handle_social_init, "🌐"),
("social_add", SOCIAL_ADD_SCHEMA, handle_social_add, "➕"),
("social_list", SOCIAL_LIST_SCHEMA, handle_social_list, "📇"),
("social_promote", SOCIAL_PROMOTE_SCHEMA, handle_social_promote, "⬆️"),
("social_screen", SOCIAL_SCREEN_SCHEMA, handle_social_screen, "🛡️"),
)
def register(ctx) -> None:
for name, schema, handler, emoji in _TOOLS:
ctx.register_tool(
name=name,
toolset="nostrsocial",
schema=schema,
handler=handler,
emoji=emoji,
)