ohamlab-harness 0.1.0b1__tar.gz
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.
- ohamlab_harness-0.1.0b1/PKG-INFO +30 -0
- ohamlab_harness-0.1.0b1/README.md +17 -0
- ohamlab_harness-0.1.0b1/pyproject.toml +20 -0
- ohamlab_harness-0.1.0b1/setup.cfg +4 -0
- ohamlab_harness-0.1.0b1/src/ohamlab_harness/__init__.py +2 -0
- ohamlab_harness-0.1.0b1/src/ohamlab_harness/cli.py +72 -0
- ohamlab_harness-0.1.0b1/src/ohamlab_harness/installer.py +85 -0
- ohamlab_harness-0.1.0b1/src/ohamlab_harness/runtime.py +42 -0
- ohamlab_harness-0.1.0b1/src/ohamlab_harness.egg-info/PKG-INFO +30 -0
- ohamlab_harness-0.1.0b1/src/ohamlab_harness.egg-info/SOURCES.txt +11 -0
- ohamlab_harness-0.1.0b1/src/ohamlab_harness.egg-info/dependency_links.txt +1 -0
- ohamlab_harness-0.1.0b1/src/ohamlab_harness.egg-info/entry_points.txt +2 -0
- ohamlab_harness-0.1.0b1/src/ohamlab_harness.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ohamlab-harness
|
|
3
|
+
Version: 0.1.0b1
|
|
4
|
+
Summary: Installer and launcher for OhamLab DeepSeek Harness
|
|
5
|
+
Author: OhamLab
|
|
6
|
+
License: Proprietary - verify repository license before publication
|
|
7
|
+
Keywords: agent,mcp,harness
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
# OhamLab Harness CLI (beta)
|
|
15
|
+
|
|
16
|
+
This Python package bootstraps the Node-based Harness and the OhamLab vendor integration from GitHub. Node.js 22, Git and pnpm are required. Install and run:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
pip install -e packages/python
|
|
20
|
+
# from any directory
|
|
21
|
+
ohamlab-harness doctor
|
|
22
|
+
ohamlab-harness install
|
|
23
|
+
ohamlab-harness start
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
By default `install` clones the Harness `1.0` branch and overlays `vendor/ohamlab` from `main` of the same repository. Override the refs with `--harness-ref` and `--vendor-ref`; pin immutable commit SHAs for reproducible production installs. For a local vendor checkout, pass `--vendor-path /path/to/vendor/ohamlab`. The installer creates a separate Python virtual environment for gateway dependencies and uses a persistent data directory.
|
|
27
|
+
|
|
28
|
+
The default Harness startup command is `pnpm dsh web`; confirm this against the selected Harness release. Override with `--start-command 'pnpm ...'` if needed. The launcher does not assert MCP registration automatically; use `doctor` and test actual tool calls in Harness.
|
|
29
|
+
|
|
30
|
+
`start` serves the upstream web UI locally; it is not a cloud-hosted service or browser extension. Use `--open-browser` to open the local URL. Do not expose the UI to the public Internet without authentication and TLS.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# OhamLab Harness CLI (beta)
|
|
2
|
+
|
|
3
|
+
This Python package bootstraps the Node-based Harness and the OhamLab vendor integration from GitHub. Node.js 22, Git and pnpm are required. Install and run:
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pip install -e packages/python
|
|
7
|
+
# from any directory
|
|
8
|
+
ohamlab-harness doctor
|
|
9
|
+
ohamlab-harness install
|
|
10
|
+
ohamlab-harness start
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
By default `install` clones the Harness `1.0` branch and overlays `vendor/ohamlab` from `main` of the same repository. Override the refs with `--harness-ref` and `--vendor-ref`; pin immutable commit SHAs for reproducible production installs. For a local vendor checkout, pass `--vendor-path /path/to/vendor/ohamlab`. The installer creates a separate Python virtual environment for gateway dependencies and uses a persistent data directory.
|
|
14
|
+
|
|
15
|
+
The default Harness startup command is `pnpm dsh web`; confirm this against the selected Harness release. Override with `--start-command 'pnpm ...'` if needed. The launcher does not assert MCP registration automatically; use `doctor` and test actual tool calls in Harness.
|
|
16
|
+
|
|
17
|
+
`start` serves the upstream web UI locally; it is not a cloud-hosted service or browser extension. Use `--open-browser` to open the local URL. Do not expose the UI to the public Internet without authentication and TLS.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ohamlab-harness"
|
|
7
|
+
version = "0.1.0b1"
|
|
8
|
+
description = "Installer and launcher for OhamLab DeepSeek Harness"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = {text = "Proprietary - verify repository license before publication"}
|
|
12
|
+
authors = [{name = "OhamLab"}]
|
|
13
|
+
keywords = ["agent", "mcp", "harness"]
|
|
14
|
+
classifiers = ["Development Status :: 4 - Beta", "Programming Language :: Python :: 3", "Operating System :: OS Independent"]
|
|
15
|
+
|
|
16
|
+
[project.scripts]
|
|
17
|
+
ohamlab-harness = "ohamlab_harness.cli:main"
|
|
18
|
+
|
|
19
|
+
[tool.setuptools.packages.find]
|
|
20
|
+
where = ["src"]
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""User-facing OhamLab Harness CLI."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
import argparse
|
|
4
|
+
import os
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
import shutil
|
|
7
|
+
import subprocess
|
|
8
|
+
import sys
|
|
9
|
+
from . import __version__
|
|
10
|
+
from .installer import REPO_URL, InstallError, install, SKILLS
|
|
11
|
+
from .runtime import start
|
|
12
|
+
|
|
13
|
+
def default_home():
|
|
14
|
+
return Path(os.environ.get("OHAMLAB_HARNESS_HOME",str(Path.home()/".ohamlab-harness")))
|
|
15
|
+
|
|
16
|
+
def doctor(home: Path):
|
|
17
|
+
print(f"OhamLab Harness {__version__}")
|
|
18
|
+
missing=[]
|
|
19
|
+
for exe in ("git","node","pnpm"):
|
|
20
|
+
path=shutil.which(exe)
|
|
21
|
+
print(f"{exe}: {path or 'MISSING'}")
|
|
22
|
+
if not path: missing.append(exe)
|
|
23
|
+
node=shutil.which("node")
|
|
24
|
+
if node:
|
|
25
|
+
version=subprocess.run([node,"--version"],capture_output=True,text=True,check=False).stdout.strip()
|
|
26
|
+
print("Node version:",version)
|
|
27
|
+
try:
|
|
28
|
+
if int(version.lstrip("v").split(".")[0])<22: missing.append("Node.js 22+")
|
|
29
|
+
except (ValueError,IndexError): missing.append("Node.js version unknown")
|
|
30
|
+
app=home/"app"
|
|
31
|
+
print("Harness checkout:", "OK" if (app/"package.json").is_file() else "NOT INSTALLED")
|
|
32
|
+
if not (app/"package.json").is_file(): missing.append("Harness checkout")
|
|
33
|
+
for skill in SKILLS:
|
|
34
|
+
exists=(home/"data"/"skills"/skill/"SKILL.md").is_file()
|
|
35
|
+
print(f"Skill {skill}:","OK" if exists else "MISSING")
|
|
36
|
+
if not exists: missing.append(skill)
|
|
37
|
+
py=home/"python-env"/("Scripts/python.exe" if os.name=="nt" else "bin/python")
|
|
38
|
+
print("Gateway Python:","OK" if py.is_file() else "MISSING")
|
|
39
|
+
if not py.is_file(): missing.append("Gateway Python")
|
|
40
|
+
print("MCP registration: NOT VERIFIED (requires live Harness test)")
|
|
41
|
+
return 1 if missing else 0
|
|
42
|
+
|
|
43
|
+
def main(argv=None):
|
|
44
|
+
parser=argparse.ArgumentParser(prog="ohamlab-harness")
|
|
45
|
+
parser.add_argument("--version",action="version",version=__version__)
|
|
46
|
+
parser.add_argument("--home",type=Path,default=default_home(),help="Installation directory")
|
|
47
|
+
subs=parser.add_subparsers(dest="action",required=True)
|
|
48
|
+
setup=subs.add_parser("install",help="Fetch, build, and install Harness")
|
|
49
|
+
setup.add_argument("--repo-url",default=REPO_URL)
|
|
50
|
+
setup.add_argument("--harness-ref",default="1.0")
|
|
51
|
+
setup.add_argument("--vendor-ref",default="main")
|
|
52
|
+
setup.add_argument("--vendor-path",type=Path)
|
|
53
|
+
setup.add_argument("--skip-python",action="store_true")
|
|
54
|
+
subs.add_parser("doctor",help="Check runtime prerequisites and installed files")
|
|
55
|
+
run=subs.add_parser("start",help="Start local Harness web UI")
|
|
56
|
+
run.add_argument("--start-command",default=os.environ.get("OHAMLAB_HARNESS_START_CMD","pnpm dsh web"))
|
|
57
|
+
run.add_argument("--host",default="127.0.0.1")
|
|
58
|
+
run.add_argument("--port",type=int,default=3080)
|
|
59
|
+
run.add_argument("--open-browser",action="store_true")
|
|
60
|
+
args=parser.parse_args(argv)
|
|
61
|
+
try:
|
|
62
|
+
if args.action=="install":
|
|
63
|
+
install(args.home,repo_url=args.repo_url,harness_ref=args.harness_ref,vendor_ref=args.vendor_ref,vendor_path=args.vendor_path,skip_python=args.skip_python)
|
|
64
|
+
return 0
|
|
65
|
+
if args.action=="doctor": return doctor(args.home)
|
|
66
|
+
return start(args.home,command=args.start_command,host=args.host,port=args.port,open_browser=args.open_browser)
|
|
67
|
+
except (InstallError,OSError,subprocess.CalledProcessError) as exc:
|
|
68
|
+
print(f"[OHAMLAB] ERROR: {exc}",file=sys.stderr)
|
|
69
|
+
return 1
|
|
70
|
+
|
|
71
|
+
if __name__=="__main__":
|
|
72
|
+
sys.exit(main())
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""Fetch and build an isolated Harness runtime, without modifying the source repository."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
import os
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
import shutil
|
|
6
|
+
import subprocess
|
|
7
|
+
import sys
|
|
8
|
+
import venv
|
|
9
|
+
|
|
10
|
+
REPO_URL = "https://github.com/innokria/ohamlab-deepseek-harness.git"
|
|
11
|
+
SKILLS = ("web-search", "agent-lab", "research-workflow")
|
|
12
|
+
|
|
13
|
+
class InstallError(RuntimeError):
|
|
14
|
+
pass
|
|
15
|
+
|
|
16
|
+
def run(argv, *, cwd=None, env=None):
|
|
17
|
+
print("+", " ".join(map(str, argv)), flush=True)
|
|
18
|
+
subprocess.run([str(x) for x in argv], cwd=cwd, env=env, check=True)
|
|
19
|
+
|
|
20
|
+
def require(binary):
|
|
21
|
+
found = shutil.which(binary)
|
|
22
|
+
if not found:
|
|
23
|
+
raise InstallError(f"Missing executable: {binary}. Install it and retry.")
|
|
24
|
+
return found
|
|
25
|
+
|
|
26
|
+
def git_checkout(url: str, ref: str, destination: Path):
|
|
27
|
+
if destination.exists():
|
|
28
|
+
raise InstallError(f"Refusing to overwrite existing directory: {destination}")
|
|
29
|
+
run([require("git"), "clone", "--no-checkout", url, destination])
|
|
30
|
+
run(["git", "-C", destination, "checkout", ref])
|
|
31
|
+
|
|
32
|
+
def install_skills(source: Path, target: Path):
|
|
33
|
+
target.mkdir(parents=True, exist_ok=True)
|
|
34
|
+
for skill in SKILLS:
|
|
35
|
+
src = source / skill
|
|
36
|
+
if not (src / "SKILL.md").is_file():
|
|
37
|
+
raise InstallError(f"Required skill missing: {src / 'SKILL.md'}")
|
|
38
|
+
shutil.copytree(src, target / skill, dirs_exist_ok=True)
|
|
39
|
+
print(f"[OHAMLAB] Installed skill: {skill}")
|
|
40
|
+
|
|
41
|
+
def install(home: Path, *, repo_url: str=REPO_URL, harness_ref: str="1.0", vendor_ref: str="main", vendor_path: Path|None=None, skip_python: bool=False):
|
|
42
|
+
require("git"); require("node"); require("pnpm")
|
|
43
|
+
home = home.expanduser().resolve()
|
|
44
|
+
home.mkdir(parents=True, exist_ok=True)
|
|
45
|
+
app = home / "app"
|
|
46
|
+
if app.exists():
|
|
47
|
+
raise InstallError(f"Harness already installed at {app}. Remove it manually to reinstall; no automatic overwrite.")
|
|
48
|
+
git_checkout(repo_url, harness_ref, app)
|
|
49
|
+
if not (app / "package.json").is_file():
|
|
50
|
+
raise InstallError("Selected Harness ref has no package.json at repository root")
|
|
51
|
+
vendor_dest = app / "vendor" / "ohamlab"
|
|
52
|
+
if vendor_path:
|
|
53
|
+
vendor_src = vendor_path.expanduser().resolve()
|
|
54
|
+
if not vendor_src.is_dir():
|
|
55
|
+
raise InstallError(f"Vendor directory missing: {vendor_src}")
|
|
56
|
+
else:
|
|
57
|
+
vendor_repo = home / "vendor-checkout"
|
|
58
|
+
git_checkout(repo_url, vendor_ref, vendor_repo)
|
|
59
|
+
vendor_src = vendor_repo / "vendor" / "ohamlab"
|
|
60
|
+
if not vendor_src.is_dir():
|
|
61
|
+
raise InstallError(f"Vendor integration missing: {vendor_src}")
|
|
62
|
+
vendor_dest.parent.mkdir(parents=True,exist_ok=True)
|
|
63
|
+
if vendor_dest.exists():
|
|
64
|
+
shutil.rmtree(vendor_dest)
|
|
65
|
+
shutil.copytree(vendor_src,vendor_dest)
|
|
66
|
+
if not vendor_path:
|
|
67
|
+
shutil.rmtree(home / "vendor-checkout")
|
|
68
|
+
requirements = vendor_dest / "gateway" / "requirements.txt"
|
|
69
|
+
if not requirements.is_file():
|
|
70
|
+
raise InstallError(f"Gateway requirements missing: {requirements}")
|
|
71
|
+
run(["pnpm", "install", "--frozen-lockfile"],cwd=app)
|
|
72
|
+
run(["pnpm", "run", "build"],cwd=app)
|
|
73
|
+
branding = vendor_dest / "plugins" / "harness-brand"
|
|
74
|
+
if branding.is_dir():
|
|
75
|
+
run(["pnpm", "dsh", "plugin", "--profile", "web", "add", branding], cwd=app)
|
|
76
|
+
if not skip_python:
|
|
77
|
+
venv_dir=home / "python-env"
|
|
78
|
+
venv.EnvBuilder(with_pip=True).create(venv_dir)
|
|
79
|
+
python=venv_dir / ("Scripts/python.exe" if os.name=="nt" else "bin/python")
|
|
80
|
+
run([python,"-m","pip","install","-r",requirements])
|
|
81
|
+
run([python,"-m","pip","install","ohamlab-agent==0.1.2","ohamlab-agent-lab==7.0.0"])
|
|
82
|
+
install_skills(vendor_dest / "skills", home / "data" / "skills")
|
|
83
|
+
print(f"[OHAMLAB] Installed into {home}")
|
|
84
|
+
print("[OHAMLAB] Next: ohamlab-harness doctor && ohamlab-harness start")
|
|
85
|
+
return app
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""Run the upstream Harness web server with an isolated data directory."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
import os
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
import shlex
|
|
6
|
+
import subprocess
|
|
7
|
+
import threading
|
|
8
|
+
import time
|
|
9
|
+
import urllib.request
|
|
10
|
+
import webbrowser
|
|
11
|
+
from .installer import InstallError
|
|
12
|
+
|
|
13
|
+
def start(home: Path, *, command: str="pnpm dsh web", host: str="127.0.0.1", port: int=3080, open_browser: bool=False):
|
|
14
|
+
home=home.expanduser().resolve()
|
|
15
|
+
app=home/"app"
|
|
16
|
+
if not (app/"package.json").is_file():
|
|
17
|
+
raise InstallError(f"Harness not installed at {app}. Run 'ohamlab-harness install' first.")
|
|
18
|
+
if not (home/"data"/"skills"/"web-search"/"SKILL.md").is_file():
|
|
19
|
+
raise InstallError("OhamLab skills missing; rerun installation")
|
|
20
|
+
env=os.environ.copy()
|
|
21
|
+
env.update({"DSH_HOME":str(home/"data"),"DSH_HOST":host,"DSH_PORT":str(port),"PORT":str(port)})
|
|
22
|
+
venv_bin=home/"python-env"/("Scripts" if os.name=="nt" else "bin")
|
|
23
|
+
if venv_bin.is_dir():
|
|
24
|
+
env["PATH"]=str(venv_bin)+os.pathsep+env.get("PATH","")
|
|
25
|
+
env["OHAM_PYTHON"]=str(venv_bin/("python.exe" if os.name=="nt" else "python"))
|
|
26
|
+
argv=shlex.split(command,posix=os.name!="nt")
|
|
27
|
+
if not argv:
|
|
28
|
+
raise InstallError("Empty startup command")
|
|
29
|
+
url=f"http://{host}:{port}"
|
|
30
|
+
print(f"[OHAMLAB] Starting Harness at {url}",flush=True)
|
|
31
|
+
print("[OHAMLAB] MCP gateway registration must be configured and verified separately.",flush=True)
|
|
32
|
+
if open_browser:
|
|
33
|
+
def open_when_ready():
|
|
34
|
+
for _ in range(40):
|
|
35
|
+
try:
|
|
36
|
+
with urllib.request.urlopen(url,timeout=1):
|
|
37
|
+
webbrowser.open(url)
|
|
38
|
+
return
|
|
39
|
+
except Exception:
|
|
40
|
+
time.sleep(1)
|
|
41
|
+
threading.Thread(target=open_when_ready,daemon=True).start()
|
|
42
|
+
return subprocess.call(argv,cwd=app,env=env)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ohamlab-harness
|
|
3
|
+
Version: 0.1.0b1
|
|
4
|
+
Summary: Installer and launcher for OhamLab DeepSeek Harness
|
|
5
|
+
Author: OhamLab
|
|
6
|
+
License: Proprietary - verify repository license before publication
|
|
7
|
+
Keywords: agent,mcp,harness
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
# OhamLab Harness CLI (beta)
|
|
15
|
+
|
|
16
|
+
This Python package bootstraps the Node-based Harness and the OhamLab vendor integration from GitHub. Node.js 22, Git and pnpm are required. Install and run:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
pip install -e packages/python
|
|
20
|
+
# from any directory
|
|
21
|
+
ohamlab-harness doctor
|
|
22
|
+
ohamlab-harness install
|
|
23
|
+
ohamlab-harness start
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
By default `install` clones the Harness `1.0` branch and overlays `vendor/ohamlab` from `main` of the same repository. Override the refs with `--harness-ref` and `--vendor-ref`; pin immutable commit SHAs for reproducible production installs. For a local vendor checkout, pass `--vendor-path /path/to/vendor/ohamlab`. The installer creates a separate Python virtual environment for gateway dependencies and uses a persistent data directory.
|
|
27
|
+
|
|
28
|
+
The default Harness startup command is `pnpm dsh web`; confirm this against the selected Harness release. Override with `--start-command 'pnpm ...'` if needed. The launcher does not assert MCP registration automatically; use `doctor` and test actual tool calls in Harness.
|
|
29
|
+
|
|
30
|
+
`start` serves the upstream web UI locally; it is not a cloud-hosted service or browser extension. Use `--open-browser` to open the local URL. Do not expose the UI to the public Internet without authentication and TLS.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/ohamlab_harness/__init__.py
|
|
4
|
+
src/ohamlab_harness/cli.py
|
|
5
|
+
src/ohamlab_harness/installer.py
|
|
6
|
+
src/ohamlab_harness/runtime.py
|
|
7
|
+
src/ohamlab_harness.egg-info/PKG-INFO
|
|
8
|
+
src/ohamlab_harness.egg-info/SOURCES.txt
|
|
9
|
+
src/ohamlab_harness.egg-info/dependency_links.txt
|
|
10
|
+
src/ohamlab_harness.egg-info/entry_points.txt
|
|
11
|
+
src/ohamlab_harness.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ohamlab_harness
|