1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
"""
Shared ExportMixin for all Briefcase framework handlers.
Provides a single _trigger_export() implementation, eliminating ~150 lines
of near-identical code duplicated across 6 handlers (LangChain, LlamaIndex,
OpenAI Agents, AG2, AutoGen, CrewAI, PageIndex).
Usage in a handler class:
class MyHandler(ExportMixin):
def __init__(self, ..., exporter=None, async_capture=True):
self._exporter = exporter # ExportMixin reads this
self.async_capture = async_capture # ExportMixin reads this
# Calling _trigger_export(record) will use self._exporter if set,
# otherwise falls back to BriefcaseConfig.get().exporter.
"""
=
"""
Mixin providing _trigger_export() for Briefcase framework handlers.
Requires the concrete class to define:
- self._exporter — optional per-instance exporter (may be None)
- self.async_capture — bool controlling sync vs background export
The mixin has no __init__, so it is safe to use with multiple inheritance
(MRO-neutral). All errors are swallowed — _trigger_export never raises.
"""
= None # subclasses set via exporter= constructor arg
"""Return the exporter to use: per-instance first, then global config."""
return
return .
return None
"""
Export a decision record via the configured exporter.
If async_capture is True (default), spawns a daemon thread so the
caller is never blocked. On any error, silently returns.
"""
=
return
=
pass
=
=
pass