AnakinCao / dsh-session-allow

목록에 있음

DSH Web GUI plugin: session-scoped "Allow for this session" option in the approval dialog (per-mode standing grants, localStorage) + right-panel auto-open guard

main도구세션샌드박스 소스 보기

설치

npx -y @deepseek-ai/dsh plugin --profile web add github:AnakinCao/dsh-session-allow

이 설치 명령은 GitHub 저장소 주소에서 생성된 확인되지 않은 시작점입니다.

README

유지 관리자가 작성한 문서 스냅샷입니다.

GitHub에서 보기 ↗
커밋 b2d16f6동기화 2026. 8. 18.

dsh-session-allow

简体中文: README.zh.md

A DSH (DeepSeek Harness) Web GUI plugin that adds an "Allow for this session" option to the approval dialog, and stops the right-side panel from auto-opening when you answer an approval.

When you pick it, a session-scoped, per-mode standing grant is recorded (persisted in localStorage, isolated by session id). Later escalation requests of the same mode in this session are auto-approved without a dialog; other modes keep prompting as usual.

What it does

ScenarioBehavior
A tool asks to escalate to danger-full-accessDialog shows: Reject / Allow once / Allow danger-full-access for this session
You click "Allow for this session"The current request is allowed and the mode is granted for this session
Same mode is requested again in this sessionSilently auto-approved, no dialog
A different mode is requested (not yet granted)Still prompts normally
Bottom of the dialogShows this session's granted modes as revocable chips (click × to revoke)
Page refresh / new sessionGrants persist per session id / stay isolated per session
Right panel auto-opens after answering an approvalClosed back automatically (see "Right-panel guard" below)

Right-panel guard (v0.2.0)

Problem: once you answer an approval (Reject / Allow once / Allow for this session), the approved tool call then runs, and its side effects can auto-open a right-side panel — e.g. dsh-better-sidebar expands when it detects a new background job or subagent (autoOpenJobs / autoOpenSubagent, both on by default), or dsh-aionui-panel's explorer appears. The user ends up with a panel they never asked for right after approving.

Fix: answering an approval arms a guard. It remembers that the right panel was closed; if the panel flips open within a 2.5 s window (detected via #root's margin-right being pushed by better-sidebar, or the aionui explorer column appearing) and the user did not interact with the panel (a click in the right strip counts as user intent), it closes the panel again through the panel's own collapse toggle. Once the window passes or the user touches the panel, the guard hands off and never fights normal use.

How it works (no core package changes)

The core approval panel is registered on the conversation.composer chain slot at priority 1. This plugin registers the same slot at priority 0 with an identical selector — the chain slot elects the lowest-priority entry whose select returns non-null, so this panel fully replaces the core one. Grants live in localStorage["dsh.sessionAllow.v1"]; a matching request is auto-answered allowed-once on the wire (the host audit still records approval/asked + approval/decided as usual).

Grant keys: mode:<mode> (parsed from the reason escalate sandbox to <mode>: ...); non-escalation reasons fall back to tool:<tool>:<reason>.

Install

Method 1 — recommended, one command (restart dsh web afterwards):

dsh plugin --profile web add https://github.com/AnakinCao/dsh-session-allow.git

Method 2 — manual: append to ~/.dsh/profiles/web/cordis.patch.yml:

- insert:
    - id: dsh-session-allow
      name: 'dsh-session-allow'

and place the repository content under ~/.dsh/profiles/web/node_modules/dsh-session-allow/ (or pnpm add), then restart dsh.

Pick ONE method — never mount twice.

Verify

  1. The dialog shows three buttons: Reject / Allow once / Allow … for this session.
  2. Click "Allow for this session" → the current request is allowed.
  3. Trigger the same mode again → no dialog, executes directly.
  4. The chips at the bottom show the granted mode; click × to revoke and the mode prompts again.
  5. Open another session → that mode still prompts (grants are per-session).

Uninstall

dsh plugin --profile web remove dsh-session-allow

or delete the - insert entry from the profile's cordis.patch.yml and remove node_modules/dsh-session-allow. Grant data lives in the browser's localStorage["dsh.sessionAllow.v1"] and can be cleared manually.

File structure

dsh-session-allow/
├── package.json          # dsh.client / dsh.bundle declaration
├── cordis.patch.yml      # loader entry registration
├── lib/
│   ├── index.js          # host-side placeholder plugin
│   └── client.js         # client bundle (panel takeover + session grants + right-panel guard)
├── test/
│   ├── guard.test.mjs    # right-panel guard behavior tests (node test/guard.test.mjs)
│   └── behavior.test.mjs # grant / auto-allow / revoke regression tests
└── README.md

License

MIT

프로젝트 파일 및 신호

표시된 항목은 디렉터리 스냅샷에서 감지된 공개 저장소 신호입니다.

테스트감지됨

저장소 정보

언어
JavaScript
라이선스
MIT
최신 릴리스
v0.2.0
마지막 업데이트
2026. 8. 16. 오후 4:53

신중하게 설치하기

소스 코드, 권한, 수명 주기 스크립트, 의존성 및 네트워크 접근을 검토하고 신뢰하지 않는 플러그인은 격리 환경에서 테스트하세요.