/** * Phenotypic signal extraction from agent responses. * * These are NOT about what an agent says — they're about HOW it says it. * The behavioral patterns are involuntary expressions of the underlying * computational substrate, like a gait analysis for language models. */ import { type VocabularySignals, type TopologySignals, type CapabilityBoundarySignals, type ToolInteractionSignals, type AdversarialSignals, type ContextUtilizationSignals } from "../sensorium/senses/index.js"; export type { VocabularySignals, TopologySignals, CapabilityBoundarySignals, ToolInteractionSignals, AdversarialSignals, ContextUtilizationSignals, }; export interface CognitiveSignals { hedgeCount: number; certaintyCount: number; disclaimerCount: number; questionsBack: number; empathyMarkers: number; hedgeToCertaintyRatio: number; } export interface StructuralSignals { charCount: number; wordCount: number; lineCount: number; paragraphCount: number; bulletLines: number; numberedListLines: number; headerLines: number; codeBlocks: number; boldCount: number; listToContentRatio: number; openingPattern: "preamble" | "direct"; closingPattern: "question" | "offer" | "statement"; avgWordLength: number; avgSentenceLength: number; } export interface TemporalSignals { timeToFirstToken: number; interTokenIntervals: number[]; meanInterval: number; stdInterval: number; medianInterval: number; burstiness: number; totalStreamingDuration: number; tokenCount: number; } export interface ErrorSignals { containsRefusal: boolean; uncertaintyAdmissions: number; assertiveWhenWrong: number; attemptedImpossible: boolean; selfCorrections: number; confidenceRatio: number; } export interface PhenotypicSignals { cognitive: CognitiveSignals; structural: StructuralSignals; temporal: TemporalSignals; error: ErrorSignals; vocabulary?: VocabularySignals; topology?: TopologySignals; capabilityBoundary?: CapabilityBoundarySignals; toolInteraction?: ToolInteractionSignals; adversarial?: AdversarialSignals; contextUtilization?: ContextUtilizationSignals; } /** Raw streaming data captured during an API call. */ export interface StreamingTrace { tokenTimestamps: number[]; tokens: string[]; startTime: number; firstTokenTime: number | null; endTime: number; } export declare function extractCognitiveSignals(text: string): CognitiveSignals; export declare function extractStructuralSignals(text: string): StructuralSignals; export declare function extractTemporalSignals(trace: StreamingTrace): TemporalSignals; export declare function extractErrorSignals(text: string, probeCategory: string): ErrorSignals; /** * Extract all phenotypic signals from a response + streaming trace. * This is the complete "observation" of a single agent expression. */ export declare function extractAllSignals(responseText: string, trace: StreamingTrace, probeCategory: string): PhenotypicSignals; /** * Flatten phenotypic signals into a numeric feature vector for ML classification. * Categorical features (openingPattern, closingPattern) are one-hot encoded. */ export declare function signalsToFeatureVector(signals: PhenotypicSignals): number[]; /** Feature names corresponding to signalsToFeatureVector output. */ export declare const FEATURE_NAMES: string[]; //# sourceMappingURL=signals.d.ts.map