meshagent-cli 0.22.2__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/__init__.py +3 -0
- meshagent/cli/agent.py +273 -0
- meshagent/cli/api_keys.py +102 -0
- meshagent/cli/async_typer.py +79 -0
- meshagent/cli/auth.py +30 -0
- meshagent/cli/auth_async.py +295 -0
- meshagent/cli/call.py +215 -0
- meshagent/cli/chatbot.py +1983 -0
- meshagent/cli/cli.py +187 -0
- meshagent/cli/cli_mcp.py +408 -0
- meshagent/cli/cli_secrets.py +414 -0
- meshagent/cli/common_options.py +47 -0
- meshagent/cli/containers.py +725 -0
- meshagent/cli/database.py +997 -0
- meshagent/cli/developer.py +70 -0
- meshagent/cli/exec.py +397 -0
- meshagent/cli/helper.py +236 -0
- meshagent/cli/helpers.py +185 -0
- meshagent/cli/host.py +41 -0
- meshagent/cli/mailbot.py +1295 -0
- meshagent/cli/mailboxes.py +223 -0
- meshagent/cli/meeting_transcriber.py +138 -0
- meshagent/cli/messaging.py +157 -0
- meshagent/cli/multi.py +357 -0
- meshagent/cli/oauth2.py +341 -0
- meshagent/cli/participant_token.py +63 -0
- meshagent/cli/port.py +70 -0
- meshagent/cli/projects.py +105 -0
- meshagent/cli/queue.py +91 -0
- meshagent/cli/room.py +26 -0
- meshagent/cli/rooms.py +214 -0
- meshagent/cli/services.py +722 -0
- meshagent/cli/sessions.py +26 -0
- meshagent/cli/storage.py +813 -0
- meshagent/cli/sync.py +434 -0
- meshagent/cli/task_runner.py +1317 -0
- meshagent/cli/version.py +1 -0
- meshagent/cli/voicebot.py +624 -0
- meshagent/cli/webhook.py +100 -0
- meshagent/cli/worker.py +1403 -0
- meshagent_cli-0.22.2.dist-info/METADATA +49 -0
- meshagent_cli-0.22.2.dist-info/RECORD +45 -0
- meshagent_cli-0.22.2.dist-info/WHEEL +5 -0
- meshagent_cli-0.22.2.dist-info/entry_points.txt +2 -0
- meshagent_cli-0.22.2.dist-info/top_level.txt +1 -0
meshagent/cli/webhook.py
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import typer
|
|
2
|
+
from rich import print
|
|
3
|
+
import json
|
|
4
|
+
from typing import Annotated, List, Optional
|
|
5
|
+
from meshagent.cli.common_options import ProjectIdOption
|
|
6
|
+
|
|
7
|
+
from meshagent.cli import async_typer
|
|
8
|
+
from meshagent.cli.helper import get_client, print_json_table, resolve_project_id
|
|
9
|
+
|
|
10
|
+
app = async_typer.AsyncTyper(help="Manage project webhooks")
|
|
11
|
+
|
|
12
|
+
# ---------------------------------------------------------------------------
|
|
13
|
+
# Webhook commands
|
|
14
|
+
# ---------------------------------------------------------------------------
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@app.async_command("create", help="Create a webhook")
|
|
18
|
+
async def webhook_create(
|
|
19
|
+
*,
|
|
20
|
+
project_id: ProjectIdOption,
|
|
21
|
+
name: Annotated[str, typer.Option(help="Friendly name for the webhook")],
|
|
22
|
+
url: Annotated[str, typer.Option(help="Target URL that will receive POSTs")],
|
|
23
|
+
event: Annotated[
|
|
24
|
+
List[str],
|
|
25
|
+
typer.Option(
|
|
26
|
+
"-e", "--event", help="Event to subscribe to (repeat for multiple)."
|
|
27
|
+
),
|
|
28
|
+
],
|
|
29
|
+
description: Annotated[
|
|
30
|
+
str, typer.Option(default="", help="Optional description")
|
|
31
|
+
] = "",
|
|
32
|
+
action: Annotated[
|
|
33
|
+
Optional[str],
|
|
34
|
+
typer.Option("--action", help="Optional action name delivered with each call"),
|
|
35
|
+
] = None,
|
|
36
|
+
payload: Annotated[
|
|
37
|
+
Optional[str],
|
|
38
|
+
typer.Option(
|
|
39
|
+
"--payload",
|
|
40
|
+
help="Optional JSON string sent as the body (merged with event payload).",
|
|
41
|
+
),
|
|
42
|
+
] = None,
|
|
43
|
+
):
|
|
44
|
+
"""Create a new project webhook."""
|
|
45
|
+
client = await get_client()
|
|
46
|
+
try:
|
|
47
|
+
project_id = await resolve_project_id(project_id=project_id)
|
|
48
|
+
|
|
49
|
+
payload_obj = json.loads(payload) if payload else None
|
|
50
|
+
webhook = await client.create_webhook(
|
|
51
|
+
project_id=project_id,
|
|
52
|
+
name=name,
|
|
53
|
+
url=url,
|
|
54
|
+
events=event,
|
|
55
|
+
description=description,
|
|
56
|
+
action=action,
|
|
57
|
+
payload=payload_obj,
|
|
58
|
+
)
|
|
59
|
+
print_json_table([webhook])
|
|
60
|
+
finally:
|
|
61
|
+
await client.close()
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@app.async_command("list", help="List webhooks")
|
|
65
|
+
async def webhook_list(
|
|
66
|
+
*,
|
|
67
|
+
project_id: ProjectIdOption,
|
|
68
|
+
):
|
|
69
|
+
"""List all webhooks for the project."""
|
|
70
|
+
client = await get_client()
|
|
71
|
+
try:
|
|
72
|
+
project_id = await resolve_project_id(project_id=project_id)
|
|
73
|
+
hooks = await client.list_webhooks(project_id)
|
|
74
|
+
print_json_table(
|
|
75
|
+
hooks.get("webhooks"),
|
|
76
|
+
"id",
|
|
77
|
+
"name",
|
|
78
|
+
"description",
|
|
79
|
+
"url",
|
|
80
|
+
"events",
|
|
81
|
+
"action",
|
|
82
|
+
)
|
|
83
|
+
finally:
|
|
84
|
+
await client.close()
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
@app.async_command("delete", help="Delete a webhook")
|
|
88
|
+
async def webhook_delete(
|
|
89
|
+
*,
|
|
90
|
+
project_id: ProjectIdOption,
|
|
91
|
+
webhook_id: Annotated[str, typer.Argument(help="ID of the webhook to delete")],
|
|
92
|
+
):
|
|
93
|
+
"""Delete a project webhook."""
|
|
94
|
+
client = await get_client()
|
|
95
|
+
try:
|
|
96
|
+
project_id = await resolve_project_id(project_id=project_id)
|
|
97
|
+
await client.delete_webhook(project_id, webhook_id)
|
|
98
|
+
print(f"[green]Webhook {webhook_id} deleted.[/]")
|
|
99
|
+
finally:
|
|
100
|
+
await client.close()
|