Moeblack/dsh-preset-kit0

dsh-preset-kit

Publish agent presets into a DeepSeek Harness home: symlink installs with hot reload, owner tracking, and clean uninstall.

AI 분석

核心用途是解决 DSH 预设覆盖冲突问题,提供符号链接安装、热重载、所有权跟踪和干净卸载。适合开发和分发包含智能体预设的插件开发者。

패키지
dsh-preset-kit
버전
0.1.0
최근 업데이트
2026. 8. 15.

설치

검증된 bundle이 없거나 호환성 검사에 실패했습니다. 먼저 저장소 설명을 읽어 주세요. 전체 README 읽기 ↗

dsh-preset-kit

Publish agent presets into a DeepSeek Harness home: symlink installs with hot reload, owner tracking, and clean uninstall.

Why

dsh treats presets as local files: a preset is a directory under $DSH_HOME/.agent-presets// holding agent.cordis.yml (+ optional preset.yml). Bundles cannot add preset roots — composeProfile replaces the agent-presets row's roots with the shipped root at the top overlay — so a plugin that ships a preset has to write into the user root itself.

This kit is that shared piece: publish, conflict rules, ownership records, and uninstall, so every preset-carrying plugin does not reinvent it.

Hot reload

dsh-agent-presets re-reads its roots on every list()/resolve(), so a preset that appears in the user root is visible immediately — no restart. With the default symlink mode the installed preset always reflects the installed package's files, so dsh plugin add updates the preset in place.

API

import { publishPresetSync } from 'dsh-preset-kit'

// In a Cordis plugin apply():
const undo = publishPresetSync({
  id: 'minimal-web',                    // /^[a-z0-9][a-z0-9-]*$/
  dir: new URL('./presets/minimal-web/', import.meta.url).pathname,
  owner: 'dsh-minimal-web',             // your package name
})
ctx.effect(() => undo(), 'preset-publish')

Async variants for scripts: publishPreset, unpublishPreset, listPublished. dshHome defaults to $DSH_HOME, then ~/.dsh.

Ownership rules

  • Publishing into an id already published by the same owner replaces it.
  • Publishing into an id published by a different owner throws.
  • Publishing into a preset directory the user authored by hand (no publisher record) throws — never overwrite a person's work.
  • unpublishPreset removes only its own publication; the undo function is safe to run after a manual rm.

Records live in $DSH_HOME/.agent-presets/.publishers/.json.