-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
37 lines (30 loc) · 966 Bytes
/
__init__.py
File metadata and controls
37 lines (30 loc) · 966 Bytes
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
"""nostr-profile 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
PROFILE_PUBLISH_SCHEMA,
PROFILE_READ_SCHEMA,
PROFILE_UPDATE_SCHEMA,
handle_profile_publish,
handle_profile_read,
handle_profile_update,
)
_TOOLS = (
("profile_publish", PROFILE_PUBLISH_SCHEMA, handle_profile_publish, "📝"),
("profile_update", PROFILE_UPDATE_SCHEMA, handle_profile_update, "✏️"),
("profile_read", PROFILE_READ_SCHEMA, handle_profile_read, "👁️"),
)
def register(ctx) -> None:
for name, schema, handler, emoji in _TOOLS:
ctx.register_tool(
name=name,
toolset="nostrprofile",
schema=schema,
handler=handler,
is_async=True,
emoji=emoji,
)