ralphx 0.3.4__py3-none-any.whl → 0.4.0__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.
- ralphx/__init__.py +1 -1
- ralphx/adapters/base.py +10 -2
- ralphx/adapters/claude_cli.py +222 -82
- ralphx/api/routes/auth.py +780 -98
- ralphx/api/routes/config.py +3 -56
- ralphx/api/routes/export_import.py +6 -9
- ralphx/api/routes/loops.py +4 -4
- ralphx/api/routes/planning.py +882 -19
- ralphx/api/routes/resources.py +528 -6
- ralphx/api/routes/stream.py +58 -56
- ralphx/api/routes/templates.py +2 -2
- ralphx/api/routes/workflows.py +258 -47
- ralphx/cli.py +4 -1
- ralphx/core/auth.py +372 -172
- ralphx/core/database.py +588 -164
- ralphx/core/executor.py +170 -19
- ralphx/core/loop.py +15 -2
- ralphx/core/loop_templates.py +29 -3
- ralphx/core/planning_iteration_executor.py +633 -0
- ralphx/core/planning_service.py +119 -24
- ralphx/core/preview.py +9 -25
- ralphx/core/project_db.py +864 -121
- ralphx/core/project_export.py +1 -5
- ralphx/core/project_import.py +14 -29
- ralphx/core/resources.py +28 -2
- ralphx/core/sample_project.py +1 -5
- ralphx/core/templates.py +9 -9
- ralphx/core/workflow_executor.py +32 -3
- ralphx/core/workflow_export.py +4 -7
- ralphx/core/workflow_import.py +3 -27
- ralphx/mcp/__init__.py +6 -2
- ralphx/mcp/registry.py +3 -3
- ralphx/mcp/tools/diagnostics.py +1 -1
- ralphx/mcp/tools/monitoring.py +10 -16
- ralphx/mcp/tools/workflows.py +115 -33
- ralphx/mcp_server.py +6 -2
- ralphx/static/assets/index-BuLI7ffn.css +1 -0
- ralphx/static/assets/index-DWvlqOTb.js +264 -0
- ralphx/static/assets/index-DWvlqOTb.js.map +1 -0
- ralphx/static/index.html +2 -2
- ralphx/templates/loop_templates/consumer.md +2 -2
- {ralphx-0.3.4.dist-info → ralphx-0.4.0.dist-info}/METADATA +33 -12
- {ralphx-0.3.4.dist-info → ralphx-0.4.0.dist-info}/RECORD +45 -44
- ralphx/static/assets/index-CcRDyY3b.css +0 -1
- ralphx/static/assets/index-CcxfTosc.js +0 -251
- ralphx/static/assets/index-CcxfTosc.js.map +0 -1
- {ralphx-0.3.4.dist-info → ralphx-0.4.0.dist-info}/WHEEL +0 -0
- {ralphx-0.3.4.dist-info → ralphx-0.4.0.dist-info}/entry_points.txt +0 -0
ralphx/api/routes/config.py
CHANGED
|
@@ -187,12 +187,12 @@ async def check_loop_type_requirements_status(slug: str, loop_type: str):
|
|
|
187
187
|
detail=f"No requirements found for loop type: {loop_type}",
|
|
188
188
|
)
|
|
189
189
|
|
|
190
|
-
# Check
|
|
190
|
+
# Check for authenticated account
|
|
191
191
|
from ralphx.core.database import Database
|
|
192
192
|
|
|
193
193
|
global_db = Database()
|
|
194
|
-
|
|
195
|
-
has_auth =
|
|
194
|
+
accounts = global_db.list_accounts(include_inactive=False, include_deleted=False)
|
|
195
|
+
has_auth = len(accounts) > 0
|
|
196
196
|
|
|
197
197
|
# Get resource counts by type
|
|
198
198
|
resources = project_db.list_resources(enabled=True)
|
|
@@ -425,59 +425,6 @@ async def import_jsonl_with_format(
|
|
|
425
425
|
tmp_path.unlink(missing_ok=True)
|
|
426
426
|
|
|
427
427
|
|
|
428
|
-
# ============================================================================
|
|
429
|
-
# Namespace Endpoints
|
|
430
|
-
# ============================================================================
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
class NamespaceInfo(BaseModel):
|
|
434
|
-
"""Information about a namespace."""
|
|
435
|
-
|
|
436
|
-
namespace: str
|
|
437
|
-
item_count: int
|
|
438
|
-
pending_count: int
|
|
439
|
-
completed_count: int
|
|
440
|
-
processed_count: int
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
@router.get("/{slug}/namespaces", response_model=list[NamespaceInfo])
|
|
444
|
-
async def list_namespaces(slug: str):
|
|
445
|
-
"""List all namespaces with item counts.
|
|
446
|
-
|
|
447
|
-
Returns namespaces that have work items, along with counts by status.
|
|
448
|
-
"""
|
|
449
|
-
manager, project, project_db = get_project(slug)
|
|
450
|
-
|
|
451
|
-
# Get all items grouped by namespace
|
|
452
|
-
items, _ = project_db.list_work_items(limit=10000)
|
|
453
|
-
|
|
454
|
-
namespace_stats = {}
|
|
455
|
-
for item in items:
|
|
456
|
-
ns = item.get("namespace")
|
|
457
|
-
if not ns:
|
|
458
|
-
continue
|
|
459
|
-
|
|
460
|
-
if ns not in namespace_stats:
|
|
461
|
-
namespace_stats[ns] = {
|
|
462
|
-
"namespace": ns,
|
|
463
|
-
"item_count": 0,
|
|
464
|
-
"pending_count": 0,
|
|
465
|
-
"completed_count": 0,
|
|
466
|
-
"processed_count": 0,
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
namespace_stats[ns]["item_count"] += 1
|
|
470
|
-
status = item.get("status", "pending")
|
|
471
|
-
if status == "pending":
|
|
472
|
-
namespace_stats[ns]["pending_count"] += 1
|
|
473
|
-
elif status == "completed":
|
|
474
|
-
namespace_stats[ns]["completed_count"] += 1
|
|
475
|
-
elif status == "processed":
|
|
476
|
-
namespace_stats[ns]["processed_count"] += 1
|
|
477
|
-
|
|
478
|
-
return [NamespaceInfo(**ns) for ns in namespace_stats.values()]
|
|
479
|
-
|
|
480
|
-
|
|
481
428
|
# ============================================================================
|
|
482
429
|
# Project Resources (Shared Library) Endpoints
|
|
483
430
|
# ============================================================================
|
|
@@ -70,7 +70,7 @@ async def _read_upload_with_limit(file: UploadFile, max_size: int = MAX_UPLOAD_S
|
|
|
70
70
|
class ExportPreviewResponse(BaseModel):
|
|
71
71
|
"""Response for export preview."""
|
|
72
72
|
workflow_name: str
|
|
73
|
-
|
|
73
|
+
workflow_id: str
|
|
74
74
|
steps_count: int
|
|
75
75
|
items_total: int
|
|
76
76
|
resources_count: int
|
|
@@ -108,7 +108,7 @@ class ResourcePreviewResponse(BaseModel):
|
|
|
108
108
|
class ImportPreviewResponse(BaseModel):
|
|
109
109
|
"""Response for import preview."""
|
|
110
110
|
workflow_name: str
|
|
111
|
-
|
|
111
|
+
workflow_id: str
|
|
112
112
|
exported_at: str
|
|
113
113
|
ralphx_version: str
|
|
114
114
|
schema_version: int
|
|
@@ -138,7 +138,7 @@ class ConflictInfo(BaseModel):
|
|
|
138
138
|
class MergePreviewResponse(BaseModel):
|
|
139
139
|
"""Response for merge preview."""
|
|
140
140
|
workflow_name: str
|
|
141
|
-
|
|
141
|
+
workflow_id: str
|
|
142
142
|
items_count: int
|
|
143
143
|
resources_count: int
|
|
144
144
|
conflicts: list[ConflictInfo]
|
|
@@ -194,7 +194,6 @@ class WorkflowSummaryResponse(BaseModel):
|
|
|
194
194
|
"""Summary of a workflow in project export."""
|
|
195
195
|
id: str
|
|
196
196
|
name: str
|
|
197
|
-
namespace: str
|
|
198
197
|
steps_count: int
|
|
199
198
|
items_count: int
|
|
200
199
|
resources_count: int
|
|
@@ -323,7 +322,7 @@ async def preview_workflow_export(slug: str, workflow_id: str):
|
|
|
323
322
|
|
|
324
323
|
return ExportPreviewResponse(
|
|
325
324
|
workflow_name=preview.workflow_name,
|
|
326
|
-
|
|
325
|
+
workflow_id=preview.workflow_id,
|
|
327
326
|
steps_count=preview.steps_count,
|
|
328
327
|
items_total=preview.items_total,
|
|
329
328
|
resources_count=preview.resources_count,
|
|
@@ -404,7 +403,7 @@ async def preview_workflow_import(
|
|
|
404
403
|
|
|
405
404
|
return ImportPreviewResponse(
|
|
406
405
|
workflow_name=preview.workflow_name,
|
|
407
|
-
|
|
406
|
+
workflow_id=preview.workflow_id,
|
|
408
407
|
exported_at=preview.exported_at,
|
|
409
408
|
ralphx_version=preview.ralphx_version,
|
|
410
409
|
schema_version=preview.schema_version,
|
|
@@ -551,7 +550,7 @@ async def preview_workflow_merge(
|
|
|
551
550
|
|
|
552
551
|
return MergePreviewResponse(
|
|
553
552
|
workflow_name=preview.workflow_name,
|
|
554
|
-
|
|
553
|
+
workflow_id=preview.workflow_id,
|
|
555
554
|
items_count=preview.items_count,
|
|
556
555
|
resources_count=preview.resources_count,
|
|
557
556
|
conflicts=conflicts,
|
|
@@ -639,7 +638,6 @@ async def preview_project_export(
|
|
|
639
638
|
WorkflowSummaryResponse(
|
|
640
639
|
id=w.id,
|
|
641
640
|
name=w.name,
|
|
642
|
-
namespace=w.namespace,
|
|
643
641
|
steps_count=w.steps_count,
|
|
644
642
|
items_count=w.items_count,
|
|
645
643
|
resources_count=w.resources_count,
|
|
@@ -727,7 +725,6 @@ async def preview_project_import(
|
|
|
727
725
|
WorkflowSummaryResponse(
|
|
728
726
|
id=w.id,
|
|
729
727
|
name=w.name,
|
|
730
|
-
namespace=w.namespace,
|
|
731
728
|
steps_count=w.steps_count,
|
|
732
729
|
items_count=w.items_count,
|
|
733
730
|
resources_count=w.resources_count,
|
ralphx/api/routes/loops.py
CHANGED
|
@@ -849,14 +849,14 @@ async def create_simple_loop(slug: str, request: CreateSimpleLoopRequest):
|
|
|
849
849
|
status_code=status.HTTP_400_BAD_REQUEST,
|
|
850
850
|
detail=f"Source loop '{source_loop}' not found in this project.",
|
|
851
851
|
)
|
|
852
|
-
|
|
852
|
+
source_loop_name = source_loop # Use source loop name
|
|
853
853
|
elif request.stories_source and request.stories_source.type == "content":
|
|
854
|
-
# For JSONL uploads, derive
|
|
855
|
-
|
|
854
|
+
# For JSONL uploads, derive source from request or loop_id
|
|
855
|
+
source_loop_name = request.stories_source.namespace or loop_id.replace("-", "_")
|
|
856
856
|
|
|
857
857
|
config_yaml = generate_simple_implementation_config(
|
|
858
858
|
name=loop_id,
|
|
859
|
-
|
|
859
|
+
source_loop=source_loop_name,
|
|
860
860
|
display_name=display_name,
|
|
861
861
|
description=description,
|
|
862
862
|
)
|