{"_id":"@bytehivex/dsh-image-gen","name":"@bytehivex/dsh-image-gen","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@bytehivex/dsh-image-gen","version":"1.0.0","description":"OpenAI-compatible image generation plugin for DeepSeek Harness.","type":"module","main":"lib/index.js","engines":{"node":"^22.19.0 || >=24.0.0"},"keywords":["deepseek-harness","dsh","image-generation","openai-compatible"],"publishConfig":{"access":"public"},"exports":{".":"./lib/index.js","./client":"./lib/client.js","./package.json":"./package.json"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"},"client":{"inject":["@deepseek-ai/dsh-api-remotes","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-client-locale"],"platform":"web"}},"_id":"@bytehivex/dsh-image-gen@1.0.0","_nodeVersion":"24.15.0","_npmVersion":"12.0.2","dist":{"integrity":"sha512-i3LF3fFmLXE9IqjSrj8GeIPus2YgDmpLipJeuA6dzIJ7jA/t39tHtfiQ0uMCNTkchwy2+hHmwMmY2vwCpM9vRQ==","shasum":"de33a14040c9de5fb6bd132490c9c35d259b1eef","tarball":"https://registry.npmjs.org/@bytehivex/dsh-image-gen/-/dsh-image-gen-1.0.0.tgz","fileCount":5,"unpackedSize":44349,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCqQUX0l6eGjAcMelS/54uAqNpcblCfLesLwai6zTfigQIgMdh19vZi+IZhzY8FfP2JVZilgLbc6DA67pHdhFTFkqs="}]},"_npmUser":{"name":"bytehivex","email":"npm@bytehivex.com"},"directories":{},"maintainers":[{"name":"bytehivex","email":"npm@bytehivex.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-image-gen_1.0.0_1786881880529_0.372026791510639"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-16T12:04:40.315Z","1.0.0":"2026-08-16T12:04:40.674Z","modified":"2026-08-16T12:04:40.906Z"},"maintainers":[{"name":"bytehivex","email":"npm@bytehivex.com"}],"description":"OpenAI-compatible image generation plugin for DeepSeek Harness.","keywords":["deepseek-harness","dsh","image-generation","openai-compatible"],"readme":"# @bytehivex/dsh-image-gen 1.0.0\n\n为 DeepSeek Harness Web profile 提供 OpenAI 兼容生图工具 `generate_image` 和“设置 → 插件 → 图像生成”配置卡。\n\n## 功能\n\n- 调用 OpenAI 兼容的 `POST /images/generations` 接口。\n- 在设置界面配置 API Key、接口地址、默认模型、默认尺寸和图片保存位置。\n- 展开设置卡时自动读取接口模型列表。\n- API Key 通过 DSH credentials 保存，不写入 `settings.yaml` 或本安装包。\n- 图片同时保存为 DSH durable attachment 和本地 PNG 文件。\n- 默认本地目录为当前会话项目根目录下的 `generated_images`。\n- 支持相对目录和绝对目录；相对目录按每个 DSH 会话的项目根目录解析。\n\n## 安装包内容\n\n```text\ndsh-image-gen/\n├── lib/\n│   ├── index.js       # Host 插件、配置 API、generate_image 工具和文件保存逻辑\n│   └── client.js      # Web 设置卡\n├── cordis.patch.yml   # 安装后自动激活 genimg 条目\n├── package.json       # DSH bundle 与 client manifest\n└── README.md\n```\n\n本包不包含 API Key、接口地址、模型选择、历史图片、`settings.yaml` 或 `.credentials.yaml`。\n\n## 环境要求\n\n- Node.js `^22.19.0` 或 `>=24.0.0`。\n- 可运行的 `@deepseek-ai/dsh`。\n- `pnpm` 已加入 PATH；`dsh plugin` 会将参数转交给 pnpm。\n- 安装目标为带 Web 设置界面的 `web` profile。\n\n## 从 npm 安装（发布后推荐）\n\n插件发布到 npm 后，在 PowerShell 中执行：\n\n```powershell\nnpx @deepseek-ai/dsh plugin --profile web add \"@bytehivex/dsh-image-gen\"\nnpx @deepseek-ai/dsh web\n```\n\n## 从 TGZ 安装\n\n先停止正在运行的 DSH Web，把 TGZ 下载到任意目录，然后在该目录打开 PowerShell 并执行：\n\n```powershell\nnpx @deepseek-ai/dsh plugin --profile web add \".\\bytehivex-dsh-image-gen-1.0.0.tgz\"\nnpx @deepseek-ai/dsh web\n```\n\n这里使用相对于当前 PowerShell 目录的路径，因此不依赖打包者或接收者的用户名、盘符和文件夹结构。如果 TGZ 不在当前目录，请换成接收者机器上的实际路径。\n\n安装命令会完成以下工作：\n\n1. 将 `@bytehivex/dsh-image-gen` 加入 `web` profile 的依赖。\n2. 识别 package manifest 中的 `dsh.bundle.patch`。\n3. 自动把 `cordis.patch.yml` 作为 profile 组合层启用。\n4. 让 Host 插件和 Web client bundle 一起加载。\n\n不要手工覆盖现有 profile 的 `cordis.patch.yml`，其中可能还有其他用户配置。\n\n## 已有手工安装版本时\n\n如果目标机器已经存在以下任一内容，不要直接叠加安装 TGZ：\n\n- `$DSH_HOME/profiles/web/plugins/dsh-image-gen` 手工插件目录；\n- `$DSH_HOME/profiles/node_modules/@bytehivex/dsh-image-gen` 手工 junction；\n- profile `cordis.patch.yml` 中手工插入的 `id: genimg` 条目。\n\n这些内容与 TGZ 自带的 bundle patch 同时存在时，可能产生重复 `genimg` 条目。应先停止 DSH Web，备份现有插件和 profile patch，移除手工装配，再执行 TGZ 安装。不要直接覆盖整个 `cordis.patch.yml`。若文件中还有其他插件或用户 patch，只移除属于 `genimg` 的那一项。\n\n## 安装后配置\n\n1. 打开 DSH Web。\n2. 进入“设置 → 插件 → 图像生成”。\n3. 填写 API Key。留空保存不会清除现有密钥。\n4. 填写 OpenAI 兼容接口地址。\n5. 刷新并选择默认模型。\n6. 选择默认尺寸。\n7. 保持 `generated_images`，或填写其他相对/绝对保存目录。\n8. 点击“保存”。\n\nAPI Key 请在目标机器本地填写，不要写入安装命令、聊天记录或安装包。\n\n## 验证\n\n启动成功时终端会显示：\n\n```text\ndsh web: http://127.0.0.1:3080\n```\n\n可进一步检查安装依赖：\n\n```powershell\nnpx @deepseek-ai/dsh plugin --profile web why \"@bytehivex/dsh-image-gen\"\n```\n\n再打开设置页确认“图像生成”卡片存在。首次真实生图会产生外部 API 请求和相应费用；验证前请确认接口与计费策略。\n\n## 更新\n\n先停止 DSH Web，然后移除旧包并安装新的 TGZ：\n\n```powershell\nnpx @deepseek-ai/dsh plugin --profile web remove \"@bytehivex/dsh-image-gen\"\nnpx @deepseek-ai/dsh plugin --profile web add \".\\<新版本TGZ文件名>\"\nnpx @deepseek-ai/dsh web\n```\n\n插件配置和 API Key 位于 DSH settings/credentials 中，不在 npm 包目录内；移除插件包通常不会主动删除它们。更新后仍应在设置页复核。\n\n## 卸载\n\n```powershell\nnpx @deepseek-ai/dsh plugin --profile web remove \"@bytehivex/dsh-image-gen\"\n```\n\n卸载后重启 DSH Web。若不再使用对应 API Key，请在目标机器的 DSH credentials 管理界面或文件中单独停用；不要仅依赖卸载插件清理凭据。\n\n## ZIP 的用途\n\nZIP 用于审阅源码、解压留档或从目录安装。在解压后的插件根目录打开 PowerShell，可以执行：\n\n```powershell\nnpx @deepseek-ai/dsh plugin --profile web add \".\"\nnpx @deepseek-ai/dsh web\n```\n\n分发给普通用户时仍优先使用 npm 包名或 `.tgz`，因为安装来源和版本更明确，`dsh plugin add` 也能自动维护 profile 依赖和 bundle 层。\n","readmeFilename":"README.md","_rev":"1-ecc6fa662ba9d50a9a5b775894b32cbf"}