meshagent-cli 0.0.32__tar.gz → 0.0.34__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of meshagent-cli might be problematic. Click here for more details.

Files changed (36) hide show
  1. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/PKG-INFO +5 -5
  2. meshagent_cli-0.0.34/meshagent/cli/chatbot.py +160 -0
  3. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/cli_mcp.py +3 -2
  4. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/helper.py +6 -0
  5. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/messaging.py +12 -7
  6. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/services.py +1 -2
  7. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/storage.py +8 -2
  8. meshagent_cli-0.0.34/meshagent/cli/version.py +1 -0
  9. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/voicebot.py +49 -16
  10. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent_cli.egg-info/PKG-INFO +5 -5
  11. meshagent_cli-0.0.34/meshagent_cli.egg-info/requires.txt +8 -0
  12. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/pyproject.toml +4 -4
  13. meshagent_cli-0.0.32/meshagent/cli/chatbot.py +0 -78
  14. meshagent_cli-0.0.32/meshagent/cli/version.py +0 -1
  15. meshagent_cli-0.0.32/meshagent_cli.egg-info/requires.txt +0 -8
  16. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/README.md +0 -0
  17. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/__init__.py +0 -0
  18. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/agent.py +0 -0
  19. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/api_keys.py +0 -0
  20. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/async_typer.py +0 -0
  21. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/auth.py +0 -0
  22. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/auth_async.py +0 -0
  23. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/call.py +0 -0
  24. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/cli.py +0 -0
  25. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/cli_secrets.py +0 -0
  26. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/developer.py +0 -0
  27. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/participant_token.py +0 -0
  28. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/projects.py +0 -0
  29. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/sessions.py +0 -0
  30. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/tty.py +0 -0
  31. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent/cli/webhook.py +0 -0
  32. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent_cli.egg-info/SOURCES.txt +0 -0
  33. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent_cli.egg-info/dependency_links.txt +0 -0
  34. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent_cli.egg-info/entry_points.txt +0 -0
  35. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/meshagent_cli.egg-info/top_level.txt +0 -0
  36. {meshagent_cli-0.0.32 → meshagent_cli-0.0.34}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-cli
3
- Version: 0.0.32
3
+ Version: 0.0.34
4
4
  Summary: CLI for Meshagent
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Documentation, https://docs.meshagent.com
@@ -10,10 +10,10 @@ Requires-Python: >=3.12
10
10
  Description-Content-Type: text/markdown
11
11
  Requires-Dist: typer~=0.15.3
12
12
  Requires-Dist: pydantic-yaml~=1.4.0
13
- Requires-Dist: meshagent-api~=0.0.32
14
- Requires-Dist: meshagent-agents~=0.0.32
15
- Requires-Dist: meshagent-tools~=0.0.32
16
- Requires-Dist: meshagent-mcp~=0.0.32
13
+ Requires-Dist: meshagent-api~=0.0.34
14
+ Requires-Dist: meshagent-agents~=0.0.34
15
+ Requires-Dist: meshagent-tools~=0.0.34
16
+ Requires-Dist: meshagent-mcp~=0.0.34
17
17
  Requires-Dist: supabase~=2.15.1
18
18
  Requires-Dist: fastmcp~=2.8.1
19
19
 
@@ -0,0 +1,160 @@
1
+
2
+ import typer
3
+ from rich import print
4
+ from typing import Annotated, Optional
5
+ from meshagent.tools import Toolkit
6
+ from meshagent.api import RoomClient, ParticipantToken, WebSocketClientProtocol, RoomException
7
+ from meshagent.api.helpers import meshagent_base_url, websocket_room_url
8
+ from meshagent.cli import async_typer
9
+ from meshagent.cli.helper import get_client, resolve_project_id, resolve_api_key, resolve_token_jwt, resolve_room
10
+ from meshagent.agents.chat import ChatBot
11
+ from meshagent.openai import OpenAIResponsesAdapter
12
+ from meshagent.openai.tools.responses_adapter import LocalShellTool
13
+ from meshagent.api.services import ServiceHost
14
+
15
+ from meshagent.agents.chat import ChatBotThreadOpenAIImageGenerationTool
16
+
17
+ from typing import List
18
+
19
+ from meshagent.api import RequiredToolkit, RequiredSchema
20
+
21
+ app = async_typer.AsyncTyper()
22
+
23
+ @app.async_command("join")
24
+ async def make_call(
25
+ *,
26
+ project_id: str = None,
27
+ room: Annotated[Optional[str], typer.Option()] = None,
28
+ api_key_id: Annotated[Optional[str], typer.Option()] = None,
29
+ name: Annotated[str, typer.Option(..., help="Participant name")] = "cli",
30
+ role: str = "agent",
31
+ agent_name: Annotated[str, typer.Option(..., help="Name of the agent to call")],
32
+ rule: Annotated[List[str], typer.Option("--rule", "-r", help="a system rule")] = [],
33
+ toolkit: Annotated[List[str], typer.Option("--toolkit", "-t", help="the name or url of a required toolkit")] = [],
34
+ schema: Annotated[List[str], typer.Option("--schema", "-s", help="the name or url of a required schema")] = [],
35
+ token_path: Annotated[Optional[str], typer.Option()] = None,
36
+ image_generation: Annotated[Optional[str], typer.Option(..., help="Name of an image gen provider (openai)")] = None,
37
+ ):
38
+ account_client = await get_client()
39
+ try:
40
+ project_id = await resolve_project_id(project_id=project_id)
41
+ api_key_id = await resolve_api_key(project_id, api_key_id)
42
+
43
+ room = resolve_room(room)
44
+ jwt = await resolve_token_jwt(project_id=project_id, api_key_id=api_key_id, token_path=token_path, name=name, role=role, room=room)
45
+
46
+ print("[bold green]Connecting to room...[/bold green]")
47
+ async with RoomClient(
48
+ protocol=WebSocketClientProtocol(url=websocket_room_url(room_name=room, base_url=meshagent_base_url()),
49
+ token=jwt)
50
+ ) as client:
51
+
52
+ requirements = []
53
+
54
+ toolkits = []
55
+
56
+ for t in toolkit:
57
+ requirements.append(RequiredToolkit(name=t))
58
+
59
+ for t in schema:
60
+ requirements.append(RequiredSchema(name=t))
61
+
62
+ class CustomChatbot(ChatBot):
63
+
64
+ async def get_thread_toolkits(self, *, thread_context, participant):
65
+ toolkits = await super().get_thread_toolkits(thread_context=thread_context, participant=participant)
66
+
67
+ thread_toolkit = Toolkit(name="thread_toolkit", tools=[])
68
+ if image_generation != None:
69
+ if image_generation == "openai":
70
+ print("adding openai image gen to thread")
71
+ thread_toolkit.tools.append(ChatBotThreadOpenAIImageGenerationTool(thread_context=thread_context, partial_images=3))
72
+ else:
73
+ raise Exception("image-generation must be openai")
74
+ toolkits.append(thread_toolkit)
75
+ return toolkits
76
+
77
+
78
+ bot = CustomChatbot(
79
+ llm_adapter=OpenAIResponsesAdapter(),
80
+ name=agent_name,
81
+ requires=requirements,
82
+ toolkits=toolkits,
83
+ rules=rule if len(rule) > 0 else None
84
+ )
85
+
86
+ await bot.start(room=client)
87
+ try:
88
+ await client.protocol.wait_for_close()
89
+ except KeyboardInterrupt:
90
+ await bot.stop()
91
+
92
+ finally:
93
+ await account_client.close()
94
+
95
+
96
+
97
+ @app.async_command("service")
98
+ async def service(
99
+ *,
100
+ room: Annotated[Optional[str], typer.Option()] = None,
101
+
102
+ agent_name: Annotated[str, typer.Option(..., help="Name of the agent to call")],
103
+
104
+ rule: Annotated[List[str], typer.Option("--rule", "-r", help="a system rule")] = [],
105
+ toolkit: Annotated[List[str], typer.Option("--toolkit", "-t", help="the name or url of a required toolkit")] = [],
106
+ schema: Annotated[List[str], typer.Option("--schema", "-s", help="the name or url of a required schema")] = [],
107
+ image_generation: Annotated[Optional[str], typer.Option(..., help="Name of an image gen provider (openai)")] = None,
108
+
109
+ host: Annotated[Optional[str], typer.Option()] = None,
110
+ port: Annotated[Optional[int], typer.Option()] = None,
111
+ path: Annotated[str, typer.Option()] = "/agent",
112
+ ):
113
+
114
+ room = resolve_room(room)
115
+
116
+ print("[bold green]Connecting to room...[/bold green]")
117
+
118
+ requirements = []
119
+
120
+ toolkits = []
121
+
122
+ for t in toolkit:
123
+ requirements.append(RequiredToolkit(name=t))
124
+
125
+ for t in schema:
126
+ requirements.append(RequiredSchema(name=t))
127
+
128
+ class CustomChatbot(ChatBot):
129
+
130
+ async def get_thread_toolkits(self, *, thread_context, participant):
131
+ toolkits = await super().get_thread_toolkits(thread_context=thread_context, participant=participant)
132
+
133
+ thread_toolkit = Toolkit(name="thread_toolkit", tools=[])
134
+ if image_generation != None:
135
+ if image_generation == "openai":
136
+ print("adding openai image gen to thread")
137
+ thread_toolkit.tools.append(ChatBotThreadOpenAIImageGenerationTool(thread_context=thread_context, partial_images=3))
138
+ else:
139
+ raise Exception("image-generation must be openai")
140
+ toolkits.append(thread_toolkit)
141
+ return toolkits
142
+
143
+
144
+ service = ServiceHost(
145
+ host=host,
146
+ port=port
147
+ )
148
+
149
+ @service.path(path=path)
150
+ class CustomChatbot(ChatBot):
151
+ def __init__(self):
152
+ super().__init__(
153
+ llm_adapter=OpenAIResponsesAdapter(),
154
+ name=agent_name,
155
+ requires=requirements,
156
+ toolkits=toolkits,
157
+ rules=rule if len(rule) > 0 else None
158
+ )
159
+
160
+ await service.run()
@@ -10,8 +10,7 @@ from typing import Annotated, Optional, List
10
10
  from meshagent.api.helpers import meshagent_base_url, websocket_room_url
11
11
  from meshagent.api import RoomClient, ParticipantToken, WebSocketClientProtocol, RoomException
12
12
  from meshagent.cli import async_typer
13
- from meshagent.cli.helper import get_client, print_json_table, set_active_project, resolve_project_id
14
- from meshagent.cli.helper import set_active_project, get_active_project, resolve_project_id, resolve_api_key, resolve_token_jwt
13
+ from meshagent.cli.helper import get_client, resolve_project_id, resolve_api_key, resolve_token_jwt, resolve_room
15
14
 
16
15
  from meshagent.tools.hosting import RemoteToolkit, RemoteToolkitServer
17
16
 
@@ -36,6 +35,7 @@ async def sse(*, project_id: str = None, room: Annotated[str, typer.Option()], t
36
35
  project_id = await resolve_project_id(project_id=project_id)
37
36
  api_key_id = await resolve_api_key(project_id, api_key_id)
38
37
 
38
+ room = resolve_room(room)
39
39
  jwt = await resolve_token_jwt(project_id=project_id, api_key_id=api_key_id, token_path=token_path, name=name, role=role, room=room)
40
40
 
41
41
  print("[bold green]Connecting to room...[/bold green]")
@@ -73,6 +73,7 @@ async def stdio(*, project_id: str = None, room: Annotated[str, typer.Option()],
73
73
  project_id = await resolve_project_id(project_id=project_id)
74
74
  api_key_id = await resolve_api_key(project_id, api_key_id)
75
75
 
76
+ room = resolve_room(room)
76
77
  jwt = await resolve_token_jwt(project_id=project_id, api_key_id=api_key_id, token_path=token_path, name=name, role=role, room=room)
77
78
 
78
79
  print("[bold green]Connecting to room...[/bold green]")
@@ -92,6 +92,12 @@ def print_json_table(records: list, *cols):
92
92
  Console().print(table)
93
93
 
94
94
 
95
+ def resolve_room(room_name: Optional[str] = None):
96
+ if room_name == None:
97
+ room_name = os.getenv("MESHAGENT_ROOM")
98
+
99
+ return room_name
100
+
95
101
  async def resolve_project_id(project_id: Optional[str] = None):
96
102
  if project_id == None:
97
103
  project_id = await get_active_project()
@@ -6,16 +6,16 @@ import json
6
6
  from meshagent.api import RoomClient, ParticipantToken, WebSocketClientProtocol
7
7
  from meshagent.api.helpers import meshagent_base_url, websocket_room_url
8
8
  from meshagent.cli import async_typer
9
- from meshagent.cli.helper import get_client, resolve_project_id, resolve_api_key, resolve_token_jwt
9
+ from meshagent.cli.helper import get_client, resolve_project_id, resolve_api_key, resolve_token_jwt, resolve_room
10
10
 
11
11
  app = async_typer.AsyncTyper()
12
12
 
13
13
 
14
- @app.async_command("list")
14
+ @app.async_command("list-participants")
15
15
  async def messaging_list_participants_command(
16
16
  *,
17
17
  project_id: str = None,
18
- room: Annotated[str, typer.Option()],
18
+ room: Annotated[Optional[str], typer.Option()] = None,
19
19
  token_path: Annotated[Optional[str], typer.Option()] = None,
20
20
  api_key_id: Annotated[Optional[str], typer.Option()] = None,
21
21
  name: Annotated[str, typer.Option()] = "cli",
@@ -29,7 +29,9 @@ async def messaging_list_participants_command(
29
29
  # Resolve project_id if not provided
30
30
  project_id = await resolve_project_id(project_id=project_id)
31
31
  api_key_id = await resolve_api_key(project_id, api_key_id)
32
-
32
+
33
+ room = resolve_room(room)
34
+
33
35
  jwt = await resolve_token_jwt(project_id=project_id, api_key_id=api_key_id, token_path=token_path, name=name, role=role, room=room)
34
36
 
35
37
  print("[bold green]Connecting to room...[/bold green]")
@@ -65,7 +67,7 @@ async def messaging_list_participants_command(
65
67
  async def messaging_send_command(
66
68
  *,
67
69
  project_id: str = None,
68
- room: Annotated[str, typer.Option()],
70
+ room: Annotated[Optional[str], typer.Option()] = None,
69
71
  token_path: Annotated[Optional[str], typer.Option()] = None,
70
72
  api_key_id: Annotated[Optional[str], typer.Option()] = None,
71
73
  name: Annotated[str, typer.Option()] = "cli",
@@ -81,7 +83,9 @@ async def messaging_send_command(
81
83
  # Resolve project_id if not provided
82
84
  project_id = await resolve_project_id(project_id=project_id)
83
85
  api_key_id = await resolve_api_key(project_id, api_key_id)
84
-
86
+
87
+ room = resolve_room(room)
88
+
85
89
  jwt = await resolve_token_jwt(project_id=project_id, api_key_id=api_key_id, token_path=token_path, name=name, role=role, room=room)
86
90
 
87
91
  print("[bold green]Connecting to room...[/bold green]")
@@ -124,7 +128,7 @@ async def messaging_send_command(
124
128
  async def messaging_broadcast_command(
125
129
  *,
126
130
  project_id: str = None,
127
- room: Annotated[str, typer.Option()],
131
+ room: Annotated[Optional[str], typer.Option()] = None,
128
132
  token_path: Annotated[Optional[str], typer.Option()] = None,
129
133
  api_key_id: Annotated[Optional[str], typer.Option()] = None,
130
134
  name: Annotated[str, typer.Option()] = "cli",
@@ -140,6 +144,7 @@ async def messaging_broadcast_command(
140
144
  project_id = await resolve_project_id(project_id=project_id)
141
145
  api_key_id = await resolve_api_key(project_id, api_key_id)
142
146
 
147
+ room = resolve_room(room)
143
148
  jwt = await resolve_token_jwt(project_id=project_id, api_key_id=api_key_id, token_path=token_path, name=name, role=role, room=room)
144
149
 
145
150
  print("[bold green]Connecting to room...[/bold green]")
@@ -14,8 +14,7 @@ from meshagent.cli import async_typer
14
14
  from meshagent.cli.helper import get_client, print_json_table, resolve_project_id, resolve_api_key
15
15
  from meshagent.api import ParticipantToken, RoomClient, WebSocketClientProtocol, websocket_protocol, websocket_room_url, meshagent_base_url
16
16
  # Pydantic basemodels
17
- from meshagent.api.accounts_client import Service, Port
18
- from meshagent.cloud.accounts import Services
17
+ from meshagent.api.accounts_client import Service, Port, Services
19
18
 
20
19
  app = async_typer.AsyncTyper()
21
20
 
@@ -11,6 +11,7 @@ from meshagent.api.room_server_client import StorageClient
11
11
  from meshagent.api.helpers import meshagent_base_url, websocket_room_url
12
12
  from meshagent.cli import async_typer
13
13
  from meshagent.cli.helper import get_client, resolve_project_id, resolve_api_key, resolve_token_jwt
14
+ from meshagent.cli.helper import get_client, resolve_project_id, resolve_api_key, resolve_token_jwt, resolve_room
14
15
 
15
16
  app = async_typer.AsyncTyper()
16
17
 
@@ -63,7 +64,7 @@ async def storage_exists_command(
63
64
  try:
64
65
  project_id = await resolve_project_id(project_id=project_id)
65
66
  api_key_id = await resolve_api_key(project_id, api_key_id)
66
-
67
+ room = resolve_room(room)
67
68
  jwt = await resolve_token_jwt(project_id=project_id, api_key_id=api_key_id, token_path=token_path, name=name, role=role, room=room)
68
69
 
69
70
  print("[bold green]Connecting to room...[/bold green]")
@@ -95,6 +96,8 @@ async def storage_cp_command(
95
96
  source_path: str,
96
97
  dest_path: str
97
98
  ):
99
+ room = resolve_room(room)
100
+
98
101
  try:
99
102
  """
100
103
  Copy files between local and remote storage. Supports globs on the source side.
@@ -310,8 +313,10 @@ async def storage_show_command(
310
313
  """
311
314
  Print the contents of a file (local or remote) to the console.
312
315
  """
316
+ room = resolve_room(room)
317
+
313
318
  scheme, subpath = parse_path(path)
314
-
319
+
315
320
  # If we need a remote connection, set it up:
316
321
  account_client = None
317
322
  client = None
@@ -388,6 +393,7 @@ async def storage_rm_command(
388
393
  - Supports wildcards on the source path (for files).
389
394
  - Fails if trying to remove a directory/folder without --recursive/-r.
390
395
  """
396
+ room = resolve_room(room)
391
397
 
392
398
  try:
393
399
  # We'll mimic the "cp" approach, expanding wildcards for local/remote.
@@ -0,0 +1 @@
1
+ __version__ = "0.0.34"
@@ -8,13 +8,12 @@ from meshagent.api import RoomClient, ParticipantToken, WebSocketClientProtocol,
8
8
  from meshagent.api.helpers import meshagent_base_url, websocket_room_url
9
9
  from meshagent.api.services import send_webhook
10
10
  from meshagent.cli import async_typer
11
- from meshagent.cli.helper import get_client, print_json_table, set_active_project, resolve_project_id
12
- from meshagent.cli.helper import set_active_project, get_active_project, resolve_project_id, resolve_api_key
11
+ from meshagent.cli.helper import get_client, resolve_project_id, resolve_api_key, resolve_token_jwt, resolve_room
13
12
  from meshagent.openai import OpenAIResponsesAdapter
14
13
  from typing import List
15
14
 
16
15
  from meshagent.api import RequiredToolkit, RequiredSchema
17
-
16
+ from meshagent.api.services import ServiceHost
18
17
 
19
18
  try:
20
19
 
@@ -34,7 +33,7 @@ app = async_typer.AsyncTyper()
34
33
  async def make_call(
35
34
  *,
36
35
  project_id: str = None,
37
- room: Annotated[str, typer.Option()],
36
+ room: Annotated[Optional[str], typer.Option()] = None,
38
37
  api_key_id: Annotated[Optional[str], typer.Option()] = None,
39
38
  name: Annotated[str, typer.Option(..., help="Participant name")] = "cli",
40
39
  role: str = "agent",
@@ -44,27 +43,19 @@ async def make_call(
44
43
  schema: Annotated[List[str], typer.Option("--schema", "-s", help="the name or url of a required schema")] = [],
45
44
  auto_greet_message: Annotated[Optional[str], typer.Option()] = None,
46
45
  auto_greet_prompt: Annotated[Optional[str], typer.Option()] = None,
46
+ token_path: Annotated[Optional[str], typer.Option()] = None,
47
47
  ):
48
48
  account_client = await get_client()
49
49
  try:
50
50
  project_id = await resolve_project_id(project_id=project_id)
51
51
  api_key_id = await resolve_api_key(project_id, api_key_id)
52
52
 
53
- key = (await account_client.decrypt_project_api_key(project_id=project_id, id=api_key_id))["token"]
54
-
55
- token = ParticipantToken(
56
- name=name,
57
- project_id=project_id,
58
- api_key_id=api_key_id
59
- )
60
- token.add_role_grant(role=role)
61
- token.add_room_grant(room)
62
-
53
+ room = resolve_room(room)
54
+ jwt = await resolve_token_jwt(project_id=project_id, api_key_id=api_key_id, token_path=token_path, name=name, role=role, room=room)
63
55
 
64
56
  print("[bold green]Connecting to room...[/bold green]")
65
57
  async with RoomClient(
66
- protocol=WebSocketClientProtocol(url=websocket_room_url(room_name=room, base_url=meshagent_base_url()),
67
- token=token.to_jwt(token=key))
58
+ protocol=WebSocketClientProtocol(url=websocket_room_url(room_name=room, base_url=meshagent_base_url()), token=jwt)
68
59
  ) as client:
69
60
 
70
61
  requirements = []
@@ -92,3 +83,45 @@ async def make_call(
92
83
 
93
84
  finally:
94
85
  await account_client.close()
86
+
87
+
88
+ @app.async_command("service")
89
+ async def service(
90
+ *,
91
+ project_id: str = None,
92
+ agent_name: Annotated[str, typer.Option(..., help="Name of the agent to call")],
93
+ rule: Annotated[List[str], typer.Option("--rule", "-r", help="a system rule")] = [],
94
+ toolkit: Annotated[List[str], typer.Option("--toolkit", "-t", help="the name or url of a required toolkit")] = [],
95
+ schema: Annotated[List[str], typer.Option("--schema", "-s", help="the name or url of a required schema")] = [],
96
+ auto_greet_message: Annotated[Optional[str], typer.Option()] = None,
97
+ auto_greet_prompt: Annotated[Optional[str], typer.Option()] = None,
98
+
99
+ host: Annotated[Optional[str], typer.Option()] = None,
100
+ port: Annotated[Optional[int], typer.Option()] = None,
101
+ path: Annotated[str, typer.Option()] = "/agent",
102
+ ):
103
+ requirements = []
104
+
105
+ for t in toolkit:
106
+ requirements.append(RequiredToolkit(name=t))
107
+
108
+ for t in schema:
109
+ requirements.append(RequiredSchema(name=t))
110
+
111
+ service = ServiceHost(
112
+ host=host,
113
+ port=port
114
+ )
115
+
116
+ @service.path(path=path)
117
+ class CustomVoiceBot(VoiceBot):
118
+ def __init__(self):
119
+ super().__init__(
120
+ auto_greet_message=auto_greet_message,
121
+ auto_greet_prompt=auto_greet_prompt,
122
+ name=agent_name,
123
+ requires=requirements,
124
+ rules=rule if len(rule) > 0 else None
125
+ )
126
+
127
+ await service.run()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-cli
3
- Version: 0.0.32
3
+ Version: 0.0.34
4
4
  Summary: CLI for Meshagent
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Documentation, https://docs.meshagent.com
@@ -10,10 +10,10 @@ Requires-Python: >=3.12
10
10
  Description-Content-Type: text/markdown
11
11
  Requires-Dist: typer~=0.15.3
12
12
  Requires-Dist: pydantic-yaml~=1.4.0
13
- Requires-Dist: meshagent-api~=0.0.32
14
- Requires-Dist: meshagent-agents~=0.0.32
15
- Requires-Dist: meshagent-tools~=0.0.32
16
- Requires-Dist: meshagent-mcp~=0.0.32
13
+ Requires-Dist: meshagent-api~=0.0.34
14
+ Requires-Dist: meshagent-agents~=0.0.34
15
+ Requires-Dist: meshagent-tools~=0.0.34
16
+ Requires-Dist: meshagent-mcp~=0.0.34
17
17
  Requires-Dist: supabase~=2.15.1
18
18
  Requires-Dist: fastmcp~=2.8.1
19
19
 
@@ -0,0 +1,8 @@
1
+ typer~=0.15.3
2
+ pydantic-yaml~=1.4.0
3
+ meshagent-api~=0.0.34
4
+ meshagent-agents~=0.0.34
5
+ meshagent-tools~=0.0.34
6
+ meshagent-mcp~=0.0.34
7
+ supabase~=2.15.1
8
+ fastmcp~=2.8.1
@@ -11,10 +11,10 @@ keywords = []
11
11
  dependencies = [
12
12
  "typer~=0.15.3",
13
13
  "pydantic-yaml~=1.4.0",
14
- "meshagent-api~=0.0.32",
15
- "meshagent-agents~=0.0.32",
16
- "meshagent-tools~=0.0.32",
17
- "meshagent-mcp~=0.0.32",
14
+ "meshagent-api~=0.0.34",
15
+ "meshagent-agents~=0.0.34",
16
+ "meshagent-tools~=0.0.34",
17
+ "meshagent-mcp~=0.0.34",
18
18
  "supabase~=2.15.1",
19
19
  "fastmcp~=2.8.1"
20
20
  ]
@@ -1,78 +0,0 @@
1
-
2
- import typer
3
- from rich import print
4
- from typing import Annotated, Optional
5
- import json
6
- import aiohttp
7
- from meshagent.api import RoomClient, ParticipantToken, WebSocketClientProtocol, RoomException
8
- from meshagent.api.helpers import meshagent_base_url, websocket_room_url
9
- from meshagent.api.services import send_webhook
10
- from meshagent.cli import async_typer
11
- from meshagent.cli.helper import get_client, print_json_table, set_active_project, resolve_project_id
12
- from meshagent.cli.helper import set_active_project, get_active_project, resolve_project_id, resolve_api_key
13
- from meshagent.agents.chat import ChatBot
14
- from meshagent.openai import OpenAIResponsesAdapter
15
- from typing import List
16
-
17
- from meshagent.api import RequiredToolkit, RequiredSchema
18
-
19
- app = async_typer.AsyncTyper()
20
-
21
- @app.async_command("join")
22
- async def make_call(
23
- *,
24
- project_id: str = None,
25
- room: Annotated[str, typer.Option()],
26
- api_key_id: Annotated[Optional[str], typer.Option()] = None,
27
- name: Annotated[str, typer.Option(..., help="Participant name")] = "cli",
28
- role: str = "agent",
29
- agent_name: Annotated[str, typer.Option(..., help="Name of the agent to call")],
30
- rule: Annotated[List[str], typer.Option("--rule", "-r", help="a system rule")] = [],
31
- toolkit: Annotated[List[str], typer.Option("--toolkit", "-t", help="the name or url of a required toolkit")] = [],
32
- schema: Annotated[List[str], typer.Option("--schema", "-s", help="the name or url of a required schema")] = []
33
- ):
34
- account_client = await get_client()
35
- try:
36
- project_id = await resolve_project_id(project_id=project_id)
37
- api_key_id = await resolve_api_key(project_id, api_key_id)
38
-
39
- key = (await account_client.decrypt_project_api_key(project_id=project_id, id=api_key_id))["token"]
40
-
41
- token = ParticipantToken(
42
- name=name,
43
- project_id=project_id,
44
- api_key_id=api_key_id
45
- )
46
- token.add_role_grant(role=role)
47
- token.add_room_grant(room)
48
-
49
-
50
- print("[bold green]Connecting to room...[/bold green]")
51
- async with RoomClient(
52
- protocol=WebSocketClientProtocol(url=websocket_room_url(room_name=room, base_url=meshagent_base_url()),
53
- token=token.to_jwt(token=key))
54
- ) as client:
55
-
56
- requirements = []
57
-
58
- for t in toolkit:
59
- requirements.append(RequiredToolkit(name=t))
60
-
61
- for t in schema:
62
- requirements.append(RequiredSchema(name=t))
63
-
64
- bot = ChatBot(
65
- llm_adapter=OpenAIResponsesAdapter(),
66
- name=agent_name,
67
- requires=requirements,
68
- rules=rule if len(rule) > 0 else None
69
- )
70
-
71
- await bot.start(room=client)
72
- try:
73
- await client.protocol.wait_for_close()
74
- except KeyboardInterrupt:
75
- await bot.stop()
76
-
77
- finally:
78
- await account_client.close()
@@ -1 +0,0 @@
1
- __version__ = "0.0.32"
@@ -1,8 +0,0 @@
1
- typer~=0.15.3
2
- pydantic-yaml~=1.4.0
3
- meshagent-api~=0.0.32
4
- meshagent-agents~=0.0.32
5
- meshagent-tools~=0.0.32
6
- meshagent-mcp~=0.0.32
7
- supabase~=2.15.1
8
- fastmcp~=2.8.1
File without changes
File without changes