[feat] trigger gui
This commit is contained in:
42
src/ts/process/triggers.ts
Normal file
42
src/ts/process/triggers.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
export interface triggerscript{
|
||||
comment: string;
|
||||
type: 'start'|'manual'|'output'
|
||||
conditions: triggerCondition[]
|
||||
effect:triggerEffect[]
|
||||
}
|
||||
|
||||
export type triggerCondition = triggerConditionsVar|triggerConditionsExists
|
||||
|
||||
export type triggerEffect = triggerEffectSetvar|triggerEffectSystemPrompt|triggerEffectImpersonate
|
||||
|
||||
export type triggerConditionsVar = {
|
||||
type:'var'
|
||||
var:string
|
||||
value:string
|
||||
operator:'='|'!='|'>'|'<'|'>='|'<='
|
||||
}
|
||||
|
||||
export type triggerConditionsExists ={
|
||||
type: 'exists'
|
||||
value:string
|
||||
type2: 'strict'|'loose'|'regex',
|
||||
depth: number
|
||||
}
|
||||
|
||||
export interface triggerEffectSetvar{
|
||||
type: 'setvar'
|
||||
var:string
|
||||
value:string
|
||||
}
|
||||
|
||||
export interface triggerEffectSystemPrompt{
|
||||
type: 'systemprompt',
|
||||
location: 'start'|'historyend'|'promptend',
|
||||
value:string
|
||||
}
|
||||
|
||||
export interface triggerEffectImpersonate{
|
||||
type: 'impersonate'
|
||||
role: 'user'|'char',
|
||||
value:string
|
||||
}
|
||||
Reference in New Issue
Block a user