All files / src/llm-orchestration llm-orchestration.interfaces.ts

100% Statements 7/7
100% Branches 0/0
100% Functions 1/1
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79                        33x                                               1242x 1242x 1242x 1242x         1242x       1242x                                                            
export interface ActionExecutionResult {
  status: 'SUCCESS' | 'FAILURE';
  summary: string;
  error_message?: string;
  persisted_args?: Record<string, any>;
  execution_log?: {
    output: string;
    error_message?: string;
  };
  original_content_for_revert?: string | null;
}
 
export class PlanExecutionContext {
  session_id: string; // Current session being processed
  system_prompt_id: string | null; // System prompt for the session
  originalParsedActions: any[];
  flags: {
    should_halt: boolean;
    halt_reason?: string;
    should_halt_hooks: boolean;
    is_final?: boolean;
    follow_up_initiated?: boolean;
  };
  feedback: {
    invalidToolErrors: { tool_name: string; arguments: any }[];
    validationErrors: { tool_name: string; error: string }[];
  };
 
  // Stores results from native tool calling for history updates
  toolResults: {
    toolCallId: string;
    toolName: string;
    result: string;
  }[];
 
  constructor() {
    this.session_id = '';
    this.system_prompt_id = null;
    this.originalParsedActions = [];
    this.flags = {
      should_halt: false,
      should_halt_hooks: false,
      follow_up_initiated: false,
    };
    this.feedback = {
      invalidToolErrors: [],
      validationErrors: [],
    };
    this.toolResults = [];
  }
}
 
// New interfaces for unified tool definitions
 
export interface ToolArgument {
  name: string;
  type: 'string' | 'number' | 'boolean' | 'array' | 'object';
  description: string;
  required: boolean;
}
 
export interface ToolMetadata {
  name: string;
  description: string;
  arguments: ToolArgument[];
}
 
// Legacy types for parser
export interface Action {
  tool_name: string;
  arguments: any;
  toolCallId?: string; // Optional ID for native function calls
}
 
export interface ParsedLlmOutput {
  explanation: string | null;
  actions: Action[];
}