kailash 0.1.5__py3-none-any.whl → 0.2.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.
- kailash/__init__.py +1 -1
- kailash/access_control.py +740 -0
- kailash/api/__main__.py +6 -0
- kailash/api/auth.py +668 -0
- kailash/api/custom_nodes.py +285 -0
- kailash/api/custom_nodes_secure.py +377 -0
- kailash/api/database.py +620 -0
- kailash/api/studio.py +915 -0
- kailash/api/studio_secure.py +893 -0
- kailash/mcp/__init__.py +53 -0
- kailash/mcp/__main__.py +13 -0
- kailash/mcp/ai_registry_server.py +712 -0
- kailash/mcp/client.py +447 -0
- kailash/mcp/client_new.py +334 -0
- kailash/mcp/server.py +293 -0
- kailash/mcp/server_new.py +336 -0
- kailash/mcp/servers/__init__.py +12 -0
- kailash/mcp/servers/ai_registry.py +289 -0
- kailash/nodes/__init__.py +4 -2
- kailash/nodes/ai/__init__.py +2 -0
- kailash/nodes/ai/a2a.py +714 -67
- kailash/nodes/ai/intelligent_agent_orchestrator.py +31 -37
- kailash/nodes/ai/iterative_llm_agent.py +1280 -0
- kailash/nodes/ai/llm_agent.py +324 -1
- kailash/nodes/ai/self_organizing.py +5 -6
- kailash/nodes/base.py +15 -2
- kailash/nodes/base_async.py +45 -0
- kailash/nodes/base_cycle_aware.py +374 -0
- kailash/nodes/base_with_acl.py +338 -0
- kailash/nodes/code/python.py +135 -27
- kailash/nodes/data/readers.py +16 -6
- kailash/nodes/data/writers.py +16 -6
- kailash/nodes/logic/__init__.py +8 -0
- kailash/nodes/logic/convergence.py +642 -0
- kailash/nodes/logic/loop.py +153 -0
- kailash/nodes/logic/operations.py +187 -27
- kailash/nodes/mixins/__init__.py +11 -0
- kailash/nodes/mixins/mcp.py +228 -0
- kailash/nodes/mixins.py +387 -0
- kailash/runtime/__init__.py +2 -1
- kailash/runtime/access_controlled.py +458 -0
- kailash/runtime/local.py +106 -33
- kailash/runtime/parallel_cyclic.py +529 -0
- kailash/sdk_exceptions.py +90 -5
- kailash/security.py +845 -0
- kailash/tracking/manager.py +38 -15
- kailash/tracking/models.py +1 -1
- kailash/tracking/storage/filesystem.py +30 -2
- kailash/utils/__init__.py +8 -0
- kailash/workflow/__init__.py +18 -0
- kailash/workflow/convergence.py +270 -0
- kailash/workflow/cycle_analyzer.py +768 -0
- kailash/workflow/cycle_builder.py +573 -0
- kailash/workflow/cycle_config.py +709 -0
- kailash/workflow/cycle_debugger.py +760 -0
- kailash/workflow/cycle_exceptions.py +601 -0
- kailash/workflow/cycle_profiler.py +671 -0
- kailash/workflow/cycle_state.py +338 -0
- kailash/workflow/cyclic_runner.py +985 -0
- kailash/workflow/graph.py +500 -39
- kailash/workflow/migration.py +768 -0
- kailash/workflow/safety.py +365 -0
- kailash/workflow/templates.py +744 -0
- kailash/workflow/validation.py +693 -0
- {kailash-0.1.5.dist-info → kailash-0.2.0.dist-info}/METADATA +256 -12
- kailash-0.2.0.dist-info/RECORD +125 -0
- kailash/nodes/mcp/__init__.py +0 -11
- kailash/nodes/mcp/client.py +0 -554
- kailash/nodes/mcp/resource.py +0 -682
- kailash/nodes/mcp/server.py +0 -577
- kailash-0.1.5.dist-info/RECORD +0 -88
- {kailash-0.1.5.dist-info → kailash-0.2.0.dist-info}/WHEEL +0 -0
- {kailash-0.1.5.dist-info → kailash-0.2.0.dist-info}/entry_points.txt +0 -0
- {kailash-0.1.5.dist-info → kailash-0.2.0.dist-info}/licenses/LICENSE +0 -0
- {kailash-0.1.5.dist-info → kailash-0.2.0.dist-info}/top_level.txt +0 -0
kailash/nodes/data/writers.py
CHANGED
@@ -34,6 +34,7 @@ import json
|
|
34
34
|
from typing import Any, Dict
|
35
35
|
|
36
36
|
from kailash.nodes.base import Node, NodeParameter, register_node
|
37
|
+
from kailash.security import safe_open, validate_file_path
|
37
38
|
|
38
39
|
|
39
40
|
@register_node()
|
@@ -190,7 +191,7 @@ class CSVWriterNode(Node):
|
|
190
191
|
- External tools can process output
|
191
192
|
- Metrics available for monitoring
|
192
193
|
"""
|
193
|
-
file_path = kwargs
|
194
|
+
file_path = kwargs.get("file_path") or self.config.get("file_path")
|
194
195
|
data = kwargs["data"]
|
195
196
|
headers = kwargs.get("headers")
|
196
197
|
delimiter = kwargs.get("delimiter", ",")
|
@@ -198,7 +199,10 @@ class CSVWriterNode(Node):
|
|
198
199
|
if not data:
|
199
200
|
return {"rows_written": 0}
|
200
201
|
|
201
|
-
|
202
|
+
# Validate file path for security
|
203
|
+
validated_path = validate_file_path(file_path, operation="CSV write")
|
204
|
+
|
205
|
+
with safe_open(validated_path, "w", newline="", encoding="utf-8") as f:
|
202
206
|
if isinstance(data[0], dict):
|
203
207
|
# Writing dictionaries
|
204
208
|
if not headers:
|
@@ -357,11 +361,14 @@ class JSONWriterNode(Node):
|
|
357
361
|
- Version control can track
|
358
362
|
- APIs can import data
|
359
363
|
"""
|
360
|
-
file_path = kwargs
|
364
|
+
file_path = kwargs.get("file_path") or self.config.get("file_path")
|
361
365
|
data = kwargs["data"]
|
362
366
|
indent = kwargs.get("indent", 2)
|
363
367
|
|
364
|
-
|
368
|
+
# Validate file path for security
|
369
|
+
validated_path = validate_file_path(file_path, operation="JSON write")
|
370
|
+
|
371
|
+
with safe_open(validated_path, "w", encoding="utf-8") as f:
|
365
372
|
json.dump(data, f, indent=indent, ensure_ascii=False)
|
366
373
|
|
367
374
|
return {"file_path": file_path}
|
@@ -517,13 +524,16 @@ class TextWriterNode(Node):
|
|
517
524
|
- Log analyzers can process
|
518
525
|
- Metrics available for monitoring
|
519
526
|
"""
|
520
|
-
file_path = kwargs
|
527
|
+
file_path = kwargs.get("file_path") or self.config.get("file_path")
|
521
528
|
text = kwargs["text"]
|
522
529
|
encoding = kwargs.get("encoding", "utf-8")
|
523
530
|
append = kwargs.get("append", False)
|
524
531
|
|
525
532
|
mode = "a" if append else "w"
|
526
|
-
|
533
|
+
# Validate file path for security
|
534
|
+
validated_path = validate_file_path(file_path, operation="text write")
|
535
|
+
|
536
|
+
with safe_open(validated_path, mode, encoding=encoding) as f:
|
527
537
|
f.write(text)
|
528
538
|
|
529
539
|
return {"file_path": file_path, "bytes_written": len(text.encode(encoding))}
|
kailash/nodes/logic/__init__.py
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
"""Logic operation nodes for the Kailash SDK."""
|
2
2
|
|
3
3
|
from kailash.nodes.logic.async_operations import AsyncMergeNode, AsyncSwitchNode
|
4
|
+
from kailash.nodes.logic.convergence import (
|
5
|
+
ConvergenceCheckerNode,
|
6
|
+
MultiCriteriaConvergenceNode,
|
7
|
+
)
|
8
|
+
from kailash.nodes.logic.loop import LoopNode
|
4
9
|
from kailash.nodes.logic.operations import MergeNode, SwitchNode
|
5
10
|
from kailash.nodes.logic.workflow import WorkflowNode
|
6
11
|
|
@@ -10,4 +15,7 @@ __all__ = [
|
|
10
15
|
"AsyncSwitchNode",
|
11
16
|
"AsyncMergeNode",
|
12
17
|
"WorkflowNode",
|
18
|
+
"LoopNode",
|
19
|
+
"ConvergenceCheckerNode",
|
20
|
+
"MultiCriteriaConvergenceNode",
|
13
21
|
]
|