-
-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathtypes.ts
More file actions
52 lines (45 loc) · 1.41 KB
/
types.ts
File metadata and controls
52 lines (45 loc) · 1.41 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import type { PluginState } from "../state"
import type { Logger } from "../logger"
import type { PluginConfig } from "../config"
import type { ToolTracker } from "./tool-tracker"
export type { ToolTracker } from "./tool-tracker"
export interface ToolOutput {
id: string
toolName?: string
}
export interface ToolMetadata {
tool: string
parameters?: any
}
export interface FormatDescriptor {
name: string
detect(body: any): boolean
getDataArray(body: any): any[] | undefined
injectSynth(data: any[], instruction: string, nudgeText: string, systemReminder: string): boolean
injectPrunableList(data: any[], injection: string): boolean
extractToolOutputs(data: any[], state: PluginState): ToolOutput[]
replaceToolOutput(data: any[], toolId: string, prunedMessage: string, state: PluginState): boolean
hasToolOutputs(data: any[]): boolean
getLogMetadata(data: any[], replacedCount: number, inputUrl: string): Record<string, any>
}
export interface SynthPrompts {
synthInstruction: string
nudgeInstruction: string
systemReminder: string
}
export interface FetchHandlerContext {
state: PluginState
logger: Logger
client: any
config: PluginConfig
toolTracker: ToolTracker
prompts: SynthPrompts
}
export interface FetchHandlerResult {
modified: boolean
body: any
}
export interface PrunedIdData {
allSessions: any
allPrunedIds: Set<string>
}