forked from deepseek-ai/deepseek-harness
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
26 lines (22 loc) · 928 Bytes
/
Copy pathindex.ts
File metadata and controls
26 lines (22 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/** 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')
}