composable-agents 1.0.0rc1__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.
- composable_agents/__init__.py +354 -0
- composable_agents/agent.py +1226 -0
- composable_agents/agent_loop.py +626 -0
- composable_agents/bundle.py +284 -0
- composable_agents/ca/__init__.py +4 -0
- composable_agents/ca/_resolve_child.py +211 -0
- composable_agents/ca/chat.py +95 -0
- composable_agents/ca/cli.py +330 -0
- composable_agents/ca/config.py +107 -0
- composable_agents/ca/deploy.py +166 -0
- composable_agents/ca/discover.py +110 -0
- composable_agents/ca/doctor.py +41 -0
- composable_agents/ca/gitstate.py +23 -0
- composable_agents/ca/langfuse_link.py +20 -0
- composable_agents/ca/ledger.py +156 -0
- composable_agents/ca/lint.py +54 -0
- composable_agents/ca/listen.py +117 -0
- composable_agents/ca/model.py +43 -0
- composable_agents/ca/resolve.py +57 -0
- composable_agents/ca/runcache.py +62 -0
- composable_agents/ca/runner.py +120 -0
- composable_agents/ca/select.py +200 -0
- composable_agents/ca/session_local.py +63 -0
- composable_agents/ca/status.py +97 -0
- composable_agents/ca/temporal_run.py +107 -0
- composable_agents/ca/tracetree.py +28 -0
- composable_agents/ca/trigger.py +77 -0
- composable_agents/capabilities.py +540 -0
- composable_agents/cas.py +195 -0
- composable_agents/cli.py +468 -0
- composable_agents/continuation.py +48 -0
- composable_agents/contracts.py +259 -0
- composable_agents/dag.py +1049 -0
- composable_agents/define.py +1512 -0
- composable_agents/deploy.py +582 -0
- composable_agents/deps.py +140 -0
- composable_agents/derived.py +357 -0
- composable_agents/diagnostics.py +80 -0
- composable_agents/dotctx.py +350 -0
- composable_agents/dotctx_rich.py +695 -0
- composable_agents/dsl.py +330 -0
- composable_agents/errors.py +133 -0
- composable_agents/execution/__init__.py +179 -0
- composable_agents/execution/_wasm/build.py +60 -0
- composable_agents/execution/_wasm/componentize_py_async_support/__init__.py +570 -0
- composable_agents/execution/_wasm/componentize_py_async_support/futures.py +149 -0
- composable_agents/execution/_wasm/componentize_py_async_support/streams.py +345 -0
- composable_agents/execution/_wasm/componentize_py_runtime.pyi +40 -0
- composable_agents/execution/_wasm/componentize_py_types.py +32 -0
- composable_agents/execution/_wasm/executor.wasm +0 -0
- composable_agents/execution/_wasm/executor_component.py +84 -0
- composable_agents/execution/_wasm/poll_loop.py +440 -0
- composable_agents/execution/_wasm/wasi_wheels/regex/regex/__init__.py +3 -0
- composable_agents/execution/_wasm/wasi_wheels/regex/regex/_regex_core.py +4495 -0
- composable_agents/execution/_wasm/wasi_wheels/regex/regex/regex.py +746 -0
- composable_agents/execution/_wasm/wit_world/__init__.py +19 -0
- composable_agents/execution/activities.py +105 -0
- composable_agents/execution/anthropic_batch.py +156 -0
- composable_agents/execution/batch_provider.py +113 -0
- composable_agents/execution/blobstore.py +105 -0
- composable_agents/execution/bundle_runner.py +115 -0
- composable_agents/execution/bundle_worker.py +32 -0
- composable_agents/execution/cma.py +400 -0
- composable_agents/execution/cma_anthropic.py +337 -0
- composable_agents/execution/cma_session.py +403 -0
- composable_agents/execution/coalesce.py +209 -0
- composable_agents/execution/codec.py +66 -0
- composable_agents/execution/dbos_backend.py +1140 -0
- composable_agents/execution/debounce.py +233 -0
- composable_agents/execution/effects.py +1155 -0
- composable_agents/execution/env_builder.py +469 -0
- composable_agents/execution/harness.py +2669 -0
- composable_agents/execution/interpreter.py +923 -0
- composable_agents/execution/langfuse.py +339 -0
- composable_agents/execution/llm.py +516 -0
- composable_agents/execution/llm_result.py +60 -0
- composable_agents/execution/native_venv_executor.py +210 -0
- composable_agents/execution/openai_batch.py +181 -0
- composable_agents/execution/otel.py +124 -0
- composable_agents/execution/policy.py +70 -0
- composable_agents/execution/reasoner_batch.py +650 -0
- composable_agents/execution/serve.py +334 -0
- composable_agents/execution/session_store.py +181 -0
- composable_agents/execution/timeouts.py +12 -0
- composable_agents/execution/trajectory_sql.py +94 -0
- composable_agents/execution/wasm_executor.py +301 -0
- composable_agents/execution/worker.py +253 -0
- composable_agents/flow_adapters.py +92 -0
- composable_agents/flow_registry.py +96 -0
- composable_agents/freeze.py +361 -0
- composable_agents/gc.py +293 -0
- composable_agents/ir.py +611 -0
- composable_agents/kinds.py +128 -0
- composable_agents/projection.py +381 -0
- composable_agents/prompt.py +139 -0
- composable_agents/purity.py +129 -0
- composable_agents/py.typed +1 -0
- composable_agents/qos.py +80 -0
- composable_agents/registry.py +384 -0
- composable_agents/resilience.py +289 -0
- composable_agents/result.py +52 -0
- composable_agents/session.py +1129 -0
- composable_agents/shapes.py +109 -0
- composable_agents/staged.py +307 -0
- composable_agents/std.py +202 -0
- composable_agents/trajectory.py +579 -0
- composable_agents/transcript.py +199 -0
- composable_agents/transforms.py +86 -0
- composable_agents/turn.py +230 -0
- composable_agents/typed.py +283 -0
- composable_agents/validate.py +894 -0
- composable_agents/worker_store.py +548 -0
- composable_agents-1.0.0rc1.dist-info/METADATA +492 -0
- composable_agents-1.0.0rc1.dist-info/RECORD +118 -0
- composable_agents-1.0.0rc1.dist-info/WHEEL +5 -0
- composable_agents-1.0.0rc1.dist-info/entry_points.txt +3 -0
- composable_agents-1.0.0rc1.dist-info/licenses/LICENSE +201 -0
- composable_agents-1.0.0rc1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
"""Composable Serverless Agents — a typed, durable agent framework.
|
|
2
|
+
|
|
3
|
+
A flow is written with the combinator DSL (:func:`seq`, :func:`par`,
|
|
4
|
+
:func:`each`, :func:`alt`, :func:`iter_up_to`, :func:`stage`, :func:`app`, plus the
|
|
5
|
+
derived :func:`race`/:func:`hedge`/:func:`quorum`/:func:`map_reduce`/…). Its
|
|
6
|
+
*shape* — where it sits on the Pipeline < Dataflow < Branching < Feedback <
|
|
7
|
+
Staged < Agent lattice — is inferred, not declared, and bounds what static
|
|
8
|
+
guarantees hold. :func:`deploy` freezes every tool to a content hash, validates
|
|
9
|
+
well-formedness, enforces capabilities (§9), and admits races (§5) before a flow
|
|
10
|
+
can run; :func:`freeze` and :func:`validate` are exposed for finer control.
|
|
11
|
+
|
|
12
|
+
Execution is durable on Temporal: the control plane walks the frozen IR in a
|
|
13
|
+
workflow, Reasoners and Tools are activities, Sub is a child workflow behind a
|
|
14
|
+
Joined firewall, and Agent is a bounded controller loop with a budget guard and
|
|
15
|
+
continue-as-new. That layer is imported lazily and guarded — everything in the
|
|
16
|
+
authoring/compile path here works with no Temporal install — and
|
|
17
|
+
:data:`HAVE_TEMPORAL` reports whether the runtime is available.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
from importlib import import_module
|
|
23
|
+
from typing import Any
|
|
24
|
+
|
|
25
|
+
__version__ = "0.1.0"
|
|
26
|
+
|
|
27
|
+
# --- shape lattice + effect kinds ----------------------------------------- #
|
|
28
|
+
from .kinds import (
|
|
29
|
+
ContextScope as ContextScope,
|
|
30
|
+
Effect as Effect,
|
|
31
|
+
EnforcementMode as EnforcementMode,
|
|
32
|
+
Idempotency as Idempotency,
|
|
33
|
+
Shape as Shape,
|
|
34
|
+
SummaryPolicy as SummaryPolicy,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
# --- IR value types (rarely built by tool; useful for typing/introspection) #
|
|
38
|
+
from .ir import (
|
|
39
|
+
EMIT_TOOL as EMIT_TOOL,
|
|
40
|
+
HUMAN_GATE_TOOL as HUMAN_GATE_TOOL,
|
|
41
|
+
RECV_TOOL as RECV_TOOL,
|
|
42
|
+
SLEEP_TOOL as SLEEP_TOOL,
|
|
43
|
+
Ann as Ann,
|
|
44
|
+
CacheHint as CacheHint,
|
|
45
|
+
ChannelRef as ChannelRef,
|
|
46
|
+
ContextPolicy as ContextPolicy,
|
|
47
|
+
McpTool as McpTool,
|
|
48
|
+
NativeTool as NativeTool,
|
|
49
|
+
Node as Node,
|
|
50
|
+
SourceSpan as SourceSpan,
|
|
51
|
+
SubContract as SubContract,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
# --- authoring DSL --------------------------------------------------------- #
|
|
55
|
+
from .dsl import (
|
|
56
|
+
Contract as Contract,
|
|
57
|
+
alt as alt,
|
|
58
|
+
app as app,
|
|
59
|
+
arr as arr,
|
|
60
|
+
reasoner_from_ctx as reasoner_from_ctx,
|
|
61
|
+
call as call,
|
|
62
|
+
fanout as fanout,
|
|
63
|
+
ident as ident,
|
|
64
|
+
iter_up_to as iter_up_to,
|
|
65
|
+
mcp as mcp,
|
|
66
|
+
native as native,
|
|
67
|
+
par as par,
|
|
68
|
+
seq as seq,
|
|
69
|
+
set_source_capture as set_source_capture,
|
|
70
|
+
source_capture_enabled as source_capture_enabled,
|
|
71
|
+
stage as stage,
|
|
72
|
+
sub as sub,
|
|
73
|
+
)
|
|
74
|
+
from .derived import (
|
|
75
|
+
HUMAN_CHANNEL as HUMAN_CHANNEL,
|
|
76
|
+
check_race_admission as check_race_admission,
|
|
77
|
+
delay as delay,
|
|
78
|
+
emit as emit,
|
|
79
|
+
hedge as hedge,
|
|
80
|
+
human_gate as human_gate,
|
|
81
|
+
map_n as map_n,
|
|
82
|
+
map_reduce as map_reduce,
|
|
83
|
+
quorum as quorum,
|
|
84
|
+
race as race,
|
|
85
|
+
recv as recv,
|
|
86
|
+
review as review,
|
|
87
|
+
vote as vote,
|
|
88
|
+
)
|
|
89
|
+
from .continuation import (
|
|
90
|
+
continuation_value as continuation_value,
|
|
91
|
+
continue_with as continue_with,
|
|
92
|
+
is_continuation as is_continuation,
|
|
93
|
+
run_chained as run_chained,
|
|
94
|
+
)
|
|
95
|
+
from .session import (
|
|
96
|
+
Channel as Channel,
|
|
97
|
+
LocalSessionHandle as LocalSessionHandle,
|
|
98
|
+
Session as Session,
|
|
99
|
+
SessionCompileError as SessionCompileError,
|
|
100
|
+
SessionEvent as SessionEvent,
|
|
101
|
+
SessionHandle as SessionHandle,
|
|
102
|
+
drive_session as drive_session,
|
|
103
|
+
loop as loop,
|
|
104
|
+
scan as scan,
|
|
105
|
+
session as session,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
# --- contracts + tool manifest --------------------------------------------- #
|
|
109
|
+
from .contracts import (
|
|
110
|
+
FrozenTool as FrozenTool,
|
|
111
|
+
McpAnnotations as McpAnnotations,
|
|
112
|
+
ToolContract as ToolContract,
|
|
113
|
+
ToolManifest as ToolManifest,
|
|
114
|
+
definition_hash as definition_hash,
|
|
115
|
+
execution_hash as execution_hash,
|
|
116
|
+
manifest_from_json as manifest_from_json,
|
|
117
|
+
manifest_to_json as manifest_to_json,
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
# --- compile pipeline ------------------------------------------------------ #
|
|
121
|
+
from .freeze import (
|
|
122
|
+
CapabilityOverrides as CapabilityOverrides,
|
|
123
|
+
FreezeResult as FreezeResult,
|
|
124
|
+
McpServerSnapshot as McpServerSnapshot,
|
|
125
|
+
McpSnapshot as McpSnapshot,
|
|
126
|
+
McpToolSpec as McpToolSpec,
|
|
127
|
+
NativeToolSpec as NativeToolSpec,
|
|
128
|
+
freeze as freeze,
|
|
129
|
+
)
|
|
130
|
+
from .validate import Diagnostic as Diagnostic, blocking as blocking, validate as validate
|
|
131
|
+
from .diagnostics import explain as explain
|
|
132
|
+
from .capabilities import (
|
|
133
|
+
Budget as Budget,
|
|
134
|
+
CapabilityManifest as CapabilityManifest,
|
|
135
|
+
ToolGrant as ToolGrant,
|
|
136
|
+
check_approval_gates as check_approval_gates,
|
|
137
|
+
)
|
|
138
|
+
from .staged import (
|
|
139
|
+
admit_plan as admit_plan,
|
|
140
|
+
bind_plan_to_manifest as bind_plan_to_manifest,
|
|
141
|
+
estimate_cost as estimate_cost,
|
|
142
|
+
referenced_tool_keys as referenced_tool_keys,
|
|
143
|
+
validate_plan as validate_plan,
|
|
144
|
+
)
|
|
145
|
+
from .deploy import (
|
|
146
|
+
Deployment as Deployment,
|
|
147
|
+
deploy as deploy,
|
|
148
|
+
snapshot_from_listings as snapshot_from_listings,
|
|
149
|
+
)
|
|
150
|
+
from .dag import (
|
|
151
|
+
Graph as Graph,
|
|
152
|
+
GraphDefinitionError as GraphDefinitionError,
|
|
153
|
+
InputEdge as InputEdge,
|
|
154
|
+
StepKind as StepKind,
|
|
155
|
+
StepNode as StepNode,
|
|
156
|
+
compile as compile_dag,
|
|
157
|
+
compile_env as compile_env_dag,
|
|
158
|
+
)
|
|
159
|
+
from .agent import (
|
|
160
|
+
AGENT_REPLY_SCHEMA as AGENT_REPLY_SCHEMA,
|
|
161
|
+
Agent as Agent,
|
|
162
|
+
Tool as Tool,
|
|
163
|
+
snapshot_from_tools as snapshot_from_tools,
|
|
164
|
+
tool as tool,
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
# --- reasoners (dotctx) ------------------------------------------------------- #
|
|
168
|
+
from .dotctx import (
|
|
169
|
+
Reasoner as Reasoner,
|
|
170
|
+
reasoner_from_settings as reasoner_from_settings,
|
|
171
|
+
reasoner_to_flow as reasoner_to_flow,
|
|
172
|
+
dotctx_flow as dotctx_flow,
|
|
173
|
+
get_reasoner as get_reasoner,
|
|
174
|
+
load_dotctx as load_dotctx,
|
|
175
|
+
register_reasoner as register_reasoner,
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
# --- purity registry ------------------------------------------------------- #
|
|
179
|
+
from .purity import (
|
|
180
|
+
Pure as Pure,
|
|
181
|
+
diff_pure_hashes as diff_pure_hashes,
|
|
182
|
+
get_pure as get_pure,
|
|
183
|
+
is_registered as is_registered,
|
|
184
|
+
pure as pure,
|
|
185
|
+
register_pure as register_pure,
|
|
186
|
+
)
|
|
187
|
+
from .registry import DEFAULT_REGISTRY as DEFAULT_REGISTRY, Registry as Registry
|
|
188
|
+
from . import std as _std
|
|
189
|
+
from .define import (
|
|
190
|
+
BoundFlow as BoundFlow,
|
|
191
|
+
cond as cond,
|
|
192
|
+
DefineError as DefineError,
|
|
193
|
+
each as each,
|
|
194
|
+
FlowDef as FlowDef,
|
|
195
|
+
Handle as Handle,
|
|
196
|
+
flow as flow,
|
|
197
|
+
reschedule as reschedule,
|
|
198
|
+
switch as switch,
|
|
199
|
+
think as think,
|
|
200
|
+
)
|
|
201
|
+
from .typed import as_flow as as_flow
|
|
202
|
+
|
|
203
|
+
# --- agent loop + plan extraction (P4) ------------------------------------- #
|
|
204
|
+
from .agent_loop import (
|
|
205
|
+
AgentConfig as AgentConfig,
|
|
206
|
+
AgentState as AgentState,
|
|
207
|
+
Decision as Decision,
|
|
208
|
+
extract_plan as extract_plan,
|
|
209
|
+
generalize_trace_to_plan as generalize_trace_to_plan,
|
|
210
|
+
interpret_reasoner_reply as interpret_reasoner_reply,
|
|
211
|
+
promote_plan as promote_plan,
|
|
212
|
+
)
|
|
213
|
+
from .execution.cma import (
|
|
214
|
+
CMAAgentEnv as CMAAgentEnv,
|
|
215
|
+
CMAClient as CMAClient,
|
|
216
|
+
CMAEvent as CMAEvent,
|
|
217
|
+
CMASession as CMASession,
|
|
218
|
+
drive_cma_agent_loop as drive_cma_agent_loop,
|
|
219
|
+
manifest_to_custom_tools as manifest_to_custom_tools,
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
# --- observability projection ---------------------------------------------- #
|
|
223
|
+
from .projection import (
|
|
224
|
+
InMemoryProjection as InMemoryProjection,
|
|
225
|
+
PostgresProjection as PostgresProjection,
|
|
226
|
+
ProjectionEmitter as ProjectionEmitter,
|
|
227
|
+
ProjectionEvent as ProjectionEvent,
|
|
228
|
+
ProjectionSink as ProjectionSink,
|
|
229
|
+
ProjectionStore as ProjectionStore,
|
|
230
|
+
SpanData as SpanData,
|
|
231
|
+
TeeStore as TeeStore,
|
|
232
|
+
ValueStore as ValueStore,
|
|
233
|
+
to_otel_spans as to_otel_spans,
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
# --- provider resilience ---------------------------------------------------- #
|
|
237
|
+
from .resilience import (
|
|
238
|
+
AttemptRecord as AttemptRecord,
|
|
239
|
+
CircuitBreaker as CircuitBreaker,
|
|
240
|
+
ErrorClass as ErrorClass,
|
|
241
|
+
ResiliencePolicy as ResiliencePolicy,
|
|
242
|
+
classify_error as classify_error,
|
|
243
|
+
summarize_attempts as summarize_attempts,
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
# --- errors ---------------------------------------------------------------- #
|
|
247
|
+
from .errors import (
|
|
248
|
+
AdmissionError as AdmissionError,
|
|
249
|
+
BudgetExceeded as BudgetExceeded,
|
|
250
|
+
CapabilityDenied as CapabilityDenied,
|
|
251
|
+
ComposableAgentsError as ComposableAgentsError,
|
|
252
|
+
FreezeError as FreezeError,
|
|
253
|
+
PlanRejected as PlanRejected,
|
|
254
|
+
PrincipalRequired as PrincipalRequired,
|
|
255
|
+
PureDriftError as PureDriftError,
|
|
256
|
+
RaceAllFailed as RaceAllFailed,
|
|
257
|
+
ResilienceExhausted as ResilienceExhausted,
|
|
258
|
+
UnsupportedShapeError as UnsupportedShapeError,
|
|
259
|
+
ValidationError as ValidationError,
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
# --- execution layer (always exposes the pure interpreter; Temporal guarded) #
|
|
263
|
+
from .execution import (
|
|
264
|
+
Env as Env,
|
|
265
|
+
ExecutionPolicy as ExecutionPolicy,
|
|
266
|
+
HAVE_DBOS as HAVE_DBOS,
|
|
267
|
+
HAVE_TEMPORAL as HAVE_TEMPORAL,
|
|
268
|
+
InMemoryEnv as InMemoryEnv,
|
|
269
|
+
Result as Result,
|
|
270
|
+
RunPrincipal as RunPrincipal,
|
|
271
|
+
WorkerContext as WorkerContext,
|
|
272
|
+
interpret as interpret,
|
|
273
|
+
)
|
|
274
|
+
|
|
275
|
+
_BASE_EXPORTS = [
|
|
276
|
+
# kinds
|
|
277
|
+
"Shape", "Effect", "EnforcementMode", "Idempotency", "ContextScope", "SummaryPolicy",
|
|
278
|
+
# ir
|
|
279
|
+
"Node", "Ann", "ContextPolicy", "CacheHint", "SubContract",
|
|
280
|
+
"NativeTool", "McpTool", "ChannelRef",
|
|
281
|
+
"HUMAN_GATE_TOOL", "SLEEP_TOOL", "RECV_TOOL", "EMIT_TOOL",
|
|
282
|
+
# dsl
|
|
283
|
+
"call", "native", "mcp", "think", "reasoner_from_ctx", "ident", "arr", "sub",
|
|
284
|
+
"seq", "par", "fanout", "each", "alt", "cond", "switch", "reschedule",
|
|
285
|
+
"iter_up_to", "stage", "app",
|
|
286
|
+
"Contract",
|
|
287
|
+
# derived
|
|
288
|
+
"race", "hedge", "quorum", "map_n", "map_reduce", "vote", "review",
|
|
289
|
+
"human_gate", "recv", "emit", "HUMAN_CHANNEL", "delay", "check_race_admission",
|
|
290
|
+
# continuation
|
|
291
|
+
"continue_with", "is_continuation", "continuation_value", "run_chained",
|
|
292
|
+
# session
|
|
293
|
+
"Channel", "Session", "SessionEvent", "SessionHandle", "LocalSessionHandle",
|
|
294
|
+
"scan", "loop", "drive_session", "session", "SessionCompileError",
|
|
295
|
+
# contracts
|
|
296
|
+
"ToolContract", "FrozenTool", "McpAnnotations", "ToolManifest",
|
|
297
|
+
"definition_hash", "execution_hash", "manifest_to_json", "manifest_from_json",
|
|
298
|
+
# compile
|
|
299
|
+
"freeze", "FreezeResult", "McpSnapshot", "McpServerSnapshot", "McpToolSpec",
|
|
300
|
+
"NativeToolSpec", "CapabilityOverrides",
|
|
301
|
+
"validate", "Diagnostic", "blocking", "explain",
|
|
302
|
+
"CapabilityManifest", "Budget", "ToolGrant", "check_approval_gates",
|
|
303
|
+
"estimate_cost", "validate_plan", "admit_plan", "referenced_tool_keys",
|
|
304
|
+
"bind_plan_to_manifest",
|
|
305
|
+
"deploy", "Deployment", "snapshot_from_listings",
|
|
306
|
+
"Agent", "AGENT_REPLY_SCHEMA", "Tool", "tool", "snapshot_from_tools",
|
|
307
|
+
# dotctx
|
|
308
|
+
"Reasoner", "register_reasoner", "get_reasoner", "load_dotctx", "dotctx_flow",
|
|
309
|
+
"reasoner_to_flow", "reasoner_from_settings",
|
|
310
|
+
# purity
|
|
311
|
+
"pure", "register_pure", "is_registered", "get_pure", "diff_pure_hashes",
|
|
312
|
+
"Registry", "DEFAULT_REGISTRY",
|
|
313
|
+
# agent loop
|
|
314
|
+
"AgentConfig", "AgentState", "Decision", "interpret_reasoner_reply",
|
|
315
|
+
"generalize_trace_to_plan", "extract_plan", "promote_plan",
|
|
316
|
+
"CMAEvent", "CMASession", "CMAClient", "CMAAgentEnv",
|
|
317
|
+
"drive_cma_agent_loop", "manifest_to_custom_tools",
|
|
318
|
+
# projection
|
|
319
|
+
"ProjectionEvent", "ProjectionEmitter", "ProjectionSink", "ProjectionStore",
|
|
320
|
+
"InMemoryProjection", "PostgresProjection", "TeeStore", "ValueStore", "SpanData",
|
|
321
|
+
"to_otel_spans",
|
|
322
|
+
# provider resilience
|
|
323
|
+
"AttemptRecord", "CircuitBreaker", "ErrorClass", "ResiliencePolicy",
|
|
324
|
+
"classify_error", "summarize_attempts",
|
|
325
|
+
# errors
|
|
326
|
+
"ComposableAgentsError", "ValidationError", "FreezeError", "AdmissionError",
|
|
327
|
+
"PureDriftError", "RaceAllFailed", "BudgetExceeded", "PlanRejected", "CapabilityDenied",
|
|
328
|
+
"PrincipalRequired", "ResilienceExhausted", "UnsupportedShapeError",
|
|
329
|
+
# execution (pure)
|
|
330
|
+
"Env", "ExecutionPolicy", "InMemoryEnv", "Result", "RunPrincipal", "WorkerContext", "interpret",
|
|
331
|
+
"HAVE_DBOS", "HAVE_TEMPORAL",
|
|
332
|
+
"__version__",
|
|
333
|
+
]
|
|
334
|
+
|
|
335
|
+
_TEMPORAL_EXPORTS = [
|
|
336
|
+
"FlowWorkflow", "SessionWorkflow", "AgentWorkflow", "FlowInput", "SessionInput", "AgentInput",
|
|
337
|
+
"run_flow", "start_flow", "TemporalSessionHandle", "build_worker", "run_worker",
|
|
338
|
+
"callTool", "invokeReasoner", "compilePlan", "verifyPures", "resolveSubflow",
|
|
339
|
+
"resolveAgentSpec", "resolveRuntimeCapabilities",
|
|
340
|
+
]
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
def __getattr__(name: str) -> Any:
|
|
344
|
+
if name not in _TEMPORAL_EXPORTS:
|
|
345
|
+
raise AttributeError(name)
|
|
346
|
+
if not HAVE_TEMPORAL:
|
|
347
|
+
raise AttributeError(name)
|
|
348
|
+
execution = import_module(".execution", __name__)
|
|
349
|
+
value = getattr(execution, name)
|
|
350
|
+
globals()[name] = value
|
|
351
|
+
return value
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
__all__ = _BASE_EXPORTS + (_TEMPORAL_EXPORTS if HAVE_TEMPORAL else [])
|