dshbase

插件目录 / Developer / dsh-image-theme

dsh-image-theme

已验证 · 实测可装 Carpon39038

✓ 持续维护 基于 6 个官方 DSH 包 纯 TypeScript

查看 GitHub ↗ ← 返回插件目录

1Stars
0Forks
0未关闭 issue
TypeScript语言
2026-08-15最近推送
跨平台平台

功能简介

Warp风格图片转主题插件

✅
我们的评价
可用 — 实测通过,早期项目

Warp风格图片转主题插件 实测能干净安装、正常启动。早期项目,但功能可用。

「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

README

DSH Image Theme

A Warp-inspired image theme plugin for the DeepSeek Harness web client.

Upload or drag in a picture and the plugin will:

  1. extract five dominant colors in CIE Lab space;
  2. turn the darkest image color into translucent glass surfaces;
  3. let you choose one extracted color as the DSH accent;
  4. correct text and accent contrast before applying theme tokens;
  5. use the original image as the full-window background.

DSH Image Theme preview

Features

  • Full-bleed background image with adjustable dark overlay, blur, saturation, and position.
  • Deterministic five-color Lab k-means palette extraction in the browser.
  • Live DSH token overrides through ctx.theme.overrideTokens()锟斤拷no hard-coded edits to the host UI.
  • A dedicated Settings 锟斤拷 Image theme section with drag-and-drop upload and palette controls.
  • Browser-local privacy: the image is stored as a Blob in IndexedDB and settings are stored in localStorage; nothing is uploaded.
  • The plugin can be disabled without losing the selected image or settings.
  • Responsive settings UI and reduced-motion support.

Install

The repository includes prebuilt lib/ artifacts, so a DSH profile can install it directly from GitHub:

dsh plugin --profile <profile-name> add github:Carpon39038/dsh-image-theme

Restart or refresh the DSH web client, then open Settings 锟斤拷 Image theme.

To install a local checkout while developing:

pnpm install
pnpm build
dsh plugin --profile <profile-name> add link:$PWD

The included .npmrc disables automatic peer installation. This is intentional: DSH supplies the client runtime and UI services, while the current public RC packages still reference workspace-only transitive packages that are not published to npm.

How it works

Palette extraction

The browser downsamples the image to at most 96 锟斤拷 96, samples at most 6,000 opaque pixels, converts RGB to CIE Lab, and runs deterministic k-means with farthest-point seeding. Five clusters are sorted by population.

This follows the same broad model as Warp's open-source theme creator, which uses Lab-space Hamerly k-means with k = 5. This implementation is written independently for the browser and uses deterministic seeding so the same pixels always produce the same palette.

Theme mapping

The plugin keeps the image, the dark surface color, the foreground, and the accent as separate roles:

image 锟斤拷 five-color palette 锟斤拷 darkest color 锟斤拷 near-black glass surfaces
                           锟終 selected color 锟斤拷 contrast-safe accent

It overrides DSH's public alias tokens, including:

  • --dsw-alias-bg-base
  • --dsw-alias-bg-layer-1
  • --dsw-alias-bg-layer-2
  • --dsw-alias-bg-overlay
  • --dsw-alias-border-l1 / --dsw-alias-border-l2
  • --dsw-alias-brand-primary
  • --dsw-alias-label-primary / --dsw-alias-label-secondary
  • --dsw-specific-sidebar-fill

Every override contains both light and dark values, as required by the DSH theme runtime.

Background rendering

A plugin-owned fixed backdrop sits behind the DSH root. The application tokens stay translucent, allowing the image to show through while the overlay and surface opacity protect readability. Unloading or disabling the plugin disposes the token layer and removes the backdrop cleanly.

Development

Requirements: Node.js 22+ and pnpm 10+.

pnpm install
pnpm typecheck
pnpm test
pnpm build

The interactive design preview is in playground/:

cd playground
npm install
npm run dev

The preview imports the same palette and role-mapping modules used by the real plugin. Its generated concert background is a clean demonstration asset, not a copy of Warp UI.

Project layout

src/client/palette.ts          Lab conversion and deterministic k-means
src/client/theme.ts            DSH token and contrast mapping
src/client/controller.ts       lifecycle, persistence, backdrop, token disposal
src/client/storage.ts          IndexedDB image + localStorage settings
src/client/ImageThemeSection.tsx
                               DSH settings page
playground/                    runnable interactive visual preview

Compatibility

The initial version targets the DSH web plugin APIs inspected at deepseek-harness 0.1.0-rc.5. DSH is still moving quickly; check the theme and settings-slot contracts when upgrading to a newer release.

The plugin is web-only. Images and preferences are local to each browser profile and are not synchronized between devices.

Credits

  • DeepSeek Harness for the plugin, settings-slot, and theme-token APIs.
  • Warp for the open-source theme-creator reference and the separation of image, background, foreground, accent, and opacity roles.

License

MIT

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-image-theme」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:Carpon39038/dsh-image-theme

Headless(CLI)profile:

dsh plugin --profile headless add github:Carpon39038/dsh-image-theme

实测报告

验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。

使用场景

扩展 agent 的编码能力面——给它一个新工具、工作流或集成,让它接手以前做不了的开发任务。

适合谁

想让 dsh 在真实代码库上像队友一样干活的开发者——能改、能跑、能验证,而不只是回答问题。

二次开发建议

工具/命令面就是缝:暴露更多 SDK 能力、加更聪明的上下文接线,或收紧改代码与验证之间的循环。

安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7797 个插件 →