openphoto
Use for deterministic local image editing with OpenPhoto: inspect an image, crop or transform the canvas or an object, adjust image properties, apply supported filters, run automatic background removal/depth/detection/coordinate segmentation/upscale, and return PNG or JPEG artifacts. Ask the user before downloading a missing AI model.
- License 许可
- MIT
- 最近更新
- 2026-09-22
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- openphoto
- description
- Use for deterministic local image editing with OpenPhoto: inspect an image, crop or transform the canvas or an object, adjust image properties, apply supported filters, run automatic background removal/depth/detection/coordinate segmentation/upscale, and return PNG or JPEG artifacts. Ask the user before downloading a missing AI model.
02 资源文件 75
- 参考文档agents/openai.yaml213 B
- 资产文件assets/ai-runtime/fonts/01.woff217.8 KB
- 资产文件assets/ai-runtime/fonts/02.woff236.1 KB
- 资产文件assets/ai-runtime/fonts/03.woff21.6 KB
- 资产文件assets/ai-runtime/fonts/04.woff28.7 KB
- 资产文件assets/ai-runtime/fonts/05.woff26.7 KB
- 资产文件assets/ai-runtime/fonts/06.woff25.8 KB
- 资产文件assets/ai-runtime/fonts/07.woff211.4 KB
- 资产文件assets/ai-runtime/fonts/08.woff230.7 KB
- 资产文件assets/ai-runtime/licenses/onnxruntime-web-LICENSE1.0 KB
- 资产文件assets/ai-runtime/licenses/transformers-LICENSE11.1 KB
- 资产文件assets/ai-runtime/openphoto-fonts.css8.3 KB
- 资产文件assets/ai-runtime/ort-wasm-simd-threaded.asyncify.wasm21.8 MB
- 资产文件assets/ai-runtime/ort-wasm-simd-threaded.wasm11.9 MB
- 脚本assets/ai-runtime/transformers.min.js539.0 KB
- 资产文件assets/openshop/icon-192.png31.2 KB
- 资产文件assets/openshop/icon-512.png181.1 KB
- 资产文件assets/openshop/index.html1006.4 KB
- 许可证assets/openshop/LICENSE1.0 KB
- 资产文件assets/openshop/manifest.webmanifest1.1 KB
- 脚本assets/openshop/openphoto-bridge.js26.9 KB
- 脚本assets/openshop/sw.js20.1 KB
- 资产文件assets/openshop/UPSTREAM.json168 B
- 脚本bin/openphoto.mjs6.0 KB
- 参考文档manifest.json595 B
- 参考文档manifests/assets.lock.json3.8 KB
- 参考文档manifests/model-route.json1.2 KB
- 参考文档manifests/models.lock.json10.9 KB
- 参考文档manifests/upstream.json155 B
- 参考文档package-lock.json2.3 KB
- 参考文档package.json725 B
- 参考文档references/capabilities.md1.3 KB
- 参考文档references/protocol.md5.2 KB
- 脚本runtime/artifact-store.mjs7.8 KB
- 脚本runtime/browser.mjs4.3 KB
- 脚本runtime/client.mjs3.1 KB
- 脚本runtime/command-schema.mjs7.0 KB
- 脚本runtime/daemon-lock.mjs2.5 KB
- 脚本runtime/daemon.mjs40.6 KB
- 脚本runtime/document-driver.mjs10.2 KB
- 脚本runtime/job-store.mjs956 B
- 脚本runtime/model-installer.mjs11.1 KB
- 脚本runtime/model-store.mjs9.3 KB
- 脚本runtime/protocol.mjs5.0 KB
- 脚本runtime/static-server.mjs13.3 KB
- 脚本tests/e2e/ai-artifact.spec.mjs10.2 KB
- 脚本tests/e2e/browser-smoke.spec.mjs1.0 KB
- 脚本tests/e2e/cli-health.spec.mjs7.3 KB
- 脚本tests/e2e/document-operations.spec.mjs14.0 KB
- 脚本tests/e2e/real-ai.spec.mjs3.3 KB
- 脚本tests/e2e/release-package.spec.mjs1.7 KB
- 脚本tests/e2e/support/client.mjs4.6 KB
- 脚本tests/e2e/support/openphoto-test.mjs430 B
- 参考文档tests/fixtures/models.fixture.lock.json1.3 KB
- 资产文件tests/fixtures/rgba-2x2.png78 B
- 参考文档tests/fixtures/upstream/openshop/index.html45 B
- 许可证tests/fixtures/upstream/openshop/LICENSE12 B
- 脚本tests/playwright.config.mjs1.5 KB
- 脚本tests/unit/artifact-store.test.mjs5.6 KB
- 脚本tests/unit/browser.test.mjs3.1 KB
- 脚本tests/unit/cli-control.test.mjs4.1 KB
- 脚本tests/unit/client.test.mjs3.1 KB
- 脚本tests/unit/command-schema.test.mjs6.1 KB
- 脚本tests/unit/daemon-lock.test.mjs1.2 KB
- 脚本tests/unit/daemon.test.mjs15.7 KB
- 脚本tests/unit/document-driver.test.mjs4.8 KB
- 脚本tests/unit/import-openshop.test.mjs977 B
- 脚本tests/unit/local-assets.test.mjs609 B
- 脚本tests/unit/model-daemon.test.mjs16.4 KB
- 脚本tests/unit/model-installer.test.mjs11.5 KB
- 脚本tests/unit/package-content.test.mjs1.7 KB
- 脚本tests/unit/protocol.test.mjs2.4 KB
- 脚本tests/unit/skill-layout.test.mjs3.0 KB
- 脚本tests/unit/static-server.test.mjs9.2 KB
- 脚本tests/unit/sync-model-lock.test.mjs5.5 KB
03 SKILL.md 正文
OpenPhoto
Run every command from this Skill's root directory (the directory containing SKILL.md).
用户引导
用户询问用途或怎么使用时,说明 OpenPhoto 可处理已有本地图片,例如检查、裁切、缩放与导出;具体可用操作以运行时能力清单为准。仅咨询时无需启动 CLI 或安装模型。
示例:“把指定的本地图片居中裁切为 1:1,缩放至 200×200 并导出 PNG。”执行需求至少包含文件路径和处理目标,由 Agent 整理请求,只补问影响结果的缺项。交付时提供实际导出文件路径、尺寸和格式。不要把图片处理描述为新图生成或页面发布;在 design-skills-suite 中,新图生成由 skill-image-generate 负责,页面素材自动回填由 skill-orchestrator 负责。独立安装 OpenPhoto 时不依赖这些套件 Skill。
Install and Runtime Prerequisites
- Place this complete Skill directory in a Skills directory recognized by the host Agent. If that host discovers Skills only at session startup, restart it or open a new session after installation.
- After the user allows dependency installation, run
npm ci --omit=devfrom the Skill root. - Use Node >=22 and an installed system Chrome or Edge. Set
OPENPHOTO_BROWSER_PATHwhen the browser is not in a default location. - Ensure
LOCALAPPDATAorOPENPHOTO_DATA_DIRpoints to a writable location. - Do not start a separate daemon, MCP server, or workspace-root script. The CLI starts its local daemon on demand.
agents/openai.yamlis optional host UI metadata; the core CLI and JSON workflow is host-independent.
Start
-
Discover the runtime surface before choosing an operation:
node bin/openphoto.mjs capabilities -
Send one JSON request at a time. Prefer saving it as
request.json, then run:node bin/openphoto.mjs request --file request.jsonFor a single inline request, run:
node bin/openphoto.mjs request --json '<single JSON request object>'
Every request needs protocol: "openphoto/v1", a non-empty requestId, an operation name, and a plain-object payload. Do not invoke operations outside the returned capability list.
Workflows
- For ordinary edits, use
artifact.import→document.open→document.inspect→document.mutateordocument.renderArtifact→artifact.read→document.close. Before every mutation, render, or artifact application, inspect the document and pass its current revision asexpectedRevision. - For AI work, start with
ai.analyze.start. If it returnsMODEL_DOWNLOAD_REQUIRED, explain the model name, source, size, license, and cache location; ask for clear user approval before callingmodel.install. Pollmodel.statuswith the returnedinstallId, then pollai.job.get. Inspect again before applying a completed raster result. Apply onlykind: "raster"results throughdocument.applyArtifact; reportkind: "json"detection results without applying them. - Call
model.install.cancelonly when the user explicitly withdraws the shared download, because it cancels that installation for every waiting job in the current daemon session.
Read references/protocol.md for executable ordinary and AI workflows. Read references/capabilities.md for supported mutation command parameters.