mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-08-06 01:06:28 +08:00
Add session timeline logging and admin sessions view
This commit is contained in:
@@ -126,6 +126,8 @@ export interface DecisionNodeMetadata {
|
||||
complexity?: 'low' | 'medium' | 'high'
|
||||
}
|
||||
|
||||
export type DecisionFlowEntryMode = 'parallel' | 'linear'
|
||||
|
||||
export interface DecisionNodeModel {
|
||||
stateId: string
|
||||
title?: string
|
||||
@@ -197,6 +199,8 @@ export interface DecisionFlowModel {
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
nodeCount?: number
|
||||
entryMode?: DecisionFlowEntryMode
|
||||
isMain?: boolean
|
||||
}
|
||||
|
||||
export interface RuntimeDecisionAutoTransition {
|
||||
@@ -213,6 +217,8 @@ export interface RuntimeDecisionAutoTransition {
|
||||
export interface RuntimeDecisionState {
|
||||
role: DecisionNodeRole
|
||||
phase: string
|
||||
name?: string
|
||||
summary?: string
|
||||
say_tpl?: string
|
||||
utterance_tpl?: string
|
||||
else_say_tpl?: string
|
||||
@@ -248,6 +254,7 @@ export interface RuntimeDecisionTree {
|
||||
roles: DecisionNodeRole[]
|
||||
phases: string[]
|
||||
states: Record<string, RuntimeDecisionState>
|
||||
entry_mode?: 'main' | DecisionFlowEntryMode
|
||||
}
|
||||
|
||||
export interface RuntimeDecisionSystem {
|
||||
@@ -265,4 +272,6 @@ export interface DecisionFlowSummary {
|
||||
nodeCount: number
|
||||
updatedAt: string
|
||||
createdAt: string
|
||||
entryMode?: DecisionFlowEntryMode
|
||||
isMain?: boolean
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { DecisionNodeCondition, DecisionNodeTrigger } from './decision'
|
||||
|
||||
export interface LLMDecisionInput {
|
||||
state_id: string
|
||||
state: any
|
||||
@@ -8,6 +10,68 @@ export interface LLMDecisionInput {
|
||||
flow_slug?: string
|
||||
}
|
||||
|
||||
export type FlowActivationMode = 'main' | 'parallel' | 'linear'
|
||||
|
||||
export interface FlowActivationInstruction {
|
||||
slug: string
|
||||
mode?: FlowActivationMode
|
||||
}
|
||||
|
||||
export interface CandidateTraceEntry {
|
||||
id: string
|
||||
flow: string
|
||||
name?: string
|
||||
summary?: string
|
||||
role?: string
|
||||
triggers?: DecisionNodeTrigger[]
|
||||
conditions?: DecisionNodeCondition[]
|
||||
}
|
||||
|
||||
export type CandidateTraceStage =
|
||||
| 'regex_candidates'
|
||||
| 'regex_filtered'
|
||||
| 'condition_filtered'
|
||||
| 'fallback_candidates'
|
||||
| 'fallback_filtered'
|
||||
| 'final'
|
||||
|
||||
export interface CandidateTraceEliminationContext {
|
||||
patterns?: Array<{ id?: string; pattern?: string; flags?: string }>
|
||||
transcript?: string
|
||||
condition?: {
|
||||
id?: string
|
||||
type: DecisionNodeCondition['type']
|
||||
variable?: string
|
||||
operator?: string
|
||||
value?: number | string | boolean
|
||||
pattern?: string
|
||||
patternFlags?: string
|
||||
}
|
||||
actualValue?: any
|
||||
expectedValue?: any
|
||||
}
|
||||
|
||||
export interface CandidateTraceElimination {
|
||||
candidate: CandidateTraceEntry
|
||||
kind: 'regex' | 'condition'
|
||||
reason: string
|
||||
context?: CandidateTraceEliminationContext
|
||||
}
|
||||
|
||||
export interface CandidateTraceStep {
|
||||
stage: CandidateTraceStage
|
||||
label: string
|
||||
candidates: CandidateTraceEntry[]
|
||||
eliminated?: CandidateTraceElimination[]
|
||||
note?: string
|
||||
}
|
||||
|
||||
export interface DecisionCandidateTimeline {
|
||||
steps: CandidateTraceStep[]
|
||||
fallbackUsed?: boolean
|
||||
autoSelected?: CandidateTraceEntry | null
|
||||
}
|
||||
|
||||
export interface LLMDecision {
|
||||
next_state: string
|
||||
updates?: Record<string, any>
|
||||
@@ -15,6 +79,31 @@ export interface LLMDecision {
|
||||
controller_say_tpl?: string
|
||||
off_schema?: boolean
|
||||
radio_check?: boolean
|
||||
activate_flow?: string
|
||||
activate_flow?: string | FlowActivationInstruction
|
||||
resume_previous?: boolean
|
||||
}
|
||||
|
||||
export interface LLMDecisionTraceCall {
|
||||
stage: 'readback-check' | 'decision'
|
||||
request: Record<string, any>
|
||||
response?: any
|
||||
rawResponseText?: string
|
||||
error?: string
|
||||
}
|
||||
|
||||
export interface LLMDecisionTraceFallback {
|
||||
used: boolean
|
||||
reason?: string
|
||||
selected?: string
|
||||
}
|
||||
|
||||
export interface LLMDecisionTrace {
|
||||
calls: LLMDecisionTraceCall[]
|
||||
fallback?: LLMDecisionTraceFallback
|
||||
candidateTimeline?: DecisionCandidateTimeline
|
||||
autoSelection?: {
|
||||
id: string
|
||||
flow: string
|
||||
reason?: string
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user