kailash 0.2.2__py3-none-any.whl → 0.3.1__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.
Files changed (117) hide show
  1. kailash/__init__.py +1 -1
  2. kailash/access_control.py +40 -39
  3. kailash/api/auth.py +26 -32
  4. kailash/api/custom_nodes.py +29 -29
  5. kailash/api/custom_nodes_secure.py +35 -35
  6. kailash/api/database.py +17 -17
  7. kailash/api/gateway.py +19 -19
  8. kailash/api/mcp_integration.py +24 -23
  9. kailash/api/studio.py +45 -45
  10. kailash/api/workflow_api.py +8 -8
  11. kailash/cli/commands.py +5 -8
  12. kailash/manifest.py +42 -42
  13. kailash/mcp/__init__.py +1 -1
  14. kailash/mcp/ai_registry_server.py +20 -20
  15. kailash/mcp/client.py +9 -11
  16. kailash/mcp/client_new.py +10 -10
  17. kailash/mcp/server.py +1 -2
  18. kailash/mcp/server_enhanced.py +449 -0
  19. kailash/mcp/servers/ai_registry.py +6 -6
  20. kailash/mcp/utils/__init__.py +31 -0
  21. kailash/mcp/utils/cache.py +267 -0
  22. kailash/mcp/utils/config.py +263 -0
  23. kailash/mcp/utils/formatters.py +293 -0
  24. kailash/mcp/utils/metrics.py +418 -0
  25. kailash/nodes/ai/agents.py +9 -9
  26. kailash/nodes/ai/ai_providers.py +33 -34
  27. kailash/nodes/ai/embedding_generator.py +31 -32
  28. kailash/nodes/ai/intelligent_agent_orchestrator.py +62 -66
  29. kailash/nodes/ai/iterative_llm_agent.py +48 -48
  30. kailash/nodes/ai/llm_agent.py +32 -33
  31. kailash/nodes/ai/models.py +13 -13
  32. kailash/nodes/ai/self_organizing.py +44 -44
  33. kailash/nodes/api/__init__.py +5 -0
  34. kailash/nodes/api/auth.py +11 -11
  35. kailash/nodes/api/graphql.py +13 -13
  36. kailash/nodes/api/http.py +19 -19
  37. kailash/nodes/api/monitoring.py +463 -0
  38. kailash/nodes/api/rate_limiting.py +9 -13
  39. kailash/nodes/api/rest.py +29 -29
  40. kailash/nodes/api/security.py +819 -0
  41. kailash/nodes/base.py +24 -26
  42. kailash/nodes/base_async.py +7 -7
  43. kailash/nodes/base_cycle_aware.py +12 -12
  44. kailash/nodes/base_with_acl.py +5 -5
  45. kailash/nodes/code/python.py +56 -55
  46. kailash/nodes/data/__init__.py +6 -0
  47. kailash/nodes/data/directory.py +6 -6
  48. kailash/nodes/data/event_generation.py +297 -0
  49. kailash/nodes/data/file_discovery.py +598 -0
  50. kailash/nodes/data/readers.py +8 -8
  51. kailash/nodes/data/retrieval.py +10 -10
  52. kailash/nodes/data/sharepoint_graph.py +17 -17
  53. kailash/nodes/data/sources.py +5 -5
  54. kailash/nodes/data/sql.py +13 -13
  55. kailash/nodes/data/streaming.py +25 -25
  56. kailash/nodes/data/vector_db.py +22 -22
  57. kailash/nodes/data/writers.py +7 -7
  58. kailash/nodes/logic/async_operations.py +17 -17
  59. kailash/nodes/logic/convergence.py +11 -11
  60. kailash/nodes/logic/loop.py +4 -4
  61. kailash/nodes/logic/operations.py +11 -11
  62. kailash/nodes/logic/workflow.py +8 -9
  63. kailash/nodes/mixins/mcp.py +17 -17
  64. kailash/nodes/mixins.py +8 -10
  65. kailash/nodes/transform/chunkers.py +3 -3
  66. kailash/nodes/transform/formatters.py +7 -7
  67. kailash/nodes/transform/processors.py +11 -11
  68. kailash/runtime/access_controlled.py +18 -18
  69. kailash/runtime/async_local.py +18 -20
  70. kailash/runtime/docker.py +24 -26
  71. kailash/runtime/local.py +55 -31
  72. kailash/runtime/parallel.py +25 -25
  73. kailash/runtime/parallel_cyclic.py +29 -29
  74. kailash/runtime/runner.py +6 -6
  75. kailash/runtime/testing.py +22 -22
  76. kailash/sdk_exceptions.py +0 -58
  77. kailash/security.py +14 -26
  78. kailash/tracking/manager.py +38 -38
  79. kailash/tracking/metrics_collector.py +15 -14
  80. kailash/tracking/models.py +53 -53
  81. kailash/tracking/storage/base.py +7 -17
  82. kailash/tracking/storage/database.py +22 -23
  83. kailash/tracking/storage/filesystem.py +38 -40
  84. kailash/utils/export.py +21 -21
  85. kailash/utils/templates.py +8 -9
  86. kailash/visualization/api.py +30 -34
  87. kailash/visualization/dashboard.py +17 -17
  88. kailash/visualization/performance.py +32 -19
  89. kailash/visualization/reports.py +30 -28
  90. kailash/workflow/builder.py +8 -8
  91. kailash/workflow/convergence.py +13 -12
  92. kailash/workflow/cycle_analyzer.py +38 -33
  93. kailash/workflow/cycle_builder.py +12 -12
  94. kailash/workflow/cycle_config.py +16 -15
  95. kailash/workflow/cycle_debugger.py +40 -40
  96. kailash/workflow/cycle_exceptions.py +29 -29
  97. kailash/workflow/cycle_profiler.py +21 -21
  98. kailash/workflow/cycle_state.py +20 -22
  99. kailash/workflow/cyclic_runner.py +45 -45
  100. kailash/workflow/graph.py +57 -45
  101. kailash/workflow/mermaid_visualizer.py +9 -11
  102. kailash/workflow/migration.py +22 -22
  103. kailash/workflow/mock_registry.py +6 -6
  104. kailash/workflow/runner.py +9 -9
  105. kailash/workflow/safety.py +12 -13
  106. kailash/workflow/state.py +8 -11
  107. kailash/workflow/templates.py +19 -19
  108. kailash/workflow/validation.py +14 -14
  109. kailash/workflow/visualization.py +32 -24
  110. kailash-0.3.1.dist-info/METADATA +476 -0
  111. kailash-0.3.1.dist-info/RECORD +136 -0
  112. kailash-0.2.2.dist-info/METADATA +0 -121
  113. kailash-0.2.2.dist-info/RECORD +0 -126
  114. {kailash-0.2.2.dist-info → kailash-0.3.1.dist-info}/WHEEL +0 -0
  115. {kailash-0.2.2.dist-info → kailash-0.3.1.dist-info}/entry_points.txt +0 -0
  116. {kailash-0.2.2.dist-info → kailash-0.3.1.dist-info}/licenses/LICENSE +0 -0
  117. {kailash-0.2.2.dist-info → kailash-0.3.1.dist-info}/top_level.txt +0 -0
kailash/nodes/api/rest.py CHANGED
@@ -10,7 +10,7 @@ Key Components:
10
10
  * Resource path builders and response handlers
11
11
  """
12
12
 
13
- from typing import Any, Dict, List, Optional
13
+ from typing import Any
14
14
 
15
15
  from kailash.nodes.api.http import AsyncHTTPRequestNode, HTTPRequestNode
16
16
  from kailash.nodes.base import Node, NodeParameter, register_node
@@ -157,7 +157,7 @@ class RESTClientNode(Node):
157
157
  super().__init__(**kwargs)
158
158
  self.http_node = HTTPRequestNode(url="")
159
159
 
160
- def get_parameters(self) -> Dict[str, NodeParameter]:
160
+ def get_parameters(self) -> dict[str, NodeParameter]:
161
161
  """Define the parameters this node accepts.
162
162
 
163
163
  Returns:
@@ -297,7 +297,7 @@ class RESTClientNode(Node):
297
297
  ),
298
298
  }
299
299
 
300
- def get_output_schema(self) -> Dict[str, NodeParameter]:
300
+ def get_output_schema(self) -> dict[str, NodeParameter]:
301
301
  """Define the output schema for this node.
302
302
 
303
303
  Returns:
@@ -334,8 +334,8 @@ class RESTClientNode(Node):
334
334
  self,
335
335
  base_url: str,
336
336
  resource: str,
337
- path_params: Dict[str, Any],
338
- version: Optional[str] = None,
337
+ path_params: dict[str, Any],
338
+ version: str | None = None,
339
339
  ) -> str:
340
340
  """Build the full URL for a REST API request.
341
341
 
@@ -394,10 +394,10 @@ class RESTClientNode(Node):
394
394
 
395
395
  def _handle_pagination(
396
396
  self,
397
- initial_response: Dict[str, Any],
398
- query_params: Dict[str, Any],
399
- pagination_params: Dict[str, Any],
400
- ) -> List[Any]:
397
+ initial_response: dict[str, Any],
398
+ query_params: dict[str, Any],
399
+ pagination_params: dict[str, Any],
400
+ ) -> list[Any]:
401
401
  """Handle pagination for REST API responses.
402
402
 
403
403
  This method supports common pagination patterns:
@@ -469,7 +469,7 @@ class RESTClientNode(Node):
469
469
  return all_items
470
470
 
471
471
  def _get_nested_value(
472
- self, obj: Dict[str, Any], path: str, default: Any = None
472
+ self, obj: dict[str, Any], path: str, default: Any = None
473
473
  ) -> Any:
474
474
  """Get a nested value from a dictionary using a dot-separated path.
475
475
 
@@ -495,7 +495,7 @@ class RESTClientNode(Node):
495
495
 
496
496
  return current
497
497
 
498
- def run(self, **kwargs) -> Dict[str, Any]:
498
+ def run(self, **kwargs) -> dict[str, Any]:
499
499
  """Execute a REST API request.
500
500
 
501
501
  Args:
@@ -671,8 +671,8 @@ class RESTClientNode(Node):
671
671
 
672
672
  # Convenience methods for CRUD operations
673
673
  def get(
674
- self, base_url: str, resource: str, resource_id: Optional[str] = None, **kwargs
675
- ) -> Dict[str, Any]:
674
+ self, base_url: str, resource: str, resource_id: str | None = None, **kwargs
675
+ ) -> dict[str, Any]:
676
676
  """GET a resource or list of resources.
677
677
 
678
678
  Args:
@@ -703,8 +703,8 @@ class RESTClientNode(Node):
703
703
  )
704
704
 
705
705
  def create(
706
- self, base_url: str, resource: str, data: Dict[str, Any], **kwargs
707
- ) -> Dict[str, Any]:
706
+ self, base_url: str, resource: str, data: dict[str, Any], **kwargs
707
+ ) -> dict[str, Any]:
708
708
  """CREATE (POST) a new resource.
709
709
 
710
710
  Args:
@@ -725,10 +725,10 @@ class RESTClientNode(Node):
725
725
  base_url: str,
726
726
  resource: str,
727
727
  resource_id: str,
728
- data: Dict[str, Any],
728
+ data: dict[str, Any],
729
729
  partial: bool = False,
730
730
  **kwargs,
731
- ) -> Dict[str, Any]:
731
+ ) -> dict[str, Any]:
732
732
  """UPDATE (PUT/PATCH) an existing resource.
733
733
 
734
734
  Args:
@@ -756,7 +756,7 @@ class RESTClientNode(Node):
756
756
 
757
757
  def delete(
758
758
  self, base_url: str, resource: str, resource_id: str, **kwargs
759
- ) -> Dict[str, Any]:
759
+ ) -> dict[str, Any]:
760
760
  """DELETE a resource.
761
761
 
762
762
  Args:
@@ -779,7 +779,7 @@ class RESTClientNode(Node):
779
779
  **kwargs,
780
780
  )
781
781
 
782
- def _extract_metadata(self, response: Dict[str, Any]) -> Dict[str, Any]:
782
+ def _extract_metadata(self, response: dict[str, Any]) -> dict[str, Any]:
783
783
  """Extract additional metadata from response.
784
784
 
785
785
  Args:
@@ -811,8 +811,8 @@ class RESTClientNode(Node):
811
811
  return metadata
812
812
 
813
813
  def _extract_rate_limit_metadata(
814
- self, headers: Dict[str, str]
815
- ) -> Optional[Dict[str, Any]]:
814
+ self, headers: dict[str, str]
815
+ ) -> dict[str, Any] | None:
816
816
  """Extract rate limiting information from response headers.
817
817
 
818
818
  Args:
@@ -847,8 +847,8 @@ class RESTClientNode(Node):
847
847
  return rate_limit if rate_limit else None
848
848
 
849
849
  def _extract_pagination_metadata(
850
- self, headers: Dict[str, str], content: Any
851
- ) -> Optional[Dict[str, Any]]:
850
+ self, headers: dict[str, str], content: Any
851
+ ) -> dict[str, Any] | None:
852
852
  """Extract pagination information from headers and response body.
853
853
 
854
854
  Args:
@@ -892,7 +892,7 @@ class RESTClientNode(Node):
892
892
 
893
893
  return pagination if pagination else None
894
894
 
895
- def _parse_link_header(self, link_header: str) -> Dict[str, str]:
895
+ def _parse_link_header(self, link_header: str) -> dict[str, str]:
896
896
  """Parse Link header for pagination URLs.
897
897
 
898
898
  Args:
@@ -916,7 +916,7 @@ class RESTClientNode(Node):
916
916
 
917
917
  return links
918
918
 
919
- def _extract_links(self, content: Any) -> Optional[Dict[str, Any]]:
919
+ def _extract_links(self, content: Any) -> dict[str, Any] | None:
920
920
  """Extract HATEOAS links from response content.
921
921
 
922
922
  Args:
@@ -986,7 +986,7 @@ class AsyncRESTClientNode(AsyncNode):
986
986
  self.http_node = AsyncHTTPRequestNode(**kwargs)
987
987
  self.rest_node = RESTClientNode(**kwargs)
988
988
 
989
- def get_parameters(self) -> Dict[str, NodeParameter]:
989
+ def get_parameters(self) -> dict[str, NodeParameter]:
990
990
  """Define the parameters this node accepts.
991
991
 
992
992
  Returns:
@@ -995,7 +995,7 @@ class AsyncRESTClientNode(AsyncNode):
995
995
  # Same parameters as the synchronous version
996
996
  return self.rest_node.get_parameters()
997
997
 
998
- def get_output_schema(self) -> Dict[str, NodeParameter]:
998
+ def get_output_schema(self) -> dict[str, NodeParameter]:
999
999
  """Define the output schema for this node.
1000
1000
 
1001
1001
  Returns:
@@ -1004,7 +1004,7 @@ class AsyncRESTClientNode(AsyncNode):
1004
1004
  # Same output schema as the synchronous version
1005
1005
  return self.rest_node.get_output_schema()
1006
1006
 
1007
- def run(self, **kwargs) -> Dict[str, Any]:
1007
+ def run(self, **kwargs) -> dict[str, Any]:
1008
1008
  """Synchronous version of the REST request, for compatibility.
1009
1009
 
1010
1010
  This is implemented for compatibility but users should use the
@@ -1022,7 +1022,7 @@ class AsyncRESTClientNode(AsyncNode):
1022
1022
  # Forward to the synchronous REST node
1023
1023
  return self.rest_node.run(**kwargs)
1024
1024
 
1025
- async def async_run(self, **kwargs) -> Dict[str, Any]:
1025
+ async def async_run(self, **kwargs) -> dict[str, Any]:
1026
1026
  """Execute a REST API request asynchronously.
1027
1027
 
1028
1028
  Args: