onex-cli 1.16.0__tar.gz → 1.16.2__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.
- {onex_cli-1.16.0/onex_cli.egg-info → onex_cli-1.16.2}/PKG-INFO +1 -1
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/__init__.py +1 -1
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/mcp/tools/rocket_tools.py +98 -18
- {onex_cli-1.16.0 → onex_cli-1.16.2/onex_cli.egg-info}/PKG-INFO +1 -1
- {onex_cli-1.16.0 → onex_cli-1.16.2}/CHANGELOG.md +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/LICENSE +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/MANIFEST.in +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/README.md +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/__main__.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/__init__.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/create.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/create_e2e.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/debug.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/deploy.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/dev.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/env.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/es.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/init.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/invoke.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/login.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/logout.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/logs.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/mcp.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/platform.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/provision.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/reload.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/replay.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/s3.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/status.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/switch.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/test.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/trace.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/undeploy.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/validate.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/commands/vpn.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/config.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/mcp/__init__.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/mcp/server.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/mcp/tools/__init__.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/runtime/__init__.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/runtime/local_runtime.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/schema/__init__.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/schema/service_descriptor.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/schema/validator.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/crud-service/README.md.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/crud-service/__init__.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/crud-service/service.yml.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/crud-service/src/__init__.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/crud-service/src/apis/__init__.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/crud-service/src/models/__init__.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/crud-service/src/models/schemas.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/crud-service/src/repositories/__init__.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/crud-service/src/services/__init__.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/e2e/data_service.yml.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/e2e/test_service_e2e.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/event-driven/README.md.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/event-driven/__init__.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/event-driven/service.yml.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/event-driven/src/__init__.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/event-driven/src/triggers/__init__.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/event-driven/src/triggers/events.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/event-driven/src/triggers/schedules.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/go-minimal/README.md.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/go-minimal/go.mod.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/go-minimal/main.go.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/go-minimal/service.yml.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/go-rest-api/README.md.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/go-rest-api/go.mod.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/go-rest-api/handlers/items.go.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/go-rest-api/main.go.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/go-rest-api/service.yml.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/minimal/README.md.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/minimal/__init__.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/minimal/service.yml.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/minimal/src/__init__.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/minimal/src/apis/__init__.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/minimal/src/apis/hello.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/rest-api/README.md.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/rest-api/__init__.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/rest-api/service.yml.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/rest-api/src/__init__.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/rest-api/src/apis/__init__.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/rest-api/src/apis/handlers.py.j2 +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/utils/__init__.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/utils/auth.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/utils/crypto.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/utils/email.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/utils/helpers.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/vpn/__init__.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/vpn/platform_detector.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/vpn/setup_vpn.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex/vpn/wireguard_manager.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex_cli.egg-info/SOURCES.txt +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex_cli.egg-info/dependency_links.txt +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex_cli.egg-info/entry_points.txt +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex_cli.egg-info/requires.txt +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/onex_cli.egg-info/top_level.txt +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/setup.cfg +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/setup.py +0 -0
- {onex_cli-1.16.0 → onex_cli-1.16.2}/tests/test_mcp_logs_e2e.py +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# OneXEOS Services CLI
|
|
2
|
-
__version__ = "1.16.
|
|
2
|
+
__version__ = "1.16.2"
|
|
@@ -130,17 +130,51 @@ def _detect_git_repo() -> Optional[dict]:
|
|
|
130
130
|
|
|
131
131
|
def register_rocket_tools(mcp, api_url: Optional[str] = None):
|
|
132
132
|
"""Register all onex-rocket tools on an existing FastMCP server."""
|
|
133
|
-
|
|
134
133
|
base_url = _resolve_rocket_url(api_url)
|
|
135
|
-
client = httpx.Client(base_url=base_url, timeout=
|
|
134
|
+
client = httpx.Client(base_url=base_url, timeout=10.0)
|
|
136
135
|
_indexed_repos: set = set() # track repos already indexed this session
|
|
136
|
+
_indexing_in_progress: set = set() # repos currently being indexed
|
|
137
|
+
|
|
138
|
+
def _check_index_status() -> Optional[dict]:
|
|
139
|
+
"""Check server-side indexing status for repos in progress.
|
|
140
|
+
Returns status dict if indexing, None if all done."""
|
|
141
|
+
if not _indexing_in_progress:
|
|
142
|
+
return None
|
|
143
|
+
try:
|
|
144
|
+
resp = client.get("/api/v1/index/status", timeout=3)
|
|
145
|
+
if resp.status_code == 200:
|
|
146
|
+
statuses = resp.json()
|
|
147
|
+
active = {}
|
|
148
|
+
for name, status in statuses.items():
|
|
149
|
+
if name in _indexing_in_progress:
|
|
150
|
+
if status.get("status") == "done":
|
|
151
|
+
_indexed_repos.add(name)
|
|
152
|
+
_indexing_in_progress.discard(name)
|
|
153
|
+
elif status.get("status") == "error":
|
|
154
|
+
_indexing_in_progress.discard(name)
|
|
155
|
+
else:
|
|
156
|
+
active[name] = status
|
|
157
|
+
if active:
|
|
158
|
+
return active
|
|
159
|
+
except Exception:
|
|
160
|
+
pass
|
|
161
|
+
return None
|
|
137
162
|
|
|
138
163
|
def _get(path: str, params: dict = None) -> str:
|
|
139
|
-
"""Make GET request to rocket API, return JSON string.
|
|
164
|
+
"""Make GET request to rocket API, return JSON string.
|
|
165
|
+
If result is empty and indexing is in progress, returns status info."""
|
|
140
166
|
try:
|
|
141
167
|
resp = client.get(f"/api/v1/{path}", params=params or {})
|
|
142
168
|
resp.raise_for_status()
|
|
143
|
-
|
|
169
|
+
result = resp.text
|
|
170
|
+
if result in ("null", "[]", "{}"):
|
|
171
|
+
active = _check_index_status()
|
|
172
|
+
if active:
|
|
173
|
+
return json.dumps({
|
|
174
|
+
"_indexing": active,
|
|
175
|
+
"_note": "Repo is being indexed. Results will be available when indexing completes. Check status with rocket_index_status tool or retry shortly."
|
|
176
|
+
})
|
|
177
|
+
return result
|
|
144
178
|
except httpx.HTTPError as e:
|
|
145
179
|
return f'{{"error": "{str(e)}"}}'
|
|
146
180
|
|
|
@@ -160,38 +194,54 @@ def register_rocket_tools(mcp, api_url: Optional[str] = None):
|
|
|
160
194
|
main/dev/preview -> "repo-name" (shared graph, auto-reindexed)
|
|
161
195
|
feature/hotfix -> "repo-name@branch" (on-demand, indexed once)
|
|
162
196
|
|
|
163
|
-
Only checks once per graph_name per session.
|
|
197
|
+
Only checks once per graph_name per session. Non-blocking:
|
|
198
|
+
triggers async index on the server and returns immediately.
|
|
164
199
|
"""
|
|
165
200
|
repo_info = _detect_git_repo()
|
|
166
201
|
if not repo_info:
|
|
167
202
|
return
|
|
168
203
|
|
|
169
204
|
graph_name = repo_info["graph_name"]
|
|
170
|
-
if graph_name in _indexed_repos:
|
|
205
|
+
if graph_name in _indexed_repos or graph_name in _indexing_in_progress:
|
|
171
206
|
return
|
|
172
207
|
|
|
173
|
-
# Check
|
|
208
|
+
# Check index/status first (lightweight, doesn't hit the graph)
|
|
209
|
+
try:
|
|
210
|
+
resp = client.get(f"/api/v1/index/status/{graph_name}", timeout=3)
|
|
211
|
+
if resp.status_code == 200:
|
|
212
|
+
status = resp.json()
|
|
213
|
+
if status.get("status") == "done":
|
|
214
|
+
_indexed_repos.add(graph_name)
|
|
215
|
+
return
|
|
216
|
+
if status.get("status") == "indexing":
|
|
217
|
+
_indexing_in_progress.add(graph_name)
|
|
218
|
+
return
|
|
219
|
+
except Exception:
|
|
220
|
+
pass
|
|
221
|
+
|
|
222
|
+
# Not tracked — check graph stats as fallback
|
|
174
223
|
try:
|
|
175
|
-
resp = client.get("/api/v1/stats", timeout=
|
|
224
|
+
resp = client.get("/api/v1/stats", timeout=3)
|
|
176
225
|
if resp.status_code == 200:
|
|
177
|
-
|
|
178
|
-
by_repo = stats.get("by_repo", {})
|
|
226
|
+
by_repo = resp.json().get("by_repo", {})
|
|
179
227
|
if graph_name in by_repo:
|
|
180
228
|
_indexed_repos.add(graph_name)
|
|
181
229
|
return
|
|
182
230
|
except Exception:
|
|
183
231
|
return
|
|
184
232
|
|
|
185
|
-
# Not in graph — trigger index
|
|
233
|
+
# Not in graph — trigger async index (returns immediately)
|
|
186
234
|
try:
|
|
187
|
-
client.post("/api/v1/index", json={
|
|
235
|
+
resp = client.post("/api/v1/index", json={
|
|
188
236
|
"url": repo_info["url"],
|
|
189
237
|
"name": graph_name,
|
|
190
238
|
"branch": repo_info["branch"],
|
|
191
|
-
|
|
192
|
-
|
|
239
|
+
"async": True,
|
|
240
|
+
}, timeout=5)
|
|
241
|
+
if resp.status_code == 200:
|
|
242
|
+
_indexing_in_progress.add(graph_name)
|
|
193
243
|
except Exception:
|
|
194
|
-
pass
|
|
244
|
+
pass
|
|
195
245
|
|
|
196
246
|
def _get_current_graph_name() -> Optional[str]:
|
|
197
247
|
"""Get the graph name for the current repo+branch.
|
|
@@ -354,8 +404,7 @@ def register_rocket_tools(mcp, api_url: Optional[str] = None):
|
|
|
354
404
|
@mcp.tool()
|
|
355
405
|
def rocket_stats() -> str:
|
|
356
406
|
"""Get graph statistics: total nodes/edges, breakdown by kind and repo.
|
|
357
|
-
|
|
358
|
-
Auto-indexes the current repo if not already in the graph."""
|
|
407
|
+
Auto-indexes the current repo if not already in the graph (non-blocking)."""
|
|
359
408
|
_ensure_repo_indexed()
|
|
360
409
|
return _get("stats")
|
|
361
410
|
|
|
@@ -370,7 +419,29 @@ def register_rocket_tools(mcp, api_url: Optional[str] = None):
|
|
|
370
419
|
|
|
371
420
|
@mcp.tool()
|
|
372
421
|
def rocket_index(path: str = "", url: str = "", name: str = "", branch: str = "main") -> str:
|
|
373
|
-
"""Index a repository into the code graph. Use path for local repos, url for git repos.
|
|
422
|
+
"""Index a repository into the code graph. Use path for local repos, url for git repos.
|
|
423
|
+
If indexing is already in progress for this repo, returns the current status instead of starting a new one."""
|
|
424
|
+
# Check if already indexing
|
|
425
|
+
check_name = name
|
|
426
|
+
if not check_name and url:
|
|
427
|
+
check_name = url.rstrip('/').rsplit('/', 1)[-1]
|
|
428
|
+
if check_name.endswith('.git'):
|
|
429
|
+
check_name = check_name[:-4]
|
|
430
|
+
if check_name:
|
|
431
|
+
try:
|
|
432
|
+
resp = client.get(f"/api/v1/index/status/{check_name}", timeout=3)
|
|
433
|
+
if resp.status_code == 200:
|
|
434
|
+
status = resp.json()
|
|
435
|
+
if status.get("status") == "indexing":
|
|
436
|
+
return json.dumps({
|
|
437
|
+
"status": "already_indexing",
|
|
438
|
+
"repo": check_name,
|
|
439
|
+
"started_at": status.get("started_at"),
|
|
440
|
+
"message": f"Indexing already in progress for '{check_name}'. Use rocket_index_status to check progress."
|
|
441
|
+
})
|
|
442
|
+
except Exception:
|
|
443
|
+
pass
|
|
444
|
+
|
|
374
445
|
data = {"branch": branch}
|
|
375
446
|
if path:
|
|
376
447
|
data["path"] = path
|
|
@@ -379,3 +450,12 @@ def register_rocket_tools(mcp, api_url: Optional[str] = None):
|
|
|
379
450
|
if name:
|
|
380
451
|
data["name"] = name
|
|
381
452
|
return _post("index", data)
|
|
453
|
+
|
|
454
|
+
@mcp.tool()
|
|
455
|
+
def rocket_index_status(repo: str = "") -> str:
|
|
456
|
+
"""Check indexing status for a repo or all repos.
|
|
457
|
+
Returns: status (indexing/done/error), duration, symbols/edges count.
|
|
458
|
+
If repo is omitted, returns status for all repos."""
|
|
459
|
+
if repo:
|
|
460
|
+
return _get(f"index/status/{repo}")
|
|
461
|
+
return _get("index/status")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/crud-service/src/repositories/__init__.py.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{onex_cli-1.16.0 → onex_cli-1.16.2}/onex/templates/event-driven/src/triggers/schedules.py.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|