cycls 0.0.2.89__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,10 +1,28 @@
1
+ Metadata-Version: 2.4
2
+ Name: cycls
3
+ Version: 0.0.2.91
4
+ Summary: Distribute Intelligence
5
+ Author-email: "Mohammed J. AlRujayi" <mj@cycls.com>
6
+ Requires-Python: >=3.10
7
+ Requires-Dist: agentfs-sdk==0.4.0
8
+ Requires-Dist: cloudpickle>=3.1.1
9
+ Requires-Dist: docker>=7.1.0
10
+ Requires-Dist: email-validator>=2.0.0
11
+ Requires-Dist: fastapi>=0.111.0
12
+ Requires-Dist: httpx>=0.27.0
13
+ Requires-Dist: pyjwt>=2.8.0
14
+ Requires-Dist: uvicorn>=0.30.0
15
+ Requires-Dist: watchfiles>=1.0.0
16
+ Description-Content-Type: text/markdown
17
+
1
18
  <h3 align="center">
2
19
  Distribute Intelligence
3
20
  </h3>
4
21
 
5
22
  <h4 align="center">
6
23
  <a href="https://cycls.com">Website</a> |
7
- <a href="https://docs.cycls.com">Docs</a>
24
+ <a href="https://docs.cycls.com">Docs</a> |
25
+ <a href="docs/tutorial.md">Tutorial</a>
8
26
  </h4>
9
27
 
10
28
  <h4 align="center">
@@ -64,7 +82,7 @@ app.deploy() # Live at https://agent.cycls.ai
64
82
  pip install cycls
65
83
  ```
66
84
 
67
- Requires Docker.
85
+ Requires Docker. See the [full tutorial](docs/tutorial.md) for a comprehensive guide.
68
86
 
69
87
  ## What You Get
70
88
 
@@ -87,6 +105,8 @@ Get an API key at [cycls.com](https://cycls.com).
87
105
 
88
106
  ## Authentication & Analytics
89
107
 
108
+ See the [tutorial](docs/tutorial.md#authentication) for full auth and monetization examples.
109
+
90
110
  ```python
91
111
  @cycls.app(pip=["openai"], auth=True, analytics=True)
92
112
  async def app(context):
@@ -103,7 +123,7 @@ async def app(context):
103
123
 
104
124
  ## Native UI Components
105
125
 
106
- Yield structured objects for rich streaming responses:
126
+ Yield structured objects for rich streaming responses. See the [tutorial](docs/tutorial.md#native-ui-components) for all component types and examples.
107
127
 
108
128
  ```python
109
129
  @cycls.app()
@@ -178,7 +198,7 @@ See [docs/streaming-protocol.md](docs/streaming-protocol.md) for frontend integr
178
198
 
179
199
  ## Declarative Infrastructure
180
200
 
181
- Define your entire runtime in the decorator:
201
+ Define your entire runtime in the decorator. See the [tutorial](docs/tutorial.md#declarative-infrastructure) for more details.
182
202
 
183
203
  ```python
184
204
  @cycls.app(
@@ -249,6 +269,13 @@ Access them at `https://your-app.cycls.ai/public/logo.png`.
249
269
 
250
270
  No YAML. No Dockerfiles. No infrastructure repo. The code is the deployment.
251
271
 
272
+ ## Learn More
273
+
274
+ - [Tutorial](docs/tutorial.md) - Comprehensive guide from basics to advanced
275
+ - [Streaming Protocol](docs/streaming-protocol.md) - Frontend integration
276
+ - [Runtime](docs/runtime.md) - Containerization details
277
+ - [Examples](examples/) - Working code samples
278
+
252
279
  ## License
253
280
 
254
281
  MIT
@@ -1,25 +1,11 @@
1
- Metadata-Version: 2.4
2
- Name: cycls
3
- Version: 0.0.2.89
4
- Summary: Distribute Intelligence
5
- Author-email: "Mohammed J. AlRujayi" <mj@cycls.com>
6
- Requires-Python: >=3.9
7
- Requires-Dist: cloudpickle>=3.1.1
8
- Requires-Dist: docker>=7.1.0
9
- Requires-Dist: email-validator>=2.0.0
10
- Requires-Dist: fastapi>=0.111.0
11
- Requires-Dist: httpx>=0.27.0
12
- Requires-Dist: pyjwt>=2.8.0
13
- Requires-Dist: uvicorn>=0.30.0
14
- Description-Content-Type: text/markdown
15
-
16
1
  <h3 align="center">
17
2
  Distribute Intelligence
18
3
  </h3>
19
4
 
20
5
  <h4 align="center">
21
6
  <a href="https://cycls.com">Website</a> |
22
- <a href="https://docs.cycls.com">Docs</a>
7
+ <a href="https://docs.cycls.com">Docs</a> |
8
+ <a href="docs/tutorial.md">Tutorial</a>
23
9
  </h4>
24
10
 
25
11
  <h4 align="center">
@@ -79,7 +65,7 @@ app.deploy() # Live at https://agent.cycls.ai
79
65
  pip install cycls
80
66
  ```
81
67
 
82
- Requires Docker.
68
+ Requires Docker. See the [full tutorial](docs/tutorial.md) for a comprehensive guide.
83
69
 
84
70
  ## What You Get
85
71
 
@@ -102,6 +88,8 @@ Get an API key at [cycls.com](https://cycls.com).
102
88
 
103
89
  ## Authentication & Analytics
104
90
 
91
+ See the [tutorial](docs/tutorial.md#authentication) for full auth and monetization examples.
92
+
105
93
  ```python
106
94
  @cycls.app(pip=["openai"], auth=True, analytics=True)
107
95
  async def app(context):
@@ -118,7 +106,7 @@ async def app(context):
118
106
 
119
107
  ## Native UI Components
120
108
 
121
- Yield structured objects for rich streaming responses:
109
+ Yield structured objects for rich streaming responses. See the [tutorial](docs/tutorial.md#native-ui-components) for all component types and examples.
122
110
 
123
111
  ```python
124
112
  @cycls.app()
@@ -193,7 +181,7 @@ See [docs/streaming-protocol.md](docs/streaming-protocol.md) for frontend integr
193
181
 
194
182
  ## Declarative Infrastructure
195
183
 
196
- Define your entire runtime in the decorator:
184
+ Define your entire runtime in the decorator. See the [tutorial](docs/tutorial.md#declarative-infrastructure) for more details.
197
185
 
198
186
  ```python
199
187
  @cycls.app(
@@ -264,6 +252,13 @@ Access them at `https://your-app.cycls.ai/public/logo.png`.
264
252
 
265
253
  No YAML. No Dockerfiles. No infrastructure repo. The code is the deployment.
266
254
 
255
+ ## Learn More
256
+
257
+ - [Tutorial](docs/tutorial.md) - Comprehensive guide from basics to advanced
258
+ - [Streaming Protocol](docs/streaming-protocol.md) - Frontend integration
259
+ - [Runtime](docs/runtime.md) - Containerization details
260
+ - [Examples](examples/) - Working code samples
261
+
267
262
  ## License
268
263
 
269
264
  MIT
@@ -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))