Перейти к основному содержимому
S

dsh-plugin-session-archive

sshooting/dsh-plugin-session-archive

Read-only DSH command that exports the current session as redacted Markdown or JSON.

Установка

dsh plugin --profile web add github:sshooting/dsh-plugin-session-archive

README

dsh-plugin-session-archive

Export the current DSH session as a clean, redacted Markdown transcript with one command.

Sessions live in a local log. This plugin turns the current one into something you can paste into an issue, archive, or share — with credential-looking strings removed. It is read-only: no network calls, no file writes, no prompt upload.

Install

dsh plugin --profile web add dsh-plugin-session-archive

Requires Node ^22.19.0 || >=24 and DSH >=0.2.0-rc.2 <0.3.0.

30-second demo

/session-export
# Session export

3 exported event(s). Credential-looking strings are redacted.

# Turn 1

## User

How do I rotate the api_key=[redacted]?

## Assistant

Use the console and revoke the old one.

### Tool call: bash

$ echo token=[redacted]

/session-export json returns JSON rows; /session-export --max-kb=64 caps the output.

Configuration

No configuration is required. The bundle patch only inserts the plugin row:

- id: dsh-plugin-session-archive
  name: dsh-plugin-session-archive
FlagDefaultMeaning
jsonoffEmit JSON rows instead of Markdown.
--max-kb=N128Cap output size (clamped to 1–512 KB).

What is exported

EventRendered
turn/startTurn heading
user/messageUser text (and skill name when applicable)
assistant/messageAssistant text, with the last observed provider/model
tool/callTool name plus command, path, or query only
tool/resultText blocks of tool-result and error text
everything elseignored

Unknown fields are never serialized. Credential-looking strings are redacted in every emitted field.

Privacy & safety

  • Only allowlisted text fields are read. No arbitrary event data is copied.
  • No network calls, no telemetry, no file writes. Output goes to the command response only.
  • Redaction runs on every emitted string before rendering.
  • If you need a different redaction rule, edit src/core.ts locally — do not disable it.

Compatibility

ComponentSupported
DSH>=0.2.0-rc.2 <0.3.0
Node^22.19.0 || >=24.0.0
Cordis>=4.0.0 <5
Surfaceheadless and web (command registry only)

Troubleshooting

SymptomCauseFix
/session-export not foundBundle row not installedRe-run dsh plugin --profile web add dsh-plugin-session-archive, restart DSH.
Export is truncated--max-kb cap reachedRaise it up to 512.
Tool arguments look emptyOnly command/path/query are rendered by designThis is intentional to avoid leaking arbitrary data.
No route shown on assistant messagesNo request/* event yet in the sessionUse the session once more, then export.

Development

npm install
npm test
npm pack --dry-run

Tests are fully offline with synthetic event fixtures.

License

MIT

Demo

Demo

Listed in

Похожие плагины