vibee-live 0.1.0__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.
vibee_live/__init__.py ADDED
@@ -0,0 +1,97 @@
1
+ """vibee-live: a person's own agent, live inside a product. Pushed events become turns in its session.
2
+
3
+ Everything a product's own command needs is here. The core's names (events, ports, the delivery path, the
4
+ exit codes) are imported with the package and need the standard library only. The companion's (`Config`,
5
+ `run`, `main_run`, `AGENTS`, `agent_command`, `folder`, `port`) live in the composition root,
6
+ `vibee_live.app`, which needs the protocol library: they are loaded when first asked for, so that importing
7
+ this package imports no adapter. The test doubles are in `vibee_live.testing`.
8
+ """
9
+
10
+ from importlib import import_module
11
+ from typing import TYPE_CHECKING, Any
12
+
13
+ from vibee_live.delivery import Live, Outcome, Policy
14
+ from vibee_live.events import Event, MalformedEvent, Mark, UnreadableCursor, Vocabulary, plain, read_event
15
+ from vibee_live.exit_codes import EXIT_FAILED, EXIT_IN_USE, EXIT_OK, EXIT_SETUP
16
+ from vibee_live.loop import SourceAvailable
17
+ from vibee_live.ports import (
18
+ AgentDriver,
19
+ AgentSession,
20
+ AgentUnavailable,
21
+ ApprovalRequest,
22
+ ApprovalSurface,
23
+ Clock,
24
+ EventSource,
25
+ Notice,
26
+ Notifier,
27
+ Option,
28
+ Saved,
29
+ SessionSpec,
30
+ SourceUnavailable,
31
+ State,
32
+ ToolServer,
33
+ TurnRefused,
34
+ )
35
+
36
+ if TYPE_CHECKING:
37
+ from vibee_live.app.command import AGENTS, agent_command, folder, main_run, port
38
+ from vibee_live.app.companion import Config, run
39
+
40
+ # The composition root's names, and the module each is loaded from when first asked for.
41
+ _LATER = {
42
+ "AGENTS": "vibee_live.app.command",
43
+ "Config": "vibee_live.app.companion",
44
+ "run": "vibee_live.app.companion",
45
+ "agent_command": "vibee_live.app.command",
46
+ "folder": "vibee_live.app.command",
47
+ "main_run": "vibee_live.app.command",
48
+ "port": "vibee_live.app.command",
49
+ }
50
+
51
+
52
+ def __getattr__(name: str) -> Any:
53
+ if name not in _LATER:
54
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
55
+ return getattr(import_module(_LATER[name]), name)
56
+
57
+
58
+ __all__ = [
59
+ "AGENTS",
60
+ "AgentDriver",
61
+ "AgentUnavailable",
62
+ "AgentSession",
63
+ "ApprovalRequest",
64
+ "ApprovalSurface",
65
+ "Clock",
66
+ "Config",
67
+ "EXIT_FAILED",
68
+ "EXIT_IN_USE",
69
+ "EXIT_OK",
70
+ "EXIT_SETUP",
71
+ "Event",
72
+ "EventSource",
73
+ "Live",
74
+ "MalformedEvent",
75
+ "Mark",
76
+ "Notice",
77
+ "Notifier",
78
+ "Option",
79
+ "Outcome",
80
+ "Policy",
81
+ "Saved",
82
+ "SessionSpec",
83
+ "SourceAvailable",
84
+ "SourceUnavailable",
85
+ "State",
86
+ "ToolServer",
87
+ "TurnRefused",
88
+ "UnreadableCursor",
89
+ "Vocabulary",
90
+ "agent_command",
91
+ "folder",
92
+ "main_run",
93
+ "plain",
94
+ "port",
95
+ "read_event",
96
+ "run",
97
+ ]
vibee_live/__main__.py ADDED
@@ -0,0 +1,6 @@
1
+ """`python -m vibee_live`: the companion command. The wiring is in `vibee_live.app`."""
2
+
3
+ from vibee_live.app.command import main
4
+
5
+ if __name__ == "__main__":
6
+ raise SystemExit(main())
@@ -0,0 +1 @@
1
+ """Adapters of the core's ports that are not specific to a product."""