zettcode-sdk 0.3.4__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.
- zettcode/daemon/__init__.py +17 -0
- zettcode/daemon/__main__.py +10 -0
- zettcode/daemon/cli.py +693 -0
- zettcode/daemon/companions.py +63 -0
- zettcode/daemon/process.py +559 -0
- zettcode/daemon/run.py +678 -0
- zettcode/daemon/state.py +356 -0
- zettcode/doctor.py +167 -0
- zettcode/mentions.py +320 -0
- zettcode/sdk/__init__.py +195 -0
- zettcode/sdk/builtins.py +608 -0
- zettcode/sdk/client.py +1810 -0
- zettcode/sdk/commands.py +9 -0
- zettcode/sdk/daemons.py +244 -0
- zettcode/sdk/errors.py +132 -0
- zettcode/sdk/events.py +434 -0
- zettcode/sdk/extensions/__init__.py +6 -0
- zettcode/sdk/extensions/mcp.py +276 -0
- zettcode/sdk/extensions/messaging.py +281 -0
- zettcode/sdk/handlers.py +126 -0
- zettcode/sdk/messenger.py +299 -0
- zettcode/sdk/models.py +156 -0
- zettcode/sdk/py.typed +0 -0
- zettcode/sdk/session.py +1212 -0
- zettcode/sdk/translation.py +384 -0
- zettcode/sdk/types.py +907 -0
- zettcode/table.py +95 -0
- zettcode_sdk-0.3.4.dist-info/METADATA +21 -0
- zettcode_sdk-0.3.4.dist-info/RECORD +30 -0
- zettcode_sdk-0.3.4.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Background agents: a session with nobody at the keyboard, which other sessions reach with ``send_message``.
|
|
2
|
+
|
|
3
|
+
zettcode daemon spawn # start one; it prints the session id it is messaged by
|
|
4
|
+
zettcode daemon list # every daemon on this machine, alive or dead
|
|
5
|
+
zettcode daemon kill <id> # stop one, and remove its record; the session stays
|
|
6
|
+
|
|
7
|
+
A daemon is an ordinary session — stored where every session is, resumable in the terminal afterwards — plus a
|
|
8
|
+
record of its process under ``~/.zettcode/daemon/<workspace>/<session-id>/`` (:mod:`.state`) and the loop that
|
|
9
|
+
answers messages (:mod:`.run`). :mod:`.process` starts it detached and stops it; :mod:`.cli` is the command.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
#: The shell levels a daemon can be given. There is no ``ask``: nobody is there to answer it.
|
|
15
|
+
PERMISSIONS = ("deny", "safe", "full")
|
|
16
|
+
|
|
17
|
+
__all__ = ["PERMISSIONS", "cli", "process", "run", "state"]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""``python -m zettcode.daemon``: what ``daemon spawn`` starts, and nothing a reader calls by hand."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
from .cli import daemon_program
|
|
8
|
+
|
|
9
|
+
if __name__ == "__main__":
|
|
10
|
+
raise SystemExit(daemon_program(sys.argv[1:]))
|