songjongdevsecops/dsh-midia ↗★ 0

dsh-midia

DeepSeek Harness plugin: semantic search over a personal music and video library, with timecodes, plus a guard that refuses to move, rename or delete media. 适合需要对媒体库进行带时间戳的语义搜索,并防止文件被改删。

パッケージ
dsh-midia
互換性
未検証
バージョン
0.1.1
ライセンス
MIT
最終更新
2026/10/18

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:songjongdevsecops/dsh-midia

ドキュメント

README 全文を読む ↗

Configuration

Precedence is profile config → environment variable → default. ~ is expanded to your home directory. Defaults follow the reference layout under your home directory; set yours to match where your media and engine actually live.

KeyEnvironment variableDefaultMeaning
musicasDSH_MIDIA_MUSICAS~/workspaces/midia/musicasmusic library root (guard and returned paths)
videosDSH_MIDIA_VIDEOS~/workspaces/midia/videosvideo library root
gemmaDSH_MIDIA_GEMMA~/workspaces/tools/embeddinggemma/bin/embeddinggemmaEmbeddingGemma binary
estadoDSH_MIDIA_ESTADO~/workspaces/harness/global/scripts/embeddings/.estadooptional index state sidecars (granularity note)
memsearchDSH_MIDIA_MEMSEARCH~/.local/bin/memsearchmemsearch CLI, for -bgem3-v1
colecao—midia-gemma-v1collection searched by default
n—10items returned when the model does not pass n
guarda—truelibrary guard on/off

Override by id in your profile patch (~/.dsh/profiles/web/cordis.patch.yml). A patch replaces the whole config of the line, so restate every key you want to keep:

- id: midia
  config:
    colecao: mymusic-gemma-v1
    n: 10
    guarda: true
    musicas: ~/Media/music
    videos: ~/Media/video
    gemma: ~/tools/embeddinggemma/bin/embeddinggemma

Environment variables are handy when the engine lives outside the default place:

export DSH_MIDIA_GEMMA="$HOME/tools/embeddinggemma/bin/embeddinggemma"
export DSH_MIDIA_MUSICAS="$HOME/Media/music"

Usage

In the chat:

/midia slow jazz for studying -n 5
/midia --mais calm --menos drums
/midia-parecidas "/home/you/Media/music/kind-of-blue.flac"
/midia-duplicatas --camada todas --propor

Or let the agent call midia_buscar with a description. Each returned item has a name, an absolute path when it can be resolved, a score, a type (faixa, trecho, quadro) and, for slices, the timecode (HH:MM:SS plus the start in seconds).

The direction arithmetic (--mais / --menos) is not normalized by the engine: only the order is meaningful there, not the absolute scores.

/midia-duplicatas runs three layers: identical bytes (md5), same recording in another format (SimHash over strings), and near-duplicate vectors (cosine). It writes a proposal under ${XDG_STATE_HOME:-~/.local/state}/dsh-midia/-duplicatas/ and never touches the media. The optional model verdict (--llm) is not implemented; the three mechanical layers are.

The guard

While guarda is true, the plugin listens on tools/pre-execute and denies a bash command whose verb is destructive (rm, mv, rename, unlink, shred, truncate, dd) when it targets a media file under musicas or videos. Read-only commands (ffprobe, ls, find, indexers) pass. The guard covers the bash tool only — other tools are not inspected — and paths outside the configured roots are not its business.