@ax-llm/ax 19.0.16 → 19.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.cts CHANGED
@@ -2306,6 +2306,7 @@ interface AxOptimizedProgram<OUT = any> {
2306
2306
  bestScore: number;
2307
2307
  stats: AxOptimizationStats;
2308
2308
  instruction?: string;
2309
+ instructionMap?: Record<string, string>;
2309
2310
  demos?: AxProgramDemos<any, OUT>[];
2310
2311
  modelConfig?: {
2311
2312
  temperature?: number;
@@ -2329,6 +2330,7 @@ declare class AxOptimizedProgramImpl<OUT = any> implements AxOptimizedProgram<OU
2329
2330
  readonly bestScore: number;
2330
2331
  readonly stats: AxOptimizationStats;
2331
2332
  readonly instruction?: string;
2333
+ readonly instructionMap?: Record<string, string>;
2332
2334
  readonly demos?: AxProgramDemos<any, OUT>[];
2333
2335
  readonly examples?: AxExample$1[];
2334
2336
  readonly modelConfig?: {
@@ -2351,6 +2353,7 @@ declare class AxOptimizedProgramImpl<OUT = any> implements AxOptimizedProgram<OU
2351
2353
  bestScore: number;
2352
2354
  stats: AxOptimizationStats;
2353
2355
  instruction?: string;
2356
+ instructionMap?: Record<string, string>;
2354
2357
  demos?: AxProgramDemos<any, OUT>[];
2355
2358
  examples?: AxExample$1[];
2356
2359
  modelConfig?: AxOptimizedProgram<OUT>['modelConfig'];
@@ -2863,6 +2866,7 @@ declare class AxProgram<IN = any, OUT = any> implements AxUsable, AxTunable<IN,
2863
2866
  id: string;
2864
2867
  signature?: string;
2865
2868
  }>;
2869
+ namedProgramInstances(): AxNamedProgramInstance<IN, OUT>[];
2866
2870
  applyOptimization(optimizedProgram: AxOptimizedProgram<OUT>): void;
2867
2871
  }
2868
2872
 
@@ -3578,11 +3582,17 @@ interface AxTunable<IN, OUT> {
3578
3582
  getId(): string;
3579
3583
  setId(id: string): void;
3580
3584
  getTraces(): AxProgramTrace<IN, OUT>[];
3585
+ namedProgramInstances?(): AxNamedProgramInstance<any, any>[];
3581
3586
  setDemos(demos: readonly AxProgramDemos<IN, OUT>[], options?: {
3582
3587
  modelConfig?: Record<string, unknown>;
3583
3588
  }): void;
3584
3589
  applyOptimization(optimizedProgram: AxOptimizedProgram<OUT>): void;
3585
3590
  }
3591
+ type AxNamedProgramInstance<IN = any, OUT = any> = {
3592
+ id: string;
3593
+ program: AxTunable<IN, OUT>;
3594
+ signature?: string;
3595
+ };
3586
3596
  interface AxUsable {
3587
3597
  getUsage(): AxProgramUsage[];
3588
3598
  resetUsage(): void;
@@ -7485,6 +7495,19 @@ interface AxTrace {
7485
7495
  /** Custom metadata */
7486
7496
  metadata?: Record<string, unknown>;
7487
7497
  }
7498
+ type AxLearnCheckpointMode = 'batch' | 'continuous' | 'playbook';
7499
+ interface AxLearnCheckpointState {
7500
+ mode: AxLearnCheckpointMode;
7501
+ instruction?: string;
7502
+ baseInstruction?: string;
7503
+ score?: number;
7504
+ continuous?: {
7505
+ feedbackTraceCount?: number;
7506
+ lastUpdateAt?: string;
7507
+ };
7508
+ playbook?: Record<string, unknown>;
7509
+ artifactSummary?: Record<string, unknown>;
7510
+ }
7488
7511
  /**
7489
7512
  * Represents a serialized checkpoint of an AxGen configuration.
7490
7513
  */
@@ -7507,6 +7530,8 @@ interface AxCheckpoint {
7507
7530
  score?: number;
7508
7531
  /** Optimization method used */
7509
7532
  optimizerType?: string;
7533
+ /** Typed AxLearn state, when the checkpoint comes from AxLearn */
7534
+ learnState?: AxLearnCheckpointState;
7510
7535
  /** Custom metadata */
7511
7536
  metadata?: Record<string, unknown>;
7512
7537
  }
@@ -7538,220 +7563,568 @@ type AxStorage = {
7538
7563
  };
7539
7564
 
7540
7565
  /**
7541
- * AxSynth - Synthetic data generator for bootstrapping optimization datasets.
7542
- *
7543
- * Generates diverse input examples and uses a teacher model to produce
7544
- * high-quality labeled outputs. Solves the "cold start" problem when
7545
- * users have no training data.
7566
+ * Individual playbook bullet with metadata used for incremental updates.
7567
+ * Mirrors the structure described in the ACE paper (Section 3.1).
7546
7568
  */
7547
-
7569
+ interface AxACEBullet extends Record<string, unknown> {
7570
+ id: string;
7571
+ section: string;
7572
+ content: string;
7573
+ helpfulCount: number;
7574
+ harmfulCount: number;
7575
+ createdAt: string;
7576
+ updatedAt: string;
7577
+ tags?: string[];
7578
+ metadata?: Record<string, unknown>;
7579
+ }
7548
7580
  /**
7549
- * Configuration for synthetic data generation.
7581
+ * Aggregated ACE playbook structure grouped by sections.
7550
7582
  */
7551
- interface AxSynthOptions {
7552
- /** Teacher AI to use for labeling generated inputs */
7553
- teacher: AxAIService;
7554
- /**
7555
- * Diversity strategy for input generation.
7556
- * - 'semantic': Use embeddings to maximize semantic diversity
7557
- * - 'lexical': Use token-based diversity
7558
- * - 'none': No diversity filtering (default)
7559
- */
7560
- diversity?: 'semantic' | 'lexical' | 'none';
7561
- /** Domain context for generating relevant examples */
7562
- domain?: string;
7563
- /**
7564
- * Edge case hints for generating challenging examples.
7565
- * Examples: "empty inputs", "very long queries", "special characters"
7566
- */
7567
- edgeCases?: string[];
7568
- /** Temperature for input generation (default: 0.8) */
7569
- temperature?: number;
7570
- /** Model to use for generation (optional, uses teacher's default) */
7571
- model?: string;
7583
+ interface AxACEPlaybook {
7584
+ version: number;
7585
+ sections: Record<string, AxACEBullet[]>;
7586
+ stats: {
7587
+ bulletCount: number;
7588
+ helpfulCount: number;
7589
+ harmfulCount: number;
7590
+ tokenEstimate: number;
7591
+ };
7592
+ updatedAt: string;
7593
+ description?: string;
7572
7594
  }
7573
7595
  /**
7574
- * A single synthesized example with input and expected output.
7596
+ * Generator output format (Appendix B of the paper) distilled to core fields.
7575
7597
  */
7576
- interface AxSynthExample {
7577
- /** Generated input values */
7578
- input: Record<string, unknown>;
7579
- /** Expected output values from teacher model */
7580
- expected: Record<string, unknown>;
7581
- /** Category of the example (normal, edge case, etc.) */
7582
- category?: string;
7598
+ interface AxACEGeneratorOutput extends Record<string, unknown> {
7599
+ reasoning: string;
7600
+ answer: unknown;
7601
+ bulletIds: string[];
7602
+ trajectory?: string;
7603
+ metadata?: Record<string, unknown>;
7583
7604
  }
7584
7605
  /**
7585
- * Result from a synthesis run.
7606
+ * Reflection payload, mapping to the Reflector JSON schema in the paper.
7586
7607
  */
7587
- interface AxSynthResult {
7588
- /** Generated examples */
7589
- examples: AxSynthExample[];
7590
- /** Statistics about the generation */
7591
- stats: {
7592
- requested: number;
7593
- generated: number;
7594
- labelingSuccessRate: number;
7595
- durationMs: number;
7596
- };
7608
+ interface AxACEReflectionOutput extends Record<string, unknown> {
7609
+ reasoning: string;
7610
+ errorIdentification: string;
7611
+ rootCauseAnalysis: string;
7612
+ correctApproach: string;
7613
+ keyInsight: string;
7614
+ bulletTags: {
7615
+ id: string;
7616
+ tag: 'helpful' | 'harmful' | 'neutral';
7617
+ }[];
7618
+ metadata?: Record<string, unknown>;
7597
7619
  }
7598
7620
  /**
7599
- * AxSynth generates synthetic training data.
7600
- *
7601
- * @example
7602
- * ```typescript
7603
- * const synth = new AxSynth(signature, {
7604
- * teacher: ai('openai', { model: 'gpt-4o' }),
7605
- * domain: 'customer support',
7606
- * edgeCases: ['angry customers', 'vague requests'],
7607
- * });
7608
- *
7609
- * const { examples } = await synth.generate(100);
7610
- * ```
7621
+ * Curator operations emitted as deltas (Section 3.1).
7611
7622
  */
7612
- declare class AxSynth<IN extends AxGenIn, OUT extends AxGenOut> {
7613
- private signature;
7614
- private options;
7615
- constructor(signature: AxSignature<IN, OUT>, options: AxSynthOptions);
7623
+ type AxACECuratorOperationType = 'ADD' | 'UPDATE' | 'REMOVE';
7624
+ interface AxACECuratorOperation {
7625
+ type: AxACECuratorOperationType;
7626
+ section: string;
7627
+ bulletId?: string;
7628
+ content?: string;
7629
+ metadata?: Record<string, unknown>;
7630
+ }
7631
+ interface AxACECuratorOutput extends Record<string, unknown> {
7632
+ reasoning: string;
7633
+ operations: AxACECuratorOperation[];
7634
+ metadata?: Record<string, unknown>;
7635
+ }
7636
+ /**
7637
+ * Runtime feedback captured after each generator rollout for online updates.
7638
+ */
7639
+ interface AxACEFeedbackEvent {
7640
+ example: AxExample$1;
7641
+ prediction: unknown;
7642
+ score: number;
7643
+ generatorOutput: AxACEGeneratorOutput;
7644
+ reflection?: AxACEReflectionOutput;
7645
+ curator?: AxACECuratorOutput;
7646
+ timestamp: string;
7647
+ }
7648
+ /**
7649
+ * Configuration options specific to ACE inside Ax.
7650
+ */
7651
+ interface AxACEOptions {
7616
7652
  /**
7617
- * Generate synthetic examples.
7653
+ * Maximum number of epochs for offline adaptation.
7618
7654
  */
7619
- generate(count: number, options?: {
7620
- batchSize?: number;
7621
- }): Promise<AxSynthResult>;
7655
+ maxEpochs?: number;
7622
7656
  /**
7623
- * Generate diverse input examples using a synthesis prompt.
7657
+ * Maximum reflector refinement rounds (paper uses up to 5).
7624
7658
  */
7625
- private generateInputs;
7659
+ maxReflectorRounds?: number;
7626
7660
  /**
7627
- * Generate edge case inputs based on hints.
7661
+ * Maximum bullets allowed in any section before triggering pruning.
7628
7662
  */
7629
- private generateEdgeCaseInputs;
7663
+ maxSectionSize?: number;
7630
7664
  /**
7631
- * Label an input using the teacher model.
7665
+ * Optional similarity threshold used by the semantic deduper.
7632
7666
  */
7633
- private labelInput;
7667
+ similarityThreshold?: number;
7634
7668
  /**
7635
- * Get the signature being used.
7669
+ * Whether to automatically create sections when curator emits new ones.
7636
7670
  */
7637
- getSignature(): AxSignature<IN, OUT>;
7671
+ allowDynamicSections?: boolean;
7638
7672
  /**
7639
- * Get the teacher AI service.
7673
+ * Initial playbook supplied by the caller.
7640
7674
  */
7641
- getTeacher(): AxAIService;
7675
+ initialPlaybook?: AxACEPlaybook;
7642
7676
  }
7643
-
7644
7677
  /**
7645
- * AxLearn - Self-improving agent that learns from traces and feedback.
7646
- *
7647
- * Combines AxGen with automatic trace logging, storage, and an optimization loop.
7648
- * This is the high-level API for creating agents that get better over time.
7678
+ * Serialized artifact saved after optimization for future reuse.
7649
7679
  */
7680
+ interface AxACEOptimizationArtifact {
7681
+ playbook: AxACEPlaybook;
7682
+ feedback: AxACEFeedbackEvent[];
7683
+ history: {
7684
+ epoch: number;
7685
+ exampleIndex: number;
7686
+ operations: AxACECuratorOperation[];
7687
+ }[];
7688
+ }
7650
7689
 
7651
- /**
7652
- * Configuration for the AxLearn agent.
7653
- * Combines agent configuration (name, storage) with learning configuration (teacher, budget).
7654
- */
7655
- interface AxLearnOptions {
7656
- /** Unique identifier/name for this agent */
7657
- name: string;
7658
- /** Storage backend (Required) */
7659
- storage: AxStorage;
7660
- /** Whether to log traces (default: true) */
7661
- enableTracing?: boolean;
7662
- /** Custom metadata for all traces */
7663
- metadata?: Record<string, unknown>;
7664
- /** Callback when a trace is logged */
7665
- onTrace?: (trace: AxTrace) => void;
7666
- /** Teacher AI for synthetic data generation and judging (Required) */
7667
- teacher: AxAIService;
7668
- /** Maximum optimization rounds (default: 20) */
7669
- budget?: number;
7670
- /** Custom metric function (if not provided, auto-generates using AxJudge) */
7671
- metric?: AxMetricFn;
7672
- /** Judge options when auto-generating metric */
7673
- judgeOptions?: Partial<AxJudgeOptions>;
7674
- /** Custom evaluation criteria for judge */
7675
- criteria?: string;
7676
- /** Training examples (manual) */
7677
- examples?: AxTypedExample<AxGenIn>[];
7678
- /** Whether to use capture traces as training examples (default: true) */
7679
- useTraces?: boolean;
7680
- /** Whether to generate synthetic examples (default: true if no other data) */
7681
- generateExamples?: boolean;
7682
- /** Number of synthetic examples to generate */
7683
- synthCount?: number;
7684
- /** Synth options for data generation */
7685
- synthOptions?: Partial<AxSynthOptions>;
7686
- /** Validation split ratio (default: 0.2) */
7687
- validationSplit?: number;
7688
- /** Progress callback */
7689
- onProgress?: (progress: AxLearnProgress) => void;
7690
+ interface AxACECompileOptions extends AxCompileOptions {
7691
+ aceOptions?: AxACEOptions;
7692
+ }
7693
+ interface AxACEResult<OUT extends AxGenOut> extends AxOptimizerResult<OUT> {
7694
+ optimizedProgram?: AxACEOptimizedProgram<OUT>;
7695
+ playbook: AxACEPlaybook;
7696
+ artifact: AxACEOptimizationArtifact;
7690
7697
  }
7691
7698
  /**
7692
- * Progress callback for monitoring optimization.
7699
+ * Optimized program artifact that persists ACE playbook updates.
7693
7700
  */
7694
- interface AxLearnProgress {
7695
- /** Current round number */
7696
- round: number;
7697
- /** Total rounds */
7698
- totalRounds: number;
7699
- /** Current best score */
7700
- score: number;
7701
- /** Score improvement from previous round */
7702
- improvement: number;
7701
+ declare class AxACEOptimizedProgram<OUT = any> extends AxOptimizedProgramImpl<OUT> {
7702
+ readonly playbook: AxACEPlaybook;
7703
+ readonly artifact: AxACEOptimizationArtifact;
7704
+ private readonly baseInstruction?;
7705
+ constructor(config: {
7706
+ baseInstruction?: string;
7707
+ playbook: AxACEPlaybook;
7708
+ artifact: AxACEOptimizationArtifact;
7709
+ bestScore: number;
7710
+ stats: AxOptimizationStats;
7711
+ optimizerType: string;
7712
+ optimizationTime: number;
7713
+ totalRounds: number;
7714
+ converged: boolean;
7715
+ instruction?: string;
7716
+ demos?: AxOptimizedProgram<OUT>['demos'];
7717
+ examples?: AxExample$1[];
7718
+ modelConfig?: AxOptimizedProgram<OUT>['modelConfig'];
7719
+ scoreHistory?: number[];
7720
+ configurationHistory?: Record<string, unknown>[];
7721
+ });
7722
+ applyTo<IN, T extends AxGenOut>(program: AxGen<IN, T>): void;
7703
7723
  }
7704
7724
  /**
7705
- * Result from an optimize operation.
7706
- */
7725
+ * AxACE implements the Agentic Context Engineering loop (Generator → Reflector → Curator).
7726
+ * The implementation mirrors the paper's architecture while integrating with the Ax optimizer
7727
+ * ergonomics (unified optimized program artifacts, metrics, and checkpointing).
7728
+ */
7729
+ declare class AxACE extends AxBaseOptimizer {
7730
+ private readonly aceConfig;
7731
+ private playbook;
7732
+ private baseInstruction?;
7733
+ private generatorHistory;
7734
+ private deltaHistory;
7735
+ private reflectorProgram?;
7736
+ private curatorProgram?;
7737
+ private program?;
7738
+ constructor(args: Readonly<AxOptimizerArgs>, options?: Readonly<AxACEOptions>);
7739
+ reset(): void;
7740
+ hydrate<IN, OUT extends AxGenOut>(program: Readonly<AxGen<IN, OUT>>, state?: Readonly<{
7741
+ baseInstruction?: string;
7742
+ playbook?: AxACEPlaybook;
7743
+ artifact?: Partial<AxACEOptimizationArtifact>;
7744
+ }>): void;
7745
+ getPlaybook(): AxACEPlaybook;
7746
+ getBaseInstruction(): string | undefined;
7747
+ getArtifact(): AxACEOptimizationArtifact;
7748
+ applyCurrentState<IN, OUT extends AxGenOut>(program?: AxGen<IN, OUT>): void;
7749
+ configureAuto(level: 'light' | 'medium' | 'heavy'): void;
7750
+ compile<IN, OUT extends AxGenOut>(program: Readonly<AxGen<IN, OUT>>, examples: readonly AxTypedExample<IN>[], metricFn: AxMetricFn, options?: AxACECompileOptions): Promise<AxACEResult<OUT>>;
7751
+ /**
7752
+ * Apply ACE updates after each online inference. Mirrors the online adaptation
7753
+ * flow described in the paper; can be called by user-land code between queries.
7754
+ */
7755
+ applyOnlineUpdate(args: Readonly<{
7756
+ example: AxExample$1;
7757
+ prediction: unknown;
7758
+ feedback?: string;
7759
+ }>): Promise<AxACECuratorOutput | undefined>;
7760
+ private composeInstruction;
7761
+ private extractProgramInstruction;
7762
+ private createGeneratorOutput;
7763
+ private resolveCuratorOperationTargets;
7764
+ private locateBullet;
7765
+ private locateFallbackBullet;
7766
+ private collectProtectedBulletIds;
7767
+ private normalizeCuratorOperations;
7768
+ private inferOperationsFromReflection;
7769
+ private runReflectionRounds;
7770
+ private runReflector;
7771
+ private runCurator;
7772
+ private getOrCreateReflectorProgram;
7773
+ private getOrCreateCuratorProgram;
7774
+ }
7775
+
7776
+ /** Structured optimization report */
7777
+ interface AxGEPAOptimizationReport {
7778
+ summary: string;
7779
+ bestSolution: {
7780
+ overallScore: number;
7781
+ objectives: Record<string, {
7782
+ value: number;
7783
+ percentage: number;
7784
+ }>;
7785
+ };
7786
+ paretoFrontier: {
7787
+ solutionCount: number;
7788
+ objectiveSpaceCoverage: number;
7789
+ hypervolume: number;
7790
+ tradeoffs?: Array<Record<string, number>>;
7791
+ };
7792
+ statistics: {
7793
+ totalEvaluations: number;
7794
+ candidatesExplored: number;
7795
+ converged: boolean;
7796
+ };
7797
+ recommendations: {
7798
+ status: 'good' | 'limited' | 'single';
7799
+ suggestions: string[];
7800
+ };
7801
+ }
7802
+ /** Single-module GEPA (reflective prompt evolution with Pareto sampling) */
7803
+ declare class AxGEPA extends AxBaseOptimizer {
7804
+ private numTrials;
7805
+ private minibatch;
7806
+ private minibatchSize;
7807
+ private earlyStoppingTrials;
7808
+ private minImprovementThreshold;
7809
+ private sampleCount;
7810
+ private paretoSetSize;
7811
+ private crossoverEvery;
7812
+ private tieEpsilon;
7813
+ private feedbackMemorySize;
7814
+ private feedbackMemory;
7815
+ private mergeMax;
7816
+ private mergesUsed;
7817
+ private mergesDue;
7818
+ private totalMergesTested;
7819
+ private lastIterFoundNewProgram;
7820
+ private mergeAttemptKeys;
7821
+ private mergeCompositionKeys;
7822
+ private static readonly REFLECTION_PROMPT_TEMPLATE;
7823
+ private rngState;
7824
+ private samplerState;
7825
+ private localScoreHistory;
7826
+ private localConfigurationHistory;
7827
+ constructor(args: Readonly<AxOptimizerArgs>);
7828
+ reset(): void;
7829
+ /**
7830
+ * Multi-objective GEPA: reflective evolution with Pareto frontier
7831
+ */
7832
+ compile<IN, OUT extends AxGenOut>(program: Readonly<AxProgrammable<IN, OUT>>, examples: readonly AxTypedExample<IN>[], metricFn: AxMetricFn | AxMultiMetricFn, options?: AxCompileOptions): Promise<AxParetoResult<OUT>>;
7833
+ /** Lightweight auto presets */
7834
+ configureAuto(level: 'light' | 'medium' | 'heavy'): void;
7835
+ private getBaseInstruction;
7836
+ private getInstructionTargets;
7837
+ private evaluateOnSet;
7838
+ private evaluateAvg;
7839
+ private evaluateOne;
7840
+ private reflectTargetInstruction;
7841
+ private reflectInstruction;
7842
+ /**
7843
+ * Extract instruction text from LLM output enclosed in backticks (aligned with reference)
7844
+ */
7845
+ private extractInstructionFromBackticks;
7846
+ private updateSamplerShuffled;
7847
+ private nextMinibatchIndices;
7848
+ private rand;
7849
+ private systemAwareMergeWithSig;
7850
+ private generateOptimizationReport;
7851
+ private mergeInstructions;
7852
+ }
7853
+
7854
+ /**
7855
+ * AxSynth - Synthetic data generator for bootstrapping optimization datasets.
7856
+ *
7857
+ * Generates diverse input examples and uses a teacher model to produce
7858
+ * high-quality labeled outputs. Solves the "cold start" problem when
7859
+ * users have no training data.
7860
+ */
7861
+
7862
+ /**
7863
+ * Configuration for synthetic data generation.
7864
+ */
7865
+ interface AxSynthOptions {
7866
+ /** Teacher AI to use for labeling generated inputs */
7867
+ teacher: AxAIService;
7868
+ /**
7869
+ * Diversity strategy for input generation.
7870
+ * - 'semantic': Use embeddings to maximize semantic diversity
7871
+ * - 'lexical': Use token-based diversity
7872
+ * - 'none': No diversity filtering (default)
7873
+ */
7874
+ diversity?: 'semantic' | 'lexical' | 'none';
7875
+ /** Domain context for generating relevant examples */
7876
+ domain?: string;
7877
+ /**
7878
+ * Edge case hints for generating challenging examples.
7879
+ * Examples: "empty inputs", "very long queries", "special characters"
7880
+ */
7881
+ edgeCases?: string[];
7882
+ /** Temperature for input generation (default: 0.8) */
7883
+ temperature?: number;
7884
+ /** Model to use for generation (optional, uses teacher's default) */
7885
+ model?: string;
7886
+ }
7887
+ /**
7888
+ * A single synthesized example with input and expected output.
7889
+ */
7890
+ interface AxSynthExample {
7891
+ /** Generated input values */
7892
+ input: Record<string, unknown>;
7893
+ /** Expected output values from teacher model */
7894
+ expected: Record<string, unknown>;
7895
+ /** Category of the example (normal, edge case, etc.) */
7896
+ category?: string;
7897
+ }
7898
+ /**
7899
+ * Result from a synthesis run.
7900
+ */
7901
+ interface AxSynthResult {
7902
+ /** Generated examples */
7903
+ examples: AxSynthExample[];
7904
+ /** Statistics about the generation */
7905
+ stats: {
7906
+ requested: number;
7907
+ generated: number;
7908
+ labelingSuccessRate: number;
7909
+ durationMs: number;
7910
+ };
7911
+ }
7912
+ /**
7913
+ * AxSynth generates synthetic training data.
7914
+ *
7915
+ * @example
7916
+ * ```typescript
7917
+ * const synth = new AxSynth(signature, {
7918
+ * teacher: ai('openai', { model: 'gpt-4o' }),
7919
+ * domain: 'customer support',
7920
+ * edgeCases: ['angry customers', 'vague requests'],
7921
+ * });
7922
+ *
7923
+ * const { examples } = await synth.generate(100);
7924
+ * ```
7925
+ */
7926
+ declare class AxSynth<IN extends AxGenIn, OUT extends AxGenOut> {
7927
+ private signature;
7928
+ private options;
7929
+ constructor(signature: AxSignature<IN, OUT>, options: AxSynthOptions);
7930
+ /**
7931
+ * Generate synthetic examples.
7932
+ */
7933
+ generate(count: number, options?: {
7934
+ batchSize?: number;
7935
+ }): Promise<AxSynthResult>;
7936
+ /**
7937
+ * Generate diverse input examples using a synthesis prompt.
7938
+ */
7939
+ private generateInputs;
7940
+ /**
7941
+ * Generate edge case inputs based on hints.
7942
+ */
7943
+ private generateEdgeCaseInputs;
7944
+ /**
7945
+ * Label an input using the teacher model.
7946
+ */
7947
+ private labelInput;
7948
+ /**
7949
+ * Get the signature being used.
7950
+ */
7951
+ getSignature(): AxSignature<IN, OUT>;
7952
+ /**
7953
+ * Get the teacher AI service.
7954
+ */
7955
+ getTeacher(): AxAIService;
7956
+ }
7957
+
7958
+ /**
7959
+ * AxLearn - Self-improving agent that learns from traces and feedback.
7960
+ *
7961
+ * Combines AxGen with automatic trace logging, storage, and mode-based
7962
+ * optimization/update flows.
7963
+ */
7964
+
7965
+ type AxLearnMode = AxLearnCheckpointMode;
7966
+ type AxLearnPlaybook = AxACEPlaybook;
7967
+ interface AxLearnContinuousOptions {
7968
+ feedbackWindowSize?: number;
7969
+ maxRecentTraces?: number;
7970
+ updateBudget?: number;
7971
+ }
7972
+ type AxLearnPlaybookOptions = Partial<AxACEOptions>;
7973
+ /**
7974
+ * Configuration for the AxLearn agent.
7975
+ */
7976
+ interface AxLearnOptions {
7977
+ /** Unique identifier/name for this agent */
7978
+ name: string;
7979
+ /** Storage backend (Required) */
7980
+ storage: AxStorage;
7981
+ /** Runtime model whose outputs should be improved */
7982
+ runtimeAI?: AxAIService;
7983
+ /** Learning mode (default: batch) */
7984
+ mode?: AxLearnMode;
7985
+ /** Whether to log traces (default: true) */
7986
+ enableTracing?: boolean;
7987
+ /** Custom metadata for all traces */
7988
+ metadata?: Record<string, unknown>;
7989
+ /** Callback when a trace is logged */
7990
+ onTrace?: (trace: AxTrace) => void;
7991
+ /** Teacher AI for synthetic data generation and judging (Required) */
7992
+ teacher: AxAIService;
7993
+ /** Maximum optimization rounds (default: 20) */
7994
+ budget?: number;
7995
+ /** Custom metric function (if not provided, auto-generates using AxJudge) */
7996
+ metric?: AxMetricFn;
7997
+ /** Judge options when auto-generating metric */
7998
+ judgeOptions?: Partial<AxJudgeOptions>;
7999
+ /** Custom evaluation criteria for judge */
8000
+ criteria?: string;
8001
+ /** Training examples (manual) */
8002
+ examples?: AxTypedExample<AxGenIn>[];
8003
+ /** Whether to use captured traces as training examples (default: true) */
8004
+ useTraces?: boolean;
8005
+ /** Whether to generate synthetic examples (default: true if no other data) */
8006
+ generateExamples?: boolean;
8007
+ /** Number of synthetic examples to generate */
8008
+ synthCount?: number;
8009
+ /** Synth options for data generation */
8010
+ synthOptions?: Partial<AxSynthOptions>;
8011
+ /** Validation split ratio (default: 0.2, clamped to keep train + validation non-empty) */
8012
+ validationSplit?: number;
8013
+ /** Mode-specific configuration for bounded continuous updates */
8014
+ continuousOptions?: AxLearnContinuousOptions;
8015
+ /** Mode-specific configuration for playbook learning */
8016
+ playbookOptions?: AxLearnPlaybookOptions;
8017
+ /** Progress callback */
8018
+ onProgress?: (progress: AxLearnProgress) => void;
8019
+ }
8020
+ interface AxLearnOptimizeOptions {
8021
+ runtimeAI?: AxAIService;
8022
+ budget?: number;
8023
+ metric?: AxMetricFn;
8024
+ judgeOptions?: Partial<AxJudgeOptions>;
8025
+ criteria?: string;
8026
+ examples?: AxTypedExample<AxGenIn>[];
8027
+ useTraces?: boolean;
8028
+ generateExamples?: boolean;
8029
+ synthCount?: number;
8030
+ synthOptions?: Partial<AxSynthOptions>;
8031
+ validationSplit?: number;
8032
+ continuousOptions?: AxLearnContinuousOptions;
8033
+ playbookOptions?: AxLearnPlaybookOptions;
8034
+ onProgress?: (progress: AxLearnProgress) => void;
8035
+ }
8036
+ type AxLearnUpdateFeedback = string | NonNullable<AxTrace['feedback']>;
8037
+ interface AxLearnUpdateInput<IN extends AxGenIn = AxGenIn, OUT extends AxGenOut = AxGenOut> {
8038
+ example: AxTypedExample<IN>;
8039
+ prediction: OUT;
8040
+ feedback?: AxLearnUpdateFeedback;
8041
+ }
8042
+ interface AxLearnUpdateOptions {
8043
+ runtimeAI?: AxAIService;
8044
+ budget?: number;
8045
+ metric?: AxMetricFn;
8046
+ judgeOptions?: Partial<AxJudgeOptions>;
8047
+ criteria?: string;
8048
+ continuousOptions?: AxLearnContinuousOptions;
8049
+ playbookOptions?: AxLearnPlaybookOptions;
8050
+ onProgress?: (progress: AxLearnProgress) => void;
8051
+ }
8052
+ interface AxLearnPlaybookSummary {
8053
+ feedbackEvents: number;
8054
+ historyBatches: number;
8055
+ bulletCount: number;
8056
+ updatedAt?: string;
8057
+ }
8058
+ interface AxLearnArtifact {
8059
+ playbook?: AxLearnPlaybook;
8060
+ playbookSummary?: AxLearnPlaybookSummary;
8061
+ lastUpdateAt?: string;
8062
+ feedbackExamples?: number;
8063
+ }
8064
+ /**
8065
+ * Progress callback for monitoring optimization.
8066
+ */
8067
+ interface AxLearnProgress {
8068
+ round: number;
8069
+ totalRounds: number;
8070
+ score: number;
8071
+ improvement: number;
8072
+ }
8073
+ /**
8074
+ * Result from optimize/applyUpdate operations.
8075
+ */
7707
8076
  interface AxLearnResult<_IN extends AxGenIn, _OUT extends AxGenOut> {
7708
- /** Final score achieved */
8077
+ mode: AxLearnMode;
7709
8078
  score: number;
7710
- /** Score improvement from original */
7711
8079
  improvement: number;
7712
- /** Checkpoint version saved */
7713
8080
  checkpointVersion: number;
7714
- /** Statistics */
7715
8081
  stats: {
7716
8082
  trainingExamples: number;
7717
8083
  validationExamples: number;
8084
+ feedbackExamples: number;
7718
8085
  durationMs: number;
8086
+ mode: AxLearnMode;
7719
8087
  };
8088
+ state?: AxLearnCheckpointState;
8089
+ artifact?: AxLearnArtifact;
7720
8090
  }
8091
+ type AxLearnMergedConfig = {
8092
+ runtimeAI?: AxAIService;
8093
+ mode: AxLearnMode;
8094
+ teacher: AxAIService;
8095
+ budget: number;
8096
+ metric?: AxMetricFn;
8097
+ judgeOptions?: Partial<AxJudgeOptions>;
8098
+ criteria?: string;
8099
+ examples?: AxTypedExample<AxGenIn>[];
8100
+ useTraces: boolean;
8101
+ generateExamples: boolean;
8102
+ synthCount?: number;
8103
+ synthOptions?: Partial<AxSynthOptions>;
8104
+ validationSplit: number;
8105
+ continuousOptions: Required<AxLearnContinuousOptions>;
8106
+ playbookOptions?: AxLearnPlaybookOptions;
8107
+ onProgress?: (progress: AxLearnProgress) => void;
8108
+ };
7721
8109
  /**
7722
8110
  * AxLearn wraps an AxGen with automatic trace logging and self-improvement capabilities.
7723
- *
7724
- * @example
7725
- * ```typescript
7726
- * const gen = ax(`question -> answer`);
7727
- *
7728
- * // Create the learner with all configuration
7729
- * const learner = new AxLearn(gen, {
7730
- * name: 'math-bot',
7731
- * teacher: gpt4o,
7732
- * storage: new AxMemoryStorage(),
7733
- * budget: 20
7734
- * });
7735
- *
7736
- * // Use in production
7737
- * await learner.forward(ai, { question: 'What is 2+2?' });
7738
- *
7739
- * // Run optimization (uses config from constructor)
7740
- * await learner.optimize();
7741
- * ```
7742
8111
  */
7743
8112
  declare class AxLearn<IN extends AxGenIn, OUT extends AxGenOut> implements AxForwardable<IN, OUT, string>, AxUsable {
7744
8113
  private gen;
7745
8114
  private options;
7746
8115
  private tracer;
7747
8116
  private currentScore?;
8117
+ private currentState?;
8118
+ private readyPromise;
8119
+ private playbookOptimizer?;
7748
8120
  constructor(gen: AxGen<IN, OUT>, options: AxLearnOptions);
8121
+ ready(): Promise<void>;
7749
8122
  /**
7750
- * Forward call - behaves exactly like AxGen.forward() but logs traces.
8123
+ * Forward call - behaves like AxGen.forward() but waits for restore and logs traces.
7751
8124
  */
7752
8125
  forward(ai: AxAIService, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramForwardOptions<string>>): Promise<OUT>;
7753
8126
  /**
7754
- * Streaming forward call - behaves exactly like AxGen.streamingForward() but logs traces.
8127
+ * Streaming forward call - behaves like AxGen.streamingForward() but waits for restore and logs traces.
7755
8128
  */
7756
8129
  streamingForward(ai: AxAIService, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramForwardOptions<string>>): AxGenStreamingOut<OUT>;
7757
8130
  getUsage(): AxProgramUsage[];
@@ -7774,14 +8147,13 @@ declare class AxLearn<IN extends AxGenIn, OUT extends AxGenOut> implements AxFor
7774
8147
  }) => unknown | Promise<unknown>): void;
7775
8148
  clone(): AxLearn<IN, OUT>;
7776
8149
  /**
7777
- * Optimize the agent using the configuration provided in constructor.
7778
- * Can optionally override options.
8150
+ * Run the configured learning flow for the current mode.
7779
8151
  */
7780
- optimize(overrides?: Partial<Omit<AxLearnOptions, 'id' | 'storage' | 'teacher'>>): Promise<AxLearnResult<IN, OUT>>;
8152
+ optimize(overrides?: AxLearnOptimizeOptions): Promise<AxLearnResult<IN, OUT>>;
7781
8153
  /**
7782
- * Load the latest checkpoint from storage.
8154
+ * Apply a bounded online update for continuous/playbook modes.
7783
8155
  */
7784
- private loadLatestCheckpoint;
8156
+ applyUpdate(input: Readonly<AxLearnUpdateInput<IN, OUT>>, overrides?: AxLearnUpdateOptions): Promise<AxLearnResult<IN, OUT>>;
7785
8157
  /**
7786
8158
  * Get the underlying AxGen instance.
7787
8159
  */
@@ -7801,6 +8173,36 @@ declare class AxLearn<IN extends AxGenIn, OUT extends AxGenOut> implements AxFor
7801
8173
  * Add feedback to a specific trace.
7802
8174
  */
7803
8175
  addFeedback(traceId: string, feedback: NonNullable<AxTrace['feedback']>): Promise<void>;
8176
+ protected createPromptOptimizer(config: Readonly<AxLearnMergedConfig>, baselineScore: number): AxGEPA;
8177
+ protected createPlaybookOptimizer(config: Readonly<AxLearnMergedConfig>, baselineScore: number): AxACE;
8178
+ private mergeConfig;
8179
+ private requireRuntimeAI;
8180
+ private createOptimizerProgressHandler;
8181
+ private resolveMetric;
8182
+ private runPromptOptimization;
8183
+ private optimizePlaybook;
8184
+ private applyPlaybookUpdate;
8185
+ private getOrCreatePlaybookOptimizer;
8186
+ private prepareDataset;
8187
+ private loadRelevantTraces;
8188
+ private normalizeExample;
8189
+ private buildObservedUpdateExample;
8190
+ private pickInputFields;
8191
+ private pickOutputFields;
8192
+ private hasInputFields;
8193
+ private hasOutputFields;
8194
+ private exampleKey;
8195
+ private feedbackToText;
8196
+ private formatObservedUpdateFeedback;
8197
+ private splitExamples;
8198
+ private shuffleExamples;
8199
+ private computeMetricBudget;
8200
+ private createPromptState;
8201
+ private createPlaybookState;
8202
+ private summarizePlaybookArtifact;
8203
+ private saveCheckpoint;
8204
+ private loadLatestCheckpoint;
8205
+ private applyRestoredPlaybook;
7804
8206
  }
7805
8207
 
7806
8208
  type AxDataRow = {
@@ -7818,287 +8220,86 @@ declare class AxHFDataLoader {
7818
8220
  split: string;
7819
8221
  config: string;
7820
8222
  options?: Readonly<{
7821
- offset?: number;
7822
- length?: number;
7823
- }>;
7824
- }>);
7825
- private fetchDataFromAPI;
7826
- loadData(): Promise<AxDataRow[]>;
7827
- setData(rows: AxDataRow[]): void;
7828
- getData(): AxDataRow[];
7829
- getRows<T>({ count, fields, renameMap, }: Readonly<{
7830
- count: number;
7831
- fields: readonly string[];
7832
- renameMap?: Record<string, string>;
7833
- }>): Promise<T[]>;
7834
- }
7835
-
7836
- declare const axCreateDefaultColorLogger: (output?: (message: string) => void) => AxLoggerFunction;
7837
- declare const axCreateDefaultTextLogger: (output?: (message: string) => void) => AxLoggerFunction;
7838
-
7839
- interface AxMetricsConfig {
7840
- enabled: boolean;
7841
- enabledCategories: ('generation' | 'streaming' | 'functions' | 'errors' | 'performance')[];
7842
- maxLabelLength: number;
7843
- samplingRate: number;
7844
- }
7845
- declare const axDefaultMetricsConfig: AxMetricsConfig;
7846
- type AxErrorCategory = 'validation_error' | 'assertion_error' | 'timeout_error' | 'abort_error' | 'network_error' | 'auth_error' | 'rate_limit_error' | 'function_error' | 'parsing_error' | 'unknown_error';
7847
- interface AxGenMetricsInstruments {
7848
- generationLatencyHistogram?: Histogram;
7849
- generationRequestsCounter?: Counter;
7850
- generationErrorsCounter?: Counter;
7851
- multiStepGenerationsCounter?: Counter;
7852
- stepsPerGenerationHistogram?: Histogram;
7853
- maxStepsReachedCounter?: Counter;
7854
- validationErrorsCounter?: Counter;
7855
- assertionErrorsCounter?: Counter;
7856
- errorCorrectionAttemptsHistogram?: Histogram;
7857
- errorCorrectionSuccessCounter?: Counter;
7858
- errorCorrectionFailureCounter?: Counter;
7859
- maxRetriesReachedCounter?: Counter;
7860
- functionsEnabledGenerationsCounter?: Counter;
7861
- functionCallStepsCounter?: Counter;
7862
- functionsExecutedPerGenerationHistogram?: Histogram;
7863
- functionErrorCorrectionCounter?: Counter;
7864
- fieldProcessorsExecutedCounter?: Counter;
7865
- streamingFieldProcessorsExecutedCounter?: Counter;
7866
- streamingGenerationsCounter?: Counter;
7867
- streamingDeltasEmittedCounter?: Counter;
7868
- streamingFinalizationLatencyHistogram?: Histogram;
7869
- samplesGeneratedHistogram?: Histogram;
7870
- resultPickerUsageCounter?: Counter;
7871
- resultPickerLatencyHistogram?: Histogram;
7872
- inputFieldsGauge?: Gauge;
7873
- outputFieldsGauge?: Gauge;
7874
- examplesUsedGauge?: Gauge;
7875
- demosUsedGauge?: Gauge;
7876
- promptRenderLatencyHistogram?: Histogram;
7877
- extractionLatencyHistogram?: Histogram;
7878
- assertionLatencyHistogram?: Histogram;
7879
- stateCreationLatencyHistogram?: Histogram;
7880
- memoryUpdateLatencyHistogram?: Histogram;
7881
- }
7882
- declare const axCheckMetricsHealth: () => {
7883
- healthy: boolean;
7884
- issues: string[];
7885
- };
7886
- declare const axUpdateMetricsConfig: (config: Readonly<Partial<AxMetricsConfig>>) => void;
7887
- declare const axGetMetricsConfig: () => AxMetricsConfig;
7888
-
7889
- /**
7890
- * Factory function to create a default optimizer logger with color formatting
7891
- */
7892
- declare const axCreateDefaultOptimizerColorLogger: (output?: (message: string) => void) => AxOptimizerLoggerFunction;
7893
- /**
7894
- * Factory function to create a text-only optimizer logger (no colors)
7895
- */
7896
- declare const axCreateDefaultOptimizerTextLogger: (output?: (message: string) => void) => AxOptimizerLoggerFunction;
7897
- /**
7898
- * Default optimizer logger instance with color formatting
7899
- */
7900
- declare const axDefaultOptimizerLogger: AxOptimizerLoggerFunction;
7901
-
7902
- /**
7903
- * Individual playbook bullet with metadata used for incremental updates.
7904
- * Mirrors the structure described in the ACE paper (Section 3.1).
7905
- */
7906
- interface AxACEBullet extends Record<string, unknown> {
7907
- id: string;
7908
- section: string;
7909
- content: string;
7910
- helpfulCount: number;
7911
- harmfulCount: number;
7912
- createdAt: string;
7913
- updatedAt: string;
7914
- tags?: string[];
7915
- metadata?: Record<string, unknown>;
7916
- }
7917
- /**
7918
- * Aggregated ACE playbook structure grouped by sections.
7919
- */
7920
- interface AxACEPlaybook {
7921
- version: number;
7922
- sections: Record<string, AxACEBullet[]>;
7923
- stats: {
7924
- bulletCount: number;
7925
- helpfulCount: number;
7926
- harmfulCount: number;
7927
- tokenEstimate: number;
7928
- };
7929
- updatedAt: string;
7930
- description?: string;
7931
- }
7932
- /**
7933
- * Generator output format (Appendix B of the paper) distilled to core fields.
7934
- */
7935
- interface AxACEGeneratorOutput extends Record<string, unknown> {
7936
- reasoning: string;
7937
- answer: unknown;
7938
- bulletIds: string[];
7939
- trajectory?: string;
7940
- metadata?: Record<string, unknown>;
7941
- }
7942
- /**
7943
- * Reflection payload, mapping to the Reflector JSON schema in the paper.
7944
- */
7945
- interface AxACEReflectionOutput extends Record<string, unknown> {
7946
- reasoning: string;
7947
- errorIdentification: string;
7948
- rootCauseAnalysis: string;
7949
- correctApproach: string;
7950
- keyInsight: string;
7951
- bulletTags: {
7952
- id: string;
7953
- tag: 'helpful' | 'harmful' | 'neutral';
7954
- }[];
7955
- metadata?: Record<string, unknown>;
7956
- }
7957
- /**
7958
- * Curator operations emitted as deltas (Section 3.1).
7959
- */
7960
- type AxACECuratorOperationType = 'ADD' | 'UPDATE' | 'REMOVE';
7961
- interface AxACECuratorOperation {
7962
- type: AxACECuratorOperationType;
7963
- section: string;
7964
- bulletId?: string;
7965
- content?: string;
7966
- metadata?: Record<string, unknown>;
7967
- }
7968
- interface AxACECuratorOutput extends Record<string, unknown> {
7969
- reasoning: string;
7970
- operations: AxACECuratorOperation[];
7971
- metadata?: Record<string, unknown>;
7972
- }
7973
- /**
7974
- * Runtime feedback captured after each generator rollout for online updates.
7975
- */
7976
- interface AxACEFeedbackEvent {
7977
- example: AxExample$1;
7978
- prediction: unknown;
7979
- score: number;
7980
- generatorOutput: AxACEGeneratorOutput;
7981
- reflection?: AxACEReflectionOutput;
7982
- curator?: AxACECuratorOutput;
7983
- timestamp: string;
7984
- }
7985
- /**
7986
- * Configuration options specific to ACE inside Ax.
7987
- */
7988
- interface AxACEOptions {
7989
- /**
7990
- * Maximum number of epochs for offline adaptation.
7991
- */
7992
- maxEpochs?: number;
7993
- /**
7994
- * Maximum reflector refinement rounds (paper uses up to 5).
7995
- */
7996
- maxReflectorRounds?: number;
7997
- /**
7998
- * Maximum bullets allowed in any section before triggering pruning.
7999
- */
8000
- maxSectionSize?: number;
8001
- /**
8002
- * Optional similarity threshold used by the semantic deduper.
8003
- */
8004
- similarityThreshold?: number;
8005
- /**
8006
- * Whether to automatically create sections when curator emits new ones.
8007
- */
8008
- allowDynamicSections?: boolean;
8009
- /**
8010
- * Initial playbook supplied by the caller.
8011
- */
8012
- initialPlaybook?: AxACEPlaybook;
8013
- }
8014
- /**
8015
- * Serialized artifact saved after optimization for future reuse.
8016
- */
8017
- interface AxACEOptimizationArtifact {
8018
- playbook: AxACEPlaybook;
8019
- feedback: AxACEFeedbackEvent[];
8020
- history: {
8021
- epoch: number;
8022
- exampleIndex: number;
8023
- operations: AxACECuratorOperation[];
8024
- }[];
8223
+ offset?: number;
8224
+ length?: number;
8225
+ }>;
8226
+ }>);
8227
+ private fetchDataFromAPI;
8228
+ loadData(): Promise<AxDataRow[]>;
8229
+ setData(rows: AxDataRow[]): void;
8230
+ getData(): AxDataRow[];
8231
+ getRows<T>({ count, fields, renameMap, }: Readonly<{
8232
+ count: number;
8233
+ fields: readonly string[];
8234
+ renameMap?: Record<string, string>;
8235
+ }>): Promise<T[]>;
8025
8236
  }
8026
8237
 
8027
- interface AxACECompileOptions extends AxCompileOptions {
8028
- aceOptions?: AxACEOptions;
8238
+ declare const axCreateDefaultColorLogger: (output?: (message: string) => void) => AxLoggerFunction;
8239
+ declare const axCreateDefaultTextLogger: (output?: (message: string) => void) => AxLoggerFunction;
8240
+
8241
+ interface AxMetricsConfig {
8242
+ enabled: boolean;
8243
+ enabledCategories: ('generation' | 'streaming' | 'functions' | 'errors' | 'performance')[];
8244
+ maxLabelLength: number;
8245
+ samplingRate: number;
8029
8246
  }
8030
- interface AxACEResult<OUT extends AxGenOut> extends AxOptimizerResult<OUT> {
8031
- optimizedProgram?: AxACEOptimizedProgram<OUT>;
8032
- playbook: AxACEPlaybook;
8033
- artifact: AxACEOptimizationArtifact;
8247
+ declare const axDefaultMetricsConfig: AxMetricsConfig;
8248
+ type AxErrorCategory = 'validation_error' | 'assertion_error' | 'timeout_error' | 'abort_error' | 'network_error' | 'auth_error' | 'rate_limit_error' | 'function_error' | 'parsing_error' | 'unknown_error';
8249
+ interface AxGenMetricsInstruments {
8250
+ generationLatencyHistogram?: Histogram;
8251
+ generationRequestsCounter?: Counter;
8252
+ generationErrorsCounter?: Counter;
8253
+ multiStepGenerationsCounter?: Counter;
8254
+ stepsPerGenerationHistogram?: Histogram;
8255
+ maxStepsReachedCounter?: Counter;
8256
+ validationErrorsCounter?: Counter;
8257
+ assertionErrorsCounter?: Counter;
8258
+ errorCorrectionAttemptsHistogram?: Histogram;
8259
+ errorCorrectionSuccessCounter?: Counter;
8260
+ errorCorrectionFailureCounter?: Counter;
8261
+ maxRetriesReachedCounter?: Counter;
8262
+ functionsEnabledGenerationsCounter?: Counter;
8263
+ functionCallStepsCounter?: Counter;
8264
+ functionsExecutedPerGenerationHistogram?: Histogram;
8265
+ functionErrorCorrectionCounter?: Counter;
8266
+ fieldProcessorsExecutedCounter?: Counter;
8267
+ streamingFieldProcessorsExecutedCounter?: Counter;
8268
+ streamingGenerationsCounter?: Counter;
8269
+ streamingDeltasEmittedCounter?: Counter;
8270
+ streamingFinalizationLatencyHistogram?: Histogram;
8271
+ samplesGeneratedHistogram?: Histogram;
8272
+ resultPickerUsageCounter?: Counter;
8273
+ resultPickerLatencyHistogram?: Histogram;
8274
+ inputFieldsGauge?: Gauge;
8275
+ outputFieldsGauge?: Gauge;
8276
+ examplesUsedGauge?: Gauge;
8277
+ demosUsedGauge?: Gauge;
8278
+ promptRenderLatencyHistogram?: Histogram;
8279
+ extractionLatencyHistogram?: Histogram;
8280
+ assertionLatencyHistogram?: Histogram;
8281
+ stateCreationLatencyHistogram?: Histogram;
8282
+ memoryUpdateLatencyHistogram?: Histogram;
8034
8283
  }
8284
+ declare const axCheckMetricsHealth: () => {
8285
+ healthy: boolean;
8286
+ issues: string[];
8287
+ };
8288
+ declare const axUpdateMetricsConfig: (config: Readonly<Partial<AxMetricsConfig>>) => void;
8289
+ declare const axGetMetricsConfig: () => AxMetricsConfig;
8290
+
8035
8291
  /**
8036
- * Optimized program artifact that persists ACE playbook updates.
8292
+ * Factory function to create a default optimizer logger with color formatting
8037
8293
  */
8038
- declare class AxACEOptimizedProgram<OUT = any> extends AxOptimizedProgramImpl<OUT> {
8039
- readonly playbook: AxACEPlaybook;
8040
- readonly artifact: AxACEOptimizationArtifact;
8041
- private readonly baseInstruction?;
8042
- constructor(config: {
8043
- baseInstruction?: string;
8044
- playbook: AxACEPlaybook;
8045
- artifact: AxACEOptimizationArtifact;
8046
- bestScore: number;
8047
- stats: AxOptimizationStats;
8048
- optimizerType: string;
8049
- optimizationTime: number;
8050
- totalRounds: number;
8051
- converged: boolean;
8052
- instruction?: string;
8053
- demos?: AxOptimizedProgram<OUT>['demos'];
8054
- examples?: AxExample$1[];
8055
- modelConfig?: AxOptimizedProgram<OUT>['modelConfig'];
8056
- scoreHistory?: number[];
8057
- configurationHistory?: Record<string, unknown>[];
8058
- });
8059
- applyTo<IN, T extends AxGenOut>(program: AxGen<IN, T>): void;
8060
- }
8294
+ declare const axCreateDefaultOptimizerColorLogger: (output?: (message: string) => void) => AxOptimizerLoggerFunction;
8061
8295
  /**
8062
- * AxACE implements the Agentic Context Engineering loop (Generator → Reflector → Curator).
8063
- * The implementation mirrors the paper's architecture while integrating with the Ax optimizer
8064
- * ergonomics (unified optimized program artifacts, metrics, and checkpointing).
8296
+ * Factory function to create a text-only optimizer logger (no colors)
8065
8297
  */
8066
- declare class AxACE extends AxBaseOptimizer {
8067
- private readonly aceConfig;
8068
- private playbook;
8069
- private generatorHistory;
8070
- private deltaHistory;
8071
- private reflectorProgram?;
8072
- private curatorProgram?;
8073
- private program?;
8074
- constructor(args: Readonly<AxOptimizerArgs>, options?: Readonly<AxACEOptions>);
8075
- reset(): void;
8076
- configureAuto(level: 'light' | 'medium' | 'heavy'): void;
8077
- compile<IN, OUT extends AxGenOut>(program: Readonly<AxGen<IN, OUT>>, examples: readonly AxTypedExample<IN>[], metricFn: AxMetricFn, options?: AxACECompileOptions): Promise<AxACEResult<OUT>>;
8078
- /**
8079
- * Apply ACE updates after each online inference. Mirrors the online adaptation
8080
- * flow described in the paper; can be called by user-land code between queries.
8081
- */
8082
- applyOnlineUpdate(args: Readonly<{
8083
- example: AxExample$1;
8084
- prediction: unknown;
8085
- feedback?: string;
8086
- }>): Promise<AxACECuratorOutput | undefined>;
8087
- private composeInstruction;
8088
- private extractProgramInstruction;
8089
- private createGeneratorOutput;
8090
- private resolveCuratorOperationTargets;
8091
- private locateBullet;
8092
- private locateFallbackBullet;
8093
- private collectProtectedBulletIds;
8094
- private normalizeCuratorOperations;
8095
- private inferOperationsFromReflection;
8096
- private runReflectionRounds;
8097
- private runReflector;
8098
- private runCurator;
8099
- private getOrCreateReflectorProgram;
8100
- private getOrCreateCuratorProgram;
8101
- }
8298
+ declare const axCreateDefaultOptimizerTextLogger: (output?: (message: string) => void) => AxOptimizerLoggerFunction;
8299
+ /**
8300
+ * Default optimizer logger instance with color formatting
8301
+ */
8302
+ declare const axDefaultOptimizerLogger: AxOptimizerLoggerFunction;
8102
8303
 
8103
8304
  declare class AxBootstrapFewShot extends AxBaseOptimizer {
8104
8305
  private maxRounds;
@@ -8118,120 +8319,6 @@ declare class AxBootstrapFewShot extends AxBaseOptimizer {
8118
8319
  compile<IN, OUT extends AxGenOut>(program: Readonly<AxGen<IN, OUT>>, examples: readonly AxTypedExample<IN>[], metricFn: AxMetricFn, options?: AxCompileOptions): Promise<AxOptimizerResult<OUT>>;
8119
8320
  }
8120
8321
 
8121
- /** Structured optimization report */
8122
- interface AxGEPAOptimizationReport {
8123
- summary: string;
8124
- bestSolution: {
8125
- overallScore: number;
8126
- objectives: Record<string, {
8127
- value: number;
8128
- percentage: number;
8129
- }>;
8130
- };
8131
- paretoFrontier: {
8132
- solutionCount: number;
8133
- objectiveSpaceCoverage: number;
8134
- hypervolume: number;
8135
- tradeoffs?: Array<Record<string, number>>;
8136
- };
8137
- statistics: {
8138
- totalEvaluations: number;
8139
- candidatesExplored: number;
8140
- converged: boolean;
8141
- };
8142
- recommendations: {
8143
- status: 'good' | 'limited' | 'single';
8144
- suggestions: string[];
8145
- };
8146
- }
8147
- /** Single-module GEPA (reflective prompt evolution with Pareto sampling) */
8148
- declare class AxGEPA extends AxBaseOptimizer {
8149
- private numTrials;
8150
- private minibatch;
8151
- private minibatchSize;
8152
- private earlyStoppingTrials;
8153
- private minImprovementThreshold;
8154
- private sampleCount;
8155
- private paretoSetSize;
8156
- private crossoverEvery;
8157
- private tieEpsilon;
8158
- private feedbackMemorySize;
8159
- private feedbackMemory;
8160
- private mergeMax;
8161
- private mergesUsed;
8162
- private mergesDue;
8163
- private totalMergesTested;
8164
- private lastIterFoundNewProgram;
8165
- private mergeAttemptKeys;
8166
- private mergeCompositionKeys;
8167
- private static readonly REFLECTION_PROMPT_TEMPLATE;
8168
- private rngState;
8169
- private samplerState;
8170
- private localScoreHistory;
8171
- private localConfigurationHistory;
8172
- constructor(args: Readonly<AxOptimizerArgs>);
8173
- reset(): void;
8174
- /**
8175
- * Multi-objective GEPA: reflective evolution with Pareto frontier
8176
- */
8177
- compile<IN, OUT extends AxGenOut>(program: Readonly<AxGen<IN, OUT>>, examples: readonly AxTypedExample<IN>[], metricFn: AxMetricFn, options?: AxCompileOptions): Promise<AxParetoResult<OUT>>;
8178
- /** Lightweight auto presets */
8179
- configureAuto(level: 'light' | 'medium' | 'heavy'): void;
8180
- private getBaseInstruction;
8181
- private evaluateOnSet;
8182
- private evaluateAvg;
8183
- private evaluateOne;
8184
- private reflectInstruction;
8185
- /**
8186
- * Extract instruction text from LLM output enclosed in backticks (aligned with reference)
8187
- */
8188
- private extractInstructionFromBackticks;
8189
- private updateSamplerShuffled;
8190
- private nextMinibatchIndices;
8191
- private rand;
8192
- private generateOptimizationReport;
8193
- private mergeInstructions;
8194
- }
8195
-
8196
- /** Flow-aware GEPA (system-level reflective evolution with module selection + system-aware merge) */
8197
- declare class AxGEPAFlow extends AxBaseOptimizer {
8198
- private numTrials;
8199
- private minibatch;
8200
- private minibatchSize;
8201
- private earlyStoppingTrials;
8202
- private minImprovementThreshold;
8203
- private sampleCount;
8204
- private crossoverEvery;
8205
- private tieEpsilon;
8206
- private paretoSetSize;
8207
- private mergeMax;
8208
- private mergesUsed;
8209
- private mergesDue;
8210
- private totalMergesTested;
8211
- private lastIterFoundNewProgram;
8212
- private rngState;
8213
- private mergeAttemptKeys;
8214
- private mergeCompositionKeys;
8215
- private samplerState;
8216
- constructor(args: Readonly<AxOptimizerArgs>);
8217
- reset(): void;
8218
- configureAuto(level: 'light' | 'medium' | 'heavy'): void;
8219
- /**
8220
- * Multi-objective GEPA-Flow: system-level reflective evolution with Pareto frontier
8221
- */
8222
- compile<IN, OUT extends AxGenOut>(program: Readonly<any>, examples: readonly AxTypedExample<IN>[], metricFn: AxMetricFn, options?: AxCompileOptions): Promise<AxParetoResult<OUT>>;
8223
- private getBaseInstruction;
8224
- private evaluateOnSet;
8225
- private evaluateAvg;
8226
- private evaluateOne;
8227
- private reflectModuleInstruction;
8228
- private updateSamplerShuffled;
8229
- private nextMinibatchIndices;
8230
- private systemAwareMergeWithSig;
8231
- private rand;
8232
- private systemAwareMerge;
8233
- }
8234
-
8235
8322
  interface AxMiPROResult<IN, OUT extends AxGenOut> extends AxOptimizerResult<OUT> {
8236
8323
  optimizedGen?: AxGen<IN, OUT>;
8237
8324
  optimizedProgram?: AxOptimizedProgram<OUT>;
@@ -9065,6 +9152,7 @@ TState extends AxFlowState = IN> implements AxFlowable<IN, OUT> {
9065
9152
  id: string;
9066
9153
  signature?: string;
9067
9154
  }>;
9155
+ namedProgramInstances(): AxNamedProgramInstance<IN, OUT>[];
9068
9156
  getTraces(): AxProgramTrace<IN, OUT>[];
9069
9157
  setDemos(demos: readonly AxProgramDemos<IN, OUT, keyof TNodes extends never ? string : `${string}.${string & keyof TNodes}`>[], options?: {
9070
9158
  modelConfig?: Record<string, unknown>;
@@ -9910,11 +9998,14 @@ interface AxCodeSession {
9910
9998
  * - `full`: Keep prior actions fully replayed with minimal compression.
9911
9999
  * Best for debugging or short tasks where the actor should reread exact old code/output.
9912
10000
  * - `adaptive`: Keep live runtime state visible, preserve recent or dependency-relevant
9913
- * actions in full, and collapse older successful work into checkpoint summaries as
9914
- * context grows. Best default for long multi-turn tasks.
10001
+ * actions in full, hide used discovery docs, and collapse older successful work
10002
+ * into checkpoint summaries as context grows. Reliability-first defaults favor
10003
+ * summaries before deletion. Best default for long multi-turn tasks.
9915
10004
  * - `lean`: Most aggressive compression. Keep live runtime state visible, checkpoint
9916
- * older successful work, and summarize replay-pruned successful turns instead of
9917
- * replaying their full code blocks. Best when token pressure matters more than raw replay detail.
10005
+ * older successful work, hide used discovery docs, and summarize replay-pruned
10006
+ * successful turns instead of replaying their full code blocks. Reliability-first
10007
+ * defaults still preserve recent evidence before deleting older low-value steps.
10008
+ * Best when token pressure matters more than raw replay detail.
9918
10009
  */
9919
10010
  type AxContextPolicyPreset = 'full' | 'adaptive' | 'lean';
9920
10011
  /**
@@ -9930,6 +10021,23 @@ interface AxContextPolicyConfig {
9930
10021
  * - `lean`: prefer live state + compact summaries over raw replay detail
9931
10022
  */
9932
10023
  preset?: AxContextPolicyPreset;
10024
+ /**
10025
+ * Default options for the internal checkpoint summarizer AxGen program.
10026
+ * `functions` are not supported, `maxSteps` is forced to `1`, and `mem`
10027
+ * is never propagated so the summarizer stays stateless.
10028
+ */
10029
+ summarizerOptions?: Omit<AxProgramForwardOptions<string>, 'functions'>;
10030
+ /**
10031
+ * Hide stale discovery docs from later actor prompts after a discovered
10032
+ * callable is used successfully. This only affects prompt replay; it does
10033
+ * not delete internal history or remove runtime values.
10034
+ *
10035
+ * Defaults by preset:
10036
+ * - `full`: false
10037
+ * - `adaptive`: true
10038
+ * - `lean`: true
10039
+ */
10040
+ pruneUsedDocs?: boolean;
9933
10041
  /** Runtime-state visibility controls. */
9934
10042
  state?: {
9935
10043
  /** Include a compact live runtime state block ahead of the action log. */
@@ -9940,6 +10048,8 @@ interface AxContextPolicyConfig {
9940
10048
  inspectThresholdChars?: number;
9941
10049
  /** Maximum number of runtime state entries to render in the summary block. */
9942
10050
  maxEntries?: number;
10051
+ /** Maximum total characters to replay in the runtime state summary block. */
10052
+ maxChars?: number;
9943
10053
  };
9944
10054
  /** Rolling checkpoint summary controls. */
9945
10055
  checkpoints?: {
@@ -9956,12 +10066,17 @@ interface AxContextPolicyConfig {
9956
10066
  recentFullActions?: number;
9957
10067
  /** Prune error entries after a successful (non-error) turn. */
9958
10068
  pruneErrors?: boolean;
9959
- /** Rank-based pruning of low-value actions. */
10069
+ /** Rank-based pruning of low-value actions. Off by default for built-in presets. */
9960
10070
  rankPruning?: {
9961
10071
  enabled?: boolean;
9962
10072
  minRank?: number;
9963
10073
  };
9964
- /** Replace resolved errors with compact tombstones before pruning. */
10074
+ /**
10075
+ * Replace resolved errors with compact tombstones before pruning.
10076
+ * When configured with options, they apply to the internal tombstone
10077
+ * summarizer AxGen program. `functions` are not supported, `maxSteps`
10078
+ * is forced to `1`, and `mem` is never propagated.
10079
+ */
9965
10080
  tombstones?: boolean | Omit<AxProgramForwardOptions<string>, 'functions'>;
9966
10081
  };
9967
10082
  }
@@ -10009,6 +10124,8 @@ declare function axBuildActorDefinition(baseDefinition: string | undefined, cont
10009
10124
  maxSubAgentCalls?: number;
10010
10125
  maxTurns?: number;
10011
10126
  hasInspectRuntime?: boolean;
10127
+ hasLiveRuntimeState?: boolean;
10128
+ hasCompressedActionReplay?: boolean;
10012
10129
  /** When true, Actor must run one observable console step per non-final turn. */
10013
10130
  enforceIncrementalConsoleTurns?: boolean;
10014
10131
  /** Child agents available under the `<agentModuleNamespace>.*` namespace in the JS runtime. */
@@ -10485,6 +10602,11 @@ type AxAgentFunction = AxFunction & {
10485
10602
  type AxAgentFunctionGroup = AxAgentFunctionModuleMeta & {
10486
10603
  functions: readonly Omit<AxAgentFunction, 'namespace'>[];
10487
10604
  };
10605
+ type AxAgentTestCompletionPayload = {
10606
+ type: 'final' | 'ask_clarification';
10607
+ args: unknown[];
10608
+ };
10609
+ type AxAgentTestResult = string | AxAgentTestCompletionPayload;
10488
10610
  type AxAgentFunctionCollection = readonly AxAgentFunction[] | readonly AxAgentFunctionGroup[];
10489
10611
  type AxContextFieldInput = string | {
10490
10612
  field: string;
@@ -10695,6 +10817,7 @@ declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut> implements AxAge
10695
10817
  id: string;
10696
10818
  signature?: string;
10697
10819
  }>;
10820
+ namedProgramInstances(): AxNamedProgramInstance<IN, OUT>[];
10698
10821
  getTraces(): AxProgramTrace<IN, OUT>[];
10699
10822
  setDemos(demos: readonly (AxAgentDemos<IN, OUT> | AxProgramDemos<IN, OUT>)[], options?: {
10700
10823
  modelConfig?: Record<string, unknown>;
@@ -10716,7 +10839,7 @@ declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut> implements AxAge
10716
10839
  ai?: AxAIService;
10717
10840
  abortSignal?: AbortSignal;
10718
10841
  debug?: boolean;
10719
- }>): Promise<string>;
10842
+ }>): Promise<AxAgentTestResult>;
10720
10843
  setSignature(signature: NonNullable<ConstructorParameters<typeof AxSignature>[0]>): void;
10721
10844
  applyOptimization(optimizedProgram: any): void;
10722
10845
  /**
@@ -11127,4 +11250,4 @@ declare class AxRateLimiterTokenUsage {
11127
11250
  acquire(tokens: number): Promise<void>;
11128
11251
  }
11129
11252
 
11130
- export { AxACE, type AxACEBullet, type AxACECuratorOperation, type AxACECuratorOperationType, type AxACECuratorOutput, type AxACEFeedbackEvent, type AxACEGeneratorOutput, type AxACEOptimizationArtifact, AxACEOptimizedProgram, type AxACEOptions, type AxACEPlaybook, type AxACEReflectionOutput, type AxACEResult, AxAI, AxAIAnthropic, type AxAIAnthropicArgs, type AxAIAnthropicChatError, type AxAIAnthropicChatRequest, type AxAIAnthropicChatRequestCacheParam, type AxAIAnthropicChatResponse, type AxAIAnthropicChatResponseDelta, type AxAIAnthropicConfig, type AxAIAnthropicContentBlockDeltaEvent, type AxAIAnthropicContentBlockStartEvent, type AxAIAnthropicContentBlockStopEvent, type AxAIAnthropicEffortLevel, type AxAIAnthropicEffortLevelMapping, type AxAIAnthropicErrorEvent, type AxAIAnthropicFunctionTool, type AxAIAnthropicMessageDeltaEvent, type AxAIAnthropicMessageStartEvent, type AxAIAnthropicMessageStopEvent, AxAIAnthropicModel, type AxAIAnthropicOutputConfig, type AxAIAnthropicPingEvent, type AxAIAnthropicRequestTool, type AxAIAnthropicThinkingConfig, type AxAIAnthropicThinkingTokenBudgetLevels, type AxAIAnthropicThinkingWire, AxAIAnthropicVertexModel, type AxAIAnthropicWebSearchTool, type AxAIArgs, AxAIAzureOpenAI, type AxAIAzureOpenAIArgs, type AxAIAzureOpenAIConfig, AxAICohere, type AxAICohereArgs, type AxAICohereChatRequest, type AxAICohereChatRequestToolResults, type AxAICohereChatResponse, type AxAICohereChatResponseDelta, type AxAICohereChatResponseToolCalls, type AxAICohereConfig, AxAICohereEmbedModel, type AxAICohereEmbedRequest, type AxAICohereEmbedResponse, AxAICohereModel, AxAIDeepSeek, type AxAIDeepSeekArgs, AxAIDeepSeekModel, type AxAIEmbedModels, type AxAIFeatures, AxAIGoogleGemini, type AxAIGoogleGeminiArgs, type AxAIGoogleGeminiBatchEmbedRequest, type AxAIGoogleGeminiBatchEmbedResponse, type AxAIGoogleGeminiCacheCreateRequest, type AxAIGoogleGeminiCacheResponse, type AxAIGoogleGeminiCacheUpdateRequest, type AxAIGoogleGeminiChatRequest, type AxAIGoogleGeminiChatResponse, type AxAIGoogleGeminiChatResponseDelta, type AxAIGoogleGeminiConfig, type AxAIGoogleGeminiContent, type AxAIGoogleGeminiContentPart, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiEmbedTypes, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, type AxAIGoogleGeminiRetrievalConfig, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiThinkingConfig, type AxAIGoogleGeminiThinkingLevel, type AxAIGoogleGeminiThinkingLevelMapping, type AxAIGoogleGeminiThinkingTokenBudgetLevels, type AxAIGoogleGeminiTool, type AxAIGoogleGeminiToolConfig, type AxAIGoogleGeminiToolFunctionDeclaration, type AxAIGoogleGeminiToolGoogleMaps, type AxAIGoogleGeminiToolGoogleSearchRetrieval, type AxAIGoogleVertexBatchEmbedRequest, type AxAIGoogleVertexBatchEmbedResponse, AxAIGrok, type AxAIGrokArgs, type AxAIGrokChatRequest, AxAIGrokEmbedModels, AxAIGrokModel, type AxAIGrokOptionsTools, type AxAIGrokSearchSource, AxAIGroq, type AxAIGroqArgs, AxAIGroqModel, AxAIHuggingFace, type AxAIHuggingFaceArgs, type AxAIHuggingFaceConfig, AxAIHuggingFaceModel, type AxAIHuggingFaceRequest, type AxAIHuggingFaceResponse, type AxAIInputModelList, type AxAIMemory, type AxAIMetricsInstruments, AxAIMistral, type AxAIMistralArgs, type AxAIMistralChatRequest, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, type AxAIModelListBase, type AxAIModels, AxAIOllama, type AxAIOllamaAIConfig, type AxAIOllamaArgs, AxAIOpenAI, type AxAIOpenAIAnnotation, type AxAIOpenAIArgs, AxAIOpenAIBase, type AxAIOpenAIBaseArgs, type AxAIOpenAIChatRequest, type AxAIOpenAIChatResponse, type AxAIOpenAIChatResponseDelta, type AxAIOpenAIConfig, AxAIOpenAIEmbedModel, type AxAIOpenAIEmbedRequest, type AxAIOpenAIEmbedResponse, type AxAIOpenAILogprob, AxAIOpenAIModel, type AxAIOpenAIResponseDelta, AxAIOpenAIResponses, type AxAIOpenAIResponsesArgs, AxAIOpenAIResponsesBase, type AxAIOpenAIResponsesCodeInterpreterToolCall, type AxAIOpenAIResponsesComputerToolCall, type AxAIOpenAIResponsesConfig, type AxAIOpenAIResponsesContentPartAddedEvent, type AxAIOpenAIResponsesContentPartDoneEvent, type AxAIOpenAIResponsesDefineFunctionTool, type AxAIOpenAIResponsesErrorEvent, type AxAIOpenAIResponsesFileSearchCallCompletedEvent, type AxAIOpenAIResponsesFileSearchCallInProgressEvent, type AxAIOpenAIResponsesFileSearchCallSearchingEvent, type AxAIOpenAIResponsesFileSearchToolCall, type AxAIOpenAIResponsesFunctionCallArgumentsDeltaEvent, type AxAIOpenAIResponsesFunctionCallArgumentsDoneEvent, type AxAIOpenAIResponsesFunctionCallItem, type AxAIOpenAIResponsesImageGenerationCallCompletedEvent, type AxAIOpenAIResponsesImageGenerationCallGeneratingEvent, type AxAIOpenAIResponsesImageGenerationCallInProgressEvent, type AxAIOpenAIResponsesImageGenerationCallPartialImageEvent, type AxAIOpenAIResponsesImageGenerationToolCall, AxAIOpenAIResponsesImpl, type AxAIOpenAIResponsesInputAudioContentPart, type AxAIOpenAIResponsesInputContentPart, type AxAIOpenAIResponsesInputFunctionCallItem, type AxAIOpenAIResponsesInputFunctionCallOutputItem, type AxAIOpenAIResponsesInputImageUrlContentPart, type AxAIOpenAIResponsesInputItem, type AxAIOpenAIResponsesInputMessageItem, type AxAIOpenAIResponsesInputTextContentPart, type AxAIOpenAIResponsesLocalShellToolCall, type AxAIOpenAIResponsesMCPCallArgumentsDeltaEvent, type AxAIOpenAIResponsesMCPCallArgumentsDoneEvent, type AxAIOpenAIResponsesMCPCallCompletedEvent, type AxAIOpenAIResponsesMCPCallFailedEvent, type AxAIOpenAIResponsesMCPCallInProgressEvent, type AxAIOpenAIResponsesMCPListToolsCompletedEvent, type AxAIOpenAIResponsesMCPListToolsFailedEvent, type AxAIOpenAIResponsesMCPListToolsInProgressEvent, type AxAIOpenAIResponsesMCPToolCall, AxAIOpenAIResponsesModel, type AxAIOpenAIResponsesOutputItem, type AxAIOpenAIResponsesOutputItemAddedEvent, type AxAIOpenAIResponsesOutputItemDoneEvent, type AxAIOpenAIResponsesOutputMessageItem, type AxAIOpenAIResponsesOutputRefusalContentPart, type AxAIOpenAIResponsesOutputTextAnnotationAddedEvent, type AxAIOpenAIResponsesOutputTextContentPart, type AxAIOpenAIResponsesOutputTextDeltaEvent, type AxAIOpenAIResponsesOutputTextDoneEvent, type AxAIOpenAIResponsesReasoningDeltaEvent, type AxAIOpenAIResponsesReasoningDoneEvent, type AxAIOpenAIResponsesReasoningItem, type AxAIOpenAIResponsesReasoningSummaryDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryDoneEvent, type AxAIOpenAIResponsesReasoningSummaryPart, type AxAIOpenAIResponsesReasoningSummaryPartAddedEvent, type AxAIOpenAIResponsesReasoningSummaryPartDoneEvent, type AxAIOpenAIResponsesReasoningSummaryTextDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryTextDoneEvent, type AxAIOpenAIResponsesRefusalDeltaEvent, type AxAIOpenAIResponsesRefusalDoneEvent, type AxAIOpenAIResponsesRequest, type AxAIOpenAIResponsesResponse, type AxAIOpenAIResponsesResponseCompletedEvent, type AxAIOpenAIResponsesResponseCreatedEvent, type AxAIOpenAIResponsesResponseDelta, type AxAIOpenAIResponsesResponseFailedEvent, type AxAIOpenAIResponsesResponseInProgressEvent, type AxAIOpenAIResponsesResponseIncompleteEvent, type AxAIOpenAIResponsesResponseQueuedEvent, type AxAIOpenAIResponsesStreamEvent, type AxAIOpenAIResponsesStreamEventBase, type AxAIOpenAIResponsesToolCall, type AxAIOpenAIResponsesToolCallBase, type AxAIOpenAIResponsesToolChoice, type AxAIOpenAIResponsesToolDefinition, type AxAIOpenAIResponsesWebSearchCallCompletedEvent, type AxAIOpenAIResponsesWebSearchCallInProgressEvent, type AxAIOpenAIResponsesWebSearchCallSearchingEvent, type AxAIOpenAIResponsesWebSearchToolCall, type AxAIOpenAIUrlCitation, type AxAIOpenAIUsage, AxAIOpenRouter, type AxAIOpenRouterArgs, AxAIRefusalError, AxAIReka, type AxAIRekaArgs, type AxAIRekaChatRequest, type AxAIRekaChatResponse, type AxAIRekaChatResponseDelta, type AxAIRekaConfig, AxAIRekaModel, type AxAIRekaUsage, type AxAIService, AxAIServiceAbortedError, type AxAIServiceActionOptions, AxAIServiceAuthenticationError, AxAIServiceError, type AxAIServiceImpl, type AxAIServiceMetrics, type AxAIServiceModelType, AxAIServiceNetworkError, type AxAIServiceOptions, AxAIServiceResponseError, AxAIServiceStatusError, AxAIServiceStreamTerminatedError, AxAIServiceTimeoutError, AxAITogether, type AxAITogetherArgs, type AxAITogetherChatModel, AxAITogetherModel, AxAIWebLLM, type AxAIWebLLMArgs, type AxAIWebLLMChatRequest, type AxAIWebLLMChatResponse, type AxAIWebLLMChatResponseDelta, type AxAIWebLLMConfig, type AxAIWebLLMEmbedModel, type AxAIWebLLMEmbedRequest, type AxAIWebLLMEmbedResponse, AxAIWebLLMModel, type AxAPI, type AxAPIConfig, AxAgent, type AxAgentCompletionProtocol, type AxAgentConfig, type AxAgentDemos, type AxAgentFunction, type AxAgentFunctionExample, type AxAgentFunctionGroup, type AxAgentInputUpdateCallback, type AxAgentOptions, type AxAgentRecursionOptions, type AxAgentic, AxApacheTika, type AxApacheTikaArgs, type AxApacheTikaConvertOptions, type AxAssertion, AxAssertionError, AxBalancer, type AxBalancerOptions, AxBaseAI, type AxBaseAIArgs, AxBaseOptimizer, AxBootstrapFewShot, type AxBootstrapOptimizerOptions, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, type AxCheckpoint, type AxCheckpointLoadFn, type AxCheckpointSaveFn, type AxCitation, type AxCodeInterpreter, type AxCodeRuntime, type AxCodeSession, type AxCompileOptions, AxContentProcessingError, type AxContentProcessingServices, type AxContextCacheInfo, type AxContextCacheOperation, type AxContextCacheOptions, type AxContextCacheRegistry, type AxContextCacheRegistryEntry, type AxContextFieldInput, type AxContextPolicyConfig, type AxContextPolicyPreset, type AxCostTracker, type AxCostTrackerOptions, AxDB, type AxDBArgs, AxDBBase, type AxDBBaseArgs, type AxDBBaseOpOptions, AxDBCloudflare, type AxDBCloudflareArgs, type AxDBCloudflareOpOptions, type AxDBLoaderOptions, AxDBManager, type AxDBManagerArgs, type AxDBMatch, AxDBMemory, type AxDBMemoryArgs, type AxDBMemoryOpOptions, AxDBPinecone, type AxDBPineconeArgs, type AxDBPineconeOpOptions, type AxDBQueryRequest, type AxDBQueryResponse, type AxDBQueryService, type AxDBService, type AxDBState, type AxDBUpsertRequest, type AxDBUpsertResponse, AxDBWeaviate, type AxDBWeaviateArgs, type AxDBWeaviateOpOptions, type AxDataRow, AxDefaultCostTracker, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, type AxErrorCategory, AxEvalUtil, type AxEvaluateArgs, type AxExample$1 as AxExample, type AxExamples, type AxField, type AxFieldProcessor, type AxFieldProcessorProcess, type AxFieldTemplateFn, type AxFieldType, type AxFieldValue, AxFlow, type AxFlowAutoParallelConfig, type AxFlowBranchContext, type AxFlowBranchEvaluationData, type AxFlowCompleteData, AxFlowDependencyAnalyzer, type AxFlowDynamicContext, type AxFlowErrorData, AxFlowExecutionPlanner, type AxFlowExecutionStep, type AxFlowLogData, type AxFlowLoggerData, type AxFlowLoggerFunction, type AxFlowNodeDefinition, type AxFlowParallelBranch, type AxFlowParallelGroup, type AxFlowParallelGroupCompleteData, type AxFlowParallelGroupStartData, type AxFlowStartData, type AxFlowState, type AxFlowStepCompleteData, type AxFlowStepFunction, type AxFlowStepStartData, type AxFlowSubContext, AxFlowSubContextImpl, type AxFlowTypedParallelBranch, type AxFlowTypedSubContext, AxFlowTypedSubContextImpl, type AxFlowable, type AxFluentFieldInfo, AxFluentFieldType, type AxForwardable, type AxFunction, type AxFunctionCallRecord, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, type AxFunctionResult, type AxFunctionResultFormatter, AxGEPA, type AxGEPAAdapter, type AxGEPAEvaluationBatch, AxGEPAFlow, type AxGEPAOptimizationReport, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenInput, type AxGenMetricsInstruments, type AxGenOut, type AxGenOutput, type AxGenStreamingOut, AxGenerateError, type AxGenerateErrorDetails, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSRuntime, type AxJSRuntimeOutputMode, AxJSRuntimePermission, AxJudge, type AxJudgeMode, type AxJudgeOptions, type AxJudgeResult, type AxJudgeRubric, AxLLMRequestTypeValues, AxLearn, type AxLearnOptions, type AxLearnProgress, type AxLearnResult, type AxLoggerData, type AxLoggerFunction, type AxMCPBlobResourceContents, AxMCPClient, type AxMCPEmbeddedResource, type AxMCPFunctionDescription, AxMCPHTTPSSETransport, type AxMCPImageContent, type AxMCPInitializeParams, type AxMCPInitializeResult, type AxMCPJSONRPCErrorResponse, type AxMCPJSONRPCNotification, type AxMCPJSONRPCRequest, type AxMCPJSONRPCResponse, type AxMCPJSONRPCSuccessResponse, type AxMCPOAuthOptions, type AxMCPPrompt, type AxMCPPromptArgument, type AxMCPPromptGetResult, type AxMCPPromptMessage, type AxMCPPromptsListResult, type AxMCPResource, type AxMCPResourceReadResult, type AxMCPResourceTemplate, type AxMCPResourceTemplatesListResult, type AxMCPResourcesListResult, type AxMCPStreamableHTTPTransportOptions, AxMCPStreambleHTTPTransport, type AxMCPTextContent, type AxMCPTextResourceContents, type AxMCPToolsListResult, type AxMCPTransport, AxMediaNotSupportedError, AxMemory, type AxMemoryData, type AxMemoryMessageValue, type AxMessage, type AxMetricFn, type AxMetricFnArgs, type AxMetricsConfig, AxMiPRO, type AxMiPROOptimizerOptions, type AxMiPROResult, AxMockAIService, type AxMockAIServiceConfig, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxModelUsage, type AxMultiMetricFn, type AxMultiProviderConfig, AxMultiServiceRouter, type AxOptimizationCheckpoint, type AxOptimizationProgress, type AxOptimizationStats, type AxOptimizedProgram, AxOptimizedProgramImpl, type AxOptimizer, type AxOptimizerArgs, type AxOptimizerLoggerData, type AxOptimizerLoggerFunction, type AxOptimizerMetricsConfig, type AxOptimizerMetricsInstruments, type AxOptimizerResult, type AxParetoResult, type AxPreparedChatRequest, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramForwardOptionsWithModels, type AxProgramOptions, type AxProgramStreamingForwardOptions, type AxProgramStreamingForwardOptionsWithModels, type AxProgramTrace, type AxProgramUsage, type AxProgrammable, AxPromptTemplate, type AxPromptTemplateOptions, AxProviderRouter, type AxRLMConfig, type AxRateLimiterFunction, AxRateLimiterTokenUsage, type AxRateLimiterTokenUsageOptions, type AxRerankerIn, type AxRerankerOut, type AxResponseHandlerArgs, type AxResultPickerFunction, type AxResultPickerFunctionFieldResults, type AxResultPickerFunctionFunctionResults, type AxRewriteIn, type AxRewriteOut, type AxRoutingResult, type AxSamplePickerOptions, type AxSelfTuningConfig, type AxSetExamplesOptions, AxSignature, AxSignatureBuilder, type AxSignatureConfig, AxSimpleClassifier, AxSimpleClassifierClass, type AxSimpleClassifierForwardOptions, AxSpanKindValues, type AxStepContext, AxStepContextImpl, type AxStepHooks, type AxStepUsage, AxStopFunctionCallException, type AxStorage, type AxStorageQuery, type AxStreamingAssertion, type AxStreamingEvent, type AxStreamingFieldProcessorProcess, AxStringUtil, AxSynth, type AxSynthExample, type AxSynthOptions, type AxSynthResult, AxTestPrompt, type AxThoughtBlockItem, AxTokenLimitError, type AxTokenUsage, type AxTrace, AxTraceLogger, type AxTraceLoggerOptions, type AxTunable, type AxTypedExample, type AxUsable, type AxWorkerRuntimeConfig, agent, ai, ax, axAIAnthropicDefaultConfig, axAIAnthropicVertexDefaultConfig, axAIAzureOpenAIBestConfig, axAIAzureOpenAICreativeConfig, axAIAzureOpenAIDefaultConfig, axAIAzureOpenAIFastConfig, axAICohereCreativeConfig, axAICohereDefaultConfig, axAIDeepSeekCodeConfig, axAIDeepSeekDefaultConfig, axAIGoogleGeminiDefaultConfig, axAIGoogleGeminiDefaultCreativeConfig, axAIGrokBestConfig, axAIGrokDefaultConfig, axAIHuggingFaceCreativeConfig, axAIHuggingFaceDefaultConfig, axAIMistralBestConfig, axAIMistralDefaultConfig, axAIOllamaDefaultConfig, axAIOllamaDefaultCreativeConfig, axAIOpenAIBestConfig, axAIOpenAICreativeConfig, axAIOpenAIDefaultConfig, axAIOpenAIFastConfig, axAIOpenAIResponsesBestConfig, axAIOpenAIResponsesCreativeConfig, axAIOpenAIResponsesDefaultConfig, axAIOpenRouterDefaultConfig, axAIRekaBestConfig, axAIRekaCreativeConfig, axAIRekaDefaultConfig, axAIRekaFastConfig, axAITogetherDefaultConfig, axAIWebLLMCreativeConfig, axAIWebLLMDefaultConfig, axAnalyzeChatPromptRequirements, axAnalyzeRequestRequirements, axBaseAIDefaultConfig, axBaseAIDefaultCreativeConfig, axBuildActorDefinition, axBuildResponderDefinition, axCheckMetricsHealth, axCreateDefaultColorLogger, axCreateDefaultOptimizerColorLogger, axCreateDefaultOptimizerTextLogger, axCreateDefaultTextLogger, axCreateFlowColorLogger, axCreateFlowTextLogger, axCreateJSRuntime, axDefaultFlowLogger, axDefaultMetricsConfig, axDefaultOptimizerLogger, axDefaultOptimizerMetricsConfig, axGetCompatibilityReport, axGetFormatCompatibility, axGetMetricsConfig, axGetOptimizerMetricsConfig, axGetProvidersWithMediaSupport, axGlobals, axModelInfoAnthropic, axModelInfoCohere, axModelInfoDeepSeek, axModelInfoGoogleGemini, axModelInfoGrok, axModelInfoGroq, axModelInfoHuggingFace, axModelInfoMistral, axModelInfoOpenAI, axModelInfoOpenAIResponses, axModelInfoReka, axModelInfoTogether, axModelInfoWebLLM, axProcessContentForProvider, axRAG, axScoreProvidersForRequest, axSelectOptimalProvider, axSpanAttributes, axSpanEvents, axUpdateMetricsConfig, axUpdateOptimizerMetricsConfig, axValidateChatRequestMessage, axValidateChatResponseResult, axValidateProviderCapabilities, axWorkerRuntime, f, flow, fn, s };
11253
+ export { AxACE, type AxACEBullet, type AxACECuratorOperation, type AxACECuratorOperationType, type AxACECuratorOutput, type AxACEFeedbackEvent, type AxACEGeneratorOutput, type AxACEOptimizationArtifact, AxACEOptimizedProgram, type AxACEOptions, type AxACEPlaybook, type AxACEReflectionOutput, type AxACEResult, AxAI, AxAIAnthropic, type AxAIAnthropicArgs, type AxAIAnthropicChatError, type AxAIAnthropicChatRequest, type AxAIAnthropicChatRequestCacheParam, type AxAIAnthropicChatResponse, type AxAIAnthropicChatResponseDelta, type AxAIAnthropicConfig, type AxAIAnthropicContentBlockDeltaEvent, type AxAIAnthropicContentBlockStartEvent, type AxAIAnthropicContentBlockStopEvent, type AxAIAnthropicEffortLevel, type AxAIAnthropicEffortLevelMapping, type AxAIAnthropicErrorEvent, type AxAIAnthropicFunctionTool, type AxAIAnthropicMessageDeltaEvent, type AxAIAnthropicMessageStartEvent, type AxAIAnthropicMessageStopEvent, AxAIAnthropicModel, type AxAIAnthropicOutputConfig, type AxAIAnthropicPingEvent, type AxAIAnthropicRequestTool, type AxAIAnthropicThinkingConfig, type AxAIAnthropicThinkingTokenBudgetLevels, type AxAIAnthropicThinkingWire, AxAIAnthropicVertexModel, type AxAIAnthropicWebSearchTool, type AxAIArgs, AxAIAzureOpenAI, type AxAIAzureOpenAIArgs, type AxAIAzureOpenAIConfig, AxAICohere, type AxAICohereArgs, type AxAICohereChatRequest, type AxAICohereChatRequestToolResults, type AxAICohereChatResponse, type AxAICohereChatResponseDelta, type AxAICohereChatResponseToolCalls, type AxAICohereConfig, AxAICohereEmbedModel, type AxAICohereEmbedRequest, type AxAICohereEmbedResponse, AxAICohereModel, AxAIDeepSeek, type AxAIDeepSeekArgs, AxAIDeepSeekModel, type AxAIEmbedModels, type AxAIFeatures, AxAIGoogleGemini, type AxAIGoogleGeminiArgs, type AxAIGoogleGeminiBatchEmbedRequest, type AxAIGoogleGeminiBatchEmbedResponse, type AxAIGoogleGeminiCacheCreateRequest, type AxAIGoogleGeminiCacheResponse, type AxAIGoogleGeminiCacheUpdateRequest, type AxAIGoogleGeminiChatRequest, type AxAIGoogleGeminiChatResponse, type AxAIGoogleGeminiChatResponseDelta, type AxAIGoogleGeminiConfig, type AxAIGoogleGeminiContent, type AxAIGoogleGeminiContentPart, AxAIGoogleGeminiEmbedModel, AxAIGoogleGeminiEmbedTypes, type AxAIGoogleGeminiGenerationConfig, AxAIGoogleGeminiModel, type AxAIGoogleGeminiOptionsTools, type AxAIGoogleGeminiRetrievalConfig, AxAIGoogleGeminiSafetyCategory, type AxAIGoogleGeminiSafetySettings, AxAIGoogleGeminiSafetyThreshold, type AxAIGoogleGeminiThinkingConfig, type AxAIGoogleGeminiThinkingLevel, type AxAIGoogleGeminiThinkingLevelMapping, type AxAIGoogleGeminiThinkingTokenBudgetLevels, type AxAIGoogleGeminiTool, type AxAIGoogleGeminiToolConfig, type AxAIGoogleGeminiToolFunctionDeclaration, type AxAIGoogleGeminiToolGoogleMaps, type AxAIGoogleGeminiToolGoogleSearchRetrieval, type AxAIGoogleVertexBatchEmbedRequest, type AxAIGoogleVertexBatchEmbedResponse, AxAIGrok, type AxAIGrokArgs, type AxAIGrokChatRequest, AxAIGrokEmbedModels, AxAIGrokModel, type AxAIGrokOptionsTools, type AxAIGrokSearchSource, AxAIGroq, type AxAIGroqArgs, AxAIGroqModel, AxAIHuggingFace, type AxAIHuggingFaceArgs, type AxAIHuggingFaceConfig, AxAIHuggingFaceModel, type AxAIHuggingFaceRequest, type AxAIHuggingFaceResponse, type AxAIInputModelList, type AxAIMemory, type AxAIMetricsInstruments, AxAIMistral, type AxAIMistralArgs, type AxAIMistralChatRequest, AxAIMistralEmbedModels, AxAIMistralModel, type AxAIModelList, type AxAIModelListBase, type AxAIModels, AxAIOllama, type AxAIOllamaAIConfig, type AxAIOllamaArgs, AxAIOpenAI, type AxAIOpenAIAnnotation, type AxAIOpenAIArgs, AxAIOpenAIBase, type AxAIOpenAIBaseArgs, type AxAIOpenAIChatRequest, type AxAIOpenAIChatResponse, type AxAIOpenAIChatResponseDelta, type AxAIOpenAIConfig, AxAIOpenAIEmbedModel, type AxAIOpenAIEmbedRequest, type AxAIOpenAIEmbedResponse, type AxAIOpenAILogprob, AxAIOpenAIModel, type AxAIOpenAIResponseDelta, AxAIOpenAIResponses, type AxAIOpenAIResponsesArgs, AxAIOpenAIResponsesBase, type AxAIOpenAIResponsesCodeInterpreterToolCall, type AxAIOpenAIResponsesComputerToolCall, type AxAIOpenAIResponsesConfig, type AxAIOpenAIResponsesContentPartAddedEvent, type AxAIOpenAIResponsesContentPartDoneEvent, type AxAIOpenAIResponsesDefineFunctionTool, type AxAIOpenAIResponsesErrorEvent, type AxAIOpenAIResponsesFileSearchCallCompletedEvent, type AxAIOpenAIResponsesFileSearchCallInProgressEvent, type AxAIOpenAIResponsesFileSearchCallSearchingEvent, type AxAIOpenAIResponsesFileSearchToolCall, type AxAIOpenAIResponsesFunctionCallArgumentsDeltaEvent, type AxAIOpenAIResponsesFunctionCallArgumentsDoneEvent, type AxAIOpenAIResponsesFunctionCallItem, type AxAIOpenAIResponsesImageGenerationCallCompletedEvent, type AxAIOpenAIResponsesImageGenerationCallGeneratingEvent, type AxAIOpenAIResponsesImageGenerationCallInProgressEvent, type AxAIOpenAIResponsesImageGenerationCallPartialImageEvent, type AxAIOpenAIResponsesImageGenerationToolCall, AxAIOpenAIResponsesImpl, type AxAIOpenAIResponsesInputAudioContentPart, type AxAIOpenAIResponsesInputContentPart, type AxAIOpenAIResponsesInputFunctionCallItem, type AxAIOpenAIResponsesInputFunctionCallOutputItem, type AxAIOpenAIResponsesInputImageUrlContentPart, type AxAIOpenAIResponsesInputItem, type AxAIOpenAIResponsesInputMessageItem, type AxAIOpenAIResponsesInputTextContentPart, type AxAIOpenAIResponsesLocalShellToolCall, type AxAIOpenAIResponsesMCPCallArgumentsDeltaEvent, type AxAIOpenAIResponsesMCPCallArgumentsDoneEvent, type AxAIOpenAIResponsesMCPCallCompletedEvent, type AxAIOpenAIResponsesMCPCallFailedEvent, type AxAIOpenAIResponsesMCPCallInProgressEvent, type AxAIOpenAIResponsesMCPListToolsCompletedEvent, type AxAIOpenAIResponsesMCPListToolsFailedEvent, type AxAIOpenAIResponsesMCPListToolsInProgressEvent, type AxAIOpenAIResponsesMCPToolCall, AxAIOpenAIResponsesModel, type AxAIOpenAIResponsesOutputItem, type AxAIOpenAIResponsesOutputItemAddedEvent, type AxAIOpenAIResponsesOutputItemDoneEvent, type AxAIOpenAIResponsesOutputMessageItem, type AxAIOpenAIResponsesOutputRefusalContentPart, type AxAIOpenAIResponsesOutputTextAnnotationAddedEvent, type AxAIOpenAIResponsesOutputTextContentPart, type AxAIOpenAIResponsesOutputTextDeltaEvent, type AxAIOpenAIResponsesOutputTextDoneEvent, type AxAIOpenAIResponsesReasoningDeltaEvent, type AxAIOpenAIResponsesReasoningDoneEvent, type AxAIOpenAIResponsesReasoningItem, type AxAIOpenAIResponsesReasoningSummaryDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryDoneEvent, type AxAIOpenAIResponsesReasoningSummaryPart, type AxAIOpenAIResponsesReasoningSummaryPartAddedEvent, type AxAIOpenAIResponsesReasoningSummaryPartDoneEvent, type AxAIOpenAIResponsesReasoningSummaryTextDeltaEvent, type AxAIOpenAIResponsesReasoningSummaryTextDoneEvent, type AxAIOpenAIResponsesRefusalDeltaEvent, type AxAIOpenAIResponsesRefusalDoneEvent, type AxAIOpenAIResponsesRequest, type AxAIOpenAIResponsesResponse, type AxAIOpenAIResponsesResponseCompletedEvent, type AxAIOpenAIResponsesResponseCreatedEvent, type AxAIOpenAIResponsesResponseDelta, type AxAIOpenAIResponsesResponseFailedEvent, type AxAIOpenAIResponsesResponseInProgressEvent, type AxAIOpenAIResponsesResponseIncompleteEvent, type AxAIOpenAIResponsesResponseQueuedEvent, type AxAIOpenAIResponsesStreamEvent, type AxAIOpenAIResponsesStreamEventBase, type AxAIOpenAIResponsesToolCall, type AxAIOpenAIResponsesToolCallBase, type AxAIOpenAIResponsesToolChoice, type AxAIOpenAIResponsesToolDefinition, type AxAIOpenAIResponsesWebSearchCallCompletedEvent, type AxAIOpenAIResponsesWebSearchCallInProgressEvent, type AxAIOpenAIResponsesWebSearchCallSearchingEvent, type AxAIOpenAIResponsesWebSearchToolCall, type AxAIOpenAIUrlCitation, type AxAIOpenAIUsage, AxAIOpenRouter, type AxAIOpenRouterArgs, AxAIRefusalError, AxAIReka, type AxAIRekaArgs, type AxAIRekaChatRequest, type AxAIRekaChatResponse, type AxAIRekaChatResponseDelta, type AxAIRekaConfig, AxAIRekaModel, type AxAIRekaUsage, type AxAIService, AxAIServiceAbortedError, type AxAIServiceActionOptions, AxAIServiceAuthenticationError, AxAIServiceError, type AxAIServiceImpl, type AxAIServiceMetrics, type AxAIServiceModelType, AxAIServiceNetworkError, type AxAIServiceOptions, AxAIServiceResponseError, AxAIServiceStatusError, AxAIServiceStreamTerminatedError, AxAIServiceTimeoutError, AxAITogether, type AxAITogetherArgs, type AxAITogetherChatModel, AxAITogetherModel, AxAIWebLLM, type AxAIWebLLMArgs, type AxAIWebLLMChatRequest, type AxAIWebLLMChatResponse, type AxAIWebLLMChatResponseDelta, type AxAIWebLLMConfig, type AxAIWebLLMEmbedModel, type AxAIWebLLMEmbedRequest, type AxAIWebLLMEmbedResponse, AxAIWebLLMModel, type AxAPI, type AxAPIConfig, AxAgent, type AxAgentCompletionProtocol, type AxAgentConfig, type AxAgentDemos, type AxAgentFunction, type AxAgentFunctionExample, type AxAgentFunctionGroup, type AxAgentInputUpdateCallback, type AxAgentOptions, type AxAgentRecursionOptions, type AxAgentTestCompletionPayload, type AxAgentTestResult, type AxAgentic, AxApacheTika, type AxApacheTikaArgs, type AxApacheTikaConvertOptions, type AxAssertion, AxAssertionError, AxBalancer, type AxBalancerOptions, AxBaseAI, type AxBaseAIArgs, AxBaseOptimizer, AxBootstrapFewShot, type AxBootstrapOptimizerOptions, type AxChatRequest, type AxChatResponse, type AxChatResponseFunctionCall, type AxChatResponseResult, type AxCheckpoint, type AxCheckpointLoadFn, type AxCheckpointSaveFn, type AxCitation, type AxCodeInterpreter, type AxCodeRuntime, type AxCodeSession, type AxCompileOptions, AxContentProcessingError, type AxContentProcessingServices, type AxContextCacheInfo, type AxContextCacheOperation, type AxContextCacheOptions, type AxContextCacheRegistry, type AxContextCacheRegistryEntry, type AxContextFieldInput, type AxContextPolicyConfig, type AxContextPolicyPreset, type AxCostTracker, type AxCostTrackerOptions, AxDB, type AxDBArgs, AxDBBase, type AxDBBaseArgs, type AxDBBaseOpOptions, AxDBCloudflare, type AxDBCloudflareArgs, type AxDBCloudflareOpOptions, type AxDBLoaderOptions, AxDBManager, type AxDBManagerArgs, type AxDBMatch, AxDBMemory, type AxDBMemoryArgs, type AxDBMemoryOpOptions, AxDBPinecone, type AxDBPineconeArgs, type AxDBPineconeOpOptions, type AxDBQueryRequest, type AxDBQueryResponse, type AxDBQueryService, type AxDBService, type AxDBState, type AxDBUpsertRequest, type AxDBUpsertResponse, AxDBWeaviate, type AxDBWeaviateArgs, type AxDBWeaviateOpOptions, type AxDataRow, AxDefaultCostTracker, AxDefaultResultReranker, type AxDockerContainer, AxDockerSession, type AxEmbedRequest, type AxEmbedResponse, AxEmbeddingAdapter, type AxErrorCategory, AxEvalUtil, type AxEvaluateArgs, type AxExample$1 as AxExample, type AxExamples, type AxField, type AxFieldProcessor, type AxFieldProcessorProcess, type AxFieldTemplateFn, type AxFieldType, type AxFieldValue, AxFlow, type AxFlowAutoParallelConfig, type AxFlowBranchContext, type AxFlowBranchEvaluationData, type AxFlowCompleteData, AxFlowDependencyAnalyzer, type AxFlowDynamicContext, type AxFlowErrorData, AxFlowExecutionPlanner, type AxFlowExecutionStep, type AxFlowLogData, type AxFlowLoggerData, type AxFlowLoggerFunction, type AxFlowNodeDefinition, type AxFlowParallelBranch, type AxFlowParallelGroup, type AxFlowParallelGroupCompleteData, type AxFlowParallelGroupStartData, type AxFlowStartData, type AxFlowState, type AxFlowStepCompleteData, type AxFlowStepFunction, type AxFlowStepStartData, type AxFlowSubContext, AxFlowSubContextImpl, type AxFlowTypedParallelBranch, type AxFlowTypedSubContext, AxFlowTypedSubContextImpl, type AxFlowable, type AxFluentFieldInfo, AxFluentFieldType, type AxForwardable, type AxFunction, type AxFunctionCallRecord, AxFunctionError, type AxFunctionHandler, type AxFunctionJSONSchema, AxFunctionProcessor, type AxFunctionResult, type AxFunctionResultFormatter, AxGEPA, type AxGEPAAdapter, type AxGEPAEvaluationBatch, type AxGEPAOptimizationReport, AxGen, type AxGenDeltaOut, type AxGenIn, type AxGenInput, type AxGenMetricsInstruments, type AxGenOut, type AxGenOutput, type AxGenStreamingOut, AxGenerateError, type AxGenerateErrorDetails, type AxGenerateResult, AxHFDataLoader, type AxIField, type AxInputFunctionType, AxInstanceRegistry, type AxInternalChatRequest, type AxInternalEmbedRequest, AxJSRuntime, type AxJSRuntimeOutputMode, AxJSRuntimePermission, AxJudge, type AxJudgeMode, type AxJudgeOptions, type AxJudgeResult, type AxJudgeRubric, AxLLMRequestTypeValues, AxLearn, type AxLearnArtifact, type AxLearnCheckpointMode, type AxLearnCheckpointState, type AxLearnContinuousOptions, type AxLearnMode, type AxLearnOptimizeOptions, type AxLearnOptions, type AxLearnPlaybook, type AxLearnPlaybookOptions, type AxLearnPlaybookSummary, type AxLearnProgress, type AxLearnResult, type AxLearnUpdateFeedback, type AxLearnUpdateInput, type AxLearnUpdateOptions, type AxLoggerData, type AxLoggerFunction, type AxMCPBlobResourceContents, AxMCPClient, type AxMCPEmbeddedResource, type AxMCPFunctionDescription, AxMCPHTTPSSETransport, type AxMCPImageContent, type AxMCPInitializeParams, type AxMCPInitializeResult, type AxMCPJSONRPCErrorResponse, type AxMCPJSONRPCNotification, type AxMCPJSONRPCRequest, type AxMCPJSONRPCResponse, type AxMCPJSONRPCSuccessResponse, type AxMCPOAuthOptions, type AxMCPPrompt, type AxMCPPromptArgument, type AxMCPPromptGetResult, type AxMCPPromptMessage, type AxMCPPromptsListResult, type AxMCPResource, type AxMCPResourceReadResult, type AxMCPResourceTemplate, type AxMCPResourceTemplatesListResult, type AxMCPResourcesListResult, type AxMCPStreamableHTTPTransportOptions, AxMCPStreambleHTTPTransport, type AxMCPTextContent, type AxMCPTextResourceContents, type AxMCPToolsListResult, type AxMCPTransport, AxMediaNotSupportedError, AxMemory, type AxMemoryData, type AxMemoryMessageValue, type AxMessage, type AxMetricFn, type AxMetricFnArgs, type AxMetricsConfig, AxMiPRO, type AxMiPROOptimizerOptions, type AxMiPROResult, AxMockAIService, type AxMockAIServiceConfig, type AxModelConfig, type AxModelInfo, type AxModelInfoWithProvider, type AxModelUsage, type AxMultiMetricFn, type AxMultiProviderConfig, AxMultiServiceRouter, type AxNamedProgramInstance, type AxOptimizationCheckpoint, type AxOptimizationProgress, type AxOptimizationStats, type AxOptimizedProgram, AxOptimizedProgramImpl, type AxOptimizer, type AxOptimizerArgs, type AxOptimizerLoggerData, type AxOptimizerLoggerFunction, type AxOptimizerMetricsConfig, type AxOptimizerMetricsInstruments, type AxOptimizerResult, type AxParetoResult, type AxPreparedChatRequest, AxProgram, type AxProgramDemos, type AxProgramExamples, type AxProgramForwardOptions, type AxProgramForwardOptionsWithModels, type AxProgramOptions, type AxProgramStreamingForwardOptions, type AxProgramStreamingForwardOptionsWithModels, type AxProgramTrace, type AxProgramUsage, type AxProgrammable, AxPromptTemplate, type AxPromptTemplateOptions, AxProviderRouter, type AxRLMConfig, type AxRateLimiterFunction, AxRateLimiterTokenUsage, type AxRateLimiterTokenUsageOptions, type AxRerankerIn, type AxRerankerOut, type AxResponseHandlerArgs, type AxResultPickerFunction, type AxResultPickerFunctionFieldResults, type AxResultPickerFunctionFunctionResults, type AxRewriteIn, type AxRewriteOut, type AxRoutingResult, type AxSamplePickerOptions, type AxSelfTuningConfig, type AxSetExamplesOptions, AxSignature, AxSignatureBuilder, type AxSignatureConfig, AxSimpleClassifier, AxSimpleClassifierClass, type AxSimpleClassifierForwardOptions, AxSpanKindValues, type AxStepContext, AxStepContextImpl, type AxStepHooks, type AxStepUsage, AxStopFunctionCallException, type AxStorage, type AxStorageQuery, type AxStreamingAssertion, type AxStreamingEvent, type AxStreamingFieldProcessorProcess, AxStringUtil, AxSynth, type AxSynthExample, type AxSynthOptions, type AxSynthResult, AxTestPrompt, type AxThoughtBlockItem, AxTokenLimitError, type AxTokenUsage, type AxTrace, AxTraceLogger, type AxTraceLoggerOptions, type AxTunable, type AxTypedExample, type AxUsable, type AxWorkerRuntimeConfig, agent, ai, ax, axAIAnthropicDefaultConfig, axAIAnthropicVertexDefaultConfig, axAIAzureOpenAIBestConfig, axAIAzureOpenAICreativeConfig, axAIAzureOpenAIDefaultConfig, axAIAzureOpenAIFastConfig, axAICohereCreativeConfig, axAICohereDefaultConfig, axAIDeepSeekCodeConfig, axAIDeepSeekDefaultConfig, axAIGoogleGeminiDefaultConfig, axAIGoogleGeminiDefaultCreativeConfig, axAIGrokBestConfig, axAIGrokDefaultConfig, axAIHuggingFaceCreativeConfig, axAIHuggingFaceDefaultConfig, axAIMistralBestConfig, axAIMistralDefaultConfig, axAIOllamaDefaultConfig, axAIOllamaDefaultCreativeConfig, axAIOpenAIBestConfig, axAIOpenAICreativeConfig, axAIOpenAIDefaultConfig, axAIOpenAIFastConfig, axAIOpenAIResponsesBestConfig, axAIOpenAIResponsesCreativeConfig, axAIOpenAIResponsesDefaultConfig, axAIOpenRouterDefaultConfig, axAIRekaBestConfig, axAIRekaCreativeConfig, axAIRekaDefaultConfig, axAIRekaFastConfig, axAITogetherDefaultConfig, axAIWebLLMCreativeConfig, axAIWebLLMDefaultConfig, axAnalyzeChatPromptRequirements, axAnalyzeRequestRequirements, axBaseAIDefaultConfig, axBaseAIDefaultCreativeConfig, axBuildActorDefinition, axBuildResponderDefinition, axCheckMetricsHealth, axCreateDefaultColorLogger, axCreateDefaultOptimizerColorLogger, axCreateDefaultOptimizerTextLogger, axCreateDefaultTextLogger, axCreateFlowColorLogger, axCreateFlowTextLogger, axCreateJSRuntime, axDefaultFlowLogger, axDefaultMetricsConfig, axDefaultOptimizerLogger, axDefaultOptimizerMetricsConfig, axGetCompatibilityReport, axGetFormatCompatibility, axGetMetricsConfig, axGetOptimizerMetricsConfig, axGetProvidersWithMediaSupport, axGlobals, axModelInfoAnthropic, axModelInfoCohere, axModelInfoDeepSeek, axModelInfoGoogleGemini, axModelInfoGrok, axModelInfoGroq, axModelInfoHuggingFace, axModelInfoMistral, axModelInfoOpenAI, axModelInfoOpenAIResponses, axModelInfoReka, axModelInfoTogether, axModelInfoWebLLM, axProcessContentForProvider, axRAG, axScoreProvidersForRequest, axSelectOptimalProvider, axSpanAttributes, axSpanEvents, axUpdateMetricsConfig, axUpdateOptimizerMetricsConfig, axValidateChatRequestMessage, axValidateChatResponseResult, axValidateProviderCapabilities, axWorkerRuntime, f, flow, fn, s };