TINGOD2006/dsh-scratch-vault ↗★ 0

dsh-scratch-vault

将临时运行脚本重定向收集至插件专属保险箱 适合希望保持工作区整洁,避免临时草稿文件污染交付物的用户。

套件
dsh-scratch-vault
相容性
待驗證
版本
0.2.1
授權
MIT
最近更新
2026年10月19日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:TINGOD2006/dsh-scratch-vault

Configuration

There is no Cordis Config schema on purpose. A profile that cannot resolve a schema library's peer dependency would fail to mount the plugin entirely, and a workspace-hygiene plugin that refuses to load is worse than one with no settings form. Configuration is a plain JSON file instead:

/scratch-vault.json          # default: ~/.dsh/scratch-vault/scratch-vault.json
$DSH_SCRATCH_VAULT_CONFIG              # or point at any JSON file

Every key is optional; missing keys fall back to the built-in defaults.

KeyDefaultMeaning
enabledtrueMaster switch.
interceptMode"redirect""redirect" moves the write; "deny" refuses it and explains the alternative; "report" changes nothing but logs every file that would have been intercepted.
scratchRoot"" → /dsh-scratchWhere scratch files live. Must be outside the workspace.
vaultDir"" → /scratch-vaultWhere collected scripts are archived.
interceptWritestrueWhether write/edit are inspected at all.
rewriteShelltrueWhether shell command references follow a redirected write.
injectPrompttrueWhether the discipline section is added to the prompt.
exposeEnvtrueWhether DSH_SCRATCH/DSH_VAULT are injected into shell calls.
registerRunScripttrueWhether run_script is offered.
interpreters{python,node,powershell,bash}Executable per language.
extensions{python:".py",node:".mjs",…}Scratch file extension per language.
scriptExtensions27 entriesWhich extensions can be scratch scripts.
scriptNamePatternsnarrow setBase-name regexes marking a scratch script.
scratchDirNames_scratch, tmp, …Directory names that mark everything beneath them.
protectDirssrc, lib, test, …Never touched — a project's real source.
excludeGlobs[]Deliverable allowlist, workspace-relative.
treatBareRootScriptsAsScratchtrueA script at the root of a workspace with no project manifest is scratch.
retainDays14Purge cutoff.
maxVaultEntries2000Ledger cap; oldest are dropped.
maxEntryBytes4194304Above this the entry is recorded but its bytes are not stored.

Start with report mode

On an unfamiliar repository, set "interceptMode": "report" first. It records what the classifier would have done without moving a single file, which is the cheap way to find out whether scriptNamePatterns needs tuning for your layout.