cycls 0.0.2.90__tar.gz → 0.0.2.91__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.
@@ -1,9 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cycls
3
- Version: 0.0.2.90
3
+ Version: 0.0.2.91
4
4
  Summary: Distribute Intelligence
5
5
  Author-email: "Mohammed J. AlRujayi" <mj@cycls.com>
6
- Requires-Python: >=3.9
6
+ Requires-Python: >=3.10
7
+ Requires-Dist: agentfs-sdk==0.4.0
7
8
  Requires-Dist: cloudpickle>=3.1.1
8
9
  Requires-Dist: docker>=7.1.0
9
10
  Requires-Dist: email-validator>=2.0.0
@@ -11,6 +12,7 @@ Requires-Dist: fastapi>=0.111.0
11
12
  Requires-Dist: httpx>=0.27.0
12
13
  Requires-Dist: pyjwt>=2.8.0
13
14
  Requires-Dist: uvicorn>=0.30.0
15
+ Requires-Dist: watchfiles>=1.0.0
14
16
  Description-Content-Type: text/markdown
15
17
 
16
18
  <h3 align="center">
@@ -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):
@@ -0,0 +1,6 @@
1
+ from agentfs_sdk import AgentFS, AgentFSOptions
2
+
3
+
4
+ async def create_state(user_id: str = "default"):
5
+ """Create state instance scoped to end-user."""
6
+ return await AgentFS.open(AgentFSOptions(id=user_id))