yin52133/dsh-luban--packages-dsh-luban-image-paste0

@yin52133/dsh-luban-image-paste

支持身份验证的图片粘贴、工作区附件存储及 DSH 会话注入插件。

AI 分析

核心用途是让用户能直接在会话中粘贴图片,并自动压缩存储为工作区附件。适合需要向 Agent 发送截图、图表进行多模态交互的用户。可选安装 sharp 以启用图片压缩。

包名
@yin52133/dsh-luban-image-paste
版本
0.1.1
许可证
MIT
最近更新
2026年9月1日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:yin52133/dsh-luban#fd42aad0a6c5628a3bee24796f0caba131fb0252&path:packages/dsh-luban-image-paste

Configuration

- insert:
    - id: luban-image-paste
      name: @yin52133/dsh-luban-image-paste
      config:
        workspaceRoot: .
        attachDir: .luban/attachments
        maxBytes: 10485760
        maxSidePx: 2000
        compression: true
        compressionQuality: 82
        retainDays: 14
        recentLimit: 50
        cleanupIntervalMinutes: 60
        injectStyle: markdown
        clipboardTimeoutMs: 10000

attachDir must be a child of workspaceRoot; absolute paths, .., ., and symlink escapes are rejected. Runtime operations stop if the canonical directory is replaced. Cleanup only removes indexed files inside this directory; startup also removes stale, unindexed plugin-generated crash artifacts after a grace period. Referenced files are retained regardless of age.

Treat attachDir as plugin-owned storage and do not place manually named files inside it; orphan recovery recognizes the plugin's dated filename scheme.

The current recent strip renders original image payloads rather than generated thumbnails. recentLimit bounds the list on the server; lower it for workspaces with many images near maxBytes to bound browser transfer and memory use.

Set compression: false only when dimension enforcement is not required. With compression enabled, sharp is required so the service can decode and verify maxSidePx before storing an image.

The CLI reads credentials from environment variables so secrets never appear in the process argument list. CLI and Web API requests have a 10-second deadline covering both headers and response bodies. CLI JSON is capped at 64 KiB, Web JSON at 1 MiB, and remote error bodies are never copied to the terminal:

$env:LUBAN_SESSION_COOKIE = 'luban_session=...'
$env:LUBAN_CSRF_TOKEN = '...'
luban-img capture --session '' --style markdown

On Ubuntu, install wl-clipboard for Wayland or xclip for X11. The CLI does not invoke a shell and does not probe any other program.