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
29 lines (25 loc) · 1.1 KB
/
Copy pathindex.ts
File metadata and controls
29 lines (25 loc) · 1.1 KB
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
27
28
29
/**
* Function plugin registering the `sessionStats` projection unit: whole-log
* turn/step counts and LLM/tool/first-token/decode wall times served through
* the session-projection seam (registry snapshot, change feed, and every
* projection carrier), so clients render full-session figures that paging and
* compaction cannot change. The plugin owns only the fold; delivery is the
* seam's.
*
* @module @deepseek-ai/dsh-session-stats
*/
import type { Context } from '@deepseek-ai/cordis'
import { sessionStatsProjectionDefinition } from './projection.ts'
export type * from './types.ts'
/** Cordis plugin name. */
export const name = 'session-stats'
/** The projection registry is the plugin's whole purpose; without it the fiber stays pending. */
export const inject = ['sessionProjections']
/**
* Register the `sessionStats` unit; the registration is an effect on this
* plugin's fiber, so unloading removes the key.
* @param ctx - registrant context carrying the projection registry.
*/
export function apply(ctx: Context): void {
ctx.sessionProjections.register(sessionStatsProjectionDefinition)
}