AbstractRuntime 0.4.0__py3-none-any.whl → 0.4.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 (65) hide show
  1. abstractruntime/__init__.py +76 -1
  2. abstractruntime/core/config.py +68 -1
  3. abstractruntime/core/models.py +5 -0
  4. abstractruntime/core/policy.py +74 -3
  5. abstractruntime/core/runtime.py +1002 -126
  6. abstractruntime/core/vars.py +8 -2
  7. abstractruntime/evidence/recorder.py +1 -1
  8. abstractruntime/history_bundle.py +772 -0
  9. abstractruntime/integrations/abstractcore/__init__.py +3 -0
  10. abstractruntime/integrations/abstractcore/default_tools.py +127 -3
  11. abstractruntime/integrations/abstractcore/effect_handlers.py +2440 -99
  12. abstractruntime/integrations/abstractcore/embeddings_client.py +69 -0
  13. abstractruntime/integrations/abstractcore/factory.py +68 -20
  14. abstractruntime/integrations/abstractcore/llm_client.py +447 -15
  15. abstractruntime/integrations/abstractcore/mcp_worker.py +1 -0
  16. abstractruntime/integrations/abstractcore/session_attachments.py +946 -0
  17. abstractruntime/integrations/abstractcore/tool_executor.py +31 -10
  18. abstractruntime/integrations/abstractcore/workspace_scoped_tools.py +561 -0
  19. abstractruntime/integrations/abstractmemory/__init__.py +3 -0
  20. abstractruntime/integrations/abstractmemory/effect_handlers.py +946 -0
  21. abstractruntime/memory/active_context.py +6 -1
  22. abstractruntime/memory/kg_packets.py +164 -0
  23. abstractruntime/memory/memact_composer.py +175 -0
  24. abstractruntime/memory/recall_levels.py +163 -0
  25. abstractruntime/memory/token_budget.py +86 -0
  26. abstractruntime/storage/__init__.py +4 -1
  27. abstractruntime/storage/artifacts.py +158 -30
  28. abstractruntime/storage/base.py +17 -1
  29. abstractruntime/storage/commands.py +339 -0
  30. abstractruntime/storage/in_memory.py +41 -1
  31. abstractruntime/storage/json_files.py +195 -12
  32. abstractruntime/storage/observable.py +38 -1
  33. abstractruntime/storage/offloading.py +433 -0
  34. abstractruntime/storage/sqlite.py +836 -0
  35. abstractruntime/visualflow_compiler/__init__.py +29 -0
  36. abstractruntime/visualflow_compiler/adapters/__init__.py +11 -0
  37. abstractruntime/visualflow_compiler/adapters/agent_adapter.py +126 -0
  38. abstractruntime/visualflow_compiler/adapters/context_adapter.py +109 -0
  39. abstractruntime/visualflow_compiler/adapters/control_adapter.py +615 -0
  40. abstractruntime/visualflow_compiler/adapters/effect_adapter.py +1051 -0
  41. abstractruntime/visualflow_compiler/adapters/event_adapter.py +307 -0
  42. abstractruntime/visualflow_compiler/adapters/function_adapter.py +97 -0
  43. abstractruntime/visualflow_compiler/adapters/memact_adapter.py +114 -0
  44. abstractruntime/visualflow_compiler/adapters/subflow_adapter.py +74 -0
  45. abstractruntime/visualflow_compiler/adapters/variable_adapter.py +316 -0
  46. abstractruntime/visualflow_compiler/compiler.py +3832 -0
  47. abstractruntime/visualflow_compiler/flow.py +247 -0
  48. abstractruntime/visualflow_compiler/visual/__init__.py +13 -0
  49. abstractruntime/visualflow_compiler/visual/agent_ids.py +29 -0
  50. abstractruntime/visualflow_compiler/visual/builtins.py +1376 -0
  51. abstractruntime/visualflow_compiler/visual/code_executor.py +214 -0
  52. abstractruntime/visualflow_compiler/visual/executor.py +2804 -0
  53. abstractruntime/visualflow_compiler/visual/models.py +211 -0
  54. abstractruntime/workflow_bundle/__init__.py +52 -0
  55. abstractruntime/workflow_bundle/models.py +236 -0
  56. abstractruntime/workflow_bundle/packer.py +317 -0
  57. abstractruntime/workflow_bundle/reader.py +87 -0
  58. abstractruntime/workflow_bundle/registry.py +587 -0
  59. abstractruntime-0.4.1.dist-info/METADATA +177 -0
  60. abstractruntime-0.4.1.dist-info/RECORD +86 -0
  61. abstractruntime-0.4.0.dist-info/METADATA +0 -167
  62. abstractruntime-0.4.0.dist-info/RECORD +0 -49
  63. {abstractruntime-0.4.0.dist-info → abstractruntime-0.4.1.dist-info}/WHEEL +0 -0
  64. {abstractruntime-0.4.0.dist-info → abstractruntime-0.4.1.dist-info}/entry_points.txt +0 -0
  65. {abstractruntime-0.4.0.dist-info → abstractruntime-0.4.1.dist-info}/licenses/LICENSE +0 -0
@@ -23,6 +23,11 @@ TEMP = "_temp"
23
23
  LIMITS = "_limits" # Canonical storage for runtime resource limits
24
24
  NODE_TRACES = "node_traces" # _runtime namespace key for per-node execution traces
25
25
 
26
+ # Fallback context window size used only when model capabilities are unavailable.
27
+ # In normal operation (AbstractCore-integrated runtimes), this is derived from
28
+ # `abstractcore.architectures.detection.get_model_capabilities(...)`.
29
+ DEFAULT_MAX_TOKENS = 32768
30
+
26
31
 
27
32
  def ensure_namespaces(vars: Dict[str, Any]) -> Dict[str, Any]:
28
33
  """Ensure the four canonical namespaces exist and are dicts."""
@@ -70,7 +75,7 @@ def ensure_limits(vars: Dict[str, Any]) -> Dict[str, Any]:
70
75
 
71
76
  This is the canonical location for runtime resource limits:
72
77
  - max_iterations / current_iteration: Iteration control
73
- - max_tokens / estimated_tokens_used: Token/context window management
78
+ - max_tokens / max_input_tokens / max_output_tokens / estimated_tokens_used: Token/context window management
74
79
  - max_history_messages: Conversation history limit (-1 = unlimited)
75
80
  - warn_*_pct: Warning thresholds for proactive notifications
76
81
 
@@ -108,8 +113,9 @@ def _default_limits() -> Dict[str, Any]:
108
113
  return {
109
114
  "max_iterations": 25,
110
115
  "current_iteration": 0,
111
- "max_tokens": 32768,
116
+ "max_tokens": DEFAULT_MAX_TOKENS,
112
117
  "max_output_tokens": None,
118
+ "max_input_tokens": None,
113
119
  "max_history_messages": -1,
114
120
  "estimated_tokens_used": 0,
115
121
  "warn_iterations_pct": 80,
@@ -169,6 +169,7 @@ class EvidenceRecorder:
169
169
  if tool_name == "fetch_url":
170
170
  url = str(args_dict.get("url") or "")
171
171
  if url:
172
+ #[WARNING:TRUNCATION] bounded tag value (indexing)
172
173
  tags["url"] = url[:200]
173
174
 
174
175
  if isinstance(output_dict, dict):
@@ -322,4 +323,3 @@ class EvidenceRecorder:
322
323
 
323
324
  return EvidenceCaptureStats(recorded=recorded)
324
325
 
325
-