meshagent-cli 0.0.34__py3-none-any.whl → 0.0.35__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.

@@ -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()
meshagent/cli/chatbot.py CHANGED
@@ -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 = []
meshagent/cli/cli.py CHANGED
@@ -1,5 +1,6 @@
1
1
  import typer
2
2
  import asyncio
3
+ from typing import Optional
3
4
 
4
5
  from meshagent.cli import auth
5
6
  from meshagent.cli import api_keys
@@ -41,6 +42,131 @@ app.add_typer(tty.app, name="tty")
41
42
  def _run_async(coro):
42
43
  asyncio.run(coro)
43
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
+
44
170
  @app.command("setup")
45
171
  def setup_command():
46
172
  """Perform initial login and project/api key activation."""
meshagent/cli/tty.py CHANGED
@@ -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
 
meshagent/cli/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.0.34"
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
 
@@ -3,10 +3,10 @@ meshagent/cli/agent.py,sha256=0VjwJkwZ-G637Mps3OtxxWIfjWbrirJ4TTq2Idvjtug,10023
3
3
  meshagent/cli/api_keys.py,sha256=VZynVFCBwxcwJ6dtxcoqKB91B0_QsUfJTim4vUXGvKc,4550
4
4
  meshagent/cli/async_typer.py,sha256=GCeSefBDbpd-V4V8LrvHGUTBMth3HspVMfFa-HUZ0cg,898
5
5
  meshagent/cli/auth.py,sha256=pZQwYTNWQOWTqpyDrkQLNKuidH-wn9GNE5yEJoxn3-g,767
6
- meshagent/cli/auth_async.py,sha256=LArKxTxQAPmItv0JaGkW3Ybutl6MVmb6_EeSjI18IbI,4001
6
+ meshagent/cli/auth_async.py,sha256=run_J11mRPJQ6BI_aAtV_3O3h52eAl1EOnHuotwhoqQ,4018
7
7
  meshagent/cli/call.py,sha256=-6Bf5PCVcsuLMgDpG1g3GiY3S5rgs_-CWgWX4C6AXwg,4739
8
- meshagent/cli/chatbot.py,sha256=qFPSYbJGIjInOemlYS03vnZ87-VbrUBGcvXufKuT2WY,6435
9
- meshagent/cli/cli.py,sha256=jogOzdPS1u6TXURLq85x9vZDuiwcJ8Brn7joC8GymlE,2128
8
+ meshagent/cli/chatbot.py,sha256=_ZuEpWwj1tYpu4CxuoQ4OXAk4LEkD1Qfmt-bOsjkkBU,6437
9
+ meshagent/cli/cli.py,sha256=L3DaoAy03buBemBiltTSgcV9aq9I044pkg6zoZPKzYc,5937
10
10
  meshagent/cli/cli_mcp.py,sha256=SG0r-cL3P7eu-fbwB-1WgjQPCmxKqQBh-X3kTKDli-E,9536
11
11
  meshagent/cli/cli_secrets.py,sha256=U0kdzN3zt7JIqzdRLynAjxdvAsI0enesBd_m7TeXjnQ,13629
12
12
  meshagent/cli/developer.py,sha256=5eoDr3kfi-IufA5d6OESqNr739Bdut_IFBtT3nq0xZU,3002
@@ -17,12 +17,12 @@ meshagent/cli/projects.py,sha256=EQfbO9_GQKkjlFcaSHQfIxqIxsmFR3FbH5Fd17I5IPk,330
17
17
  meshagent/cli/services.py,sha256=pMAyLg0eEO33fhRiin5q0KbNVoTzQyT5wSDgvDqeRYM,11241
18
18
  meshagent/cli/sessions.py,sha256=WWvuztYqRfthSq6ztwL_eQ_sz9JRc33jcN6p7YyM_Fs,782
19
19
  meshagent/cli/storage.py,sha256=Se_4xhxiihIovSR1ajlEWo_YZ12G7eUY_-lvifJ8pjo,33806
20
- meshagent/cli/tty.py,sha256=F1-ZKEl-kfKSFPvwsX8S99E9xbq7WyApbZGLs5_I-Bw,4081
21
- meshagent/cli/version.py,sha256=IeOAFvenopBWYv9ajaYlgGYiPXMiGT008qnpbTQ0HPU,23
20
+ meshagent/cli/tty.py,sha256=DkgeYQckjil191HNoEGHmheniCi41XNUSMpYY1ilAic,4099
21
+ meshagent/cli/version.py,sha256=QmUV3Ydc9xA0pOuihDI_wM1kvEzVZrdkq2eiedTW2UA,23
22
22
  meshagent/cli/voicebot.py,sha256=5vB0yzcKVvQ-nq2in51Xlf-rWbJB8Mjc8V44me6mUD4,4701
23
23
  meshagent/cli/webhook.py,sha256=KBl8U1TcOX3z2uoyH4YMuUuw0vSVX7xpRxYvzxI5c-Y,2811
24
- meshagent_cli-0.0.34.dist-info/METADATA,sha256=E77RQqtneIqGLXHZmNcXAqlwHNWqaaGTPfkVqZVg0rI,635
25
- meshagent_cli-0.0.34.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
26
- meshagent_cli-0.0.34.dist-info/entry_points.txt,sha256=WRcGGN4vMtvC5Pgl3uRFqsJiQXNoHuLLa-TCSY3gAhQ,52
27
- meshagent_cli-0.0.34.dist-info/top_level.txt,sha256=GlcXnHtRP6m7zlG3Df04M35OsHtNXy_DY09oFwWrH74,10
28
- meshagent_cli-0.0.34.dist-info/RECORD,,
24
+ meshagent_cli-0.0.35.dist-info/METADATA,sha256=5tcx5aulHPt6KgjOIdaih5sXkMGB1Dp7SiLPIg5H7o4,627
25
+ meshagent_cli-0.0.35.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
26
+ meshagent_cli-0.0.35.dist-info/entry_points.txt,sha256=WRcGGN4vMtvC5Pgl3uRFqsJiQXNoHuLLa-TCSY3gAhQ,52
27
+ meshagent_cli-0.0.35.dist-info/top_level.txt,sha256=GlcXnHtRP6m7zlG3Df04M35OsHtNXy_DY09oFwWrH74,10
28
+ meshagent_cli-0.0.35.dist-info/RECORD,,