steerable-agent-runtime 0.2.5__tar.gz → 0.4.0__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.
Files changed (143) hide show
  1. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/PKG-INFO +3 -3
  2. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/pyproject.toml +13 -3
  3. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/__init__.py +410 -0
  4. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/antihallucination.py +6 -7
  5. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/approval.py +404 -0
  6. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/approval_policy.py +243 -0
  7. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/branch.py +294 -0
  8. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/cache_control.py +154 -0
  9. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/calibration.py +1 -1
  10. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/compaction.py +69 -29
  11. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/default.harness.json +30 -0
  12. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/default.harness.yaml +28 -0
  13. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/errors.py +20 -0
  14. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/handoff.py +147 -0
  15. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/harness.py +674 -0
  16. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/harness_spec.py +339 -0
  17. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/history.py +774 -0
  18. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/hooks.py +402 -0
  19. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/llm/__init__.py +78 -10
  20. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/llm/anthropic_native.py +104 -29
  21. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/llm/compat.py +259 -0
  22. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/llm/errors.py +23 -2
  23. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/llm/openai_compat.py +649 -0
  24. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/llm/parts.py +69 -0
  25. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/llm/system_proxy.py +177 -0
  26. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/loop.py +2474 -0
  27. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/maintenance.py +238 -0
  28. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/mcp.py +438 -0
  29. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/mcp_server.py +319 -0
  30. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/model_catalog.py +7619 -0
  31. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/model_info.py +247 -0
  32. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/model_resolve.py +151 -0
  33. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/observation_aging.py +196 -0
  34. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/orchestration.py +686 -0
  35. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/otel.py +82 -9
  36. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/pricing.py +88 -0
  37. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/recording.py +455 -0
  38. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/reminders.py +279 -0
  39. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/resume.py +130 -11
  40. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/retry.py +5 -1
  41. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/sandboxed.py +188 -0
  42. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/skills.py +161 -36
  43. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/storage/__init__.py +58 -3
  44. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/storage/in_memory.py +64 -0
  45. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/storage/sqlalchemy_store.py +154 -22
  46. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/storage/sqlite_store.py +414 -0
  47. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/storage/write_lease.py +134 -0
  48. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/subagent.py +59 -3
  49. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/tokens.py +37 -33
  50. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/tool_schema.py +124 -0
  51. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/tool_search.py +177 -0
  52. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/tools.py +65 -8
  53. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/tracing.py +122 -15
  54. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime/world_state.py +345 -0
  55. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime.egg-info/PKG-INFO +3 -3
  56. steerable_agent_runtime-0.4.0/src/steerable_agent_runtime.egg-info/SOURCES.txt +131 -0
  57. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime.egg-info/requires.txt +2 -2
  58. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_antihallucination.py +18 -18
  59. steerable_agent_runtime-0.4.0/tests/test_approval.py +470 -0
  60. steerable_agent_runtime-0.4.0/tests/test_approval_policy.py +185 -0
  61. steerable_agent_runtime-0.4.0/tests/test_branch.py +234 -0
  62. steerable_agent_runtime-0.4.0/tests/test_cache_control.py +185 -0
  63. steerable_agent_runtime-0.4.0/tests/test_cache_instrumentation.py +264 -0
  64. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_calibration.py +7 -7
  65. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_compaction.py +131 -24
  66. steerable_agent_runtime-0.4.0/tests/test_content_parts.py +237 -0
  67. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_error_taxonomy.py +20 -9
  68. steerable_agent_runtime-0.4.0/tests/test_fragment_bounds.py +208 -0
  69. steerable_agent_runtime-0.4.0/tests/test_golden.py +257 -0
  70. steerable_agent_runtime-0.4.0/tests/test_handoff.py +113 -0
  71. steerable_agent_runtime-0.4.0/tests/test_harness.py +244 -0
  72. steerable_agent_runtime-0.4.0/tests/test_harness_spec.py +251 -0
  73. steerable_agent_runtime-0.4.0/tests/test_history.py +370 -0
  74. steerable_agent_runtime-0.4.0/tests/test_history_persistence.py +1150 -0
  75. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_hooks.py +144 -10
  76. steerable_agent_runtime-0.4.0/tests/test_llm_wire_helpers.py +653 -0
  77. steerable_agent_runtime-0.4.0/tests/test_long_session.py +163 -0
  78. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_loop.py +46 -8
  79. steerable_agent_runtime-0.4.0/tests/test_loop_cancellation.py +325 -0
  80. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_loop_replay.py +1 -1
  81. steerable_agent_runtime-0.4.0/tests/test_loop_sandbox_event.py +68 -0
  82. steerable_agent_runtime-0.4.0/tests/test_maintenance.py +136 -0
  83. steerable_agent_runtime-0.4.0/tests/test_mcp.py +480 -0
  84. steerable_agent_runtime-0.4.0/tests/test_mcp_server.py +209 -0
  85. steerable_agent_runtime-0.4.0/tests/test_model_catalog.py +183 -0
  86. steerable_agent_runtime-0.4.0/tests/test_model_equivalence.py +185 -0
  87. steerable_agent_runtime-0.4.0/tests/test_model_info.py +185 -0
  88. steerable_agent_runtime-0.4.0/tests/test_model_resolve.py +86 -0
  89. steerable_agent_runtime-0.4.0/tests/test_observation_aging.py +169 -0
  90. steerable_agent_runtime-0.4.0/tests/test_orchestration.py +923 -0
  91. steerable_agent_runtime-0.4.0/tests/test_otel.py +292 -0
  92. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_parallel_tools.py +7 -7
  93. steerable_agent_runtime-0.4.0/tests/test_provider_compat.py +269 -0
  94. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_pseudo.py +4 -4
  95. steerable_agent_runtime-0.4.0/tests/test_recording.py +345 -0
  96. steerable_agent_runtime-0.4.0/tests/test_reminders.py +136 -0
  97. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_resume.py +16 -16
  98. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_retry_hooks.py +17 -4
  99. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_safety_gate.py +24 -0
  100. steerable_agent_runtime-0.4.0/tests/test_sandboxed.py +188 -0
  101. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_skills.py +46 -30
  102. steerable_agent_runtime-0.4.0/tests/test_soft_timeout.py +1174 -0
  103. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_spill.py +5 -5
  104. steerable_agent_runtime-0.4.0/tests/test_sqlite_storage.py +238 -0
  105. steerable_agent_runtime-0.4.0/tests/test_steer.py +281 -0
  106. steerable_agent_runtime-0.4.0/tests/test_storage_contract.py +135 -0
  107. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_stream_strip.py +3 -3
  108. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_subagent.py +90 -1
  109. steerable_agent_runtime-0.4.0/tests/test_system_proxy.py +211 -0
  110. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_tokens.py +7 -7
  111. steerable_agent_runtime-0.4.0/tests/test_tool_exposure.py +506 -0
  112. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_tool_hygiene.py +4 -4
  113. steerable_agent_runtime-0.4.0/tests/test_tool_schema.py +114 -0
  114. steerable_agent_runtime-0.4.0/tests/test_tool_timeout.py +311 -0
  115. steerable_agent_runtime-0.4.0/tests/test_trace_recorder.py +339 -0
  116. steerable_agent_runtime-0.4.0/tests/test_usage_attribution.py +137 -0
  117. steerable_agent_runtime-0.4.0/tests/test_world_state.py +408 -0
  118. steerable_agent_runtime-0.4.0/tests/test_write_lease.py +99 -0
  119. steerable_agent_runtime-0.2.5/src/steerable_agent_runtime/__init__.py +0 -165
  120. steerable_agent_runtime-0.2.5/src/steerable_agent_runtime/hooks.py +0 -250
  121. steerable_agent_runtime-0.2.5/src/steerable_agent_runtime/llm/openai_compat.py +0 -325
  122. steerable_agent_runtime-0.2.5/src/steerable_agent_runtime/loop.py +0 -1100
  123. steerable_agent_runtime-0.2.5/src/steerable_agent_runtime.egg-info/SOURCES.txt +0 -63
  124. steerable_agent_runtime-0.2.5/tests/test_llm_wire_helpers.py +0 -306
  125. steerable_agent_runtime-0.2.5/tests/test_otel.py +0 -161
  126. steerable_agent_runtime-0.2.5/tests/test_soft_timeout.py +0 -165
  127. steerable_agent_runtime-0.2.5/tests/test_steer.py +0 -127
  128. steerable_agent_runtime-0.2.5/tests/test_trace_recorder.py +0 -170
  129. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/README.md +0 -0
  130. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/setup.cfg +0 -0
  131. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/pseudo.py +0 -0
  132. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/replay.py +0 -0
  133. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/spill.py +0 -0
  134. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/transport/__init__.py +0 -0
  135. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/transport/fastapi_sse.py +0 -0
  136. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime/transport/stdio_jsonrpc.py +0 -0
  137. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime.egg-info/dependency_links.txt +0 -0
  138. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/src/steerable_agent_runtime.egg-info/top_level.txt +0 -0
  139. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_in_memory_storage.py +0 -0
  140. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_replay_crosslang.py +0 -0
  141. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_tool_router.py +0 -0
  142. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_transport_jsonrpc.py +0 -0
  143. {steerable_agent_runtime-0.2.5 → steerable_agent_runtime-0.4.0}/tests/test_transport_sse.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: steerable-agent-runtime
3
- Version: 0.2.5
3
+ Version: 0.4.0
4
4
  Summary: Steerable agent runtime: LLM, tool, storage, and transport adapters.
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -13,14 +13,14 @@ Provides-Extra: fastapi
13
13
  Requires-Dist: fastapi>=0.110; extra == "fastapi"
14
14
  Requires-Dist: starlette>=0.37; extra == "fastapi"
15
15
  Provides-Extra: openai
16
- Requires-Dist: httpx>=0.27; extra == "openai"
16
+ Requires-Dist: httpx[socks]>=0.27; extra == "openai"
17
17
  Provides-Extra: anthropic
18
18
  Requires-Dist: anthropic>=0.40; extra == "anthropic"
19
19
  Provides-Extra: all
20
20
  Requires-Dist: sqlalchemy>=2.0; extra == "all"
21
21
  Requires-Dist: fastapi>=0.110; extra == "all"
22
22
  Requires-Dist: starlette>=0.37; extra == "all"
23
- Requires-Dist: httpx>=0.27; extra == "all"
23
+ Requires-Dist: httpx[socks]>=0.27; extra == "all"
24
24
  Requires-Dist: anthropic>=0.40; extra == "all"
25
25
 
26
26
  # steerable-agent-runtime
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "steerable-agent-runtime"
3
- version = "0.2.5"
3
+ version = "0.4.0"
4
4
  description = "Steerable agent runtime: LLM, tool, storage, and transport adapters."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -18,13 +18,17 @@ dependencies = [
18
18
  [project.optional-dependencies]
19
19
  sqlalchemy = ["sqlalchemy>=2.0"]
20
20
  fastapi = ["fastapi>=0.110", "starlette>=0.37"]
21
- openai = ["httpx>=0.27"]
21
+ # The `socks` extra is not optional in practice: httpx builds a transport for
22
+ # every proxy the environment declares while the client is constructed, so a
23
+ # host exporting `all_proxy=socks5://…` — the common shell proxy snippet — makes
24
+ # construction raise without it, failing provider calls that never reach a URL.
25
+ openai = ["httpx[socks]>=0.27"]
22
26
  anthropic = ["anthropic>=0.40"]
23
27
  all = [
24
28
  "sqlalchemy>=2.0",
25
29
  "fastapi>=0.110",
26
30
  "starlette>=0.37",
27
- "httpx>=0.27",
31
+ "httpx[socks]>=0.27",
28
32
  "anthropic>=0.40",
29
33
  ]
30
34
 
@@ -38,6 +42,12 @@ package-dir = {"" = "src"}
38
42
  [tool.setuptools.packages.find]
39
43
  where = ["src"]
40
44
 
45
+ # default.harness.yaml/.json ship inside the wheel: the sidecar resolves
46
+ # the spec relative to the installed package (Harbor trial containers
47
+ # pip-install the wheels, so a repo-relative path would not exist there).
48
+ [tool.setuptools.package-data]
49
+ steerable_agent_runtime = ["*.yaml", "*.json"]
50
+
41
51
  [tool.uv.sources]
42
52
  steerable-agent-protocol = { workspace = true }
43
53
  steerable-agent-harness = { workspace = true }
@@ -0,0 +1,410 @@
1
+ """Steerable agent runtime — Tier 3 adapter package."""
2
+
3
+ from .antihallucination import (
4
+ AntiHallucinationConfig,
5
+ AntiHallucinationHooks,
6
+ detect_claimed_execution,
7
+ detect_deferred_execution,
8
+ detect_deferred_execution_eager,
9
+ detect_execution_intent_in_user_message,
10
+ parse_grounding_verdict,
11
+ parse_turn_route,
12
+ should_run_grounding_judge,
13
+ )
14
+ from .approval import (
15
+ ApprovalDecision,
16
+ ApprovalExecutor,
17
+ ApprovalRequest,
18
+ ApprovalStore,
19
+ Approver,
20
+ AutoApprover,
21
+ InMemoryApprovalStore,
22
+ JsonApprovalStore,
23
+ SessionApprovalCache,
24
+ )
25
+ from .approval_policy import (
26
+ ApprovalPolicy,
27
+ ApprovalRule,
28
+ JsonApprovalPolicyStore,
29
+ PolicyApprover,
30
+ rule_from_amendment,
31
+ )
32
+ from .branch import (
33
+ BranchPoint,
34
+ ForkResult,
35
+ branch_label,
36
+ fork_record,
37
+ lineage,
38
+ resolve_fork_seq,
39
+ )
40
+ from .cache_control import (
41
+ CacheControlProvider,
42
+ CacheRetention,
43
+ place_cache_breakpoints,
44
+ system_blocks_with_cache,
45
+ )
46
+ from .calibration import CalibratingProvider, ModelCalibration, UsageCalibration
47
+ from .compaction import CompactionHooks
48
+ from .errors import (
49
+ ApprovalAborted,
50
+ BudgetExhaustedError,
51
+ PolicyDeniedError,
52
+ StorageError,
53
+ ToolDispatchError,
54
+ TransportError,
55
+ )
56
+ from .errors import (
57
+ RuntimeError as SteerableRuntimeError,
58
+ )
59
+ from .history import (
60
+ RECORD_FORMAT_VERSION,
61
+ CompactionBoundary,
62
+ ContextFragment,
63
+ ContextManager,
64
+ HistoryItem,
65
+ HistorySeed,
66
+ HistoryStore,
67
+ RecordEntry,
68
+ RecordFormatError,
69
+ SystemPromptFragment,
70
+ entry_from_dict,
71
+ render_fragment_capped,
72
+ entry_to_dict,
73
+ message_from_dict,
74
+ message_to_dict,
75
+ upgrade_entry_dict,
76
+ )
77
+ from .hooks import (
78
+ ChainHooks,
79
+ CompletionAction,
80
+ CompletionDraft,
81
+ LoopHooks,
82
+ NoopHooks,
83
+ PreStepAction,
84
+ RetryAction,
85
+ RewriteRequest,
86
+ TranscriptAppend,
87
+ )
88
+ from .llm import (
89
+ ContentPart,
90
+ ImagePart,
91
+ LLMMessage,
92
+ LLMProvider,
93
+ LLMStreamChunk,
94
+ LLMUsage,
95
+ TextPart,
96
+ text_parts,
97
+ )
98
+ from .loop import (
99
+ CompletionDecision,
100
+ CoreLoop,
101
+ LoopConfig,
102
+ LoopContext,
103
+ LoopEvent,
104
+ RouterToolExecutor,
105
+ ToolExecutor,
106
+ )
107
+ from .mcp import (
108
+ DEFAULT_MAX_SERVER_TOOLS,
109
+ McpCallResult,
110
+ McpCatalogError,
111
+ McpError,
112
+ McpStdioClient,
113
+ McpToolInfo,
114
+ mcp_invoker,
115
+ parse_mcp_name,
116
+ qualify_mcp_name,
117
+ register_mcp_catalog,
118
+ )
119
+ from .model_info import (
120
+ MODEL_INFOS,
121
+ REASONING_EFFORT_ORDER,
122
+ ModelInfo,
123
+ clamp_reasoning_effort,
124
+ register_model_info,
125
+ resolve_model_info,
126
+ )
127
+ from .orchestration import (
128
+ AgentPool,
129
+ ChildOutcome,
130
+ OrchestrationBudgetExceeded,
131
+ OrchestrationConfig,
132
+ OrchestrationExecutor,
133
+ orchestration_tool_descriptors,
134
+ )
135
+ from .otel import PrivacyMode, export_otlp_http, export_trace, to_otlp_json
136
+ from .pricing import (
137
+ MODEL_PRICES,
138
+ ModelPrice,
139
+ estimate_cost_usd,
140
+ price_for_model,
141
+ register_model_price,
142
+ )
143
+ from .pseudo import extract_inline_tool_calls
144
+ from .recording import (
145
+ DEFAULT_MAX_ITEM_TOKENS,
146
+ InMemoryRequestSink,
147
+ JsonlRequestSink,
148
+ RecordedRequest,
149
+ RecordingProvider,
150
+ RequestSink,
151
+ assert_bounded_items,
152
+ assert_requests_match_record,
153
+ assert_stable_prefix,
154
+ load_recorded_requests,
155
+ )
156
+ from .replay import (
157
+ ExecutionBudget,
158
+ HarnessExecutionState,
159
+ HarnessTrajectoryEvent,
160
+ build_step_decision_event,
161
+ reduce_execution_state,
162
+ )
163
+ from .resume import (
164
+ close_dangling_tool_calls,
165
+ load_history_transcript,
166
+ load_transcript,
167
+ project_transcript,
168
+ )
169
+ from .retry import RetryHooks
170
+ from .sandboxed import (
171
+ DEFAULT_SHELL_TOOLS,
172
+ SandboxBackend,
173
+ SandboxedToolExecutor,
174
+ SandboxEnforcement,
175
+ )
176
+ from .skills import (
177
+ EAGER_PRIORITY_THRESHOLD,
178
+ FilesystemSkillProvider,
179
+ SkillConfig,
180
+ SkillDefinition,
181
+ SkillExecutor,
182
+ SkillHooks,
183
+ SkillProvider,
184
+ SkillSummary,
185
+ matches_conditions,
186
+ render_skill_catalog,
187
+ select_catalog,
188
+ select_skills,
189
+ skill_to_dict,
190
+ skill_tool_descriptor,
191
+ )
192
+ from .spill import FilesystemSpillStore, InMemorySpillStore, SpillHooks, SpillStore
193
+ from .storage import StorageAdapter
194
+ from .subagent import (
195
+ FilteredToolsExecutor,
196
+ SubagentConfig,
197
+ SubagentExecutor,
198
+ subagent_tool_descriptor,
199
+ )
200
+ from .tokens import (
201
+ MODEL_TOKEN_FACTORS,
202
+ estimate_text_tokens,
203
+ estimate_tokens,
204
+ factor_for_model,
205
+ register_model_factor,
206
+ )
207
+ from .tool_search import TOOL_SEARCH_NAME, register_tool_search, tool_search_descriptor
208
+ from .tools import RegisteredTool, ToolExposure, ToolRouter, tool
209
+ from .tracing import TraceRecorder
210
+ from .transport import TransportAdapter
211
+ from .world_state import (
212
+ StaticWorldStateSection,
213
+ WorldStateFragment,
214
+ WorldStateHooks,
215
+ WorldStatePatchFragment,
216
+ WorldStateSection,
217
+ apply_merge_patch,
218
+ last_world_state_snapshot,
219
+ merge_patch,
220
+ )
221
+
222
+ __all__ = [
223
+ "DEFAULT_MAX_ITEM_TOKENS",
224
+ "DEFAULT_MAX_SERVER_TOOLS",
225
+ "DEFAULT_SHELL_TOOLS",
226
+ "EAGER_PRIORITY_THRESHOLD",
227
+ "MODEL_INFOS",
228
+ "MODEL_PRICES",
229
+ "MODEL_TOKEN_FACTORS",
230
+ "REASONING_EFFORT_ORDER",
231
+ "RECORD_FORMAT_VERSION",
232
+ "TOOL_SEARCH_NAME",
233
+ "AgentPool",
234
+ "AntiHallucinationConfig",
235
+ "AntiHallucinationHooks",
236
+ "ApprovalAborted",
237
+ "ApprovalDecision",
238
+ "ApprovalExecutor",
239
+ "ApprovalPolicy",
240
+ "ApprovalRequest",
241
+ "ApprovalRule",
242
+ "ApprovalStore",
243
+ "Approver",
244
+ "AutoApprover",
245
+ "BranchPoint",
246
+ "BudgetExhaustedError",
247
+ "CacheControlProvider",
248
+ "CacheRetention",
249
+ "CalibratingProvider",
250
+ "ChainHooks",
251
+ "ChildOutcome",
252
+ "CompactionBoundary",
253
+ "CompactionHooks",
254
+ "CompletionAction",
255
+ "CompletionDecision",
256
+ "CompletionDraft",
257
+ "ContentPart",
258
+ "ContextFragment",
259
+ "ContextManager",
260
+ "CoreLoop",
261
+ "ExecutionBudget",
262
+ "FilesystemSkillProvider",
263
+ "FilesystemSpillStore",
264
+ "FilteredToolsExecutor",
265
+ "ForkResult",
266
+ "HarnessExecutionState",
267
+ "HarnessTrajectoryEvent",
268
+ "HistoryItem",
269
+ "HistorySeed",
270
+ "HistoryStore",
271
+ "ImagePart",
272
+ "InMemoryApprovalStore",
273
+ "InMemoryRequestSink",
274
+ "InMemorySpillStore",
275
+ "JsonApprovalPolicyStore",
276
+ "JsonApprovalStore",
277
+ "JsonlRequestSink",
278
+ "LLMMessage",
279
+ "LLMProvider",
280
+ "LLMStreamChunk",
281
+ "LLMUsage",
282
+ "LoopConfig",
283
+ "LoopContext",
284
+ "LoopEvent",
285
+ "LoopHooks",
286
+ "McpCallResult",
287
+ "McpCatalogError",
288
+ "McpError",
289
+ "McpStdioClient",
290
+ "McpToolInfo",
291
+ "ModelCalibration",
292
+ "ModelInfo",
293
+ "ModelPrice",
294
+ "NoopHooks",
295
+ "OrchestrationBudgetExceeded",
296
+ "OrchestrationConfig",
297
+ "OrchestrationExecutor",
298
+ "PolicyApprover",
299
+ "PolicyDeniedError",
300
+ "PreStepAction",
301
+ "PrivacyMode",
302
+ "RecordEntry",
303
+ "RecordFormatError",
304
+ "RecordedRequest",
305
+ "RecordingProvider",
306
+ "RegisteredTool",
307
+ "RequestSink",
308
+ "RetryAction",
309
+ "RetryHooks",
310
+ "RewriteRequest",
311
+ "RouterToolExecutor",
312
+ "SandboxBackend",
313
+ "SandboxEnforcement",
314
+ "SandboxedToolExecutor",
315
+ "SessionApprovalCache",
316
+ "SkillConfig",
317
+ "SkillDefinition",
318
+ "SystemPromptFragment",
319
+ "SkillExecutor",
320
+ "SkillHooks",
321
+ "SkillProvider",
322
+ "SkillSummary",
323
+ "SpillHooks",
324
+ "SpillStore",
325
+ "StaticWorldStateSection",
326
+ "SteerableRuntimeError",
327
+ "StorageAdapter",
328
+ "StorageError",
329
+ "SubagentConfig",
330
+ "SubagentExecutor",
331
+ "TextPart",
332
+ "ToolDispatchError",
333
+ "ToolExecutor",
334
+ "ToolExposure",
335
+ "ToolRouter",
336
+ "TraceRecorder",
337
+ "TranscriptAppend",
338
+ "TransportAdapter",
339
+ "TransportError",
340
+ "UsageCalibration",
341
+ "WorldStateFragment",
342
+ "WorldStateHooks",
343
+ "WorldStatePatchFragment",
344
+ "WorldStateSection",
345
+ "apply_merge_patch",
346
+ "assert_bounded_items",
347
+ "assert_requests_match_record",
348
+ "assert_stable_prefix",
349
+ "branch_label",
350
+ "build_step_decision_event",
351
+ "clamp_reasoning_effort",
352
+ "close_dangling_tool_calls",
353
+ "detect_claimed_execution",
354
+ "detect_deferred_execution",
355
+ "detect_deferred_execution_eager",
356
+ "detect_execution_intent_in_user_message",
357
+ "entry_from_dict",
358
+ "entry_to_dict",
359
+ "estimate_cost_usd",
360
+ "estimate_text_tokens",
361
+ "estimate_tokens",
362
+ "export_otlp_http",
363
+ "export_trace",
364
+ "extract_inline_tool_calls",
365
+ "factor_for_model",
366
+ "fork_record",
367
+ "last_world_state_snapshot",
368
+ "lineage",
369
+ "load_history_transcript",
370
+ "load_recorded_requests",
371
+ "load_transcript",
372
+ "matches_conditions",
373
+ "mcp_invoker",
374
+ "merge_patch",
375
+ "message_from_dict",
376
+ "message_to_dict",
377
+ "orchestration_tool_descriptors",
378
+ "parse_grounding_verdict",
379
+ "parse_mcp_name",
380
+ "parse_turn_route",
381
+ "place_cache_breakpoints",
382
+ "price_for_model",
383
+ "project_transcript",
384
+ "qualify_mcp_name",
385
+ "reduce_execution_state",
386
+ "register_mcp_catalog",
387
+ "register_model_factor",
388
+ "register_model_info",
389
+ "register_model_price",
390
+ "register_tool_search",
391
+ "render_fragment_capped",
392
+ "render_skill_catalog",
393
+ "resolve_fork_seq",
394
+ "resolve_model_info",
395
+ "rule_from_amendment",
396
+ "select_catalog",
397
+ "select_skills",
398
+ "should_run_grounding_judge",
399
+ "skill_to_dict",
400
+ "skill_tool_descriptor",
401
+ "subagent_tool_descriptor",
402
+ "system_blocks_with_cache",
403
+ "text_parts",
404
+ "to_otlp_json",
405
+ "tool",
406
+ "tool_search_descriptor",
407
+ "upgrade_entry_dict",
408
+ ]
409
+
410
+ __version__ = "0.1.0"
@@ -471,28 +471,27 @@ class AntiHallucinationHooks(NoopHooks):
471
471
  or not self._config.force_tool_choice
472
472
  or not self._config.tools_available
473
473
  ):
474
- return PreStepAction(kind="proceed", transcript=transcript)
474
+ return PreStepAction(kind="proceed")
475
475
  self._route = await self._classify_route()
476
476
  if self._route == "require_tool":
477
477
  return PreStepAction(
478
478
  kind="proceed",
479
- transcript=transcript,
480
479
  tool_choice=self._config.force_tool_choice,
481
480
  )
482
- return PreStepAction(kind="proceed", transcript=transcript)
481
+ return PreStepAction(kind="proceed")
483
482
 
484
483
  async def _classify_route(self) -> DataNeedRoute:
485
484
  from .llm import LLMMessage
486
485
 
487
486
  try:
488
487
  messages = [
489
- LLMMessage(role=m["role"], content=m["content"])
488
+ LLMMessage.text_of(m["role"], m["content"])
490
489
  for m in build_turn_route_messages(
491
490
  self._config.user_question, self._config.last_assistant_tail
492
491
  )
493
492
  ]
494
493
  reply, _usage = await self._provider.complete(messages, temperature=0)
495
- parsed = parse_turn_route(reply.content or "")
494
+ parsed = parse_turn_route(reply.content_text)
496
495
  if parsed:
497
496
  return parsed["route"] # type: ignore[return-value]
498
497
  except Exception:
@@ -594,11 +593,11 @@ class AntiHallucinationHooks(NoopHooks):
594
593
 
595
594
  try:
596
595
  messages = [
597
- LLMMessage(role=m["role"], content=m["content"])
596
+ LLMMessage.text_of(m["role"], m["content"])
598
597
  for m in build_grounding_messages(user_question, assistant_reply)
599
598
  ]
600
599
  reply, _usage = await self._provider.complete(messages, temperature=0)
601
- return parse_grounding_verdict(reply.content or "")
600
+ return parse_grounding_verdict(reply.content_text)
602
601
  except Exception:
603
602
  return None
604
603