meshagent-cli 0.0.34__tar.gz → 0.0.35__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.34 → meshagent_cli-0.0.35}/PKG-INFO +9 -9
  2. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/auth_async.py +1 -1
  3. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/chatbot.py +4 -2
  4. meshagent_cli-0.0.35/meshagent/cli/cli.py +189 -0
  5. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/tty.py +2 -2
  6. meshagent_cli-0.0.35/meshagent/cli/version.py +1 -0
  7. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent_cli.egg-info/PKG-INFO +9 -9
  8. meshagent_cli-0.0.35/meshagent_cli.egg-info/requires.txt +8 -0
  9. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/pyproject.toml +8 -8
  10. meshagent_cli-0.0.34/meshagent/cli/cli.py +0 -63
  11. meshagent_cli-0.0.34/meshagent/cli/version.py +0 -1
  12. meshagent_cli-0.0.34/meshagent_cli.egg-info/requires.txt +0 -8
  13. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/README.md +0 -0
  14. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/__init__.py +0 -0
  15. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/agent.py +0 -0
  16. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/api_keys.py +0 -0
  17. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/async_typer.py +0 -0
  18. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/auth.py +0 -0
  19. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/call.py +0 -0
  20. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/cli_mcp.py +0 -0
  21. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/cli_secrets.py +0 -0
  22. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/developer.py +0 -0
  23. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/helper.py +0 -0
  24. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/messaging.py +0 -0
  25. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/participant_token.py +0 -0
  26. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/projects.py +0 -0
  27. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/services.py +0 -0
  28. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/sessions.py +0 -0
  29. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/storage.py +0 -0
  30. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/voicebot.py +0 -0
  31. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent/cli/webhook.py +0 -0
  32. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent_cli.egg-info/SOURCES.txt +0 -0
  33. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent_cli.egg-info/dependency_links.txt +0 -0
  34. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent_cli.egg-info/entry_points.txt +0 -0
  35. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/meshagent_cli.egg-info/top_level.txt +0 -0
  36. {meshagent_cli-0.0.34 → meshagent_cli-0.0.35}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-cli
3
- Version: 0.0.34
3
+ Version: 0.0.35
4
4
  Summary: CLI for Meshagent
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Documentation, https://docs.meshagent.com
@@ -8,14 +8,14 @@ Project-URL: Website, https://www.meshagent.com
8
8
  Project-URL: Source, https://www.meshagent.com
9
9
  Requires-Python: >=3.12
10
10
  Description-Content-Type: text/markdown
11
- Requires-Dist: typer~=0.15.3
12
- Requires-Dist: pydantic-yaml~=1.4.0
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
- Requires-Dist: supabase~=2.15.1
18
- Requires-Dist: fastmcp~=2.8.1
11
+ Requires-Dist: typer~=0.15
12
+ Requires-Dist: pydantic-yaml~=1.4
13
+ Requires-Dist: meshagent-api~=0.0.35
14
+ Requires-Dist: meshagent-agents~=0.0.35
15
+ Requires-Dist: meshagent-tools~=0.0.35
16
+ Requires-Dist: meshagent-mcp~=0.0.35
17
+ Requires-Dist: supabase~=2.15
18
+ Requires-Dist: fastmcp~=2.8
19
19
 
20
20
  ### Meshagent CLI
21
21
 
@@ -58,7 +58,7 @@ async def _wait_for_code() -> str:
58
58
  return web.Response(status=400)
59
59
 
60
60
  app.add_routes([web.get("/callback", callback)])
61
- runner = web.AppRunner(app)
61
+ runner = web.AppRunner(app, access_log=None)
62
62
  await runner.setup()
63
63
  site = web.TCPSite(runner, "localhost", REDIRECT_PORT)
64
64
  await site.start()
@@ -45,8 +45,10 @@ async def make_call(
45
45
 
46
46
  print("[bold green]Connecting to room...[/bold green]")
47
47
  async with RoomClient(
48
- protocol=WebSocketClientProtocol(url=websocket_room_url(room_name=room, base_url=meshagent_base_url()),
49
- token=jwt)
48
+ protocol=WebSocketClientProtocol(
49
+ url=websocket_room_url(room_name=room, base_url=meshagent_base_url()),
50
+ token=jwt
51
+ )
50
52
  ) as client:
51
53
 
52
54
  requirements = []
@@ -0,0 +1,189 @@
1
+ import typer
2
+ import asyncio
3
+ from typing import Optional
4
+
5
+ from meshagent.cli import auth
6
+ from meshagent.cli import api_keys
7
+ from meshagent.cli import projects
8
+ from meshagent.cli import sessions
9
+ from meshagent.cli import participant_token
10
+ from meshagent.cli import agent
11
+ from meshagent.cli import messaging
12
+ from meshagent.cli import storage
13
+ from meshagent.cli import developer
14
+ from meshagent.cli import webhook
15
+ from meshagent.cli import services
16
+ from meshagent.cli import cli_secrets
17
+ from meshagent.cli import call
18
+ from meshagent.cli import cli_mcp
19
+ from meshagent.cli import chatbot
20
+ from meshagent.cli import voicebot
21
+ from meshagent.cli import tty
22
+
23
+ app = typer.Typer()
24
+ app.add_typer(call.app, name="call")
25
+ app.add_typer(auth.app, name="auth")
26
+ app.add_typer(projects.app, name="project")
27
+ app.add_typer(api_keys.app, name="api-key")
28
+ app.add_typer(sessions.app, name="session")
29
+ app.add_typer(participant_token.app, name="participant-token")
30
+ app.add_typer(agent.app, name="agents")
31
+ app.add_typer(messaging.app, name="messaging")
32
+ app.add_typer(storage.app, name="storage")
33
+ app.add_typer(developer.app, name="developer")
34
+ app.add_typer(webhook.app, name="webhook")
35
+ app.add_typer(services.app, name="service")
36
+ app.add_typer(cli_secrets.app, name="secret")
37
+ app.add_typer(cli_mcp.app, name="mcp")
38
+ app.add_typer(chatbot.app, name="chatbot")
39
+ app.add_typer(voicebot.app, name="voicebot")
40
+ app.add_typer(tty.app, name="tty")
41
+
42
+ def _run_async(coro):
43
+ asyncio.run(coro)
44
+
45
+
46
+ import os, sys
47
+ from pathlib import Path
48
+ import typer
49
+ from meshagent.cli.helper import get_client, set_active_project, get_active_project, resolve_project_id, resolve_api_key
50
+
51
+
52
+ def detect_shell() -> str:
53
+ """
54
+ Best-effort detection of the *current* interactive shell.
55
+
56
+ Order of preference
57
+ 1. Explicit --shell argument (handled by Typer)
58
+ 2. Per-shell env vars set by the running shell
59
+ • BASH_VERSION / ZSH_VERSION / FISH_VERSION
60
+ 3. $SHELL on POSIX (user’s login shell – still correct >90 % of the time)
61
+ 4. Parent process on Windows (COMSPEC → cmd / powershell)
62
+ 5. Safe default: 'bash'
63
+ """
64
+ # Per-shell version variables (works even if login shell ≠ current shell)
65
+ for var, name in (
66
+ ("ZSH_VERSION", "zsh"),
67
+ ("BASH_VERSION", "bash"),
68
+ ("FISH_VERSION", "fish"),
69
+ ):
70
+ if var in os.environ:
71
+ return name
72
+
73
+ # POSIX fallback: login shell path
74
+ sh = os.environ.get("SHELL")
75
+ if sh:
76
+ return Path(sh).name.lower()
77
+
78
+ # Windows heuristics
79
+ if sys.platform == "win32":
80
+ comspec = Path(os.environ.get("COMSPEC", "")).name.lower()
81
+ if "powershell" in comspec:
82
+ return "powershell"
83
+ if "cmd" in comspec:
84
+ return "cmd"
85
+ return "powershell" # sensible default on modern Windows
86
+
87
+ # Last-ditch default
88
+ return "bash"
89
+
90
+
91
+ def _bash_like(name: str, value: str, unset: bool) -> str:
92
+ return f'unset {name}' if unset else f'export {name}="{value}"'
93
+
94
+
95
+ def _fish(name: str, value: str, unset: bool) -> str:
96
+ return f'set -e {name}' if unset else f'set -gx {name} "{value}"'
97
+
98
+
99
+ def _powershell(name: str, value: str, unset: bool) -> str:
100
+ return f'Remove-Item Env:{name}' if unset else f'$Env:{name}="{value}"'
101
+
102
+
103
+ def _cmd(name: str, value: str, unset: bool) -> str:
104
+ return f'set {name}=' if unset else f'set {name}={value}'
105
+
106
+
107
+ SHELL_RENDERERS = {
108
+ "bash": _bash_like,
109
+ "zsh": _bash_like,
110
+ "fish": _fish,
111
+ "powershell": _powershell,
112
+ "cmd": _cmd,
113
+ }
114
+
115
+
116
+ @app.command(
117
+ "env",
118
+ help="Generate commands to set meshagent environment variables.",
119
+ )
120
+ def env(
121
+ shell: Optional[str] = typer.Option(None,
122
+ "--shell",
123
+ case_sensitive=False,
124
+ help="bash | zsh | fish | powershell | cmd",
125
+ ),
126
+ unset: bool = typer.Option(
127
+ False, "--unset", help="Output commands to unset the variables."
128
+ ),
129
+ ):
130
+ """Print shell-specific exports/unsets for Docker environment variables."""
131
+
132
+ async def command():
133
+ nonlocal shell, unset
134
+ shell = (shell or detect_shell()).lower()
135
+ if shell not in SHELL_RENDERERS:
136
+ typer.echo(f"Unsupported shell '{shell}'.", err=True)
137
+ raise typer.Exit(code=1)
138
+
139
+ client = await get_client()
140
+ try:
141
+ project_id = await resolve_project_id(project_id=None)
142
+ api_key_id = await resolve_api_key(project_id=project_id, api_key_id=None)
143
+
144
+ token = (await client.decrypt_project_api_key(project_id=project_id, id=api_key_id))["token"]
145
+ finally:
146
+ await client.close()
147
+
148
+ vars = {
149
+ "MESHAGENT_PROJECT_ID" : project_id,
150
+ "MESHAGENT_API_KEY" : api_key_id,
151
+ "MESHAGENT_SECRET" : token
152
+ }
153
+ if shell not in SHELL_RENDERERS:
154
+ typer.echo(f"Unsupported shell '{shell}'.", err=True)
155
+ raise typer.Exit(code=1)
156
+
157
+ render = SHELL_RENDERERS[shell]
158
+
159
+ for name, value in vars.items():
160
+ typer.echo(render(name, value, unset))
161
+
162
+ if not unset and shell in ("bash", "zsh"):
163
+ typer.echo(
164
+ '\n# Run this command to configure your current shell:\n'
165
+ f'# eval "$(meshagent env)"'
166
+ )
167
+
168
+ _run_async(command())
169
+
170
+ @app.command("setup")
171
+ def setup_command():
172
+ """Perform initial login and project/api key activation."""
173
+
174
+ async def runner():
175
+ await auth.login()
176
+ print("Activate a project...")
177
+ project_id = await projects.activate(None, interactive=True)
178
+ if project_id is None:
179
+ print("You have choosen to not activate a project. Exiting.")
180
+ if project_id is not None:
181
+ print("Activate an api-key...")
182
+ api_key_id = await api_keys.activate(None, interactive=True)
183
+ if api_key_id is None:
184
+ print("You have choosen to not activate an api-key. Exiting.")
185
+
186
+ _run_async(runner())
187
+
188
+ if __name__ == "__main__":
189
+ app()
@@ -2,6 +2,7 @@ import pathlib
2
2
  import sys
3
3
  import tty
4
4
  import termios
5
+ from meshagent.api.helpers import websocket_room_url
5
6
  from typing import Annotated, Optional
6
7
 
7
8
  import asyncio
@@ -46,10 +47,9 @@ async def tty_command(
46
47
  )
47
48
 
48
49
  token.add_role_grant(role="user")
49
-
50
50
  token.add_room_grant(room)
51
51
 
52
- ws_url = f"{os.getenv("MESHAGENT_API_URL").replace("http","ws",1)}/rooms/{room}/tty?token={token.to_jwt(token=key)}"
52
+ ws_url = websocket_room_url(room_name=room)+"/tty?token={token.to_jwt(token=key)}"
53
53
 
54
54
  print(f"[bold green]Connecting to[/bold green] {room}")
55
55
 
@@ -0,0 +1 @@
1
+ __version__ = "0.0.35"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-cli
3
- Version: 0.0.34
3
+ Version: 0.0.35
4
4
  Summary: CLI for Meshagent
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Documentation, https://docs.meshagent.com
@@ -8,14 +8,14 @@ Project-URL: Website, https://www.meshagent.com
8
8
  Project-URL: Source, https://www.meshagent.com
9
9
  Requires-Python: >=3.12
10
10
  Description-Content-Type: text/markdown
11
- Requires-Dist: typer~=0.15.3
12
- Requires-Dist: pydantic-yaml~=1.4.0
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
- Requires-Dist: supabase~=2.15.1
18
- Requires-Dist: fastmcp~=2.8.1
11
+ Requires-Dist: typer~=0.15
12
+ Requires-Dist: pydantic-yaml~=1.4
13
+ Requires-Dist: meshagent-api~=0.0.35
14
+ Requires-Dist: meshagent-agents~=0.0.35
15
+ Requires-Dist: meshagent-tools~=0.0.35
16
+ Requires-Dist: meshagent-mcp~=0.0.35
17
+ Requires-Dist: supabase~=2.15
18
+ Requires-Dist: fastmcp~=2.8
19
19
 
20
20
  ### Meshagent CLI
21
21
 
@@ -0,0 +1,8 @@
1
+ typer~=0.15
2
+ pydantic-yaml~=1.4
3
+ meshagent-api~=0.0.35
4
+ meshagent-agents~=0.0.35
5
+ meshagent-tools~=0.0.35
6
+ meshagent-mcp~=0.0.35
7
+ supabase~=2.15
8
+ fastmcp~=2.8
@@ -9,14 +9,14 @@ requires-python = ">=3.12"
9
9
  license = "Apache-2.0"
10
10
  keywords = []
11
11
  dependencies = [
12
- "typer~=0.15.3",
13
- "pydantic-yaml~=1.4.0",
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
- "supabase~=2.15.1",
19
- "fastmcp~=2.8.1"
12
+ "typer~=0.15",
13
+ "pydantic-yaml~=1.4",
14
+ "meshagent-api~=0.0.35",
15
+ "meshagent-agents~=0.0.35",
16
+ "meshagent-tools~=0.0.35",
17
+ "meshagent-mcp~=0.0.35",
18
+ "supabase~=2.15",
19
+ "fastmcp~=2.8"
20
20
  ]
21
21
  dynamic = ["version", "readme"]
22
22
 
@@ -1,63 +0,0 @@
1
- import typer
2
- import asyncio
3
-
4
- from meshagent.cli import auth
5
- from meshagent.cli import api_keys
6
- from meshagent.cli import projects
7
- from meshagent.cli import sessions
8
- from meshagent.cli import participant_token
9
- from meshagent.cli import agent
10
- from meshagent.cli import messaging
11
- from meshagent.cli import storage
12
- from meshagent.cli import developer
13
- from meshagent.cli import webhook
14
- from meshagent.cli import services
15
- from meshagent.cli import cli_secrets
16
- from meshagent.cli import call
17
- from meshagent.cli import cli_mcp
18
- from meshagent.cli import chatbot
19
- from meshagent.cli import voicebot
20
- from meshagent.cli import tty
21
-
22
- app = typer.Typer()
23
- app.add_typer(call.app, name="call")
24
- app.add_typer(auth.app, name="auth")
25
- app.add_typer(projects.app, name="project")
26
- app.add_typer(api_keys.app, name="api-key")
27
- app.add_typer(sessions.app, name="session")
28
- app.add_typer(participant_token.app, name="participant-token")
29
- app.add_typer(agent.app, name="agents")
30
- app.add_typer(messaging.app, name="messaging")
31
- app.add_typer(storage.app, name="storage")
32
- app.add_typer(developer.app, name="developer")
33
- app.add_typer(webhook.app, name="webhook")
34
- app.add_typer(services.app, name="service")
35
- app.add_typer(cli_secrets.app, name="secret")
36
- app.add_typer(cli_mcp.app, name="mcp")
37
- app.add_typer(chatbot.app, name="chatbot")
38
- app.add_typer(voicebot.app, name="voicebot")
39
- app.add_typer(tty.app, name="tty")
40
-
41
- def _run_async(coro):
42
- asyncio.run(coro)
43
-
44
- @app.command("setup")
45
- def setup_command():
46
- """Perform initial login and project/api key activation."""
47
-
48
- async def runner():
49
- await auth.login()
50
- print("Activate a project...")
51
- project_id = await projects.activate(None, interactive=True)
52
- if project_id is None:
53
- print("You have choosen to not activate a project. Exiting.")
54
- if project_id is not None:
55
- print("Activate an api-key...")
56
- api_key_id = await api_keys.activate(None, interactive=True)
57
- if api_key_id is None:
58
- print("You have choosen to not activate an api-key. Exiting.")
59
-
60
- _run_async(runner())
61
-
62
- if __name__ == "__main__":
63
- app()
@@ -1 +0,0 @@
1
- __version__ = "0.0.34"
@@ -1,8 +0,0 @@
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
File without changes
File without changes