meshagent-cli 0.5.15__py3-none-any.whl → 0.6.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.

Potentially problematic release.


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

meshagent/cli/storage.py CHANGED
@@ -1,6 +1,6 @@
1
1
  import typer
2
2
  from typing import Annotated, Optional
3
- from meshagent.cli.common_options import ProjectIdOption, ApiKeyIdOption, RoomOption
3
+ from meshagent.cli.common_options import ProjectIdOption, RoomOption
4
4
  from rich import print
5
5
  import os
6
6
  import fnmatch
@@ -14,8 +14,6 @@ from meshagent.cli import async_typer
14
14
  from meshagent.cli.helper import (
15
15
  get_client,
16
16
  resolve_project_id,
17
- resolve_api_key,
18
- resolve_token_jwt,
19
17
  )
20
18
  from meshagent.cli.helper import resolve_room
21
19
 
@@ -59,10 +57,6 @@ async def storage_exists_command(
59
57
  *,
60
58
  project_id: ProjectIdOption = None,
61
59
  room: RoomOption,
62
- token_path: Annotated[Optional[str], typer.Option()] = None,
63
- api_key_id: ApiKeyIdOption = None,
64
- name: Annotated[str, typer.Option(..., help="Participant name")] = "cli",
65
- role: str = "user",
66
60
  path: str,
67
61
  ):
68
62
  """
@@ -71,22 +65,14 @@ async def storage_exists_command(
71
65
  account_client = await get_client()
72
66
  try:
73
67
  project_id = await resolve_project_id(project_id=project_id)
74
- api_key_id = await resolve_api_key(project_id, api_key_id)
75
68
  room = resolve_room(room)
76
- jwt = await resolve_token_jwt(
77
- project_id=project_id,
78
- api_key_id=api_key_id,
79
- token_path=token_path,
80
- name=name,
81
- role=role,
82
- room=room,
83
- )
69
+ connection = await account_client.connect_room(project_id=project_id, room=room)
84
70
 
85
71
  print("[bold green]Connecting to room...[/bold green]")
86
72
  async with RoomClient(
87
73
  protocol=WebSocketClientProtocol(
88
74
  url=websocket_room_url(room_name=room, base_url=meshagent_base_url()),
89
- token=jwt,
75
+ token=connection.jwt,
90
76
  )
91
77
  ) as client:
92
78
  file_exists = await client.storage.exists(path=path)
@@ -104,13 +90,7 @@ async def storage_exists_command(
104
90
  async def storage_cp_command(
105
91
  *,
106
92
  project_id: ProjectIdOption = None,
107
- room: RoomOption = None,
108
- token_path: Annotated[Optional[str], typer.Option()] = None,
109
- api_key_id: ApiKeyIdOption = None,
110
- name: Annotated[
111
- str, typer.Option(..., help="Participant name (if copying to/from remote)")
112
- ] = "cli",
113
- role: str = "user",
93
+ room: RoomOption,
114
94
  source_path: str,
115
95
  dest_path: str,
116
96
  ):
@@ -136,22 +116,16 @@ async def storage_cp_command(
136
116
 
137
117
  # A helper to ensure we have a connected StorageClient if needed
138
118
  async def ensure_storage_client():
139
- nonlocal account_client, client, storage_client, api_key_id, project_id
119
+ nonlocal account_client, client, storage_client, project_id
140
120
 
141
121
  if storage_client is not None:
142
122
  return # Already connected
143
123
 
144
124
  account_client = await get_client()
145
125
  project_id = await resolve_project_id(project_id=project_id)
146
- api_key_id = await resolve_api_key(project_id, api_key_id)
147
-
148
- jwt = await resolve_token_jwt(
149
- project_id=project_id,
150
- api_key_id=api_key_id,
151
- token_path=token_path,
152
- name=name,
153
- role=role,
154
- room=room,
126
+
127
+ connection = await account_client.connect_room(
128
+ project_id=project_id, room=room
155
129
  )
156
130
 
157
131
  print("[bold green]Connecting to room...[/bold green]")
@@ -160,7 +134,7 @@ async def storage_cp_command(
160
134
  url=websocket_room_url(
161
135
  room_name=room, base_url=meshagent_base_url()
162
136
  ),
163
- token=jwt,
137
+ token=connection.jwt,
164
138
  )
165
139
  )
166
140
 
@@ -349,13 +323,7 @@ async def storage_cp_command(
349
323
  async def storage_show_command(
350
324
  *,
351
325
  project_id: ProjectIdOption = None,
352
- room: RoomOption = None,
353
- token_path: Annotated[Optional[str], typer.Option()] = None,
354
- api_key_id: ApiKeyIdOption = None,
355
- name: Annotated[
356
- Optional[str], typer.Option(..., help="Participant name (if remote)")
357
- ] = None,
358
- role: str = "user",
326
+ room: RoomOption,
359
327
  path: str,
360
328
  encoding: Annotated[
361
329
  str, typer.Option("--encoding", help="Text encoding")
@@ -374,7 +342,7 @@ async def storage_show_command(
374
342
  storage_client = None
375
343
 
376
344
  async def ensure_storage_client():
377
- nonlocal account_client, client, storage_client, api_key_id, project_id
345
+ nonlocal account_client, client, storage_client, project_id
378
346
 
379
347
  if storage_client is not None:
380
348
  return
@@ -384,22 +352,14 @@ async def storage_show_command(
384
352
 
385
353
  account_client = await get_client()
386
354
  project_id = await resolve_project_id(project_id=project_id)
387
- api_key_id = await resolve_api_key(project_id, api_key_id)
388
-
389
- jwt = await resolve_token_jwt(
390
- project_id=project_id,
391
- api_key_id=api_key_id,
392
- token_path=token_path,
393
- name=name,
394
- role=role,
395
- room=room,
396
- )
355
+
356
+ connection = await account_client.connect_room(project_id=project_id, name=room)
397
357
 
398
358
  print("[bold green]Connecting to room...[/bold green]")
399
359
  client = RoomClient(
400
360
  protocol=WebSocketClientProtocol(
401
361
  url=websocket_room_url(room_name=room, base_url=meshagent_base_url()),
402
- token=jwt,
362
+ token=connection.jwt,
403
363
  )
404
364
  )
405
365
 
@@ -436,13 +396,7 @@ async def storage_show_command(
436
396
  async def storage_rm_command(
437
397
  *,
438
398
  project_id: ProjectIdOption = None,
439
- room: RoomOption = None,
440
- token_path: Annotated[Optional[str], typer.Option()] = None,
441
- api_key_id: ApiKeyIdOption = None,
442
- name: Annotated[
443
- Optional[str], typer.Option(..., help="Participant name (if remote)")
444
- ] = None,
445
- role: str = "user",
399
+ room: RoomOption,
446
400
  path: str,
447
401
  recursive: Annotated[
448
402
  bool, typer.Option("-r", help="Remove directories/folders recursively")
@@ -466,7 +420,7 @@ async def storage_rm_command(
466
420
 
467
421
  # Helper to ensure we have a storage client if we need remote operations
468
422
  async def ensure_storage_client():
469
- nonlocal account_client, client, storage_client, project_id, api_key_id
423
+ nonlocal account_client, client, storage_client, project_id
470
424
 
471
425
  if storage_client is not None:
472
426
  return # Already set up
@@ -478,14 +432,9 @@ async def storage_rm_command(
478
432
 
479
433
  account_client = await get_client()
480
434
  project_id = await resolve_project_id(project_id=project_id)
481
- resolved_project_id = await resolve_project_id(project_id=project_id)
482
- jwt = await resolve_token_jwt(
483
- project_id=resolved_project_id,
484
- api_key_id=api_key_id,
485
- token_path=token_path,
486
- name=name,
487
- role=role,
488
- room=room,
435
+
436
+ connection = await account_client.connect_room(
437
+ project_id=project_id, name=room
489
438
  )
490
439
 
491
440
  print("[bold green]Connecting to room...[/bold green]")
@@ -494,7 +443,7 @@ async def storage_rm_command(
494
443
  url=websocket_room_url(
495
444
  room_name=room, base_url=meshagent_base_url()
496
445
  ),
497
- token=jwt,
446
+ token=connection.jwt,
498
447
  )
499
448
  )
500
449
 
@@ -651,13 +600,7 @@ async def storage_rm_command(
651
600
  async def storage_ls_command(
652
601
  *,
653
602
  project_id: ProjectIdOption = None,
654
- room: RoomOption = None,
655
- token_path: Annotated[Optional[str], typer.Option()] = None,
656
- api_key_id: ApiKeyIdOption = None,
657
- name: Annotated[
658
- Optional[str], typer.Option(..., help="Participant name (if remote)")
659
- ] = None,
660
- role: str = "user",
603
+ room: RoomOption,
661
604
  path: Annotated[
662
605
  str, typer.Argument(..., help="Path to list (local or room://...)")
663
606
  ],
@@ -681,7 +624,7 @@ async def storage_ls_command(
681
624
 
682
625
  # --- Set up remote connection if needed ---
683
626
  async def ensure_storage_client():
684
- nonlocal account_client, client, storage_client, project_id, api_key_id
627
+ nonlocal account_client, client, storage_client, project_id
685
628
  if storage_client is not None:
686
629
  return
687
630
 
@@ -690,20 +633,12 @@ async def storage_ls_command(
690
633
 
691
634
  account_client = await get_client()
692
635
  project_id = await resolve_project_id(project_id=project_id)
693
- api_key_id = await resolve_api_key(project_id, api_key_id)
694
- jwt = await resolve_token_jwt(
695
- project_id=project_id,
696
- api_key_id=api_key_id,
697
- token_path=token_path,
698
- name=name,
699
- role=role,
700
- room=room,
701
- )
636
+ connection = await account_client.connect_room(project_id=project_id, room=room)
702
637
 
703
638
  client = RoomClient(
704
639
  protocol=WebSocketClientProtocol(
705
640
  url=websocket_room_url(room_name=room, base_url=meshagent_base_url()),
706
- token=jwt,
641
+ token=connection.jwt,
707
642
  )
708
643
  )
709
644
  await client.__aenter__()
meshagent/cli/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.5.15"
1
+ __version__ = "0.6.0"
meshagent/cli/voicebot.py CHANGED
@@ -1,16 +1,16 @@
1
1
  import typer
2
2
  from rich import print
3
3
  from typing import Annotated, Optional
4
- from meshagent.cli.common_options import ProjectIdOption, ApiKeyIdOption, RoomOption
4
+ from meshagent.cli.common_options import ProjectIdOption, RoomOption
5
5
  from meshagent.api import RoomClient, WebSocketClientProtocol, RoomException
6
6
  from meshagent.api.helpers import meshagent_base_url, websocket_room_url
7
7
  from meshagent.cli import async_typer
8
+ from meshagent.api import ParticipantToken, ApiScope
8
9
  from meshagent.cli.helper import (
9
10
  get_client,
10
11
  resolve_project_id,
11
- resolve_api_key,
12
- resolve_token_jwt,
13
12
  resolve_room,
13
+ resolve_key,
14
14
  )
15
15
  from typing import List
16
16
 
@@ -18,17 +18,6 @@ from meshagent.api import RequiredToolkit, RequiredSchema
18
18
  from meshagent.api.services import ServiceHost
19
19
  from pathlib import Path
20
20
 
21
- try:
22
- from meshagent.livekit.agents.voice import VoiceBot
23
-
24
- except ImportError:
25
-
26
- class VoiceBot:
27
- def __init__(self, **kwargs):
28
- raise RoomException(
29
- "meshagent.livekit module not found, voicebots are not available"
30
- )
31
-
32
21
 
33
22
  app = async_typer.AsyncTyper(help="Join a voicebot to a room")
34
23
 
@@ -37,10 +26,7 @@ app = async_typer.AsyncTyper(help="Join a voicebot to a room")
37
26
  async def make_call(
38
27
  *,
39
28
  project_id: ProjectIdOption = None,
40
- room: RoomOption = None,
41
- api_key_id: ApiKeyIdOption = None,
42
- name: Annotated[str, typer.Option(..., help="Participant name")] = "cli",
43
- role: str = "agent",
29
+ room: RoomOption,
44
30
  agent_name: Annotated[str, typer.Option(..., help="Name of the agent to call")],
45
31
  rule: Annotated[List[str], typer.Option("--rule", "-r", help="a system rule")] = [],
46
32
  rules_file: Optional[str] = None,
@@ -54,22 +40,38 @@ async def make_call(
54
40
  ] = [],
55
41
  auto_greet_message: Annotated[Optional[str], typer.Option()] = None,
56
42
  auto_greet_prompt: Annotated[Optional[str], typer.Option()] = None,
57
- token_path: Annotated[Optional[str], typer.Option()] = None,
43
+ key: Annotated[
44
+ str,
45
+ typer.Option("--key", help="an api key to sign the token with"),
46
+ ] = None,
58
47
  ):
48
+ try:
49
+ from meshagent.livekit.agents.voice import VoiceBot
50
+ except ImportError:
51
+
52
+ class VoiceBot:
53
+ def __init__(self, **kwargs):
54
+ raise RoomException(
55
+ "meshagent.livekit module not found, voicebots are not available"
56
+ )
57
+
58
+ key = await resolve_key(project_id=project_id, key=key)
59
+
59
60
  account_client = await get_client()
60
61
  try:
61
62
  project_id = await resolve_project_id(project_id=project_id)
62
- api_key_id = await resolve_api_key(project_id, api_key_id)
63
63
  room = resolve_room(room)
64
- jwt = await resolve_token_jwt(
65
- project_id=project_id,
66
- api_key_id=api_key_id,
67
- token_path=token_path,
68
- name=name,
69
- role=role,
70
- room=room,
64
+
65
+ token = ParticipantToken(
66
+ name=agent_name,
71
67
  )
72
68
 
69
+ token.add_api_grant(ApiScope.agent_default())
70
+
71
+ token.add_role_grant(role="agent")
72
+ token.add_room_grant(room)
73
+
74
+ jwt = token.to_jwt(api_key=key)
73
75
  if rules_file is not None:
74
76
  try:
75
77
  with open(Path(rules_file).resolve(), "r") as f:
@@ -118,7 +120,6 @@ async def make_call(
118
120
  @app.async_command("service")
119
121
  async def service(
120
122
  *,
121
- project_id: ProjectIdOption = None,
122
123
  agent_name: Annotated[str, typer.Option(..., help="Name of the agent to call")],
123
124
  rule: Annotated[List[str], typer.Option("--rule", "-r", help="a system rule")] = [],
124
125
  rules_file: Optional[str] = None,
@@ -136,6 +137,16 @@ async def service(
136
137
  port: Annotated[Optional[int], typer.Option()] = None,
137
138
  path: Annotated[str, typer.Option()] = "/agent",
138
139
  ):
140
+ try:
141
+ from meshagent.livekit.agents.voice import VoiceBot
142
+ except ImportError:
143
+
144
+ class VoiceBot:
145
+ def __init__(self, **kwargs):
146
+ raise RoomException(
147
+ "meshagent.livekit module not found, voicebots are not available"
148
+ )
149
+
139
150
  requirements = []
140
151
 
141
152
  for t in toolkit:
meshagent/cli/webhook.py CHANGED
@@ -47,7 +47,7 @@ async def webhook_create(
47
47
  project_id = await resolve_project_id(project_id=project_id)
48
48
 
49
49
  payload_obj = json.loads(payload) if payload else None
50
- webhook = await client.create_project_webhook(
50
+ webhook = await client.create_webhook(
51
51
  project_id=project_id,
52
52
  name=name,
53
53
  url=url,
@@ -70,7 +70,7 @@ async def webhook_list(
70
70
  client = await get_client()
71
71
  try:
72
72
  project_id = await resolve_project_id(project_id=project_id)
73
- hooks = await client.list_project_webhooks(project_id)
73
+ hooks = await client.list_webhooks(project_id)
74
74
  print_json_table(
75
75
  hooks.get("webhooks"),
76
76
  "id",
@@ -94,7 +94,7 @@ async def webhook_delete(
94
94
  client = await get_client()
95
95
  try:
96
96
  project_id = await resolve_project_id(project_id=project_id)
97
- await client.delete_project_webhook(project_id, webhook_id)
97
+ await client.delete_webhook(project_id, webhook_id)
98
98
  print(f"[green]Webhook {webhook_id} deleted.[/]")
99
99
  finally:
100
100
  await client.close()
@@ -1,28 +1,34 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-cli
3
- Version: 0.5.15
3
+ Version: 0.6.0
4
4
  Summary: CLI for Meshagent
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Documentation, https://docs.meshagent.com
7
7
  Project-URL: Website, https://www.meshagent.com
8
8
  Project-URL: Source, https://www.meshagent.com
9
- Requires-Python: >=3.12
9
+ Requires-Python: >=3.13
10
10
  Description-Content-Type: text/markdown
11
11
  Requires-Dist: typer~=0.15
12
- Requires-Dist: pydantic-yaml~=1.4
13
- Requires-Dist: meshagent-api~=0.5.15
14
- Requires-Dist: meshagent-agents~=0.5.15
15
- Requires-Dist: meshagent-computers~=0.5.15
16
- Requires-Dist: meshagent-openai~=0.5.15
17
- Requires-Dist: meshagent-tools~=0.5.15
18
- Requires-Dist: meshagent-mcp~=0.5.15
19
- Requires-Dist: supabase~=2.15
20
12
  Requires-Dist: fastmcp~=2.8
21
13
  Requires-Dist: opentelemetry-distro~=0.54b1
22
14
  Requires-Dist: opentelemetry-exporter-otlp-proto-http~=1.33
23
15
  Requires-Dist: art~=6.5
24
16
  Requires-Dist: pydantic-yaml~=1.5
25
- Requires-Dist: supabase-auth~=2.12.3
17
+ Requires-Dist: pathspec~=0.12.1
18
+ Provides-Extra: all
19
+ Requires-Dist: meshagent-agents[all]~=0.6.0; extra == "all"
20
+ Requires-Dist: meshagent-api[all]~=0.6.0; extra == "all"
21
+ Requires-Dist: meshagent-computers~=0.6.0; extra == "all"
22
+ Requires-Dist: meshagent-openai~=0.6.0; extra == "all"
23
+ Requires-Dist: meshagent-mcp~=0.6.0; extra == "all"
24
+ Requires-Dist: meshagent-tools~=0.6.0; extra == "all"
25
+ Requires-Dist: supabase-auth~=2.12.3; extra == "all"
26
+ Provides-Extra: mcp-service
27
+ Requires-Dist: meshagent-agents[all]~=0.6.0; extra == "mcp-service"
28
+ Requires-Dist: meshagent-api~=0.6.0; extra == "mcp-service"
29
+ Requires-Dist: meshagent-mcp~=0.6.0; extra == "mcp-service"
30
+ Requires-Dist: meshagent-tools~=0.6.0; extra == "mcp-service"
31
+ Requires-Dist: supabase-auth~=2.12.3; extra == "mcp-service"
26
32
 
27
33
  # [Meshagent](https://www.meshagent.com)
28
34
 
@@ -0,0 +1,35 @@
1
+ meshagent/cli/__init__.py,sha256=X78Z4yEg5XfkNKH0HiIdG4k1q5ktB-ampTuXHLNFrAw,58
2
+ meshagent/cli/agent.py,sha256=CKH8XkRJ4oeu2hbG-FL8tWXtDn2tYDvTSCxSvQ0sCIY,8976
3
+ meshagent/cli/api_keys.py,sha256=2_-TB0a1vca4uG-RG4zc0_c9QTJ8EHt3qomy2wfKlXE,3192
4
+ meshagent/cli/async_typer.py,sha256=GCeSefBDbpd-V4V8LrvHGUTBMth3HspVMfFa-HUZ0cg,898
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=ydxEnX7uPZ9B2-ND1LvBt4Leb2K8whhmdogRIsCydnw,7315
8
+ meshagent/cli/chatbot.py,sha256=QogSjbMjs5WeOEdhOOSveRN0Sy7qXur9xjpjCOticFw,9552
9
+ meshagent/cli/cli.py,sha256=nu6djaYsWmBVu4m7KIXbzAAan2civ91iLEjDkapXmxg,5513
10
+ meshagent/cli/cli_mcp.py,sha256=d3N37rZ-CMFouk9jxJRe8CIUprv_nExiata8Ni8OKsQ,11259
11
+ meshagent/cli/cli_secrets.py,sha256=_hxEe93YJaJczWZXbMxS-qiedMpwGLC3ez-YUnjqudM,13713
12
+ meshagent/cli/common_options.py,sha256=_zw7Vm6Jvd71QIlFekAuff1Bdx0d-ZeOFqjU0wrcbAY,458
13
+ meshagent/cli/containers.py,sha256=s9xuxjT_jLLmML3cuxBeLi8HE2w0lI3wRgVk8COOM3w,17573
14
+ meshagent/cli/developer.py,sha256=2nWCX9lqtTd__i6qDJOOJtI0kB4X185s_3Ktfx5MaRQ,2251
15
+ meshagent/cli/exec.py,sha256=fZpRvvTJC5bUBpaUCOFFJuaZDuyIPz5r42-bxtwDWhM,15647
16
+ meshagent/cli/helper.py,sha256=RLUJxNJ1aDx4fij61ps_s0NGXwYVcp_Ek6n1ChHM3HM,3961
17
+ meshagent/cli/helpers.py,sha256=9JSZiWOnVkh0qfM3DKcvz4u83EJ34DBdukx2Ple9V94,4783
18
+ meshagent/cli/mailbot.py,sha256=dMfDM-QWfhmiRegzRe_bihznzUfD1RngkNPDhDu7sYs,8160
19
+ meshagent/cli/meeting_transcriber.py,sha256=Eo4itFxwQvMoz-IBN4hMA7PMVsU81uUsYSnmCyZK9QA,3834
20
+ meshagent/cli/messaging.py,sha256=guzaFxtmApLJ0p6RCqiHstk-md2NGW3FLTu-Pzwdo5Q,5278
21
+ meshagent/cli/oauth2.py,sha256=-ArxgO7KAjowanp8KcHlSEnVpemzm49fSov6wrKOe0o,6193
22
+ meshagent/cli/participant_token.py,sha256=zdNDviXfChhvbVyWukJt4CNvi7nVIl5nJChST_qCjaI,1778
23
+ meshagent/cli/projects.py,sha256=-s5xIfd2pCW8HsuqRsNoKZr5hsF6xYxfEjyYI6Nm4YI,3511
24
+ meshagent/cli/queue.py,sha256=DauqjVul7v6dLHQ_t3C-Pqmrgvjg093FHCRsD5Yf3bg,2937
25
+ meshagent/cli/services.py,sha256=GZA40INO9bOZMoKAw0u_qTtD2inGEJAX4aqXqUuSt3Y,14908
26
+ meshagent/cli/sessions.py,sha256=bUwrPkzeEWE8gTqD4E-tfr2ChBns3Fvv9MsSV4RRNTQ,881
27
+ meshagent/cli/storage.py,sha256=0pSrviBM53-2xFlD1ZW4rDthJ-CwUD5tQC43FcaU5sU,32541
28
+ meshagent/cli/version.py,sha256=cID1jLnC_vj48GgMN6Yb1FA3JsQ95zNmCHmRYE8TFhY,22
29
+ meshagent/cli/voicebot.py,sha256=t8sqygbXPbasfCf6cDDTGxZWHD3KeuBZhYDkV0k-wQI,6003
30
+ meshagent/cli/webhook.py,sha256=g2vqt3fKQ5HQ2miXZbekjyZ_NODsyRTYIgWEni5bDP0,2971
31
+ meshagent_cli-0.6.0.dist-info/METADATA,sha256=o7XaeAvH1DMvCLWUYcUouqufPiVd7fZJ4IctKR9pTXM,1976
32
+ meshagent_cli-0.6.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
33
+ meshagent_cli-0.6.0.dist-info/entry_points.txt,sha256=WRcGGN4vMtvC5Pgl3uRFqsJiQXNoHuLLa-TCSY3gAhQ,52
34
+ meshagent_cli-0.6.0.dist-info/top_level.txt,sha256=GlcXnHtRP6m7zlG3Df04M35OsHtNXy_DY09oFwWrH74,10
35
+ meshagent_cli-0.6.0.dist-info/RECORD,,
meshagent/cli/otel.py DELETED
@@ -1,122 +0,0 @@
1
- from opentelemetry.sdk.resources import SERVICE_NAME, Resource
2
- from opentelemetry import trace
3
- from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
4
- from opentelemetry.sdk.trace import TracerProvider
5
- from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter
6
-
7
- from opentelemetry import metrics
8
- from opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter
9
- from opentelemetry.sdk._logs.export import ConsoleLogExporter
10
- from opentelemetry.sdk.metrics import MeterProvider
11
- from opentelemetry.sdk.metrics.export import (
12
- PeriodicExportingMetricReader,
13
- ConsoleMetricExporter,
14
- )
15
- from opentelemetry import _logs
16
- from opentelemetry.sdk._logs import LoggerProvider, LoggingHandler
17
- from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
18
- from opentelemetry.exporter.otlp.proto.http._log_exporter import OTLPLogExporter
19
- from opentelemetry.sdk.metrics.export import AggregationTemporality
20
- from opentelemetry.sdk.metrics import Counter, Histogram
21
- import logging
22
-
23
- import os
24
-
25
-
26
- def _call_once(fn):
27
- called = False
28
- result = None
29
-
30
- def wrapper(*args, **kwargs):
31
- nonlocal called, result
32
- if not called:
33
- result = fn(*args, **kwargs)
34
- called = True
35
- return result
36
-
37
- return wrapper
38
-
39
-
40
- attributes = {
41
- SERVICE_NAME: "room-server",
42
- }
43
-
44
- if os.getenv("MESHAGENT_PROJECT_ID") is not None:
45
- attributes["project"] = os.getenv("MESHAGENT_PROJECT_ID")
46
-
47
- if os.getenv("MESHAGENT_SESSION_ID") is not None:
48
- attributes["session"] = os.getenv("MESHAGENT_SESSION_ID")
49
-
50
- if os.getenv("MESHAGENT_ROOM") is not None:
51
- attributes["room"] = os.getenv("MESHAGENT_ROOM")
52
-
53
- resource = Resource.create(attributes=attributes)
54
-
55
- logger_provider = None
56
- tracer_provider = None
57
- meter_provider = None
58
-
59
- add_console_exporters = False
60
-
61
- otel_endpoint = os.getenv("OTEL_ENDPOINT")
62
-
63
- if otel_endpoint is not None:
64
- otel_logs_endpoint = otel_endpoint + "/v1/logs"
65
- otel_traces_endpoint = otel_endpoint + "/v1/traces"
66
- otel_metrics_endpoint = otel_endpoint + "/v1/metrics"
67
-
68
- if otel_logs_endpoint is not None:
69
- logs_exporter = OTLPLogExporter(
70
- endpoint=otel_logs_endpoint,
71
- )
72
- logger_provider = LoggerProvider(resource=resource)
73
- _logs.set_logger_provider(logger_provider)
74
-
75
- logger_provider.add_log_record_processor(BatchLogRecordProcessor(logs_exporter))
76
-
77
- if add_console_exporters:
78
- logger_provider.add_log_record_processor(
79
- BatchLogRecordProcessor(ConsoleLogExporter())
80
- )
81
-
82
- if otel_traces_endpoint is not None:
83
- tracer_provider = TracerProvider(resource=resource)
84
- processor = BatchSpanProcessor(OTLPSpanExporter(endpoint=otel_traces_endpoint))
85
- tracer_provider.add_span_processor(processor)
86
- if add_console_exporters:
87
- tracer_provider.add_span_processor(
88
- BatchSpanProcessor(ConsoleSpanExporter())
89
- )
90
- trace.set_tracer_provider(tracer_provider)
91
-
92
- if otel_metrics_endpoint is not None:
93
- reader = PeriodicExportingMetricReader(
94
- exporter=OTLPMetricExporter(
95
- endpoint=otel_metrics_endpoint,
96
- preferred_temporality={
97
- Counter: AggregationTemporality.DELTA,
98
- Histogram: AggregationTemporality.DELTA,
99
- },
100
- ),
101
- export_interval_millis=1000,
102
- )
103
-
104
- readers = [
105
- reader,
106
- ]
107
- if add_console_exporters:
108
- readers.append(PeriodicExportingMetricReader(ConsoleMetricExporter()))
109
-
110
- meter_provider = MeterProvider(resource=resource, metric_readers=readers)
111
- metrics.set_meter_provider(meter_provider)
112
-
113
-
114
- @_call_once
115
- def init(level):
116
- if logger_provider is not None:
117
- logging_handler = LoggingHandler(level=level, logger_provider=logger_provider)
118
- root = logging.getLogger()
119
- root.setLevel(level)
120
- root.addHandler(logging_handler)
121
- else:
122
- logging.basicConfig(level=level)
@@ -1,32 +0,0 @@
1
- meshagent/cli/__init__.py,sha256=X78Z4yEg5XfkNKH0HiIdG4k1q5ktB-ampTuXHLNFrAw,58
2
- meshagent/cli/agent.py,sha256=ar1u1iPM5NG0vKIj6jlkHTyrAZ2a55uOSgzJn5G_TG0,10691
3
- meshagent/cli/api_keys.py,sha256=l288EXciwj7C3ooSb-kQIjLInq7QVs2QuTtbMewTgM4,5026
4
- meshagent/cli/async_typer.py,sha256=GCeSefBDbpd-V4V8LrvHGUTBMth3HspVMfFa-HUZ0cg,898
5
- meshagent/cli/auth.py,sha256=wpGTomrFH0uvbwv262sTqK0DgB4ltAuurEmI9tYedIs,815
6
- meshagent/cli/auth_async.py,sha256=adL38zvZI_wg9l1VnJuXoYFFlx_AXqjktgd_KnlxJKU,4114
7
- meshagent/cli/call.py,sha256=XrWtyy0kOUngniz4UcQm1ws46Nde34-IQLWmcgcDwEI,5405
8
- meshagent/cli/chatbot.py,sha256=q-W3GdbvT9YgTrwwxZRnTV1E_tzBIrkmn0ngJHjB1tU,8946
9
- meshagent/cli/cli.py,sha256=a3wOL1uZVQqb8wE1fzL1-PCkDQxd5XZ06m-7oenR20Q,6677
10
- meshagent/cli/cli_mcp.py,sha256=Wh3brbzBIs3h15qLrZltLOKxpJoImIEuBEb5ISDOKGY,10656
11
- meshagent/cli/cli_secrets.py,sha256=RC236eYGV4sl4gOzaBYAGl23RNIAs7qXnwOSJpDMt-4,13722
12
- meshagent/cli/common_options.py,sha256=-eNhLfHxbVG3DXME5ONySMfMel8nZsOBwXHKsGtLSq4,726
13
- meshagent/cli/developer.py,sha256=VWJk5h0tzzihdrVhGk51RPdnf7H86IV8PuahdnMzZgM,2974
14
- meshagent/cli/exec.py,sha256=U4Fpz-YXMpDiMPZywxT0k1X3zzTzjpsMsF2zb5nd4Tg,11658
15
- meshagent/cli/helper.py,sha256=RJjzpfkO-nF5QP_OqqDSXPUK7_GQc-UC8Pxl3tMQUMc,4873
16
- meshagent/cli/mailbot.py,sha256=LttSEpR15947OYSlN6B_eFDTxesahA0ZxNIC_-s3vfE,8204
17
- meshagent/cli/messaging.py,sha256=2_wd71vvG71ctTBXW9FdnwSUnoPy_W6I8aw2f3SUD24,6407
18
- meshagent/cli/otel.py,sha256=1yoMGivskLV9f7M_LqCLKbttTTAPmFY5yhWXqFzvRN8,4066
19
- meshagent/cli/participant_token.py,sha256=tkVS1LVNyZqCSFWCU9NcEZlGIjJ-cXeJkkE8bW3aJaM,1488
20
- meshagent/cli/projects.py,sha256=-s5xIfd2pCW8HsuqRsNoKZr5hsF6xYxfEjyYI6Nm4YI,3511
21
- meshagent/cli/queue.py,sha256=nunP7CoByhPRKRrd99A3412T2rCf5j-it47Bn_vaBDY,3946
22
- meshagent/cli/services.py,sha256=1aeT3rfi-_ITGxjCJun7bgELguuZqkPDgFQM_dH_7EE,17541
23
- meshagent/cli/sessions.py,sha256=bUwrPkzeEWE8gTqD4E-tfr2ChBns3Fvv9MsSV4RRNTQ,881
24
- meshagent/cli/storage.py,sha256=aqSLojVF-aTEvSaVRyPh2dfOd2LrO_kcbUbhQYj8g5E,34827
25
- meshagent/cli/version.py,sha256=L6LoKMlJx-n68Agaz17S4PydD7S5Z4lwW3o79dy3l1c,23
26
- meshagent/cli/voicebot.py,sha256=DCSvsa2EeGQTxI2i6xA6tS1dM2U4op8MsMNy99KQfjo,5775
27
- meshagent/cli/webhook.py,sha256=3vSZAGC19A8GN26uogh-ZUFeAOOCUOeqn80RVXj4qaA,2995
28
- meshagent_cli-0.5.15.dist-info/METADATA,sha256=haqQT-nmzojtlGB-yiG6quYL1zCRzdPpMVVP4UCwTO8,1534
29
- meshagent_cli-0.5.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
30
- meshagent_cli-0.5.15.dist-info/entry_points.txt,sha256=WRcGGN4vMtvC5Pgl3uRFqsJiQXNoHuLLa-TCSY3gAhQ,52
31
- meshagent_cli-0.5.15.dist-info/top_level.txt,sha256=GlcXnHtRP6m7zlG3Df04M35OsHtNXy_DY09oFwWrH74,10
32
- meshagent_cli-0.5.15.dist-info/RECORD,,