lcode-cli 0.63.0__py3-none-any.whl → 0.63.1__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.
lcode/__init__.py CHANGED
@@ -3,7 +3,7 @@
3
3
  From a program: `from lcode import Session` (see lcode.api).
4
4
  """
5
5
 
6
- __version__ = "0.63.0"
6
+ __version__ = "0.63.1"
7
7
 
8
8
  API = ("Session", "Result", "Options", "SetupError")
9
9
 
lcode/docs/modes.md CHANGED
@@ -99,7 +99,8 @@ alone shows them.
99
99
  closes before an image arrives, the next request in image mode saves it.
100
100
  - **From scripts:** `lcode --mode image -p "a red fox in the snow --n 2"` makes the images and
101
101
  exits; with `--output json` it prints a result with the file paths, the model, the seeds, the size
102
- and the time.
102
+ and the time. It exits with `1` when no image came (no ComfyUI, a job that failed, Ctrl+C), and so
103
+ does `lcode -c -p "…"` when it carries on an image or video session.
103
104
  - **No Ollama needed:** `lcode --mode image` starts even when Ollama isn't running or the coding
104
105
  model isn't installed; `/mode code` then says what's missing.
105
106
 
lcode/docs/quickstart.md CHANGED
@@ -12,7 +12,7 @@ lcode
12
12
 
13
13
  ```text
14
14
  ╭──────────────────────────────────────────────╮
15
- │ lcode v0.63.0 — local coding agent │
15
+ │ lcode v0.63.1 — local coding agent │
16
16
  │ │
17
17
  │ model lcode-qwen3.6-35b │
18
18
  │ context 256K tokens │
lcode/repl.py CHANGED
@@ -715,9 +715,9 @@ def handle_command(agent: Agent, line: str, hardware: Hardware) -> bool:
715
715
 
716
716
 
717
717
  def repl(agent: Agent, prompt: str | None, hardware: Hardware, cont: bool = False, resume: str | None = None) -> int:
718
- """The interactive session, or with a prompt (`lcode -p`) that one request. Returns lcode's exit code: for a coding
719
- request, the one `--output json` gives (api.EXIT_CODES), so a script can tell a failed request from a done one;
720
- otherwise 0."""
718
+ """The interactive session, or with a prompt (`lcode -p`) that one request. Returns lcode's exit code, so a script
719
+ can tell a failed request from a done one: for a coding request, the one `--output json` gives (api.EXIT_CODES);
720
+ for an image or video request, 1 when it failed or was cancelled, as `lcode --mode image -p` exits; otherwise 0."""
721
721
  if cont:
722
722
  note = agent.load_latest()
723
723
  if note is None:
@@ -732,9 +732,8 @@ def repl(agent: Agent, prompt: str | None, hardware: Hardware, cont: bool = Fals
732
732
  if info:
733
733
  resume_session(agent, info)
734
734
  session_start(agent)
735
- if prompt and agent.settings.mode in ("image", "video"):
736
- respond(agent, prompt)
737
- return 0
735
+ if prompt and agent.settings.mode in ("image", "video"): # -c or --resume into an image or video session
736
+ return 0 if respond(agent, prompt) else 1
738
737
  if prompt:
739
738
  return api.EXIT_CODES.get(run_safely(agent, prompt), 1)
740
739
  banner(agent)
@@ -776,17 +775,17 @@ def repl(agent: Agent, prompt: str | None, hardware: Hardware, cont: bool = Fals
776
775
  return 0
777
776
 
778
777
 
779
- def respond(agent: Agent, line: str) -> None:
778
+ def respond(agent: Agent, line: str) -> bool:
780
779
  """What a typed request does: the coding agent works on it, or image and video mode take it (a question about
781
- lcode is answered from its manual instead)."""
780
+ lcode is answered from its manual instead). Returns whether it went through: False when it failed or was
781
+ cancelled."""
782
782
  if agent.settings.mode in ("image", "video"): # no coding model involved
783
783
  if manual.is_question(line) and not media.RAW_FLAG.search(line):
784
784
  ask_manual(agent, line, typed=True)
785
- return
786
- make_image(agent, line)
787
- return
785
+ return True
786
+ return make_image(agent, line)
788
787
  agent.console.print(Rule(style="dim"))
789
- run_safely(agent, line)
788
+ return run_safely(agent, line) == "success"
790
789
 
791
790
 
792
791
  def manual_writer(agent: Agent):
lcode/repl_media.py CHANGED
@@ -297,9 +297,9 @@ def gallery(agent: Agent, everything: bool = False) -> None:
297
297
  )
298
298
 
299
299
 
300
- def make_image(agent: Agent, prompt: str = "", options=None, run=None) -> None:
300
+ def make_image(agent: Agent, prompt: str = "", options=None, run=None) -> bool:
301
301
  """Image mode: ComfyUI makes the images (a request, or `run(cancelled, ask)`); Esc or Ctrl+C cancels them
302
- there too."""
302
+ there too. Returns whether they came: False when the request failed or was cancelled."""
303
303
  steering = Steering()
304
304
  reader = KeyReader(steering)
305
305
  reading = agent.interactive and reader.start() # Esc sets steering.pause: here it cancels
@@ -309,6 +309,7 @@ def make_image(agent: Agent, prompt: str = "", options=None, run=None) -> None:
309
309
  return answer.strip().lower() in ("y", "yes")
310
310
 
311
311
  started = time.monotonic()
312
+ made = False
312
313
  try:
313
314
  asking = ask if agent.interactive else None
314
315
  if run is not None:
@@ -317,6 +318,7 @@ def make_image(agent: Agent, prompt: str = "", options=None, run=None) -> None:
317
318
  media.request(agent, prompt, cancelled=lambda: steering.pause, ask=asking)
318
319
  else:
319
320
  media.make(agent, prompt, options, cancelled=lambda: steering.pause, ask=asking)
321
+ made = True
320
322
  except media.MediaError as e:
321
323
  agent.console.print(f"[yellow]{escape(str(e))}[/]")
322
324
  except KeyboardInterrupt: # while ComfyUI was starting: nothing queued yet
@@ -332,3 +334,4 @@ def make_image(agent: Agent, prompt: str = "", options=None, run=None) -> None:
332
334
  agent.console.print(Text("✎ What you typed is in the prompt below.", style="cyan"))
333
335
  agent.save() # the gallery and options carry over when the session is resumed
334
336
  agent.finished(prompt or "image or video", time.monotonic() - started) # a long render: notify
337
+ return made
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: lcode-cli
3
- Version: 0.63.0
3
+ Version: 0.63.1
4
4
  Summary: A local-first terminal coding agent powered by open-weight models on your own GPU or Mac, via Ollama.
5
5
  Project-URL: Homepage, https://nasser1941.github.io/lcode/
6
6
  Project-URL: Documentation, https://nasser1941.github.io/lcode/
@@ -13,16 +13,16 @@ lcode/docs/lsp.md,sha256=tou-eJFMPvAJt0_-NaCm-c4OtfgVhok4Ig8NJnj6Rhs,3405
13
13
  lcode/docs/mcp.md,sha256=Ol3ScuP4i2KsoN9xaSEbnm86Tvoc1qnUV7zkRprWwHo,15168
14
14
  lcode/docs/memory.md,sha256=XbsNnTwRdnUEYW7_2U1GHbtK0uOjTxR-s2EujgJbR0Y,6889
15
15
  lcode/docs/models.md,sha256=OE_Lp_rLHiCSWPApHqKkv2GzRb81udGJqamGdx-Gy7A,18280
16
- lcode/docs/modes.md,sha256=vNQv5K-lk6egNQNlnOHk8YeIdoAsmyaWvSu-RbQeZnQ,34039
16
+ lcode/docs/modes.md,sha256=q5ut1jR1PWnyMmXNT0cq7adCqj-bWrZDD2Y2X-L5ty0,34197
17
17
  lcode/docs/public-benchmarks.md,sha256=vYv4-kUV0RN3G-FK_YCcr2_WkIgn41kgtA_DDqwKNkA,11052
18
- lcode/docs/quickstart.md,sha256=XfFb-ad9P0_AaAD6fx5H9NOJnykyw8NrC4qIqgx7vts,3403
18
+ lcode/docs/quickstart.md,sha256=RTvGNmy94AZNjmFvyr3gILNXrc4_ClfooGSYF--NHs0,3403
19
19
  lcode/docs/sandbox.md,sha256=-_jc2I0LXKQIYCz_JOuHGaP2ehVuEqEepKqMATlFpZY,4064
20
20
  lcode/docs/search.md,sha256=1Sqkfc9NRftpcfBFG9b_D8Ns-octH399AaaSNBPHq28,4251
21
21
  lcode/docs/servers.md,sha256=0ddumHseQXx0CP0nqzgwV-493s81kdEBa6qtUYe9t6k,5718
22
22
  lcode/docs/traces.md,sha256=_rP0XIgyeiZPld4VjP-ISlyf6ZPoKQBTQPLVbyp5fUE,10201
23
23
  lcode/docs/troubleshooting.md,sha256=iD72y6GOlwLK0HNA1mxfucSU40Iwp7kGyGJa_AX1OWs,9052
24
24
  lcode/docs/usage.md,sha256=cIq3cQjnb71DRJN7JXW-DBLFC8bn9680PvU1249h_rI,52175
25
- lcode/__init__.py,sha256=HRfcHW_v0zCAVZC_M0LxOMI1ojQik5L_o-ftra6Rbsk,473
25
+ lcode/__init__.py,sha256=P4GUmWuUGc0syg6iFxtkWjnjp_qTeIutfDQe_424CF8,473
26
26
  lcode/__main__.py,sha256=s5N5pryX2FAu93GGZ3FxUrIXHWGzxz66lKUoaV_h8Ws,35
27
27
  lcode/acp.py,sha256=9S2n1ycB_IWeOv3zIbuwa6oFW2wyC-GKXcc3Jg5AfQk,30326
28
28
  lcode/action.py,sha256=wuT5F9EJCdEligPeytzmEi8FpahWBhXer528tpuTj_k,16711
@@ -91,9 +91,9 @@ lcode/preview.py,sha256=ATzEs6yaI1__bfo2_juWznrTDXUD4QTc_aQMPRCytgA,6253
91
91
  lcode/qt_hook.py,sha256=NloRd9p86Gs7r0Zmfd3g7PhR5vMzaGS7UbTO88O7pKw,14463
92
92
  lcode/render.py,sha256=gMvf4W3qkLUJ4Vot3az_hP_zRDAItJC9pP-68dHFkfA,1375
93
93
  lcode/repeats.py,sha256=2lcH25X4EIbgIfNSYyVczRvKFyKhw_DxEzXOX7lRoY0,5986
94
- lcode/repl.py,sha256=amIznYpQsTclAajSxEgH40Np-xfIc0Z4uC6SI86hQoc,39964
94
+ lcode/repl.py,sha256=t0Z1uu2HCGLF53K8TXtm39QuHgYYTdorZk10VNjzfKo,40208
95
95
  lcode/repl_history.py,sha256=gDmgWRklR0Q1FdqYidQ_7XQjXO15B1-WOBf4ReXybO0,12102
96
- lcode/repl_media.py,sha256=abBgNDzxCAXUEZTxZgS36dBdFgW3xMGJ1C6wZHJZWLY,16610
96
+ lcode/repl_media.py,sha256=FOXBnXHbs55jIEdXaFGfd6ZnDTPuGgrLOVTx3s46Jm4,16738
97
97
  lcode/repl_models.py,sha256=txLdULaDqRC0vm4Wlo5gPvneZxIaXiLFzy_gmCcvjJc,13150
98
98
  lcode/repl_sessions.py,sha256=3_3MSEZfxqH2N8-V-aH27Gqq6LibljnjXgvV_s0xiSQ,5812
99
99
  lcode/replay.py,sha256=aYtyI3TU1rag_cSYpdOFZrQ5N8gfBIW7Aj0XyksWEJY,29674
@@ -149,8 +149,8 @@ lcode/workflows/wan21-vace.json,sha256=vJsiRvLCXCjKIibOO0SGM3fT6bedAGxF8N2sN2vcP
149
149
  lcode/workflows/wan22-fun-inp-5b.json,sha256=4HbKEezik8MHvxTMP6PjQUPQPfCeSu10U9FrC-DHKYw,3327
150
150
  lcode/workflows/wan22-ti2v-5b.json,sha256=RcTehoC2pNizzlb7Ed3keJ56DiE7V5lhXmsvR2Y0smQ,3371
151
151
  lcode/workflows/z-image-turbo-t2i.json,sha256=sHsL7xnnuULOuWGYlQrDl4jOTySdAmb2T82c_cChv0s,1585
152
- lcode_cli-0.63.0.dist-info/METADATA,sha256=KZuD5R0qprx5m8H3k-XOgRJZIf4d5q0DPOSgoHcuij0,14260
153
- lcode_cli-0.63.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
154
- lcode_cli-0.63.0.dist-info/entry_points.txt,sha256=Hxsn_itbnbgft3U0FwxWdmEt0yoAV2LB-nJDnL9WT20,172
155
- lcode_cli-0.63.0.dist-info/licenses/LICENSE,sha256=JWjmoL7nNIC1XUa-dZm2hwLUgjUQMFo6k8APb0idNzs,1074
156
- lcode_cli-0.63.0.dist-info/RECORD,,
152
+ lcode_cli-0.63.1.dist-info/METADATA,sha256=6rdZty39fMGcGeH4_IB8zuE9uAUn7wfpEbrJ--ogNqc,14260
153
+ lcode_cli-0.63.1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
154
+ lcode_cli-0.63.1.dist-info/entry_points.txt,sha256=Hxsn_itbnbgft3U0FwxWdmEt0yoAV2LB-nJDnL9WT20,172
155
+ lcode_cli-0.63.1.dist-info/licenses/LICENSE,sha256=JWjmoL7nNIC1XUa-dZm2hwLUgjUQMFo6k8APb0idNzs,1074
156
+ lcode_cli-0.63.1.dist-info/RECORD,,