loom-core 0.1.2__tar.gz → 0.1.4__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.
- {loom_core-0.1.2 → loom_core-0.1.4}/PKG-INFO +1 -1
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/cli/cli.py +4 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/common/activity.py +6 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/common/workflow.py +6 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/core/engine.py +3 -1
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/core/state.py +1 -1
- {loom_core-0.1.2 → loom_core-0.1.4}/loom_core.egg-info/PKG-INFO +1 -1
- {loom_core-0.1.2 → loom_core-0.1.4}/pyproject.toml +1 -1
- {loom_core-0.1.2 → loom_core-0.1.4}/LICENSE +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/MANIFEST.in +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/QUICKSTART.md +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/README.md +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/__init__.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/cli/__init__.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/common/config.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/common/errors.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/core/__init__.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/core/compiled.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/core/context.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/core/handle.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/core/logger.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/core/runner.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/core/worker.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/core/workflow.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/database/__init__.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/database/db.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/decorators/__init__.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/decorators/activity.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/decorators/workflow.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/lib/progress.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/lib/utils.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/migrations/down/001_setup_pragma.sql +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/migrations/down/002_create_workflows.sql +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/migrations/down/003.create_events.sql +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/migrations/down/004.create_tasks.sql +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/migrations/down/005.create_indexes.sql +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/migrations/down/006_auto_update_triggers.sql +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/migrations/down/007_create_logs.sql +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/migrations/up/001_setup_pragma.sql +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/migrations/up/002_create_workflows.sql +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/migrations/up/003_create_events.sql +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/migrations/up/004_create_tasks.sql +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/migrations/up/005_create_indexes.sql +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/migrations/up/006_auto_update_triggers.sql +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/migrations/up/007_create_logs.sql +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/schemas/__init__.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/schemas/activity.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/schemas/database.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/schemas/events.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/schemas/tasks.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom/schemas/workflow.py +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom_core.egg-info/SOURCES.txt +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom_core.egg-info/dependency_links.txt +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom_core.egg-info/entry_points.txt +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom_core.egg-info/requires.txt +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/loom_core.egg-info/top_level.txt +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/setup.cfg +0 -0
- {loom_core-0.1.2 → loom_core-0.1.4}/setup.py +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"""Loom CLI - Command-line interface for Loom workflow orchestration."""
|
|
3
3
|
|
|
4
4
|
import asyncio
|
|
5
|
+
import os # Added import
|
|
5
6
|
import sys
|
|
6
7
|
from typing import Any
|
|
7
8
|
|
|
@@ -28,6 +29,9 @@ def cli():
|
|
|
28
29
|
Loom provides event-sourced, deterministic workflow execution with
|
|
29
30
|
automatic recovery and replay capabilities.
|
|
30
31
|
"""
|
|
32
|
+
# Ensure current directory is in python path so user modules can be imported
|
|
33
|
+
if os.getcwd() not in sys.path:
|
|
34
|
+
sys.path.insert(0, os.getcwd())
|
|
31
35
|
pass
|
|
32
36
|
|
|
33
37
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import importlib
|
|
2
|
+
import sys
|
|
2
3
|
from typing import Any, Awaitable, Callable, cast
|
|
3
4
|
|
|
4
5
|
|
|
@@ -6,6 +7,11 @@ def load_activity(module: str, func: str) -> Callable[..., Awaitable[Any]]:
|
|
|
6
7
|
|
|
7
8
|
try:
|
|
8
9
|
activity_module = importlib.import_module(module)
|
|
10
|
+
|
|
11
|
+
# Force reload the module to get latest changes
|
|
12
|
+
if module in sys.modules:
|
|
13
|
+
activity_module = importlib.reload(activity_module)
|
|
14
|
+
|
|
9
15
|
except ModuleNotFoundError as e:
|
|
10
16
|
raise ModuleNotFoundError(
|
|
11
17
|
f"Cannot import activity module '{module}'. "
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import importlib
|
|
2
|
+
import sys
|
|
2
3
|
from typing import Any, Type
|
|
3
4
|
|
|
4
5
|
from ..core.workflow import Workflow
|
|
@@ -32,6 +33,11 @@ def workflow_registry(module: str, cls: str) -> Type[Workflow[Any, Any]]:
|
|
|
32
33
|
"""
|
|
33
34
|
try:
|
|
34
35
|
workflow_module = importlib.import_module(module)
|
|
36
|
+
|
|
37
|
+
# Force reload the module to get latest changes
|
|
38
|
+
if module in sys.modules:
|
|
39
|
+
workflow_module = importlib.reload(workflow_module)
|
|
40
|
+
|
|
35
41
|
except ModuleNotFoundError as e:
|
|
36
42
|
raise ModuleNotFoundError(
|
|
37
43
|
f"Cannot import workflow module '{module}'. "
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import json
|
|
1
2
|
from datetime import datetime, timedelta, timezone
|
|
2
3
|
from typing import Generic
|
|
3
4
|
|
|
@@ -76,9 +77,10 @@ class Engine(Generic[InputT, StateT]):
|
|
|
76
77
|
async with Database[InputT, StateT]() as db:
|
|
77
78
|
workflow_def = await db.get_workflow_info(workflow_id)
|
|
78
79
|
history = await db.get_workflow_events(workflow_id=workflow_def["id"])
|
|
80
|
+
workflow_input = json.loads(workflow_def["input"])
|
|
79
81
|
|
|
80
82
|
ctx: WorkflowContext = WorkflowContext(
|
|
81
|
-
workflow_def["id"],
|
|
83
|
+
workflow_def["id"], workflow_input, history, {}
|
|
82
84
|
)
|
|
83
85
|
|
|
84
86
|
first_event = ctx._peek()
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|