@ax-llm/ax 19.0.19 → 19.0.21

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.ts CHANGED
@@ -9962,174 +9962,289 @@ declare class AxEmbeddingAdapter {
9962
9962
  }
9963
9963
 
9964
9964
  /**
9965
- * RLM (Recursive Language Model) interfaces and prompt builder.
9965
+ * Semantic Context Management for the AxAgent RLM loop.
9966
9966
  *
9967
- * Pluggable interpreter interface anyone can implement for any runtime.
9968
- * No Node.js-specific imports; browser-safe.
9967
+ * Manages the action log by evaluating step importance via hindsight heuristics,
9968
+ * generating compact tombstones for resolved errors, and pruning low-value entries
9969
+ * to maximize context window utility.
9969
9970
  */
9970
9971
 
9972
+ type ActionLogTag = 'error' | 'dead-end' | 'foundational' | 'pivot' | 'superseded';
9973
+ type ActionLogStepKind = 'explore' | 'transform' | 'query' | 'finalize' | 'error';
9974
+ type ActionReplayMode = 'full' | 'omit';
9975
+ type DiscoveryModuleSection = {
9976
+ module: string;
9977
+ text: string;
9978
+ };
9979
+ type DiscoveryFunctionSection = {
9980
+ qualifiedName: string;
9981
+ text: string;
9982
+ };
9983
+ type ActionLogEntry = {
9984
+ turn: number;
9985
+ code: string;
9986
+ output: string;
9987
+ actorFieldsOutput: string;
9988
+ tags: ActionLogTag[];
9989
+ summary?: string;
9990
+ producedVars?: string[];
9991
+ referencedVars?: string[];
9992
+ stateDelta?: string;
9993
+ stepKind?: ActionLogStepKind;
9994
+ replayMode?: ActionReplayMode;
9995
+ /** 0-5 importance score set by hindsight evaluation. */
9996
+ rank?: number;
9997
+ /** Compact summary replacing full code+output when rendered. */
9998
+ tombstone?: string;
9999
+ /** @internal Pending tombstone generation. */
10000
+ _tombstonePromise?: Promise<string>;
10001
+ /** @internal Parsed discovery module sections for prompt-facing filtering. */
10002
+ _discoveryModuleSections?: readonly DiscoveryModuleSection[];
10003
+ /** @internal Parsed discovery callable sections for prompt-facing filtering. */
10004
+ _discoveryFunctionSections?: readonly DiscoveryFunctionSection[];
10005
+ /** @internal Direct qualified callable usages like `db.search(...)`. */
10006
+ _directQualifiedCalls?: readonly string[];
10007
+ };
10008
+ type CheckpointSummaryState = {
10009
+ fingerprint: string;
10010
+ summary: string;
10011
+ turns: number[];
10012
+ };
10013
+ type RuntimeStateVariableProvenance = {
10014
+ createdTurn: number;
10015
+ lastReadTurn?: number;
10016
+ stepKind?: ActionLogStepKind;
10017
+ source?: string;
10018
+ code?: string;
10019
+ };
10020
+
9971
10021
  /**
9972
- * A code runtime that can create persistent sessions.
9973
- * Implement this interface for your target runtime (Node.js, browser, WASM, etc.).
10022
+ * Interface for agents that can be used as child agents.
10023
+ * Provides methods to get the agent's function definition and features.
9974
10024
  */
9975
- interface AxCodeRuntime {
9976
- createSession(globals?: Record<string, unknown>): AxCodeSession;
9977
- /**
9978
- * Optional runtime-specific usage guidance injected into the RLM system prompt.
9979
- * Use this for execution semantics that differ by runtime/language.
9980
- */
9981
- getUsageInstructions(): string;
10025
+ interface AxAgentic<IN extends AxGenIn, OUT extends AxGenOut> extends AxProgrammable<IN, OUT> {
10026
+ getFunction(): AxFunction;
10027
+ /** Returns the list of shared fields this agent wants to exclude. */
10028
+ getExcludedSharedFields?(): readonly string[];
10029
+ /** Returns the list of shared agents this agent wants to exclude (by function name). */
10030
+ getExcludedAgents?(): readonly string[];
10031
+ /** Returns the list of shared agent functions this agent wants to exclude (by name). */
10032
+ getExcludedAgentFunctions?(): readonly string[];
9982
10033
  }
9983
- /**
9984
- * @deprecated Use `AxCodeRuntime` instead.
9985
- */
9986
- type AxCodeInterpreter = AxCodeRuntime;
9987
- type AxCodeSessionSnapshotEntry = {
10034
+ type AxAnyAgentic = AxAgentic<any, any>;
10035
+ type AxAgentIdentity = {
9988
10036
  name: string;
9989
- type: string;
9990
- ctor?: string;
9991
- size?: string;
9992
- preview?: string;
9993
- restorable?: boolean;
10037
+ description: string;
10038
+ namespace?: string;
9994
10039
  };
9995
- type AxCodeSessionSnapshot = {
10040
+ type AxAgentFunctionModuleMeta = {
10041
+ namespace: string;
10042
+ title: string;
10043
+ selectionCriteria: string;
10044
+ description: string;
10045
+ };
10046
+ type AxAgentFunctionExample = {
10047
+ code: string;
10048
+ title?: string;
10049
+ description?: string;
10050
+ language?: string;
10051
+ };
10052
+ type AxAgentFunction = AxFunction & {
10053
+ examples?: readonly AxAgentFunctionExample[];
10054
+ };
10055
+ type AxAgentFunctionGroup = AxAgentFunctionModuleMeta & {
10056
+ functions: readonly Omit<AxAgentFunction, 'namespace'>[];
10057
+ };
10058
+ type AxAgentTestCompletionPayload = {
10059
+ type: 'final' | 'ask_clarification';
10060
+ args: unknown[];
10061
+ };
10062
+ type AxAgentTestResult = string | AxAgentTestCompletionPayload;
10063
+ type AxAgentClarificationKind = 'text' | 'number' | 'date' | 'single_choice' | 'multiple_choice';
10064
+ type AxAgentClarificationChoice = string | {
10065
+ label: string;
10066
+ value?: string;
10067
+ };
10068
+ type AxAgentClarification = string | AxAgentStructuredClarification;
10069
+ type AxAgentStructuredClarification = {
10070
+ question: string;
10071
+ type?: AxAgentClarificationKind;
10072
+ choices?: AxAgentClarificationChoice[];
10073
+ [key: string]: unknown;
10074
+ };
10075
+ type AxAgentStateActionLogEntry = Pick<ActionLogEntry, 'turn' | 'code' | 'output' | 'actorFieldsOutput' | 'tags' | 'summary' | 'producedVars' | 'referencedVars' | 'stateDelta' | 'stepKind' | 'replayMode' | 'rank' | 'tombstone'>;
10076
+ type AxAgentStateCheckpointState = CheckpointSummaryState;
10077
+ type AxAgentStateRuntimeEntry = AxCodeSessionSnapshotEntry;
10078
+ type AxAgentState = {
9996
10079
  version: 1;
9997
- entries: AxCodeSessionSnapshotEntry[];
9998
- bindings: Record<string, unknown>;
10080
+ runtimeBindings: Record<string, unknown>;
10081
+ runtimeEntries: AxAgentStateRuntimeEntry[];
10082
+ actionLogEntries: AxAgentStateActionLogEntry[];
10083
+ checkpointState?: AxAgentStateCheckpointState;
10084
+ provenance: Record<string, RuntimeStateVariableProvenance>;
9999
10085
  };
10000
- /**
10001
- * A persistent code execution session. Variables persist across `execute()` calls.
10002
- */
10003
- interface AxCodeSession {
10004
- execute(code: string, options?: {
10005
- signal?: AbortSignal;
10006
- reservedNames?: readonly string[];
10007
- }): Promise<unknown>;
10008
- inspectGlobals?(options?: {
10009
- signal?: AbortSignal;
10010
- reservedNames?: readonly string[];
10011
- }): Promise<string>;
10012
- snapshotGlobals?(options?: {
10013
- signal?: AbortSignal;
10014
- reservedNames?: readonly string[];
10015
- }): Promise<AxCodeSessionSnapshot>;
10016
- patchGlobals(globals: Record<string, unknown>, options?: {
10017
- signal?: AbortSignal;
10018
- }): Promise<void>;
10019
- close(): void;
10086
+ declare class AxAgentClarificationError extends Error {
10087
+ readonly question: string;
10088
+ readonly clarification: AxAgentStructuredClarification;
10089
+ private readonly stateSnapshot;
10090
+ private readonly stateErrorMessage;
10091
+ constructor(clarification: AxAgentClarification, options?: Readonly<{
10092
+ state?: AxAgentState;
10093
+ stateError?: string;
10094
+ }>);
10095
+ getState(): AxAgentState | undefined;
10020
10096
  }
10097
+ type AxAgentFunctionCollection = readonly AxAgentFunction[] | readonly AxAgentFunctionGroup[];
10098
+ type AxContextFieldInput = string | {
10099
+ field: string;
10100
+ promptMaxChars?: number;
10101
+ keepInPromptChars?: number;
10102
+ reverseTruncate?: boolean;
10103
+ };
10021
10104
  /**
10022
- * Opinionated context replay presets for the Actor loop.
10023
- *
10024
- * - `full`: Keep prior actions fully replayed with minimal compression.
10025
- * Best for debugging or short tasks where the actor should reread exact old code/output.
10026
- * - `adaptive`: Keep live runtime state visible, preserve recent or dependency-relevant
10027
- * actions in full, hide used discovery docs, and collapse older successful work
10028
- * into checkpoint summaries as context grows. Reliability-first defaults favor
10029
- * summaries before deletion. Best default for long multi-turn tasks.
10030
- * - `lean`: Most aggressive compression. Keep live runtime state visible, checkpoint
10031
- * older successful work, hide used discovery docs, and summarize replay-pruned
10032
- * successful turns instead of replaying their full code blocks. Reliability-first
10033
- * defaults still preserve recent evidence before deleting older low-value steps.
10034
- * Best when token pressure matters more than raw replay detail.
10035
- */
10036
- type AxContextPolicyPreset = 'full' | 'adaptive' | 'lean';
10037
- /**
10038
- * Public context policy for the Actor loop.
10039
- * Presets provide the common behavior; top-level toggles plus `state`,
10040
- * `checkpoints`, and `expert` override specific pieces.
10105
+ * Demo traces for AxAgent's split architecture.
10106
+ * Actor demos use `{ javascriptCode }` + optional actorFields.
10107
+ * Responder demos use the agent's output type + optional input fields.
10041
10108
  */
10042
- interface AxContextPolicyConfig {
10043
- /**
10044
- * Opinionated preset for how the agent should replay and compress context.
10045
- *
10046
- * - `full`: prefer raw replay of earlier actions
10047
- * - `adaptive`: balance replay detail with checkpoint compression
10048
- * - `lean`: prefer live state + compact summaries over raw replay detail
10049
- */
10050
- preset?: AxContextPolicyPreset;
10051
- /**
10052
- * Default options for the internal checkpoint summarizer AxGen program.
10053
- * `functions` are not supported, `maxSteps` is forced to `1`, and `mem`
10054
- * is never propagated so the summarizer stays stateless.
10055
- */
10056
- summarizerOptions?: Omit<AxProgramForwardOptions<string>, 'functions'>;
10057
- /**
10058
- * Hide stale discovery docs from later actor prompts after a discovered
10059
- * callable is used successfully. This only affects prompt replay; it does
10060
- * not delete internal history or remove runtime values.
10061
- *
10062
- * Defaults by preset:
10063
- * - `full`: false
10064
- * - `adaptive`: true
10065
- * - `lean`: true
10066
- */
10067
- pruneUsedDocs?: boolean;
10109
+ type AxAgentDemos<IN extends AxGenIn, OUT extends AxGenOut, PREFIX extends string = string> = {
10110
+ programId: `${PREFIX}.actor`;
10111
+ traces: (Record<string, AxFieldValue> & {
10112
+ javascriptCode: string;
10113
+ })[];
10114
+ } | {
10115
+ programId: `${PREFIX}.responder`;
10116
+ traces: (OUT & Partial<IN>)[];
10117
+ };
10118
+ type AxAgentInputUpdateCallback<IN extends AxGenIn> = (currentInputs: Readonly<IN>) => Promise<Partial<IN> | undefined> | Partial<IN> | undefined;
10119
+ type AxAgentTurnCallbackArgs = {
10120
+ /** 1-based actor turn number. */
10121
+ turn: number;
10122
+ /** Full actor AxGen output for the turn, including javascriptCode and any actor fields. */
10123
+ actorResult: Record<string, unknown>;
10124
+ /** Normalized JavaScript that was executed for this turn. */
10125
+ code: string;
10068
10126
  /**
10069
- * Prune error entries after a successful (non-error) turn.
10070
- *
10071
- * Defaults by preset:
10072
- * - `full`: false
10073
- * - `adaptive`: true
10074
- * - `lean`: true
10127
+ * Raw runtime execution result before formatting or truncation.
10128
+ * For policy-violation turns and completion-signal turns, this is undefined.
10075
10129
  */
10076
- pruneErrors?: boolean;
10077
- /** Runtime-state visibility controls. */
10078
- state?: {
10079
- /** Include a compact live runtime state block ahead of the action log. */
10080
- summary?: boolean;
10081
- /** Expose `inspect_runtime()` to the actor and show the large-context hint. */
10082
- inspect?: boolean;
10083
- /** Character count above which the actor is reminded to call `inspect_runtime()`. */
10084
- inspectThresholdChars?: number;
10085
- /** Maximum number of runtime state entries to render in the summary block. */
10086
- maxEntries?: number;
10087
- /** Maximum total characters to replay in the runtime state summary block. */
10088
- maxChars?: number;
10089
- };
10090
- /** Rolling checkpoint summary controls. */
10091
- checkpoints?: {
10092
- /** Enable checkpoint summaries for older successful turns. */
10093
- enabled?: boolean;
10094
- /** Character count above which a checkpoint summary is generated. */
10095
- triggerChars?: number;
10130
+ result: unknown;
10131
+ /** Action-log-safe runtime output string after formatting/truncation. */
10132
+ output: string;
10133
+ /** True when the turn recorded an error output. */
10134
+ isError: boolean;
10135
+ /** Thought text returned by the actor AxGen when available. */
10136
+ thought?: string;
10137
+ };
10138
+ type AxAgentJudgeOptions = Partial<Omit<AxJudgeOptions, 'ai'>>;
10139
+ type AxAgentOptimizeTarget = 'actor' | 'responder' | 'all' | readonly string[];
10140
+ type AxAgentEvalFunctionCall = {
10141
+ qualifiedName: string;
10142
+ name: string;
10143
+ arguments: AxFieldValue;
10144
+ result?: AxFieldValue;
10145
+ error?: string;
10146
+ };
10147
+ type AxAgentEvalPrediction<OUT = any> = {
10148
+ completionType: 'final';
10149
+ output: OUT;
10150
+ clarification?: undefined;
10151
+ actionLog: string;
10152
+ functionCalls: AxAgentEvalFunctionCall[];
10153
+ toolErrors: string[];
10154
+ turnCount: number;
10155
+ usage?: AxProgramUsage[];
10156
+ } | {
10157
+ completionType: 'ask_clarification';
10158
+ output?: undefined;
10159
+ clarification: AxAgentStructuredClarification;
10160
+ actionLog: string;
10161
+ functionCalls: AxAgentEvalFunctionCall[];
10162
+ toolErrors: string[];
10163
+ turnCount: number;
10164
+ usage?: AxProgramUsage[];
10165
+ };
10166
+ type AxAgentEvalTask<IN = any> = {
10167
+ input: IN;
10168
+ criteria: string;
10169
+ id?: string;
10170
+ expectedOutput?: AxFieldValue;
10171
+ expectedActions?: string[];
10172
+ forbiddenActions?: string[];
10173
+ weight?: number;
10174
+ metadata?: AxFieldValue;
10175
+ };
10176
+ type AxAgentEvalDataset<IN = any> = readonly AxAgentEvalTask<IN>[] | {
10177
+ train: readonly AxAgentEvalTask<IN>[];
10178
+ validation?: readonly AxAgentEvalTask<IN>[];
10179
+ };
10180
+ type AxAgentOptimizeOptions<_IN extends AxGenIn = AxGenIn, _OUT extends AxGenOut = AxGenOut> = {
10181
+ studentAI?: Readonly<AxAIService>;
10182
+ judgeAI?: Readonly<AxAIService>;
10183
+ teacherAI?: Readonly<AxAIService>;
10184
+ judgeOptions?: AxAgentJudgeOptions;
10185
+ target?: AxAgentOptimizeTarget;
10186
+ apply?: boolean;
10187
+ maxMetricCalls?: number;
10188
+ metric?: AxMetricFn;
10189
+ verbose?: boolean;
10190
+ debugOptimizer?: boolean;
10191
+ optimizerLogger?: AxOptimizerLoggerFunction;
10192
+ onProgress?: (progress: Readonly<AxOptimizationProgress>) => void;
10193
+ onEarlyStop?: (reason: string, stats: Readonly<AxOptimizationStats>) => void;
10194
+ };
10195
+ type AxAgentOptimizeResult<OUT extends AxGenOut = AxGenOut> = AxParetoResult<OUT>;
10196
+ type AxAgentOptions<IN extends AxGenIn = AxGenIn> = Omit<AxProgramForwardOptions<string>, 'functions' | 'description'> & {
10197
+ debug?: boolean;
10198
+ /**
10199
+ * Input fields used as context.
10200
+ * - `string`: runtime-only (legacy behavior)
10201
+ * - `{ field, promptMaxChars }`: runtime + conditionally inlined into Actor prompt
10202
+ * - `{ field, keepInPromptChars, reverseTruncate? }`: runtime + truncated string excerpt in Actor prompt
10203
+ */
10204
+ contextFields: readonly AxContextFieldInput[];
10205
+ /** Child agents and agent sharing configuration. */
10206
+ agents?: {
10207
+ /** Agents registered under the configured child-agent module namespace (default: `agents.*`). */
10208
+ local?: AxAnyAgentic[];
10209
+ /** Agents to automatically add to all direct child agents (one level). */
10210
+ shared?: AxAnyAgentic[];
10211
+ /** Agents to automatically add to ALL descendants recursively (entire agent tree). */
10212
+ globallyShared?: AxAnyAgentic[];
10213
+ /** Agent function names this agent should NOT receive from parents. */
10214
+ excluded?: string[];
10096
10215
  };
10097
- /** Expert-level overrides for the preset-derived internal policy. */
10098
- expert?: {
10099
- /** Controls how prior actor actions are replayed before checkpoint compression. */
10100
- replay?: 'full' | 'adaptive' | 'minimal';
10101
- /** Number of most-recent actions that should always remain fully rendered. */
10102
- recentFullActions?: number;
10103
- /** Rank-based pruning of low-value actions. Off by default for built-in presets. */
10104
- rankPruning?: {
10105
- enabled?: boolean;
10106
- minRank?: number;
10107
- };
10216
+ /** Field sharing configuration. */
10217
+ fields?: {
10108
10218
  /**
10109
- * Replace resolved errors with compact tombstones before pruning.
10110
- * When configured with options, they apply to the internal tombstone
10111
- * summarizer AxGen program. `functions` are not supported, `maxSteps`
10112
- * is forced to `1`, and `mem` is never propagated.
10219
+ * Shared/global fields that should remain available in this agent's own
10220
+ * Actor/Responder flow instead of bypassing it.
10113
10221
  */
10114
- tombstones?: boolean | Omit<AxProgramForwardOptions<string>, 'functions'>;
10222
+ local?: string[];
10223
+ /** Input fields to pass directly to subagents, bypassing the top-level LLM. */
10224
+ shared?: string[];
10225
+ /** Fields to pass to ALL descendants recursively (entire agent tree). */
10226
+ globallyShared?: string[];
10227
+ /** Shared fields from a parent agent that this agent should NOT receive. */
10228
+ excluded?: string[];
10229
+ };
10230
+ /** Agent function configuration. */
10231
+ functions?: {
10232
+ /** Agent functions local to this agent (registered under namespace globals). */
10233
+ local?: AxAgentFunctionCollection;
10234
+ /** Agent functions to share with direct child agents (one level). */
10235
+ shared?: AxAgentFunctionCollection;
10236
+ /** Agent functions to share with ALL descendants recursively. */
10237
+ globallyShared?: AxAgentFunctionCollection;
10238
+ /** Agent function names this agent should NOT receive from parents. */
10239
+ excluded?: string[];
10240
+ /** Enables runtime callable discovery (modules + on-demand definitions). */
10241
+ discovery?: boolean;
10115
10242
  };
10116
- }
10117
- /**
10118
- * RLM configuration for AxAgent.
10119
- */
10120
- interface AxRLMConfig {
10121
- /** Input fields holding long context (will be removed from the LLM prompt). */
10122
- contextFields: string[];
10123
- /** Input fields to pass directly to subagents, bypassing the top-level LLM. */
10124
- sharedFields?: string[];
10125
10243
  /** Code runtime for the REPL loop (default: AxJSRuntime). */
10126
10244
  runtime?: AxCodeRuntime;
10127
10245
  /** Cap on recursive sub-agent calls (default: 50). */
10128
10246
  maxSubAgentCalls?: number;
10129
- /**
10130
- * Maximum characters for RLM runtime payloads (default: 5000).
10131
- * Applies to llmQuery context and code execution output.
10132
- */
10247
+ /** Maximum characters for RLM runtime payloads (default: 5000). */
10133
10248
  maxRuntimeChars?: number;
10134
10249
  /** Maximum parallel llmQuery calls in batched mode (default: 8). */
10135
10250
  maxBatchedLlmQueryConcurrency?: number;
@@ -10139,731 +10254,414 @@ interface AxRLMConfig {
10139
10254
  contextPolicy?: AxContextPolicyConfig;
10140
10255
  /** Output field names the Actor should produce (in addition to javascriptCode). */
10141
10256
  actorFields?: string[];
10142
- /** Called after each Actor turn with the full actor result. */
10143
- actorCallback?: (result: Record<string, unknown>) => void | Promise<void>;
10144
10257
  /**
10145
- * Sub-query execution mode (default: 'simple').
10146
- * - 'simple': llmQuery delegates to a plain AxGen (direct LLM call, no code runtime).
10147
- * - 'advanced': llmQuery delegates to a full AxAgent (Actor/Responder + code runtime).
10258
+ * Called after each Actor turn is recorded with both the raw runtime result
10259
+ * and the formatted action-log output.
10260
+ */
10261
+ actorTurnCallback?: (args: AxAgentTurnCallbackArgs) => void | Promise<void>;
10262
+ /**
10263
+ * Called before each Actor turn with current input values. Return a partial patch
10264
+ * to update in-flight inputs for subsequent Actor/Responder steps.
10148
10265
  */
10266
+ inputUpdateCallback?: AxAgentInputUpdateCallback<IN>;
10267
+ /** Sub-query execution mode (default: 'simple'). */
10149
10268
  mode?: 'simple' | 'advanced';
10150
- }
10151
- /**
10152
- * Builds the Actor system prompt. The Actor is a code generation agent that
10153
- * decides what code to execute next based on the current state. It NEVER
10154
- * generates final answers directly.
10155
- */
10156
- declare function axBuildActorDefinition(baseDefinition: string | undefined, contextFields: readonly AxIField[], responderOutputFields: readonly AxIField[], options: Readonly<{
10157
- runtimeUsageInstructions?: string;
10158
- maxSubAgentCalls?: number;
10159
- maxTurns?: number;
10160
- hasInspectRuntime?: boolean;
10161
- hasLiveRuntimeState?: boolean;
10162
- hasCompressedActionReplay?: boolean;
10163
- /** When true, Actor must run one observable console step per non-final turn. */
10164
- enforceIncrementalConsoleTurns?: boolean;
10165
- /** Child agents available under the `<agentModuleNamespace>.*` namespace in the JS runtime. */
10166
- agents?: ReadonlyArray<{
10167
- name: string;
10168
- description: string;
10169
- parameters?: AxFunctionJSONSchema;
10170
- }>;
10171
- /** Agent functions available under namespaced globals in the JS runtime. */
10172
- agentFunctions?: ReadonlyArray<{
10173
- name: string;
10174
- description: string;
10175
- parameters: AxFunctionJSONSchema;
10176
- returns?: AxFunctionJSONSchema;
10177
- namespace: string;
10269
+ /** Default forward options for recursive llmQuery sub-agent calls. */
10270
+ recursionOptions?: AxAgentRecursionOptions;
10271
+ /** Default forward options for the Actor sub-program. */
10272
+ actorOptions?: Partial<Omit<AxProgramForwardOptions<string>, 'functions'> & {
10273
+ description?: string;
10274
+ promptLevel?: AxActorPromptLevel;
10178
10275
  }>;
10179
- /** Module namespace used for child agent calls (default: "agents"). */
10180
- agentModuleNamespace?: string;
10181
- /** Enables module-only discovery rendering in prompt. */
10182
- discoveryMode?: boolean;
10183
- /** Precomputed available modules for runtime discovery mode. */
10184
- availableModules?: ReadonlyArray<{
10185
- namespace: string;
10186
- selectionCriteria?: string;
10276
+ /** Default forward options for the Responder sub-program. */
10277
+ responderOptions?: Partial<Omit<AxProgramForwardOptions<string>, 'functions'> & {
10278
+ description?: string;
10187
10279
  }>;
10188
- }>): string;
10189
- /**
10190
- * Builds the Responder system prompt. The Responder synthesizes a final answer
10191
- * from the action log produced by the Actor. It NEVER generates code.
10192
- */
10193
- declare function axBuildResponderDefinition(baseDefinition: string | undefined, contextFields: readonly AxIField[]): string;
10194
-
10195
- /**
10196
- * Permissions that can be granted to the RLM JS interpreter sandbox.
10197
- * By default all dangerous globals are blocked; users opt in via this enum.
10198
- */
10199
- declare enum AxJSRuntimePermission {
10200
- /** fetch, XMLHttpRequest, WebSocket, EventSource */
10201
- NETWORK = "network",
10202
- /** indexedDB, caches */
10203
- STORAGE = "storage",
10204
- /** importScripts */
10205
- CODE_LOADING = "code-loading",
10206
- /** BroadcastChannel */
10207
- COMMUNICATION = "communication",
10208
- /** performance */
10209
- TIMING = "timing",
10210
- /**
10211
- * Worker, SharedWorker.
10212
- * Warning: sub-workers spawn with fresh, unlocked globals — granting
10213
- * WORKERS without other restrictions implicitly grants all capabilities
10214
- * (e.g. fetch, indexedDB) inside child workers.
10215
- */
10216
- WORKERS = "workers"
10217
- }
10218
- type AxJSRuntimeOutputMode = 'return' | 'stdout';
10280
+ /** Default options for the built-in judge used by optimize(). */
10281
+ judgeOptions?: AxAgentJudgeOptions;
10282
+ };
10283
+ type AxAgentRecursionOptions = Partial<Omit<AxProgramForwardOptions<string>, 'functions'>> & {
10284
+ /** Maximum nested recursion depth for llmQuery sub-agent calls. */
10285
+ maxDepth?: number;
10286
+ /** Prompt detail level for recursive child agents (default: inherits parent). */
10287
+ promptLevel?: AxActorPromptLevel;
10288
+ };
10289
+ type AxActorPromptLevel = 'detailed' | 'basic';
10219
10290
  /**
10220
- * Browser-compatible JavaScript interpreter for RLM using Web Workers.
10221
- * Creates persistent sessions where variables survive across `execute()` calls.
10291
+ * A split-architecture AI agent that uses two AxGen programs:
10292
+ * - **Actor**: generates code to gather information (inputs, actionLog -> code)
10293
+ * - **Responder**: synthesizes the final answer from actorResult payload (inputs, actorResult -> outputs)
10294
+ *
10295
+ * The execution loop is managed by TypeScript, not the LLM:
10296
+ * 1. Actor generates code → executed in runtime → result appended to actionLog
10297
+ * 2. Loop until Actor calls final(...) / ask_clarification(...) or maxTurns reached
10298
+ * 3. Responder synthesizes final answer from actorResult payload
10222
10299
  */
10223
- declare class AxJSRuntime implements AxCodeRuntime {
10224
- readonly language = "JavaScript";
10225
- private readonly timeout;
10226
- private readonly permissions;
10227
- private readonly allowUnsafeNodeHostAccess;
10228
- private readonly nodeWorkerPoolSize;
10229
- private readonly debugNodeWorkerPool;
10230
- private readonly outputMode;
10231
- private readonly captureConsole;
10232
- constructor(options?: Readonly<{
10233
- timeout?: number;
10234
- permissions?: readonly AxJSRuntimePermission[];
10235
- outputMode?: AxJSRuntimeOutputMode;
10236
- captureConsole?: boolean;
10237
- /**
10238
- * Warning: enables direct access to Node host globals (e.g. process/require)
10239
- * from model-generated code in Node worker runtime.
10240
- *
10241
- * Defaults to false for safer behavior.
10242
- */
10243
- allowUnsafeNodeHostAccess?: boolean;
10244
- /**
10245
- * Node-only: prewarm pool size for worker_threads.
10246
- * Defaults to an adaptive value based on availableParallelism() when available.
10247
- */
10248
- nodeWorkerPoolSize?: number;
10249
- /**
10250
- * Node-only: prints resolved worker pool size to console.debug.
10251
- * Can also be enabled via AX_RLM_DEBUG_NODE_POOL=1.
10252
- */
10253
- debugNodeWorkerPool?: boolean;
10254
- }>);
10255
- getUsageInstructions(): string;
10300
+ declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut> implements AxAgentic<IN, OUT> {
10301
+ private ai?;
10302
+ private judgeAI?;
10303
+ private program;
10304
+ private actorProgram;
10305
+ private responderProgram;
10306
+ private agents?;
10307
+ private agentFunctions;
10308
+ private agentFunctionModuleMetadata;
10309
+ private debug?;
10310
+ private options?;
10311
+ private rlmConfig;
10312
+ private runtime;
10313
+ private actorFieldNames;
10314
+ private localFieldNames;
10315
+ private sharedFieldNames;
10316
+ private globalSharedFieldNames;
10317
+ private excludedSharedFields;
10318
+ private excludedAgents;
10319
+ private excludedAgentFunctions;
10320
+ private actorDescription?;
10321
+ private actorPromptLevel?;
10322
+ private responderDescription?;
10323
+ private judgeOptions?;
10324
+ private recursionForwardOptions?;
10325
+ private actorForwardOptions?;
10326
+ private responderForwardOptions?;
10327
+ private inputUpdateCallback?;
10328
+ private contextPromptConfigByField;
10329
+ private agentModuleNamespace;
10330
+ private functionDiscoveryEnabled;
10331
+ private runtimeUsageInstructions;
10332
+ private enforceIncrementalConsoleTurns;
10333
+ private activeAbortControllers;
10334
+ private _stopRequested;
10335
+ private state;
10336
+ private stateError;
10337
+ private runtimeBootstrapContext;
10338
+ private llmQueryBudgetState;
10339
+ private func;
10340
+ private _parentSharedFields;
10341
+ private _parentSharedAgents;
10342
+ private _parentSharedAgentFunctions;
10343
+ private _reservedAgentFunctionNamespaces;
10344
+ private _mergeAgentFunctionModuleMetadata;
10345
+ private _validateConfiguredSignature;
10346
+ private _validateAgentFunctionNamespaces;
10347
+ constructor({ ai, judgeAI, agentIdentity, agentModuleNamespace, signature, }: Readonly<{
10348
+ ai?: Readonly<AxAIService>;
10349
+ judgeAI?: Readonly<AxAIService>;
10350
+ agentIdentity?: Readonly<AxAgentIdentity>;
10351
+ agentModuleNamespace?: string;
10352
+ signature: string | Readonly<AxSignatureConfig> | Readonly<AxSignature<IN, OUT>>;
10353
+ }>, options: Readonly<AxAgentOptions<IN>>);
10256
10354
  /**
10257
- * Creates a persistent execution session.
10258
- *
10259
- * Message flow:
10260
- * 1) Main thread sends `init` with globals, function proxies, permissions.
10261
- * 2) Main thread sends `execute` with correlation ID and code.
10262
- * 3) Worker returns `result` or requests host callbacks via `fn-call`.
10263
- * 4) Host responds to callback requests with `fn-result`.
10264
- *
10265
- * Session closes on:
10266
- * - explicit close(),
10267
- * - timeout,
10268
- * - abort signal,
10269
- * - worker error.
10355
+ * Builds (or rebuilds) Actor and Responder programs from the current
10356
+ * base signature, contextFields, sharedFields, and actorFieldNames.
10270
10357
  */
10271
- createSession(globals?: Record<string, unknown>): AxCodeSession;
10272
- toFunction(): AxFunction;
10273
- }
10274
- /**
10275
- * Factory function for creating an AxJSRuntime.
10276
- */
10277
- declare function axCreateJSRuntime(options?: Readonly<{
10278
- timeout?: number;
10279
- permissions?: readonly AxJSRuntimePermission[];
10280
- outputMode?: AxJSRuntimeOutputMode;
10281
- captureConsole?: boolean;
10282
- allowUnsafeNodeHostAccess?: boolean;
10283
- nodeWorkerPoolSize?: number;
10284
- debugNodeWorkerPool?: boolean;
10285
- }>): AxJSRuntime;
10286
-
10287
- type AxWorkerRuntimeConfig = Readonly<{
10288
- functionRefKey: string;
10289
- maxErrorCauseDepth: number;
10290
- }>;
10291
- declare function axWorkerRuntime(config: AxWorkerRuntimeConfig): void;
10292
-
10293
- interface AxMCPJSONRPCRequest<T> {
10294
- jsonrpc: '2.0';
10295
- id: string | number;
10296
- method: string;
10297
- params?: T;
10298
- }
10299
- interface AxMCPJSONRPCSuccessResponse<T = unknown> {
10300
- jsonrpc: '2.0';
10301
- id: string | number;
10302
- result: T;
10303
- }
10304
- interface AxMCPJSONRPCErrorResponse {
10305
- jsonrpc: '2.0';
10306
- id: string | number;
10307
- error: {
10308
- code: number;
10309
- message: string;
10310
- data?: unknown;
10311
- };
10312
- }
10313
- type AxMCPJSONRPCResponse<T = unknown> = AxMCPJSONRPCSuccessResponse<T> | AxMCPJSONRPCErrorResponse;
10314
- interface AxMCPInitializeParams {
10315
- protocolVersion: string;
10316
- capabilities: Record<string, unknown>;
10317
- clientInfo: {
10318
- name: string;
10319
- version: string;
10320
- };
10321
- }
10322
- interface AxMCPInitializeResult {
10323
- protocolVersion: string;
10324
- capabilities: {
10325
- tools?: unknown[];
10326
- resources?: Record<string, unknown>;
10327
- prompts?: unknown[];
10328
- };
10329
- serverInfo: {
10330
- name: string;
10331
- version: string;
10332
- };
10333
- }
10334
- interface AxMCPFunctionDescription {
10335
- name: string;
10336
- description: string;
10337
- inputSchema: AxFunctionJSONSchema;
10338
- }
10339
- interface AxMCPToolsListResult {
10340
- name: string;
10341
- description: string;
10342
- tools: AxMCPFunctionDescription[];
10343
- }
10344
- interface AxMCPJSONRPCNotification {
10345
- jsonrpc: '2.0';
10346
- method: string;
10347
- params?: Record<string, unknown>;
10348
- }
10349
- interface AxMCPTextContent {
10350
- type: 'text';
10351
- text: string;
10352
- }
10353
- interface AxMCPImageContent {
10354
- type: 'image';
10355
- data: string;
10356
- mimeType: string;
10357
- }
10358
- interface AxMCPEmbeddedResource {
10359
- type: 'resource';
10360
- resource: AxMCPTextResourceContents | AxMCPBlobResourceContents;
10361
- }
10362
- interface AxMCPTextResourceContents {
10363
- uri: string;
10364
- mimeType?: string;
10365
- text: string;
10366
- }
10367
- interface AxMCPBlobResourceContents {
10368
- uri: string;
10369
- mimeType?: string;
10370
- blob: string;
10371
- }
10372
- interface AxMCPResource {
10373
- uri: string;
10374
- name: string;
10375
- description?: string;
10376
- mimeType?: string;
10377
- }
10378
- interface AxMCPResourceTemplate {
10379
- uriTemplate: string;
10380
- name: string;
10381
- description?: string;
10382
- mimeType?: string;
10383
- }
10384
- interface AxMCPResourcesListResult {
10385
- resources: AxMCPResource[];
10386
- nextCursor?: string;
10387
- }
10388
- interface AxMCPResourceTemplatesListResult {
10389
- resourceTemplates: AxMCPResourceTemplate[];
10390
- nextCursor?: string;
10391
- }
10392
- interface AxMCPResourceReadResult {
10393
- contents: (AxMCPTextResourceContents | AxMCPBlobResourceContents)[];
10394
- }
10395
- interface AxMCPPromptArgument {
10396
- name: string;
10397
- description?: string;
10398
- required?: boolean;
10399
- }
10400
- interface AxMCPPrompt {
10401
- name: string;
10402
- description?: string;
10403
- arguments?: AxMCPPromptArgument[];
10404
- }
10405
- interface AxMCPPromptMessage {
10406
- role: 'user' | 'assistant';
10407
- content: AxMCPTextContent | AxMCPImageContent | AxMCPEmbeddedResource;
10408
- }
10409
- interface AxMCPPromptsListResult {
10410
- prompts: AxMCPPrompt[];
10411
- nextCursor?: string;
10412
- }
10413
- interface AxMCPPromptGetResult {
10414
- description?: string;
10415
- messages: AxMCPPromptMessage[];
10416
- }
10417
-
10418
- interface AxMCPTransport {
10358
+ private _buildSplitPrograms;
10419
10359
  /**
10420
- * Sends a JSON-RPC request or notification and returns the response
10421
- * @param message The JSON-RPC request or notification to send
10422
- * @returns A Promise that resolves to the JSON-RPC response
10360
+ * Extends this agent's input signature and context fields for shared fields
10361
+ * propagated from a parent agent. Called by a parent during its constructor.
10423
10362
  */
10424
- send(message: Readonly<AxMCPJSONRPCRequest<unknown>>): Promise<AxMCPJSONRPCResponse<unknown>>;
10363
+ private _extendForSharedFields;
10425
10364
  /**
10426
- * Sends a JSON-RPC notification
10427
- * @param message The JSON-RPC notification to send
10365
+ * Extends this agent's agents list with shared agents from a parent.
10366
+ * Called by a parent during its constructor. Throws on duplicate propagation.
10428
10367
  */
10429
- sendNotification(message: Readonly<AxMCPJSONRPCNotification>): Promise<void>;
10368
+ private _extendForSharedAgents;
10430
10369
  /**
10431
- * Connects to the transport if needed
10432
- * This method is optional and only required for transports that need connection setup
10370
+ * Extends this agent and all its descendants with global shared fields.
10371
+ * Adds fields to this agent's signature and sharedFieldNames, then
10372
+ * recursively propagates to this agent's own children.
10433
10373
  */
10434
- connect?(): Promise<void>;
10435
- }
10436
-
10437
- /**
10438
- * Configuration for overriding function properties
10439
- */
10440
- interface FunctionOverride {
10441
- /** Original function name to override */
10442
- name: string;
10443
- /** Updates to apply to the function */
10444
- updates: {
10445
- /** Alternative name for the function */
10446
- name?: string;
10447
- /** Alternative description for the function */
10448
- description?: string;
10449
- };
10450
- }
10451
- /**
10452
- * Options for the MCP client
10453
- */
10454
- interface AxMCPClientOptions {
10455
- /** Enable debug logging */
10456
- debug?: boolean;
10457
- /** Logger function for debug output */
10458
- logger?: AxLoggerFunction;
10374
+ private _extendForGlobalSharedFields;
10459
10375
  /**
10460
- * List of function overrides
10461
- * Use this to provide alternative names and descriptions for functions
10462
- * while preserving their original functionality
10463
- *
10464
- * Example:
10465
- * ```
10466
- * functionOverrides: [
10467
- * {
10468
- * name: "original-function-name",
10469
- * updates: {
10470
- * name: "new-function-name",
10471
- * description: "New function description"
10472
- * }
10473
- * }
10474
- * ]
10475
- * ```
10376
+ * Extends this agent and all its descendants with global shared agents.
10377
+ * Adds agents to this agent's agents list, then recursively propagates
10378
+ * to this agent's own children.
10476
10379
  */
10477
- functionOverrides?: FunctionOverride[];
10478
- }
10479
- declare class AxMCPClient {
10480
- private readonly transport;
10481
- private readonly options;
10482
- private functions;
10483
- private promptFunctions;
10484
- private resourceFunctions;
10485
- private activeRequests;
10486
- private capabilities;
10487
- private logger;
10488
- constructor(transport: AxMCPTransport, options?: Readonly<AxMCPClientOptions>);
10489
- init(): Promise<void>;
10490
- private discoverFunctions;
10491
- private discoverPromptFunctions;
10492
- private discoverResourceFunctions;
10493
- private promptToFunction;
10494
- private resourceToFunction;
10495
- private resourceTemplateToFunction;
10496
- private formatPromptMessages;
10497
- private extractContent;
10498
- private formatResourceContents;
10499
- private sanitizeName;
10500
- private parseUriTemplate;
10501
- private expandUriTemplate;
10502
- ping(timeout?: number): Promise<void>;
10503
- toFunction(): AxFunction[];
10504
- getCapabilities(): {
10505
- tools: boolean;
10506
- resources: boolean;
10507
- prompts: boolean;
10508
- };
10509
- hasToolsCapability(): boolean;
10510
- hasPromptsCapability(): boolean;
10511
- hasResourcesCapability(): boolean;
10512
- listPrompts(cursor?: string): Promise<AxMCPPromptsListResult>;
10513
- getPrompt(name: string, args?: Record<string, string>): Promise<AxMCPPromptGetResult>;
10514
- listResources(cursor?: string): Promise<AxMCPResourcesListResult>;
10515
- listResourceTemplates(cursor?: string): Promise<AxMCPResourceTemplatesListResult>;
10516
- readResource(uri: string): Promise<AxMCPResourceReadResult>;
10517
- subscribeResource(uri: string): Promise<void>;
10518
- unsubscribeResource(uri: string): Promise<void>;
10519
- cancelRequest(id: string): void;
10520
- private sendRequest;
10521
- private sendNotification;
10522
- }
10523
-
10524
- type TokenSet = {
10525
- accessToken: string;
10526
- refreshToken?: string;
10527
- expiresAt?: number;
10528
- issuer?: string;
10529
- };
10530
- interface AxMCPOAuthOptions {
10531
- clientId?: string;
10532
- clientSecret?: string;
10533
- redirectUri?: string;
10534
- scopes?: string[];
10535
- selectAuthorizationServer?: (issuers: string[], resourceMetadata: unknown) => Promise<string> | string;
10536
- onAuthCode?: (authorizationUrl: string) => Promise<{
10537
- code: string;
10538
- redirectUri?: string;
10380
+ private _extendForGlobalSharedAgents;
10381
+ /**
10382
+ * Extends this agent's agent functions list with shared agent functions
10383
+ * from a parent. Throws on duplicate propagation.
10384
+ */
10385
+ private _extendForSharedAgentFunctions;
10386
+ /**
10387
+ * Extends this agent and all its descendants with globally shared agent functions.
10388
+ */
10389
+ private _extendForGlobalSharedAgentFunctions;
10390
+ /**
10391
+ * Stops an in-flight forward/streamingForward call. Causes the call
10392
+ * to throw `AxAIServiceAbortedError`.
10393
+ */
10394
+ stop(): void;
10395
+ getId(): string;
10396
+ setId(id: string): void;
10397
+ namedPrograms(): Array<{
10398
+ id: string;
10399
+ signature?: string;
10539
10400
  }>;
10540
- tokenStore?: {
10541
- getToken: (key: string) => Promise<TokenSet | null> | TokenSet | null;
10542
- setToken: (key: string, token: TokenSet) => Promise<void> | void;
10543
- clearToken?: (key: string) => Promise<void> | void;
10544
- };
10545
- }
10546
-
10547
- interface AxMCPStreamableHTTPTransportOptions {
10548
- headers?: Record<string, string>;
10549
- authorization?: string;
10550
- oauth?: AxMCPOAuthOptions;
10551
- }
10552
-
10553
- declare class AxMCPStreambleHTTPTransport implements AxMCPTransport {
10554
- private mcpEndpoint;
10555
- private sessionId?;
10556
- private eventSource?;
10557
- private pendingRequests;
10558
- private messageHandler?;
10559
- private customHeaders;
10560
- private oauthHelper;
10561
- private currentToken?;
10562
- private currentIssuer?;
10563
- constructor(mcpEndpoint: string, options?: AxMCPStreamableHTTPTransportOptions);
10564
- setHeaders(headers: Record<string, string>): void;
10565
- setAuthorization(authorization: string): void;
10566
- getHeaders(): Record<string, string>;
10567
- private buildHeaders;
10568
- setMessageHandler(handler: (message: AxMCPJSONRPCRequest<unknown> | AxMCPJSONRPCNotification) => void): void;
10569
- connect(): Promise<void>;
10570
- openListeningStream(): Promise<void>;
10571
- private openListeningStreamWithFetch;
10572
- send(message: Readonly<AxMCPJSONRPCRequest<unknown>>): Promise<AxMCPJSONRPCResponse<unknown>>;
10573
- private handleSSEResponse;
10574
- sendNotification(message: Readonly<AxMCPJSONRPCNotification>): Promise<void>;
10575
- terminateSession(): Promise<void>;
10576
- close(): void;
10401
+ namedProgramInstances(): AxNamedProgramInstance<IN, OUT>[];
10402
+ getTraces(): AxProgramTrace<IN, OUT>[];
10403
+ setDemos(demos: readonly (AxAgentDemos<IN, OUT> | AxProgramDemos<IN, OUT>)[], options?: {
10404
+ modelConfig?: Record<string, unknown>;
10405
+ }): void;
10406
+ getUsage(): (AxModelUsage & {
10407
+ ai: string;
10408
+ model: string;
10409
+ })[];
10410
+ resetUsage(): void;
10411
+ getState(): AxAgentState | undefined;
10412
+ setState(state?: AxAgentState): void;
10413
+ optimize(dataset: Readonly<AxAgentEvalDataset<IN>>, options?: Readonly<AxAgentOptimizeOptions<IN, OUT>>): Promise<AxAgentOptimizeResult<OUT>>;
10414
+ private _createOptimizationProgram;
10415
+ private _createAgentOptimizeMetric;
10416
+ private _forwardForEvaluation;
10417
+ getFunction(): AxFunction;
10418
+ getExcludedSharedFields(): readonly string[];
10419
+ private _getBypassedSharedFieldNames;
10420
+ private _createRuntimeInputState;
10421
+ private _ensureLlmQueryBudgetState;
10422
+ private _createRuntimeExecutionContext;
10423
+ getExcludedAgents(): readonly string[];
10424
+ getExcludedAgentFunctions(): readonly string[];
10425
+ getSignature(): AxSignature;
10426
+ test(code: string, values?: Partial<IN>, options?: Readonly<{
10427
+ ai?: AxAIService;
10428
+ abortSignal?: AbortSignal;
10429
+ debug?: boolean;
10430
+ }>): Promise<AxAgentTestResult>;
10431
+ setSignature(signature: NonNullable<ConstructorParameters<typeof AxSignature>[0]>): void;
10432
+ applyOptimization(optimizedProgram: any): void;
10433
+ /**
10434
+ * Runs the Actor loop: sets up the runtime session, executes code iteratively,
10435
+ * and returns the state needed by the Responder. Closes the session before returning.
10436
+ */
10437
+ private _runActorLoop;
10438
+ forward<T extends Readonly<AxAIService>>(parentAi: T, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramForwardOptionsWithModels<T>>): Promise<OUT>;
10439
+ streamingForward<T extends Readonly<AxAIService>>(parentAi: T, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramStreamingForwardOptionsWithModels<T>>): AxGenStreamingOut<OUT>;
10440
+ /**
10441
+ * Wraps an AxFunction as an async callable that handles both
10442
+ * named ({ key: val }) and positional (val1, val2) argument styles.
10443
+ */
10444
+ private static wrapFunction;
10445
+ /**
10446
+ * Wraps an AxFunction with automatic shared field injection.
10447
+ * Shared field values are merged into call args (caller-provided args take precedence).
10448
+ */
10449
+ private static wrapFunctionWithSharedFields;
10450
+ /**
10451
+ * Wraps agent functions under namespaced globals and child agents under
10452
+ * a configurable `<module>.*` namespace for the JS runtime session.
10453
+ */
10454
+ private buildRuntimeGlobals;
10455
+ /**
10456
+ * Returns options compatible with AxGen (strips agent-specific grouped options).
10457
+ */
10458
+ private get _genOptions();
10459
+ /**
10460
+ * Builds the clean AxFunction parameters schema: input fields only, with any
10461
+ * parent-injected shared fields stripped out (they are auto-injected at runtime).
10462
+ */
10463
+ private _buildFuncParameters;
10577
10464
  }
10578
-
10579
- declare class AxMCPHTTPSSETransport implements AxMCPTransport {
10580
- private endpoint;
10581
- private sseUrl;
10582
- private eventSource?;
10583
- private customHeaders;
10584
- private oauthHelper;
10585
- private currentToken?;
10586
- private currentIssuer?;
10587
- private sseAbort?;
10588
- private pendingRequests;
10589
- private messageHandler?;
10590
- private endpointReady?;
10591
- constructor(sseUrl: string, options?: AxMCPStreamableHTTPTransportOptions);
10592
- private buildHeaders;
10593
- private openSSEWithFetch;
10594
- private createEndpointReady;
10595
- private consumeSSEStream;
10596
- connect(): Promise<void>;
10597
- send(message: Readonly<AxMCPJSONRPCRequest<unknown>>): Promise<AxMCPJSONRPCResponse<unknown>>;
10598
- sendNotification(message: Readonly<AxMCPJSONRPCNotification>): Promise<void>;
10599
- close(): void;
10465
+ /**
10466
+ * Configuration options for creating an agent using the agent() factory function.
10467
+ */
10468
+ interface AxAgentConfig<_IN extends AxGenIn, _OUT extends AxGenOut> extends AxAgentOptions<_IN> {
10469
+ ai?: AxAIService;
10470
+ judgeAI?: AxAIService;
10471
+ agentIdentity?: AxAgentIdentity;
10600
10472
  }
10601
-
10602
10473
  /**
10603
- * Semantic Context Management for the AxAgent RLM loop.
10474
+ * Creates a strongly-typed AI agent from a signature.
10475
+ * This is the recommended way to create agents, providing better type inference and cleaner syntax.
10604
10476
  *
10605
- * Manages the action log by evaluating step importance via hindsight heuristics,
10606
- * generating compact tombstones for resolved errors, and pruning low-value entries
10607
- * to maximize context window utility.
10608
- */
10609
-
10610
- type ActionLogTag = 'error' | 'dead-end' | 'foundational' | 'pivot' | 'superseded';
10611
- type ActionLogStepKind = 'explore' | 'transform' | 'query' | 'finalize' | 'error';
10612
- type ActionReplayMode = 'full' | 'omit';
10613
- type DiscoveryModuleSection = {
10614
- module: string;
10615
- text: string;
10616
- };
10617
- type DiscoveryFunctionSection = {
10618
- qualifiedName: string;
10619
- text: string;
10620
- };
10621
- type ActionLogEntry = {
10622
- turn: number;
10623
- code: string;
10624
- output: string;
10625
- actorFieldsOutput: string;
10626
- tags: ActionLogTag[];
10627
- summary?: string;
10628
- producedVars?: string[];
10629
- referencedVars?: string[];
10630
- stateDelta?: string;
10631
- stepKind?: ActionLogStepKind;
10632
- replayMode?: ActionReplayMode;
10633
- /** 0-5 importance score set by hindsight evaluation. */
10634
- rank?: number;
10635
- /** Compact summary replacing full code+output when rendered. */
10636
- tombstone?: string;
10637
- /** @internal Pending tombstone generation. */
10638
- _tombstonePromise?: Promise<string>;
10639
- /** @internal Parsed discovery module sections for prompt-facing filtering. */
10640
- _discoveryModuleSections?: readonly DiscoveryModuleSection[];
10641
- /** @internal Parsed discovery callable sections for prompt-facing filtering. */
10642
- _discoveryFunctionSections?: readonly DiscoveryFunctionSection[];
10643
- /** @internal Direct qualified callable usages like `db.search(...)`. */
10644
- _directQualifiedCalls?: readonly string[];
10645
- };
10646
- type CheckpointSummaryState = {
10647
- fingerprint: string;
10648
- summary: string;
10649
- turns: number[];
10650
- };
10651
- type RuntimeStateVariableProvenance = {
10652
- createdTurn: number;
10653
- lastReadTurn?: number;
10654
- stepKind?: ActionLogStepKind;
10655
- source?: string;
10656
- code?: string;
10657
- };
10477
+ * @param signature - The input/output signature as a string or AxSignature object
10478
+ * @param config - Configuration options for the agent (contextFields is required)
10479
+ * @returns A typed agent instance
10480
+ *
10481
+ * @example
10482
+ * ```typescript
10483
+ * const myAgent = agent('context:string, query:string -> answer:string', {
10484
+ * contextFields: ['context'],
10485
+ * runtime: new AxJSRuntime(),
10486
+ * });
10487
+ * ```
10488
+ */
10489
+ declare function agent<const T extends string, const CF extends readonly AxContextFieldInput[]>(signature: T, config: Omit<AxAgentConfig<ParseSignature<T>['inputs'], ParseSignature<T>['outputs']>, 'contextFields'> & {
10490
+ contextFields: CF;
10491
+ }): AxAgent<ParseSignature<T>['inputs'], ParseSignature<T>['outputs']>;
10492
+ declare function agent<TInput extends Record<string, any>, TOutput extends Record<string, any>, const CF extends readonly AxContextFieldInput[]>(signature: AxSignature<TInput, TOutput>, config: Omit<AxAgentConfig<TInput, TOutput>, 'contextFields'> & {
10493
+ contextFields: CF;
10494
+ }): AxAgent<TInput, TOutput>;
10658
10495
 
10659
10496
  /**
10660
- * Interface for agents that can be used as child agents.
10661
- * Provides methods to get the agent's function definition and features.
10497
+ * RLM (Recursive Language Model) interfaces and prompt builder.
10498
+ *
10499
+ * Pluggable interpreter interface — anyone can implement for any runtime.
10500
+ * No Node.js-specific imports; browser-safe.
10662
10501
  */
10663
- interface AxAgentic<IN extends AxGenIn, OUT extends AxGenOut> extends AxProgrammable<IN, OUT> {
10664
- getFunction(): AxFunction;
10665
- /** Returns the list of shared fields this agent wants to exclude. */
10666
- getExcludedSharedFields?(): readonly string[];
10667
- /** Returns the list of shared agents this agent wants to exclude (by function name). */
10668
- getExcludedAgents?(): readonly string[];
10669
- /** Returns the list of shared agent functions this agent wants to exclude (by name). */
10670
- getExcludedAgentFunctions?(): readonly string[];
10502
+
10503
+ /**
10504
+ * A code runtime that can create persistent sessions.
10505
+ * Implement this interface for your target runtime (Node.js, browser, WASM, etc.).
10506
+ */
10507
+ interface AxCodeRuntime {
10508
+ createSession(globals?: Record<string, unknown>): AxCodeSession;
10509
+ /**
10510
+ * Optional runtime-specific usage guidance injected into the RLM system prompt.
10511
+ * Use this for execution semantics that differ by runtime/language.
10512
+ */
10513
+ getUsageInstructions(): string;
10671
10514
  }
10672
- type AxAnyAgentic = AxAgentic<any, any>;
10673
- type AxAgentIdentity = {
10515
+ /**
10516
+ * @deprecated Use `AxCodeRuntime` instead.
10517
+ */
10518
+ type AxCodeInterpreter = AxCodeRuntime;
10519
+ type AxCodeSessionSnapshotEntry = {
10674
10520
  name: string;
10675
- description: string;
10676
- namespace?: string;
10677
- };
10678
- type AxAgentFunctionModuleMeta = {
10679
- namespace: string;
10680
- title: string;
10681
- selectionCriteria: string;
10682
- description: string;
10683
- };
10684
- type AxAgentFunctionExample = {
10685
- code: string;
10686
- title?: string;
10687
- description?: string;
10688
- language?: string;
10689
- };
10690
- type AxAgentFunction = AxFunction & {
10691
- examples?: readonly AxAgentFunctionExample[];
10692
- };
10693
- type AxAgentFunctionGroup = AxAgentFunctionModuleMeta & {
10694
- functions: readonly Omit<AxAgentFunction, 'namespace'>[];
10695
- };
10696
- type AxAgentTestCompletionPayload = {
10697
- type: 'final' | 'ask_clarification';
10698
- args: unknown[];
10699
- };
10700
- type AxAgentTestResult = string | AxAgentTestCompletionPayload;
10701
- type AxAgentClarificationKind = 'text' | 'number' | 'date' | 'single_choice' | 'multiple_choice';
10702
- type AxAgentClarificationChoice = string | {
10703
- label: string;
10704
- value?: string;
10705
- };
10706
- type AxAgentClarification = string | AxAgentStructuredClarification;
10707
- type AxAgentStructuredClarification = {
10708
- question: string;
10709
- type?: AxAgentClarificationKind;
10710
- choices?: AxAgentClarificationChoice[];
10711
- [key: string]: unknown;
10521
+ type: string;
10522
+ ctor?: string;
10523
+ size?: string;
10524
+ preview?: string;
10525
+ restorable?: boolean;
10712
10526
  };
10713
- type AxAgentStateActionLogEntry = Pick<ActionLogEntry, 'turn' | 'code' | 'output' | 'actorFieldsOutput' | 'tags' | 'summary' | 'producedVars' | 'referencedVars' | 'stateDelta' | 'stepKind' | 'replayMode' | 'rank' | 'tombstone'>;
10714
- type AxAgentStateCheckpointState = CheckpointSummaryState;
10715
- type AxAgentStateRuntimeEntry = AxCodeSessionSnapshotEntry;
10716
- type AxAgentState = {
10527
+ type AxCodeSessionSnapshot = {
10717
10528
  version: 1;
10718
- runtimeBindings: Record<string, unknown>;
10719
- runtimeEntries: AxAgentStateRuntimeEntry[];
10720
- actionLogEntries: AxAgentStateActionLogEntry[];
10721
- checkpointState?: AxAgentStateCheckpointState;
10722
- provenance: Record<string, RuntimeStateVariableProvenance>;
10529
+ entries: AxCodeSessionSnapshotEntry[];
10530
+ bindings: Record<string, unknown>;
10723
10531
  };
10724
- declare class AxAgentClarificationError extends Error {
10725
- readonly question: string;
10726
- readonly clarification: AxAgentStructuredClarification;
10727
- private readonly stateSnapshot;
10728
- private readonly stateErrorMessage;
10729
- constructor(clarification: AxAgentClarification, options?: Readonly<{
10730
- state?: AxAgentState;
10731
- stateError?: string;
10732
- }>);
10733
- getState(): AxAgentState | undefined;
10532
+ /**
10533
+ * A persistent code execution session. Variables persist across `execute()` calls.
10534
+ */
10535
+ interface AxCodeSession {
10536
+ execute(code: string, options?: {
10537
+ signal?: AbortSignal;
10538
+ reservedNames?: readonly string[];
10539
+ }): Promise<unknown>;
10540
+ inspectGlobals?(options?: {
10541
+ signal?: AbortSignal;
10542
+ reservedNames?: readonly string[];
10543
+ }): Promise<string>;
10544
+ snapshotGlobals?(options?: {
10545
+ signal?: AbortSignal;
10546
+ reservedNames?: readonly string[];
10547
+ }): Promise<AxCodeSessionSnapshot>;
10548
+ patchGlobals(globals: Record<string, unknown>, options?: {
10549
+ signal?: AbortSignal;
10550
+ }): Promise<void>;
10551
+ close(): void;
10734
10552
  }
10735
- type AxAgentFunctionCollection = readonly AxAgentFunction[] | readonly AxAgentFunctionGroup[];
10736
- type AxContextFieldInput = string | {
10737
- field: string;
10738
- promptMaxChars?: number;
10739
- keepInPromptChars?: number;
10740
- reverseTruncate?: boolean;
10741
- };
10742
10553
  /**
10743
- * Demo traces for AxAgent's split architecture.
10744
- * Actor demos use `{ javascriptCode }` + optional actorFields.
10745
- * Responder demos use the agent's output type + optional input fields.
10554
+ * Opinionated context replay presets for the Actor loop.
10555
+ *
10556
+ * - `full`: Keep prior actions fully replayed with minimal compression.
10557
+ * Best for debugging or short tasks where the actor should reread exact old code/output.
10558
+ * - `adaptive`: Keep live runtime state visible, preserve recent or dependency-relevant
10559
+ * actions in full, keep discovery docs available by default, and collapse older successful work
10560
+ * into checkpoint summaries as context grows. Reliability-first defaults favor
10561
+ * summaries before deletion. Best default for long multi-turn tasks.
10562
+ * - `lean`: Most aggressive compression. Keep live runtime state visible, checkpoint
10563
+ * older successful work, hide used discovery docs, and summarize replay-pruned
10564
+ * successful turns instead of replaying their full code blocks. Reliability-first
10565
+ * defaults still preserve recent evidence before deleting older low-value steps.
10566
+ * Best when token pressure matters more than raw replay detail.
10746
10567
  */
10747
- type AxAgentDemos<IN extends AxGenIn, OUT extends AxGenOut, PREFIX extends string = string> = {
10748
- programId: `${PREFIX}.actor`;
10749
- traces: (Record<string, AxFieldValue> & {
10750
- javascriptCode: string;
10751
- })[];
10752
- } | {
10753
- programId: `${PREFIX}.responder`;
10754
- traces: (OUT & Partial<IN>)[];
10755
- };
10756
- type AxAgentInputUpdateCallback<IN extends AxGenIn> = (currentInputs: Readonly<IN>) => Promise<Partial<IN> | undefined> | Partial<IN> | undefined;
10757
- type AxAgentJudgeOptions = Partial<Omit<AxJudgeOptions, 'ai'>>;
10758
- type AxAgentOptimizeTarget = 'actor' | 'responder' | 'all' | readonly string[];
10759
- type AxAgentEvalFunctionCall = {
10760
- qualifiedName: string;
10761
- name: string;
10762
- arguments: AxFieldValue;
10763
- result?: AxFieldValue;
10764
- error?: string;
10765
- };
10766
- type AxAgentEvalPrediction<OUT = any> = {
10767
- completionType: 'final';
10768
- output: OUT;
10769
- clarification?: undefined;
10770
- actionLog: string;
10771
- functionCalls: AxAgentEvalFunctionCall[];
10772
- toolErrors: string[];
10773
- turnCount: number;
10774
- usage?: AxProgramUsage[];
10775
- } | {
10776
- completionType: 'ask_clarification';
10777
- output?: undefined;
10778
- clarification: AxAgentStructuredClarification;
10779
- actionLog: string;
10780
- functionCalls: AxAgentEvalFunctionCall[];
10781
- toolErrors: string[];
10782
- turnCount: number;
10783
- usage?: AxProgramUsage[];
10784
- };
10785
- type AxAgentEvalTask<IN = any> = {
10786
- input: IN;
10787
- criteria: string;
10788
- id?: string;
10789
- expectedOutput?: AxFieldValue;
10790
- expectedActions?: string[];
10791
- forbiddenActions?: string[];
10792
- weight?: number;
10793
- metadata?: AxFieldValue;
10794
- };
10795
- type AxAgentEvalDataset<IN = any> = readonly AxAgentEvalTask<IN>[] | {
10796
- train: readonly AxAgentEvalTask<IN>[];
10797
- validation?: readonly AxAgentEvalTask<IN>[];
10798
- };
10799
- type AxAgentOptimizeOptions<_IN extends AxGenIn = AxGenIn, _OUT extends AxGenOut = AxGenOut> = {
10800
- studentAI?: Readonly<AxAIService>;
10801
- judgeAI?: Readonly<AxAIService>;
10802
- teacherAI?: Readonly<AxAIService>;
10803
- judgeOptions?: AxAgentJudgeOptions;
10804
- target?: AxAgentOptimizeTarget;
10805
- apply?: boolean;
10806
- maxMetricCalls?: number;
10807
- metric?: AxMetricFn;
10808
- verbose?: boolean;
10809
- debugOptimizer?: boolean;
10810
- optimizerLogger?: AxOptimizerLoggerFunction;
10811
- onProgress?: (progress: Readonly<AxOptimizationProgress>) => void;
10812
- onEarlyStop?: (reason: string, stats: Readonly<AxOptimizationStats>) => void;
10813
- };
10814
- type AxAgentOptimizeResult<OUT extends AxGenOut = AxGenOut> = AxParetoResult<OUT>;
10815
- type AxAgentOptions<IN extends AxGenIn = AxGenIn> = Omit<AxProgramForwardOptions<string>, 'functions' | 'description'> & {
10816
- debug?: boolean;
10568
+ type AxContextPolicyPreset = 'full' | 'adaptive' | 'lean';
10569
+ /**
10570
+ * Public context policy for the Actor loop.
10571
+ * Presets provide the common behavior; top-level toggles plus `state`,
10572
+ * `checkpoints`, and `expert` override specific pieces.
10573
+ */
10574
+ interface AxContextPolicyConfig {
10817
10575
  /**
10818
- * Input fields used as context.
10819
- * - `string`: runtime-only (legacy behavior)
10820
- * - `{ field, promptMaxChars }`: runtime + conditionally inlined into Actor prompt
10821
- * - `{ field, keepInPromptChars, reverseTruncate? }`: runtime + truncated string excerpt in Actor prompt
10576
+ * Opinionated preset for how the agent should replay and compress context.
10577
+ *
10578
+ * - `full`: prefer raw replay of earlier actions
10579
+ * - `adaptive`: balance replay detail with checkpoint compression while keeping more recent evidence visible
10580
+ * - `lean`: prefer live state + compact summaries over raw replay detail
10822
10581
  */
10823
- contextFields: readonly AxContextFieldInput[];
10824
- /** Child agents and agent sharing configuration. */
10825
- agents?: {
10826
- /** Agents registered under the configured child-agent module namespace (default: `agents.*`). */
10827
- local?: AxAnyAgentic[];
10828
- /** Agents to automatically add to all direct child agents (one level). */
10829
- shared?: AxAnyAgentic[];
10830
- /** Agents to automatically add to ALL descendants recursively (entire agent tree). */
10831
- globallyShared?: AxAnyAgentic[];
10832
- /** Agent function names this agent should NOT receive from parents. */
10833
- excluded?: string[];
10582
+ preset?: AxContextPolicyPreset;
10583
+ /**
10584
+ * Default options for the internal checkpoint summarizer AxGen program.
10585
+ * `functions` are not supported, `maxSteps` is forced to `1`, and `mem`
10586
+ * is never propagated so the summarizer stays stateless.
10587
+ */
10588
+ summarizerOptions?: Omit<AxProgramForwardOptions<string>, 'functions'>;
10589
+ /**
10590
+ * Hide stale discovery docs from later actor prompts after a discovered
10591
+ * callable is used successfully. This only affects prompt replay; it does
10592
+ * not delete internal history or remove runtime values.
10593
+ *
10594
+ * Defaults by preset:
10595
+ * - `full`: false
10596
+ * - `adaptive`: false
10597
+ * - `lean`: true
10598
+ */
10599
+ pruneUsedDocs?: boolean;
10600
+ /**
10601
+ * Prune error entries after a successful (non-error) turn.
10602
+ *
10603
+ * Defaults by preset:
10604
+ * - `full`: false
10605
+ * - `adaptive`: true
10606
+ * - `lean`: true
10607
+ */
10608
+ pruneErrors?: boolean;
10609
+ /** Runtime-state visibility controls. */
10610
+ state?: {
10611
+ /** Include a compact live runtime state block ahead of the action log. */
10612
+ summary?: boolean;
10613
+ /** Expose `inspect_runtime()` to the actor and show the large-context hint. */
10614
+ inspect?: boolean;
10615
+ /** Character count above which the actor is reminded to call `inspect_runtime()`. */
10616
+ inspectThresholdChars?: number;
10617
+ /** Maximum number of runtime state entries to render in the summary block. */
10618
+ maxEntries?: number;
10619
+ /** Maximum total characters to replay in the runtime state summary block. */
10620
+ maxChars?: number;
10834
10621
  };
10835
- /** Field sharing configuration. */
10836
- fields?: {
10622
+ /** Rolling checkpoint summary controls. */
10623
+ checkpoints?: {
10624
+ /** Enable checkpoint summaries for older successful turns. */
10625
+ enabled?: boolean;
10626
+ /** Character count above which a checkpoint summary is generated. */
10627
+ triggerChars?: number;
10628
+ };
10629
+ /** Expert-level overrides for the preset-derived internal policy. */
10630
+ expert?: {
10631
+ /** Controls how prior actor actions are replayed before checkpoint compression. */
10632
+ replay?: 'full' | 'adaptive' | 'minimal';
10633
+ /** Number of most-recent actions that should always remain fully rendered. */
10634
+ recentFullActions?: number;
10635
+ /** Rank-based pruning of low-value actions. Off by default for built-in presets. */
10636
+ rankPruning?: {
10637
+ enabled?: boolean;
10638
+ minRank?: number;
10639
+ };
10837
10640
  /**
10838
- * Shared/global fields that should remain available in this agent's own
10839
- * Actor/Responder flow instead of bypassing it.
10641
+ * Replace resolved errors with compact tombstones before pruning.
10642
+ * When configured with options, they apply to the internal tombstone
10643
+ * summarizer AxGen program. `functions` are not supported, `maxSteps`
10644
+ * is forced to `1`, and `mem` is never propagated.
10840
10645
  */
10841
- local?: string[];
10842
- /** Input fields to pass directly to subagents, bypassing the top-level LLM. */
10843
- shared?: string[];
10844
- /** Fields to pass to ALL descendants recursively (entire agent tree). */
10845
- globallyShared?: string[];
10846
- /** Shared fields from a parent agent that this agent should NOT receive. */
10847
- excluded?: string[];
10848
- };
10849
- /** Agent function configuration. */
10850
- functions?: {
10851
- /** Agent functions local to this agent (registered under namespace globals). */
10852
- local?: AxAgentFunctionCollection;
10853
- /** Agent functions to share with direct child agents (one level). */
10854
- shared?: AxAgentFunctionCollection;
10855
- /** Agent functions to share with ALL descendants recursively. */
10856
- globallyShared?: AxAgentFunctionCollection;
10857
- /** Agent function names this agent should NOT receive from parents. */
10858
- excluded?: string[];
10859
- /** Enables runtime callable discovery (modules + on-demand definitions). */
10860
- discovery?: boolean;
10646
+ tombstones?: boolean | Omit<AxProgramForwardOptions<string>, 'functions'>;
10861
10647
  };
10648
+ }
10649
+ /**
10650
+ * RLM configuration for AxAgent.
10651
+ */
10652
+ interface AxRLMConfig {
10653
+ /** Input fields holding long context (will be removed from the LLM prompt). */
10654
+ contextFields: string[];
10655
+ /** Input fields to pass directly to subagents, bypassing the top-level LLM. */
10656
+ sharedFields?: string[];
10862
10657
  /** Code runtime for the REPL loop (default: AxJSRuntime). */
10863
10658
  runtime?: AxCodeRuntime;
10864
10659
  /** Cap on recursive sub-agent calls (default: 50). */
10865
10660
  maxSubAgentCalls?: number;
10866
- /** Maximum characters for RLM runtime payloads (default: 5000). */
10661
+ /**
10662
+ * Maximum characters for RLM runtime payloads (default: 5000).
10663
+ * Applies to llmQuery context and code execution output.
10664
+ */
10867
10665
  maxRuntimeChars?: number;
10868
10666
  /** Maximum parallel llmQuery calls in batched mode (default: 8). */
10869
10667
  maxBatchedLlmQueryConcurrency?: number;
@@ -10873,233 +10671,470 @@ type AxAgentOptions<IN extends AxGenIn = AxGenIn> = Omit<AxProgramForwardOptions
10873
10671
  contextPolicy?: AxContextPolicyConfig;
10874
10672
  /** Output field names the Actor should produce (in addition to javascriptCode). */
10875
10673
  actorFields?: string[];
10876
- /** Called after each Actor turn with the full actor result. */
10877
- actorCallback?: (result: Record<string, unknown>) => void | Promise<void>;
10878
10674
  /**
10879
- * Called before each Actor turn with current input values. Return a partial patch
10880
- * to update in-flight inputs for subsequent Actor/Responder steps.
10675
+ * Called after each Actor turn is recorded with both raw runtime output and
10676
+ * the formatted action-log output.
10677
+ */
10678
+ actorTurnCallback?: (args: AxAgentTurnCallbackArgs) => void | Promise<void>;
10679
+ /**
10680
+ * Sub-query execution mode (default: 'simple').
10681
+ * - 'simple': llmQuery delegates to a plain AxGen (direct LLM call, no code runtime).
10682
+ * - 'advanced': llmQuery delegates to a full AxAgent (Actor/Responder + code runtime).
10881
10683
  */
10882
- inputUpdateCallback?: AxAgentInputUpdateCallback<IN>;
10883
- /** Sub-query execution mode (default: 'simple'). */
10884
10684
  mode?: 'simple' | 'advanced';
10885
- /** Default forward options for recursive llmQuery sub-agent calls. */
10886
- recursionOptions?: AxAgentRecursionOptions;
10887
- /** Default forward options for the Actor sub-program. */
10888
- actorOptions?: Partial<Omit<AxProgramForwardOptions<string>, 'functions'> & {
10889
- description?: string;
10685
+ }
10686
+ /**
10687
+ * Builds the Actor system prompt. The Actor is a code generation agent that
10688
+ * decides what code to execute next based on the current state. It NEVER
10689
+ * generates final answers directly.
10690
+ */
10691
+ declare function axBuildActorDefinition(baseDefinition: string | undefined, contextFields: readonly AxIField[], responderOutputFields: readonly AxIField[], options: Readonly<{
10692
+ runtimeUsageInstructions?: string;
10693
+ promptLevel?: 'detailed' | 'basic';
10694
+ maxSubAgentCalls?: number;
10695
+ maxTurns?: number;
10696
+ hasInspectRuntime?: boolean;
10697
+ hasLiveRuntimeState?: boolean;
10698
+ hasCompressedActionReplay?: boolean;
10699
+ llmQueryPromptMode?: 'simple' | 'advanced-recursive' | 'simple-at-terminal-depth';
10700
+ /** When true, Actor must run one observable console step per non-final turn. */
10701
+ enforceIncrementalConsoleTurns?: boolean;
10702
+ /** Child agents available under the `<agentModuleNamespace>.*` namespace in the JS runtime. */
10703
+ agents?: ReadonlyArray<{
10704
+ name: string;
10705
+ description: string;
10706
+ parameters?: AxFunctionJSONSchema;
10890
10707
  }>;
10891
- /** Default forward options for the Responder sub-program. */
10892
- responderOptions?: Partial<Omit<AxProgramForwardOptions<string>, 'functions'> & {
10893
- description?: string;
10708
+ /** Agent functions available under namespaced globals in the JS runtime. */
10709
+ agentFunctions?: ReadonlyArray<{
10710
+ name: string;
10711
+ description: string;
10712
+ parameters: AxFunctionJSONSchema;
10713
+ returns?: AxFunctionJSONSchema;
10714
+ namespace: string;
10894
10715
  }>;
10895
- /** Default options for the built-in judge used by optimize(). */
10896
- judgeOptions?: AxAgentJudgeOptions;
10897
- };
10898
- type AxAgentRecursionOptions = Partial<Omit<AxProgramForwardOptions<string>, 'functions'>> & {
10899
- /** Maximum nested recursion depth for llmQuery sub-agent calls. */
10900
- maxDepth?: number;
10901
- };
10716
+ /** Module namespace used for child agent calls (default: "agents"). */
10717
+ agentModuleNamespace?: string;
10718
+ /** Enables module-only discovery rendering in prompt. */
10719
+ discoveryMode?: boolean;
10720
+ /** Precomputed available modules for runtime discovery mode. */
10721
+ availableModules?: ReadonlyArray<{
10722
+ namespace: string;
10723
+ selectionCriteria?: string;
10724
+ }>;
10725
+ }>): string;
10902
10726
  /**
10903
- * A split-architecture AI agent that uses two AxGen programs:
10904
- * - **Actor**: generates code to gather information (inputs, actionLog -> code)
10905
- * - **Responder**: synthesizes the final answer from actorResult payload (inputs, actorResult -> outputs)
10906
- *
10907
- * The execution loop is managed by TypeScript, not the LLM:
10908
- * 1. Actor generates code → executed in runtime → result appended to actionLog
10909
- * 2. Loop until Actor calls final(...) / ask_clarification(...) or maxTurns reached
10910
- * 3. Responder synthesizes final answer from actorResult payload
10727
+ * Builds the Responder system prompt. The Responder synthesizes a final answer
10728
+ * from the action log produced by the Actor. It NEVER generates code.
10911
10729
  */
10912
- declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut> implements AxAgentic<IN, OUT> {
10913
- private ai?;
10914
- private judgeAI?;
10915
- private program;
10916
- private actorProgram;
10917
- private responderProgram;
10918
- private agents?;
10919
- private agentFunctions;
10920
- private agentFunctionModuleMetadata;
10921
- private debug?;
10922
- private options?;
10923
- private rlmConfig;
10924
- private runtime;
10925
- private actorFieldNames;
10926
- private localFieldNames;
10927
- private sharedFieldNames;
10928
- private globalSharedFieldNames;
10929
- private excludedSharedFields;
10930
- private excludedAgents;
10931
- private excludedAgentFunctions;
10932
- private actorDescription?;
10933
- private responderDescription?;
10934
- private judgeOptions?;
10935
- private recursionForwardOptions?;
10936
- private actorForwardOptions?;
10937
- private responderForwardOptions?;
10938
- private inputUpdateCallback?;
10939
- private contextPromptConfigByField;
10940
- private agentModuleNamespace;
10941
- private functionDiscoveryEnabled;
10942
- private runtimeUsageInstructions;
10943
- private enforceIncrementalConsoleTurns;
10944
- private activeAbortControllers;
10945
- private _stopRequested;
10946
- private state;
10947
- private stateError;
10948
- private func;
10949
- private _parentSharedFields;
10950
- private _parentSharedAgents;
10951
- private _parentSharedAgentFunctions;
10952
- private _reservedAgentFunctionNamespaces;
10953
- private _mergeAgentFunctionModuleMetadata;
10954
- private _validateConfiguredSignature;
10955
- private _validateAgentFunctionNamespaces;
10956
- constructor({ ai, judgeAI, agentIdentity, agentModuleNamespace, signature, }: Readonly<{
10957
- ai?: Readonly<AxAIService>;
10958
- judgeAI?: Readonly<AxAIService>;
10959
- agentIdentity?: Readonly<AxAgentIdentity>;
10960
- agentModuleNamespace?: string;
10961
- signature: string | Readonly<AxSignatureConfig> | Readonly<AxSignature<IN, OUT>>;
10962
- }>, options: Readonly<AxAgentOptions<IN>>);
10963
- /**
10964
- * Builds (or rebuilds) Actor and Responder programs from the current
10965
- * base signature, contextFields, sharedFields, and actorFieldNames.
10966
- */
10967
- private _buildSplitPrograms;
10968
- /**
10969
- * Extends this agent's input signature and context fields for shared fields
10970
- * propagated from a parent agent. Called by a parent during its constructor.
10971
- */
10972
- private _extendForSharedFields;
10973
- /**
10974
- * Extends this agent's agents list with shared agents from a parent.
10975
- * Called by a parent during its constructor. Throws on duplicate propagation.
10976
- */
10977
- private _extendForSharedAgents;
10978
- /**
10979
- * Extends this agent and all its descendants with global shared fields.
10980
- * Adds fields to this agent's signature and sharedFieldNames, then
10981
- * recursively propagates to this agent's own children.
10982
- */
10983
- private _extendForGlobalSharedFields;
10984
- /**
10985
- * Extends this agent and all its descendants with global shared agents.
10986
- * Adds agents to this agent's agents list, then recursively propagates
10987
- * to this agent's own children.
10988
- */
10989
- private _extendForGlobalSharedAgents;
10990
- /**
10991
- * Extends this agent's agent functions list with shared agent functions
10992
- * from a parent. Throws on duplicate propagation.
10993
- */
10994
- private _extendForSharedAgentFunctions;
10995
- /**
10996
- * Extends this agent and all its descendants with globally shared agent functions.
10997
- */
10998
- private _extendForGlobalSharedAgentFunctions;
10999
- /**
11000
- * Stops an in-flight forward/streamingForward call. Causes the call
11001
- * to throw `AxAIServiceAbortedError`.
11002
- */
11003
- stop(): void;
11004
- getId(): string;
11005
- setId(id: string): void;
11006
- namedPrograms(): Array<{
11007
- id: string;
11008
- signature?: string;
11009
- }>;
11010
- namedProgramInstances(): AxNamedProgramInstance<IN, OUT>[];
11011
- getTraces(): AxProgramTrace<IN, OUT>[];
11012
- setDemos(demos: readonly (AxAgentDemos<IN, OUT> | AxProgramDemos<IN, OUT>)[], options?: {
11013
- modelConfig?: Record<string, unknown>;
11014
- }): void;
11015
- getUsage(): (AxModelUsage & {
11016
- ai: string;
11017
- model: string;
11018
- })[];
11019
- resetUsage(): void;
11020
- getState(): AxAgentState | undefined;
11021
- setState(state?: AxAgentState): void;
11022
- optimize(dataset: Readonly<AxAgentEvalDataset<IN>>, options?: Readonly<AxAgentOptimizeOptions<IN, OUT>>): Promise<AxAgentOptimizeResult<OUT>>;
11023
- private _createOptimizationProgram;
11024
- private _createAgentOptimizeMetric;
11025
- private _forwardForEvaluation;
11026
- getFunction(): AxFunction;
11027
- getExcludedSharedFields(): readonly string[];
11028
- private _getBypassedSharedFieldNames;
11029
- private _createRuntimeInputState;
11030
- private _createRuntimeExecutionContext;
11031
- getExcludedAgents(): readonly string[];
11032
- getExcludedAgentFunctions(): readonly string[];
11033
- getSignature(): AxSignature;
11034
- test(code: string, values?: Partial<IN>, options?: Readonly<{
11035
- ai?: AxAIService;
11036
- abortSignal?: AbortSignal;
11037
- debug?: boolean;
11038
- }>): Promise<AxAgentTestResult>;
11039
- setSignature(signature: NonNullable<ConstructorParameters<typeof AxSignature>[0]>): void;
11040
- applyOptimization(optimizedProgram: any): void;
11041
- /**
11042
- * Runs the Actor loop: sets up the runtime session, executes code iteratively,
11043
- * and returns the state needed by the Responder. Closes the session before returning.
11044
- */
11045
- private _runActorLoop;
11046
- forward<T extends Readonly<AxAIService>>(parentAi: T, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramForwardOptionsWithModels<T>>): Promise<OUT>;
11047
- streamingForward<T extends Readonly<AxAIService>>(parentAi: T, values: IN | AxMessage<IN>[], options?: Readonly<AxProgramStreamingForwardOptionsWithModels<T>>): AxGenStreamingOut<OUT>;
10730
+ declare function axBuildResponderDefinition(baseDefinition: string | undefined, contextFields: readonly AxIField[]): string;
10731
+
10732
+ /**
10733
+ * Permissions that can be granted to the RLM JS interpreter sandbox.
10734
+ * By default all dangerous globals are blocked; users opt in via this enum.
10735
+ */
10736
+ declare enum AxJSRuntimePermission {
10737
+ /** fetch, XMLHttpRequest, WebSocket, EventSource */
10738
+ NETWORK = "network",
10739
+ /** indexedDB, caches */
10740
+ STORAGE = "storage",
10741
+ /** importScripts */
10742
+ CODE_LOADING = "code-loading",
10743
+ /** BroadcastChannel */
10744
+ COMMUNICATION = "communication",
10745
+ /** performance */
10746
+ TIMING = "timing",
11048
10747
  /**
11049
- * Wraps an AxFunction as an async callable that handles both
11050
- * named ({ key: val }) and positional (val1, val2) argument styles.
10748
+ * Worker, SharedWorker.
10749
+ * Warning: sub-workers spawn with fresh, unlocked globals — granting
10750
+ * WORKERS without other restrictions implicitly grants all capabilities
10751
+ * (e.g. fetch, indexedDB) inside child workers.
11051
10752
  */
11052
- private static wrapFunction;
10753
+ WORKERS = "workers"
10754
+ }
10755
+ type AxJSRuntimeOutputMode = 'return' | 'stdout';
10756
+ /**
10757
+ * Browser-compatible JavaScript interpreter for RLM using Web Workers.
10758
+ * Creates persistent sessions where variables survive across `execute()` calls.
10759
+ */
10760
+ declare class AxJSRuntime implements AxCodeRuntime {
10761
+ readonly language = "JavaScript";
10762
+ private readonly timeout;
10763
+ private readonly permissions;
10764
+ private readonly allowUnsafeNodeHostAccess;
10765
+ private readonly nodeWorkerPoolSize;
10766
+ private readonly debugNodeWorkerPool;
10767
+ private readonly outputMode;
10768
+ private readonly captureConsole;
10769
+ constructor(options?: Readonly<{
10770
+ timeout?: number;
10771
+ permissions?: readonly AxJSRuntimePermission[];
10772
+ outputMode?: AxJSRuntimeOutputMode;
10773
+ captureConsole?: boolean;
10774
+ /**
10775
+ * Warning: enables direct access to Node host globals (e.g. process/require)
10776
+ * from model-generated code in Node worker runtime.
10777
+ *
10778
+ * Defaults to false for safer behavior.
10779
+ */
10780
+ allowUnsafeNodeHostAccess?: boolean;
10781
+ /**
10782
+ * Node-only: prewarm pool size for worker_threads.
10783
+ * Defaults to an adaptive value based on availableParallelism() when available.
10784
+ */
10785
+ nodeWorkerPoolSize?: number;
10786
+ /**
10787
+ * Node-only: prints resolved worker pool size to console.debug.
10788
+ * Can also be enabled via AX_RLM_DEBUG_NODE_POOL=1.
10789
+ */
10790
+ debugNodeWorkerPool?: boolean;
10791
+ }>);
10792
+ getUsageInstructions(): string;
11053
10793
  /**
11054
- * Wraps an AxFunction with automatic shared field injection.
11055
- * Shared field values are merged into call args (caller-provided args take precedence).
10794
+ * Creates a persistent execution session.
10795
+ *
10796
+ * Message flow:
10797
+ * 1) Main thread sends `init` with globals, function proxies, permissions.
10798
+ * 2) Main thread sends `execute` with correlation ID and code.
10799
+ * 3) Worker returns `result` or requests host callbacks via `fn-call`.
10800
+ * 4) Host responds to callback requests with `fn-result`.
10801
+ *
10802
+ * Session closes on:
10803
+ * - explicit close(),
10804
+ * - timeout,
10805
+ * - abort signal,
10806
+ * - worker error.
11056
10807
  */
11057
- private static wrapFunctionWithSharedFields;
10808
+ createSession(globals?: Record<string, unknown>): AxCodeSession;
10809
+ toFunction(): AxFunction;
10810
+ }
10811
+ /**
10812
+ * Factory function for creating an AxJSRuntime.
10813
+ */
10814
+ declare function axCreateJSRuntime(options?: Readonly<{
10815
+ timeout?: number;
10816
+ permissions?: readonly AxJSRuntimePermission[];
10817
+ outputMode?: AxJSRuntimeOutputMode;
10818
+ captureConsole?: boolean;
10819
+ allowUnsafeNodeHostAccess?: boolean;
10820
+ nodeWorkerPoolSize?: number;
10821
+ debugNodeWorkerPool?: boolean;
10822
+ }>): AxJSRuntime;
10823
+
10824
+ type AxWorkerRuntimeConfig = Readonly<{
10825
+ functionRefKey: string;
10826
+ maxErrorCauseDepth: number;
10827
+ }>;
10828
+ declare function axWorkerRuntime(config: AxWorkerRuntimeConfig): void;
10829
+
10830
+ interface AxMCPJSONRPCRequest<T> {
10831
+ jsonrpc: '2.0';
10832
+ id: string | number;
10833
+ method: string;
10834
+ params?: T;
10835
+ }
10836
+ interface AxMCPJSONRPCSuccessResponse<T = unknown> {
10837
+ jsonrpc: '2.0';
10838
+ id: string | number;
10839
+ result: T;
10840
+ }
10841
+ interface AxMCPJSONRPCErrorResponse {
10842
+ jsonrpc: '2.0';
10843
+ id: string | number;
10844
+ error: {
10845
+ code: number;
10846
+ message: string;
10847
+ data?: unknown;
10848
+ };
10849
+ }
10850
+ type AxMCPJSONRPCResponse<T = unknown> = AxMCPJSONRPCSuccessResponse<T> | AxMCPJSONRPCErrorResponse;
10851
+ interface AxMCPInitializeParams {
10852
+ protocolVersion: string;
10853
+ capabilities: Record<string, unknown>;
10854
+ clientInfo: {
10855
+ name: string;
10856
+ version: string;
10857
+ };
10858
+ }
10859
+ interface AxMCPInitializeResult {
10860
+ protocolVersion: string;
10861
+ capabilities: {
10862
+ tools?: unknown[];
10863
+ resources?: Record<string, unknown>;
10864
+ prompts?: unknown[];
10865
+ };
10866
+ serverInfo: {
10867
+ name: string;
10868
+ version: string;
10869
+ };
10870
+ }
10871
+ interface AxMCPFunctionDescription {
10872
+ name: string;
10873
+ description: string;
10874
+ inputSchema: AxFunctionJSONSchema;
10875
+ }
10876
+ interface AxMCPToolsListResult {
10877
+ name: string;
10878
+ description: string;
10879
+ tools: AxMCPFunctionDescription[];
10880
+ }
10881
+ interface AxMCPJSONRPCNotification {
10882
+ jsonrpc: '2.0';
10883
+ method: string;
10884
+ params?: Record<string, unknown>;
10885
+ }
10886
+ interface AxMCPTextContent {
10887
+ type: 'text';
10888
+ text: string;
10889
+ }
10890
+ interface AxMCPImageContent {
10891
+ type: 'image';
10892
+ data: string;
10893
+ mimeType: string;
10894
+ }
10895
+ interface AxMCPEmbeddedResource {
10896
+ type: 'resource';
10897
+ resource: AxMCPTextResourceContents | AxMCPBlobResourceContents;
10898
+ }
10899
+ interface AxMCPTextResourceContents {
10900
+ uri: string;
10901
+ mimeType?: string;
10902
+ text: string;
10903
+ }
10904
+ interface AxMCPBlobResourceContents {
10905
+ uri: string;
10906
+ mimeType?: string;
10907
+ blob: string;
10908
+ }
10909
+ interface AxMCPResource {
10910
+ uri: string;
10911
+ name: string;
10912
+ description?: string;
10913
+ mimeType?: string;
10914
+ }
10915
+ interface AxMCPResourceTemplate {
10916
+ uriTemplate: string;
10917
+ name: string;
10918
+ description?: string;
10919
+ mimeType?: string;
10920
+ }
10921
+ interface AxMCPResourcesListResult {
10922
+ resources: AxMCPResource[];
10923
+ nextCursor?: string;
10924
+ }
10925
+ interface AxMCPResourceTemplatesListResult {
10926
+ resourceTemplates: AxMCPResourceTemplate[];
10927
+ nextCursor?: string;
10928
+ }
10929
+ interface AxMCPResourceReadResult {
10930
+ contents: (AxMCPTextResourceContents | AxMCPBlobResourceContents)[];
10931
+ }
10932
+ interface AxMCPPromptArgument {
10933
+ name: string;
10934
+ description?: string;
10935
+ required?: boolean;
10936
+ }
10937
+ interface AxMCPPrompt {
10938
+ name: string;
10939
+ description?: string;
10940
+ arguments?: AxMCPPromptArgument[];
10941
+ }
10942
+ interface AxMCPPromptMessage {
10943
+ role: 'user' | 'assistant';
10944
+ content: AxMCPTextContent | AxMCPImageContent | AxMCPEmbeddedResource;
10945
+ }
10946
+ interface AxMCPPromptsListResult {
10947
+ prompts: AxMCPPrompt[];
10948
+ nextCursor?: string;
10949
+ }
10950
+ interface AxMCPPromptGetResult {
10951
+ description?: string;
10952
+ messages: AxMCPPromptMessage[];
10953
+ }
10954
+
10955
+ interface AxMCPTransport {
11058
10956
  /**
11059
- * Wraps agent functions under namespaced globals and child agents under
11060
- * a configurable `<module>.*` namespace for the JS runtime session.
10957
+ * Sends a JSON-RPC request or notification and returns the response
10958
+ * @param message The JSON-RPC request or notification to send
10959
+ * @returns A Promise that resolves to the JSON-RPC response
11061
10960
  */
11062
- private buildRuntimeGlobals;
10961
+ send(message: Readonly<AxMCPJSONRPCRequest<unknown>>): Promise<AxMCPJSONRPCResponse<unknown>>;
11063
10962
  /**
11064
- * Returns options compatible with AxGen (strips agent-specific grouped options).
10963
+ * Sends a JSON-RPC notification
10964
+ * @param message The JSON-RPC notification to send
11065
10965
  */
11066
- private get _genOptions();
10966
+ sendNotification(message: Readonly<AxMCPJSONRPCNotification>): Promise<void>;
11067
10967
  /**
11068
- * Builds the clean AxFunction parameters schema: input fields only, with any
11069
- * parent-injected shared fields stripped out (they are auto-injected at runtime).
10968
+ * Connects to the transport if needed
10969
+ * This method is optional and only required for transports that need connection setup
11070
10970
  */
11071
- private _buildFuncParameters;
10971
+ connect?(): Promise<void>;
11072
10972
  }
10973
+
11073
10974
  /**
11074
- * Configuration options for creating an agent using the agent() factory function.
10975
+ * Configuration for overriding function properties
11075
10976
  */
11076
- interface AxAgentConfig<_IN extends AxGenIn, _OUT extends AxGenOut> extends AxAgentOptions<_IN> {
11077
- ai?: AxAIService;
11078
- judgeAI?: AxAIService;
11079
- agentIdentity?: AxAgentIdentity;
10977
+ interface FunctionOverride {
10978
+ /** Original function name to override */
10979
+ name: string;
10980
+ /** Updates to apply to the function */
10981
+ updates: {
10982
+ /** Alternative name for the function */
10983
+ name?: string;
10984
+ /** Alternative description for the function */
10985
+ description?: string;
10986
+ };
11080
10987
  }
11081
10988
  /**
11082
- * Creates a strongly-typed AI agent from a signature.
11083
- * This is the recommended way to create agents, providing better type inference and cleaner syntax.
11084
- *
11085
- * @param signature - The input/output signature as a string or AxSignature object
11086
- * @param config - Configuration options for the agent (contextFields is required)
11087
- * @returns A typed agent instance
11088
- *
11089
- * @example
11090
- * ```typescript
11091
- * const myAgent = agent('context:string, query:string -> answer:string', {
11092
- * contextFields: ['context'],
11093
- * runtime: new AxJSRuntime(),
11094
- * });
11095
- * ```
10989
+ * Options for the MCP client
11096
10990
  */
11097
- declare function agent<const T extends string, const CF extends readonly AxContextFieldInput[]>(signature: T, config: Omit<AxAgentConfig<ParseSignature<T>['inputs'], ParseSignature<T>['outputs']>, 'contextFields'> & {
11098
- contextFields: CF;
11099
- }): AxAgent<ParseSignature<T>['inputs'], ParseSignature<T>['outputs']>;
11100
- declare function agent<TInput extends Record<string, any>, TOutput extends Record<string, any>, const CF extends readonly AxContextFieldInput[]>(signature: AxSignature<TInput, TOutput>, config: Omit<AxAgentConfig<TInput, TOutput>, 'contextFields'> & {
11101
- contextFields: CF;
11102
- }): AxAgent<TInput, TOutput>;
10991
+ interface AxMCPClientOptions {
10992
+ /** Enable debug logging */
10993
+ debug?: boolean;
10994
+ /** Logger function for debug output */
10995
+ logger?: AxLoggerFunction;
10996
+ /**
10997
+ * List of function overrides
10998
+ * Use this to provide alternative names and descriptions for functions
10999
+ * while preserving their original functionality
11000
+ *
11001
+ * Example:
11002
+ * ```
11003
+ * functionOverrides: [
11004
+ * {
11005
+ * name: "original-function-name",
11006
+ * updates: {
11007
+ * name: "new-function-name",
11008
+ * description: "New function description"
11009
+ * }
11010
+ * }
11011
+ * ]
11012
+ * ```
11013
+ */
11014
+ functionOverrides?: FunctionOverride[];
11015
+ }
11016
+ declare class AxMCPClient {
11017
+ private readonly transport;
11018
+ private readonly options;
11019
+ private functions;
11020
+ private promptFunctions;
11021
+ private resourceFunctions;
11022
+ private activeRequests;
11023
+ private capabilities;
11024
+ private logger;
11025
+ constructor(transport: AxMCPTransport, options?: Readonly<AxMCPClientOptions>);
11026
+ init(): Promise<void>;
11027
+ private discoverFunctions;
11028
+ private discoverPromptFunctions;
11029
+ private discoverResourceFunctions;
11030
+ private promptToFunction;
11031
+ private resourceToFunction;
11032
+ private resourceTemplateToFunction;
11033
+ private formatPromptMessages;
11034
+ private extractContent;
11035
+ private formatResourceContents;
11036
+ private sanitizeName;
11037
+ private parseUriTemplate;
11038
+ private expandUriTemplate;
11039
+ ping(timeout?: number): Promise<void>;
11040
+ toFunction(): AxFunction[];
11041
+ getCapabilities(): {
11042
+ tools: boolean;
11043
+ resources: boolean;
11044
+ prompts: boolean;
11045
+ };
11046
+ hasToolsCapability(): boolean;
11047
+ hasPromptsCapability(): boolean;
11048
+ hasResourcesCapability(): boolean;
11049
+ listPrompts(cursor?: string): Promise<AxMCPPromptsListResult>;
11050
+ getPrompt(name: string, args?: Record<string, string>): Promise<AxMCPPromptGetResult>;
11051
+ listResources(cursor?: string): Promise<AxMCPResourcesListResult>;
11052
+ listResourceTemplates(cursor?: string): Promise<AxMCPResourceTemplatesListResult>;
11053
+ readResource(uri: string): Promise<AxMCPResourceReadResult>;
11054
+ subscribeResource(uri: string): Promise<void>;
11055
+ unsubscribeResource(uri: string): Promise<void>;
11056
+ cancelRequest(id: string): void;
11057
+ private sendRequest;
11058
+ private sendNotification;
11059
+ }
11060
+
11061
+ type TokenSet = {
11062
+ accessToken: string;
11063
+ refreshToken?: string;
11064
+ expiresAt?: number;
11065
+ issuer?: string;
11066
+ };
11067
+ interface AxMCPOAuthOptions {
11068
+ clientId?: string;
11069
+ clientSecret?: string;
11070
+ redirectUri?: string;
11071
+ scopes?: string[];
11072
+ selectAuthorizationServer?: (issuers: string[], resourceMetadata: unknown) => Promise<string> | string;
11073
+ onAuthCode?: (authorizationUrl: string) => Promise<{
11074
+ code: string;
11075
+ redirectUri?: string;
11076
+ }>;
11077
+ tokenStore?: {
11078
+ getToken: (key: string) => Promise<TokenSet | null> | TokenSet | null;
11079
+ setToken: (key: string, token: TokenSet) => Promise<void> | void;
11080
+ clearToken?: (key: string) => Promise<void> | void;
11081
+ };
11082
+ }
11083
+
11084
+ interface AxMCPStreamableHTTPTransportOptions {
11085
+ headers?: Record<string, string>;
11086
+ authorization?: string;
11087
+ oauth?: AxMCPOAuthOptions;
11088
+ }
11089
+
11090
+ declare class AxMCPStreambleHTTPTransport implements AxMCPTransport {
11091
+ private mcpEndpoint;
11092
+ private sessionId?;
11093
+ private eventSource?;
11094
+ private pendingRequests;
11095
+ private messageHandler?;
11096
+ private customHeaders;
11097
+ private oauthHelper;
11098
+ private currentToken?;
11099
+ private currentIssuer?;
11100
+ constructor(mcpEndpoint: string, options?: AxMCPStreamableHTTPTransportOptions);
11101
+ setHeaders(headers: Record<string, string>): void;
11102
+ setAuthorization(authorization: string): void;
11103
+ getHeaders(): Record<string, string>;
11104
+ private buildHeaders;
11105
+ setMessageHandler(handler: (message: AxMCPJSONRPCRequest<unknown> | AxMCPJSONRPCNotification) => void): void;
11106
+ connect(): Promise<void>;
11107
+ openListeningStream(): Promise<void>;
11108
+ private openListeningStreamWithFetch;
11109
+ send(message: Readonly<AxMCPJSONRPCRequest<unknown>>): Promise<AxMCPJSONRPCResponse<unknown>>;
11110
+ private handleSSEResponse;
11111
+ sendNotification(message: Readonly<AxMCPJSONRPCNotification>): Promise<void>;
11112
+ terminateSession(): Promise<void>;
11113
+ close(): void;
11114
+ }
11115
+
11116
+ declare class AxMCPHTTPSSETransport implements AxMCPTransport {
11117
+ private endpoint;
11118
+ private sseUrl;
11119
+ private eventSource?;
11120
+ private customHeaders;
11121
+ private oauthHelper;
11122
+ private currentToken?;
11123
+ private currentIssuer?;
11124
+ private sseAbort?;
11125
+ private pendingRequests;
11126
+ private messageHandler?;
11127
+ private endpointReady?;
11128
+ constructor(sseUrl: string, options?: AxMCPStreamableHTTPTransportOptions);
11129
+ private buildHeaders;
11130
+ private openSSEWithFetch;
11131
+ private createEndpointReady;
11132
+ private consumeSSEStream;
11133
+ connect(): Promise<void>;
11134
+ send(message: Readonly<AxMCPJSONRPCRequest<unknown>>): Promise<AxMCPJSONRPCResponse<unknown>>;
11135
+ sendNotification(message: Readonly<AxMCPJSONRPCNotification>): Promise<void>;
11136
+ close(): void;
11137
+ }
11103
11138
 
11104
11139
  /**
11105
11140
  * Advanced Multi-hop RAG with iterative query refinement, context accumulation,
@@ -11447,4 +11482,4 @@ declare class AxRateLimiterTokenUsage {
11447
11482
  acquire(tokens: number): Promise<void>;
11448
11483
  }
11449
11484
 
11450
- 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 AxAgentClarification, type AxAgentClarificationChoice, AxAgentClarificationError, type AxAgentClarificationKind, type AxAgentCompletionProtocol, type AxAgentConfig, type AxAgentDemos, type AxAgentEvalDataset, type AxAgentEvalFunctionCall, type AxAgentEvalPrediction, type AxAgentEvalTask, type AxAgentFunction, type AxAgentFunctionExample, type AxAgentFunctionGroup, type AxAgentInputUpdateCallback, type AxAgentJudgeOptions, type AxAgentOptimizeOptions, type AxAgentOptimizeResult, type AxAgentOptimizeTarget, type AxAgentOptions, type AxAgentRecursionOptions, type AxAgentState, type AxAgentStateActionLogEntry, type AxAgentStateCheckpointState, type AxAgentStateRuntimeEntry, type AxAgentStructuredClarification, 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 AxCodeSessionSnapshot, type AxCodeSessionSnapshotEntry, 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 AxJudgeForwardOptions, 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 };
11485
+ 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, type AxActorPromptLevel, AxAgent, type AxAgentClarification, type AxAgentClarificationChoice, AxAgentClarificationError, type AxAgentClarificationKind, type AxAgentCompletionProtocol, type AxAgentConfig, type AxAgentDemos, type AxAgentEvalDataset, type AxAgentEvalFunctionCall, type AxAgentEvalPrediction, type AxAgentEvalTask, type AxAgentFunction, type AxAgentFunctionExample, type AxAgentFunctionGroup, type AxAgentInputUpdateCallback, type AxAgentJudgeOptions, type AxAgentOptimizeOptions, type AxAgentOptimizeResult, type AxAgentOptimizeTarget, type AxAgentOptions, type AxAgentRecursionOptions, type AxAgentState, type AxAgentStateActionLogEntry, type AxAgentStateCheckpointState, type AxAgentStateRuntimeEntry, type AxAgentStructuredClarification, type AxAgentTestCompletionPayload, type AxAgentTestResult, type AxAgentTurnCallbackArgs, 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 AxCodeSessionSnapshot, type AxCodeSessionSnapshotEntry, 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 AxJudgeForwardOptions, 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 };