sunholo 0.116.0__py3-none-any.whl → 0.116.1__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 +1 -1
- sunholo/mcp/cli.py +74 -33
- {sunholo-0.116.0.dist-info → sunholo-0.116.1.dist-info}/METADATA +3 -2
- {sunholo-0.116.0.dist-info → sunholo-0.116.1.dist-info}/RECORD +8 -8
- {sunholo-0.116.0.dist-info → sunholo-0.116.1.dist-info}/LICENSE.txt +0 -0
- {sunholo-0.116.0.dist-info → sunholo-0.116.1.dist-info}/WHEEL +0 -0
- {sunholo-0.116.0.dist-info → sunholo-0.116.1.dist-info}/entry_points.txt +0 -0
- {sunholo-0.116.0.dist-info → sunholo-0.116.1.dist-info}/top_level.txt +0 -0
sunholo/cli/cli.py
CHANGED
|
@@ -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="sunholo CLI tool for deploying GenAI VACs 3", 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,7 @@ import asyncio
|
|
|
3
3
|
from typing import Any, Sequence
|
|
4
4
|
from functools import lru_cache
|
|
5
5
|
import subprocess
|
|
6
|
-
|
|
7
|
-
from mcp.server.stdio import stdio_server
|
|
8
|
-
from mcp.types import (
|
|
9
|
-
Resource,
|
|
10
|
-
Tool,
|
|
11
|
-
TextContent,
|
|
12
|
-
ImageContent,
|
|
13
|
-
EmbeddedResource,
|
|
14
|
-
)
|
|
15
|
-
"""
|
|
6
|
+
|
|
16
7
|
try:
|
|
17
8
|
from mcp.server import Server
|
|
18
9
|
from mcp.server.stdio import stdio_server
|
|
@@ -23,24 +14,37 @@ try:
|
|
|
23
14
|
ImageContent,
|
|
24
15
|
EmbeddedResource,
|
|
25
16
|
)
|
|
17
|
+
|
|
18
|
+
from rich import print
|
|
19
|
+
from ..cli.sun_rich import console
|
|
26
20
|
except ImportError:
|
|
27
21
|
Server = None
|
|
28
|
-
|
|
22
|
+
console = None
|
|
29
23
|
|
|
30
24
|
from pydantic import AnyUrl
|
|
31
25
|
|
|
32
26
|
# Configure logging
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
import logging
|
|
28
|
+
logging.basicConfig(level=logging.DEBUG)
|
|
29
|
+
logger = logging.getLogger("sunholo-mcp")
|
|
30
|
+
|
|
35
31
|
|
|
36
|
-
class
|
|
32
|
+
class SunholoMCPServer2:
|
|
37
33
|
def __init__(self):
|
|
34
|
+
logger.info("Initializing Sunholo MCP Server")
|
|
35
|
+
|
|
38
36
|
if Server is None:
|
|
39
37
|
raise ImportError("SunholoMCPServer requires `sunholo[anthropic]` to be installed")
|
|
40
38
|
|
|
41
39
|
self.server = Server("sunholo-mcp-server")
|
|
40
|
+
self.server.onerror = self.handle_error
|
|
41
|
+
|
|
42
42
|
self.setup_handlers()
|
|
43
43
|
|
|
44
|
+
def handle_error(self, error: Exception):
|
|
45
|
+
"""Handle server errors"""
|
|
46
|
+
logger.error(f"MCP Server error: {error}", exc_info=True)
|
|
47
|
+
|
|
44
48
|
def setup_handlers(self):
|
|
45
49
|
"""Set up all the MCP protocol handlers"""
|
|
46
50
|
self.setup_resource_handlers()
|
|
@@ -54,8 +58,8 @@ class SunholoMCPServer:
|
|
|
54
58
|
"""List available Sunholo resources"""
|
|
55
59
|
return [
|
|
56
60
|
Resource(
|
|
57
|
-
uri="sunholo://vacs/
|
|
58
|
-
name="Available Sunholo VACs",
|
|
61
|
+
uri="sunholo://vacs/list2",
|
|
62
|
+
name="Available Sunholo VACs 2",
|
|
59
63
|
mimeType="application/json",
|
|
60
64
|
description="List of available Virtual Agent Computers"
|
|
61
65
|
)
|
|
@@ -64,14 +68,17 @@ class SunholoMCPServer:
|
|
|
64
68
|
@self.server.read_resource()
|
|
65
69
|
async def read_resource(uri: AnyUrl) -> str:
|
|
66
70
|
"""Read Sunholo resources based on URI"""
|
|
67
|
-
|
|
71
|
+
logger.info(f"{uri} available")
|
|
72
|
+
console.print(f"{uri} available")
|
|
73
|
+
if str(uri) == "sunholo://vacs/list2":
|
|
68
74
|
try:
|
|
69
75
|
# Execute sunholo vac list command
|
|
70
76
|
result = subprocess.run(
|
|
71
|
-
["sunholo", "vac", "list"
|
|
77
|
+
["sunholo", "vac", "list"],
|
|
72
78
|
capture_output=True,
|
|
73
79
|
text=True
|
|
74
80
|
)
|
|
81
|
+
console.print(f"{result=}")
|
|
75
82
|
return result.stdout
|
|
76
83
|
except subprocess.CalledProcessError as e:
|
|
77
84
|
raise RuntimeError(f"Failed to list VACs: {str(e)}")
|
|
@@ -89,7 +96,7 @@ class SunholoMCPServer:
|
|
|
89
96
|
return [
|
|
90
97
|
Tool(
|
|
91
98
|
name="chat_with_vac",
|
|
92
|
-
description="Chat with a specific Sunholo
|
|
99
|
+
description="Chat with a specific Sunholo VAC2",
|
|
93
100
|
inputSchema={
|
|
94
101
|
"type": "object",
|
|
95
102
|
"properties": {
|
|
@@ -101,18 +108,34 @@ class SunholoMCPServer:
|
|
|
101
108
|
"type": "string",
|
|
102
109
|
"description": "Message to send to the VAC"
|
|
103
110
|
},
|
|
104
|
-
"headless": {
|
|
105
|
-
"type": "boolean",
|
|
106
|
-
"description": "Whether to run in headless mode",
|
|
107
|
-
"default": True
|
|
108
|
-
}
|
|
109
111
|
},
|
|
110
112
|
"required": ["vac_name", "message"]
|
|
111
113
|
}
|
|
112
114
|
),
|
|
115
|
+
Tool(
|
|
116
|
+
name="list_configs",
|
|
117
|
+
description="List Sunholo configurations2",
|
|
118
|
+
inputSchema={
|
|
119
|
+
"type": "object",
|
|
120
|
+
"properties": {
|
|
121
|
+
"kind": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"description": "Filter configurations by kind e.g. vacConfig"
|
|
124
|
+
},
|
|
125
|
+
"vac": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"description": "Filter configurations by VAC name"
|
|
128
|
+
},
|
|
129
|
+
"validate": {
|
|
130
|
+
"type": "boolean",
|
|
131
|
+
"description": "Validate the configuration files"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
),
|
|
113
136
|
Tool(
|
|
114
137
|
name="embed_content",
|
|
115
|
-
description="Embed content in a VAC's vector
|
|
138
|
+
description="Embed content in a VAC's vector store2",
|
|
116
139
|
inputSchema={
|
|
117
140
|
"type": "object",
|
|
118
141
|
"properties": {
|
|
@@ -148,15 +171,13 @@ class SunholoMCPServer:
|
|
|
148
171
|
|
|
149
172
|
vac_name = arguments.get("vac_name")
|
|
150
173
|
message = arguments.get("message")
|
|
151
|
-
headless = arguments.get("headless", True)
|
|
152
174
|
|
|
153
175
|
if not vac_name or not message:
|
|
154
176
|
raise ValueError("Missing required arguments")
|
|
155
177
|
|
|
156
178
|
try:
|
|
157
179
|
cmd = ["sunholo", "vac", "chat", vac_name, message]
|
|
158
|
-
|
|
159
|
-
cmd.append("--headless")
|
|
180
|
+
cmd.append("--headless")
|
|
160
181
|
|
|
161
182
|
result = subprocess.run(
|
|
162
183
|
cmd,
|
|
@@ -213,6 +234,25 @@ class SunholoMCPServer:
|
|
|
213
234
|
text=f"Error embedding content: {e.stderr}"
|
|
214
235
|
)
|
|
215
236
|
]
|
|
237
|
+
elif name == "list_configs":
|
|
238
|
+
|
|
239
|
+
# Build command
|
|
240
|
+
cmd = ["sunholo", "list-configs"]
|
|
241
|
+
|
|
242
|
+
if arguments.get("kind"):
|
|
243
|
+
cmd.extend(["--kind", arguments["kind"]])
|
|
244
|
+
if arguments.get("vac"):
|
|
245
|
+
cmd.extend(["--vac", arguments["vac"]])
|
|
246
|
+
if arguments.get("validate"):
|
|
247
|
+
cmd.append("--validate")
|
|
248
|
+
|
|
249
|
+
# Execute sunholo command
|
|
250
|
+
try:
|
|
251
|
+
result = subprocess.run(cmd, capture_output=True, text=True)
|
|
252
|
+
return [TextContent(type="text", text=result.stdout)]
|
|
253
|
+
except subprocess.CalledProcessError as e:
|
|
254
|
+
return [TextContent(type="text", text=f"Error: {e.stderr}")]
|
|
255
|
+
|
|
216
256
|
|
|
217
257
|
raise ValueError(f"Unknown tool: {name}")
|
|
218
258
|
|
|
@@ -230,9 +270,10 @@ def cli_mcp(args):
|
|
|
230
270
|
try:
|
|
231
271
|
|
|
232
272
|
# Create and run the MCP server
|
|
233
|
-
server =
|
|
273
|
+
server = SunholoMCPServer2()
|
|
234
274
|
|
|
235
|
-
logger.info("Starting Sunholo MCP
|
|
275
|
+
logger.info("Starting Sunholo MCP server3...")
|
|
276
|
+
console.print("Starting Sunholo MCP server3...")
|
|
236
277
|
asyncio.run(server.run())
|
|
237
278
|
|
|
238
279
|
except Exception as e:
|
|
@@ -241,9 +282,9 @@ def cli_mcp(args):
|
|
|
241
282
|
|
|
242
283
|
def setup_mcp_subparser(subparsers):
|
|
243
284
|
"""
|
|
244
|
-
Sets up an argparse subparser for the 'mcp' command.
|
|
285
|
+
Sets up an argparse subparser for the 'mcp' command 3.
|
|
245
286
|
|
|
246
|
-
By default will use configurations within the folder specified by '
|
|
287
|
+
By default will use configurations within the folder specified by 'VAC_CONFIG_FOLDER'
|
|
247
288
|
|
|
248
289
|
Example command:
|
|
249
290
|
```bash
|
|
@@ -251,6 +292,6 @@ def setup_mcp_subparser(subparsers):
|
|
|
251
292
|
```
|
|
252
293
|
"""
|
|
253
294
|
mcp_parser = subparsers.add_parser('mcp',
|
|
254
|
-
help='Start an Anthropic MCP server that wraps `sunholo`
|
|
295
|
+
help='Start an Anthropic MCP server that wraps `sunholo` functionality3')
|
|
255
296
|
|
|
256
297
|
mcp_parser.set_defaults(func=cli_mcp)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.116.
|
|
3
|
+
Version: 0.116.1
|
|
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.1.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"
|
|
@@ -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=K8c0Lw3d0fJ_RL5Fh6wnFAhNFH7WM8Lem042Q7ytk40,4575
|
|
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=Ff4sQFbAli3aDalEzQkWm8o5NjeC8Nwh9qzuaPLSP4Q,10526
|
|
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.1.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
|
153
|
+
sunholo-0.116.1.dist-info/METADATA,sha256=FYrAQFonxUdw8AVH32lbQurwbVnIdCfclmPOVK6IdRk,9210
|
|
154
|
+
sunholo-0.116.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
155
|
+
sunholo-0.116.1.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
|
156
|
+
sunholo-0.116.1.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
|
157
|
+
sunholo-0.116.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|