seren-kitchen 0.5.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.
@@ -0,0 +1,25 @@
1
+ """seren_kitchen - the kitchen.
2
+
3
+ One fridge per Seren app, in that app's own colour. On the door: a magnet for
4
+ whoever is holding the repo right now, and the sheets we leave each other
5
+ (honey-do now, a note to the person, a note to the partner, art). Inside, on the
6
+ shelves: the longer lists, the decisions waiting on someone, and the leftovers
7
+ (what got done). A decision left too long goes off like milk.
8
+
9
+ It is a shared surface, not a memory: a partner's own stores (Memory, Loci, the
10
+ Margin) are theirs alone, and nothing here reads or writes them. The kitchen is
11
+ where the people who share a house leave each other notes.
12
+ """
13
+ from __future__ import annotations
14
+
15
+ try: # the setuptools-scm build artifact (gitignored); present in installed wheels
16
+ from ._version import version as __version__
17
+ except Exception: # source checkout without a build -> metadata, then dev fallback
18
+ try:
19
+ from importlib.metadata import version as _v
20
+
21
+ __version__ = _v("seren-kitchen")
22
+ except Exception:
23
+ __version__ = "0.0.0.dev0"
24
+
25
+ __all__ = ["__version__"]
@@ -0,0 +1,51 @@
1
+ """Entry point for `python -m seren_kitchen` or the `seren-kitchen` script.
2
+
3
+ --config / -c like the rest of the family; --describe answers before anything
4
+ heavy is imported, so a broken install can still say its own name.
5
+ """
6
+ from __future__ import annotations
7
+
8
+ import argparse
9
+ import json
10
+ import sys
11
+
12
+
13
+ def _force_utf8_stdio() -> None:
14
+ for stream in (sys.stdout, sys.stderr):
15
+ try:
16
+ stream.reconfigure(encoding="utf-8") # type: ignore[union-attr]
17
+ except (AttributeError, ValueError):
18
+ pass
19
+
20
+
21
+ def main() -> None:
22
+ _force_utf8_stdio()
23
+ if "--describe" in sys.argv[1:]:
24
+ from ._describe import DESCRIBE
25
+ print(json.dumps(DESCRIBE))
26
+ raise SystemExit(0)
27
+
28
+ parser = argparse.ArgumentParser(prog="seren_kitchen",
29
+ description="SerenKitchen - a fridge per app, and the notes we leave each other.")
30
+ parser.add_argument("--config", "-c", default=None,
31
+ help="Path to seren-kitchen.yaml (default: $SEREN_KITCHEN_CONFIG, then "
32
+ "~/seren-kitchen/seren-kitchen.yaml, then built-in defaults).")
33
+ args = parser.parse_args()
34
+
35
+ import uvicorn
36
+ from seren_meninges.exposure import enforce_server
37
+
38
+ from ._diag import diag
39
+ from .app import create_app
40
+ from .config import load_config
41
+
42
+ cfg = load_config(args.config)
43
+ enforce_server(cfg.server, service="seren-kitchen", env_prefix="SEREN_KITCHEN", log=diag)
44
+ app = create_app(cfg)
45
+ diag(f"[seren-kitchen] the kitchen at http://{cfg.host}:{cfg.port}/viewer")
46
+ diag(f"[seren-kitchen] {len(cfg.fridges)} fridges on the wall; sheets kept in {cfg.state_path}")
47
+ uvicorn.run(app, host=cfg.host, port=cfg.port, log_level="info")
48
+
49
+
50
+ if __name__ == "__main__":
51
+ main()
@@ -0,0 +1,37 @@
1
+ """The family, as fridges: every Seren app with the colour its own Starwright card
2
+ declares (each card's `--describe`). A kitchen's yaml can
3
+ add fridges, drop them, or recolour one; this is what it starts with.
4
+
5
+ STDLIB ONLY: the config reads it before anything else is up.
6
+ """
7
+ from __future__ import annotations
8
+
9
+ # name, display, group, accent, GitHub repo
10
+ CONSTELLATION = [
11
+ ("seren-lodestar", "Lodestar", "core", "#F5D76E", "ChadRoesler/SerenLodestar"),
12
+ ("seren-observatory", "Observatory", "core", "#f59056", "ChadRoesler/SerenObservatory"),
13
+ ("seren-workbench", "Workbench", "core", "#afdbdb", "ChadRoesler/SerenWorkbench"),
14
+ ("seren-memory", "Memory", "brain", "#ff6e8a", "ChadRoesler/SerenMemory"),
15
+ ("seren-loci", "Loci", "brain", "#5bc8e8", "ChadRoesler/SerenLoci"),
16
+ ("seren-corpus-callosum", "Corpus Callosum", "brain", "#9d7cff", "ChadRoesler/SerenCorpusCallosum"),
17
+ ("seren-hippocampus", "Hippocampus", "brain", "#c9a0dc", "ChadRoesler/SerenHippocampus"),
18
+ ("seren-margin", "Margin", "auxiliary", "#d1cbba", "ChadRoesler/SerenMargin"),
19
+ ("seren-probe", "Probe", "auxiliary", "#8fffb4", "ChadRoesler/SerenProbe"),
20
+ ("seren-theatre", "Theatre", "auxiliary", "#6d2823", "ChadRoesler/SerenTheatre"),
21
+ ("seren-lyceum", "Lyceum", "auxiliary", "#a17056", "ChadRoesler/SerenLyceum"),
22
+ ("seren-soma", "Soma", "auxiliary", "#8fbf88", "ChadRoesler/SerenSoma"),
23
+ ("seren-psycheion", "Psycheion", "auxiliary", "#f2aeb1", "ChadRoesler/SerenPsycheion"),
24
+ # "Kitchen Repo", not "Kitchen": the room holds every fridge, this fridge holds the room's own code
25
+ ("seren-kitchen", "Kitchen Repo", "auxiliary", "#e0514b", "ChadRoesler/SerenKitchen"),
26
+ ("seren-symposium", "Symposium", "desktop", "#a3b18a", "ChadRoesler/SerenSymposium"),
27
+ ("seren-carabiner", "Carabiner", "carabiners", "#2f6fb3", "ChadRoesler/SerenCarabiners"),
28
+ ("seren-starwright", "Starwright", "installer", "#d9b382", "ChadRoesler/SerenStarwright"),
29
+ ("seren-sinew", "Sinew", "library", "#c4c4c4", "ChadRoesler/SerenSinew"),
30
+ ("seren-meninges", "Meninges", "library", "#b8b8c8", "ChadRoesler/SerenMeninges"),
31
+ # the house itself: its sheets live on the big fridge's door and freezer, not on a polaroid
32
+ ("seren-project", "The House", "project", "#c9c2d6", ""),
33
+ ]
34
+
35
+
36
+ def default_fridges() -> list[dict]:
37
+ return [{"name": n, "display": d, "group": g, "accent": a, "repo": r} for n, d, g, a, r in CONSTELLATION]
@@ -0,0 +1,40 @@
1
+ """SerenKitchen's identity card. STDLIB ONLY - nothing imported, nothing read.
2
+
3
+ What an INSTALLED Kitchen answers to `--describe`, so it can be compared with
4
+ its Starwright card once that exists. Standard library only, for the reason
5
+ every Seren card is: the moment you most want a thing to say its own name is
6
+ when its install is broken.
7
+ """
8
+ from __future__ import annotations
9
+
10
+ NAME = "seren-kitchen"
11
+ DISPLAY = "Seren Kitchen"
12
+ DESCRIPTION = ("The kitchen: a fridge per Seren app, magnets for whoever holds it, "
13
+ "and the notes we leave each other.")
14
+
15
+ # 7431: after Probe (7430), the next free slot in the family band.
16
+ PORT = 7431
17
+
18
+ GROUP = "auxiliary"
19
+
20
+ # Tomato: a fridge-magnet red that no other app in the family wears.
21
+ ACCENT = "#e0514b"
22
+
23
+ # Nothing to install first. The freezer's facts (releases, builds) arrive over
24
+ # HTTP from whoever knows them; a kitchen with no fridges configured still
25
+ # serves its page and says so.
26
+ REQUIRES: tuple = ()
27
+ EXTRAS: tuple = ()
28
+
29
+ DESCRIBE = {
30
+ "schema_version": 1,
31
+ "name": NAME,
32
+ "display": DISPLAY,
33
+ "description": DESCRIPTION,
34
+ "port": PORT,
35
+ "group": GROUP,
36
+ "accent": ACCENT,
37
+ "package": "seren-kitchen",
38
+ "requires": list(REQUIRES),
39
+ "extras": list(EXTRAS),
40
+ }
seren_kitchen/_diag.py ADDED
@@ -0,0 +1,18 @@
1
+ """Startup diagnostics that survive a nulled stdout (parity with SerenTheatre's
2
+ and SerenMargin's _diag): `pythonw` nulls sys.stdout, and a write to a closed
3
+ stream would end the run. Print, but never let printing be what kills it."""
4
+ from __future__ import annotations
5
+
6
+ import sys
7
+
8
+
9
+ def diag(message: str) -> None:
10
+ for stream in (sys.stdout, sys.stderr):
11
+ try:
12
+ if stream is None:
13
+ continue
14
+ stream.write(message + "\n")
15
+ stream.flush()
16
+ return
17
+ except Exception: # noqa: BLE001 - a broken stream must not be fatal
18
+ continue
@@ -0,0 +1,24 @@
1
+ # file generated by vcs-versioning
2
+ # don't change, don't track in version control
3
+ from __future__ import annotations
4
+
5
+ __all__ = [
6
+ "__version__",
7
+ "__version_tuple__",
8
+ "version",
9
+ "version_tuple",
10
+ "__commit_id__",
11
+ "commit_id",
12
+ ]
13
+
14
+ version: str
15
+ __version__: str
16
+ __version_tuple__: tuple[int | str, ...]
17
+ version_tuple: tuple[int | str, ...]
18
+ commit_id: str | None
19
+ __commit_id__: str | None
20
+
21
+ __version__ = version = '0.5.0'
22
+ __version_tuple__ = version_tuple = (0, 5, 0)
23
+
24
+ __commit_id__ = commit_id = 'g26cbdea36'