@steerable/agent-protocol 0.13.1 → 0.14.1
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.
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* this module owns only the vocabulary and the reader.
|
|
12
12
|
*/
|
|
13
13
|
/** One provider failure class the backend can record. */
|
|
14
|
-
export type TurnFailureKind = 'transport' | 'rate_limit' | 'server' | 'auth' | 'invalid_request' | 'context_overflow' | 'unknown';
|
|
14
|
+
export type TurnFailureKind = 'transport' | 'rate_limit' | 'server' | 'auth' | 'invalid_request' | 'context_overflow' | 'license' | 'unknown';
|
|
15
15
|
/** Every kind, in the order diagnostics list them. */
|
|
16
16
|
export declare const TURN_FAILURE_KINDS: readonly TurnFailureKind[];
|
|
17
17
|
/** Structured failure detail persisted with a turn (`messageMetadata.failure`). */
|
|
@@ -18,6 +18,7 @@ export const TURN_FAILURE_KINDS = [
|
|
|
18
18
|
'auth',
|
|
19
19
|
'invalid_request',
|
|
20
20
|
'context_overflow',
|
|
21
|
+
'license',
|
|
21
22
|
'unknown',
|
|
22
23
|
];
|
|
23
24
|
/**
|
|
@@ -45,7 +46,7 @@ export function readTurnFailureDetail(value) {
|
|
|
45
46
|
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
46
47
|
return undefined;
|
|
47
48
|
const record = value;
|
|
48
|
-
const kind = readTurnFailureKind(record.errorKind);
|
|
49
|
+
const kind = readTurnFailureKind(record.errorKind) ?? readTurnFailureKind(record.kind);
|
|
49
50
|
if (!kind)
|
|
50
51
|
return undefined;
|
|
51
52
|
const proxy = typeof record.proxy === 'string' && record.proxy ? record.proxy : undefined;
|
|
@@ -72,13 +73,17 @@ export function readTurnFailureDetail(value) {
|
|
|
72
73
|
*/
|
|
73
74
|
export function classifyErrorMessage(message) {
|
|
74
75
|
const text = message.toLowerCase();
|
|
76
|
+
if (/\blicense_(missing|expired|signature_invalid|clock_rollback|seat_exceeded|user_limit_reached|feature_disabled|malformed)\b|system license (expired|invalid|missing)|enterprise license (expired|invalid|missing)/.test(text)) {
|
|
77
|
+
return 'license';
|
|
78
|
+
}
|
|
75
79
|
if (/\b(401|403)\b|unauthor|invalid[ _-]?api[ _-]?key|authentication fail|incorrect api key/.test(text)) {
|
|
76
80
|
return 'auth';
|
|
77
81
|
}
|
|
78
82
|
if (/\b429\b|rate[ _-]?limit|too many requests|quota exceeded/.test(text))
|
|
79
83
|
return 'rate_limit';
|
|
80
|
-
if (
|
|
84
|
+
if (/\b413\b|context[ _-]?(length|window)|too many tokens|maximum context|request entity too large|payload too large|body too large|request too large|input is too long/.test(text)) {
|
|
81
85
|
return 'context_overflow';
|
|
86
|
+
}
|
|
82
87
|
if (/\b(400|404|422)\b|invalid[ _-]?request|bad request/.test(text))
|
|
83
88
|
return 'invalid_request';
|
|
84
89
|
if (/\b5\d\d\b|internal server|bad gateway|service unavailable/.test(text))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steerable/agent-protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "Steerable framework Tier 1 — wire-format types (SSEEvent, ChatMessage, ToolCall, ToolResult, AgentSession, HarnessTrace, sidecar JSON-RPC) shared by every Steerable client and server.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://steerableframework.com/",
|