Files
deepseek-harness/packages/session-query/session-log-export/src/index.ts

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')
}