meshagent-cli 0.0.22__py3-none-any.whl → 0.0.23__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/services.py +50 -19
- meshagent/cli/version.py +1 -1
- {meshagent_cli-0.0.22.dist-info → meshagent_cli-0.0.23.dist-info}/METADATA +5 -5
- {meshagent_cli-0.0.22.dist-info → meshagent_cli-0.0.23.dist-info}/RECORD +7 -7
- {meshagent_cli-0.0.22.dist-info → meshagent_cli-0.0.23.dist-info}/WHEEL +1 -1
- {meshagent_cli-0.0.22.dist-info → meshagent_cli-0.0.23.dist-info}/entry_points.txt +0 -0
- {meshagent_cli-0.0.22.dist-info → meshagent_cli-0.0.23.dist-info}/top_level.txt +0 -0
meshagent/cli/services.py
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import typer
|
|
5
5
|
from rich import print
|
|
6
6
|
from typing import Annotated, List, Optional, Dict
|
|
7
|
+
from aiohttp import ClientResponseError
|
|
7
8
|
from datetime import datetime, timezone
|
|
8
9
|
from pydantic_yaml import parse_yaml_raw_as, to_yaml_str
|
|
9
10
|
from pydantic import PositiveInt
|
|
@@ -21,6 +22,7 @@ app = async_typer.AsyncTyper()
|
|
|
21
22
|
# Utilities
|
|
22
23
|
# ---------------------------------------------------------------------------
|
|
23
24
|
|
|
25
|
+
|
|
24
26
|
def _kv_to_dict(pairs: List[str]) -> Dict[str, str]:
|
|
25
27
|
"""Convert ["A=1","B=2"] → {"A":"1","B":"2"}."""
|
|
26
28
|
out: Dict[str, str] = {}
|
|
@@ -31,17 +33,20 @@ def _kv_to_dict(pairs: List[str]) -> Dict[str, str]:
|
|
|
31
33
|
out[k] = v
|
|
32
34
|
return out
|
|
33
35
|
|
|
36
|
+
|
|
34
37
|
class PortSpec(pydantic.BaseModel):
|
|
35
38
|
"""
|
|
36
39
|
CLI schema for --port.
|
|
37
40
|
Example:
|
|
38
|
-
--port num=8080 type=webserver liveness=/health
|
|
41
|
+
--port num=8080 type=webserver liveness=/health path=path
|
|
39
42
|
"""
|
|
43
|
+
|
|
40
44
|
num: PositiveInt
|
|
41
45
|
type: Literal["mcp.sse", "meshagent.callable", "http", "tcp"]
|
|
42
46
|
liveness: str | None = None
|
|
43
47
|
participant_name: str | None = None
|
|
44
48
|
|
|
49
|
+
|
|
45
50
|
def _parse_port_spec(spec: str) -> PortSpec:
|
|
46
51
|
"""
|
|
47
52
|
Convert "num=8080 type=webserver liveness=/health" → PortSpec.
|
|
@@ -64,6 +69,7 @@ def _parse_port_spec(spec: str) -> PortSpec:
|
|
|
64
69
|
# Commands
|
|
65
70
|
# ---------------------------------------------------------------------------
|
|
66
71
|
|
|
72
|
+
|
|
67
73
|
@app.async_command("create")
|
|
68
74
|
async def service_create(
|
|
69
75
|
*,
|
|
@@ -91,7 +97,7 @@ async def service_create(
|
|
|
91
97
|
"--port",
|
|
92
98
|
"-p",
|
|
93
99
|
help=(
|
|
94
|
-
|
|
100
|
+
"Repeatable. Example:\n"
|
|
95
101
|
' -p "num=8080 type=[mcp.sse | meshagent.callable | http | tcp] liveness=/health"'
|
|
96
102
|
),
|
|
97
103
|
),
|
|
@@ -105,17 +111,14 @@ async def service_create(
|
|
|
105
111
|
# ✅ validate / coerce port specs
|
|
106
112
|
port_specs: List[PortSpec] = [_parse_port_spec(s) for s in port]
|
|
107
113
|
|
|
108
|
-
ports_dict =
|
|
109
|
-
|
|
110
|
-
ps.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
or None
|
|
118
|
-
)
|
|
114
|
+
ports_dict = {
|
|
115
|
+
ps.num: Port(
|
|
116
|
+
type=ps.type,
|
|
117
|
+
liveness=ps.liveness,
|
|
118
|
+
participant_name=ps.participant_name,
|
|
119
|
+
)
|
|
120
|
+
for ps in port_specs
|
|
121
|
+
} or None
|
|
119
122
|
|
|
120
123
|
service_obj = Service(
|
|
121
124
|
id="",
|
|
@@ -131,19 +134,35 @@ async def service_create(
|
|
|
131
134
|
ports=ports_dict,
|
|
132
135
|
)
|
|
133
136
|
|
|
134
|
-
|
|
135
|
-
|
|
137
|
+
try:
|
|
138
|
+
new_id = (
|
|
139
|
+
await client.create_service(project_id=project_id, service=service_obj)
|
|
140
|
+
)["id"]
|
|
141
|
+
except ClientResponseError as exc:
|
|
142
|
+
if exc.status == 409:
|
|
143
|
+
print(f"[red]Service name already in use: {name}[/red]")
|
|
144
|
+
raise typer.Exit(code=1)
|
|
145
|
+
raise
|
|
146
|
+
else:
|
|
147
|
+
print(f"[green]Created service:[/] {new_id}")
|
|
136
148
|
|
|
137
149
|
finally:
|
|
138
150
|
await client.close()
|
|
139
151
|
|
|
152
|
+
|
|
140
153
|
@app.async_command("show")
|
|
141
|
-
async def service_show(
|
|
154
|
+
async def service_show(
|
|
155
|
+
*,
|
|
156
|
+
project_id: str = None,
|
|
157
|
+
service_id: Annotated[str, typer.Argument(help="ID of the service to delete")],
|
|
158
|
+
):
|
|
142
159
|
"""Show a services for the project."""
|
|
143
160
|
client = await get_client()
|
|
144
161
|
try:
|
|
145
162
|
project_id = await resolve_project_id(project_id)
|
|
146
|
-
service = await client.get_service(
|
|
163
|
+
service = await client.get_service(
|
|
164
|
+
project_id=project_id, service_id=service_id
|
|
165
|
+
) # → List[Service]
|
|
147
166
|
print(service.model_dump(mode="json"))
|
|
148
167
|
finally:
|
|
149
168
|
await client.close()
|
|
@@ -155,8 +174,20 @@ async def service_list(*, project_id: str = None):
|
|
|
155
174
|
client = await get_client()
|
|
156
175
|
try:
|
|
157
176
|
project_id = await resolve_project_id(project_id)
|
|
158
|
-
services
|
|
159
|
-
|
|
177
|
+
services: list[Service] = await client.list_services(
|
|
178
|
+
project_id=project_id
|
|
179
|
+
) # → List[Service]
|
|
180
|
+
print_json_table(
|
|
181
|
+
[svc.model_dump(mode="json") for svc in services],
|
|
182
|
+
"id",
|
|
183
|
+
"name",
|
|
184
|
+
"image",
|
|
185
|
+
"command",
|
|
186
|
+
"room_storage_path",
|
|
187
|
+
"pull_secret",
|
|
188
|
+
"environment_secrets",
|
|
189
|
+
"ports",
|
|
190
|
+
)
|
|
160
191
|
finally:
|
|
161
192
|
await client.close()
|
|
162
193
|
|
meshagent/cli/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.0.
|
|
1
|
+
__version__ = "0.0.23"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meshagent-cli
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.23
|
|
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.
|
|
14
|
-
Requires-Dist: meshagent-agents~=0.0.
|
|
15
|
-
Requires-Dist: meshagent-tools~=0.0.
|
|
16
|
-
Requires-Dist: meshagent-mcp~=0.0.
|
|
13
|
+
Requires-Dist: meshagent-api~=0.0.23
|
|
14
|
+
Requires-Dist: meshagent-agents~=0.0.23
|
|
15
|
+
Requires-Dist: meshagent-tools~=0.0.23
|
|
16
|
+
Requires-Dist: meshagent-mcp~=0.0.23
|
|
17
17
|
Requires-Dist: supabase~=2.15.1
|
|
18
18
|
|
|
19
19
|
### Meshagent CLI
|
|
@@ -13,13 +13,13 @@ meshagent/cli/helper.py,sha256=hcY6C5BqGnYmwFVIG7nS9NPIZXbdpOoEna-t0mYmHGY,4632
|
|
|
13
13
|
meshagent/cli/messaging.py,sha256=cU6LIK6gwOveLo_x2x3iWW5rC4MhDpwp2hvehAkvybI,6068
|
|
14
14
|
meshagent/cli/participant_token.py,sha256=uCGmlUgNOfarYGkDZpzreXwnv9AJrM76tu5Lt690vYU,1456
|
|
15
15
|
meshagent/cli/projects.py,sha256=Tut8kRCVvgdWzlAR1Zqf0QxAi4sNfQEIHY9zxfS1nuI,1100
|
|
16
|
-
meshagent/cli/services.py,sha256=
|
|
16
|
+
meshagent/cli/services.py,sha256=p6s1IlKqVBCbI270IAjaoGc0sgVTHdHo0IZXm8CxYO4,6588
|
|
17
17
|
meshagent/cli/sessions.py,sha256=WWvuztYqRfthSq6ztwL_eQ_sz9JRc33jcN6p7YyM_Fs,782
|
|
18
18
|
meshagent/cli/storage.py,sha256=BsagaJfThrUWqXFyAk9IvQtUuDAMckE2mffZ_peozMo,33555
|
|
19
|
-
meshagent/cli/version.py,sha256=
|
|
19
|
+
meshagent/cli/version.py,sha256=CO0VmekjZ_r8LBYVaUXTM3i08rEVwYKhjb9sy0X7vz0,23
|
|
20
20
|
meshagent/cli/webhook.py,sha256=KBl8U1TcOX3z2uoyH4YMuUuw0vSVX7xpRxYvzxI5c-Y,2811
|
|
21
|
-
meshagent_cli-0.0.
|
|
22
|
-
meshagent_cli-0.0.
|
|
23
|
-
meshagent_cli-0.0.
|
|
24
|
-
meshagent_cli-0.0.
|
|
25
|
-
meshagent_cli-0.0.
|
|
21
|
+
meshagent_cli-0.0.23.dist-info/METADATA,sha256=-RP4HkPhX8aaLsZzZUVJT8Htu31g0HsW_nTENIgNMg4,605
|
|
22
|
+
meshagent_cli-0.0.23.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
23
|
+
meshagent_cli-0.0.23.dist-info/entry_points.txt,sha256=WRcGGN4vMtvC5Pgl3uRFqsJiQXNoHuLLa-TCSY3gAhQ,52
|
|
24
|
+
meshagent_cli-0.0.23.dist-info/top_level.txt,sha256=GlcXnHtRP6m7zlG3Df04M35OsHtNXy_DY09oFwWrH74,10
|
|
25
|
+
meshagent_cli-0.0.23.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|