@axlsdk/axl 0.24.1 → 0.24.2
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/dist/index.cjs +186 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -15
- package/dist/index.d.ts +17 -15
- package/dist/index.js +186 -85
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -151,6 +151,7 @@ declare function summarizeModelInput(input: ModelInput): string;
|
|
|
151
151
|
* {@link AccountingReason}, which makes the scope `incomplete` and makes
|
|
152
152
|
* `knownCost` an explicit lower bound.
|
|
153
153
|
*/
|
|
154
|
+
|
|
154
155
|
/**
|
|
155
156
|
* How much of the declared/instrumented scope the numbers actually cover.
|
|
156
157
|
*
|
|
@@ -423,6 +424,8 @@ type ToolChoice = 'auto' | 'none' | 'required' | {
|
|
|
423
424
|
*/
|
|
424
425
|
type ChatOptions = {
|
|
425
426
|
model: string;
|
|
427
|
+
/** @internal Full URI of a `ctx.ask` agent turn for cross-runtime diagnostics. */
|
|
428
|
+
accountingModelUri?: string;
|
|
426
429
|
temperature?: number;
|
|
427
430
|
tools?: ToolDefinition[];
|
|
428
431
|
maxTokens?: number;
|
|
@@ -2121,7 +2124,6 @@ declare class EventStreamOverflowError extends Error {
|
|
|
2121
2124
|
readonly cause?: unknown;
|
|
2122
2125
|
constructor(maxQueued: number, eventType: string, cause?: unknown);
|
|
2123
2126
|
}
|
|
2124
|
-
/** A known tool failure whose author-provided model message is safe to expose. */
|
|
2125
2127
|
declare class ToolFailure extends AxlError {
|
|
2126
2128
|
readonly modelMessage: string;
|
|
2127
2129
|
readonly cause?: unknown;
|
|
@@ -3012,7 +3014,8 @@ type RateLimitConfig = {
|
|
|
3012
3014
|
* `adaptive`), a call first waits out any active rate-limit brake and only
|
|
3013
3015
|
* then starts this clock; a call already queued when a brake begins keeps
|
|
3014
3016
|
* its clock running through it. A retry's re-acquire after a rate-limit 429
|
|
3015
|
-
* is exempt: it is bounded by `maxRateLimitRetries
|
|
3017
|
+
* is exempt: it is bounded by `maxRateLimitRetries`, or by the ask's abort
|
|
3018
|
+
* signal when the caller needs a strict deadline.
|
|
3016
3019
|
*/
|
|
3017
3020
|
acquireTimeoutMs?: number;
|
|
3018
3021
|
/**
|
|
@@ -3025,12 +3028,10 @@ type RateLimitConfig = {
|
|
|
3025
3028
|
* recovered linearly on success, dropped once traffic stays well below it;
|
|
3026
3029
|
* tuning is internal) until it reopens. Nothing waits before the first 429.
|
|
3027
3030
|
*
|
|
3028
|
-
*
|
|
3029
|
-
*
|
|
3030
|
-
*
|
|
3031
|
-
*
|
|
3032
|
-
* 429 is a rate limit, so a spend-cap or daily-quota 429 fails only once
|
|
3033
|
-
* `maxRateLimitRetries` is spent.
|
|
3031
|
+
* First-party OpenAI, Anthropic, and Gemini at their vendor origins read
|
|
3032
|
+
* 429 bodies: explicit terminal quota/billing limits fail fast. Only OpenAI
|
|
3033
|
+
* and Anthropic read 2xx quota hints. Unrecognized Gemini 429s, presets,
|
|
3034
|
+
* and proxy/gateway origins retry as rate limits.
|
|
3034
3035
|
*
|
|
3035
3036
|
* `false` restores the plain behavior: a 429 shares the transient retry
|
|
3036
3037
|
* budget, holds up no other call, and nothing is paced. Ignored by a
|
|
@@ -3225,10 +3226,10 @@ type QuotaDialect = {
|
|
|
3225
3226
|
* share one predicate, `Date.now() < brakeUntil`. A scope that does not adapt
|
|
3226
3227
|
* never brakes, so it behaves exactly as a plain `RateLimiter`.
|
|
3227
3228
|
*
|
|
3228
|
-
* Adapting needs no quota dialect. A dialect (first-party OpenAI
|
|
3229
|
-
* at the vendor origin, see `quota.ts`) adds
|
|
3230
|
-
*
|
|
3231
|
-
*
|
|
3229
|
+
* Adapting needs no quota dialect. A dialect (first-party OpenAI, Anthropic,
|
|
3230
|
+
* or Gemini at the vendor origin, see `quota.ts`) adds classification of a
|
|
3231
|
+
* 429 body; OpenAI and Anthropic also provide 2xx quota hints. Without one,
|
|
3232
|
+
* every 429 is treated as a rate limit and the hint is
|
|
3232
3233
|
* never read, so recovery and reopening proceed as if the account were healthy.
|
|
3233
3234
|
*/
|
|
3234
3235
|
declare class ScopeGovernor extends RateLimiter {
|
|
@@ -5840,7 +5841,7 @@ type ModelTimingRollup = Record<string, {
|
|
|
5840
5841
|
/** Timed calls that reported a `firstTokenMs` — the denominator for it. */
|
|
5841
5842
|
firstTokenCalls?: number;
|
|
5842
5843
|
/**
|
|
5843
|
-
* The per-call blocks the sums were built from, in
|
|
5844
|
+
* The per-call blocks the sums were built from, in settlement order.
|
|
5844
5845
|
* `length === calls`. Present only under `captureTimingSamples`, because
|
|
5845
5846
|
* retaining it is O(calls) in memory and the sums alone are O(models) — a
|
|
5846
5847
|
* caller that needs a real DISTRIBUTION (percentiles, min/max) cannot
|
|
@@ -6517,8 +6518,9 @@ declare class AxlRuntime extends EventEmitter {
|
|
|
6517
6518
|
* new paid operations once known spend reaches the limit. Already-dispatched
|
|
6518
6519
|
* work still settles and is still counted.
|
|
6519
6520
|
*
|
|
6520
|
-
*
|
|
6521
|
-
*
|
|
6521
|
+
* Model metadata and timing share the settlement scope with accounting, so
|
|
6522
|
+
* they cross runtimes and compatible ESM/CJS copies. Workflow names and
|
|
6523
|
+
* captured traces still come from this runtime's events.
|
|
6522
6524
|
*/
|
|
6523
6525
|
trackOutcome<T>(fn: () => Promise<T>, options?: TrackOutcomeOptions): Promise<TrackedOutcome<T>>;
|
|
6524
6526
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -151,6 +151,7 @@ declare function summarizeModelInput(input: ModelInput): string;
|
|
|
151
151
|
* {@link AccountingReason}, which makes the scope `incomplete` and makes
|
|
152
152
|
* `knownCost` an explicit lower bound.
|
|
153
153
|
*/
|
|
154
|
+
|
|
154
155
|
/**
|
|
155
156
|
* How much of the declared/instrumented scope the numbers actually cover.
|
|
156
157
|
*
|
|
@@ -423,6 +424,8 @@ type ToolChoice = 'auto' | 'none' | 'required' | {
|
|
|
423
424
|
*/
|
|
424
425
|
type ChatOptions = {
|
|
425
426
|
model: string;
|
|
427
|
+
/** @internal Full URI of a `ctx.ask` agent turn for cross-runtime diagnostics. */
|
|
428
|
+
accountingModelUri?: string;
|
|
426
429
|
temperature?: number;
|
|
427
430
|
tools?: ToolDefinition[];
|
|
428
431
|
maxTokens?: number;
|
|
@@ -2121,7 +2124,6 @@ declare class EventStreamOverflowError extends Error {
|
|
|
2121
2124
|
readonly cause?: unknown;
|
|
2122
2125
|
constructor(maxQueued: number, eventType: string, cause?: unknown);
|
|
2123
2126
|
}
|
|
2124
|
-
/** A known tool failure whose author-provided model message is safe to expose. */
|
|
2125
2127
|
declare class ToolFailure extends AxlError {
|
|
2126
2128
|
readonly modelMessage: string;
|
|
2127
2129
|
readonly cause?: unknown;
|
|
@@ -3012,7 +3014,8 @@ type RateLimitConfig = {
|
|
|
3012
3014
|
* `adaptive`), a call first waits out any active rate-limit brake and only
|
|
3013
3015
|
* then starts this clock; a call already queued when a brake begins keeps
|
|
3014
3016
|
* its clock running through it. A retry's re-acquire after a rate-limit 429
|
|
3015
|
-
* is exempt: it is bounded by `maxRateLimitRetries
|
|
3017
|
+
* is exempt: it is bounded by `maxRateLimitRetries`, or by the ask's abort
|
|
3018
|
+
* signal when the caller needs a strict deadline.
|
|
3016
3019
|
*/
|
|
3017
3020
|
acquireTimeoutMs?: number;
|
|
3018
3021
|
/**
|
|
@@ -3025,12 +3028,10 @@ type RateLimitConfig = {
|
|
|
3025
3028
|
* recovered linearly on success, dropped once traffic stays well below it;
|
|
3026
3029
|
* tuning is internal) until it reopens. Nothing waits before the first 429.
|
|
3027
3030
|
*
|
|
3028
|
-
*
|
|
3029
|
-
*
|
|
3030
|
-
*
|
|
3031
|
-
*
|
|
3032
|
-
* 429 is a rate limit, so a spend-cap or daily-quota 429 fails only once
|
|
3033
|
-
* `maxRateLimitRetries` is spent.
|
|
3031
|
+
* First-party OpenAI, Anthropic, and Gemini at their vendor origins read
|
|
3032
|
+
* 429 bodies: explicit terminal quota/billing limits fail fast. Only OpenAI
|
|
3033
|
+
* and Anthropic read 2xx quota hints. Unrecognized Gemini 429s, presets,
|
|
3034
|
+
* and proxy/gateway origins retry as rate limits.
|
|
3034
3035
|
*
|
|
3035
3036
|
* `false` restores the plain behavior: a 429 shares the transient retry
|
|
3036
3037
|
* budget, holds up no other call, and nothing is paced. Ignored by a
|
|
@@ -3225,10 +3226,10 @@ type QuotaDialect = {
|
|
|
3225
3226
|
* share one predicate, `Date.now() < brakeUntil`. A scope that does not adapt
|
|
3226
3227
|
* never brakes, so it behaves exactly as a plain `RateLimiter`.
|
|
3227
3228
|
*
|
|
3228
|
-
* Adapting needs no quota dialect. A dialect (first-party OpenAI
|
|
3229
|
-
* at the vendor origin, see `quota.ts`) adds
|
|
3230
|
-
*
|
|
3231
|
-
*
|
|
3229
|
+
* Adapting needs no quota dialect. A dialect (first-party OpenAI, Anthropic,
|
|
3230
|
+
* or Gemini at the vendor origin, see `quota.ts`) adds classification of a
|
|
3231
|
+
* 429 body; OpenAI and Anthropic also provide 2xx quota hints. Without one,
|
|
3232
|
+
* every 429 is treated as a rate limit and the hint is
|
|
3232
3233
|
* never read, so recovery and reopening proceed as if the account were healthy.
|
|
3233
3234
|
*/
|
|
3234
3235
|
declare class ScopeGovernor extends RateLimiter {
|
|
@@ -5840,7 +5841,7 @@ type ModelTimingRollup = Record<string, {
|
|
|
5840
5841
|
/** Timed calls that reported a `firstTokenMs` — the denominator for it. */
|
|
5841
5842
|
firstTokenCalls?: number;
|
|
5842
5843
|
/**
|
|
5843
|
-
* The per-call blocks the sums were built from, in
|
|
5844
|
+
* The per-call blocks the sums were built from, in settlement order.
|
|
5844
5845
|
* `length === calls`. Present only under `captureTimingSamples`, because
|
|
5845
5846
|
* retaining it is O(calls) in memory and the sums alone are O(models) — a
|
|
5846
5847
|
* caller that needs a real DISTRIBUTION (percentiles, min/max) cannot
|
|
@@ -6517,8 +6518,9 @@ declare class AxlRuntime extends EventEmitter {
|
|
|
6517
6518
|
* new paid operations once known spend reaches the limit. Already-dispatched
|
|
6518
6519
|
* work still settles and is still counted.
|
|
6519
6520
|
*
|
|
6520
|
-
*
|
|
6521
|
-
*
|
|
6521
|
+
* Model metadata and timing share the settlement scope with accounting, so
|
|
6522
|
+
* they cross runtimes and compatible ESM/CJS copies. Workflow names and
|
|
6523
|
+
* captured traces still come from this runtime's events.
|
|
6522
6524
|
*/
|
|
6523
6525
|
trackOutcome<T>(fn: () => Promise<T>, options?: TrackOutcomeOptions): Promise<TrackedOutcome<T>>;
|
|
6524
6526
|
/**
|