lcode-cli 0.47.0__tar.gz → 0.48.0__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.
Files changed (211) hide show
  1. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/CHANGELOG.md +13 -1
  2. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/PKG-INFO +1 -1
  3. lcode_cli-0.48.0/docs/assets/film-fox-and-kitten.jpg +0 -0
  4. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/modes.md +44 -1
  5. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/quickstart.md +1 -1
  6. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/usage.md +1 -0
  7. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/__init__.py +1 -1
  8. lcode_cli-0.48.0/src/lcode/film.py +316 -0
  9. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/repl.py +67 -0
  10. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_comfy.py +3 -1
  11. lcode_cli-0.48.0/tests/test_film.py +154 -0
  12. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/.editorconfig +0 -0
  13. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/.github/CODEOWNERS +0 -0
  14. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  15. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  16. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  17. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/.github/ISSUE_TEMPLATE/model_request.yml +0 -0
  18. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  19. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/.github/dependabot.yml +0 -0
  20. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/.github/workflows/ci.yml +0 -0
  21. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/.github/workflows/docs.yml +0 -0
  22. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/.github/workflows/release.yml +0 -0
  23. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/.gitignore +0 -0
  24. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/.pre-commit-config.yaml +0 -0
  25. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/AGENTS.md +0 -0
  26. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/CODE_OF_CONDUCT.md +0 -0
  27. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/CONTRIBUTING.md +0 -0
  28. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/LICENSE +0 -0
  29. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/README.md +0 -0
  30. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/SECURITY.md +0 -0
  31. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/action.yml +0 -0
  32. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/agents.md +0 -0
  33. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/assets/demo.svg +0 -0
  34. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/assets/extra.css +0 -0
  35. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/automation.md +0 -0
  36. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/bench.md +0 -0
  37. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/changelog.md +0 -0
  38. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/commands.md +0 -0
  39. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/configuration.md +0 -0
  40. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/contributing.md +0 -0
  41. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/editors.md +0 -0
  42. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/git.md +0 -0
  43. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/hooks.md +0 -0
  44. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/how-it-works.md +0 -0
  45. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/index.md +0 -0
  46. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/installation.md +0 -0
  47. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/lsp.md +0 -0
  48. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/mcp.md +0 -0
  49. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/memory.md +0 -0
  50. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/models.md +0 -0
  51. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/sandbox.md +0 -0
  52. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/search.md +0 -0
  53. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/servers.md +0 -0
  54. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/docs/troubleshooting.md +0 -0
  55. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/examples/README.md +0 -0
  56. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/examples/api/fix_tests.py +0 -0
  57. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/examples/commands/review.md +0 -0
  58. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/examples/skills/commit-message/SKILL.md +0 -0
  59. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/examples/skills/commit-message/scripts/staged.sh +0 -0
  60. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/install.sh +0 -0
  61. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/mkdocs.yml +0 -0
  62. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/overrides/main.html +0 -0
  63. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/pyproject.toml +0 -0
  64. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/scripts/make_logos.py +0 -0
  65. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/scripts/record_demo.py +0 -0
  66. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/scripts/social-preview.html +0 -0
  67. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/__main__.py +0 -0
  68. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/acp.py +0 -0
  69. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/action.py +0 -0
  70. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/agent.py +0 -0
  71. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/api.py +0 -0
  72. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/assistant.py +0 -0
  73. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/backends.py +0 -0
  74. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/bench.py +0 -0
  75. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/bench_backend.py +0 -0
  76. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/bench_runtime.py +0 -0
  77. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/catalog.py +0 -0
  78. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/checkpoints.py +0 -0
  79. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/checks.py +0 -0
  80. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/cli.py +0 -0
  81. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/clipboard.py +0 -0
  82. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/cloud.py +0 -0
  83. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/codesearch.py +0 -0
  84. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/comfy.py +0 -0
  85. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/config.py +0 -0
  86. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/context.py +0 -0
  87. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/edits.py +0 -0
  88. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/escalate.py +0 -0
  89. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/extensions.py +0 -0
  90. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/frontmatter.py +0 -0
  91. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/gitflow.py +0 -0
  92. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/hardware.py +0 -0
  93. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/hooks.py +0 -0
  94. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/imageopts.py +0 -0
  95. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/jobs.py +0 -0
  96. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/limits.py +0 -0
  97. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/lsp.py +0 -0
  98. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/matching.py +0 -0
  99. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/mcp/__init__.py +0 -0
  100. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/mcp/auth.py +0 -0
  101. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/mcp/catalog.py +0 -0
  102. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/mcp/catalog.toml +0 -0
  103. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/mcp/client.py +0 -0
  104. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/mcp/commands.py +0 -0
  105. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/mcp/config.py +0 -0
  106. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/mcp/http.py +0 -0
  107. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/mcp/manager.py +0 -0
  108. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/mcp/protocol.py +0 -0
  109. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/mcp/server.py +0 -0
  110. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/mcp/stdio.py +0 -0
  111. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/media.py +0 -0
  112. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/media.toml +0 -0
  113. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/media_catalog.py +0 -0
  114. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/memory.py +0 -0
  115. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/models.toml +0 -0
  116. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/modes.py +0 -0
  117. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/notify.py +0 -0
  118. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/ollama.py +0 -0
  119. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/permissions.py +0 -0
  120. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/planning.py +0 -0
  121. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/preview.py +0 -0
  122. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/render.py +0 -0
  123. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/repeats.py +0 -0
  124. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/repomap.py +0 -0
  125. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/residency.py +0 -0
  126. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/review.py +0 -0
  127. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/sandbox.py +0 -0
  128. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/screenshots.py +0 -0
  129. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/secretscan.py +0 -0
  130. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/servers/__init__.py +0 -0
  131. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/servers/encord.py +0 -0
  132. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/servers/valohai.py +0 -0
  133. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/servers/xai.py +0 -0
  134. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/sessions.py +0 -0
  135. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/steer.py +0 -0
  136. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/subagents.py +0 -0
  137. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/tools.py +0 -0
  138. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/unreachable.py +0 -0
  139. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/update.py +0 -0
  140. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/vision.py +0 -0
  141. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/web.py +0 -0
  142. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/workflows/__init__.py +0 -0
  143. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/workflows/flux2-klein-4b-t2i.json +0 -0
  144. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/workflows/remove-background.json +0 -0
  145. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/workflows/smooth-film.json +0 -0
  146. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/workflows/sound-stable-audio.json +0 -0
  147. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/workflows/upscale-esrgan.json +0 -0
  148. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/workflows/upscale-video-esrgan.json +0 -0
  149. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/workflows/wan21-fun-camera.json +0 -0
  150. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/workflows/wan21-vace.json +0 -0
  151. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/workflows/wan22-fun-inp-5b.json +0 -0
  152. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/workflows/wan22-ti2v-5b.json +0 -0
  153. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/src/lcode/workflows/z-image-turbo-t2i.json +0 -0
  154. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/comfy_standin.py +0 -0
  155. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/conftest.py +0 -0
  156. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/fake_lsp_server.py +0 -0
  157. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/fake_mcp_server.py +0 -0
  158. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_acp.py +0 -0
  159. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_action.py +0 -0
  160. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_agent.py +0 -0
  161. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_api.py +0 -0
  162. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_assistant.py +0 -0
  163. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_backends.py +0 -0
  164. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_bench.py +0 -0
  165. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_catalog.py +0 -0
  166. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_checkpoints.py +0 -0
  167. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_checks.py +0 -0
  168. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_cli.py +0 -0
  169. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_clipboard.py +0 -0
  170. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_cloud.py +0 -0
  171. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_codesearch.py +0 -0
  172. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_config.py +0 -0
  173. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_context.py +0 -0
  174. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_context_picker.py +0 -0
  175. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_escalate.py +0 -0
  176. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_extensions.py +0 -0
  177. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_gitflow.py +0 -0
  178. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_hooks.py +0 -0
  179. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_image_edit.py +0 -0
  180. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_image_generate.py +0 -0
  181. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_jobs.py +0 -0
  182. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_look.py +0 -0
  183. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_lsp.py +0 -0
  184. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_matching.py +0 -0
  185. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_mcp.py +0 -0
  186. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_media_catalog.py +0 -0
  187. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_memory.py +0 -0
  188. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_model_picker.py +0 -0
  189. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_modes.py +0 -0
  190. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_permissions.py +0 -0
  191. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_plan_mode.py +0 -0
  192. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_repeats.py +0 -0
  193. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_repomap.py +0 -0
  194. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_residency.py +0 -0
  195. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_review.py +0 -0
  196. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_robustness.py +0 -0
  197. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_sandbox.py +0 -0
  198. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_screenshots.py +0 -0
  199. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_secretscan.py +0 -0
  200. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_servers.py +0 -0
  201. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_sessions.py +0 -0
  202. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_steer.py +0 -0
  203. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_stuck.py +0 -0
  204. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_subagents.py +0 -0
  205. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_tools.py +0 -0
  206. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_update.py +0 -0
  207. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_video.py +0 -0
  208. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_vision.py +0 -0
  209. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_web.py +0 -0
  210. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/tests/test_xai.py +0 -0
  211. {lcode_cli-0.47.0 → lcode_cli-0.48.0}/uv.lock +0 -0
@@ -6,6 +6,17 @@ All notable changes to lcode are documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.48.0] - 2026-10-24
10
+
11
+ ### Added
12
+
13
+ - **Films** (#155): `/film a fox finds a lost kitten --shots 3` makes a short film with the same
14
+ characters in every shot. The prompt assistant writes the storyboard (saved, editable); each
15
+ character gets a reference picture; each shot starts from a keyframe made with the cast as
16
+ references and is animated; the shots are joined with cuts or fades, with an optional sound
17
+ track. `/film shot 2` remakes one shot, `/film stitch` joins again. A real 3-shot film took 4
18
+ minutes on a 12 GB laptop GPU. See [Films](https://nasser1941.github.io/lcode/modes/#films).
19
+
9
20
  ## [0.47.0] - 2026-10-24
10
21
 
11
22
  ### Added
@@ -1015,7 +1026,8 @@ First public release.
1015
1026
  - `AGENTS.md` project instructions and `/init` to generate them.
1016
1027
  - One-line installer for Linux and macOS.
1017
1028
 
1018
- [Unreleased]: https://github.com/nasser1941/lcode/compare/v0.47.0...HEAD
1029
+ [Unreleased]: https://github.com/nasser1941/lcode/compare/v0.48.0...HEAD
1030
+ [0.48.0]: https://github.com/nasser1941/lcode/compare/v0.47.0...v0.48.0
1019
1031
  [0.47.0]: https://github.com/nasser1941/lcode/compare/v0.46.0...v0.47.0
1020
1032
  [0.46.0]: https://github.com/nasser1941/lcode/compare/v0.45.0...v0.46.0
1021
1033
  [0.45.0]: https://github.com/nasser1941/lcode/compare/v0.44.0...v0.45.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: lcode-cli
3
- Version: 0.47.0
3
+ Version: 0.48.0
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/
@@ -196,6 +196,50 @@ video ❯ /play
196
196
  - **Long renders:** progress shows the step and the time left. With `notify` on, lcode sends a
197
197
  desktop notification when a clip that took longer than `notify_after` seconds is done.
198
198
 
199
+ ## Films
200
+
201
+ From one idea, lcode makes a short film with the same characters in every shot:
202
+
203
+ ```text
204
+ video ❯ /film a red fox finds a lost white kitten in a snowy forest and they walk home together --shots 3 --seconds 3 --transition fade --sound "soft wind and footsteps in snow"
205
+ The Fox and the Kitten (.lcode/media/films/the-fox-and-the-kitten)
206
+ look: cinematic realism, soft winter light, cool blues and warm oranges, shallow depth of field
207
+ cast: Fox — a red fox with a white chest and bushy tail
208
+ cast: Kitten — a small white kitten with large ears
209
+ 1. The Fox spots the shivering Kitten trapped under a snowbank in a dense pine forest. [Fox, Kitten] — static low angle shot, 3 s
210
+ 2. The Fox gently nudges the Kitten free and they stand side by side facing the camera. [Fox, Kitten] — slow push in, 3 s
211
+ 3. The pair trots away from the forest into a warm, lit doorway together. [Fox, Kitten] — tracking shot, 3 s
212
+ …
213
+ ◆ The Fox and the Kitten: .lcode/media/films/the-fox-and-the-kitten/film-sound.mp4
214
+ ```
215
+
216
+ ![The cast's reference pictures (right) and a frame from each of the three shots](assets/film-fox-and-kitten.jpg)
217
+
218
+ 1. **The storyboard:** the [prompt assistant](#the-prompt-assistant) writes it from your idea: the
219
+ look of the whole film, the cast (each character described once) and the shots (what happens,
220
+ the camera, who's in it, how long). It's saved as `storyboard.json` (and a readable
221
+ `storyboard.md`) in the film's folder.
222
+ 2. **The cast:** each character gets a reference picture, made once, in `cast/`.
223
+ 3. **The shots:** each starts as a keyframe made with the cast's pictures as references, so the
224
+ characters look the same in every shot, and is then animated by video mode's model (`shots/`).
225
+ 4. **The film:** the shots are joined into `film.mp4` with cuts or fades (ffmpeg), and
226
+ `--sound "…"` adds a sound track for the whole film (`film-sound.mp4`).
227
+
228
+ | Command | What it does |
229
+ |---|---|
230
+ | `/film <idea>` | The storyboard, then the film. Options: `--shots 3` (1 to 8), `--seconds 4` per shot, `--quality fast`, `--transition cut` or `fade`, `--sound "…"` |
231
+ | `/film plan <idea>` | Only the storyboard, to read or edit before making it |
232
+ | `/film make [name]` | The film from its storyboard (the latest film without a name) |
233
+ | `/film shot 2 [name]` | Shot 2 made again, and the film joined again |
234
+ | `/film stitch [name]` | The shots joined again (after editing the transition or the sound) |
235
+ | `/film show [name]`, `/film list` | One film's storyboard, or all the films here |
236
+
237
+ - **Needs:** the prompt assistant's model (`ollama pull qwen3.5:4b`), FLUX.2 klein 4B, video
238
+ mode's model, and ffmpeg.
239
+ - **Measured** on the RTX 4080 Laptop GPU (12 GB): the 3-shot film above (3 s shots at `fast`, two
240
+ cast members, fades and sound) took 4 minutes, after a 5-second storyboard. The fox and the
241
+ kitten look the same in all three shots.
242
+
199
243
  ## The prompt assistant
200
244
 
201
245
  Image and video models do better with some prompts than others. A small local language model,
@@ -339,7 +383,6 @@ themselves:
339
383
 
340
384
  ## Coming next
341
385
 
342
- - **#155 Movies:** storyboards with a consistent cast, shots stitched into one film.
343
386
  - **#157 Cloud generation**, with costs shown (Grok Imagine first).
344
387
 
345
388
  The permission mode (`ask`, `plan`, `auto-edit`, `yolo`) is a different setting: `/permissions`
@@ -12,7 +12,7 @@ lcode
12
12
 
13
13
  ```text
14
14
  ╭──────────────────────────────────────────────╮
15
- │ lcode v0.47.0 — local coding agent │
15
+ │ lcode v0.48.0 — local coding agent │
16
16
  │ │
17
17
  │ model lcode-qwen3.6-35b │
18
18
  │ context 256K tokens │
@@ -84,6 +84,7 @@ reasoning is on.
84
84
  | `/options`, `/again`, `/vary N`, `/gallery`, `/open N` | Image mode: [options for the session, follow-ups on results](modes.md#results) |
85
85
  | `/edit N`, `/use N`, `/extend N`, `/upscale N`, `/nobg N` | Image mode: [edit, follow, outpaint, upscale, cut out](modes.md#editing) |
86
86
  | `/animate N`, `/play N` | [Video mode](modes.md#video-mode): animate image N; play a clip |
87
+ | `/film <idea>` (`plan`, `make`, `shot N`, `stitch`, `list`) | [A short film](modes.md#films) with the same characters in every shot |
87
88
  | `/restyle N`, `/smooth N`, `/sound N`, `/upscale N` | [Video mode](modes.md#video-mode): a new look, more frames, sound, more pixels |
88
89
  | `/permissions [ask\|plan\|auto-edit\|yolo]` | Set the permission mode |
89
90
  | `/cd DIR` | Change the working directory |
@@ -3,7 +3,7 @@
3
3
  From a program: `from lcode import Session` (see lcode.api).
4
4
  """
5
5
 
6
- __version__ = "0.47.0"
6
+ __version__ = "0.48.0"
7
7
 
8
8
  API = ("Session", "Result", "Options", "SetupError")
9
9
 
@@ -0,0 +1,316 @@
1
+ """Films: from one description to a short film with the same characters in every shot.
2
+
3
+ 1. **A storyboard.** The prompt assistant (lcode.assistant) writes it: a title, the look of the whole film, the cast
4
+ (each character or place described once), and the shots (what happens, how long, the camera, who's in it). It's
5
+ saved as `storyboard.json` in the film's folder, so it can be edited and made again.
6
+ 2. **The cast.** Each character gets a reference picture (FLUX.2 klein), made once and kept in `cast/`.
7
+ 3. **The shots.** Each shot starts as a keyframe: a picture of the shot made with the cast's pictures as references,
8
+ so the characters look the same from shot to shot. Video mode's model then animates the keyframe.
9
+ 4. **The film.** The shots are joined with cuts or fades (ffmpeg) into `film.mp4`, and a sound track can be added.
10
+
11
+ Any shot can be made again alone (`/film shot 2`), and the film joined again (`/film stitch`).
12
+ """
13
+
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ import re
18
+ import shutil
19
+ import subprocess
20
+ from collections.abc import Callable
21
+ from dataclasses import asdict, dataclass, field, replace
22
+ from pathlib import Path
23
+ from typing import TYPE_CHECKING
24
+
25
+ from lcode import assistant, comfy, imageopts, media
26
+
27
+ if TYPE_CHECKING:
28
+ from lcode.agent import Agent
29
+
30
+ MAX_SHOTS = 8
31
+ STORYBOARD = (
32
+ "You write storyboards for short AI-generated films. From the user's idea, write a film of {shots} shots, each "
33
+ "about {seconds} seconds. Answer with JSON only, in English:\n"
34
+ '{{"title": "a short title", "look": "the visual style of the whole film in one sentence (medium, light, '
35
+ 'colour, lens)", "cast": [{{"name": "a one-word name", "description": "what the character looks like: '
36
+ 'species or age, build, clothes, colours, distinctive features, in one sentence"}}], "shots": [{{"description": '
37
+ '"what happens in this shot, where, and who is in it, in one or two sentences, using the cast names", "camera": '
38
+ '"a shot type and camera move, like slow zoom in, tracking shot, static wide shot", "cast": ["names in this '
39
+ 'shot"], "seconds": {seconds}}}]}}\n'
40
+ "Use one to three cast members, the same names in every shot. Each shot is one continuous moment; the film "
41
+ "tells a small story from the first shot to the last. Describe what is seen, never what is felt or heard."
42
+ )
43
+ TRANSITIONS = ("cut", "fade")
44
+ FADE = 0.5 # seconds a fade takes
45
+
46
+
47
+ class FilmError(Exception):
48
+ pass
49
+
50
+
51
+ @dataclass
52
+ class Shot:
53
+ description: str
54
+ camera: str = "static shot"
55
+ cast: list[str] = field(default_factory=list)
56
+ seconds: float = 4.0
57
+
58
+
59
+ @dataclass
60
+ class Board:
61
+ title: str
62
+ look: str
63
+ cast: dict[str, str] # name -> description
64
+ shots: list[Shot]
65
+ idea: str = ""
66
+ transition: str = "cut"
67
+ sound: str = "" # a sound track for the whole film, made after it's joined
68
+ quality: str = "fast"
69
+
70
+ def to_json(self) -> dict:
71
+ data = asdict(self)
72
+ data["cast"] = [{"name": n, "description": d} for n, d in self.cast.items()]
73
+ return data
74
+
75
+ @classmethod
76
+ def from_json(cls, data: dict) -> Board:
77
+ cast = {}
78
+ for member in data.get("cast") or []:
79
+ if isinstance(member, dict) and str(member.get("name") or "").strip():
80
+ cast[str(member["name"]).strip()] = str(member.get("description") or "").strip()
81
+ shots = []
82
+ for raw in data.get("shots") or []:
83
+ if not isinstance(raw, dict) or not str(raw.get("description") or "").strip():
84
+ continue
85
+ seconds = raw.get("seconds")
86
+ shots.append(
87
+ Shot(
88
+ str(raw["description"]).strip(),
89
+ str(raw.get("camera") or "static shot").strip(),
90
+ [str(n).strip() for n in raw.get("cast") or [] if str(n).strip() in cast],
91
+ float(seconds) if isinstance(seconds, (int, float)) and 1 <= seconds <= 8 else 4.0,
92
+ )
93
+ )
94
+ if not shots:
95
+ raise FilmError("the storyboard has no shots")
96
+ return cls(
97
+ str(data.get("title") or "Untitled").strip(),
98
+ str(data.get("look") or "").strip(),
99
+ cast,
100
+ shots[:MAX_SHOTS],
101
+ str(data.get("idea") or ""),
102
+ data.get("transition") if data.get("transition") in TRANSITIONS else "cut",
103
+ str(data.get("sound") or ""),
104
+ data.get("quality") if data.get("quality") in imageopts.QUALITIES else "fast",
105
+ )
106
+
107
+
108
+ # ----------------------------------------------------------------------------- the storyboard
109
+
110
+
111
+ def films_folder(agent: Agent) -> Path:
112
+ return media.folder(agent) / "films"
113
+
114
+
115
+ def plan(agent: Agent, idea: str, shots: int = 3, seconds: float = 4.0) -> tuple[Board, Path]:
116
+ """The assistant's storyboard for an idea, saved in a new film folder."""
117
+ model = assistant.pick(agent.ollama, agent.settings.prompt_assistant if agent.settings.prompt_assistant
118
+ not in assistant.SCOPES else "auto") # fmt: skip
119
+ if model is None:
120
+ raise FilmError("Films need the prompt assistant to write the storyboard: ollama pull qwen3.5:4b")
121
+ helper = assistant.Assistant(agent.ollama, model)
122
+ system = STORYBOARD.format(shots=shots, seconds=f"{seconds:g}")
123
+ with agent.console.status(f"The prompt assistant ({model}) is writing the storyboard…", spinner="dots"):
124
+ try:
125
+ data = assistant.parse_json(helper.write(system, idea, json_answer=True))
126
+ except assistant.AssistantError as e:
127
+ raise FilmError(str(e)) from e
128
+ data["idea"] = idea
129
+ board = Board.from_json(data)
130
+ folder = new_folder(agent, board.title)
131
+ save(board, folder)
132
+ return board, folder
133
+
134
+
135
+ def new_folder(agent: Agent, title: str) -> Path:
136
+ base = films_folder(agent) / comfy.slug(title, 30)
137
+ folder, n = base, 2
138
+ while folder.exists():
139
+ folder, n = base.with_name(f"{base.name}-{n}"), n + 1
140
+ folder.mkdir(parents=True)
141
+ return folder
142
+
143
+
144
+ def save(board: Board, folder: Path) -> None:
145
+ (folder / "storyboard.json").write_text(json.dumps(board.to_json(), indent=2, ensure_ascii=False) + "\n")
146
+ lines = [f"# {board.title}", "", f"*{board.look}*", "", "## Cast", ""]
147
+ lines += [f"- **{name}:** {desc}" for name, desc in board.cast.items()]
148
+ lines += ["", "## Shots", ""]
149
+ for n, shot in enumerate(board.shots, 1):
150
+ who = f" ({', '.join(shot.cast)})" if shot.cast else ""
151
+ lines.append(f"{n}. {shot.description}{who} — {shot.camera}, {shot.seconds:g} s")
152
+ (folder / "storyboard.md").write_text("\n".join(lines) + "\n")
153
+
154
+
155
+ def load(folder: Path) -> Board:
156
+ try:
157
+ return Board.from_json(json.loads((folder / "storyboard.json").read_text()))
158
+ except (OSError, ValueError) as e:
159
+ raise FilmError(f"can't read {folder / 'storyboard.json'}: {e}") from e
160
+
161
+
162
+ def latest(agent: Agent) -> Path:
163
+ folders = sorted((p for p in films_folder(agent).glob("*") if (p / "storyboard.json").exists()),
164
+ key=lambda p: p.stat().st_mtime) # fmt: skip
165
+ if not folders:
166
+ raise FilmError("No film here yet: /film <your idea>")
167
+ return folders[-1]
168
+
169
+
170
+ def find(agent: Agent, name: str) -> Path:
171
+ if not name:
172
+ return latest(agent)
173
+ folder = films_folder(agent) / name
174
+ if not (folder / "storyboard.json").exists():
175
+ raise FilmError(f"There's no film {name!r}: /film list")
176
+ return folder
177
+
178
+
179
+ def describe(board: Board, folder: Path, agent: Agent) -> str:
180
+ lines = [f"{board.title} ({media.shown(agent, folder)})", f" look: {board.look}"]
181
+ lines += [f" cast: {name} — {desc}" for name, desc in board.cast.items()]
182
+ for n, shot in enumerate(board.shots, 1):
183
+ who = f" [{', '.join(shot.cast)}]" if shot.cast else ""
184
+ lines.append(f" {n}. {shot.description}{who} — {shot.camera}, {shot.seconds:g} s")
185
+ return "\n".join(lines)
186
+
187
+
188
+ # ----------------------------------------------------------------------------- making it
189
+
190
+
191
+ def make(
192
+ agent: Agent,
193
+ board: Board,
194
+ folder: Path,
195
+ only: list[int] | None = None,
196
+ cancelled: Callable[[], bool] = lambda: False,
197
+ ask: Callable[[str], bool] | None = None,
198
+ ) -> Path:
199
+ """Make the cast's pictures (once), the shots (all, or `only` those numbers), and join the film."""
200
+ say = agent.say
201
+ for name, desc in board.cast.items():
202
+ picture = folder / "cast" / f"{comfy.slug(name, 20)}.png"
203
+ if picture.exists():
204
+ continue
205
+ say(f"Cast: {name}")
206
+ prompt = f"{board.look} Character reference of {name}: {desc}. Full body, facing the camera, plain background."
207
+ made = with_mode(agent, "image", lambda p=prompt: media.generate_image(
208
+ agent, p, cancelled, ask, imageopts.Options(size="3:4", quality=board.quality))) # fmt: skip
209
+ keep(made.files[0], picture)
210
+ for n, shot in enumerate(board.shots, 1):
211
+ if only and n not in only:
212
+ continue
213
+ say(f"Shot {n} of {len(board.shots)}: {shot.description}")
214
+ keyframe = folder / "keyframes" / f"{n:02d}.png"
215
+ refs = [folder / "cast" / f"{comfy.slug(name, 20)}.png" for name in shot.cast]
216
+ if refs:
217
+ names = "; ".join(f"image {k} is {name}" for k, name in enumerate(shot.cast, 1))
218
+ prompt = f"{board.look} {shot.description} ({names}). A film still, wide 16:9 frame."
219
+ options = imageopts.Options(size="16:9", quality=board.quality)
220
+ job = {"kind": "edit", "prompt": prompt, "options": options, "sources": [str(p) for p in refs],
221
+ "mask": None, "pads": None, "keep_shape": False, "raw": True} # fmt: skip
222
+ made = with_mode(agent, "image", lambda j=job: media.edit_image(agent, j, j["options"], cancelled, ask))
223
+ else:
224
+ prompt = f"{board.look} {shot.description}. A film still, wide 16:9 frame."
225
+ made = with_mode(agent, "image", lambda p=prompt: media.generate_image(
226
+ agent, p, cancelled, ask, imageopts.Options(size="16:9", quality=board.quality))) # fmt: skip
227
+ keep(made.files[0], keyframe)
228
+ options = imageopts.Options(seconds=shot.seconds, quality=board.quality)
229
+ job = {"kind": "video", "prompt": f"{shot.description} {shot.camera}. {board.look}", "options": options,
230
+ "sources": [str(keyframe)], "mask": None, "pads": None, "keep_shape": True} # fmt: skip
231
+ [clip] = with_mode(agent, "video", lambda j=job: media.redo(agent, j, cancelled, ask))
232
+ keep(clip.files[0], folder / "shots" / f"{n:02d}.mp4")
233
+ return stitch(agent, board, folder, cancelled, ask)
234
+
235
+
236
+ def with_mode(agent: Agent, mode: str, run):
237
+ """Run one step in image or video mode (the right model for it), then go back."""
238
+ before = agent.settings.mode
239
+ agent.settings.mode = mode
240
+ try:
241
+ return run()
242
+ finally:
243
+ agent.settings.mode = before
244
+
245
+
246
+ def keep(made: Path, where: Path) -> None:
247
+ where.parent.mkdir(parents=True, exist_ok=True)
248
+ shutil.copyfile(made, where)
249
+
250
+
251
+ def stitch(
252
+ agent: Agent,
253
+ board: Board,
254
+ folder: Path,
255
+ cancelled: Callable[[], bool] = lambda: False,
256
+ ask: Callable[[str], bool] | None = None,
257
+ ) -> Path:
258
+ """Join the shots into film.mp4 (cuts or fades), and add the sound track when the storyboard has one."""
259
+ shots = [folder / "shots" / f"{n:02d}.mp4" for n in range(1, len(board.shots) + 1)]
260
+ missing = [p.name for p in shots if not p.exists()]
261
+ if missing:
262
+ raise FilmError(f"Shots not made yet: {', '.join(missing)} (/film make)")
263
+ ffmpeg = shutil.which("ffmpeg")
264
+ if not ffmpeg:
265
+ raise FilmError("Joining the shots needs ffmpeg: install it (apt install ffmpeg, brew install ffmpeg)")
266
+ film = folder / "film.mp4"
267
+ command = join_command(ffmpeg, shots, film, board.transition, [media.clip_info(p)["seconds"] for p in shots])
268
+ with agent.console.status("Joining the shots…", spinner="dots"):
269
+ done = subprocess.run(command, capture_output=True, text=True, stdin=subprocess.DEVNULL)
270
+ if done.returncode != 0:
271
+ raise FilmError(f"ffmpeg couldn't join the shots: {done.stderr.strip()[-400:]}")
272
+ if board.sound:
273
+ made = with_mode(agent, "video", lambda: media.apply_tool(agent, "sound", film, 1, cancelled, ask, board.sound))
274
+ keep(made.files[0], folder / "film-sound.mp4")
275
+ film = folder / "film-sound.mp4"
276
+ agent.console.print(f"[green]◆ {board.title}:[/] {media.shown(agent, film)}")
277
+ return film
278
+
279
+
280
+ def join_command(ffmpeg: str, shots: list[Path], out: Path, transition: str, lengths: list[float]) -> list[str]:
281
+ """ffmpeg's command for the shots one after another: cut, or each fading into the next (xfade)."""
282
+ command = [ffmpeg, "-y", "-v", "error"]
283
+ for shot in shots:
284
+ command += ["-i", str(shot)]
285
+ count = len(shots)
286
+ if transition == "fade" and count > 1:
287
+ chain, last = [], "[0:v]"
288
+ for k in range(1, count):
289
+ joined = sum(lengths[:k]) - (k - 1) * FADE # how long the film is so far
290
+ label = f"[v{k}]"
291
+ start = max(0.0, joined - FADE)
292
+ chain.append(f"{last}[{k}:v]xfade=transition=fade:duration={FADE}:offset={start:.3f}{label}")
293
+ last = label
294
+ graph = ";".join(chain)
295
+ else:
296
+ last = "[out]"
297
+ graph = "".join(f"[{k}:v]" for k in range(count)) + f"concat=n={count}:v=1:a=0{last}"
298
+ return [*command, "-filter_complex", graph, "-map", last, "-c:v", "libx264", "-pix_fmt", "yuv420p",
299
+ "-movflags", "+faststart", str(out)] # fmt: skip
300
+
301
+
302
+ def shot_numbers(text: str, count: int) -> list[int]:
303
+ numbers = [int(n) for n in re.findall(r"\d+", text)]
304
+ bad = [n for n in numbers if not 1 <= n <= count]
305
+ if not numbers or bad:
306
+ raise FilmError(f"Say which shot: 1 to {count} (/film shot 2)")
307
+ return numbers
308
+
309
+
310
+ def with_options(board: Board, transition: str = "", sound: str = "", quality: str = "") -> Board:
311
+ return replace(
312
+ board,
313
+ transition=transition if transition in TRANSITIONS else board.transition,
314
+ sound=sound or board.sound,
315
+ quality=quality if quality in imageopts.QUALITIES else board.quality,
316
+ )
@@ -94,6 +94,7 @@ COMMANDS = {
94
94
  "/sound": "Video mode: add sound to a clip, e.g. /sound 4 waves and seagulls",
95
95
  "/restyle": "Video mode: the same clip in a new look, e.g. /restyle 4 as a watercolor painting",
96
96
  "/play": "Play a video in your player, e.g. /play 4 (default: the last)",
97
+ "/film": "A short film from an idea: /film a fox finds a lost kitten --shots 3 (plan, make, shot N, stitch, list)",
97
98
  "/cd": "Change the working directory",
98
99
  "/todos": "Show the current todo list",
99
100
  "/status": "The task sheet: your requests, the plan and notes, files changed, the last check",
@@ -1198,6 +1199,8 @@ def handle_command(agent: Agent, line: str, hardware: Hardware) -> bool:
1198
1199
  mode_command(agent, arg.strip().lower())
1199
1200
  elif cmd in IMAGE_COMMANDS:
1200
1201
  image_command(agent, cmd, arg)
1202
+ elif cmd == "/film":
1203
+ film_command(agent, arg)
1201
1204
  elif cmd == "/permissions":
1202
1205
  if arg in PERMISSION_MODES:
1203
1206
  agent.perms.mode = arg
@@ -1583,6 +1586,70 @@ def use_references(agent: Agent, arg: str) -> None:
1583
1586
  c.print(f"References for the next requests: [bold]{escape(shown)}[/] [dim](/use off stops)[/]")
1584
1587
 
1585
1588
 
1589
+ FILM_FLAGS = re.compile(r'--(shots|seconds|quality|transition|sound)\s+("[^"]*"|\S+)')
1590
+
1591
+
1592
+ def film_command(agent: Agent, arg: str) -> None:
1593
+ """/film: a storyboard from an idea, the film made from it, a shot made again, the shots joined again."""
1594
+ from lcode import film
1595
+
1596
+ c = agent.console
1597
+ flags = {k: v.strip('"') for k, v in FILM_FLAGS.findall(arg)}
1598
+ text = " ".join(FILM_FLAGS.sub(" ", arg).split())
1599
+ word, _, rest = text.partition(" ")
1600
+ try:
1601
+ if word == "list":
1602
+ folders = sorted(p for p in film.films_folder(agent).glob("*") if (p / "storyboard.json").exists())
1603
+ if not folders:
1604
+ c.print("[dim]No films here yet: /film <your idea>[/]")
1605
+ for folder in folders:
1606
+ board = film.load(folder)
1607
+ made = "made" if (folder / "film.mp4").exists() else "storyboard only"
1608
+ about = f"{len(board.shots)} shots · {made}"
1609
+ c.print(f" [bold]{escape(folder.name)}[/] {escape(board.title)} [dim]· {about}[/]")
1610
+ return
1611
+ if word in ("make", "stitch", "shot", "show"):
1612
+ if word == "shot":
1613
+ numbers_text, _, name = rest.partition(" ")
1614
+ folder = film.find(agent, name.strip())
1615
+ else:
1616
+ folder = film.find(agent, rest.strip())
1617
+ board = film.with_options(film.load(folder), flags.get("transition", ""), flags.get("sound", ""),
1618
+ flags.get("quality", "")) # fmt: skip
1619
+ if word == "show":
1620
+ c.print(escape(film.describe(board, folder, agent)))
1621
+ return
1622
+ film.save(board, folder)
1623
+ if word == "stitch":
1624
+ film.stitch(agent, board, folder)
1625
+ return
1626
+ only = film.shot_numbers(numbers_text, len(board.shots)) if word == "shot" else None
1627
+ make_image(agent, run=lambda cancel, ask: film.make(agent, board, folder, only, cancel, ask))
1628
+ return
1629
+ just_plan = word == "plan"
1630
+ idea = rest if just_plan else text
1631
+ if not idea.strip():
1632
+ c.print("[yellow]Say what the film is about: /film a fox finds a lost kitten in the snow --shots 3[/]")
1633
+ return
1634
+ shots = int(flags.get("shots", "3"))
1635
+ if not 1 <= shots <= film.MAX_SHOTS:
1636
+ c.print(f"[yellow]A film has 1 to {film.MAX_SHOTS} shots.[/]")
1637
+ return
1638
+ seconds = float(flags.get("seconds", "4"))
1639
+ board, folder = film.plan(agent, idea, shots, min(max(seconds, 1.0), 8.0))
1640
+ board = film.with_options(board, flags.get("transition", ""), flags.get("sound", ""), flags.get("quality", ""))
1641
+ film.save(board, folder)
1642
+ c.print(escape(film.describe(board, folder, agent)))
1643
+ if just_plan:
1644
+ c.print(
1645
+ f"[dim]Edit {escape(media.shown(agent, folder / 'storyboard.json'))} if you like, then /film make.[/]"
1646
+ )
1647
+ return
1648
+ make_image(agent, run=lambda cancel, ask: film.make(agent, board, folder, None, cancel, ask))
1649
+ except (film.FilmError, ValueError) as e:
1650
+ c.print(f"[yellow]{escape(str(e))}[/]")
1651
+
1652
+
1586
1653
  def gallery(agent: Agent, everything: bool = False) -> None:
1587
1654
  """The session's images (or every image in the media folder), with what made them."""
1588
1655
  import json as json_module
@@ -1,5 +1,6 @@
1
1
  """Image mode's engine: lcode drives ComfyUI (a stand-in here): queue, progress, cancel, outputs, recovery."""
2
2
 
3
+ import contextlib
3
4
  import io
4
5
  import json
5
6
  import os
@@ -410,7 +411,8 @@ def test_comfyui_stops_when_lcode_is_killed(tmp_path):
410
411
  assert not alive(child)
411
412
  finally:
412
413
  if alive(child):
413
- os.kill(child, 9)
414
+ with contextlib.suppress(ProcessLookupError): # it may end between the check and the kill
415
+ os.kill(child, 9)
414
416
 
415
417
 
416
418
  def alive(pid: int) -> bool: