Chuyển đến nội dung chính

dsh-approval-notify

Đã xác minh

@mangobsh/dsh-approval-notify · v0.4.0 · MIT

Host OS approval notifications on macOS and Windows for DeepSeek Harness

Cài đặt

dsh plugin add @mangobsh/dsh-approval-notify

Xác nhận layer đã áp bằng dsh --profile default --dump-config — xem hướng dẫn cài plugin.

Mã nguồn

Phát hành lên npm mà không có repository công khai. Hãy kiểm tra nội dung package trước khi cài.

Thẻ

Tác giả

Readme

dsh-approval-notify

Host OS notifications for DeepSeek Harness whenever the harness waits on the human: an approval question dispatched through approval/request, or the model calling the ask_user_question tool (waiting for you to pick an answer). Fires a macOS or Windows system notification, then delegates to the composed answerers. Mounting the plugin never changes approval outcomes or tool execution; it only adds the ephemeral host side-effect.

This is a standalone extract of the in-repo package @deepseek-ai/dsh-approval-notify (packages/interaction/approval-notify), published outside the harness so anyone with an installed dsh CLI can install it without waiting for the official release.

Install (one command)

dsh plugin --profile web add @mangobsh/dsh-approval-notify

The package declares dsh.bundle, so the CLI activates it as a profile layer automatically — no patch file editing. It fires on every approval/request dispatch and every ask_user_question tool call in the web profile (browser approval / answer selection).

To undo:

dsh plugin --profile web remove @mangobsh/dsh-approval-notify

Config

Optional, via the profile's cordis.patch.yml insert row or the plugin inventory UI:

Field Default Meaning
title DeepSeek Harness 请您处理 Notification title template.
message [会话摘要]: {summary} Notification message template.

Both templates expand {toolName}, {reason}, {sessionId}, and {summary} per notification; absent values read as the empty string and unknown tokens pass through verbatim.

  • {sessionId} is the session/agent id (e.g. comp-agent) — the harness carries no human-readable session title in the request payload.
  • {summary} is a short preview of the session's latest user message (the last thing the human asked of this session), folded to one line and truncated to 40 code points. Use it to tell "what is this session waiting on" at a glance.

Example patch row with config:

- insert:
  - id: approval-notify
    name: '@mangobsh/dsh-approval-notify'
    config:
      title: '需要你的审批'
      message: '{toolName} 请求执行,原因: {reason}'

Platforms

  • macOS — notifies through osascript (display notification).
  • Windows — notifies through powershell.exe with a NotifyIcon balloon (the helper process must stay alive for the 5-second balloon render).
  • Other platforms — no-op.

Development

pnpm install
pnpm test    # unit + real Loader composition tests
pnpm build   # tsc emit to lib/

The notification is unobservable to snapshot harnesses, so the real-composition test asserts the spawned command instead.

Publishing

Published to npm as @mangobsh/dsh-approval-notify. Releasing a new version:

pnpm build
npm publish --registry=https://registry.npmjs.org

Remember to bump version in package.json first — installs via dsh plugin add @mangobsh/dsh-approval-notify pull the npm version. Semver prerelease rules mean ^0.1.1-rc.2 only matches the 0.1.1-rc.x line (not 0.1.0-rc.x); if the harness moves to a new rc line, bump dependencies/peerDependencies in lockstep or dsh plugin add will fail with a resolver error.

License

MIT