@orkestrel/agent 0.0.23 → 0.0.24
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/src/core/index.cjs
CHANGED
|
@@ -188,7 +188,7 @@ var ProviderAbortError = class extends Error {
|
|
|
188
188
|
* ```
|
|
189
189
|
*/
|
|
190
190
|
function isProviderAbortError(value) {
|
|
191
|
-
return value
|
|
191
|
+
return (0, _orkestrel_contract.isInstance)(value, ProviderAbortError);
|
|
192
192
|
}
|
|
193
193
|
/**
|
|
194
194
|
* Reports an {@link AgentInterface} run that ended {@link AgentResult.partial} under a
|
|
@@ -235,7 +235,7 @@ var AgentJobError = class extends Error {
|
|
|
235
235
|
* ```
|
|
236
236
|
*/
|
|
237
237
|
function isAgentJobError(value) {
|
|
238
|
-
return value
|
|
238
|
+
return (0, _orkestrel_contract.isInstance)(value, AgentJobError);
|
|
239
239
|
}
|
|
240
240
|
/**
|
|
241
241
|
* Reports a conversation with no {@link ConversationSummaryHandler} to fold its messages with,
|
|
@@ -279,7 +279,7 @@ var ConversationError = class extends Error {
|
|
|
279
279
|
* ```
|
|
280
280
|
*/
|
|
281
281
|
function isConversationError(value) {
|
|
282
|
-
return value
|
|
282
|
+
return (0, _orkestrel_contract.isInstance)(value, ConversationError);
|
|
283
283
|
}
|
|
284
284
|
/**
|
|
285
285
|
* Reports a concurrent run that would corrupt shared per-agent accounting, or a rehydration
|
|
@@ -325,7 +325,7 @@ var AgentError = class extends Error {
|
|
|
325
325
|
* ```
|
|
326
326
|
*/
|
|
327
327
|
function isAgentError(value) {
|
|
328
|
-
return value
|
|
328
|
+
return (0, _orkestrel_contract.isInstance)(value, AgentError);
|
|
329
329
|
}
|
|
330
330
|
/**
|
|
331
331
|
* Reports a coded provider failure with its HTTP status and underlying cause when available.
|
|
@@ -359,7 +359,7 @@ var ProviderError = class extends Error {
|
|
|
359
359
|
* ```
|
|
360
360
|
*/
|
|
361
361
|
function isProviderError(value) {
|
|
362
|
-
return value
|
|
362
|
+
return (0, _orkestrel_contract.isInstance)(value, ProviderError);
|
|
363
363
|
}
|
|
364
364
|
//#endregion
|
|
365
365
|
//#region src/core/shapers.ts
|
|
@@ -726,7 +726,7 @@ function renderFencedFile(path, language, content) {
|
|
|
726
726
|
* @returns The floored count, or `0` when the value is non-finite or non-positive
|
|
727
727
|
*/
|
|
728
728
|
function sanitizeToken(value) {
|
|
729
|
-
return
|
|
729
|
+
return (0, _orkestrel_contract.isFiniteNumber)(value) && value > 0 ? Math.floor(value) : 0;
|
|
730
730
|
}
|
|
731
731
|
/**
|
|
732
732
|
* Sanitizes a {@link TokenUsage} into safe, non-negative integers — the guard an agent's
|
|
@@ -3148,7 +3148,7 @@ var RelayStream = class {
|
|
|
3148
3148
|
if (step.done) this.#finish(controller);
|
|
3149
3149
|
} catch (error) {
|
|
3150
3150
|
if (this.#settled) return;
|
|
3151
|
-
const frame = error
|
|
3151
|
+
const frame = isProviderAbortError(error) ? {
|
|
3152
3152
|
channel: "abort",
|
|
3153
3153
|
partial: error.partial
|
|
3154
3154
|
} : {
|