lightcraft
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLightCraft
LightCraft
Operate LightCraft through its structured automation interface, using the user's intended photo library and session.
通过 LightCraft 的结构化自动化接口进行操作,使用用户指定的照片库和会话。
References
参考资料
Read the relevant sections of references/control-protocol.md before constructing desktop calls. This is an unmodified upstream snapshot downloaded on 2026-11-02.
Source: LightCraft control protocol. The upstream MIT license is included in references/LICENSE-MIT.
Search for , , , and as needed. Relative links resolve against .
MethodsWhen the library can't be savedWhen the library can't be openedHeadless renderinghttps://github.com/storytold/lightcraft/blob/main/docs/For MCP tool schemas, import modes, develop controls, export options, and one-shot CLI syntax, consult the upstream MCP documentation when needed. Discover installed command and tool schemas if behavior differs; do not reuse parameters from other ArtCraft applications.
在构建桌面调用之前,读取 references/control-protocol.md 的相关章节。这是一份于 2026-11-02 下载的、未经修改的上游快照。
来源:LightCraft control protocol。上游 MIT 许可证包含在 references/LICENSE-MIT 中。
按需搜索 、、 和 。相对链接基于 解析。
MethodsWhen the library can't be savedWhen the library can't be openedHeadless renderinghttps://github.com/storytold/lightcraft/blob/main/docs/需要 MCP 工具 schema、导入模式、develop(显影)控件、导出选项和一次性 CLI 语法时,请查阅 上游 MCP 文档。如果行为存在差异,请探测已安装的命令和工具 schema;不要复用其他 ArtCraft 应用的参数。
Choose the session
选择会话
Discover available LightCraft tools, installed executables, and existing sessions. Prefer an available MCP connection that targets the intended session.
- For the user's running app, use desktop control or . A needed desktop session can be started with
lightcraft-cli mcp --connect 127.0.0.1:7980orlightcraft --control 7980; adapt executable paths and port to the environment.LIGHTCRAFT_CONTROL_PORT=7980 - For independent photo processing, use . Headless is the default and runs a separate in-process session.
lightcraft-cli mcp [FILES/FOLDERS…] - For persistent headless edits, add . A library can be open in only one program at a time; if the app holds its catalog lock, connect to the app instead of opening that folder headlessly. Do not remove the lock to bypass this restriction.
--library /absolute/path/library
Without , do not assume headless catalog edits persist between sessions. Use only for requested demonstrations or isolated examples. Reuse an appropriate session; report a missing executable or connection when unavailable. This skill does not install LightCraft or configure MCP servers.
--library--demo发现可用的 LightCraft 工具、已安装的可执行程序和现有会话。优先使用指向预期会话的可用 MCP 连接。
- 对于用户正在运行的应用,使用桌面控制或 。可以通过
lightcraft-cli mcp --connect 127.0.0.1:7980或lightcraft --control 7980启动所需的桌面会话;请根据环境调整可执行程序路径和端口。LIGHTCRAFT_CONTROL_PORT=7980 - 对于独立的照片处理,使用 。默认采用 headless,并运行独立的进程内会话。
lightcraft-cli mcp [FILES/FOLDERS…] - 对于持久化 headless 编辑,添加 。一个照片库在同一时间只能由一个程序打开;如果应用持有其 catalog 锁,请连接到应用,而不是以 headless 方式打开该文件夹。不要移除锁以绕过此限制。
--library /absolute/path/library
没有 时,不要假定 headless 照片库编辑会在会话之间持久保存。仅在用户要求进行演示或用于隔离示例时使用 。复用合适的会话;如果缺少可执行程序或连接,请予以报告。此 skill 不会安装 LightCraft 或配置 MCP 服务器。
--library--demoDesktop transport
桌面传输
The control channel is raw loopback TCP, not HTTP or MCP JSON-RPC, and has no authentication; enable it only while needed. Send UTF-8 JSON objects, one per newline, with a string , optional , and distinct request IDs. Read one reply per request, match IDs, and check before dependent actions:
methodparamsokjson
{"id":1,"method":"ui.inspect","params":{}}
{"id":2,"method":"engine.commands","params":{}}Discover engine and UI command IDs, parameter documentation, and enablement with . Invoke them with (alias ). MCP uses and , helper tools, or tools named after command IDs with dots replaced by underscores.
engine.commandsengine.execute {command, params}ui.menu.invokelist_commandsrun_command {command, params}cmd_Requests run on the UI thread between frames with a 60-second timeout. Invalid JSON objects, invalid UTF-8, and lines over 4 MiB close the connection; at most 16 connections are served. Reconnect after an error reply. After a timeout or lost mutation reply, inspect state before replaying; stop and report uncertainty if the outcome cannot be established safely.
控制通道是原始 loopback TCP,而不是 HTTP 或 MCP JSON-RPC,并且没有身份验证;仅在需要时启用。发送 UTF-8 JSON 对象,每行一个,其中包含字符串 、可选的 和彼此不同的请求 ID。每个请求读取一个响应,匹配 ID,并在执行依赖操作前检查 :
methodparamsokjson
{"id":1,"method":"ui.inspect","params":{}}
{"id":2,"method":"engine.commands","params":{}}通过 发现 engine 和 UI 命令 ID、参数文档及启用状态。使用 调用这些命令(别名 )。MCP 使用 和 、helper 工具,或者使用以命令 ID 命名且将点替换为下划线的 工具。
engine.commandsengine.execute {command, params}ui.menu.invokelist_commandsrun_command {command, params}cmd_请求在帧与帧之间运行于 UI 线程,超时时间为 60 秒。无效的 JSON 对象、无效的 UTF-8 和超过 4 MiB 的行会关闭连接;最多服务 16 个连接。收到错误响应后重新连接。发生超时或丢失 mutation 响应后,在重放前检查状态;如果无法安全确定结果,则停止并报告不确定性。
Inspect and edit photos
检查和编辑照片
Inspect the library, current view/filter, active photo, selection, and background work before editing. Desktop uses plus discovered library/photo commands; MCP exposes , , and resources such as and .
ui.inspectquery_photosget_developlightcraft://librarylightcraft://photo/activeObtain real photo IDs from queries and set selection explicitly with or a discovered library selection command. Tools taking make that photo active first; tools without it act on the active photo. For batch operations, use documented parameters or explicitly select the intended photos and verify scope before applying changes.
select_photos {ids, active?, mode?}ididsDiscover develop control IDs, ranges, defaults, and current values with or the installed command registry. Use with for individual controls or for a partial deep merge. Read current settings first and preserve unrelated edits. Query available presets instead of inventing preset IDs. MCP uses normalized coordinates and a straighten angle; read its schema before combining crop and rotation.
list_controlsset_developvaluessettingscrop[x0,y0,x1,y1]For imports, preserve the user's intended source-file handling. Read import schemas before choosing reference, copy, or move behavior. Move mode removes verified, catalogued sources and their XMP sidecars; undo does not move them back. Inspect returned moved/kept results and failures before reporting completion.
Prefer commands and helper tools for precise edits. For desktop interactions, get stable widget IDs from ; screen rectangles are in points, while gestures use normalized image coordinates in Detail view. Refresh widgets after layout changes. Text input depends on focus. Position the pointer before scroll or pinch zoom. supports fit/fill or percentage zoom and a normalized image-centre pan; consult the reference for limits.
ui.widgetsui.pointerview.navigate编辑前,检查照片库、当前视图或筛选条件、活动照片、所选照片和后台工作。桌面端使用 以及探测到的 library/photo 命令;MCP 提供 、,以及 和 等资源。
ui.inspectquery_photosget_developlightcraft://librarylightcraft://photo/active通过查询获取真实照片 ID,并使用 或探测到的照片库选择命令显式设置选区。接受 的工具会先将该照片设为活动照片;不接受 的工具则作用于活动照片。对于批量操作,使用文档中列出的 参数,或显式选择目标照片,并在应用更改前验证操作范围。
select_photos {ids, active?, mode?}ididids使用 或已安装的命令注册表发现 develop 控件的 ID、范围、默认值和当前值。使用 的 设置单个控件,或使用 进行局部深度合并。先读取当前设置,并保留无关的编辑。查询可用的 preset,不要自行杜撰 preset ID。MCP 使用归一化的 坐标和 straighten 角度;组合 crop 与 rotation 前,先读取其 schema。
list_controlsset_developvaluessettingscrop[x0,y0,x1,y1]导入时,保留用户预期的源文件处理方式。选择 reference、copy 或 move 行为前,先读取导入 schema。move 模式会移除经过验证且已编目的源文件及其 XMP sidecar;undo 不会将它们移回。报告完成前,检查返回的 moved/kept 结果和失败项。
精确编辑优先使用命令和 helper 工具。对于桌面交互,从 获取稳定的 widget ID;屏幕矩形以 point 为单位,而 手势在 Detail 视图中使用归一化的图像坐标。布局变化后刷新 widgets。文本输入取决于焦点。滚动或双指缩放前,先定位 pointer。 支持 fit/fill 或百分比缩放,以及以图像中心为基准的归一化平移;具体限制请参阅 reference。
ui.widgetsui.pointerview.navigatePersistence, export, and verification
持久化、导出和验证
A persistent library journals mutations before replying. The error means the edit already happened and is queued for persistence. Do not repeat it as though nothing changed. Inspect → or → / , resolve the storage problem within scope, and verify the queue clears. Do not quit or claim the edits are safely saved while unsaved operations remain.
saved in memory but not written to diskui.inspectunsavedlibrary.infounsavedOpsunsavedErrorIf the library cannot open, inspect . A temporary session writes nothing; do not choose Continue Without Saving when the task requires durable edits. Retry, choose the intended accessible library, or report the blocking issue without discarding work.
libraryProblemRead the export schema before selecting format, dimensions, color space, quality, bit depth, or original/DNG output. MCP export defaults to a 3000-pixel long edge; use for cropped native resolution when requested. Confirm explicit IDs and destinations. Rendering a preview does not constitute exporting a deliverable.
longEdge: 0Desktop with acknowledges queued work. Poll → until the relevant batch finishes, inspect its result, and verify returned files exist and are readable. Likewise, check import/task progress before treating asynchronous work as complete. Inspect state and outputs before retrying an uncertain export.
app.exportbackground: trueui.inspectexportVerify develop settings and selection scope, then view a rendered photo or screenshot to assess exposure, color, crop, and the requested look. Desktop renders a photo; waits for finished renders and supports CPU capture with , including when the window is occluded.
ui.renderui.screenshotheadless: trueFor independent UI snapshots, accepts control requests. This opens its own session and must respect the library lock. Failed script requests do not stop subsequent requests, but make the exit status non-zero; inspect all replies and exit status before reporting success. waits for renders to finish in snapshot scripts. Report actual exported paths and any remaining persistence errors or unfinished work.
lightcraft-cli snapshot --library DIR --script tour.jsonl -o shot.pngui.settle {timeoutMs?}持久化照片库会在响应前通过 journal 记录 mutation。错误 表示编辑已经发生,并且正在排队等待持久化。不要将它当作没有发生更改一样重复执行。检查 → 或 → / ,在任务范围内解决存储问题,并验证队列已清空。只要仍有未保存的操作,就不要退出,也不要声称编辑已安全保存。
saved in memory but not written to diskui.inspectunsavedlibrary.infounsavedOpsunsavedError如果照片库无法打开,检查 。临时会话不会写入任何内容;当任务需要持久化编辑时,不要选择 Continue Without Saving。请重试、选择预期且可访问的照片库,或在保留现有工作的情况下报告阻塞问题。
libraryProblem选择格式、尺寸、色彩空间、质量、位深或原始/DNG 输出前,先读取导出 schema。MCP export 默认使用长边为 3000 像素的输出;按要求使用 获取裁剪后的原生分辨率。确认明确的 ID 和目标路径。渲染预览并不等于导出交付文件。
longEdge: 0桌面端 的 只表示已确认排队任务。轮询 → ,直到相关批次完成;检查结果,并验证返回的文件存在且可读。同样,在把异步工作视为完成之前,检查 import/task 进度。重试结果不确定的 export 前,先检查状态和输出。
app.exportbackground: trueui.inspectexport验证 develop 设置和选择范围,然后查看渲染后的照片或截图,以评估曝光、颜色、裁剪和目标效果。桌面端 可渲染照片; 会等待渲染完成,并支持通过 进行 CPU 捕获,即使窗口被遮挡也可用。
ui.renderui.screenshotheadless: true对于独立的 UI 快照, 接受控制请求。它会打开自己的会话,并且必须遵守照片库锁。失败的脚本请求不会阻止后续请求,但会使退出状态变为非零;报告成功之前,检查所有响应和退出状态。在 snapshot 脚本中, 会等待渲染完成。报告实际导出路径,以及任何尚未解决的持久化错误或未完成的工作。
lightcraft-cli snapshot --library DIR --script tour.jsonl -o shot.pngui.settle {timeoutMs?}