MCPcopy Create free account
hub / github.com/effect-app/libs / decode

Function decode

repos/effect/packages/effect/src/unstable/encoding/Sse.ts:36–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34export class EventTooLarge extends Data.TaggedError("EventTooLarge")<{
35 readonly maxEventSize: number
36}> {
37 override get message() {
38 return `Pending SSE event exceeded the maximum size of ${this.maxEventSize}`
39 }
40}
41
42/**
43 * Union of Server-Sent Events decoding error reasons.
44 *
45 * @category errors
46 * @since 4.0.0
47 */
48export type SseErrorReason = EventTooLarge
49
50/**
51 * Error raised when decoding a Server-Sent Events stream fails.
52 *
53 * @category errors
54 * @since 4.0.0
55 */
56export class SseError extends Data.TaggedError("SseError")<{
57 readonly reason: SseErrorReason
58}> {
59 /**
60 * Marks this value as an SSE decoding error.
61 *
62 * @since 4.0.0
63 */
64 readonly [SseErrorTypeId] = SseErrorTypeId
65
66 /**
67 * Delegates the public message to the underlying SSE error reason.
68 *
69 * @since 4.0.0
70 */
71 override get message() {
72 return this.reason.message
73 }
74}
75
76/**
77 * Options for decoding Server-Sent Events streams.

Callers 11

decodeSchemaFunction · 0.70
decodeDataSchemaFunction · 0.70
findOneFunction · 0.50
findOneOptionFunction · 0.50
makeSchemaPrimitiveFunction · 0.50
fileSchemaFunction · 0.50
LanguageModel.tsFile · 0.50
McpServer.tsFile · 0.50
registerPromptFunction · 0.50
getFunction · 0.50
sendFunction · 0.50

Calls 6

syncMethod · 0.80
pushMethod · 0.80
feedMethod · 0.80
makeParserFunction · 0.70
succeedMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…