Back to home@changguo1998

dsh-turtle-ui-prompt-extra

No description

Stars
0
Language
TypeScript
Created
Aug 18, 2026
Updated
Aug 18, 2026
GitHub repo

Introduction

dsh-turtle-ui-prompt-extra

Extra top-bar slots for the official turtle-ui TUI of DeepSeek Harness.

turtle-ui (package @deepseek-ai/dsh-tui) lets a profile compose its top bar via theme.leftPrompt from a shared slot registry, ctx.tuiPrompt. It ships eight built-in slots (cwd, git/worktree, token_meter/cache_hit_rate, model, context, queued, symbol, indicator) — but no provider, no reasoning-effort, no clock. This plugin adds those.

SlotWidgetSourceDefault on
${provider}current provider route (ustc)session request header → agentDefaultModelyes
${thinking}reasoning effort (high)sameyes
${time}wall clock, 24h/12hDate on a timeryes
${date}calendar date YYYY-MM-DDDate on a timerno
${session}short session idrunning agent idno

Unlike whole-TUI replacements (dsh-tui-pi, dsh-cc-tui), this plugin adds only prompt variables to the official TUI. No config here changes the top bar composition — that stays in your profile's theme.leftPrompt, exactly like turtle-ui's own built-in-slots-on-profile pattern.

Install

# in your profile dir (e.g. ~/.dsh/profiles/tui)
dsh plugin --profile tui add dsh-turtle-ui-prompt-extra

or, for a local checkout with a manual file-path row, see examples/.

Quick start

Append to your profile's cordis.patch.yml:

- insert:
    - id: prompt-extra
      name: "dsh-turtle-ui-prompt-extra"

- id: tui
  config:
    theme:
      leftPrompt: "${cwd} ${git/worktree} ${provider}/${model}:${thinking} ${context} ${token_meter/cache_hit_rate} ${time}"
      rightPrompt: "${queued}"

The - id: tui override replaces the bundle default, so any listed slot not registered (or empty at that moment) is pruned from the rendered bar. Run dsh --profile tui to see the new slots.

Config

- id: prompt-extra
  config:
    prefix: extra # namespace all slots: `${extra/time}`
    timeFormat: "24h" # or '12h'
    tickMs: 1000 # clock + lazy probe interval
    warnOnCollision: true # log instead of silently skip a collision
    slots: # absence keeps DEFAULT_SLOTS
      provider: true
      thinking: true
      time: true
      date: false
      session: false

Slots are registered with the pattern prefix/name when prefix is set. Colliding names (already registered — e.g. a future turtle-ui builtin) are skipped, never thrown through the plugin boundary.

Degradation contract

  • No ctx.tuiPrompt service → the plugin stays silent (retries on each tick).
  • Non-turtle-ui host → no-op; never throws, never blocks boot.
  • Settings fetch failure → the slot value is undefined for that tick.

Development

pnpm install
pnpm typecheck
pnpm test       # > tests in src/index.test.ts
pnpm build      # emits dist/src/index.js

License

MIT


Also available in 简体中文.