mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
27 lines
928 B
TypeScript
27 lines
928 B
TypeScript
/** Web Session-log download command over the host endpoint owned by ApiProxy. */
|
|
|
|
import type { Context } from '@deepseek-ai/cordis'
|
|
import type { CommandResult } from '@deepseek-ai/dsh-commands'
|
|
|
|
export const name = 'session-log-download'
|
|
export const inject = ['commands']
|
|
|
|
const REQUESTED: CommandResult = {
|
|
kind: 'success',
|
|
text: 'Session log download requested.',
|
|
}
|
|
|
|
/**
|
|
* Register the Web-only `/export` command that the browser download plugin observes.
|
|
* @param ctx - Host context carrying the human-command registry.
|
|
*/
|
|
export function apply(ctx: Context): void {
|
|
ctx.effect(() => ctx.commands.register({
|
|
name: 'export',
|
|
description: 'Download this Session log as a ZIP archive',
|
|
handler: invocation => Promise.resolve(invocation.rawInput.trim() === ''
|
|
? REQUESTED
|
|
: { kind: 'error', text: 'The Web /export command does not accept a path.' }),
|
|
}), 'session-log-download: command')
|
|
}
|