Introduction

Currently, DSH has limitations for image input in the native input box (mainly relying on text-only admission). dsh-luna-vision-bridge is a pure host-side DSH LLM adapter. It registers a new luna-vision-bridge provider, allowing the native DSH input box to continue using pasting images, drag-and-drop, thumbnails, deletion, Enter, and the send button. After images enter the DSH native attachment store, Codex Luna converts them into text, which is then passed to any registered pure-text model (downstream target; multiple targets can be configured and switched via the model selector).

Core Features

  • Pure host-side DSH LLM adapter.
  • Registers a new luna-vision-bridge provider.
  • Supports native image input (paste, drag-and-drop, etc.).
  • Uses Codex Luna to transcribe images into text.
  • Passes the image transcription text to a downstream pure-text model.
  • Provides a Web configuration interface for configuring downstream models.

Working Principle

The plugin intercepts DSH’s addImages and submit flows and completes image processing at the Host layer.

DSH 原生 addImages / submit
        │
        ▼
DSH attachment store(校验并持久化原图)
        │
        ▼
luna-vision-bridge adapter
  1. 读取经过校验的附件
  2. 写入 0600 临时文件
  3. 调用插件内置 scripts/read-image-luna.sh
  4. 脚本启动 codex exec --json / gpt-5.6-luna
  5. 删除临时文件
  6. 将图片块替换为带安全边界的识图文本
        │
        ▼
target provider / target model(任意纯文本下游,按所选模型路由)

Prerequisites

  • Each downstream target’s provider is already registered in DSH and available as pure text (e.g., deepseek-official).
  • The codex CLI can be executed from the Host environment where DSH is started, and authentication has been completed.

Installation

The plugin is published on npm.

dsh plugin add --profile web @ycp424c/dsh-luna-vision-bridge

The plugin package includes a cordis.patch.yml bundle. After installation, the Luna Vision Bridge provider appears in the model selector. If the current DSH version does not automatically mount external bundles, append the package name to the bundles in ~/.dsh/profiles/web/cordis.patch.yml and restart dsh web.

Configuration

The plugin provides two configuration methods: a Web interface and a configuration file.

Open Settings → “Luna Vision Bridge” in the Web interface; no configuration file editing is required.

  1. The form is pre-filled with one default combination (defaults to DeepSeek / DeepSeek-V4-Flash when not configured).
  2. Edit the configuration items:
    - Provider display name: the display name of the bridge provider in the model selector; default is Luna Vision Bridge.
    - Downstream models: one combination per line, including provider, model, and display name (optional).
    - Bridge model id (optional): default is <provider>-<model>; values must be unique.
  3. Click Save, and the new combinations appear immediately in the model selector.

Configuration File Method

All fields have default values; zero configuration results in a single DeepSeek downstream.

Configure in ~/.dsh/profiles/web/cordis.patch.yml:

- id: luna-vision-bridge
  name: '@ycp424c/dsh-luna-vision-bridge'
  inject: [llm, attachments]
  config:
    providerName: Luna Vision Bridge
    targets:
      - provider: deepseek-official
        model: deepseek-v4-flash
        name: DeepSeek V4 Flash + Luna
        bridgeModel: deepseek-v4-flash

Global field configuration example:

    # Luna 转写与缓存(全局):
    # 默认自动解析为插件包内的 scripts/read-image-luna.sh;通常无需配置
    codexCommand: codex
    lunaModel: gpt-5.6-luna
    timeoutMs: 180000
    cacheDescriptions: true
    cacheDir: ~/.dsh/cache/luna-vision-bridge
    cacheNamespace: v1

Notes and Limitations

  • Temporary solution: This is a temporary compatibility workaround for current DSH image input limitations, not a stable architecture recommended for long-term dependency. When DSH officially provides native image reading capability, migration and deprecation of this plugin should be prioritized.
  • Transcription-side adaptation: The transcription side only supports Codex CLI and gpt-5.6-luna; downstream can be any pure-text provider, but this plugin is not a general vision provider framework.
  • Security: Temporary file permissions are 0600/0700, and the temporary file is deleted immediately after image recognition completes. Original images are still managed by the DSH native attachment store. The same attachment and prompt use a content-addressed cache.
  • Dependencies: Depends on the codex CLI in the Host environment.