@axlsdk/axl 0.23.0 → 0.23.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/README.md +29 -0
- package/dist/index.cjs +311 -116
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +62 -31
- package/dist/index.d.ts +62 -31
- package/dist/index.js +310 -116
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -229,6 +229,34 @@ const dynamicAgent = agent({
|
|
|
229
229
|
});
|
|
230
230
|
```
|
|
231
231
|
|
|
232
|
+
#### Ask deadlines
|
|
233
|
+
|
|
234
|
+
`timeout` is a graceful between-turn budget (default `'60s'`): the current provider
|
|
235
|
+
turn and ordinary tool work finish, but Axl will not start another turn after it expires.
|
|
236
|
+
Time spent in `awaitHuman` is excluded. For a strict request SLA, pass an ask-local signal:
|
|
237
|
+
|
|
238
|
+
```typescript
|
|
239
|
+
const answer = await ctx.ask(researcher, question, {
|
|
240
|
+
signal: AbortSignal.timeout(15_000), // hard wall-clock deadline
|
|
241
|
+
});
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
For long-running work without a short wall-clock SLA, use `stallTimeout` as an opt-in
|
|
245
|
+
anti-hang guard (`'120s'` is conservative starting guidance, not an SDK default):
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
const answer = await ctx.ask(researcher, question, {
|
|
249
|
+
stallTimeout: '120s', // reset whenever a streamed chunk arrives
|
|
250
|
+
});
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
`signal` aborts in-flight work and preserves its exact reason. `stallTimeout` throws
|
|
254
|
+
`StallTimeoutError` (a `TimeoutError` subtype). Both discard partial streamed output. If you
|
|
255
|
+
combine them, make the strict deadline longer than the stall window when you want either control
|
|
256
|
+
to be able to fire. See the
|
|
257
|
+
[API reference](../../docs/api-reference.md#ask-deadlines-cancellation-and-stalled-requests)
|
|
258
|
+
for precedence, nested asks, and provider timing details.
|
|
259
|
+
|
|
232
260
|
#### Dynamic Handoffs
|
|
233
261
|
|
|
234
262
|
`handoffs` accepts a static array or a function for runtime-conditional routing:
|
|
@@ -768,6 +796,7 @@ import {
|
|
|
768
796
|
QuorumNotMet, // Quorum threshold not reached
|
|
769
797
|
NoConsensus, // Vote could not reach consensus
|
|
770
798
|
TimeoutError, // Operation exceeded timeout
|
|
799
|
+
StallTimeoutError, // Provider request stopped making progress
|
|
771
800
|
MaxTurnsError, // Agent exceeded max tool-calling turns
|
|
772
801
|
BudgetExceededError, // Budget limit exceeded
|
|
773
802
|
GuardrailError, // Guardrail blocked input or output
|