songjongdevsecops/dsh-escutar ↗★ 0

dsh-escutar

语音条转写一致性校验与语义检索工具 适合需要校验语音转写准确性,或通过语义搜索音频内容的用户。

包名
dsh-escutar
兼容性
待验证
版本
0.1.1
许可证
MIT
最近更新
2026年10月18日

安装

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

Usage

WhoHowWhat you get
the agentconferir_transcricao toolcheck one note (id) or search the audio by meaning (consulta)
you/escutar commandrecent notes with a suspicious transcript
the agentagent/pre-step hooka short warning at the end of the conversation when a recent note is suspicious; nothing is appended when there is no suspicion, so it costs zero tokens
conferir_transcricao { "id": "001" }                               # is this note trustworthy?
conferir_transcricao { "consulta": "what did I say about backup" } # search the audio
/escutar                                                           # recent suspicious notes

Verdicts

The verdict is the cosine between the audio vector and the transcript vector:

VerdictWhen
suspeitacosine 0.78 + 0.03
sem-medidano number (CLI failure, corrupt cache)

A note on the edge of the threshold is reported as incerta on purpose: it is neither an alarm nor a pass.

Configuration

Every key falls back to a default, so a wrong config never breaks the plugin. Override the row by id in your profile patch (~/.dsh/profiles/web/cordis.patch.yml; on Windows, %USERPROFILE%\.dsh\profiles\web\cordis.patch.yml). A patch replaces the whole config of the row, so restate every key you want to keep:

- id: escutar
  config:
    corpus: '/path/to/voice-corpus'
    cache: '/path/to/discordancia.json'
    gemma: '/path/to/embeddinggemma'
    limiar: 0.78
    banda: 0.03
    maxAvisos: 2
    colecaoAudio: 'escutar-audio-gemma-v1'
    tempoLimiteMs: 120000
KeyDefaultMeaning
workspacepackage directorybase for the corpus and cache defaults
corpus/corpusfolder with the audio/transcript pairs
cache/estado/discordancia.jsoncache read by /escutar and the hook
gemmaDSH_ESCUTAR_GEMMA_BIN, then ~/.local/bin/embeddinggemma (embeddinggemma.exe on Windows)EmbeddingGemma CLI
limiar0.78cosine below which the transcript is suspicious
banda0.03uncertainty margin around the threshold
maxAvisos2maximum lines the hook appends; 0 disables it
colecaoAudioescutar-audio-gemma-v1index name used by consulta
tempoLimiteMs120000timeout for one CLI call

The DSH_ESCUTAR_GEMMA_BIN variable is used when gemma is not set in the config. The package carries no machine-specific path.

Index and cache

The plugin reads two artifacts; it does not build them:

  1. Audio index (colecaoAudio, default escutar-audio-gemma-v1) — needed only by conferir_transcricao with consulta. Build it with the EmbeddingGemma CLI:

    embeddinggemma indexar /path/to/corpus/audio \
      --nome escutar-audio-gemma-v1 --ext ogg,opus,mp3,wav,m4a
    

    The audio encoder reads roughly the first 30 seconds of each file. If you need long notes sliced into windows, slice them before indexing.

  2. Discordance cache (cache) — needed by /escutar and the hook. It is a JSON file written by your indexing pipeline:

    {
      "gerado_em": "2026-10-13T12:00:00+00:00",
      "notas": [
        {
          "id": "001",
          "cosseno": 0.84,
          "transcricao": "first 200 characters of the transcript",
          "mtime": "2026-10-13T11:59:00+00:00",
          "mtime_texto": "2026-10-13T11:59:00+00:00",
          "janelas": [0.84],
          "segundos": 12
        }
      ]
    }
    

    mtime and mtime_texto are the modification times of the audio and the transcript when the cosine was measured. The tool checks them on every read: a cache without them, or older than the files on disk, is not served as current — the note is measured again on the spot. The hook only warns about notes whose mtime is within the last 48 hours.

Without an index or a cache, conferir_transcricao with id still works: it measures the pair live (about 11 s to load the model, plus a few seconds per note). /escutar and the hook stay quiet and say what is missing.