@ax-llm/ax 16.1.8 → 16.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.cts CHANGED
@@ -341,6 +341,7 @@ type AxFunctionHandler = (args?: any, extra?: Readonly<{
341
341
  debug?: boolean;
342
342
  ai?: AxAIService;
343
343
  step?: AxStepContext;
344
+ abortSignal?: AbortSignal;
344
345
  }>) => unknown;
345
346
  type AxFunctionJSONSchema = {
346
347
  type: string;
@@ -2812,7 +2813,14 @@ declare class AxGen<IN = any, OUT extends AxGenOut = any> extends AxProgram<IN,
2812
2813
  private thoughtFieldName;
2813
2814
  private signatureToolCallingManager?;
2814
2815
  private structuredOutputFunctionFallback;
2816
+ private abortController?;
2817
+ private _stopRequested;
2815
2818
  constructor(signature: NonNullable<ConstructorParameters<typeof AxSignature>[0]> | AxSignature<any, any>, options?: Readonly<AxProgramForwardOptions<any>>);
2819
+ /**
2820
+ * Stops an in-flight generation. Causes `forward()` / `streamingForward()`
2821
+ * to throw `AxAIServiceAbortedError`.
2822
+ */
2823
+ stop(): void;
2816
2824
  setInstruction(instruction: string): void;
2817
2825
  getInstruction(): string | undefined;
2818
2826
  private getSignatureName;
@@ -8845,10 +8853,17 @@ TState extends AxFlowState = IN> implements AxFlowable<IN, OUT> {
8845
8853
  private readonly flowLogger?;
8846
8854
  private readonly timingLogger?;
8847
8855
  private readonly defaultAIOptions?;
8856
+ private abortController?;
8857
+ private _stopRequested;
8848
8858
  /**
8849
8859
  * Converts a string to camelCase for valid field names
8850
8860
  */
8851
8861
  private toCamelCase;
8862
+ /**
8863
+ * Stops an in-flight `forward()` call. Causes it to throw
8864
+ * `AxAIServiceAbortedError`.
8865
+ */
8866
+ stop(): void;
8852
8867
  /**
8853
8868
  * Executes a list of steps with comprehensive logging
8854
8869
  */
@@ -10037,7 +10052,9 @@ interface AxCodeInterpreter {
10037
10052
  * A persistent code execution session. Variables persist across `execute()` calls.
10038
10053
  */
10039
10054
  interface AxCodeSession {
10040
- execute(code: string): Promise<unknown>;
10055
+ execute(code: string, options?: {
10056
+ signal?: AbortSignal;
10057
+ }): Promise<unknown>;
10041
10058
  close(): void;
10042
10059
  }
10043
10060
  /**
@@ -10120,6 +10137,8 @@ declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut> implements AxAge
10120
10137
  private rlmConfig?;
10121
10138
  private rlmContextFields?;
10122
10139
  private rlmProgram?;
10140
+ private abortController?;
10141
+ private _stopRequested;
10123
10142
  private name;
10124
10143
  private func;
10125
10144
  constructor({ ai, name, description, definition, signature, agents, functions, }: Readonly<{
@@ -10131,6 +10150,11 @@ declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut> implements AxAge
10131
10150
  agents?: AxAgentic<IN, OUT>[];
10132
10151
  functions?: AxInputFunctionType;
10133
10152
  }>, options?: Readonly<AxAgentOptions>);
10153
+ /**
10154
+ * Stops an in-flight forward/streamingForward call. Causes the call
10155
+ * to throw `AxAIServiceAbortedError`.
10156
+ */
10157
+ stop(): void;
10134
10158
  /**
10135
10159
  * Creates a new AxAgent instance with type-safe signature parsing.
10136
10160
  * This is the recommended way to create agents with string-based signatures.
package/index.d.ts CHANGED
@@ -341,6 +341,7 @@ type AxFunctionHandler = (args?: any, extra?: Readonly<{
341
341
  debug?: boolean;
342
342
  ai?: AxAIService;
343
343
  step?: AxStepContext;
344
+ abortSignal?: AbortSignal;
344
345
  }>) => unknown;
345
346
  type AxFunctionJSONSchema = {
346
347
  type: string;
@@ -2812,7 +2813,14 @@ declare class AxGen<IN = any, OUT extends AxGenOut = any> extends AxProgram<IN,
2812
2813
  private thoughtFieldName;
2813
2814
  private signatureToolCallingManager?;
2814
2815
  private structuredOutputFunctionFallback;
2816
+ private abortController?;
2817
+ private _stopRequested;
2815
2818
  constructor(signature: NonNullable<ConstructorParameters<typeof AxSignature>[0]> | AxSignature<any, any>, options?: Readonly<AxProgramForwardOptions<any>>);
2819
+ /**
2820
+ * Stops an in-flight generation. Causes `forward()` / `streamingForward()`
2821
+ * to throw `AxAIServiceAbortedError`.
2822
+ */
2823
+ stop(): void;
2816
2824
  setInstruction(instruction: string): void;
2817
2825
  getInstruction(): string | undefined;
2818
2826
  private getSignatureName;
@@ -8845,10 +8853,17 @@ TState extends AxFlowState = IN> implements AxFlowable<IN, OUT> {
8845
8853
  private readonly flowLogger?;
8846
8854
  private readonly timingLogger?;
8847
8855
  private readonly defaultAIOptions?;
8856
+ private abortController?;
8857
+ private _stopRequested;
8848
8858
  /**
8849
8859
  * Converts a string to camelCase for valid field names
8850
8860
  */
8851
8861
  private toCamelCase;
8862
+ /**
8863
+ * Stops an in-flight `forward()` call. Causes it to throw
8864
+ * `AxAIServiceAbortedError`.
8865
+ */
8866
+ stop(): void;
8852
8867
  /**
8853
8868
  * Executes a list of steps with comprehensive logging
8854
8869
  */
@@ -10037,7 +10052,9 @@ interface AxCodeInterpreter {
10037
10052
  * A persistent code execution session. Variables persist across `execute()` calls.
10038
10053
  */
10039
10054
  interface AxCodeSession {
10040
- execute(code: string): Promise<unknown>;
10055
+ execute(code: string, options?: {
10056
+ signal?: AbortSignal;
10057
+ }): Promise<unknown>;
10041
10058
  close(): void;
10042
10059
  }
10043
10060
  /**
@@ -10120,6 +10137,8 @@ declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut> implements AxAge
10120
10137
  private rlmConfig?;
10121
10138
  private rlmContextFields?;
10122
10139
  private rlmProgram?;
10140
+ private abortController?;
10141
+ private _stopRequested;
10123
10142
  private name;
10124
10143
  private func;
10125
10144
  constructor({ ai, name, description, definition, signature, agents, functions, }: Readonly<{
@@ -10131,6 +10150,11 @@ declare class AxAgent<IN extends AxGenIn, OUT extends AxGenOut> implements AxAge
10131
10150
  agents?: AxAgentic<IN, OUT>[];
10132
10151
  functions?: AxInputFunctionType;
10133
10152
  }>, options?: Readonly<AxAgentOptions>);
10153
+ /**
10154
+ * Stops an in-flight forward/streamingForward call. Causes the call
10155
+ * to throw `AxAIServiceAbortedError`.
10156
+ */
10157
+ stop(): void;
10134
10158
  /**
10135
10159
  * Creates a new AxAgent instance with type-safe signature parsing.
10136
10160
  * This is the recommended way to create agents with string-based signatures.