mycode-cli 0.5.2__py3-none-any.whl → 0.5.3__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.
mycode_cli/main.py CHANGED
@@ -196,7 +196,7 @@ def run(
196
196
  def web(
197
197
  hostname: Annotated[str, typer.Option(help="Hostname to listen on")] = "127.0.0.1",
198
198
  port: Annotated[int | None, typer.Option(help="Port to listen on")] = None,
199
- dev: Annotated[bool, typer.Option(help="API-only backend for web UI dev workflows")] = False,
199
+ dev: Annotated[bool, typer.Option(help="API-only backend with hot reload for web UI dev workflows")] = False,
200
200
  ) -> None:
201
201
  """Start the web server."""
202
202
 
@@ -206,9 +206,17 @@ def web(
206
206
 
207
207
  import uvicorn
208
208
 
209
- from mycode_cli.server.app import create_app
209
+ app_factory = "mycode_cli.server.app:create_web_app"
210
+ if dev:
211
+ app_factory = "mycode_cli.server.app:create_api_app"
210
212
 
211
- uvicorn.run(create_app(serve_web=not dev), host=hostname, port=resolved_port)
213
+ uvicorn.run(
214
+ app_factory,
215
+ host=hostname,
216
+ port=resolved_port,
217
+ reload=dev,
218
+ factory=True,
219
+ )
212
220
 
213
221
 
214
222
  @session_app.command("list")
mycode_cli/server/app.py CHANGED
@@ -49,4 +49,14 @@ def create_app(*, serve_web: bool = True) -> FastAPI:
49
49
  return application
50
50
 
51
51
 
52
+ def create_web_app() -> FastAPI:
53
+ """Create the app with packaged web assets."""
54
+ return create_app(serve_web=True)
55
+
56
+
57
+ def create_api_app() -> FastAPI:
58
+ """Create the API-only app."""
59
+ return create_app(serve_web=False)
60
+
61
+
52
62
  app = create_app()
mycode_cli/tui/render.py CHANGED
@@ -550,7 +550,7 @@ class ReplyRenderer:
550
550
 
551
551
  def _stop_tool_live(self) -> None:
552
552
  if self._tool_live is not None:
553
- self._tool_live.stop()
553
+ self._clear_live(self._tool_live)
554
554
  self._tool_live = None
555
555
 
556
556
  @staticmethod
@@ -669,12 +669,7 @@ class ReplyRenderer:
669
669
  self._thinking_collapsed = True
670
670
 
671
671
  if self._live is not None:
672
- # Rich's stop() refreshes the last renderable once more before
673
- # restoring the cursor. Blank it first so a final spinner frame
674
- # can't get stranded in terminals that occasionally miss the clear.
675
- self._live.transient = True
676
- self._live.update(Text(""))
677
- self._live.stop()
672
+ self._clear_live(self._live)
678
673
  self._live = None
679
674
 
680
675
  duration = ""
@@ -714,7 +709,7 @@ class ReplyRenderer:
714
709
  """Stop live rendering and clear transient buffers for the current phase."""
715
710
 
716
711
  if self._live is not None:
717
- self._live.stop()
712
+ self._clear_live(self._live)
718
713
  self._live = None
719
714
  self._stop_tool_live()
720
715
  self._reasoning.clear()
@@ -723,6 +718,12 @@ class ReplyRenderer:
723
718
  self._thinking_collapsed = False
724
719
  self._thinking_start_time = None
725
720
 
721
+ @staticmethod
722
+ def _clear_live(live: Live) -> None:
723
+ live.transient = True
724
+ live.update(Text(""))
725
+ live.stop()
726
+
726
727
  def _build_live_renderable(self) -> Spinner | _LeftMarkdown:
727
728
  """Build the Rich renderable used while a reply is streaming."""
728
729
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mycode-cli
3
- Version: 0.5.2
3
+ Version: 0.5.3
4
4
  Summary: Minimal coding agent CLI and web UI built on mycode-sdk.
5
5
  Project-URL: Homepage, https://github.com/legibet/mycode
6
6
  Project-URL: Repository, https://github.com/legibet/mycode
@@ -22,7 +22,7 @@ Classifier: Programming Language :: Python :: 3.13
22
22
  Classifier: Topic :: Software Development
23
23
  Requires-Python: >=3.12
24
24
  Requires-Dist: fastapi>=0.115.0
25
- Requires-Dist: mycode-sdk==0.5.2
25
+ Requires-Dist: mycode-sdk==0.5.3
26
26
  Requires-Dist: prompt-toolkit>=3.0.52
27
27
  Requires-Dist: pyyaml>=6.0.0
28
28
  Requires-Dist: rich>=14.2.0
@@ -40,7 +40,6 @@ A minimal coding agent. Inspired by [pi](https://github.com/badlogic/pi-mono).
40
40
  - 4 built-in tools only (`read`, `write`, `edit`, `bash`), expanded via skills.
41
41
  - Mobile-friendly web UI.
42
42
  - Native image and pdf input support.
43
- - Lightweight Python SDK for building custom agents.
44
43
 
45
44
  ## Quick Start
46
45
 
@@ -185,25 +184,19 @@ uv build --package mycode-cli
185
184
 
186
185
  ## mycode-sdk
187
186
 
188
- Agent core as a lightweight Python SDK for building agents. Install via: `uv add mycode-sdk`
187
+ Agent core of mycode as a lightweight Python SDK for building custom agents. Install via: `uv add mycode-sdk`
189
188
 
190
189
  ```python
191
- import asyncio
192
- from mycode import Agent, bash_tool, read_tool
193
-
194
- async def main() -> None:
195
- agent = Agent(
196
- model="claude-sonnet-4-6",
197
- api_key="...",
198
- cwd=".",
199
- system="You are a concise coding assistant.",
200
- tools=[read_tool, bash_tool],
201
- )
202
- async for event in agent.achat("Read pyproject.toml and tell me the project name."):
203
- if event.type == "text":
204
- print(event.data["delta"], end="")
205
-
206
- asyncio.run(main())
190
+ from mycode import Agent, read_tool
191
+
192
+ agent = Agent(
193
+ model="claude-sonnet-4-6",
194
+ api_key="...",
195
+ tools=[read_tool],
196
+ )
197
+
198
+ result = agent.run("Read pyproject.toml and tell me the project name.")
199
+ print(result.text)
207
200
  ```
208
201
 
209
202
  See [mycode/README.md](mycode/README.md) for details.
@@ -1,10 +1,10 @@
1
1
  mycode_cli/__init__.py,sha256=qsnZt6kWVPR_j5x_544x9vs1nyKuqC_tq1J1La7spYE,78
2
2
  mycode_cli/config.py,sha256=Zd7TmgZYN91EL7O5N3XuvO4GM3XPQ0L7BQP4MJ_4YZo,17299
3
- mycode_cli/main.py,sha256=zkQ56CGpnNMv91miqsM6EFpztE_zQ9LnZ10r94lf8HI,7325
3
+ mycode_cli/main.py,sha256=5X9pSaKOEfDyo43aDut05_piSecJDh7Clv4brGv2a8I,7477
4
4
  mycode_cli/runtime.py,sha256=Th8QF9Fm62pAPLdTxS6El4XtHME46q5wSJznIU576n0,8657
5
5
  mycode_cli/system_prompt.py,sha256=M8xTJ24bjU7JqlWf29u4nBegVokBncAND6Re5y4QXoo,10549
6
6
  mycode_cli/server/__init__.py,sha256=Bt8J0HJdkPdE2VQl7zjnEjofriUHksen5tHQ8agw7RM,32
7
- mycode_cli/server/app.py,sha256=9QvJC6e1-QwrLaRYrYNKxYp6Iylv_ZreoEWphH4rPTk,1448
7
+ mycode_cli/server/app.py,sha256=N1zUM1iQbIYcpwneHbFAdgo-ucQkoOw5mXbzItnz9GY,1681
8
8
  mycode_cli/server/deps.py,sha256=BcNTWoZ1wMMll-6un6wGaRDI_83wR6VYgugcjw2O9GA,733
9
9
  mycode_cli/server/run_manager.py,sha256=VcSk0g9-OwwYIoafBwofq3Qt-L7LSzpPMX-cB4ho-HY,6243
10
10
  mycode_cli/server/schemas.py,sha256=v9qdOgDE5zKVNpPL5K9sVPQd--uQXMTXTwSthF4ahEg,1711
@@ -379,10 +379,10 @@ mycode_cli/server/static/assets/zenscript-DVFEvuxE.js,sha256=WKgS641xEh7jvW5RO4o
379
379
  mycode_cli/server/static/assets/zig-VOosw3JB.js,sha256=fDaSkledibeB6Rt2pN8b-6YEKHx6XixCaSWTXvCMCEE,5340
380
380
  mycode_cli/tui/__init__.py,sha256=5sPlJS3c8HdNEBwcF0bUuj8f8brAD-_6MNmF4Q_1Edg,69
381
381
  mycode_cli/tui/chat.py,sha256=iW0xC5SVyTOiVnTbm3joyAlMrv_ZL6JrMTTWbU7d4aU,25171
382
- mycode_cli/tui/render.py,sha256=mp59CieMVUGYpdLXE-uwPoUvgcTyfJUHAjQq_x1JKd0,26633
382
+ mycode_cli/tui/render.py,sha256=mravf5NPpinmiiIBaO5_E6u6VolpW2fb8dX7uEaM9YM,26495
383
383
  mycode_cli/tui/theme.py,sha256=HS3C1kSoIONrSaiSx22AWRLk1n6-T-Tn5iohCMewAg4,3455
384
- mycode_cli-0.5.2.dist-info/METADATA,sha256=yUyMeOM1Ia4PPHcLuRD4TuU1cpVppVxdkK2ZEVo6mSo,6416
385
- mycode_cli-0.5.2.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
386
- mycode_cli-0.5.2.dist-info/entry_points.txt,sha256=1R7YN8dxJUy5AMC4q2J5Ly9xuEom3ZbTaa8xXwxuZyk,48
387
- mycode_cli-0.5.2.dist-info/licenses/LICENSE,sha256=DSE6T-B9WhrWypr6H7y2kTZzoF1tef5xf7veUyImQsM,1064
388
- mycode_cli-0.5.2.dist-info/RECORD,,
384
+ mycode_cli-0.5.3.dist-info/METADATA,sha256=95BaXoAXSdDOaBEdB4LgUjhXtfG_mxGvFpRkhL4t_E4,6128
385
+ mycode_cli-0.5.3.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
386
+ mycode_cli-0.5.3.dist-info/entry_points.txt,sha256=1R7YN8dxJUy5AMC4q2J5Ly9xuEom3ZbTaa8xXwxuZyk,48
387
+ mycode_cli-0.5.3.dist-info/licenses/LICENSE,sha256=DSE6T-B9WhrWypr6H7y2kTZzoF1tef5xf7veUyImQsM,1064
388
+ mycode_cli-0.5.3.dist-info/RECORD,,