deskd 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.
deskd/__init__.py ADDED
@@ -0,0 +1,98 @@
1
+ """deskd — a domain-agnostic orchestration engine for multi-agent desks.
2
+
3
+ deskd owns the part of a multi-agent system that is hard and has nothing to do
4
+ with your domain: which agents are alive, what is queued for them, and — the
5
+ difficult bit — reliably waking the right agent at the right time and proving
6
+ the message actually landed. Your agents do the domain work; deskd does the
7
+ coordination. It never acts *as* an agent.
8
+
9
+ Start here::
10
+
11
+ from deskd import RoleSpec, configure
12
+
13
+ configure(
14
+ roles=(RoleSpec("researcher", "Researcher"),
15
+ RoleSpec("operator", "Operator")),
16
+ timezone="America/New_York",
17
+ probe_allowlist=("myapp.watchers",), # empty = no probes may run
18
+ )
19
+
20
+ from deskd import orchestration
21
+ orchestration.inbox_enqueue("operator", "alert", "threshold crossed",
22
+ priority="urgent")
23
+
24
+ `configure()` mutates the process-wide `CONFIG` in place, and engine modules
25
+ read it at call time — so a host must configure before it calls the engine, and
26
+ importing a module does not freeze the configuration.
27
+
28
+ Layering, which imports must respect: config -> auth -> mailbox -> meetings ->
29
+ orchestration -> (cli, web). Nothing lower may import anything higher.
30
+
31
+ The submodules are the API surface; this package re-exports only the entry
32
+ points a host actually needs:
33
+
34
+ * `deskd.orchestration` — presence, tasks, the unified inbox, wake orchestration,
35
+ wake hooks, the delivery ledger, session lifecycle, board/agent aggregates.
36
+ `inbox_enqueue()` is THE public ingress: hosts inject their own domain events
37
+ through it, and the engine never reaches into the host to collect them.
38
+ * `deskd.meetings` — bounded multi-agent meetings and the supervisor adapter.
39
+ * `deskd.mailbox` — the durable thread/message transport and review workflow.
40
+ * `deskd.auth` — the supervisor trust boundary (Ed25519 verification, the nonce
41
+ ledger). Read this one before changing anything security-relevant.
42
+ * `deskd.web` — the optional console (`pip install deskd[web]`).
43
+ """
44
+
45
+ from __future__ import annotations
46
+
47
+ from .config import (
48
+ CONFIG,
49
+ DEFAULT_WAKE_LADDER,
50
+ ENV_PREFIX,
51
+ PROJECT_NAME,
52
+ EngineConfig,
53
+ PromptBuilder,
54
+ RoleSpec,
55
+ WakeRung,
56
+ __version__,
57
+ configure,
58
+ env,
59
+ )
60
+
61
+ __all__ = [
62
+ # configuration — what a host touches first
63
+ "CONFIG",
64
+ "EngineConfig",
65
+ "configure",
66
+ "RoleSpec",
67
+ "PromptBuilder",
68
+ "WakeRung",
69
+ "DEFAULT_WAKE_LADDER",
70
+ "PROJECT_NAME",
71
+ "ENV_PREFIX",
72
+ "env",
73
+ "__version__",
74
+ # engine modules (imported lazily; see __getattr__)
75
+ "auth",
76
+ "mailbox",
77
+ "meetings",
78
+ "orchestration",
79
+ ]
80
+
81
+
82
+ def __getattr__(name: str):
83
+ """Expose the engine submodules as attributes, imported on first use.
84
+
85
+ Lazy on purpose. Importing `deskd` must stay cheap and side-effect-free: the
86
+ engine modules open no database at import time, but they do pull in
87
+ `cryptography` and build their schema constants, and a host that only wants
88
+ `configure()` and `RoleSpec` should not pay for that. It also keeps
89
+ `import deskd` working in an environment where an optional dependency of a
90
+ submodule is missing.
91
+ """
92
+ if name in ("auth", "mailbox", "meetings", "orchestration"):
93
+ import importlib
94
+
95
+ module = importlib.import_module(f".{name}", __name__)
96
+ globals()[name] = module
97
+ return module
98
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
deskd/__main__.py ADDED
@@ -0,0 +1,12 @@
1
+ """Entry point for `python -m deskd`.
2
+
3
+ The `deskd` console script is the normal way in, but the wake driver falls back
4
+ to `python -m deskd` when deskd is importable without having been installed with
5
+ its script on PATH (a cron environment, a checkout, a vendored copy). Both must
6
+ reach the same CLI.
7
+ """
8
+
9
+ from .cli import main
10
+
11
+ if __name__ == "__main__":
12
+ main()