cnhkmcp 1.4.6__py3-none-any.whl → 1.4.8__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.
- cnhkmcp/__init__.py +1 -1
- cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272//321/210/320/276/320/271AI/321/210/320/277/342/225/227/321/210/342/224/220/320/251/321/204/342/225/225/320/272/321/206/320/246/320/227/321/206/320/261/320/263/321/206/320/255/320/265/321/205/320/275/320/266/321/204/342/225/235/320/252/321/204/342/225/225/320/233/321/210/342/225/234/342/225/234/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270.md +8 -0
- cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272//321/211/320/225/320/235/321/207/342/225/234/320/276/321/205/320/231/320/235/321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/230/320/241_/321/205/320/276/320/231/321/210/320/263/320/225/321/205/342/224/220/320/225/321/210/320/266/320/221/321/204/342/225/233/320/255/321/210/342/225/241/320/246/321/205/320/234/320/225.py +30 -5
- cnhkmcp/untracked/platform_functions.py +9 -6
- cnhkmcp/untracked//321/211/320/225/320/235/321/207/342/225/234/320/276/321/205/320/231/320/235/321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/230/320/241_/321/205/320/276/320/231/321/210/320/263/320/225/321/205/342/224/220/320/225/321/210/320/266/320/221/321/204/342/225/233/320/255/321/210/342/225/241/320/246/321/205/320/234/320/225.py +30 -5
- {cnhkmcp-1.4.6.dist-info → cnhkmcp-1.4.8.dist-info}/METADATA +1 -1
- {cnhkmcp-1.4.6.dist-info → cnhkmcp-1.4.8.dist-info}/RECORD +11 -11
- {cnhkmcp-1.4.6.dist-info → cnhkmcp-1.4.8.dist-info}/WHEEL +0 -0
- {cnhkmcp-1.4.6.dist-info → cnhkmcp-1.4.8.dist-info}/entry_points.txt +0 -0
- {cnhkmcp-1.4.6.dist-info → cnhkmcp-1.4.8.dist-info}/licenses/LICENSE +0 -0
- {cnhkmcp-1.4.6.dist-info → cnhkmcp-1.4.8.dist-info}/top_level.txt +0 -0
cnhkmcp/__init__.py
CHANGED
|
@@ -16,6 +16,14 @@ This means Playwright cannot find the Chrome browser executable in its default s
|
|
|
16
16
|
|
|
17
17
|
The solution is to download the Chrome `.deb` package, extract the executable, and then point your Playwright script to it.
|
|
18
18
|
|
|
19
|
+
### Step 0: pip install playwright
|
|
20
|
+
|
|
21
|
+
Before you begin, make sure you have Playwright installed. You can install it using pip:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install playwright
|
|
25
|
+
```
|
|
26
|
+
|
|
19
27
|
### Step 1: Download the Chrome `.deb` Package
|
|
20
28
|
|
|
21
29
|
You can download the latest stable version of Google Chrome for Debian/Ubuntu-based systems using `wget`:
|
|
@@ -75,12 +75,24 @@ def is_version_sufficient(installed: str, required: str) -> bool:
|
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
def install_package(spec: str) -> Tuple[bool, str]:
|
|
78
|
-
"""Install a package spec using pip.
|
|
79
|
-
|
|
78
|
+
"""Install a package spec using pip. Streams output live and returns (success, output)."""
|
|
79
|
+
# Use -v for verbose pip output; capture stdout/stderr while streaming to console
|
|
80
|
+
cmd = [sys.executable, "-m", "pip", "install", "-v", spec]
|
|
80
81
|
try:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
|
|
83
|
+
output_lines = []
|
|
84
|
+
if proc.stdout:
|
|
85
|
+
for line in proc.stdout:
|
|
86
|
+
output_lines.append(line)
|
|
87
|
+
# print each pip line as it arrives for visibility
|
|
88
|
+
try:
|
|
89
|
+
print(line.rstrip())
|
|
90
|
+
except Exception:
|
|
91
|
+
# fallback: print raw line
|
|
92
|
+
print(line)
|
|
93
|
+
proc.wait()
|
|
94
|
+
out = "".join(output_lines)
|
|
95
|
+
success = proc.returncode == 0
|
|
84
96
|
return success, out
|
|
85
97
|
except Exception as e:
|
|
86
98
|
return False, str(e)
|
|
@@ -113,10 +125,21 @@ def main():
|
|
|
113
125
|
if needs_install:
|
|
114
126
|
print(f"-> {name}: {action} via pip ({spec})")
|
|
115
127
|
success, output = install_package(spec)
|
|
128
|
+
# Attempt to read installed version after install
|
|
129
|
+
installed_after = None
|
|
130
|
+
if success:
|
|
131
|
+
try:
|
|
132
|
+
installed_after = importlib.metadata.version(name)
|
|
133
|
+
except Exception:
|
|
134
|
+
installed_after = None
|
|
135
|
+
if installed_after:
|
|
136
|
+
print(f" -> {name} now installed as: {installed_after}")
|
|
137
|
+
|
|
116
138
|
results.append({
|
|
117
139
|
"name": name,
|
|
118
140
|
"spec": spec,
|
|
119
141
|
"installed_version_before": installed_ver,
|
|
142
|
+
"installed_version_after": installed_after,
|
|
120
143
|
"action": action,
|
|
121
144
|
"success": success,
|
|
122
145
|
"output": output
|
|
@@ -152,6 +175,8 @@ def main():
|
|
|
152
175
|
print("-----")
|
|
153
176
|
print(f"Package: {f['name']}")
|
|
154
177
|
print(f"Spec: {f['spec']}")
|
|
178
|
+
print(f"Installed before: {f.get('installed_version_before')}")
|
|
179
|
+
print(f"Installed after: {f.get('installed_version_after')}")
|
|
155
180
|
print("Output:")
|
|
156
181
|
print(f.get("output", "(no output)"))
|
|
157
182
|
|
|
@@ -371,7 +371,9 @@ class BrainApiClient:
|
|
|
371
371
|
print("Alpha done simulating, getting alpha details")
|
|
372
372
|
alpha_id = simulation_progress.json()["alpha"]
|
|
373
373
|
alpha = self.session.get("https://api.worldquantbrain.com/alphas/" + alpha_id)
|
|
374
|
-
|
|
374
|
+
result = alpha.json()
|
|
375
|
+
result['note'] = "if you got a negative alpha sharpe, you can just add a minus sign in front of the last line of the Alpha to flip then think the next step."
|
|
376
|
+
return result
|
|
375
377
|
|
|
376
378
|
except Exception as e:
|
|
377
379
|
self.log(f"❌ Failed to create simulation: {str(e)}", "ERROR")
|
|
@@ -1822,7 +1824,7 @@ async def create_simulation(
|
|
|
1822
1824
|
result = await brain_client.create_simulation(simulation_data)
|
|
1823
1825
|
return result
|
|
1824
1826
|
except Exception as e:
|
|
1825
|
-
return {"error": str(e)}
|
|
1827
|
+
return {"error": str(e), "note":", you need to call three mcp tools get_operators, get_platform_setting_options and get_datafields to check whether you correctly use the operators, setting the simulation settings, and existing data fields."}
|
|
1826
1828
|
|
|
1827
1829
|
# get_simulation_status MCP tool removed as requested
|
|
1828
1830
|
# wait_for_simulation MCP tool removed as requested
|
|
@@ -2588,7 +2590,7 @@ async def create_multiSim(
|
|
|
2588
2590
|
response = brain_client.session.post(f"{brain_client.base_url}/simulations", json=multisimulation_data)
|
|
2589
2591
|
|
|
2590
2592
|
if response.status_code != 201:
|
|
2591
|
-
return {"error": f"Failed to create multisimulation. Status: {response.status_code}"}
|
|
2593
|
+
return {"error": f"Failed to create multisimulation. Status: {response.status_code},, you need to call three mcp tools get_operators, get_platform_setting_options and get_datafields to check whether you correctly use the operators, setting the simulation settings, and existing data fields."}
|
|
2592
2594
|
|
|
2593
2595
|
# Get multisimulation location
|
|
2594
2596
|
location = response.headers.get('Location', '')
|
|
@@ -2599,7 +2601,7 @@ async def create_multiSim(
|
|
|
2599
2601
|
return await _wait_for_multisimulation_completion(location, len(alpha_expressions))
|
|
2600
2602
|
|
|
2601
2603
|
except Exception as e:
|
|
2602
|
-
return {"error": f"Error creating multisimulation: {str(e)}"}
|
|
2604
|
+
return {"error": f"Error creating multisimulation: {str(e)}, , you need to call three mcp tools get_operators, get_platform_setting_options and get_datafields to check whether you correctly use the operators, setting the simulation settings, and existing data fields."}
|
|
2603
2605
|
|
|
2604
2606
|
async def _wait_for_multisimulation_completion(location: str, expected_children: int) -> Dict[str, Any]:
|
|
2605
2607
|
"""Wait for multisimulation to complete and return results"""
|
|
@@ -2714,11 +2716,12 @@ async def _wait_for_multisimulation_completion(location: str, expected_children:
|
|
|
2714
2716
|
'total_created': len(alpha_results),
|
|
2715
2717
|
'multisimulation_id': location.split('/')[-1],
|
|
2716
2718
|
'multisimulation_location': location,
|
|
2717
|
-
'alpha_results': alpha_results
|
|
2719
|
+
'alpha_results': alpha_results,
|
|
2720
|
+
'note': "if you got a negative alpha sharpe, you can just add a minus sign in front of the last line of the Alpha to flip then think the next step."
|
|
2718
2721
|
}
|
|
2719
2722
|
|
|
2720
2723
|
except Exception as e:
|
|
2721
|
-
return {"error": f"Error waiting for multisimulation completion: {str(e)}"}
|
|
2724
|
+
return {"error": f"Error waiting for multisimulation completion: {str(e)}, you need to call three mcp tools get_operators, get_platform_setting_options and get_datafields to check whether you correctly use the operators, setting the simulation settings, and existing data fields."}
|
|
2722
2725
|
|
|
2723
2726
|
@mcp.tool()
|
|
2724
2727
|
async def get_daily_and_quarterly_payment(email: str = "", password: str = "") -> Dict[str, Any]:
|
|
@@ -75,12 +75,24 @@ def is_version_sufficient(installed: str, required: str) -> bool:
|
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
def install_package(spec: str) -> Tuple[bool, str]:
|
|
78
|
-
"""Install a package spec using pip.
|
|
79
|
-
|
|
78
|
+
"""Install a package spec using pip. Streams output live and returns (success, output)."""
|
|
79
|
+
# Use -v for verbose pip output; capture stdout/stderr while streaming to console
|
|
80
|
+
cmd = [sys.executable, "-m", "pip", "install", "-v", spec]
|
|
80
81
|
try:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
|
|
83
|
+
output_lines = []
|
|
84
|
+
if proc.stdout:
|
|
85
|
+
for line in proc.stdout:
|
|
86
|
+
output_lines.append(line)
|
|
87
|
+
# print each pip line as it arrives for visibility
|
|
88
|
+
try:
|
|
89
|
+
print(line.rstrip())
|
|
90
|
+
except Exception:
|
|
91
|
+
# fallback: print raw line
|
|
92
|
+
print(line)
|
|
93
|
+
proc.wait()
|
|
94
|
+
out = "".join(output_lines)
|
|
95
|
+
success = proc.returncode == 0
|
|
84
96
|
return success, out
|
|
85
97
|
except Exception as e:
|
|
86
98
|
return False, str(e)
|
|
@@ -113,10 +125,21 @@ def main():
|
|
|
113
125
|
if needs_install:
|
|
114
126
|
print(f"-> {name}: {action} via pip ({spec})")
|
|
115
127
|
success, output = install_package(spec)
|
|
128
|
+
# Attempt to read installed version after install
|
|
129
|
+
installed_after = None
|
|
130
|
+
if success:
|
|
131
|
+
try:
|
|
132
|
+
installed_after = importlib.metadata.version(name)
|
|
133
|
+
except Exception:
|
|
134
|
+
installed_after = None
|
|
135
|
+
if installed_after:
|
|
136
|
+
print(f" -> {name} now installed as: {installed_after}")
|
|
137
|
+
|
|
116
138
|
results.append({
|
|
117
139
|
"name": name,
|
|
118
140
|
"spec": spec,
|
|
119
141
|
"installed_version_before": installed_ver,
|
|
142
|
+
"installed_version_after": installed_after,
|
|
120
143
|
"action": action,
|
|
121
144
|
"success": success,
|
|
122
145
|
"output": output
|
|
@@ -152,6 +175,8 @@ def main():
|
|
|
152
175
|
print("-----")
|
|
153
176
|
print(f"Package: {f['name']}")
|
|
154
177
|
print(f"Spec: {f['spec']}")
|
|
178
|
+
print(f"Installed before: {f.get('installed_version_before')}")
|
|
179
|
+
print(f"Installed after: {f.get('installed_version_after')}")
|
|
155
180
|
print("Output:")
|
|
156
181
|
print(f.get("output", "(no output)"))
|
|
157
182
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
cnhkmcp/__init__.py,sha256=
|
|
1
|
+
cnhkmcp/__init__.py,sha256=6HAUbLyRJK-E8TxYkbuGHZ57oAxeH8LgrUVK19ttNhY,2758
|
|
2
2
|
cnhkmcp/untracked/arXiv_API_Tool_Manual.md,sha256=I3hvI5mpmIjBuWptufoVSWFnuhyUc67oCGHEuR0p_xs,13552
|
|
3
3
|
cnhkmcp/untracked/arxiv_api.py,sha256=-E-Ub9K-DXAYaCjrbobyfQ9H97gaZBc7pL6xPEyVHec,9020
|
|
4
4
|
cnhkmcp/untracked/forum_functions.py,sha256=QW-CplAsqDkw-Wcwq-1tuZBq48dEO-vXZ8xw7X65EuE,42303
|
|
5
|
-
cnhkmcp/untracked/platform_functions.py,sha256=
|
|
5
|
+
cnhkmcp/untracked/platform_functions.py,sha256=KQQlh-ZFQn6541H2DMoL3mEn4BiNkr-cg87lTSy6qMs,121144
|
|
6
6
|
cnhkmcp/untracked/sample_mcp_config.json,sha256=QSFvZ086bxUQsvmLjcE6pL9ObzKn4FGnt9npWPo7Eps,1044
|
|
7
7
|
cnhkmcp/untracked/user_config.json,sha256=_INn1X1qIsITrmEno-BRlQOAGm9wnNCw-6B333DEvnk,695
|
|
8
8
|
cnhkmcp/untracked/示例参考文档_BRAIN_Alpha_Test_Requirements_and_Tips.md,sha256=W4dtQrqoTN72UyvIsvkGRF0HFOJLHSDeeSlbR3gqQg0,17133
|
|
@@ -11,7 +11,7 @@ cnhkmcp/untracked/示例工作流_BRAIN_6_Tips_Datafield_Exploration_Guide.md,sh
|
|
|
11
11
|
cnhkmcp/untracked/示例工作流_BRAIN_Alpha_Improvement_Workflow.md,sha256=XlWYREd_qXe1skdXIhkiGY05oDr_6KiBs1WkerY4S8U,5092
|
|
12
12
|
cnhkmcp/untracked/示例工作流_Dataset_Exploration_Expert_Manual.md,sha256=-C4fWdaBe9UzA5BDZz0Do2z8RaPWLslb6D0nTz6fqk4,24403
|
|
13
13
|
cnhkmcp/untracked/示例工作流_daily_report_workflow.md,sha256=6aNmPqWRn09XdQMRxoVTka9IYVOUv5LcWparHu16EfQ,9460
|
|
14
|
-
cnhkmcp/untracked/配置前运行我_安装必要依赖包.py,sha256=
|
|
14
|
+
cnhkmcp/untracked/配置前运行我_安装必要依赖包.py,sha256=BnUyL5g6PaC62yEuS-8vcDSJ0oKu3k6jqQxi2jginuQ,6612
|
|
15
15
|
cnhkmcp/untracked/APP/.gitignore,sha256=oPCoVTNo82bhkN0c671LdjCpOTVpVhZI5NR75ztcg48,317
|
|
16
16
|
cnhkmcp/untracked/APP/MODULAR_STRUCTURE.md,sha256=Ji4VeRZjeMWRX6cvEHxyR_gmoorIEEdqwsXTCVIr5_0,4331
|
|
17
17
|
cnhkmcp/untracked/APP/README.md,sha256=vb7hmQX0sH5aFNBmDCN5szMSDHm1_h2VKY4UKCt0aMk,11676
|
|
@@ -64,11 +64,11 @@ cnhkmcp/untracked/__pycache__/forum_functions.cpython-313.pyc,sha256=agARlP2x36s
|
|
|
64
64
|
cnhkmcp/untracked/mcp文件论坛版2_如果原版启动不了浏览器就试这个/forum_functions.py,sha256=sm2Vqi7Dq0plbXNvMC2_Y0qOFAR3jBhQ4KDLJfMDH6s,19026
|
|
65
65
|
cnhkmcp/untracked/mcp文件论坛版2_如果原版启动不了浏览器就试这个/platform_functions.py,sha256=aa5jCRjCORFars8CVahqwbk5ni0mLYWu9yND7Z4TGUM,99159
|
|
66
66
|
cnhkmcp/untracked/mcp文件论坛版2_如果原版启动不了浏览器就试这个/user_config.json,sha256=_INn1X1qIsITrmEno-BRlQOAGm9wnNCw-6B333DEvnk,695
|
|
67
|
-
cnhkmcp/untracked/mcp文件论坛版2_如果原版启动不了浏览器就试这个/让AI读这个文档来学会下载浏览器.md,sha256=
|
|
68
|
-
cnhkmcp/untracked/mcp文件论坛版2_如果原版启动不了浏览器就试这个/配置前运行我_安装必要依赖包.py,sha256=
|
|
69
|
-
cnhkmcp-1.4.
|
|
70
|
-
cnhkmcp-1.4.
|
|
71
|
-
cnhkmcp-1.4.
|
|
72
|
-
cnhkmcp-1.4.
|
|
73
|
-
cnhkmcp-1.4.
|
|
74
|
-
cnhkmcp-1.4.
|
|
67
|
+
cnhkmcp/untracked/mcp文件论坛版2_如果原版启动不了浏览器就试这个/让AI读这个文档来学会下载浏览器.md,sha256=v5QPSMjRDh52ZjgC4h8QjImnaqlVRLjTHGxmGjTo36g,3396
|
|
68
|
+
cnhkmcp/untracked/mcp文件论坛版2_如果原版启动不了浏览器就试这个/配置前运行我_安装必要依赖包.py,sha256=BnUyL5g6PaC62yEuS-8vcDSJ0oKu3k6jqQxi2jginuQ,6612
|
|
69
|
+
cnhkmcp-1.4.8.dist-info/licenses/LICENSE,sha256=QLxO2eNMnJQEdI_R1UV2AOD-IvuA8zVrkHWA4D9gtoc,1081
|
|
70
|
+
cnhkmcp-1.4.8.dist-info/METADATA,sha256=3il3BOpVV4336VeR6EPmXrIN11P71A3hdNiEs5BzO9g,5171
|
|
71
|
+
cnhkmcp-1.4.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
72
|
+
cnhkmcp-1.4.8.dist-info/entry_points.txt,sha256=lTQieVyIvjhSMK4fT-XwnccY-JBC1H4vVQ3V9dDM-Pc,70
|
|
73
|
+
cnhkmcp-1.4.8.dist-info/top_level.txt,sha256=x--ibUcSgOS9Z_RWK2Qc-vfs7DaXQN-WMaaxEETJ1Bw,8
|
|
74
|
+
cnhkmcp-1.4.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|