Skip to content

Commit c5d10f6

Browse files
authored
Update __init__.py
1 parent a1d7ef7 commit c5d10f6

1 file changed

Lines changed: 33 additions & 1 deletion

File tree

‎app/controllers/__init__.py‎

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,48 @@
1-
"""Controller package: protocol, runner, manager."""
1+
"""Controllers: all of the app's business logic.
22
3+
Two kinds of module live here:
4+
5+
*Machinery* — ``runner`` (sandboxes and harness processes), ``protocol``
6+
(the harness event contract), ``manager`` (run lifecycle, event
7+
fan-out).
8+
9+
*Request logic* — ``accounts``, ``conversations``, ``files``, ``runs``,
10+
``secrets``, ``usage``. One module per area of the domain, holding the
11+
rules that decide what a caller may do and what the agent is told.
12+
13+
``app.routes`` is deliberately thin on top of these: it wires HTTP
14+
(dependencies, status codes, response schemas) and nothing else. A
15+
controller refuses work by raising from ``errors``, so it never needs to
16+
know the caller speaks HTTP.
17+
"""
18+
19+
from .errors import (
20+
Conflict,
21+
DomainError,
22+
Forbidden,
23+
InvalidRequest,
24+
NotFound,
25+
PayloadTooLarge,
26+
Unauthorized,
27+
)
328
from .manager import Controller
429
from .protocol import ProtocolEvent, RunOutcome, apply_event, parse_line, parse_stream
530
from .runner import ExecResult, Runner, ServerRunner, get_runner
631

732
__all__ = [
33+
"Conflict",
834
"Controller",
35+
"DomainError",
936
"ExecResult",
37+
"Forbidden",
38+
"InvalidRequest",
39+
"NotFound",
40+
"PayloadTooLarge",
1041
"ProtocolEvent",
1142
"RunOutcome",
1243
"Runner",
1344
"ServerRunner",
45+
"Unauthorized",
1446
"apply_event",
1547
"get_runner",
1648
"parse_line",

0 commit comments

Comments
 (0)