@veryfront/ext-llm-anthropic 0.1.1260 → 0.1.1261
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-stream.d.ts","sourceRoot":"","sources":["../src/anthropic-stream.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,YAAY,EAGb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,iCAAiC,EAIvC,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,+BAA+B,CAAC;AAuCvC,MAAM,MAAM,yBAAyB,GAAG;IACtC,YAAY,EAAE,MAAM,GAAG;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC/D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,OAAO,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,iCAAiC,CAAC,EAAE,MAAM,CAAC;IAC3C,qCAAqC,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC3D,wCAAwC,CAAC,EAAE,MAAM,CAAC;IAClD,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qBAAqB,CAAC,EAAE,iCAAiC,CAAC;IAC1D,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,yBAAyB,KAAK,IAAI,CAAC;CAChE,CAAC;AAwBF,eAAO,MAAM,oCAAoC,WAAa,CAAC;AAC/D;;;GAGG;AACH,eAAO,MAAM,oCAAoC,OAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"anthropic-stream.d.ts","sourceRoot":"","sources":["../src/anthropic-stream.ts"],"names":[],"mappings":"AAcA,OAAO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OAAO,GAAG,YAAY,GAAG,SAAS,CA+DhF;AAoGD,wBAAuB,8BAA8B,CACnD,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,EAClC,OAAO,GAAE,sBAA2B,GACnC,aAAa,CAAC,OAAO,CAAC,CA62BxB"}
|
package/esm/anthropic-stream.js
CHANGED
|
@@ -39,12 +39,13 @@ export const MAX_ANTHROPIC_RETAINED_CONTENT_BYTES = 16_777_216;
|
|
|
39
39
|
* deltas accepted per stream. Non-empty deltas are bounded by bytes only.
|
|
40
40
|
*/
|
|
41
41
|
export const MAX_ANTHROPIC_RETAINED_CONTENT_ITEMS = 8_192;
|
|
42
|
-
function invalidAnthropicStream(providerLabel, issue) {
|
|
42
|
+
function invalidAnthropicStream(providerLabel, issue, cause) {
|
|
43
43
|
return new ProviderRequestError({
|
|
44
44
|
provider: "anthropic",
|
|
45
45
|
status: 200,
|
|
46
46
|
message: `${providerLabel} request failed: invalid successful stream (${issue})`,
|
|
47
47
|
retryable: false,
|
|
48
|
+
...(cause === undefined ? {} : { cause }),
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
const UNPARSABLE_TOOL_INPUT_ISSUE = "tool call arguments were not valid JSON object text";
|
|
@@ -793,7 +794,7 @@ export async function* streamAnthropicCompatibleParts(stream, options = {}) {
|
|
|
793
794
|
}
|
|
794
795
|
catch (error) {
|
|
795
796
|
if (error instanceof RangeError) {
|
|
796
|
-
throw invalidAnthropicStream(providerLabel, error.message);
|
|
797
|
+
throw invalidAnthropicStream(providerLabel, error.message, error);
|
|
797
798
|
}
|
|
798
799
|
throw invalidAnthropicStream(providerLabel, "content block could not be retained safely");
|
|
799
800
|
}
|
|
@@ -984,7 +985,7 @@ export async function* streamAnthropicCompatibleParts(stream, options = {}) {
|
|
|
984
985
|
retainedContentBudget.retainDelta(delta.text, "text delta");
|
|
985
986
|
}
|
|
986
987
|
catch (error) {
|
|
987
|
-
throw invalidAnthropicStream(providerLabel, error instanceof Error ? error.message : "text retention budget was exceeded");
|
|
988
|
+
throw invalidAnthropicStream(providerLabel, error instanceof Error ? error.message : "text retention budget was exceeded", error);
|
|
988
989
|
}
|
|
989
990
|
chunks.append(delta.text);
|
|
990
991
|
if (delta.text.length > 0) {
|
|
@@ -1009,7 +1010,7 @@ export async function* streamAnthropicCompatibleParts(stream, options = {}) {
|
|
|
1009
1010
|
retainedContentBudget.retainDelta(delta.thinking, "thinking delta");
|
|
1010
1011
|
}
|
|
1011
1012
|
catch (error) {
|
|
1012
|
-
throw invalidAnthropicStream(providerLabel, error instanceof Error ? error.message : "thinking retention budget was exceeded");
|
|
1013
|
+
throw invalidAnthropicStream(providerLabel, error instanceof Error ? error.message : "thinking retention budget was exceeded", error);
|
|
1013
1014
|
}
|
|
1014
1015
|
chunks.append(delta.thinking);
|
|
1015
1016
|
if (delta.thinking.length > 0) {
|
|
@@ -1049,7 +1050,7 @@ export async function* streamAnthropicCompatibleParts(stream, options = {}) {
|
|
|
1049
1050
|
retainedContentBudget.retainItem(stringifyJsonValue(citation), "citation delta");
|
|
1050
1051
|
}
|
|
1051
1052
|
catch (error) {
|
|
1052
|
-
throw invalidAnthropicStream(providerLabel, error instanceof Error ? error.message : "citation retention budget was exceeded");
|
|
1053
|
+
throw invalidAnthropicStream(providerLabel, error instanceof Error ? error.message : "citation retention budget was exceeded", error);
|
|
1053
1054
|
}
|
|
1054
1055
|
citations.push(citation);
|
|
1055
1056
|
rawBlock.citations = citations;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veryfront/ext-llm-anthropic",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1261",
|
|
4
4
|
"description": "Veryfront first-party extension package for ext-llm-anthropic",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"veryfront",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"capabilities": []
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"veryfront": "^0.1.
|
|
48
|
+
"veryfront": "^0.1.1261"
|
|
49
49
|
},
|
|
50
50
|
"type": "module",
|
|
51
51
|
"types": "./esm/index.d.ts",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"NOTICE",
|
|
56
56
|
"README.md"
|
|
57
57
|
],
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "2c528e5ed4a52402c66f5a83e70803b20c88161e"
|
|
59
59
|
}
|