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.
- abstractruntime/__init__.py +76 -1
- abstractruntime/core/config.py +68 -1
- abstractruntime/core/models.py +5 -0
- abstractruntime/core/policy.py +74 -3
- abstractruntime/core/runtime.py +1002 -126
- abstractruntime/core/vars.py +8 -2
- abstractruntime/evidence/recorder.py +1 -1
- abstractruntime/history_bundle.py +772 -0
- abstractruntime/integrations/abstractcore/__init__.py +3 -0
- abstractruntime/integrations/abstractcore/default_tools.py +127 -3
- abstractruntime/integrations/abstractcore/effect_handlers.py +2440 -99
- abstractruntime/integrations/abstractcore/embeddings_client.py +69 -0
- abstractruntime/integrations/abstractcore/factory.py +68 -20
- abstractruntime/integrations/abstractcore/llm_client.py +447 -15
- abstractruntime/integrations/abstractcore/mcp_worker.py +1 -0
- abstractruntime/integrations/abstractcore/session_attachments.py +946 -0
- abstractruntime/integrations/abstractcore/tool_executor.py +31 -10
- abstractruntime/integrations/abstractcore/workspace_scoped_tools.py +561 -0
- abstractruntime/integrations/abstractmemory/__init__.py +3 -0
- abstractruntime/integrations/abstractmemory/effect_handlers.py +946 -0
- abstractruntime/memory/active_context.py +6 -1
- abstractruntime/memory/kg_packets.py +164 -0
- abstractruntime/memory/memact_composer.py +175 -0
- abstractruntime/memory/recall_levels.py +163 -0
- abstractruntime/memory/token_budget.py +86 -0
- abstractruntime/storage/__init__.py +4 -1
- abstractruntime/storage/artifacts.py +158 -30
- abstractruntime/storage/base.py +17 -1
- abstractruntime/storage/commands.py +339 -0
- abstractruntime/storage/in_memory.py +41 -1
- abstractruntime/storage/json_files.py +195 -12
- abstractruntime/storage/observable.py +38 -1
- abstractruntime/storage/offloading.py +433 -0
- abstractruntime/storage/sqlite.py +836 -0
- abstractruntime/visualflow_compiler/__init__.py +29 -0
- abstractruntime/visualflow_compiler/adapters/__init__.py +11 -0
- abstractruntime/visualflow_compiler/adapters/agent_adapter.py +126 -0
- abstractruntime/visualflow_compiler/adapters/context_adapter.py +109 -0
- abstractruntime/visualflow_compiler/adapters/control_adapter.py +615 -0
- abstractruntime/visualflow_compiler/adapters/effect_adapter.py +1051 -0
- abstractruntime/visualflow_compiler/adapters/event_adapter.py +307 -0
- abstractruntime/visualflow_compiler/adapters/function_adapter.py +97 -0
- abstractruntime/visualflow_compiler/adapters/memact_adapter.py +114 -0
- abstractruntime/visualflow_compiler/adapters/subflow_adapter.py +74 -0
- abstractruntime/visualflow_compiler/adapters/variable_adapter.py +316 -0
- abstractruntime/visualflow_compiler/compiler.py +3832 -0
- abstractruntime/visualflow_compiler/flow.py +247 -0
- abstractruntime/visualflow_compiler/visual/__init__.py +13 -0
- abstractruntime/visualflow_compiler/visual/agent_ids.py +29 -0
- abstractruntime/visualflow_compiler/visual/builtins.py +1376 -0
- abstractruntime/visualflow_compiler/visual/code_executor.py +214 -0
- abstractruntime/visualflow_compiler/visual/executor.py +2804 -0
- abstractruntime/visualflow_compiler/visual/models.py +211 -0
- abstractruntime/workflow_bundle/__init__.py +52 -0
- abstractruntime/workflow_bundle/models.py +236 -0
- abstractruntime/workflow_bundle/packer.py +317 -0
- abstractruntime/workflow_bundle/reader.py +87 -0
- abstractruntime/workflow_bundle/registry.py +587 -0
- abstractruntime-0.4.1.dist-info/METADATA +177 -0
- abstractruntime-0.4.1.dist-info/RECORD +86 -0
- abstractruntime-0.4.0.dist-info/METADATA +0 -167
- abstractruntime-0.4.0.dist-info/RECORD +0 -49
- {abstractruntime-0.4.0.dist-info → abstractruntime-0.4.1.dist-info}/WHEEL +0 -0
- {abstractruntime-0.4.0.dist-info → abstractruntime-0.4.1.dist-info}/entry_points.txt +0 -0
- {abstractruntime-0.4.0.dist-info → abstractruntime-0.4.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -275,7 +275,7 @@ class MappingToolExecutor:
|
|
|
275
275
|
return cleaned or text
|
|
276
276
|
return None
|
|
277
277
|
|
|
278
|
-
def _append_result(*, call_id: str, name: str, output: Any) -> None:
|
|
278
|
+
def _append_result(*, call_id: str, runtime_call_id: Optional[str], name: str, output: Any) -> None:
|
|
279
279
|
error = _error_from_output(output)
|
|
280
280
|
if error is not None:
|
|
281
281
|
# Preserve structured outputs for provenance/evidence. For string-only error outputs
|
|
@@ -284,6 +284,7 @@ class MappingToolExecutor:
|
|
|
284
284
|
results.append(
|
|
285
285
|
{
|
|
286
286
|
"call_id": call_id,
|
|
287
|
+
"runtime_call_id": runtime_call_id,
|
|
287
288
|
"name": name,
|
|
288
289
|
"success": False,
|
|
289
290
|
"output": output_json,
|
|
@@ -295,6 +296,7 @@ class MappingToolExecutor:
|
|
|
295
296
|
results.append(
|
|
296
297
|
{
|
|
297
298
|
"call_id": call_id,
|
|
299
|
+
"runtime_call_id": runtime_call_id,
|
|
298
300
|
"name": name,
|
|
299
301
|
"success": True,
|
|
300
302
|
"output": _jsonable(output),
|
|
@@ -307,12 +309,16 @@ class MappingToolExecutor:
|
|
|
307
309
|
raw_arguments = tc.get("arguments") or {}
|
|
308
310
|
arguments = dict(raw_arguments) if isinstance(raw_arguments, dict) else (_loads_dict_like(raw_arguments) or {})
|
|
309
311
|
call_id = str(tc.get("call_id") or "")
|
|
312
|
+
runtime_call_id = tc.get("runtime_call_id")
|
|
313
|
+
runtime_call_id_str = str(runtime_call_id).strip() if runtime_call_id is not None else ""
|
|
314
|
+
runtime_call_id_out = runtime_call_id_str or None
|
|
310
315
|
|
|
311
316
|
func = self._tool_map.get(name)
|
|
312
317
|
if func is None:
|
|
313
318
|
results.append(
|
|
314
319
|
{
|
|
315
320
|
"call_id": call_id,
|
|
321
|
+
"runtime_call_id": runtime_call_id_out,
|
|
316
322
|
"name": name,
|
|
317
323
|
"success": False,
|
|
318
324
|
"output": None,
|
|
@@ -335,11 +341,12 @@ class MappingToolExecutor:
|
|
|
335
341
|
|
|
336
342
|
ok, output, err = _call_with_timeout(_invoke, timeout_s=self._timeout_s)
|
|
337
343
|
if ok:
|
|
338
|
-
_append_result(call_id=call_id, name=name, output=output)
|
|
344
|
+
_append_result(call_id=call_id, runtime_call_id=runtime_call_id_out, name=name, output=output)
|
|
339
345
|
else:
|
|
340
346
|
results.append(
|
|
341
347
|
{
|
|
342
348
|
"call_id": call_id,
|
|
349
|
+
"runtime_call_id": runtime_call_id_out,
|
|
343
350
|
"name": name,
|
|
344
351
|
"success": False,
|
|
345
352
|
"output": None,
|
|
@@ -386,23 +393,29 @@ class AbstractCoreToolExecutor:
|
|
|
386
393
|
from abstractcore.tools.core import ToolCall
|
|
387
394
|
from abstractcore.tools.registry import execute_tool
|
|
388
395
|
|
|
389
|
-
calls = [
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
396
|
+
calls: list[ToolCall] = []
|
|
397
|
+
runtime_call_ids: list[Optional[str]] = []
|
|
398
|
+
for tc in tool_calls:
|
|
399
|
+
calls.append(
|
|
400
|
+
ToolCall(
|
|
401
|
+
name=str(tc.get("name")),
|
|
402
|
+
arguments=dict(tc.get("arguments") or {}),
|
|
403
|
+
call_id=tc.get("call_id"),
|
|
404
|
+
)
|
|
394
405
|
)
|
|
395
|
-
|
|
396
|
-
|
|
406
|
+
runtime_call_id = tc.get("runtime_call_id")
|
|
407
|
+
runtime_call_id_str = str(runtime_call_id).strip() if runtime_call_id is not None else ""
|
|
408
|
+
runtime_call_ids.append(runtime_call_id_str or None)
|
|
397
409
|
|
|
398
410
|
normalized = []
|
|
399
|
-
for call in calls:
|
|
411
|
+
for call, runtime_call_id in zip(calls, runtime_call_ids):
|
|
400
412
|
ok, out, err = _call_with_timeout(lambda c=call: execute_tool(c), timeout_s=self._timeout_s)
|
|
401
413
|
if ok:
|
|
402
414
|
r = out
|
|
403
415
|
normalized.append(
|
|
404
416
|
{
|
|
405
417
|
"call_id": getattr(r, "call_id", "") if r is not None else "",
|
|
418
|
+
"runtime_call_id": runtime_call_id,
|
|
406
419
|
"name": getattr(call, "name", ""),
|
|
407
420
|
"success": bool(getattr(r, "success", False)) if r is not None else True,
|
|
408
421
|
"output": _jsonable(getattr(r, "output", None)) if r is not None else None,
|
|
@@ -414,6 +427,7 @@ class AbstractCoreToolExecutor:
|
|
|
414
427
|
normalized.append(
|
|
415
428
|
{
|
|
416
429
|
"call_id": str(getattr(call, "call_id", "") or ""),
|
|
430
|
+
"runtime_call_id": runtime_call_id,
|
|
417
431
|
"name": getattr(call, "name", ""),
|
|
418
432
|
"success": False,
|
|
419
433
|
"output": None,
|
|
@@ -520,6 +534,9 @@ class McpToolExecutor:
|
|
|
520
534
|
for tc in tool_calls:
|
|
521
535
|
name = str(tc.get("name", "") or "")
|
|
522
536
|
call_id = str(tc.get("call_id") or "")
|
|
537
|
+
runtime_call_id = tc.get("runtime_call_id")
|
|
538
|
+
runtime_call_id_str = str(runtime_call_id).strip() if runtime_call_id is not None else ""
|
|
539
|
+
runtime_call_id_out = runtime_call_id_str or None
|
|
523
540
|
raw_arguments = tc.get("arguments") or {}
|
|
524
541
|
arguments = dict(raw_arguments) if isinstance(raw_arguments, dict) else {}
|
|
525
542
|
|
|
@@ -531,6 +548,7 @@ class McpToolExecutor:
|
|
|
531
548
|
results.append(
|
|
532
549
|
{
|
|
533
550
|
"call_id": call_id,
|
|
551
|
+
"runtime_call_id": runtime_call_id_out,
|
|
534
552
|
"name": name,
|
|
535
553
|
"success": False,
|
|
536
554
|
"output": None,
|
|
@@ -547,6 +565,7 @@ class McpToolExecutor:
|
|
|
547
565
|
results.append(
|
|
548
566
|
{
|
|
549
567
|
"call_id": call_id,
|
|
568
|
+
"runtime_call_id": runtime_call_id_out,
|
|
550
569
|
"name": name,
|
|
551
570
|
"success": False,
|
|
552
571
|
"output": None,
|
|
@@ -557,6 +576,7 @@ class McpToolExecutor:
|
|
|
557
576
|
results.append(
|
|
558
577
|
{
|
|
559
578
|
"call_id": call_id,
|
|
579
|
+
"runtime_call_id": runtime_call_id_out,
|
|
560
580
|
"name": name,
|
|
561
581
|
"success": True,
|
|
562
582
|
"output": _mcp_result_to_output(mcp_result),
|
|
@@ -567,6 +587,7 @@ class McpToolExecutor:
|
|
|
567
587
|
results.append(
|
|
568
588
|
{
|
|
569
589
|
"call_id": call_id,
|
|
590
|
+
"runtime_call_id": runtime_call_id_out,
|
|
570
591
|
"name": name,
|
|
571
592
|
"success": False,
|
|
572
593
|
"output": None,
|