sunholo 0.116.0__py3-none-any.whl → 0.116.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.
- sunholo/cli/cli.py +3 -3
- sunholo/mcp/cli.py +69 -25
- {sunholo-0.116.0.dist-info → sunholo-0.116.2.dist-info}/METADATA +9 -2
- {sunholo-0.116.0.dist-info → sunholo-0.116.2.dist-info}/RECORD +8 -8
- {sunholo-0.116.0.dist-info → sunholo-0.116.2.dist-info}/LICENSE.txt +0 -0
- {sunholo-0.116.0.dist-info → sunholo-0.116.2.dist-info}/WHEEL +0 -0
- {sunholo-0.116.0.dist-info → sunholo-0.116.2.dist-info}/entry_points.txt +0 -0
- {sunholo-0.116.0.dist-info → sunholo-0.116.2.dist-info}/top_level.txt +0 -0
sunholo/cli/cli.py
CHANGED
|
@@ -16,7 +16,6 @@ from ..terraform import setup_tfvarseditor_subparser
|
|
|
16
16
|
from ..senses.stream_voice import setup_tts_subparser
|
|
17
17
|
from ..mcp.cli import setup_mcp_subparser
|
|
18
18
|
|
|
19
|
-
|
|
20
19
|
from ..utils import ConfigManager
|
|
21
20
|
from ..utils.version import sunholo_version
|
|
22
21
|
|
|
@@ -24,7 +23,7 @@ from ..custom_logging import log
|
|
|
24
23
|
|
|
25
24
|
from .sun_rich import console
|
|
26
25
|
import sys
|
|
27
|
-
|
|
26
|
+
|
|
28
27
|
|
|
29
28
|
def load_default_gcp_config():
|
|
30
29
|
try:
|
|
@@ -43,6 +42,7 @@ class CustomHelpAction(argparse.Action):
|
|
|
43
42
|
super().__init__(option_strings, dest, nargs=nargs, **kwargs)
|
|
44
43
|
|
|
45
44
|
def __call__(self, parser, namespace, values, option_string=None):
|
|
45
|
+
from rich.panel import Panel
|
|
46
46
|
console.print(
|
|
47
47
|
Panel("Welcome to Sunholo Command Line Interface, your assistant to deploy GenAI Virtual Agent Computers (VACs) to Multivac or your own Cloud.",
|
|
48
48
|
title="Sunholo GenAIOps Assistant CLI",
|
|
@@ -64,7 +64,7 @@ def main(args=None):
|
|
|
64
64
|
"""
|
|
65
65
|
default_project, default_region = load_default_gcp_config()
|
|
66
66
|
|
|
67
|
-
parser = argparse.ArgumentParser(description="sunholo CLI tool for deploying GenAI VACs", add_help=False)
|
|
67
|
+
parser = argparse.ArgumentParser(description=f"sunholo CLI tool for deploying GenAI VACs - [{sunholo_version()}]", add_help=False)
|
|
68
68
|
parser.add_argument('-h', '--help', action=CustomHelpAction, help='Show this help message and exit')
|
|
69
69
|
parser.add_argument('--debug', action='store_true', help='Enable debug output')
|
|
70
70
|
parser.add_argument('--project', default=default_project, help='GCP project to list Cloud Run services from.')
|
sunholo/mcp/cli.py
CHANGED
|
@@ -3,16 +3,8 @@ import asyncio
|
|
|
3
3
|
from typing import Any, Sequence
|
|
4
4
|
from functools import lru_cache
|
|
5
5
|
import subprocess
|
|
6
|
-
from
|
|
7
|
-
|
|
8
|
-
from mcp.types import (
|
|
9
|
-
Resource,
|
|
10
|
-
Tool,
|
|
11
|
-
TextContent,
|
|
12
|
-
ImageContent,
|
|
13
|
-
EmbeddedResource,
|
|
14
|
-
)
|
|
15
|
-
"""
|
|
6
|
+
from ..utils.version import sunholo_version
|
|
7
|
+
|
|
16
8
|
try:
|
|
17
9
|
from mcp.server import Server
|
|
18
10
|
from mcp.server.stdio import stdio_server
|
|
@@ -23,24 +15,35 @@ try:
|
|
|
23
15
|
ImageContent,
|
|
24
16
|
EmbeddedResource,
|
|
25
17
|
)
|
|
18
|
+
|
|
19
|
+
from rich import print
|
|
20
|
+
from ..cli.sun_rich import console
|
|
26
21
|
except ImportError:
|
|
27
22
|
Server = None
|
|
28
|
-
|
|
23
|
+
console = None
|
|
29
24
|
|
|
30
25
|
from pydantic import AnyUrl
|
|
31
26
|
|
|
32
27
|
# Configure logging
|
|
33
28
|
from ..custom_logging import setup_logging
|
|
34
|
-
logger = setup_logging("sunholo-mcp
|
|
29
|
+
logger = setup_logging("sunholo-mcp")
|
|
35
30
|
|
|
36
31
|
class SunholoMCPServer:
|
|
37
32
|
def __init__(self):
|
|
33
|
+
logger.info("Initializing Sunholo MCP Server")
|
|
34
|
+
|
|
38
35
|
if Server is None:
|
|
39
36
|
raise ImportError("SunholoMCPServer requires `sunholo[anthropic]` to be installed")
|
|
40
37
|
|
|
41
38
|
self.server = Server("sunholo-mcp-server")
|
|
39
|
+
self.server.onerror = self.handle_error
|
|
40
|
+
|
|
42
41
|
self.setup_handlers()
|
|
43
42
|
|
|
43
|
+
def handle_error(self, error: Exception):
|
|
44
|
+
"""Handle server errors"""
|
|
45
|
+
logger.error(f"MCP Server error: {error}", exc_info=True)
|
|
46
|
+
|
|
44
47
|
def setup_handlers(self):
|
|
45
48
|
"""Set up all the MCP protocol handlers"""
|
|
46
49
|
self.setup_resource_handlers()
|
|
@@ -64,11 +67,13 @@ class SunholoMCPServer:
|
|
|
64
67
|
@self.server.read_resource()
|
|
65
68
|
async def read_resource(uri: AnyUrl) -> str:
|
|
66
69
|
"""Read Sunholo resources based on URI"""
|
|
70
|
+
logger.info(f"{uri} available")
|
|
71
|
+
console.print(f"{uri} available")
|
|
67
72
|
if str(uri) == "sunholo://vacs/list":
|
|
68
73
|
try:
|
|
69
74
|
# Execute sunholo vac list command
|
|
70
75
|
result = subprocess.run(
|
|
71
|
-
["sunholo", "vac", "list"
|
|
76
|
+
["sunholo", "vac", "list"],
|
|
72
77
|
capture_output=True,
|
|
73
78
|
text=True
|
|
74
79
|
)
|
|
@@ -101,15 +106,31 @@ class SunholoMCPServer:
|
|
|
101
106
|
"type": "string",
|
|
102
107
|
"description": "Message to send to the VAC"
|
|
103
108
|
},
|
|
104
|
-
"headless": {
|
|
105
|
-
"type": "boolean",
|
|
106
|
-
"description": "Whether to run in headless mode",
|
|
107
|
-
"default": True
|
|
108
|
-
}
|
|
109
109
|
},
|
|
110
110
|
"required": ["vac_name", "message"]
|
|
111
111
|
}
|
|
112
112
|
),
|
|
113
|
+
Tool(
|
|
114
|
+
name="list_configs",
|
|
115
|
+
description="List Sunholo configurations",
|
|
116
|
+
inputSchema={
|
|
117
|
+
"type": "object",
|
|
118
|
+
"properties": {
|
|
119
|
+
"kind": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"description": "Filter configurations by kind e.g. vacConfig"
|
|
122
|
+
},
|
|
123
|
+
"vac": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"description": "Filter configurations by VAC name"
|
|
126
|
+
},
|
|
127
|
+
"validate": {
|
|
128
|
+
"type": "boolean",
|
|
129
|
+
"description": "Validate the configuration files"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
),
|
|
113
134
|
Tool(
|
|
114
135
|
name="embed_content",
|
|
115
136
|
description="Embed content in a VAC's vector store",
|
|
@@ -148,15 +169,13 @@ class SunholoMCPServer:
|
|
|
148
169
|
|
|
149
170
|
vac_name = arguments.get("vac_name")
|
|
150
171
|
message = arguments.get("message")
|
|
151
|
-
headless = arguments.get("headless", True)
|
|
152
172
|
|
|
153
173
|
if not vac_name or not message:
|
|
154
174
|
raise ValueError("Missing required arguments")
|
|
155
175
|
|
|
156
176
|
try:
|
|
157
177
|
cmd = ["sunholo", "vac", "chat", vac_name, message]
|
|
158
|
-
|
|
159
|
-
cmd.append("--headless")
|
|
178
|
+
cmd.append("--headless")
|
|
160
179
|
|
|
161
180
|
result = subprocess.run(
|
|
162
181
|
cmd,
|
|
@@ -213,6 +232,25 @@ class SunholoMCPServer:
|
|
|
213
232
|
text=f"Error embedding content: {e.stderr}"
|
|
214
233
|
)
|
|
215
234
|
]
|
|
235
|
+
elif name == "list_configs":
|
|
236
|
+
|
|
237
|
+
# Build command
|
|
238
|
+
cmd = ["sunholo", "list-configs"]
|
|
239
|
+
|
|
240
|
+
if arguments.get("kind"):
|
|
241
|
+
cmd.extend(["--kind", arguments["kind"]])
|
|
242
|
+
if arguments.get("vac"):
|
|
243
|
+
cmd.extend(["--vac", arguments["vac"]])
|
|
244
|
+
if arguments.get("validate"):
|
|
245
|
+
cmd.append("--validate")
|
|
246
|
+
|
|
247
|
+
# Execute sunholo command
|
|
248
|
+
try:
|
|
249
|
+
result = subprocess.run(cmd, capture_output=True, text=True)
|
|
250
|
+
return [TextContent(type="text", text=result.stdout)]
|
|
251
|
+
except subprocess.CalledProcessError as e:
|
|
252
|
+
return [TextContent(type="text", text=f"Error: {e.stderr}")]
|
|
253
|
+
|
|
216
254
|
|
|
217
255
|
raise ValueError(f"Unknown tool: {name}")
|
|
218
256
|
|
|
@@ -229,10 +267,16 @@ def cli_mcp(args):
|
|
|
229
267
|
"""CLI handler for the MCP server command"""
|
|
230
268
|
try:
|
|
231
269
|
|
|
270
|
+
if not os.getenv("VAC_CONFIG_FOLDER"):
|
|
271
|
+
raise ValueError("sunholo configuration folder must be present in config/ or via VAC_CONFIG_FOLDER")
|
|
272
|
+
|
|
232
273
|
# Create and run the MCP server
|
|
233
274
|
server = SunholoMCPServer()
|
|
234
|
-
|
|
235
|
-
|
|
275
|
+
msg = {"message": "Starting Sunholo MCP server..."}
|
|
276
|
+
|
|
277
|
+
logger.info(msg)
|
|
278
|
+
console.print(msg)
|
|
279
|
+
|
|
236
280
|
asyncio.run(server.run())
|
|
237
281
|
|
|
238
282
|
except Exception as e:
|
|
@@ -241,9 +285,9 @@ def cli_mcp(args):
|
|
|
241
285
|
|
|
242
286
|
def setup_mcp_subparser(subparsers):
|
|
243
287
|
"""
|
|
244
|
-
Sets up an argparse subparser for the 'mcp' command.
|
|
288
|
+
Sets up an argparse subparser for the 'mcp' command 3.
|
|
245
289
|
|
|
246
|
-
By default will use configurations within the folder specified by '
|
|
290
|
+
By default will use configurations within the folder specified by 'VAC_CONFIG_FOLDER'
|
|
247
291
|
|
|
248
292
|
Example command:
|
|
249
293
|
```bash
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.116.
|
|
3
|
+
Version: 0.116.2
|
|
4
4
|
Summary: Large Language Model DevOps - a package to help deploy LLMs to the Cloud.
|
|
5
5
|
Home-page: https://github.com/sunholo-data/sunholo-py
|
|
6
|
-
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.116.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.116.2.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -62,6 +62,7 @@ Requires-Dist: langchain-anthropic==0.1.23; extra == "all"
|
|
|
62
62
|
Requires-Dist: langchain-google-vertexai; extra == "all"
|
|
63
63
|
Requires-Dist: langchain-unstructured; extra == "all"
|
|
64
64
|
Requires-Dist: langfuse; extra == "all"
|
|
65
|
+
Requires-Dist: mcp; extra == "all"
|
|
65
66
|
Requires-Dist: numpy; extra == "all"
|
|
66
67
|
Requires-Dist: pg8000; extra == "all"
|
|
67
68
|
Requires-Dist: pgvector; extra == "all"
|
|
@@ -189,6 +190,12 @@ pip install . --use-feature=in-tree-build
|
|
|
189
190
|
pytest tests
|
|
190
191
|
```
|
|
191
192
|
|
|
193
|
+
## Local dev
|
|
194
|
+
|
|
195
|
+
```sh
|
|
196
|
+
uv tool install --from "sunholo[cli]" sunholo --with ".[all]"
|
|
197
|
+
```
|
|
198
|
+
|
|
192
199
|
## Demos
|
|
193
200
|
|
|
194
201
|
Using https://github.com/charmbracelet/vhs
|
|
@@ -44,7 +44,7 @@ sunholo/chunker/pubsub.py,sha256=48bhuAcszN7LGe3-ksPSLHHhq0uKxiXOrizck5qpcP0,101
|
|
|
44
44
|
sunholo/chunker/splitter.py,sha256=RfekLPkjhCcNd1PFXIj_FxusJMJ8_3cyWl7bsYvtQ0g,7068
|
|
45
45
|
sunholo/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
46
46
|
sunholo/cli/chat_vac.py,sha256=sYPzUDwwwebJvIobv3GRW_xbQQ4BTy9G-WHdarGCHB0,23705
|
|
47
|
-
sunholo/cli/cli.py,sha256=
|
|
47
|
+
sunholo/cli/cli.py,sha256=WiWyLywKwuKR46H7a-mBLO0c7jMW-PNl8th2Mj7ioMs,4606
|
|
48
48
|
sunholo/cli/cli_init.py,sha256=u6BZFtUyFMOKrXZ46-DfET0IpH3Tl2PlOz386rADtrw,8549
|
|
49
49
|
sunholo/cli/configs.py,sha256=QUM9DvKOdZmEQRM5uI3Nh887T0YDiSMr7O240zTLqws,4546
|
|
50
50
|
sunholo/cli/deploy.py,sha256=zxdwUsRTRMC8U5vyRv0JiKBLFn84Ug_Tc88-_h9hJSs,1609
|
|
@@ -108,7 +108,7 @@ sunholo/llamaindex/user_history.py,sha256=ZtkecWuF9ORduyGB8kF8gP66bm9DdvCI-ZiK6K
|
|
|
108
108
|
sunholo/lookup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
109
109
|
sunholo/lookup/model_lookup.yaml,sha256=O7o-jP53MLA06C8pI-ILwERShO-xf6z_258wtpZBv6A,739
|
|
110
110
|
sunholo/mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
111
|
-
sunholo/mcp/cli.py,sha256=
|
|
111
|
+
sunholo/mcp/cli.py,sha256=D9IFMSffCsRO6vFayzukiVX9s3CvoFFyJUcQ0S6db1s,10660
|
|
112
112
|
sunholo/pubsub/__init__.py,sha256=DfTEk4zmCfqn6gFxRrqDO0pOrvXTDqH-medpgYO4PGw,117
|
|
113
113
|
sunholo/pubsub/process_pubsub.py,sha256=rN2N4WM6PZkMKDrdT8pnEfTvsXACRyJFqIHJQCbuxLs,3088
|
|
114
114
|
sunholo/pubsub/pubsub_manager.py,sha256=19w_N0LiG-wgVWvgJ13b8BUeN8ZzgSPXAhPmL1HRRSI,6966
|
|
@@ -149,9 +149,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
|
|
|
149
149
|
sunholo/vertex/memory_tools.py,sha256=tBZxqVZ4InTmdBvLlOYwoSEWu4-kGquc-gxDwZCC4FA,7667
|
|
150
150
|
sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
|
|
151
151
|
sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
|
|
152
|
-
sunholo-0.116.
|
|
153
|
-
sunholo-0.116.
|
|
154
|
-
sunholo-0.116.
|
|
155
|
-
sunholo-0.116.
|
|
156
|
-
sunholo-0.116.
|
|
157
|
-
sunholo-0.116.
|
|
152
|
+
sunholo-0.116.2.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
|
153
|
+
sunholo-0.116.2.dist-info/METADATA,sha256=YUoz-Kw42oDa68pBZ6Qd1gygiihKtR36SqJ0OnXl-6I,9297
|
|
154
|
+
sunholo-0.116.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
155
|
+
sunholo-0.116.2.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
|
156
|
+
sunholo-0.116.2.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
|
157
|
+
sunholo-0.116.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|