refua-studio 0.6.0__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 JJ Ben-Joseph
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,160 @@
1
+ Metadata-Version: 2.4
2
+ Name: refua-studio
3
+ Version: 0.6.0
4
+ Summary: Web control plane for Refua campaign orchestration and scientific execution.
5
+ Author-email: JJ Ben-Joseph <jj@tensorspace.ai>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://agentcures.com/
8
+ Project-URL: Repository, https://github.com/agentcures/refua
9
+ Project-URL: Documentation, https://github.com/agentcures/refua#readme
10
+ Project-URL: Issues, https://github.com/agentcures/refua/issues
11
+ Keywords: drug discovery,refua,campaign,control plane,studio
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Requires-Python: <3.15,>=3.11
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Dynamic: license-file
25
+
26
+ # refua-studio
27
+
28
+ `refua-studio` is the Refua web control plane for planning and running discovery campaigns.
29
+
30
+ It provides:
31
+
32
+ - Mission control UI for planning (`plan`), execution (`run`), and autonomous loops (`run-autonomous` behavior)
33
+ - JSON plan editor with validation and direct execution
34
+ - Portfolio ranking UI for disease program prioritization
35
+ - Built-in objective/plan/portfolio templates loaded from workspace examples
36
+ - Promising drug portfolio section with candidate cards, scores, metrics, and full detail view
37
+ - Persistent background job history (SQLite)
38
+ - Job lifecycle operations (filter, cancel queued jobs, clear finished jobs)
39
+ - Runtime/tool introspection with graceful fallback when heavy ML deps are unavailable
40
+
41
+ This project is designed to reuse existing workspace components:
42
+
43
+ - `ClawCures` for planning, policy checks, orchestration, and portfolio ranking
44
+ - `refua-mcp` for tool execution when runtime dependencies are installed
45
+
46
+ ## Install
47
+
48
+ ```bash
49
+ cd path/to/refua-studio
50
+ pip install -e .
51
+ ```
52
+
53
+ ## Run
54
+
55
+ ```bash
56
+ refua-studio --host 127.0.0.1 --port 8787 --open-browser
57
+ ```
58
+
59
+ Or from source without install:
60
+
61
+ ```bash
62
+ cd path/to/refua-studio
63
+ PYTHONPATH=src python -m refua_studio --host 127.0.0.1 --port 8787
64
+ ```
65
+
66
+ ## Configuration
67
+
68
+ Studio uses the same OpenClaw-related environment variables as `ClawCures`:
69
+
70
+ - `REFUA_CAMPAIGN_OPENCLAW_BASE_URL` (default: `http://127.0.0.1:18789`)
71
+ - `REFUA_CAMPAIGN_OPENCLAW_MODEL` (default: `openclaw:main`)
72
+ - `REFUA_CAMPAIGN_TIMEOUT_SECONDS` (default: `180`)
73
+ - `OPENCLAW_GATEWAY_TOKEN` or `REFUA_CAMPAIGN_OPENCLAW_TOKEN`
74
+
75
+ CLI flags:
76
+
77
+ - `--host`
78
+ - `--port`
79
+ - `--data-dir` (default: `.refua-studio`)
80
+ - `--workspace-root` (defaults to parent workspace)
81
+ - `--max-workers` (background job concurrency)
82
+
83
+ ## API Endpoints
84
+
85
+ - `GET /api/health`
86
+ - `GET /api/config`
87
+ - `GET /api/tools`
88
+ - `GET /api/examples`
89
+ - `GET /api/drug-portfolio?min_score=50&limit=60`
90
+ - `GET /api/jobs?limit=80&status=running,failed`
91
+ - `GET /api/jobs/{job_id}`
92
+ - `POST /api/jobs/{job_id}/cancel`
93
+ - `POST /api/jobs/clear`
94
+ - `POST /api/plan`
95
+ - `POST /api/run`
96
+ - `POST /api/plan/validate`
97
+ - `POST /api/plan/execute`
98
+ - `POST /api/portfolio/rank`
99
+
100
+ ### `POST /api/run` payload
101
+
102
+ ```json
103
+ {
104
+ "objective": "Design an initial campaign against KRAS G12D",
105
+ "system_prompt": null,
106
+ "dry_run": false,
107
+ "async_mode": true,
108
+ "autonomous": false,
109
+ "max_rounds": 3,
110
+ "max_calls": 10,
111
+ "allow_skip_validate_first": false,
112
+ "plan": null
113
+ }
114
+ ```
115
+
116
+ ## Background Jobs
117
+
118
+ Jobs are persisted in SQLite at:
119
+
120
+ - `<data-dir>/studio.db`
121
+
122
+ Each job records request payload, status transitions (`queued` -> `running` -> `completed`/`failed`), result JSON, and error text.
123
+ `cancelled` is also tracked when queued jobs are cancelled before execution.
124
+
125
+ ## Runtime Behavior
126
+
127
+ - If `refua-mcp` runtime dependencies are available, Studio executes plans through `RefuaMcpAdapter`.
128
+ - If unavailable, Studio falls back to a static tool list for planning/validation and emits warnings.
129
+ - Dry-run workflows and policy validation remain usable even without heavy runtime dependencies.
130
+
131
+ ## Tests
132
+
133
+ ```bash
134
+ cd path/to/refua-studio
135
+ python -m unittest discover -s tests -v
136
+ ```
137
+
138
+ ## Project Layout
139
+
140
+ ```text
141
+ refua-studio/
142
+ src/refua_studio/
143
+ app.py
144
+ bridge.py
145
+ cli.py
146
+ config.py
147
+ runner.py
148
+ storage.py
149
+ static/
150
+ index.html
151
+ app.js
152
+ styles.css
153
+ tests/
154
+ ```
155
+
156
+ ## Notes
157
+
158
+ - The Studio UI is a static single-page app served by the Python server.
159
+ - No third-party web framework is required.
160
+ - This keeps installation lightweight while still integrating with the existing Refua ecosystem.
@@ -0,0 +1,135 @@
1
+ # refua-studio
2
+
3
+ `refua-studio` is the Refua web control plane for planning and running discovery campaigns.
4
+
5
+ It provides:
6
+
7
+ - Mission control UI for planning (`plan`), execution (`run`), and autonomous loops (`run-autonomous` behavior)
8
+ - JSON plan editor with validation and direct execution
9
+ - Portfolio ranking UI for disease program prioritization
10
+ - Built-in objective/plan/portfolio templates loaded from workspace examples
11
+ - Promising drug portfolio section with candidate cards, scores, metrics, and full detail view
12
+ - Persistent background job history (SQLite)
13
+ - Job lifecycle operations (filter, cancel queued jobs, clear finished jobs)
14
+ - Runtime/tool introspection with graceful fallback when heavy ML deps are unavailable
15
+
16
+ This project is designed to reuse existing workspace components:
17
+
18
+ - `ClawCures` for planning, policy checks, orchestration, and portfolio ranking
19
+ - `refua-mcp` for tool execution when runtime dependencies are installed
20
+
21
+ ## Install
22
+
23
+ ```bash
24
+ cd path/to/refua-studio
25
+ pip install -e .
26
+ ```
27
+
28
+ ## Run
29
+
30
+ ```bash
31
+ refua-studio --host 127.0.0.1 --port 8787 --open-browser
32
+ ```
33
+
34
+ Or from source without install:
35
+
36
+ ```bash
37
+ cd path/to/refua-studio
38
+ PYTHONPATH=src python -m refua_studio --host 127.0.0.1 --port 8787
39
+ ```
40
+
41
+ ## Configuration
42
+
43
+ Studio uses the same OpenClaw-related environment variables as `ClawCures`:
44
+
45
+ - `REFUA_CAMPAIGN_OPENCLAW_BASE_URL` (default: `http://127.0.0.1:18789`)
46
+ - `REFUA_CAMPAIGN_OPENCLAW_MODEL` (default: `openclaw:main`)
47
+ - `REFUA_CAMPAIGN_TIMEOUT_SECONDS` (default: `180`)
48
+ - `OPENCLAW_GATEWAY_TOKEN` or `REFUA_CAMPAIGN_OPENCLAW_TOKEN`
49
+
50
+ CLI flags:
51
+
52
+ - `--host`
53
+ - `--port`
54
+ - `--data-dir` (default: `.refua-studio`)
55
+ - `--workspace-root` (defaults to parent workspace)
56
+ - `--max-workers` (background job concurrency)
57
+
58
+ ## API Endpoints
59
+
60
+ - `GET /api/health`
61
+ - `GET /api/config`
62
+ - `GET /api/tools`
63
+ - `GET /api/examples`
64
+ - `GET /api/drug-portfolio?min_score=50&limit=60`
65
+ - `GET /api/jobs?limit=80&status=running,failed`
66
+ - `GET /api/jobs/{job_id}`
67
+ - `POST /api/jobs/{job_id}/cancel`
68
+ - `POST /api/jobs/clear`
69
+ - `POST /api/plan`
70
+ - `POST /api/run`
71
+ - `POST /api/plan/validate`
72
+ - `POST /api/plan/execute`
73
+ - `POST /api/portfolio/rank`
74
+
75
+ ### `POST /api/run` payload
76
+
77
+ ```json
78
+ {
79
+ "objective": "Design an initial campaign against KRAS G12D",
80
+ "system_prompt": null,
81
+ "dry_run": false,
82
+ "async_mode": true,
83
+ "autonomous": false,
84
+ "max_rounds": 3,
85
+ "max_calls": 10,
86
+ "allow_skip_validate_first": false,
87
+ "plan": null
88
+ }
89
+ ```
90
+
91
+ ## Background Jobs
92
+
93
+ Jobs are persisted in SQLite at:
94
+
95
+ - `<data-dir>/studio.db`
96
+
97
+ Each job records request payload, status transitions (`queued` -> `running` -> `completed`/`failed`), result JSON, and error text.
98
+ `cancelled` is also tracked when queued jobs are cancelled before execution.
99
+
100
+ ## Runtime Behavior
101
+
102
+ - If `refua-mcp` runtime dependencies are available, Studio executes plans through `RefuaMcpAdapter`.
103
+ - If unavailable, Studio falls back to a static tool list for planning/validation and emits warnings.
104
+ - Dry-run workflows and policy validation remain usable even without heavy runtime dependencies.
105
+
106
+ ## Tests
107
+
108
+ ```bash
109
+ cd path/to/refua-studio
110
+ python -m unittest discover -s tests -v
111
+ ```
112
+
113
+ ## Project Layout
114
+
115
+ ```text
116
+ refua-studio/
117
+ src/refua_studio/
118
+ app.py
119
+ bridge.py
120
+ cli.py
121
+ config.py
122
+ runner.py
123
+ storage.py
124
+ static/
125
+ index.html
126
+ app.js
127
+ styles.css
128
+ tests/
129
+ ```
130
+
131
+ ## Notes
132
+
133
+ - The Studio UI is a static single-page app served by the Python server.
134
+ - No third-party web framework is required.
135
+ - This keeps installation lightweight while still integrating with the existing Refua ecosystem.
@@ -0,0 +1,50 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "refua-studio"
7
+ version = "0.6.0"
8
+ description = "Web control plane for Refua campaign orchestration and scientific execution."
9
+ readme = "README.md"
10
+ requires-python = ">=3.11,<3.15"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{name = "JJ Ben-Joseph", email = "jj@tensorspace.ai"}]
14
+ keywords = [
15
+ "drug discovery",
16
+ "refua",
17
+ "campaign",
18
+ "control plane",
19
+ "studio"
20
+ ]
21
+ classifiers = [
22
+ "Development Status :: 3 - Alpha",
23
+ "Intended Audience :: Science/Research",
24
+ "Programming Language :: Python :: 3",
25
+ "Programming Language :: Python :: 3.11",
26
+ "Programming Language :: Python :: 3.12",
27
+ "Programming Language :: Python :: 3.13",
28
+ "Programming Language :: Python :: 3.14",
29
+ "Topic :: Scientific/Engineering :: Bio-Informatics",
30
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
31
+ ]
32
+ dependencies = []
33
+
34
+ [project.urls]
35
+ Homepage = "https://agentcures.com/"
36
+ Repository = "https://github.com/agentcures/refua"
37
+ Documentation = "https://github.com/agentcures/refua#readme"
38
+ Issues = "https://github.com/agentcures/refua/issues"
39
+
40
+ [project.scripts]
41
+ refua-studio = "refua_studio.cli:main"
42
+
43
+ [tool.setuptools.packages.find]
44
+ where = ["src"]
45
+
46
+ [tool.setuptools.package-data]
47
+ refua_studio = ["static/*"]
48
+
49
+ [tool.setuptools.exclude-package-data]
50
+ "*" = ["*.py[cod]", "__pycache__/*"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,5 @@
1
+ """Refua Studio package."""
2
+
3
+ __all__ = ["__version__"]
4
+
5
+ __version__ = "0.6.0"
@@ -0,0 +1,7 @@
1
+ from __future__ import annotations
2
+
3
+ from refua_studio.cli import main
4
+
5
+
6
+ if __name__ == "__main__":
7
+ raise SystemExit(main())