azathoth-ui 1.4.0__tar.gz

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.
Files changed (60) hide show
  1. azathoth_ui-1.4.0/LICENSE +21 -0
  2. azathoth_ui-1.4.0/PKG-INFO +131 -0
  3. azathoth_ui-1.4.0/README.md +99 -0
  4. azathoth_ui-1.4.0/pyproject.toml +102 -0
  5. azathoth_ui-1.4.0/setup.cfg +4 -0
  6. azathoth_ui-1.4.0/setup.py +50 -0
  7. azathoth_ui-1.4.0/src/azathoth_ui/__init__.py +11 -0
  8. azathoth_ui-1.4.0/src/azathoth_ui/__main__.py +6 -0
  9. azathoth_ui-1.4.0/src/azathoth_ui/app.py +279 -0
  10. azathoth_ui-1.4.0/src/azathoth_ui/assets/icon.svg +4 -0
  11. azathoth_ui-1.4.0/src/azathoth_ui/assets/logo.svg +4 -0
  12. azathoth_ui-1.4.0/src/azathoth_ui/assets/page.css +172 -0
  13. azathoth_ui-1.4.0/src/azathoth_ui/browsing.py +371 -0
  14. azathoth_ui-1.4.0/src/azathoth_ui/catalog.py +410 -0
  15. azathoth_ui-1.4.0/src/azathoth_ui/cli.py +172 -0
  16. azathoth_ui-1.4.0/src/azathoth_ui/commands.py +41 -0
  17. azathoth_ui-1.4.0/src/azathoth_ui/live.py +699 -0
  18. azathoth_ui-1.4.0/src/azathoth_ui/pages.py +140 -0
  19. azathoth_ui-1.4.0/src/azathoth_ui/paths.py +80 -0
  20. azathoth_ui-1.4.0/src/azathoth_ui/py.typed +0 -0
  21. azathoth_ui-1.4.0/src/azathoth_ui/remotes.py +364 -0
  22. azathoth_ui-1.4.0/src/azathoth_ui/security.py +281 -0
  23. azathoth_ui-1.4.0/src/azathoth_ui/static/assets/fraunces-latin-ext-full-normal-YHFkNujK.woff2 +0 -0
  24. azathoth_ui-1.4.0/src/azathoth_ui/static/assets/fraunces-latin-full-normal-CFFu7zhK.woff2 +0 -0
  25. azathoth_ui-1.4.0/src/azathoth_ui/static/assets/fraunces-vietnamese-full-normal-7BpKI3vF.woff2 +0 -0
  26. azathoth_ui-1.4.0/src/azathoth_ui/static/assets/hanken-grotesk-cyrillic-ext-wght-normal-D_UHSL_T.woff2 +0 -0
  27. azathoth_ui-1.4.0/src/azathoth_ui/static/assets/hanken-grotesk-latin-ext-wght-normal-Dg-wlmqe.woff2 +0 -0
  28. azathoth_ui-1.4.0/src/azathoth_ui/static/assets/hanken-grotesk-latin-wght-normal-CaVRRdDk.woff2 +0 -0
  29. azathoth_ui-1.4.0/src/azathoth_ui/static/assets/hanken-grotesk-vietnamese-wght-normal-CHiFlh_0.woff2 +0 -0
  30. azathoth_ui-1.4.0/src/azathoth_ui/static/assets/index-B5c912CI.js +23 -0
  31. azathoth_ui-1.4.0/src/azathoth_ui/static/assets/index-D4ZZE9VD.css +1 -0
  32. azathoth_ui-1.4.0/src/azathoth_ui/static/icon.svg +4 -0
  33. azathoth_ui-1.4.0/src/azathoth_ui/static/index.html +16 -0
  34. azathoth_ui-1.4.0/src/azathoth_ui.egg-info/PKG-INFO +131 -0
  35. azathoth_ui-1.4.0/src/azathoth_ui.egg-info/SOURCES.txt +58 -0
  36. azathoth_ui-1.4.0/src/azathoth_ui.egg-info/dependency_links.txt +1 -0
  37. azathoth_ui-1.4.0/src/azathoth_ui.egg-info/entry_points.txt +2 -0
  38. azathoth_ui-1.4.0/src/azathoth_ui.egg-info/requires.txt +12 -0
  39. azathoth_ui-1.4.0/src/azathoth_ui.egg-info/top_level.txt +1 -0
  40. azathoth_ui-1.4.0/tests/test_app.py +299 -0
  41. azathoth_ui-1.4.0/tests/test_browsing.py +533 -0
  42. azathoth_ui-1.4.0/tests/test_catalog.py +665 -0
  43. azathoth_ui-1.4.0/tests/test_changelog.py +23 -0
  44. azathoth_ui-1.4.0/tests/test_checking.py +252 -0
  45. azathoth_ui-1.4.0/tests/test_ci.py +82 -0
  46. azathoth_ui-1.4.0/tests/test_cli.py +239 -0
  47. azathoth_ui-1.4.0/tests/test_commands.py +28 -0
  48. azathoth_ui-1.4.0/tests/test_docs.py +23 -0
  49. azathoth_ui-1.4.0/tests/test_live.py +761 -0
  50. azathoth_ui-1.4.0/tests/test_logo.py +59 -0
  51. azathoth_ui-1.4.0/tests/test_package.py +153 -0
  52. azathoth_ui-1.4.0/tests/test_paths.py +65 -0
  53. azathoth_ui-1.4.0/tests/test_private_code.py +158 -0
  54. azathoth_ui-1.4.0/tests/test_readme.py +38 -0
  55. azathoth_ui-1.4.0/tests/test_release.py +133 -0
  56. azathoth_ui-1.4.0/tests/test_remote_sync.py +530 -0
  57. azathoth_ui-1.4.0/tests/test_remotes.py +284 -0
  58. azathoth_ui-1.4.0/tests/test_security.py +257 -0
  59. azathoth_ui-1.4.0/tests/test_web.py +90 -0
  60. azathoth_ui-1.4.0/tests/test_wheel.py +207 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Eldritch, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,131 @@
1
+ Metadata-Version: 2.4
2
+ Name: azathoth-ui
3
+ Version: 1.4.0
4
+ Summary: A local editor for Azathoth workflows, served in your browser.
5
+ Author: Eris Discordia Montano
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/EldritchInc/azathoth-ui
8
+ Project-URL: Repository, https://github.com/EldritchInc/azathoth-ui
9
+ Keywords: artificial-intelligence,llm,workflow-editor,azathoth
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Typing :: Typed
17
+ Requires-Python: >=3.11
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: azathoth-ai==1.4.*
21
+ Requires-Dist: starlette>=0.40
22
+ Requires-Dist: uvicorn>=0.30
23
+ Provides-Extra: dev
24
+ Requires-Dist: build; extra == "dev"
25
+ Requires-Dist: httpx; extra == "dev"
26
+ Requires-Dist: mypy; extra == "dev"
27
+ Requires-Dist: pytest; extra == "dev"
28
+ Requires-Dist: ruff; extra == "dev"
29
+ Requires-Dist: setuptools>=68; extra == "dev"
30
+ Requires-Dist: wheel; extra == "dev"
31
+ Dynamic: license-file
32
+
33
+ # Azathoth UI
34
+
35
+ A local editor for [Azathoth](https://github.com/EldritchInc/azathoth)
36
+ workflows, served on your own computer and opened in your browser.
37
+
38
+ The editor keeps an Azathoth instance of its own, and drives it only through
39
+ Azathoth's public service API, `azathoth.api`, and needs Azathoth 1.4.
40
+
41
+ ## Installing it
42
+
43
+ Install it into a venv of its own, as
44
+ [Installing Azathoth](https://github.com/EldritchInc/azathoth/blob/main/docs/install.md)
45
+ shows for Azathoth, with Python 3.11 or newer:
46
+
47
+ ```bash
48
+ python -m pip install azathoth-ui
49
+ ```
50
+
51
+ pip brings Azathoth 1.4 with it, from PyPI.
52
+
53
+ ## Running it
54
+
55
+ ```bash
56
+ azathoth-ui
57
+ ```
58
+
59
+ The command creates the editor's own Azathoth instance the first time,
60
+ serves the editor on `127.0.0.1`, and opens it in your browser. It prints the
61
+ address it opened, with a key for this launch; only a browser that has opened
62
+ that address can use the editor. Press Ctrl+C to stop it.
63
+
64
+ - `--database` edits another Azathoth database, an SQLite file or a
65
+ PostgreSQL URL. `AZATHOTH_DATABASE` does the same.
66
+ - `--port` listens on one port rather than any free one.
67
+ - `--no-browser` prints the address without opening it.
68
+
69
+ Providers are configured as they are for Azathoth's own command line, through
70
+ the environment: set `OPENROUTER_API_KEY`, or `AZATHOTH_BEDROCK=1` with your
71
+ AWS credentials, before launching it. The Models page then lists what they
72
+ serve, and keeps the editor's local portfolio, the models its workflows may
73
+ use; a shared server keeps its own
74
+ ([ADR 0006](https://github.com/EldritchInc/azathoth-ui/blob/main/docs/adrs/0006-local-models-and-the-portfolio.md)).
75
+ A workflow's Run button runs it on text, JSON or a file, a PDF, an image or
76
+ text, and shows the run as it goes: each step lit on the graph as it starts
77
+ and ends, every event in words, and how it ended. A run goes on if you leave
78
+ its page, and the editor's rail points to the runs still running. Every run
79
+ is kept and listed on its workflow's page, with what each step did. While
80
+ you edit, the editor asks Azathoth what it would refuse and whether the
81
+ workflow could run here, and a step's details try that one step alone, on
82
+ the values you give its inputs, keeping nothing
83
+ ([ADR 0007](https://github.com/EldritchInc/azathoth-ui/blob/main/docs/adrs/0007-running-and-watching-workflows.md)).
84
+ The Remotes page names the shared instances your workflows ship to, each
85
+ with the environment variable its token is read from; set it before
86
+ launching the editor, which never sees the token itself. A remote's page
87
+ says where everything stands there, and pulls what it holds that you lack.
88
+ Ship, on every workflow, tool and benchmark, pushes it to a remote after
89
+ saying where it stands, and reports Azathoth's warnings of what would stop
90
+ it running there
91
+ ([ADR 0008](https://github.com/EldritchInc/azathoth-ui/blob/main/docs/adrs/0008-shipping-to-a-remote.md)).
92
+ [ADR 0001](https://github.com/EldritchInc/azathoth-ui/blob/main/docs/adrs/0001-local-server-security.md) explains how the server
93
+ keeps other sites and other users out.
94
+
95
+ ## Development
96
+
97
+ The editor is built against released Azathoth from PyPI: `make install`
98
+ takes the release `pyproject.toml` requires, and never Azathoth's own
99
+ checkout.
100
+
101
+ The web app needs Node `^20.19.0 || >=22.12.0`, and npm.
102
+
103
+ ```bash
104
+ python -m venv .venv
105
+ source .venv/bin/activate
106
+ make install
107
+ make install-web
108
+ make build-web
109
+ make check
110
+ ```
111
+
112
+ `make build-web` builds the web app into the package, where `azathoth-ui`
113
+ serves it. `make check` lints, type-checks and tests both halves: the Python
114
+ package, and the web app with ESLint, Prettier, TypeScript and Vitest. It
115
+ never runs Azathoth's own test suite.
116
+
117
+ `make wheel` builds the web app, then the wheel with it, into `dist/`.
118
+ Building a wheel refuses until the web app is built.
119
+
120
+ To work on the web app with hot reloading, start the server on a fixed port,
121
+ open the address it prints once, then start Vite and open
122
+ <http://127.0.0.1:5173>:
123
+
124
+ ```bash
125
+ azathoth-ui --port 8765 --no-browser
126
+ cd web && npm run dev
127
+ ```
128
+
129
+ ## License
130
+
131
+ MIT. See [LICENSE](https://github.com/EldritchInc/azathoth-ui/blob/main/LICENSE).
@@ -0,0 +1,99 @@
1
+ # Azathoth UI
2
+
3
+ A local editor for [Azathoth](https://github.com/EldritchInc/azathoth)
4
+ workflows, served on your own computer and opened in your browser.
5
+
6
+ The editor keeps an Azathoth instance of its own, and drives it only through
7
+ Azathoth's public service API, `azathoth.api`, and needs Azathoth 1.4.
8
+
9
+ ## Installing it
10
+
11
+ Install it into a venv of its own, as
12
+ [Installing Azathoth](https://github.com/EldritchInc/azathoth/blob/main/docs/install.md)
13
+ shows for Azathoth, with Python 3.11 or newer:
14
+
15
+ ```bash
16
+ python -m pip install azathoth-ui
17
+ ```
18
+
19
+ pip brings Azathoth 1.4 with it, from PyPI.
20
+
21
+ ## Running it
22
+
23
+ ```bash
24
+ azathoth-ui
25
+ ```
26
+
27
+ The command creates the editor's own Azathoth instance the first time,
28
+ serves the editor on `127.0.0.1`, and opens it in your browser. It prints the
29
+ address it opened, with a key for this launch; only a browser that has opened
30
+ that address can use the editor. Press Ctrl+C to stop it.
31
+
32
+ - `--database` edits another Azathoth database, an SQLite file or a
33
+ PostgreSQL URL. `AZATHOTH_DATABASE` does the same.
34
+ - `--port` listens on one port rather than any free one.
35
+ - `--no-browser` prints the address without opening it.
36
+
37
+ Providers are configured as they are for Azathoth's own command line, through
38
+ the environment: set `OPENROUTER_API_KEY`, or `AZATHOTH_BEDROCK=1` with your
39
+ AWS credentials, before launching it. The Models page then lists what they
40
+ serve, and keeps the editor's local portfolio, the models its workflows may
41
+ use; a shared server keeps its own
42
+ ([ADR 0006](https://github.com/EldritchInc/azathoth-ui/blob/main/docs/adrs/0006-local-models-and-the-portfolio.md)).
43
+ A workflow's Run button runs it on text, JSON or a file, a PDF, an image or
44
+ text, and shows the run as it goes: each step lit on the graph as it starts
45
+ and ends, every event in words, and how it ended. A run goes on if you leave
46
+ its page, and the editor's rail points to the runs still running. Every run
47
+ is kept and listed on its workflow's page, with what each step did. While
48
+ you edit, the editor asks Azathoth what it would refuse and whether the
49
+ workflow could run here, and a step's details try that one step alone, on
50
+ the values you give its inputs, keeping nothing
51
+ ([ADR 0007](https://github.com/EldritchInc/azathoth-ui/blob/main/docs/adrs/0007-running-and-watching-workflows.md)).
52
+ The Remotes page names the shared instances your workflows ship to, each
53
+ with the environment variable its token is read from; set it before
54
+ launching the editor, which never sees the token itself. A remote's page
55
+ says where everything stands there, and pulls what it holds that you lack.
56
+ Ship, on every workflow, tool and benchmark, pushes it to a remote after
57
+ saying where it stands, and reports Azathoth's warnings of what would stop
58
+ it running there
59
+ ([ADR 0008](https://github.com/EldritchInc/azathoth-ui/blob/main/docs/adrs/0008-shipping-to-a-remote.md)).
60
+ [ADR 0001](https://github.com/EldritchInc/azathoth-ui/blob/main/docs/adrs/0001-local-server-security.md) explains how the server
61
+ keeps other sites and other users out.
62
+
63
+ ## Development
64
+
65
+ The editor is built against released Azathoth from PyPI: `make install`
66
+ takes the release `pyproject.toml` requires, and never Azathoth's own
67
+ checkout.
68
+
69
+ The web app needs Node `^20.19.0 || >=22.12.0`, and npm.
70
+
71
+ ```bash
72
+ python -m venv .venv
73
+ source .venv/bin/activate
74
+ make install
75
+ make install-web
76
+ make build-web
77
+ make check
78
+ ```
79
+
80
+ `make build-web` builds the web app into the package, where `azathoth-ui`
81
+ serves it. `make check` lints, type-checks and tests both halves: the Python
82
+ package, and the web app with ESLint, Prettier, TypeScript and Vitest. It
83
+ never runs Azathoth's own test suite.
84
+
85
+ `make wheel` builds the web app, then the wheel with it, into `dist/`.
86
+ Building a wheel refuses until the web app is built.
87
+
88
+ To work on the web app with hot reloading, start the server on a fixed port,
89
+ open the address it prints once, then start Vite and open
90
+ <http://127.0.0.1:5173>:
91
+
92
+ ```bash
93
+ azathoth-ui --port 8765 --no-browser
94
+ cd web && npm run dev
95
+ ```
96
+
97
+ ## License
98
+
99
+ MIT. See [LICENSE](https://github.com/EldritchInc/azathoth-ui/blob/main/LICENSE).
@@ -0,0 +1,102 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "azathoth-ui"
7
+ version = "1.4.0"
8
+ description = "A local editor for Azathoth workflows, served in your browser."
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = { text = "MIT" }
12
+ authors = [
13
+ { name = "Eris Discordia Montano" }
14
+ ]
15
+ keywords = [
16
+ "artificial-intelligence",
17
+ "llm",
18
+ "workflow-editor",
19
+ "azathoth",
20
+ ]
21
+ classifiers = [
22
+ "Development Status :: 5 - Production/Stable",
23
+ "License :: OSI Approved :: MIT License",
24
+ "Programming Language :: Python :: 3",
25
+ "Programming Language :: Python :: 3.11",
26
+ "Programming Language :: Python :: 3.12",
27
+ "Programming Language :: Python :: 3.13",
28
+ "Typing :: Typed"
29
+ ]
30
+ dependencies = [
31
+ "azathoth-ai==1.4.*",
32
+ "starlette>=0.40",
33
+ "uvicorn>=0.30",
34
+ ]
35
+
36
+ [project.scripts]
37
+ azathoth-ui = "azathoth_ui.cli:main"
38
+
39
+ [project.urls]
40
+ Homepage = "https://github.com/EldritchInc/azathoth-ui"
41
+ Repository = "https://github.com/EldritchInc/azathoth-ui"
42
+
43
+ [project.optional-dependencies]
44
+ dev = [
45
+ "build",
46
+ "httpx",
47
+ "mypy",
48
+ "pytest",
49
+ "ruff",
50
+ "setuptools>=68",
51
+ "wheel",
52
+ ]
53
+
54
+ [tool.setuptools]
55
+ package-dir = {"" = "src"}
56
+
57
+ [tool.setuptools.packages.find]
58
+ where = ["src"]
59
+
60
+ [tool.setuptools.package-data]
61
+ azathoth_ui = ["py.typed", "assets/*", "static/**/*"]
62
+
63
+ [tool.pytest.ini_options]
64
+ testpaths = ["tests"]
65
+ pythonpath = ["."]
66
+ addopts = [
67
+ "--strict-markers",
68
+ "--strict-config",
69
+ "-ra",
70
+ ]
71
+
72
+ [tool.ruff]
73
+ line-length = 100
74
+ target-version = "py311"
75
+ src = [".", "src"]
76
+ extend-exclude = ["web"]
77
+
78
+ [tool.ruff.lint]
79
+ select = [
80
+ "E",
81
+ "F",
82
+ "I",
83
+ "UP",
84
+ "B",
85
+ "SIM",
86
+ ]
87
+
88
+ [tool.mypy]
89
+ python_version = "3.11"
90
+ strict = true
91
+ warn_unreachable = true
92
+ pretty = true
93
+
94
+ # setuptools ships no types. Only setup.py builds on it: its one command
95
+ # subclasses setuptools' build_py.
96
+ [[tool.mypy.overrides]]
97
+ module = ["setuptools", "setuptools.*"]
98
+ ignore_missing_imports = true
99
+
100
+ [[tool.mypy.overrides]]
101
+ module = ["setup"]
102
+ disallow_subclassing_any = false
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,50 @@
1
+ """The editor's build: everything is in `pyproject.toml`, except one refusal.
2
+
3
+ A wheel without the web app would install an editor that can only say it is
4
+ not built, so building one refuses until `make build-web` has put the web app
5
+ in `src/azathoth_ui/static`. An editable install, for working on the
6
+ checkout, does not need it.
7
+ """
8
+
9
+ from pathlib import Path
10
+ from typing import Final
11
+
12
+ from setuptools import setup
13
+ from setuptools.command.build_py import build_py
14
+
15
+ STATIC: Final = Path(__file__).resolve().parent / "src" / "azathoth_ui" / "static"
16
+ """Where `make build-web` builds the web app into the package."""
17
+
18
+
19
+ def require_web_app(
20
+ static: Path,
21
+ ) -> None:
22
+ """Refuse to build when one folder holds no built web app."""
23
+
24
+ index = static / "index.html"
25
+
26
+ if not index.is_file():
27
+ raise SystemExit(
28
+ f"error: {index} is missing. Run `make build-web` before building the wheel."
29
+ )
30
+
31
+
32
+ class BuildPy(build_py):
33
+ """`build_py` that refuses to build a wheel without the web app."""
34
+
35
+ def needs_web_app(self) -> bool:
36
+ """Return whether this build makes a wheel, rather than an editable install."""
37
+
38
+ return not self.editable_mode
39
+
40
+ def run(self) -> None:
41
+ """Check for the web app, then build as usual."""
42
+
43
+ if self.needs_web_app():
44
+ require_web_app(STATIC)
45
+
46
+ super().run()
47
+
48
+
49
+ if __name__ == "__main__":
50
+ setup(cmdclass={"build_py": BuildPy})
@@ -0,0 +1,11 @@
1
+ """Azathoth's local editor: a web app served on this computer, for this computer.
2
+
3
+ The editor drives an Azathoth instance of its own through the public service
4
+ API, `azathoth.api`, and never through anything else.
5
+ """
6
+
7
+ __version__ = "1.4.0"
8
+
9
+ __all__ = [
10
+ "__version__",
11
+ ]
@@ -0,0 +1,6 @@
1
+ """`python -m azathoth_ui`: the `azathoth-ui` command."""
2
+
3
+ from azathoth_ui.cli import main
4
+
5
+ if __name__ == "__main__":
6
+ raise SystemExit(main())