@opencode-ai/client 0.0.0-next-15333 → 0.0.0-next-15335
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,4 +1,4 @@
|
|
|
1
|
-
export type ClientErrorReason = "Transport" | "UnexpectedStatus" | "UnsupportedContentType" | "MalformedResponse";
|
|
1
|
+
export type ClientErrorReason = "Transport" | "UnexpectedStatus" | "UnsupportedContentType" | "MalformedResponse" | "SseEventTooLarge";
|
|
2
2
|
export declare class ClientError extends Error {
|
|
3
3
|
readonly reason: ClientErrorReason;
|
|
4
4
|
readonly name = "ClientError";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ClientError } from "./client-error";
|
|
2
|
+
const maxSseEventBytes = 16 * 1024 * 1024;
|
|
2
3
|
export function make(options) {
|
|
3
4
|
const fetch = options.fetch ?? globalThis.fetch;
|
|
4
5
|
const prepare = (descriptor, requestOptions) => {
|
|
@@ -84,8 +85,8 @@ export function make(options) {
|
|
|
84
85
|
throw new ClientError("Transport", { cause });
|
|
85
86
|
}
|
|
86
87
|
buffer += decoder.decode(next.value, { stream: !next.done });
|
|
87
|
-
if (buffer.length >
|
|
88
|
-
throw new ClientError("
|
|
88
|
+
if (buffer.length > maxSseEventBytes)
|
|
89
|
+
throw new ClientError("SseEventTooLarge");
|
|
89
90
|
const trailingCarriageReturn = !next.done && buffer.endsWith("\r");
|
|
90
91
|
if (trailingCarriageReturn)
|
|
91
92
|
buffer = buffer.slice(0, -1);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode-ai/client",
|
|
4
|
-
"version": "0.0.0-next-
|
|
4
|
+
"version": "0.0.0-next-15335",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"typecheck": "tsgo --noEmit"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@opencode-ai/schema": "0.0.0-next-
|
|
49
|
-
"@opencode-ai/protocol": "0.0.0-next-
|
|
48
|
+
"@opencode-ai/schema": "0.0.0-next-15335",
|
|
49
|
+
"@opencode-ai/protocol": "0.0.0-next-15335"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"effect": "4.0.0-beta.83"
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@effect/platform-node": "4.0.0-beta.83",
|
|
61
|
-
"@opencode-ai/httpapi-codegen": "0.0.0-next-
|
|
61
|
+
"@opencode-ai/httpapi-codegen": "0.0.0-next-15335",
|
|
62
62
|
"@tsconfig/bun": "1.0.9",
|
|
63
63
|
"@types/bun": "1.3.13",
|
|
64
64
|
"@typescript/native-preview": "7.0.0-dev.20251207.1",
|