cycls 0.0.2.89__py3-none-any.whl → 0.0.2.91__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.
- cycls/app.py +5 -4
- cycls/state.py +6 -0
- cycls/themes/default/assets/index-BbLcHBku.js +435 -0
- cycls/themes/default/index.html +6 -2
- cycls/web.py +33 -25
- {cycls-0.0.2.89.dist-info → cycls-0.0.2.91.dist-info}/METADATA +18 -6
- cycls-0.0.2.91.dist-info/RECORD +15 -0
- cycls/themes/default/assets/index-C2r4Daz3.js +0 -435
- cycls/themes/default/assets/index-DWGS8zpa.css +0 -1
- cycls/themes/defaultN/assets/index-DOmNqb-2.js +0 -435
- cycls/themes/defaultN/index.html +0 -32
- cycls-0.0.2.89.dist-info/RECORD +0 -17
- /cycls/themes/{defaultN → default}/assets/index-oGkkm3Z8.css +0 -0
- {cycls-0.0.2.89.dist-info → cycls-0.0.2.91.dist-info}/WHEEL +0 -0
- {cycls-0.0.2.89.dist-info → cycls-0.0.2.91.dist-info}/entry_points.txt +0 -0
cycls/app.py
CHANGED
|
@@ -14,12 +14,14 @@ class App(Function):
|
|
|
14
14
|
"""App extends Function with web UI serving capabilities."""
|
|
15
15
|
|
|
16
16
|
def __init__(self, func, name, theme="default", pip=None, apt=None, copy=None, copy_public=None,
|
|
17
|
-
auth=False, org=None, header=None, intro=None, title=None, plan="free", analytics=False
|
|
17
|
+
auth=False, org=None, header=None, intro=None, title=None, plan="free", analytics=False,
|
|
18
|
+
state=False):
|
|
18
19
|
if theme not in THEMES:
|
|
19
20
|
raise ValueError(f"Unknown theme: {theme}. Available: {THEMES}")
|
|
20
21
|
self.user_func = func
|
|
21
22
|
self.theme = theme
|
|
22
23
|
self.copy_public = copy_public or []
|
|
24
|
+
self.state = state
|
|
23
25
|
|
|
24
26
|
self.config = Config(
|
|
25
27
|
header=header,
|
|
@@ -29,6 +31,7 @@ class App(Function):
|
|
|
29
31
|
plan=plan,
|
|
30
32
|
analytics=analytics,
|
|
31
33
|
org=org,
|
|
34
|
+
state=state,
|
|
32
35
|
)
|
|
33
36
|
|
|
34
37
|
# Build files dict for Function (theme is inside cycls/)
|
|
@@ -39,7 +42,7 @@ class App(Function):
|
|
|
39
42
|
super().__init__(
|
|
40
43
|
func=func,
|
|
41
44
|
name=name,
|
|
42
|
-
pip=["fastapi[standard]", "pyjwt", "cryptography", "uvicorn", "python-dotenv", "docker", *(pip or [])],
|
|
45
|
+
pip=["fastapi[standard]", "pyjwt", "cryptography", "uvicorn", "python-dotenv", "docker", "agentfs-sdk", "pyturso==0.4.0rc17", *(pip or [])],
|
|
43
46
|
apt=apt,
|
|
44
47
|
copy=files,
|
|
45
48
|
base_url=_get_base_url(),
|
|
@@ -51,7 +54,6 @@ class App(Function):
|
|
|
51
54
|
|
|
52
55
|
def _prepare_func(self, prod):
|
|
53
56
|
self.config.set_prod(prod)
|
|
54
|
-
self.config.debug = not prod # debug=True in local mode
|
|
55
57
|
self.config.public_path = f"cycls/themes/{self.theme}"
|
|
56
58
|
user_func, config, name = self.user_func, self.config, self.name
|
|
57
59
|
self.func = lambda port: __import__("cycls").web.serve(user_func, config, name, port)
|
|
@@ -61,7 +63,6 @@ class App(Function):
|
|
|
61
63
|
print(f"Starting local server at localhost:{port}")
|
|
62
64
|
self.config.public_path = str(CYCLS_PATH.joinpath(f"themes/{self.theme}"))
|
|
63
65
|
self.config.set_prod(False)
|
|
64
|
-
self.config.debug = True
|
|
65
66
|
uvicorn.run(web(self.user_func, self.config), host="0.0.0.0", port=port)
|
|
66
67
|
|
|
67
68
|
def local(self, port=8080, watch=True):
|