meshagent-cli 0.21.0__py3-none-any.whl → 0.23.0__py3-none-any.whl
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.
- meshagent/cli/agent.py +8 -2
- meshagent/cli/call.py +15 -28
- meshagent/cli/chatbot.py +580 -76
- meshagent/cli/cli.py +3 -3
- meshagent/cli/helper.py +40 -2
- meshagent/cli/helpers.py +0 -3
- meshagent/cli/host.py +4 -0
- meshagent/cli/mailbot.py +137 -76
- meshagent/cli/meeting_transcriber.py +19 -11
- meshagent/cli/messaging.py +1 -4
- meshagent/cli/multi.py +53 -98
- meshagent/cli/oauth2.py +164 -35
- meshagent/cli/room.py +6 -2
- meshagent/cli/services.py +238 -15
- meshagent/cli/sync.py +434 -0
- meshagent/cli/task_runner.py +625 -78
- meshagent/cli/version.py +1 -1
- meshagent/cli/voicebot.py +54 -34
- meshagent/cli/worker.py +151 -75
- {meshagent_cli-0.21.0.dist-info → meshagent_cli-0.23.0.dist-info}/METADATA +13 -11
- meshagent_cli-0.23.0.dist-info/RECORD +45 -0
- {meshagent_cli-0.21.0.dist-info → meshagent_cli-0.23.0.dist-info}/WHEEL +1 -1
- meshagent_cli-0.21.0.dist-info/RECORD +0 -44
- {meshagent_cli-0.21.0.dist-info → meshagent_cli-0.23.0.dist-info}/entry_points.txt +0 -0
- {meshagent_cli-0.21.0.dist-info → meshagent_cli-0.23.0.dist-info}/top_level.txt +0 -0
meshagent/cli/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.
|
|
1
|
+
__version__ = "0.23.0"
|
meshagent/cli/voicebot.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import typer
|
|
2
|
+
import os
|
|
2
3
|
from rich import print
|
|
3
4
|
from typing import Annotated, Optional
|
|
4
5
|
from meshagent.cli.common_options import ProjectIdOption, RoomOption
|
|
@@ -36,7 +37,6 @@ logger = logging.getLogger("voicebot")
|
|
|
36
37
|
|
|
37
38
|
def build_voicebot(
|
|
38
39
|
*,
|
|
39
|
-
agent_name: str,
|
|
40
40
|
rules: list[str],
|
|
41
41
|
rules_file: Optional[str] = None,
|
|
42
42
|
toolkits: list[str],
|
|
@@ -75,11 +75,18 @@ def build_voicebot(
|
|
|
75
75
|
super().__init__(
|
|
76
76
|
auto_greet_message=auto_greet_message,
|
|
77
77
|
auto_greet_prompt=auto_greet_prompt,
|
|
78
|
-
name=agent_name,
|
|
79
78
|
requires=requirements,
|
|
80
79
|
rules=rules if len(rules) > 0 else None,
|
|
81
80
|
)
|
|
82
81
|
|
|
82
|
+
async def init_chat_context(self):
|
|
83
|
+
from meshagent.cli.helper import init_context_from_spec
|
|
84
|
+
|
|
85
|
+
context = await super().init_chat_context()
|
|
86
|
+
await init_context_from_spec(context)
|
|
87
|
+
|
|
88
|
+
return context
|
|
89
|
+
|
|
83
90
|
async def start(self, *, room: RoomClient):
|
|
84
91
|
await super().start(room=room)
|
|
85
92
|
|
|
@@ -147,11 +154,13 @@ def build_voicebot(
|
|
|
147
154
|
|
|
148
155
|
|
|
149
156
|
@app.async_command("join")
|
|
150
|
-
async def
|
|
157
|
+
async def join(
|
|
151
158
|
*,
|
|
152
159
|
project_id: ProjectIdOption,
|
|
153
160
|
room: RoomOption,
|
|
154
|
-
agent_name: Annotated[
|
|
161
|
+
agent_name: Annotated[
|
|
162
|
+
Optional[str], typer.Option(..., help="Name of the agent to call")
|
|
163
|
+
] = None,
|
|
155
164
|
rule: Annotated[List[str], typer.Option("--rule", "-r", help="a system rule")] = [],
|
|
156
165
|
rules_file: Optional[str] = None,
|
|
157
166
|
require_toolkit: Annotated[
|
|
@@ -206,17 +215,26 @@ async def make_call(
|
|
|
206
215
|
project_id = await resolve_project_id(project_id=project_id)
|
|
207
216
|
room = resolve_room(room)
|
|
208
217
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
218
|
+
jwt = os.getenv("MESHAGENT_TOKEN")
|
|
219
|
+
if jwt is None:
|
|
220
|
+
if agent_name is None:
|
|
221
|
+
print(
|
|
222
|
+
"[bold red]--agent-name must be specified when the MESHAGENT_TOKEN environment variable is not set[/bold red]"
|
|
223
|
+
)
|
|
224
|
+
raise typer.Exit(1)
|
|
212
225
|
|
|
213
|
-
|
|
226
|
+
token = ParticipantToken(
|
|
227
|
+
name=agent_name,
|
|
228
|
+
)
|
|
214
229
|
|
|
215
|
-
|
|
216
|
-
|
|
230
|
+
token.add_api_grant(ApiScope.agent_default())
|
|
231
|
+
|
|
232
|
+
token.add_role_grant(role="agent")
|
|
233
|
+
token.add_room_grant(room)
|
|
234
|
+
|
|
235
|
+
jwt = token.to_jwt(api_key=key)
|
|
217
236
|
|
|
218
237
|
CustomVoiceBot = build_voicebot(
|
|
219
|
-
agent_name=agent_name,
|
|
220
238
|
rules=rule,
|
|
221
239
|
rules_file=rules_file,
|
|
222
240
|
toolkits=require_toolkit + toolkit,
|
|
@@ -226,27 +244,32 @@ async def make_call(
|
|
|
226
244
|
room_rules_paths=room_rules,
|
|
227
245
|
)
|
|
228
246
|
|
|
229
|
-
|
|
247
|
+
bot = CustomVoiceBot()
|
|
230
248
|
|
|
231
249
|
print("[bold green]Connecting to room...[/bold green]", flush=True)
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
url=websocket_room_url(room_name=room, base_url=meshagent_base_url()),
|
|
235
|
-
token=jwt,
|
|
236
|
-
)
|
|
237
|
-
) as client:
|
|
238
|
-
bot = CustomVoiceBot()
|
|
250
|
+
if get_deferred():
|
|
251
|
+
from meshagent.cli.host import agents
|
|
239
252
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
253
|
+
agents.append((bot, jwt))
|
|
254
|
+
else:
|
|
255
|
+
async with RoomClient(
|
|
256
|
+
protocol=WebSocketClientProtocol(
|
|
257
|
+
url=websocket_room_url(
|
|
258
|
+
room_name=room, base_url=meshagent_base_url()
|
|
259
|
+
),
|
|
260
|
+
token=jwt,
|
|
246
261
|
)
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
262
|
+
) as client:
|
|
263
|
+
await bot.start(room=client)
|
|
264
|
+
|
|
265
|
+
try:
|
|
266
|
+
print(
|
|
267
|
+
f"[bold green]Open the studio to interact with your agent: {meshagent_base_url().replace('api.', 'studio.')}/projects/{project_id}/rooms/{client.room_name}[/bold green]",
|
|
268
|
+
flush=True,
|
|
269
|
+
)
|
|
270
|
+
await client.protocol.wait_for_close()
|
|
271
|
+
except KeyboardInterrupt:
|
|
272
|
+
await bot.stop()
|
|
250
273
|
|
|
251
274
|
finally:
|
|
252
275
|
await account_client.close()
|
|
@@ -309,7 +332,6 @@ async def service(
|
|
|
309
332
|
] = [],
|
|
310
333
|
):
|
|
311
334
|
CustomVoiceBot = build_voicebot(
|
|
312
|
-
agent_name=agent_name,
|
|
313
335
|
rules=rule,
|
|
314
336
|
rules_file=rules_file,
|
|
315
337
|
toolkits=require_toolkit + toolkit,
|
|
@@ -322,7 +344,7 @@ async def service(
|
|
|
322
344
|
service = get_service(host=host, port=port)
|
|
323
345
|
|
|
324
346
|
service.agents.append(
|
|
325
|
-
AgentSpec(name=agent_name, annotations={ANNOTATION_AGENT_TYPE: "
|
|
347
|
+
AgentSpec(name=agent_name, annotations={ANNOTATION_AGENT_TYPE: "VoiceBot"})
|
|
326
348
|
)
|
|
327
349
|
|
|
328
350
|
if path is None:
|
|
@@ -403,7 +425,6 @@ async def spec(
|
|
|
403
425
|
] = [],
|
|
404
426
|
):
|
|
405
427
|
CustomVoiceBot = build_voicebot(
|
|
406
|
-
agent_name=agent_name,
|
|
407
428
|
rules=rule,
|
|
408
429
|
rules_file=rules_file,
|
|
409
430
|
toolkits=require_toolkit + toolkit,
|
|
@@ -416,7 +437,7 @@ async def spec(
|
|
|
416
437
|
service = get_service(host=host, port=port)
|
|
417
438
|
|
|
418
439
|
service.agents.append(
|
|
419
|
-
AgentSpec(name=agent_name, annotations={ANNOTATION_AGENT_TYPE: "
|
|
440
|
+
AgentSpec(name=agent_name, annotations={ANNOTATION_AGENT_TYPE: "VoiceBot"})
|
|
420
441
|
)
|
|
421
442
|
|
|
422
443
|
if path is None:
|
|
@@ -516,7 +537,6 @@ async def deploy(
|
|
|
516
537
|
project_id = await resolve_project_id(project_id=project_id)
|
|
517
538
|
|
|
518
539
|
CustomVoiceBot = build_voicebot(
|
|
519
|
-
agent_name=agent_name,
|
|
520
540
|
rules=rule,
|
|
521
541
|
rules_file=rules_file,
|
|
522
542
|
toolkits=require_toolkit + toolkit,
|
|
@@ -529,7 +549,7 @@ async def deploy(
|
|
|
529
549
|
service = get_service(host=host, port=port)
|
|
530
550
|
|
|
531
551
|
service.agents.append(
|
|
532
|
-
AgentSpec(name=agent_name, annotations={ANNOTATION_AGENT_TYPE: "
|
|
552
|
+
AgentSpec(name=agent_name, annotations={ANNOTATION_AGENT_TYPE: "VoiceBot"})
|
|
533
553
|
)
|
|
534
554
|
|
|
535
555
|
if path is None:
|
meshagent/cli/worker.py
CHANGED
|
@@ -3,6 +3,7 @@ from rich import print
|
|
|
3
3
|
from typing import Annotated, Optional, List, Type
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
import logging
|
|
6
|
+
import os
|
|
6
7
|
|
|
7
8
|
from meshagent.tools.storage import StorageToolkitBuilder
|
|
8
9
|
|
|
@@ -35,6 +36,7 @@ from meshagent.tools.database import DatabaseToolkitBuilder, DatabaseToolkitConf
|
|
|
35
36
|
from meshagent.tools.datetime import DatetimeToolkit
|
|
36
37
|
from meshagent.tools.uuid import UUIDToolkit
|
|
37
38
|
from meshagent.openai import OpenAIResponsesAdapter
|
|
39
|
+
from meshagent.anthropic import AnthropicOpenAIResponsesStreamAdapter
|
|
38
40
|
|
|
39
41
|
|
|
40
42
|
# Your Worker base (the one you pasted) + adapters
|
|
@@ -76,7 +78,6 @@ def build_worker(
|
|
|
76
78
|
*,
|
|
77
79
|
WorkerBase: Type[Worker],
|
|
78
80
|
model: str,
|
|
79
|
-
agent_name: str,
|
|
80
81
|
rule: List[str],
|
|
81
82
|
toolkit: List[str],
|
|
82
83
|
schema: List[str],
|
|
@@ -112,7 +113,9 @@ def build_worker(
|
|
|
112
113
|
toolkit_name: Optional[str] = None,
|
|
113
114
|
skill_dirs: Optional[list[str]] = None,
|
|
114
115
|
shell_image: Optional[str] = None,
|
|
116
|
+
delegate_shell_token: Optional[bool] = None,
|
|
115
117
|
log_llm_requests: Optional[bool] = None,
|
|
118
|
+
prompt: Optional[str] = None,
|
|
116
119
|
):
|
|
117
120
|
"""
|
|
118
121
|
Returns a Worker subclass
|
|
@@ -149,21 +152,26 @@ def build_worker(
|
|
|
149
152
|
log_requests=log_llm_requests,
|
|
150
153
|
)
|
|
151
154
|
else:
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
155
|
+
if model.startswith("claude-"):
|
|
156
|
+
llm_adapter = AnthropicOpenAIResponsesStreamAdapter(
|
|
157
|
+
model=model,
|
|
158
|
+
log_requests=log_llm_requests,
|
|
159
|
+
)
|
|
160
|
+
else:
|
|
161
|
+
llm_adapter = OpenAIResponsesAdapter(
|
|
162
|
+
model=model,
|
|
163
|
+
log_requests=log_llm_requests,
|
|
164
|
+
)
|
|
156
165
|
|
|
157
166
|
class CustomWorker(WorkerBase):
|
|
158
167
|
def __init__(self):
|
|
159
168
|
super().__init__(
|
|
160
169
|
llm_adapter=llm_adapter,
|
|
161
170
|
tool_adapter=tool_adapter,
|
|
162
|
-
name=agent_name,
|
|
163
171
|
requires=requirements,
|
|
164
172
|
toolkits=toolkits,
|
|
165
173
|
queue=queue,
|
|
166
|
-
title=title
|
|
174
|
+
title=title,
|
|
167
175
|
description=description,
|
|
168
176
|
rules=rule if len(rule) > 0 else None,
|
|
169
177
|
toolkit_name=toolkit_name,
|
|
@@ -171,6 +179,17 @@ def build_worker(
|
|
|
171
179
|
)
|
|
172
180
|
self._room_rules_paths = room_rules_paths or []
|
|
173
181
|
|
|
182
|
+
def get_prompt_for_message(self, *, message: dict) -> str:
|
|
183
|
+
return prompt or super().get_prompt_for_message(message=message)
|
|
184
|
+
|
|
185
|
+
async def init_chat_context(self):
|
|
186
|
+
from meshagent.cli.helper import init_context_from_spec
|
|
187
|
+
|
|
188
|
+
context = await super().init_chat_context()
|
|
189
|
+
await init_context_from_spec(context)
|
|
190
|
+
|
|
191
|
+
return context
|
|
192
|
+
|
|
174
193
|
async def start(self, *, room: RoomClient):
|
|
175
194
|
print(
|
|
176
195
|
"[bold green]Worker connected. It will consume queue messages.[/bold green]"
|
|
@@ -263,12 +282,17 @@ def build_worker(
|
|
|
263
282
|
if require_local_shell:
|
|
264
283
|
thread_toolkit.tools.append(LocalShellTool())
|
|
265
284
|
|
|
285
|
+
env = {}
|
|
286
|
+
if delegate_shell_token:
|
|
287
|
+
env["MESHAGENT_TOKEN"] = self.room.protocol.token
|
|
288
|
+
|
|
266
289
|
if require_shell:
|
|
267
290
|
thread_toolkit.tools.append(
|
|
268
291
|
ShellTool(
|
|
269
292
|
working_directory=working_directory,
|
|
270
293
|
config=ShellConfig(name="shell"),
|
|
271
294
|
image=shell_image or "python:3.13",
|
|
295
|
+
env=env,
|
|
272
296
|
)
|
|
273
297
|
)
|
|
274
298
|
|
|
@@ -351,7 +375,9 @@ async def join(
|
|
|
351
375
|
project_id: ProjectIdOption,
|
|
352
376
|
room: RoomOption,
|
|
353
377
|
role: str = "agent",
|
|
354
|
-
agent_name: Annotated[
|
|
378
|
+
agent_name: Annotated[
|
|
379
|
+
Optional[str], typer.Option(..., help="Name of the worker agent")
|
|
380
|
+
] = None,
|
|
355
381
|
rule: Annotated[List[str], typer.Option("--rule", "-r", help="a system rule")] = [],
|
|
356
382
|
rules_file: Optional[str] = None,
|
|
357
383
|
require_toolkit: Annotated[
|
|
@@ -492,10 +518,18 @@ async def join(
|
|
|
492
518
|
Optional[str],
|
|
493
519
|
typer.Option(..., help="an image tag to use to run shell commands in"),
|
|
494
520
|
] = None,
|
|
521
|
+
delegate_shell_token: Annotated[
|
|
522
|
+
Optional[bool],
|
|
523
|
+
typer.Option(..., help="Delegate the room token to shell tools"),
|
|
524
|
+
] = False,
|
|
495
525
|
log_llm_requests: Annotated[
|
|
496
526
|
Optional[bool],
|
|
497
527
|
typer.Option(..., help="log all requests to the llm"),
|
|
498
528
|
] = False,
|
|
529
|
+
prompt: Annotated[
|
|
530
|
+
Optional[str],
|
|
531
|
+
typer.Option(..., help="a prompt to use for the worker"),
|
|
532
|
+
] = None,
|
|
499
533
|
):
|
|
500
534
|
key = await resolve_key(project_id=project_id, key=key)
|
|
501
535
|
|
|
@@ -504,71 +538,86 @@ async def join(
|
|
|
504
538
|
project_id = await resolve_project_id(project_id=project_id)
|
|
505
539
|
room_name = resolve_room(room)
|
|
506
540
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
541
|
+
jwt = os.getenv("MESHAGENT_TOKEN")
|
|
542
|
+
if jwt is None:
|
|
543
|
+
if agent_name is None:
|
|
544
|
+
print(
|
|
545
|
+
"[bold red]--agent-name must be specified when the MESHAGENT_TOKEN environment variable is not set[/bold red]"
|
|
546
|
+
)
|
|
547
|
+
raise typer.Exit(1)
|
|
548
|
+
|
|
549
|
+
token = ParticipantToken(name=agent_name)
|
|
550
|
+
token.add_api_grant(ApiScope.agent_default(tunnels=require_computer_use))
|
|
551
|
+
token.add_role_grant(role=role)
|
|
552
|
+
token.add_room_grant(room_name)
|
|
511
553
|
|
|
512
|
-
|
|
554
|
+
jwt = token.to_jwt(api_key=key)
|
|
513
555
|
|
|
514
556
|
print("[bold green]Connecting to room...[/bold green]", flush=True)
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
),
|
|
520
|
-
token=jwt,
|
|
521
|
-
)
|
|
522
|
-
) as client:
|
|
523
|
-
# Plug in your specific worker implementation here:
|
|
524
|
-
# from meshagent.agents.some_worker import SomeWorker
|
|
525
|
-
# WorkerBase = SomeWorker
|
|
526
|
-
from meshagent.agents.worker import Worker as WorkerBase # default; replace
|
|
527
|
-
|
|
528
|
-
CustomWorker = build_worker(
|
|
529
|
-
WorkerBase=WorkerBase,
|
|
530
|
-
model=model,
|
|
531
|
-
agent_name=agent_name,
|
|
532
|
-
rule=rule,
|
|
533
|
-
toolkit=require_toolkit + toolkit,
|
|
534
|
-
schema=require_schema + schema,
|
|
535
|
-
rules_file=rules_file,
|
|
536
|
-
room_rules_paths=room_rules,
|
|
537
|
-
queue=queue,
|
|
538
|
-
local_shell=local_shell,
|
|
539
|
-
shell=shell,
|
|
540
|
-
apply_patch=apply_patch,
|
|
541
|
-
image_generation=image_generation,
|
|
542
|
-
web_search=web_search,
|
|
543
|
-
mcp=mcp,
|
|
544
|
-
storage=storage,
|
|
545
|
-
require_local_shell=require_local_shell,
|
|
546
|
-
require_web_search=require_web_search,
|
|
547
|
-
require_shell=require_shell,
|
|
548
|
-
require_apply_patch=require_apply_patch,
|
|
549
|
-
toolkit_name=toolkit_name,
|
|
550
|
-
require_storage=require_storage,
|
|
551
|
-
require_read_only_storage=require_read_only_storage,
|
|
552
|
-
require_time=require_time,
|
|
553
|
-
require_uuid=require_uuid,
|
|
554
|
-
require_table_read=require_table_read,
|
|
555
|
-
require_table_write=require_table_write,
|
|
556
|
-
require_computer_use=require_computer_use,
|
|
557
|
-
database_namespace=[database_namespace] if database_namespace else None,
|
|
558
|
-
title=title,
|
|
559
|
-
description=description,
|
|
560
|
-
working_directory=working_directory,
|
|
561
|
-
skill_dirs=skill_dir,
|
|
562
|
-
shell_image=shell_image,
|
|
563
|
-
log_llm_requests=log_llm_requests,
|
|
564
|
-
)
|
|
557
|
+
# Plug in your specific worker implementation here:
|
|
558
|
+
# from meshagent.agents.some_worker import SomeWorker
|
|
559
|
+
# WorkerBase = SomeWorker
|
|
560
|
+
from meshagent.agents.worker import Worker as WorkerBase # default; replace
|
|
565
561
|
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
562
|
+
CustomWorker = build_worker(
|
|
563
|
+
WorkerBase=WorkerBase,
|
|
564
|
+
model=model,
|
|
565
|
+
rule=rule,
|
|
566
|
+
toolkit=require_toolkit + toolkit,
|
|
567
|
+
schema=require_schema + schema,
|
|
568
|
+
rules_file=rules_file,
|
|
569
|
+
room_rules_paths=room_rules,
|
|
570
|
+
queue=queue,
|
|
571
|
+
local_shell=local_shell,
|
|
572
|
+
shell=shell,
|
|
573
|
+
apply_patch=apply_patch,
|
|
574
|
+
image_generation=image_generation,
|
|
575
|
+
web_search=web_search,
|
|
576
|
+
mcp=mcp,
|
|
577
|
+
storage=storage,
|
|
578
|
+
require_local_shell=require_local_shell,
|
|
579
|
+
require_web_search=require_web_search,
|
|
580
|
+
require_shell=require_shell,
|
|
581
|
+
require_apply_patch=require_apply_patch,
|
|
582
|
+
toolkit_name=toolkit_name,
|
|
583
|
+
require_storage=require_storage,
|
|
584
|
+
require_read_only_storage=require_read_only_storage,
|
|
585
|
+
require_time=require_time,
|
|
586
|
+
require_uuid=require_uuid,
|
|
587
|
+
require_table_read=require_table_read,
|
|
588
|
+
require_table_write=require_table_write,
|
|
589
|
+
require_computer_use=require_computer_use,
|
|
590
|
+
database_namespace=[database_namespace] if database_namespace else None,
|
|
591
|
+
title=title,
|
|
592
|
+
description=description,
|
|
593
|
+
working_directory=working_directory,
|
|
594
|
+
skill_dirs=skill_dir,
|
|
595
|
+
shell_image=shell_image,
|
|
596
|
+
delegate_shell_token=delegate_shell_token,
|
|
597
|
+
log_llm_requests=log_llm_requests,
|
|
598
|
+
prompt=prompt,
|
|
599
|
+
)
|
|
600
|
+
|
|
601
|
+
worker = CustomWorker()
|
|
602
|
+
|
|
603
|
+
if get_deferred():
|
|
604
|
+
from meshagent.cli.host import agents
|
|
605
|
+
|
|
606
|
+
agents.append((worker, jwt))
|
|
607
|
+
else:
|
|
608
|
+
async with RoomClient(
|
|
609
|
+
protocol=WebSocketClientProtocol(
|
|
610
|
+
url=websocket_room_url(
|
|
611
|
+
room_name=room_name, base_url=meshagent_base_url()
|
|
612
|
+
),
|
|
613
|
+
token=jwt,
|
|
614
|
+
)
|
|
615
|
+
) as client:
|
|
616
|
+
await worker.start(room=client)
|
|
617
|
+
try:
|
|
618
|
+
await client.protocol.wait_for_close()
|
|
619
|
+
except KeyboardInterrupt:
|
|
620
|
+
await worker.stop()
|
|
572
621
|
|
|
573
622
|
finally:
|
|
574
623
|
await account_client.close()
|
|
@@ -724,10 +773,18 @@ async def service(
|
|
|
724
773
|
Optional[str],
|
|
725
774
|
typer.Option(..., help="an image tag to use to run shell commands in"),
|
|
726
775
|
] = None,
|
|
776
|
+
delegate_shell_token: Annotated[
|
|
777
|
+
Optional[bool],
|
|
778
|
+
typer.Option(..., help="Delegate the room token to shell tools"),
|
|
779
|
+
] = False,
|
|
727
780
|
log_llm_requests: Annotated[
|
|
728
781
|
Optional[bool],
|
|
729
782
|
typer.Option(..., help="log all requests to the llm"),
|
|
730
783
|
] = False,
|
|
784
|
+
prompt: Annotated[
|
|
785
|
+
Optional[str],
|
|
786
|
+
typer.Option(..., help="a prompt to use for the worker"),
|
|
787
|
+
] = None,
|
|
731
788
|
):
|
|
732
789
|
service = get_service(host=host, port=port)
|
|
733
790
|
|
|
@@ -744,7 +801,7 @@ async def service(
|
|
|
744
801
|
) # replace with your concrete worker class
|
|
745
802
|
|
|
746
803
|
service.agents.append(
|
|
747
|
-
AgentSpec(name=agent_name, annotations={ANNOTATION_AGENT_TYPE: "
|
|
804
|
+
AgentSpec(name=agent_name, annotations={ANNOTATION_AGENT_TYPE: "Worker"})
|
|
748
805
|
)
|
|
749
806
|
|
|
750
807
|
service.add_path(
|
|
@@ -753,7 +810,6 @@ async def service(
|
|
|
753
810
|
cls=build_worker(
|
|
754
811
|
WorkerBase=WorkerBase,
|
|
755
812
|
model=model,
|
|
756
|
-
agent_name=agent_name,
|
|
757
813
|
rule=rule,
|
|
758
814
|
toolkit=require_toolkit + toolkit,
|
|
759
815
|
schema=require_schema + schema,
|
|
@@ -785,7 +841,9 @@ async def service(
|
|
|
785
841
|
working_directory=working_directory,
|
|
786
842
|
skill_dirs=skill_dir,
|
|
787
843
|
shell_image=shell_image,
|
|
844
|
+
delegate_shell_token=delegate_shell_token,
|
|
788
845
|
log_llm_requests=log_llm_requests,
|
|
846
|
+
prompt=prompt,
|
|
789
847
|
),
|
|
790
848
|
)
|
|
791
849
|
|
|
@@ -951,10 +1009,18 @@ async def spec(
|
|
|
951
1009
|
Optional[str],
|
|
952
1010
|
typer.Option(..., help="an image tag to use to run shell commands in"),
|
|
953
1011
|
] = None,
|
|
1012
|
+
delegate_shell_token: Annotated[
|
|
1013
|
+
Optional[bool],
|
|
1014
|
+
typer.Option(..., help="Delegate the room token to shell tools"),
|
|
1015
|
+
] = False,
|
|
954
1016
|
log_llm_requests: Annotated[
|
|
955
1017
|
Optional[bool],
|
|
956
1018
|
typer.Option(..., help="log all requests to the llm"),
|
|
957
1019
|
] = False,
|
|
1020
|
+
prompt: Annotated[
|
|
1021
|
+
Optional[str],
|
|
1022
|
+
typer.Option(..., help="a prompt to use for the worker"),
|
|
1023
|
+
] = None,
|
|
958
1024
|
):
|
|
959
1025
|
service = get_service(host=host, port=port)
|
|
960
1026
|
|
|
@@ -971,7 +1037,7 @@ async def spec(
|
|
|
971
1037
|
) # replace with your concrete worker class
|
|
972
1038
|
|
|
973
1039
|
service.agents.append(
|
|
974
|
-
AgentSpec(name=agent_name, annotations={ANNOTATION_AGENT_TYPE: "
|
|
1040
|
+
AgentSpec(name=agent_name, annotations={ANNOTATION_AGENT_TYPE: "Worker"})
|
|
975
1041
|
)
|
|
976
1042
|
|
|
977
1043
|
service.add_path(
|
|
@@ -980,7 +1046,6 @@ async def spec(
|
|
|
980
1046
|
cls=build_worker(
|
|
981
1047
|
WorkerBase=WorkerBase,
|
|
982
1048
|
model=model,
|
|
983
|
-
agent_name=agent_name,
|
|
984
1049
|
rule=rule,
|
|
985
1050
|
toolkit=require_toolkit + toolkit,
|
|
986
1051
|
schema=require_schema + schema,
|
|
@@ -1012,7 +1077,9 @@ async def spec(
|
|
|
1012
1077
|
working_directory=working_directory,
|
|
1013
1078
|
skill_dirs=skill_dir,
|
|
1014
1079
|
shell_image=shell_image,
|
|
1080
|
+
delegate_shell_token=delegate_shell_token,
|
|
1015
1081
|
log_llm_requests=log_llm_requests,
|
|
1082
|
+
prompt=prompt,
|
|
1016
1083
|
),
|
|
1017
1084
|
)
|
|
1018
1085
|
|
|
@@ -1191,10 +1258,18 @@ async def deploy(
|
|
|
1191
1258
|
Optional[str],
|
|
1192
1259
|
typer.Option(..., help="an image tag to use to run shell commands in"),
|
|
1193
1260
|
] = None,
|
|
1261
|
+
delegate_shell_token: Annotated[
|
|
1262
|
+
Optional[bool],
|
|
1263
|
+
typer.Option(..., help="Delegate the room token to shell tools"),
|
|
1264
|
+
] = False,
|
|
1194
1265
|
log_llm_requests: Annotated[
|
|
1195
1266
|
Optional[bool],
|
|
1196
1267
|
typer.Option(..., help="log all requests to the llm"),
|
|
1197
1268
|
] = False,
|
|
1269
|
+
prompt: Annotated[
|
|
1270
|
+
Optional[str],
|
|
1271
|
+
typer.Option(..., help="a prompt to use for the worker"),
|
|
1272
|
+
] = None,
|
|
1198
1273
|
project_id: ProjectIdOption,
|
|
1199
1274
|
room: Annotated[
|
|
1200
1275
|
Optional[str],
|
|
@@ -1218,7 +1293,7 @@ async def deploy(
|
|
|
1218
1293
|
) # replace with your concrete worker class
|
|
1219
1294
|
|
|
1220
1295
|
service.agents.append(
|
|
1221
|
-
AgentSpec(name=agent_name, annotations={ANNOTATION_AGENT_TYPE: "
|
|
1296
|
+
AgentSpec(name=agent_name, annotations={ANNOTATION_AGENT_TYPE: "Worker"})
|
|
1222
1297
|
)
|
|
1223
1298
|
|
|
1224
1299
|
service.add_path(
|
|
@@ -1227,7 +1302,6 @@ async def deploy(
|
|
|
1227
1302
|
cls=build_worker(
|
|
1228
1303
|
WorkerBase=WorkerBase,
|
|
1229
1304
|
model=model,
|
|
1230
|
-
agent_name=agent_name,
|
|
1231
1305
|
rule=rule,
|
|
1232
1306
|
toolkit=require_toolkit + toolkit,
|
|
1233
1307
|
schema=require_schema + schema,
|
|
@@ -1259,7 +1333,9 @@ async def deploy(
|
|
|
1259
1333
|
working_directory=working_directory,
|
|
1260
1334
|
skill_dirs=skill_dir,
|
|
1261
1335
|
shell_image=shell_image,
|
|
1336
|
+
delegate_shell_token=delegate_shell_token,
|
|
1262
1337
|
log_llm_requests=log_llm_requests,
|
|
1338
|
+
prompt=prompt,
|
|
1263
1339
|
),
|
|
1264
1340
|
)
|
|
1265
1341
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meshagent-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.23.0
|
|
4
4
|
Summary: CLI for Meshagent
|
|
5
5
|
License-Expression: Apache-2.0
|
|
6
6
|
Project-URL: Documentation, https://docs.meshagent.com
|
|
@@ -16,18 +16,20 @@ Requires-Dist: art~=6.5
|
|
|
16
16
|
Requires-Dist: pydantic-yaml~=1.5
|
|
17
17
|
Requires-Dist: pathspec~=0.12.1
|
|
18
18
|
Provides-Extra: all
|
|
19
|
-
Requires-Dist: meshagent-agents[all]~=0.
|
|
20
|
-
Requires-Dist: meshagent-api[all]~=0.
|
|
21
|
-
Requires-Dist: meshagent-computers~=0.
|
|
22
|
-
Requires-Dist: meshagent-openai~=0.
|
|
23
|
-
Requires-Dist: meshagent-
|
|
24
|
-
Requires-Dist: meshagent-
|
|
19
|
+
Requires-Dist: meshagent-agents[all]~=0.23.0; extra == "all"
|
|
20
|
+
Requires-Dist: meshagent-api[all]~=0.23.0; extra == "all"
|
|
21
|
+
Requires-Dist: meshagent-computers~=0.23.0; extra == "all"
|
|
22
|
+
Requires-Dist: meshagent-openai~=0.23.0; extra == "all"
|
|
23
|
+
Requires-Dist: meshagent-anthropic~=0.23.0; extra == "all"
|
|
24
|
+
Requires-Dist: meshagent-mcp~=0.23.0; extra == "all"
|
|
25
|
+
Requires-Dist: meshagent-tools~=0.23.0; extra == "all"
|
|
25
26
|
Requires-Dist: supabase-auth~=2.22.3; extra == "all"
|
|
27
|
+
Requires-Dist: prompt-toolkit~=3.0.52; extra == "all"
|
|
26
28
|
Provides-Extra: mcp-service
|
|
27
|
-
Requires-Dist: meshagent-agents[all]~=0.
|
|
28
|
-
Requires-Dist: meshagent-api~=0.
|
|
29
|
-
Requires-Dist: meshagent-mcp~=0.
|
|
30
|
-
Requires-Dist: meshagent-tools~=0.
|
|
29
|
+
Requires-Dist: meshagent-agents[all]~=0.23.0; extra == "mcp-service"
|
|
30
|
+
Requires-Dist: meshagent-api~=0.23.0; extra == "mcp-service"
|
|
31
|
+
Requires-Dist: meshagent-mcp~=0.23.0; extra == "mcp-service"
|
|
32
|
+
Requires-Dist: meshagent-tools~=0.23.0; extra == "mcp-service"
|
|
31
33
|
Requires-Dist: supabase-auth~=2.22.3; extra == "mcp-service"
|
|
32
34
|
|
|
33
35
|
# [Meshagent](https://www.meshagent.com)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
meshagent/cli/__init__.py,sha256=X78Z4yEg5XfkNKH0HiIdG4k1q5ktB-ampTuXHLNFrAw,58
|
|
2
|
+
meshagent/cli/agent.py,sha256=z0KHcTTn04XshbwXO79g0NBT1PG8TospofBtw-Ggsv4,9478
|
|
3
|
+
meshagent/cli/api_keys.py,sha256=5H5bWRqunCZ66EpQjxf4raW3KJXvAzqQZubaZ3O289A,3164
|
|
4
|
+
meshagent/cli/async_typer.py,sha256=r5oi1m_CuloQ6gAJNZ3RvBuKdGNR3uzrYMAEh602JDI,2290
|
|
5
|
+
meshagent/cli/auth.py,sha256=wpGTomrFH0uvbwv262sTqK0DgB4ltAuurEmI9tYedIs,815
|
|
6
|
+
meshagent/cli/auth_async.py,sha256=Ce0h_V3tNlZBvplQuhy2uRP9PJvhi6k_vUGh3GMNL-E,9277
|
|
7
|
+
meshagent/cli/call.py,sha256=vn6sDWfSIwNohbvzbxDlXUckvTI31f_XOdsIQh1yH8I,7094
|
|
8
|
+
meshagent/cli/chatbot.py,sha256=ARiMZ9qlaJqAcR-_GLSbXhWRdVCBrkv8W0SX3BkFJKg,66513
|
|
9
|
+
meshagent/cli/cli.py,sha256=0r2IZr1Z_I8u_NxU6KKOx1PO2i2eReb1dLU9BrxGhbc,5500
|
|
10
|
+
meshagent/cli/cli_mcp.py,sha256=yQYTUoF78Wp393Cdb9Xl4RO41bANNGSfgm4WvDBLFS0,13235
|
|
11
|
+
meshagent/cli/cli_secrets.py,sha256=xRbt-vvfSce5khCkJQrq33lgiJrgZ6CWatUwTAOBxf4,13643
|
|
12
|
+
meshagent/cli/common_options.py,sha256=eJaSYDJnwlr34VsFS9UgnGV0VUIpQow8U7niMnkQ3sw,1054
|
|
13
|
+
meshagent/cli/containers.py,sha256=KTILHaL08hzrNe97HUY2x_l5gwqKEXyfqwUn62_OCGQ,21973
|
|
14
|
+
meshagent/cli/database.py,sha256=OZOm56Q2d9PJUqwg3XXFAV-a8o3J-tbi35UreCOI6KM,33226
|
|
15
|
+
meshagent/cli/developer.py,sha256=cF9LYnD43-_BCirPp9r_C7Sp7AWLUVNfEnxK8Gpuqs8,2323
|
|
16
|
+
meshagent/cli/exec.py,sha256=j_GYVvScC-RXUwVF3PLqjjdB6YINi4lFvXLqBFcLdZ0,16161
|
|
17
|
+
meshagent/cli/helper.py,sha256=qpvRAoW6x5r0QuTq11SJNYkgYSwq3rxpUxyNu4HGtYk,6829
|
|
18
|
+
meshagent/cli/helpers.py,sha256=RfsWUa1Z_k9DHjHloOyNnR5vHuu9jjHV7CpqONDxfwU,6912
|
|
19
|
+
meshagent/cli/host.py,sha256=8MXCuK-59HFwwUSMJoSo7L3AbaB0CL4xJkckUjHnIAI,845
|
|
20
|
+
meshagent/cli/mailbot.py,sha256=wlYcrAj757cPn7YqwUAtOoHBgMhaG35xuXfQ6QN5u4w,43397
|
|
21
|
+
meshagent/cli/mailboxes.py,sha256=V2QhRAZDR53fIKHEPwwu8jGlcNg-qZiO3d1K45YWV_Y,6411
|
|
22
|
+
meshagent/cli/meeting_transcriber.py,sha256=5tQzkw-IfLYcqybKOpeXc0ZxqA7uC6krhKLVHTPch8Y,4290
|
|
23
|
+
meshagent/cli/messaging.py,sha256=6gaKunkqM4DNr4lsIYHovfpV-taEvm6mRB1aeSIsy44,5296
|
|
24
|
+
meshagent/cli/multi.py,sha256=yDRkwhIVQG_SmWP8aXLkUa--Uz6syqmudVLVvsPytP8,11021
|
|
25
|
+
meshagent/cli/oauth2.py,sha256=Kvp2vcVKzT9Ueu51EGswWbPRIjO206J4W__hkCLWcYY,10479
|
|
26
|
+
meshagent/cli/participant_token.py,sha256=jzZdtN6v3RB3QVEGdYZG7ZP2egxb3vlLwtC0KkUVMqE,1938
|
|
27
|
+
meshagent/cli/port.py,sha256=uF_4pY8TSHSVYr00rMW97s-OIehNVUwNGv8fgMT8uLc,1646
|
|
28
|
+
meshagent/cli/projects.py,sha256=-s5xIfd2pCW8HsuqRsNoKZr5hsF6xYxfEjyYI6Nm4YI,3511
|
|
29
|
+
meshagent/cli/queue.py,sha256=KEc5w7uJnkjsTWEuEDctj51R-IY7BdFQrl5WeHQSgPk,2923
|
|
30
|
+
meshagent/cli/room.py,sha256=_xLn0jAXzflfavcjxcrH1swMc9GUbMGEatEzcu7ESVc,1107
|
|
31
|
+
meshagent/cli/rooms.py,sha256=KT90102OlywgFKMzOAPZtMw0aIw2eZILp_enJIpfKLc,6487
|
|
32
|
+
meshagent/cli/services.py,sha256=b4DhrKEo8RKvxm3q6b9G7G9OY1RkZnFzBgb76ped3TQ,22661
|
|
33
|
+
meshagent/cli/sessions.py,sha256=iWQKqwCMOT5u6sOwWsVPQrci-0bqytp3mCujL9Nv5PA,971
|
|
34
|
+
meshagent/cli/storage.py,sha256=Rwuh1HcUePuyxsbDQ3RnYKec2vdmvIqNH0AD0zlq36U,32506
|
|
35
|
+
meshagent/cli/sync.py,sha256=9KV-FrXAclpgcDpGLVSSXPiNJ0o2OAmaNh0KV3JokEA,15667
|
|
36
|
+
meshagent/cli/task_runner.py,sha256=T_TJUZHWmHSG4mHED06XefATXFyyfHdEh7B2GT5KRuE,46436
|
|
37
|
+
meshagent/cli/version.py,sha256=6bYcjtcATvc99ZNMjTUfPlrJP3-1WenVEc656roVn_I,23
|
|
38
|
+
meshagent/cli/voicebot.py,sha256=PwdZXolEgXoR2NEcFFQGEi5DgB9wnh4eVjvXEidPBAc,20239
|
|
39
|
+
meshagent/cli/webhook.py,sha256=ZxwayUS6XlrFM61YUWkh5QyFKPp4CBVw_E2-3H6VrNQ,3052
|
|
40
|
+
meshagent/cli/worker.py,sha256=0wBmh_qE5Sy-dYAlrosk13CsXft3i-oEYf5WENebAFM,47635
|
|
41
|
+
meshagent_cli-0.23.0.dist-info/METADATA,sha256=sRj8oav9TVSy-d2u1NhUMQXDyXnGpssPFrt8xJ1s-yQ,2100
|
|
42
|
+
meshagent_cli-0.23.0.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
43
|
+
meshagent_cli-0.23.0.dist-info/entry_points.txt,sha256=WRcGGN4vMtvC5Pgl3uRFqsJiQXNoHuLLa-TCSY3gAhQ,52
|
|
44
|
+
meshagent_cli-0.23.0.dist-info/top_level.txt,sha256=GlcXnHtRP6m7zlG3Df04M35OsHtNXy_DY09oFwWrH74,10
|
|
45
|
+
meshagent_cli-0.23.0.dist-info/RECORD,,
|