eutaxy 0.12.0 → 0.14.0
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/README.md +11 -8
- package/dist/aws.mjs +5 -5
- package/dist/bin.mjs +1 -2
- package/dist/bin.mjs.map +1 -1
- package/dist/{checksum-DJbbDJA0.mjs → checksum-75EliDEr.mjs} +5 -5
- package/dist/{checksum-DJbbDJA0.mjs.map → checksum-75EliDEr.mjs.map} +1 -1
- package/dist/{src-DIG0_CjU.mjs → cli-BppjMaqL.mjs} +690 -4113
- package/dist/cli-BppjMaqL.mjs.map +1 -0
- package/dist/cli.mjs +1 -2
- package/dist/cloudflare.d.mts +245 -84
- package/dist/cloudflare.d.mts.map +1 -1
- package/dist/cloudflare.mjs +3 -3
- package/dist/{delivery-invariants-Br29H7Rg.mjs → delivery-invariants-_T9ZMwOJ.mjs} +2 -2
- package/dist/{delivery-invariants-Br29H7Rg.mjs.map → delivery-invariants-_T9ZMwOJ.mjs.map} +1 -1
- package/dist/{event-streams-eH6Jim9p.mjs → event-streams-lXGVdHFn.mjs} +2 -2
- package/dist/{event-streams-eH6Jim9p.mjs.map → event-streams-lXGVdHFn.mjs.map} +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/provers-DS44OeEm.mjs +83 -0
- package/dist/provers-DS44OeEm.mjs.map +1 -0
- package/dist/{src-CWVQEhTr.mjs → src-ClXnIi6O.mjs} +3 -83
- package/dist/src-ClXnIi6O.mjs.map +1 -0
- package/dist/{src-DGh7w877.mjs → src-DPCF2XGv.mjs} +103 -16
- package/dist/src-DPCF2XGv.mjs.map +1 -0
- package/dist/workerd-DVJ8eCLI.mjs +5200 -0
- package/dist/workerd-DVJ8eCLI.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/cli-BFTyLLRF.mjs +0 -2
- package/dist/src-CWVQEhTr.mjs.map +0 -1
- package/dist/src-DGh7w877.mjs.map +0 -1
- package/dist/src-DIG0_CjU.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-streams-eH6Jim9p.mjs","names":["Crc32","Crc32","EventStreamMarshaller","UniversalEventStreamMarshaller"],"sources":["../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/Int64.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/splitMessage.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/EventStreamCodec.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/MessageDecoderStream.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/MessageEncoderStream.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageDecoderStream.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageEncoderStream.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getChunkedStream.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getUnmarshalledStream.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/EventStreamMarshaller.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde/EventStreamMarshaller.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/index.js"],"sourcesContent":["import { toHex } from \"@smithy/core/serde\";\nexport class Int64 {\n bytes;\n constructor(bytes) {\n this.bytes = bytes;\n if (bytes.byteLength !== 8) {\n throw new Error(\"Int64 buffers must be exactly 8 bytes\");\n }\n }\n static fromNumber(number) {\n if (number > 9_223_372_036_854_775_807 || number < -9_223_372_036_854_775_808) {\n throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);\n }\n const bytes = new Uint8Array(8);\n for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) {\n bytes[i] = remaining;\n }\n if (number < 0) {\n negate(bytes);\n }\n return new Int64(bytes);\n }\n valueOf() {\n const bytes = this.bytes.slice(0);\n const negative = bytes[0] & 0b10000000;\n if (negative) {\n negate(bytes);\n }\n return parseInt(toHex(bytes), 16) * (negative ? -1 : 1);\n }\n toString() {\n return String(this.valueOf());\n }\n}\nfunction negate(bytes) {\n for (let i = 0; i < 8; i++) {\n bytes[i] ^= 0xff;\n }\n for (let i = 7; i > -1; i--) {\n bytes[i]++;\n if (bytes[i] !== 0)\n break;\n }\n}\n","import { hasOwn } from \"@smithy/core/transport\";\nimport { fromHex, toHex } from \"@smithy/core/serde\";\nimport { Int64 } from \"./Int64\";\nexport class HeaderMarshaller {\n toUtf8;\n fromUtf8;\n constructor(toUtf8, fromUtf8) {\n this.toUtf8 = toUtf8;\n this.fromUtf8 = fromUtf8;\n }\n format(headers) {\n const chunks = [];\n for (const headerName in headers) {\n if (!hasOwn(headers, headerName))\n continue;\n const bytes = this.fromUtf8(headerName);\n if (bytes.byteLength > 255) {\n throw new Error(`@smithy/core/event-streams - header name exceeds 255 bytes: ${bytes.byteLength}`);\n }\n chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));\n }\n const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0));\n let position = 0;\n for (const chunk of chunks) {\n out.set(chunk, position);\n position += chunk.byteLength;\n }\n return out;\n }\n formatHeaderValue(header) {\n switch (header.type) {\n case \"boolean\":\n return Uint8Array.from([header.value ? 0 : 1]);\n case \"byte\":\n return Uint8Array.from([2, header.value]);\n case \"short\":\n const shortView = new DataView(new ArrayBuffer(3));\n shortView.setUint8(0, 3);\n shortView.setInt16(1, header.value, false);\n return new Uint8Array(shortView.buffer);\n case \"integer\":\n const intView = new DataView(new ArrayBuffer(5));\n intView.setUint8(0, 4);\n intView.setInt32(1, header.value, false);\n return new Uint8Array(intView.buffer);\n case \"long\":\n const longBytes = new Uint8Array(9);\n longBytes[0] = 5;\n longBytes.set(header.value.bytes, 1);\n return longBytes;\n case \"binary\":\n if (header.value.byteLength > MAX_HEADER_VALUE_BYTES) {\n throw new Error(`@smithy/core/event-streams - header value (binary) exceeds ${MAX_HEADER_VALUE_BYTES} bytes: ${header.value.byteLength}`);\n }\n const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));\n binView.setUint8(0, 6);\n binView.setUint16(1, header.value.byteLength, false);\n const binBytes = new Uint8Array(binView.buffer);\n binBytes.set(header.value, 3);\n return binBytes;\n case \"string\":\n const utf8Bytes = this.fromUtf8(header.value);\n if (utf8Bytes.byteLength > MAX_HEADER_VALUE_BYTES) {\n throw new Error(`@smithy/core/event-streams - header value (string) exceeds ${MAX_HEADER_VALUE_BYTES} bytes: ${utf8Bytes.byteLength}`);\n }\n const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));\n strView.setUint8(0, 7);\n strView.setUint16(1, utf8Bytes.byteLength, false);\n const strBytes = new Uint8Array(strView.buffer);\n strBytes.set(utf8Bytes, 3);\n return strBytes;\n case \"timestamp\":\n const tsBytes = new Uint8Array(9);\n tsBytes[0] = 8;\n tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1);\n return tsBytes;\n case \"uuid\":\n if (!UUID_PATTERN.test(header.value)) {\n throw new Error(`Invalid UUID received: ${header.value}`);\n }\n const uuidBytes = new Uint8Array(17);\n uuidBytes[0] = 9;\n uuidBytes.set(fromHex(header.value.replace(/-/g, \"\")), 1);\n return uuidBytes;\n }\n }\n parse(headers) {\n const out = {};\n let position = 0;\n while (position < headers.byteLength) {\n const nameLength = headers.getUint8(position++);\n const name = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength));\n position += nameLength;\n switch (headers.getUint8(position++)) {\n case 0:\n out[name] = {\n type: BOOLEAN_TAG,\n value: true,\n };\n break;\n case 1:\n out[name] = {\n type: BOOLEAN_TAG,\n value: false,\n };\n break;\n case 2:\n out[name] = {\n type: BYTE_TAG,\n value: headers.getInt8(position++),\n };\n break;\n case 3:\n out[name] = {\n type: SHORT_TAG,\n value: headers.getInt16(position, false),\n };\n position += 2;\n break;\n case 4:\n out[name] = {\n type: INT_TAG,\n value: headers.getInt32(position, false),\n };\n position += 4;\n break;\n case 5:\n out[name] = {\n type: LONG_TAG,\n value: new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)),\n };\n position += 8;\n break;\n case 6:\n const binaryLength = headers.getUint16(position, false);\n position += 2;\n out[name] = {\n type: BINARY_TAG,\n value: new Uint8Array(headers.buffer, headers.byteOffset + position, binaryLength),\n };\n position += binaryLength;\n break;\n case 7:\n const stringLength = headers.getUint16(position, false);\n position += 2;\n out[name] = {\n type: STRING_TAG,\n value: this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, stringLength)),\n };\n position += stringLength;\n break;\n case 8:\n out[name] = {\n type: TIMESTAMP_TAG,\n value: new Date(new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf()),\n };\n position += 8;\n break;\n case 9:\n const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16);\n position += 16;\n out[name] = {\n type: UUID_TAG,\n value: `${toHex(uuidBytes.subarray(0, 4))}-${toHex(uuidBytes.subarray(4, 6))}-${toHex(uuidBytes.subarray(6, 8))}-${toHex(uuidBytes.subarray(8, 10))}-${toHex(uuidBytes.subarray(10))}`,\n };\n break;\n default:\n throw new Error(`Unrecognized header type tag`);\n }\n }\n return out;\n }\n}\nvar HEADER_VALUE_TYPE;\n(function (HEADER_VALUE_TYPE) {\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"boolTrue\"] = 0] = \"boolTrue\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"boolFalse\"] = 1] = \"boolFalse\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"byte\"] = 2] = \"byte\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"short\"] = 3] = \"short\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"integer\"] = 4] = \"integer\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"long\"] = 5] = \"long\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"byteArray\"] = 6] = \"byteArray\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"string\"] = 7] = \"string\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"timestamp\"] = 8] = \"timestamp\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"uuid\"] = 9] = \"uuid\";\n})(HEADER_VALUE_TYPE || (HEADER_VALUE_TYPE = {}));\nconst BOOLEAN_TAG = \"boolean\";\nconst BYTE_TAG = \"byte\";\nconst SHORT_TAG = \"short\";\nconst INT_TAG = \"integer\";\nconst LONG_TAG = \"long\";\nconst BINARY_TAG = \"binary\";\nconst STRING_TAG = \"string\";\nconst TIMESTAMP_TAG = \"timestamp\";\nconst UUID_TAG = \"uuid\";\nconst UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;\nconst MAX_HEADER_VALUE_BYTES = 32767;\n","import { Crc32 } from \"@smithy/core/checksum\";\nconst PRELUDE_MEMBER_LENGTH = 4;\nconst PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2;\nconst CHECKSUM_LENGTH = 4;\nconst MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2;\nexport function splitMessage({ byteLength, byteOffset, buffer }) {\n if (byteLength < MINIMUM_MESSAGE_LENGTH) {\n throw new Error(\"Provided message too short to accommodate event stream message overhead\");\n }\n const view = new DataView(buffer, byteOffset, byteLength);\n const messageLength = view.getUint32(0, false);\n if (byteLength !== messageLength) {\n throw new Error(\"Reported message length does not match received message length\");\n }\n const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false);\n const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false);\n const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false);\n const checksummer = new Crc32();\n checksummer.update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH));\n if (expectedPreludeChecksum !== checksummer.digestSync()) {\n throw new Error(`The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digestSync()})`);\n }\n checksummer.update(new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH, byteLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH)));\n if (expectedMessageChecksum !== checksummer.digestSync()) {\n throw new Error(`The message checksum (${checksummer.digestSync()}) did not match the expected value of ${expectedMessageChecksum}`);\n }\n return {\n headers: new DataView(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength),\n body: new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH + headerLength, messageLength - headerLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH + CHECKSUM_LENGTH)),\n };\n}\n","import { Crc32 } from \"@smithy/core/checksum\";\nimport { HeaderMarshaller } from \"./HeaderMarshaller\";\nimport { splitMessage } from \"./splitMessage\";\nexport class EventStreamCodec {\n headerMarshaller;\n messageBuffer;\n isEndOfStream;\n constructor(toUtf8, fromUtf8) {\n this.headerMarshaller = new HeaderMarshaller(toUtf8, fromUtf8);\n this.messageBuffer = [];\n this.isEndOfStream = false;\n }\n feed(message) {\n this.messageBuffer.push(this.decode(message));\n }\n endOfStream() {\n this.isEndOfStream = true;\n }\n getMessage() {\n const message = this.messageBuffer.pop();\n const isEndOfStream = this.isEndOfStream;\n return {\n getMessage() {\n return message;\n },\n isEndOfStream() {\n return isEndOfStream;\n },\n };\n }\n getAvailableMessages() {\n const messages = this.messageBuffer;\n this.messageBuffer = [];\n const isEndOfStream = this.isEndOfStream;\n return {\n getMessages() {\n return messages;\n },\n isEndOfStream() {\n return isEndOfStream;\n },\n };\n }\n encode({ headers: rawHeaders, body }) {\n const headers = this.headerMarshaller.format(rawHeaders);\n const length = headers.byteLength + body.byteLength + 16;\n const out = new Uint8Array(length);\n const view = new DataView(out.buffer, out.byteOffset, out.byteLength);\n const checksum = new Crc32();\n view.setUint32(0, length, false);\n view.setUint32(4, headers.byteLength, false);\n checksum.update(out.subarray(0, 8));\n view.setUint32(8, checksum.digestSync(), false);\n out.set(headers, 12);\n out.set(body, headers.byteLength + 12);\n checksum.update(out.subarray(8, length - 4));\n view.setUint32(length - 4, checksum.digestSync(), false);\n return out;\n }\n decode(message) {\n const { headers, body } = splitMessage(message);\n return { headers: this.headerMarshaller.parse(headers), body };\n }\n formatHeaders(rawHeaders) {\n return this.headerMarshaller.format(rawHeaders);\n }\n}\n","export class MessageDecoderStream {\n options;\n constructor(options) {\n this.options = options;\n }\n [Symbol.asyncIterator]() {\n return this.asyncIterator();\n }\n async *asyncIterator() {\n for await (const bytes of this.options.inputStream) {\n const decoded = this.options.decoder.decode(bytes);\n yield decoded;\n }\n }\n}\n","export class MessageEncoderStream {\n options;\n constructor(options) {\n this.options = options;\n }\n [Symbol.asyncIterator]() {\n return this.asyncIterator();\n }\n async *asyncIterator() {\n for await (const msg of this.options.messageStream) {\n const encoded = this.options.encoder.encode(msg);\n yield encoded;\n }\n if (this.options.includeEndFrame) {\n yield new Uint8Array(0);\n }\n }\n}\n","export class SmithyMessageDecoderStream {\n options;\n constructor(options) {\n this.options = options;\n }\n [Symbol.asyncIterator]() {\n return this.asyncIterator();\n }\n async *asyncIterator() {\n for await (const message of this.options.messageStream) {\n const deserialized = await this.options.deserializer(message);\n if (deserialized === undefined)\n continue;\n yield deserialized;\n }\n }\n}\n","export class SmithyMessageEncoderStream {\n options;\n constructor(options) {\n this.options = options;\n }\n [Symbol.asyncIterator]() {\n return this.asyncIterator();\n }\n async *asyncIterator() {\n for await (const chunk of this.options.inputStream) {\n const payloadBuf = this.options.serializer(chunk);\n yield payloadBuf;\n }\n }\n}\n","export function getChunkedStream(source) {\n let currentMessageTotalLength = 0;\n let currentMessagePendingLength = 0;\n let currentMessage = null;\n let messageLengthBuffer = null;\n const allocateMessage = (size) => {\n if (typeof size !== \"number\") {\n throw new Error(\"Attempted to allocate an event message where size was not a number: \" + size);\n }\n currentMessageTotalLength = size;\n currentMessagePendingLength = 4;\n currentMessage = new Uint8Array(size);\n const currentMessageView = new DataView(currentMessage.buffer);\n currentMessageView.setUint32(0, size, false);\n };\n const iterator = async function* () {\n const sourceIterator = source[Symbol.asyncIterator]();\n while (true) {\n const { value, done } = await sourceIterator.next();\n if (done) {\n if (!currentMessageTotalLength) {\n return;\n }\n else if (currentMessageTotalLength === currentMessagePendingLength) {\n yield currentMessage;\n }\n else {\n throw new Error(\"Truncated event message received.\");\n }\n return;\n }\n const chunkLength = value.length;\n let currentOffset = 0;\n while (currentOffset < chunkLength) {\n if (!currentMessage) {\n const bytesRemaining = chunkLength - currentOffset;\n if (!messageLengthBuffer) {\n messageLengthBuffer = new Uint8Array(4);\n }\n const numBytesForTotal = Math.min(4 - currentMessagePendingLength, bytesRemaining);\n messageLengthBuffer.set(value.slice(currentOffset, currentOffset + numBytesForTotal), currentMessagePendingLength);\n currentMessagePendingLength += numBytesForTotal;\n currentOffset += numBytesForTotal;\n if (currentMessagePendingLength < 4) {\n break;\n }\n allocateMessage(new DataView(messageLengthBuffer.buffer).getUint32(0, false));\n messageLengthBuffer = null;\n }\n const numBytesToWrite = Math.min(currentMessageTotalLength - currentMessagePendingLength, chunkLength - currentOffset);\n currentMessage.set(value.slice(currentOffset, currentOffset + numBytesToWrite), currentMessagePendingLength);\n currentMessagePendingLength += numBytesToWrite;\n currentOffset += numBytesToWrite;\n if (currentMessageTotalLength && currentMessageTotalLength === currentMessagePendingLength) {\n yield currentMessage;\n currentMessage = null;\n currentMessageTotalLength = 0;\n currentMessagePendingLength = 0;\n }\n }\n }\n };\n return {\n [Symbol.asyncIterator]: iterator,\n };\n}\n","export function getUnmarshalledStream(source, options) {\n const messageUnmarshaller = getMessageUnmarshaller(options.deserializer, options.toUtf8);\n return {\n [Symbol.asyncIterator]: async function* () {\n for await (const chunk of source) {\n const message = options.eventStreamCodec.decode(chunk);\n const type = await messageUnmarshaller(message);\n if (type === undefined)\n continue;\n yield type;\n }\n },\n };\n}\nexport function getMessageUnmarshaller(deserializer, toUtf8) {\n return async function (message) {\n const { value: messageType } = message.headers[\":message-type\"];\n if (messageType === \"error\") {\n const unmodeledError = new Error(message.headers[\":error-message\"].value || \"UnknownError\");\n unmodeledError.name = message.headers[\":error-code\"].value;\n throw unmodeledError;\n }\n else if (messageType === \"exception\") {\n const code = message.headers[\":exception-type\"].value;\n const exception = { [code]: message };\n const deserializedException = await deserializer(exception);\n if (deserializedException.$unknown) {\n const error = new Error(toUtf8(message.body));\n error.name = code;\n throw error;\n }\n throw deserializedException[code];\n }\n else if (messageType === \"event\") {\n const event = {\n [message.headers[\":event-type\"].value]: message,\n };\n const deserialized = await deserializer(event);\n if (deserialized.$unknown)\n return;\n return deserialized;\n }\n else {\n throw Error(`Unrecognizable event type: ${message.headers[\":event-type\"].value}`);\n }\n };\n}\n","import { EventStreamCodec } from \"../eventstream-codec/EventStreamCodec\";\nimport { MessageDecoderStream } from \"../eventstream-codec/MessageDecoderStream\";\nimport { MessageEncoderStream } from \"../eventstream-codec/MessageEncoderStream\";\nimport { SmithyMessageDecoderStream } from \"../eventstream-codec/SmithyMessageDecoderStream\";\nimport { SmithyMessageEncoderStream } from \"../eventstream-codec/SmithyMessageEncoderStream\";\nimport { getChunkedStream } from \"./getChunkedStream\";\nimport { getMessageUnmarshaller } from \"./getUnmarshalledStream\";\nexport class EventStreamMarshaller {\n eventStreamCodec;\n utfEncoder;\n constructor({ utf8Encoder, utf8Decoder }) {\n this.eventStreamCodec = new EventStreamCodec(utf8Encoder, utf8Decoder);\n this.utfEncoder = utf8Encoder;\n }\n deserialize(body, deserializer) {\n const inputStream = getChunkedStream(body);\n return new SmithyMessageDecoderStream({\n messageStream: new MessageDecoderStream({ inputStream, decoder: this.eventStreamCodec }),\n deserializer: getMessageUnmarshaller(deserializer, this.utfEncoder),\n });\n }\n serialize(inputStream, serializer) {\n return new MessageEncoderStream({\n messageStream: new SmithyMessageEncoderStream({ inputStream, serializer }),\n encoder: this.eventStreamCodec,\n includeEndFrame: true,\n });\n }\n}\nexport const eventStreamSerdeProvider = (options) => new EventStreamMarshaller(options);\n","import { Readable } from \"node:stream\";\nimport { EventStreamMarshaller as UniversalEventStreamMarshaller } from \"../eventstream-serde-universal/EventStreamMarshaller\";\nexport class EventStreamMarshaller {\n universalMarshaller;\n constructor({ utf8Encoder, utf8Decoder }) {\n this.universalMarshaller = new UniversalEventStreamMarshaller({\n utf8Decoder,\n utf8Encoder,\n });\n }\n deserialize(body, deserializer) {\n const bodyIterable = typeof body[Symbol.asyncIterator] === \"function\" ? body : readableToIterable(body);\n return this.universalMarshaller.deserialize(bodyIterable, deserializer);\n }\n serialize(input, serializer) {\n return Readable.from(this.universalMarshaller.serialize(input, serializer));\n }\n}\nexport const eventStreamSerdeProvider = (options) => new EventStreamMarshaller(options);\nexport async function* readableToIterable(readStream) {\n let streamEnded = false;\n let generationEnded = false;\n const records = new Array();\n readStream.on(\"error\", (err) => {\n if (!streamEnded) {\n streamEnded = true;\n }\n if (err) {\n throw err;\n }\n });\n readStream.on(\"data\", (data) => {\n records.push(data);\n });\n readStream.on(\"end\", () => {\n streamEnded = true;\n });\n while (!generationEnded) {\n const value = await new Promise((resolve) => setTimeout(() => resolve(records.shift()), 0));\n if (value) {\n yield value;\n }\n generationEnded = streamEnded && records.length === 0;\n }\n}\n","import { hasOwn } from \"@smithy/core/transport\";\nimport { TypeRegistry } from \"@smithy/core/schema\";\nimport { fromUtf8, toUtf8 } from \"@smithy/core/serde\";\nexport class EventStreamSerde {\n marshaller;\n serializer;\n deserializer;\n serdeContext;\n defaultContentType;\n compositeErrorRegistry;\n constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType, compositeErrorRegistry, }) {\n this.marshaller = marshaller;\n this.serializer = serializer;\n this.deserializer = deserializer;\n this.serdeContext = serdeContext;\n this.defaultContentType = defaultContentType;\n this.compositeErrorRegistry = compositeErrorRegistry;\n }\n async serializeEventStream({ eventStream, requestSchema, initialRequest, initialMessageType, }) {\n const marshaller = this.marshaller;\n const eventStreamMember = requestSchema.getEventStreamMember();\n const unionSchema = requestSchema.getMemberSchema(eventStreamMember);\n const serializer = this.serializer;\n const defaultContentType = this.defaultContentType;\n const initialRequestMarker = Symbol(\"initialRequestMarker\");\n const eventStreamIterable = {\n async *[Symbol.asyncIterator]() {\n if (initialRequest) {\n const headers = {\n \":event-type\": { type: \"string\", value: initialMessageType ?? \"initial-request\" },\n \":message-type\": { type: \"string\", value: \"event\" },\n \":content-type\": { type: \"string\", value: defaultContentType },\n };\n serializer.write(requestSchema, initialRequest);\n const body = serializer.flush();\n yield {\n [initialRequestMarker]: true,\n headers,\n body,\n };\n }\n for await (const page of eventStream) {\n yield page;\n }\n },\n };\n return marshaller.serialize(eventStreamIterable, (event) => {\n if (event[initialRequestMarker]) {\n return {\n headers: event.headers,\n body: event.body,\n };\n }\n let unionMember = \"\";\n for (const key in event) {\n if (!hasOwn(event, key))\n continue;\n if (key !== \"__type\") {\n unionMember = key;\n break;\n }\n }\n const { additionalHeaders, body, eventType, explicitPayloadContentType } = this.writeEventBody(unionMember, unionSchema, event);\n const headers = {\n \":event-type\": { type: \"string\", value: eventType },\n \":message-type\": { type: \"string\", value: \"event\" },\n \":content-type\": { type: \"string\", value: explicitPayloadContentType ?? defaultContentType },\n ...additionalHeaders,\n };\n return {\n headers,\n body,\n };\n });\n }\n async deserializeEventStream({ response, responseSchema, initialResponseContainer, initialMessageType, }) {\n const marshaller = this.marshaller;\n const eventStreamMember = responseSchema.getEventStreamMember();\n const unionSchema = responseSchema.getMemberSchema(eventStreamMember);\n const memberSchemas = unionSchema.getMemberSchemas();\n const initialResponseMarker = Symbol(\"initialResponseMarker\");\n const asyncIterable = marshaller.deserialize(response.body, async (event) => {\n let unionMember = \"\";\n for (const key in event) {\n if (!hasOwn(event, key))\n continue;\n if (key !== \"__type\") {\n unionMember = key;\n break;\n }\n }\n const body = event[unionMember].body;\n if (unionMember === (initialMessageType ?? \"initial-response\")) {\n const dataObject = await this.deserializer.read(responseSchema, body);\n delete dataObject[eventStreamMember];\n return {\n [initialResponseMarker]: true,\n ...dataObject,\n };\n }\n else if (unionMember in memberSchemas) {\n const eventStreamSchema = memberSchemas[unionMember];\n if (eventStreamSchema.isStructSchema()) {\n const out = {};\n let hasBindings = false;\n for (const [name, member] of eventStreamSchema.structIterator()) {\n const { eventHeader, eventPayload } = member.getMergedTraits();\n hasBindings = hasBindings || Boolean(eventHeader || eventPayload);\n if (eventPayload) {\n if (member.isBlobSchema()) {\n out[name] = body;\n }\n else if (member.isStringSchema()) {\n out[name] = (this.serdeContext?.utf8Encoder ?? toUtf8)(body);\n }\n else if (member.isStructSchema()) {\n out[name] = await this.deserializer.read(member, body);\n }\n }\n else if (eventHeader) {\n const value = event[unionMember].headers[name]?.value;\n if (value != null) {\n if (member.isNumericSchema()) {\n if (value && typeof value === \"object\" && \"bytes\" in value) {\n out[name] = BigInt(value.toString());\n }\n else {\n out[name] = Number(value);\n }\n }\n else {\n out[name] = value;\n }\n }\n }\n }\n return {\n [unionMember]: await this.readEventMember(eventStreamSchema, body, hasBindings, out),\n };\n }\n return {\n [unionMember]: await this.deserializer.read(eventStreamSchema, body),\n };\n }\n else {\n return {\n $unknown: event,\n };\n }\n });\n const asyncIterator = asyncIterable[Symbol.asyncIterator]();\n const firstEvent = await asyncIterator.next();\n if (firstEvent.done) {\n return asyncIterable;\n }\n if (firstEvent.value?.[initialResponseMarker]) {\n if (!responseSchema) {\n throw new Error(\"@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.\");\n }\n for (const key in firstEvent.value) {\n if (!hasOwn(firstEvent.value, key))\n continue;\n initialResponseContainer[key] = firstEvent.value[key];\n }\n }\n return {\n async *[Symbol.asyncIterator]() {\n if (!firstEvent?.value?.[initialResponseMarker]) {\n yield firstEvent.value;\n }\n while (true) {\n const { done, value } = await asyncIterator.next();\n if (done) {\n break;\n }\n yield value;\n }\n },\n };\n }\n async readEventMember(eventStreamSchema, body, hasBindings, out) {\n let ErrCtor;\n const staticStructuralSchema = eventStreamSchema.getSchema();\n if (Array.isArray(staticStructuralSchema) && staticStructuralSchema[0] === -3) {\n const namespace = staticStructuralSchema[1];\n const nsRegistry = TypeRegistry.for(namespace);\n this.compositeErrorRegistry?.copyFrom(nsRegistry);\n ErrCtor = (this.compositeErrorRegistry ?? nsRegistry)?.getErrorCtor(staticStructuralSchema);\n }\n const dataObject = hasBindings\n ? out\n : body.byteLength === 0\n ? {}\n : await this.deserializer.read(eventStreamSchema, body);\n if (ErrCtor) {\n const message = dataObject.message ?? dataObject.Message ?? \"Unknown\";\n const metadata = {};\n const $fault = eventStreamSchema.getMergedTraits().error;\n if ($fault) {\n metadata.$fault = $fault;\n }\n return Object.assign(new ErrCtor({}), metadata, {\n message,\n }, dataObject);\n }\n return dataObject;\n }\n writeEventBody(unionMember, unionSchema, event) {\n const serializer = this.serializer;\n let eventType = unionMember;\n let explicitPayloadMember = null;\n let explicitPayloadContentType;\n const isKnownSchema = (() => {\n const struct = unionSchema.getSchema();\n return struct[4].includes(unionMember);\n })();\n const additionalHeaders = {};\n if (!isKnownSchema) {\n const [type, value] = event[unionMember];\n eventType = type;\n serializer.write(15, value);\n }\n else {\n const eventSchema = unionSchema.getMemberSchema(unionMember);\n if (eventSchema.isStructSchema()) {\n for (const [memberName, memberSchema] of eventSchema.structIterator()) {\n const { eventHeader, eventPayload } = memberSchema.getMergedTraits();\n if (eventPayload) {\n explicitPayloadMember = memberName;\n }\n else if (eventHeader) {\n const value = event[unionMember][memberName];\n let type = \"binary\";\n if (memberSchema.isNumericSchema()) {\n if ((-2) ** 31 <= value && value <= 2 ** 31 - 1) {\n type = \"integer\";\n }\n else {\n type = \"long\";\n }\n }\n else if (memberSchema.isTimestampSchema()) {\n type = \"timestamp\";\n }\n else if (memberSchema.isStringSchema()) {\n type = \"string\";\n }\n else if (memberSchema.isBooleanSchema()) {\n type = \"boolean\";\n }\n if (value != null) {\n additionalHeaders[memberName] = {\n type,\n value,\n };\n delete event[unionMember][memberName];\n }\n }\n }\n if (explicitPayloadMember !== null) {\n const payloadSchema = eventSchema.getMemberSchema(explicitPayloadMember);\n if (payloadSchema.isBlobSchema()) {\n explicitPayloadContentType = \"application/octet-stream\";\n }\n else if (payloadSchema.isStringSchema()) {\n explicitPayloadContentType = \"text/plain\";\n }\n serializer.write(payloadSchema, event[unionMember][explicitPayloadMember]);\n }\n else {\n serializer.write(eventSchema, event[unionMember]);\n }\n }\n else if (eventSchema.isUnitSchema()) {\n serializer.write(eventSchema, {});\n }\n else {\n throw new Error(\"@smithy/core/event-streams - non-struct member not supported in event stream union.\");\n }\n }\n const messageSerialization = serializer.flush() ?? new Uint8Array();\n const body = typeof messageSerialization === \"string\"\n ? (this.serdeContext?.utf8Decoder ?? fromUtf8)(messageSerialization)\n : messageSerialization;\n return {\n body,\n eventType,\n explicitPayloadContentType,\n additionalHeaders,\n };\n }\n}\n","export { EventStreamCodec } from \"./eventstream-codec/EventStreamCodec\";\nexport { HeaderMarshaller } from \"./eventstream-codec/HeaderMarshaller\";\nexport { Int64 } from \"./eventstream-codec/Int64\";\nexport { MessageDecoderStream } from \"./eventstream-codec/MessageDecoderStream\";\nexport { MessageEncoderStream } from \"./eventstream-codec/MessageEncoderStream\";\nexport { SmithyMessageDecoderStream } from \"./eventstream-codec/SmithyMessageDecoderStream\";\nexport { SmithyMessageEncoderStream } from \"./eventstream-codec/SmithyMessageEncoderStream\";\nexport { EventStreamMarshaller, eventStreamSerdeProvider } from \"./eventstream-serde/EventStreamMarshaller\";\nexport { readableStreamToIterable, iterableToReadableStream } from \"./eventstream-serde/utils\";\nexport { EventStreamMarshaller as UniversalEventStreamMarshaller, eventStreamSerdeProvider as universalEventStreamSerdeProvider, } from \"./eventstream-serde-universal/EventStreamMarshaller\";\nexport { getChunkedStream } from \"./eventstream-serde-universal/getChunkedStream\";\nexport { getUnmarshalledStream, getMessageUnmarshaller } from \"./eventstream-serde-universal/getUnmarshalledStream\";\nexport { resolveEventStreamSerdeConfig } from \"./eventstream-serde-config-resolver/EventStreamSerdeConfig\";\nexport { EventStreamSerde } from \"./EventStreamSerde\";\n"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13],"mappings":";;;;AAkCA,SAAS,OAAO,OAAO;CACnB,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KACnB,MAAM,MAAM;CAEhB,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,KAAK;EACzB,MAAM,EAAE;EACR,IAAI,MAAM,OAAO,GACb;CACR;AACJ;;;CA3C0C,WAAA;CAC7B,QAAb,MAAa,MAAM;EACf;EACA,YAAY,OAAO;GACf,KAAK,QAAQ;GACb,IAAI,MAAM,eAAe,GACrB,MAAM,IAAI,MAAM,uCAAuC;EAE/D;EACA,OAAO,WAAW,QAAQ;GACtB,IAAI,SAAS,sBAA6B,SAAS,qBAC/C,MAAM,IAAI,MAAM,GAAG,OAAO,oEAAoE;GAElG,MAAM,wBAAQ,IAAI,WAAW,CAAC;GAC9B,KAAK,IAAI,IAAI,GA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AgB;MACnE,IAAI,cACA,wBAAwB;WAEvB,IAAI,aAAa;OAClB,MAAM,QAAQ,MAAM,YAAY,CAAC;OACjC,IAAI,OAAO;OACX,IAAI,aAAa,gBAAgB,GAAG;QAChC,IAAK,QAAO,MAAM,SAAS,SAAS,KAAK,KAAK,GAC1C,OAAO;aAGP,OAAO;OAEf,OACK,IAAI,aAAa,kBAAkB,GACpC,OAAO;YAEN,IAAI,aAAa,eAAe,GACjC,OAAO;YAEN,IAAI,aAAa,gBAAgB,GAClC,OAAO;OAEX,IAAI,SAAS,MAAM;QACf,kBAAkB,cAAc;SAC5B;SACA;QACJ;QACA,OAAO,MAAM,YAAY,CAAC;OAC9B;MACJ;KACJ;KACA,IAAI,0BAA0B,MAAM;MAChC,MAAM,gBAAgB,YAAY,gBAAgB,qBAAqB;MACvE,IAAI,cAAc,aAAa,GAC3B,6BAA6B;WAE5B,IAAI,cAAc,eAAe,GAClC,6BAA6B;MAEjC,WAAW,MAAM,eAAe,MAAM,YAAY,CAAC,sBAAsB;KAC7E,OAEI,WAAW,MAAM,aAAa,MAAM,YAAY;IAExD,OACK,IAAI,YAAY,aAAa,GAC9B,WAAW,MAAM,aAAa,CAAC,CAAC;SAGhC,MAAM,IAAI,MAAM,qFAAqF;GAE7G;GACA,MAAM,uBAAuB,WAAW,MAAM,qBAAK,IAAI,WAAW;GAIlE,OAAO;IACH,MAJS,OAAO,yBAAyB,YACtC,KAAK,cAAc,eAAe,SAAA,CAAU,oBAAoB,IACjE;IAGF;IACA;IACA;GACJ;EACJ;CACJ;;;;;;;;;;CC5R2G,2BAAA;;CAMtD,sBAAA"}
|
|
1
|
+
{"version":3,"file":"event-streams-lXGVdHFn.mjs","names":["Crc32","Crc32","EventStreamMarshaller","UniversalEventStreamMarshaller"],"sources":["../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/Int64.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/splitMessage.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/EventStreamCodec.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/MessageDecoderStream.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/MessageEncoderStream.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageDecoderStream.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageEncoderStream.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getChunkedStream.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getUnmarshalledStream.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/EventStreamMarshaller.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde/EventStreamMarshaller.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js","../../../node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/event-streams/index.js"],"sourcesContent":["import { toHex } from \"@smithy/core/serde\";\nexport class Int64 {\n bytes;\n constructor(bytes) {\n this.bytes = bytes;\n if (bytes.byteLength !== 8) {\n throw new Error(\"Int64 buffers must be exactly 8 bytes\");\n }\n }\n static fromNumber(number) {\n if (number > 9_223_372_036_854_775_807 || number < -9_223_372_036_854_775_808) {\n throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);\n }\n const bytes = new Uint8Array(8);\n for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) {\n bytes[i] = remaining;\n }\n if (number < 0) {\n negate(bytes);\n }\n return new Int64(bytes);\n }\n valueOf() {\n const bytes = this.bytes.slice(0);\n const negative = bytes[0] & 0b10000000;\n if (negative) {\n negate(bytes);\n }\n return parseInt(toHex(bytes), 16) * (negative ? -1 : 1);\n }\n toString() {\n return String(this.valueOf());\n }\n}\nfunction negate(bytes) {\n for (let i = 0; i < 8; i++) {\n bytes[i] ^= 0xff;\n }\n for (let i = 7; i > -1; i--) {\n bytes[i]++;\n if (bytes[i] !== 0)\n break;\n }\n}\n","import { hasOwn } from \"@smithy/core/transport\";\nimport { fromHex, toHex } from \"@smithy/core/serde\";\nimport { Int64 } from \"./Int64\";\nexport class HeaderMarshaller {\n toUtf8;\n fromUtf8;\n constructor(toUtf8, fromUtf8) {\n this.toUtf8 = toUtf8;\n this.fromUtf8 = fromUtf8;\n }\n format(headers) {\n const chunks = [];\n for (const headerName in headers) {\n if (!hasOwn(headers, headerName))\n continue;\n const bytes = this.fromUtf8(headerName);\n if (bytes.byteLength > 255) {\n throw new Error(`@smithy/core/event-streams - header name exceeds 255 bytes: ${bytes.byteLength}`);\n }\n chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));\n }\n const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0));\n let position = 0;\n for (const chunk of chunks) {\n out.set(chunk, position);\n position += chunk.byteLength;\n }\n return out;\n }\n formatHeaderValue(header) {\n switch (header.type) {\n case \"boolean\":\n return Uint8Array.from([header.value ? 0 : 1]);\n case \"byte\":\n return Uint8Array.from([2, header.value]);\n case \"short\":\n const shortView = new DataView(new ArrayBuffer(3));\n shortView.setUint8(0, 3);\n shortView.setInt16(1, header.value, false);\n return new Uint8Array(shortView.buffer);\n case \"integer\":\n const intView = new DataView(new ArrayBuffer(5));\n intView.setUint8(0, 4);\n intView.setInt32(1, header.value, false);\n return new Uint8Array(intView.buffer);\n case \"long\":\n const longBytes = new Uint8Array(9);\n longBytes[0] = 5;\n longBytes.set(header.value.bytes, 1);\n return longBytes;\n case \"binary\":\n if (header.value.byteLength > MAX_HEADER_VALUE_BYTES) {\n throw new Error(`@smithy/core/event-streams - header value (binary) exceeds ${MAX_HEADER_VALUE_BYTES} bytes: ${header.value.byteLength}`);\n }\n const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));\n binView.setUint8(0, 6);\n binView.setUint16(1, header.value.byteLength, false);\n const binBytes = new Uint8Array(binView.buffer);\n binBytes.set(header.value, 3);\n return binBytes;\n case \"string\":\n const utf8Bytes = this.fromUtf8(header.value);\n if (utf8Bytes.byteLength > MAX_HEADER_VALUE_BYTES) {\n throw new Error(`@smithy/core/event-streams - header value (string) exceeds ${MAX_HEADER_VALUE_BYTES} bytes: ${utf8Bytes.byteLength}`);\n }\n const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));\n strView.setUint8(0, 7);\n strView.setUint16(1, utf8Bytes.byteLength, false);\n const strBytes = new Uint8Array(strView.buffer);\n strBytes.set(utf8Bytes, 3);\n return strBytes;\n case \"timestamp\":\n const tsBytes = new Uint8Array(9);\n tsBytes[0] = 8;\n tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1);\n return tsBytes;\n case \"uuid\":\n if (!UUID_PATTERN.test(header.value)) {\n throw new Error(`Invalid UUID received: ${header.value}`);\n }\n const uuidBytes = new Uint8Array(17);\n uuidBytes[0] = 9;\n uuidBytes.set(fromHex(header.value.replace(/-/g, \"\")), 1);\n return uuidBytes;\n }\n }\n parse(headers) {\n const out = {};\n let position = 0;\n while (position < headers.byteLength) {\n const nameLength = headers.getUint8(position++);\n const name = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength));\n position += nameLength;\n switch (headers.getUint8(position++)) {\n case 0:\n out[name] = {\n type: BOOLEAN_TAG,\n value: true,\n };\n break;\n case 1:\n out[name] = {\n type: BOOLEAN_TAG,\n value: false,\n };\n break;\n case 2:\n out[name] = {\n type: BYTE_TAG,\n value: headers.getInt8(position++),\n };\n break;\n case 3:\n out[name] = {\n type: SHORT_TAG,\n value: headers.getInt16(position, false),\n };\n position += 2;\n break;\n case 4:\n out[name] = {\n type: INT_TAG,\n value: headers.getInt32(position, false),\n };\n position += 4;\n break;\n case 5:\n out[name] = {\n type: LONG_TAG,\n value: new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)),\n };\n position += 8;\n break;\n case 6:\n const binaryLength = headers.getUint16(position, false);\n position += 2;\n out[name] = {\n type: BINARY_TAG,\n value: new Uint8Array(headers.buffer, headers.byteOffset + position, binaryLength),\n };\n position += binaryLength;\n break;\n case 7:\n const stringLength = headers.getUint16(position, false);\n position += 2;\n out[name] = {\n type: STRING_TAG,\n value: this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, stringLength)),\n };\n position += stringLength;\n break;\n case 8:\n out[name] = {\n type: TIMESTAMP_TAG,\n value: new Date(new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf()),\n };\n position += 8;\n break;\n case 9:\n const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16);\n position += 16;\n out[name] = {\n type: UUID_TAG,\n value: `${toHex(uuidBytes.subarray(0, 4))}-${toHex(uuidBytes.subarray(4, 6))}-${toHex(uuidBytes.subarray(6, 8))}-${toHex(uuidBytes.subarray(8, 10))}-${toHex(uuidBytes.subarray(10))}`,\n };\n break;\n default:\n throw new Error(`Unrecognized header type tag`);\n }\n }\n return out;\n }\n}\nvar HEADER_VALUE_TYPE;\n(function (HEADER_VALUE_TYPE) {\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"boolTrue\"] = 0] = \"boolTrue\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"boolFalse\"] = 1] = \"boolFalse\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"byte\"] = 2] = \"byte\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"short\"] = 3] = \"short\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"integer\"] = 4] = \"integer\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"long\"] = 5] = \"long\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"byteArray\"] = 6] = \"byteArray\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"string\"] = 7] = \"string\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"timestamp\"] = 8] = \"timestamp\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"uuid\"] = 9] = \"uuid\";\n})(HEADER_VALUE_TYPE || (HEADER_VALUE_TYPE = {}));\nconst BOOLEAN_TAG = \"boolean\";\nconst BYTE_TAG = \"byte\";\nconst SHORT_TAG = \"short\";\nconst INT_TAG = \"integer\";\nconst LONG_TAG = \"long\";\nconst BINARY_TAG = \"binary\";\nconst STRING_TAG = \"string\";\nconst TIMESTAMP_TAG = \"timestamp\";\nconst UUID_TAG = \"uuid\";\nconst UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;\nconst MAX_HEADER_VALUE_BYTES = 32767;\n","import { Crc32 } from \"@smithy/core/checksum\";\nconst PRELUDE_MEMBER_LENGTH = 4;\nconst PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2;\nconst CHECKSUM_LENGTH = 4;\nconst MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2;\nexport function splitMessage({ byteLength, byteOffset, buffer }) {\n if (byteLength < MINIMUM_MESSAGE_LENGTH) {\n throw new Error(\"Provided message too short to accommodate event stream message overhead\");\n }\n const view = new DataView(buffer, byteOffset, byteLength);\n const messageLength = view.getUint32(0, false);\n if (byteLength !== messageLength) {\n throw new Error(\"Reported message length does not match received message length\");\n }\n const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false);\n const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false);\n const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false);\n const checksummer = new Crc32();\n checksummer.update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH));\n if (expectedPreludeChecksum !== checksummer.digestSync()) {\n throw new Error(`The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digestSync()})`);\n }\n checksummer.update(new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH, byteLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH)));\n if (expectedMessageChecksum !== checksummer.digestSync()) {\n throw new Error(`The message checksum (${checksummer.digestSync()}) did not match the expected value of ${expectedMessageChecksum}`);\n }\n return {\n headers: new DataView(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength),\n body: new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH + headerLength, messageLength - headerLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH + CHECKSUM_LENGTH)),\n };\n}\n","import { Crc32 } from \"@smithy/core/checksum\";\nimport { HeaderMarshaller } from \"./HeaderMarshaller\";\nimport { splitMessage } from \"./splitMessage\";\nexport class EventStreamCodec {\n headerMarshaller;\n messageBuffer;\n isEndOfStream;\n constructor(toUtf8, fromUtf8) {\n this.headerMarshaller = new HeaderMarshaller(toUtf8, fromUtf8);\n this.messageBuffer = [];\n this.isEndOfStream = false;\n }\n feed(message) {\n this.messageBuffer.push(this.decode(message));\n }\n endOfStream() {\n this.isEndOfStream = true;\n }\n getMessage() {\n const message = this.messageBuffer.pop();\n const isEndOfStream = this.isEndOfStream;\n return {\n getMessage() {\n return message;\n },\n isEndOfStream() {\n return isEndOfStream;\n },\n };\n }\n getAvailableMessages() {\n const messages = this.messageBuffer;\n this.messageBuffer = [];\n const isEndOfStream = this.isEndOfStream;\n return {\n getMessages() {\n return messages;\n },\n isEndOfStream() {\n return isEndOfStream;\n },\n };\n }\n encode({ headers: rawHeaders, body }) {\n const headers = this.headerMarshaller.format(rawHeaders);\n const length = headers.byteLength + body.byteLength + 16;\n const out = new Uint8Array(length);\n const view = new DataView(out.buffer, out.byteOffset, out.byteLength);\n const checksum = new Crc32();\n view.setUint32(0, length, false);\n view.setUint32(4, headers.byteLength, false);\n checksum.update(out.subarray(0, 8));\n view.setUint32(8, checksum.digestSync(), false);\n out.set(headers, 12);\n out.set(body, headers.byteLength + 12);\n checksum.update(out.subarray(8, length - 4));\n view.setUint32(length - 4, checksum.digestSync(), false);\n return out;\n }\n decode(message) {\n const { headers, body } = splitMessage(message);\n return { headers: this.headerMarshaller.parse(headers), body };\n }\n formatHeaders(rawHeaders) {\n return this.headerMarshaller.format(rawHeaders);\n }\n}\n","export class MessageDecoderStream {\n options;\n constructor(options) {\n this.options = options;\n }\n [Symbol.asyncIterator]() {\n return this.asyncIterator();\n }\n async *asyncIterator() {\n for await (const bytes of this.options.inputStream) {\n const decoded = this.options.decoder.decode(bytes);\n yield decoded;\n }\n }\n}\n","export class MessageEncoderStream {\n options;\n constructor(options) {\n this.options = options;\n }\n [Symbol.asyncIterator]() {\n return this.asyncIterator();\n }\n async *asyncIterator() {\n for await (const msg of this.options.messageStream) {\n const encoded = this.options.encoder.encode(msg);\n yield encoded;\n }\n if (this.options.includeEndFrame) {\n yield new Uint8Array(0);\n }\n }\n}\n","export class SmithyMessageDecoderStream {\n options;\n constructor(options) {\n this.options = options;\n }\n [Symbol.asyncIterator]() {\n return this.asyncIterator();\n }\n async *asyncIterator() {\n for await (const message of this.options.messageStream) {\n const deserialized = await this.options.deserializer(message);\n if (deserialized === undefined)\n continue;\n yield deserialized;\n }\n }\n}\n","export class SmithyMessageEncoderStream {\n options;\n constructor(options) {\n this.options = options;\n }\n [Symbol.asyncIterator]() {\n return this.asyncIterator();\n }\n async *asyncIterator() {\n for await (const chunk of this.options.inputStream) {\n const payloadBuf = this.options.serializer(chunk);\n yield payloadBuf;\n }\n }\n}\n","export function getChunkedStream(source) {\n let currentMessageTotalLength = 0;\n let currentMessagePendingLength = 0;\n let currentMessage = null;\n let messageLengthBuffer = null;\n const allocateMessage = (size) => {\n if (typeof size !== \"number\") {\n throw new Error(\"Attempted to allocate an event message where size was not a number: \" + size);\n }\n currentMessageTotalLength = size;\n currentMessagePendingLength = 4;\n currentMessage = new Uint8Array(size);\n const currentMessageView = new DataView(currentMessage.buffer);\n currentMessageView.setUint32(0, size, false);\n };\n const iterator = async function* () {\n const sourceIterator = source[Symbol.asyncIterator]();\n while (true) {\n const { value, done } = await sourceIterator.next();\n if (done) {\n if (!currentMessageTotalLength) {\n return;\n }\n else if (currentMessageTotalLength === currentMessagePendingLength) {\n yield currentMessage;\n }\n else {\n throw new Error(\"Truncated event message received.\");\n }\n return;\n }\n const chunkLength = value.length;\n let currentOffset = 0;\n while (currentOffset < chunkLength) {\n if (!currentMessage) {\n const bytesRemaining = chunkLength - currentOffset;\n if (!messageLengthBuffer) {\n messageLengthBuffer = new Uint8Array(4);\n }\n const numBytesForTotal = Math.min(4 - currentMessagePendingLength, bytesRemaining);\n messageLengthBuffer.set(value.slice(currentOffset, currentOffset + numBytesForTotal), currentMessagePendingLength);\n currentMessagePendingLength += numBytesForTotal;\n currentOffset += numBytesForTotal;\n if (currentMessagePendingLength < 4) {\n break;\n }\n allocateMessage(new DataView(messageLengthBuffer.buffer).getUint32(0, false));\n messageLengthBuffer = null;\n }\n const numBytesToWrite = Math.min(currentMessageTotalLength - currentMessagePendingLength, chunkLength - currentOffset);\n currentMessage.set(value.slice(currentOffset, currentOffset + numBytesToWrite), currentMessagePendingLength);\n currentMessagePendingLength += numBytesToWrite;\n currentOffset += numBytesToWrite;\n if (currentMessageTotalLength && currentMessageTotalLength === currentMessagePendingLength) {\n yield currentMessage;\n currentMessage = null;\n currentMessageTotalLength = 0;\n currentMessagePendingLength = 0;\n }\n }\n }\n };\n return {\n [Symbol.asyncIterator]: iterator,\n };\n}\n","export function getUnmarshalledStream(source, options) {\n const messageUnmarshaller = getMessageUnmarshaller(options.deserializer, options.toUtf8);\n return {\n [Symbol.asyncIterator]: async function* () {\n for await (const chunk of source) {\n const message = options.eventStreamCodec.decode(chunk);\n const type = await messageUnmarshaller(message);\n if (type === undefined)\n continue;\n yield type;\n }\n },\n };\n}\nexport function getMessageUnmarshaller(deserializer, toUtf8) {\n return async function (message) {\n const { value: messageType } = message.headers[\":message-type\"];\n if (messageType === \"error\") {\n const unmodeledError = new Error(message.headers[\":error-message\"].value || \"UnknownError\");\n unmodeledError.name = message.headers[\":error-code\"].value;\n throw unmodeledError;\n }\n else if (messageType === \"exception\") {\n const code = message.headers[\":exception-type\"].value;\n const exception = { [code]: message };\n const deserializedException = await deserializer(exception);\n if (deserializedException.$unknown) {\n const error = new Error(toUtf8(message.body));\n error.name = code;\n throw error;\n }\n throw deserializedException[code];\n }\n else if (messageType === \"event\") {\n const event = {\n [message.headers[\":event-type\"].value]: message,\n };\n const deserialized = await deserializer(event);\n if (deserialized.$unknown)\n return;\n return deserialized;\n }\n else {\n throw Error(`Unrecognizable event type: ${message.headers[\":event-type\"].value}`);\n }\n };\n}\n","import { EventStreamCodec } from \"../eventstream-codec/EventStreamCodec\";\nimport { MessageDecoderStream } from \"../eventstream-codec/MessageDecoderStream\";\nimport { MessageEncoderStream } from \"../eventstream-codec/MessageEncoderStream\";\nimport { SmithyMessageDecoderStream } from \"../eventstream-codec/SmithyMessageDecoderStream\";\nimport { SmithyMessageEncoderStream } from \"../eventstream-codec/SmithyMessageEncoderStream\";\nimport { getChunkedStream } from \"./getChunkedStream\";\nimport { getMessageUnmarshaller } from \"./getUnmarshalledStream\";\nexport class EventStreamMarshaller {\n eventStreamCodec;\n utfEncoder;\n constructor({ utf8Encoder, utf8Decoder }) {\n this.eventStreamCodec = new EventStreamCodec(utf8Encoder, utf8Decoder);\n this.utfEncoder = utf8Encoder;\n }\n deserialize(body, deserializer) {\n const inputStream = getChunkedStream(body);\n return new SmithyMessageDecoderStream({\n messageStream: new MessageDecoderStream({ inputStream, decoder: this.eventStreamCodec }),\n deserializer: getMessageUnmarshaller(deserializer, this.utfEncoder),\n });\n }\n serialize(inputStream, serializer) {\n return new MessageEncoderStream({\n messageStream: new SmithyMessageEncoderStream({ inputStream, serializer }),\n encoder: this.eventStreamCodec,\n includeEndFrame: true,\n });\n }\n}\nexport const eventStreamSerdeProvider = (options) => new EventStreamMarshaller(options);\n","import { Readable } from \"node:stream\";\nimport { EventStreamMarshaller as UniversalEventStreamMarshaller } from \"../eventstream-serde-universal/EventStreamMarshaller\";\nexport class EventStreamMarshaller {\n universalMarshaller;\n constructor({ utf8Encoder, utf8Decoder }) {\n this.universalMarshaller = new UniversalEventStreamMarshaller({\n utf8Decoder,\n utf8Encoder,\n });\n }\n deserialize(body, deserializer) {\n const bodyIterable = typeof body[Symbol.asyncIterator] === \"function\" ? body : readableToIterable(body);\n return this.universalMarshaller.deserialize(bodyIterable, deserializer);\n }\n serialize(input, serializer) {\n return Readable.from(this.universalMarshaller.serialize(input, serializer));\n }\n}\nexport const eventStreamSerdeProvider = (options) => new EventStreamMarshaller(options);\nexport async function* readableToIterable(readStream) {\n let streamEnded = false;\n let generationEnded = false;\n const records = new Array();\n readStream.on(\"error\", (err) => {\n if (!streamEnded) {\n streamEnded = true;\n }\n if (err) {\n throw err;\n }\n });\n readStream.on(\"data\", (data) => {\n records.push(data);\n });\n readStream.on(\"end\", () => {\n streamEnded = true;\n });\n while (!generationEnded) {\n const value = await new Promise((resolve) => setTimeout(() => resolve(records.shift()), 0));\n if (value) {\n yield value;\n }\n generationEnded = streamEnded && records.length === 0;\n }\n}\n","import { hasOwn } from \"@smithy/core/transport\";\nimport { TypeRegistry } from \"@smithy/core/schema\";\nimport { fromUtf8, toUtf8 } from \"@smithy/core/serde\";\nexport class EventStreamSerde {\n marshaller;\n serializer;\n deserializer;\n serdeContext;\n defaultContentType;\n compositeErrorRegistry;\n constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType, compositeErrorRegistry, }) {\n this.marshaller = marshaller;\n this.serializer = serializer;\n this.deserializer = deserializer;\n this.serdeContext = serdeContext;\n this.defaultContentType = defaultContentType;\n this.compositeErrorRegistry = compositeErrorRegistry;\n }\n async serializeEventStream({ eventStream, requestSchema, initialRequest, initialMessageType, }) {\n const marshaller = this.marshaller;\n const eventStreamMember = requestSchema.getEventStreamMember();\n const unionSchema = requestSchema.getMemberSchema(eventStreamMember);\n const serializer = this.serializer;\n const defaultContentType = this.defaultContentType;\n const initialRequestMarker = Symbol(\"initialRequestMarker\");\n const eventStreamIterable = {\n async *[Symbol.asyncIterator]() {\n if (initialRequest) {\n const headers = {\n \":event-type\": { type: \"string\", value: initialMessageType ?? \"initial-request\" },\n \":message-type\": { type: \"string\", value: \"event\" },\n \":content-type\": { type: \"string\", value: defaultContentType },\n };\n serializer.write(requestSchema, initialRequest);\n const body = serializer.flush();\n yield {\n [initialRequestMarker]: true,\n headers,\n body,\n };\n }\n for await (const page of eventStream) {\n yield page;\n }\n },\n };\n return marshaller.serialize(eventStreamIterable, (event) => {\n if (event[initialRequestMarker]) {\n return {\n headers: event.headers,\n body: event.body,\n };\n }\n let unionMember = \"\";\n for (const key in event) {\n if (!hasOwn(event, key))\n continue;\n if (key !== \"__type\") {\n unionMember = key;\n break;\n }\n }\n const { additionalHeaders, body, eventType, explicitPayloadContentType } = this.writeEventBody(unionMember, unionSchema, event);\n const headers = {\n \":event-type\": { type: \"string\", value: eventType },\n \":message-type\": { type: \"string\", value: \"event\" },\n \":content-type\": { type: \"string\", value: explicitPayloadContentType ?? defaultContentType },\n ...additionalHeaders,\n };\n return {\n headers,\n body,\n };\n });\n }\n async deserializeEventStream({ response, responseSchema, initialResponseContainer, initialMessageType, }) {\n const marshaller = this.marshaller;\n const eventStreamMember = responseSchema.getEventStreamMember();\n const unionSchema = responseSchema.getMemberSchema(eventStreamMember);\n const memberSchemas = unionSchema.getMemberSchemas();\n const initialResponseMarker = Symbol(\"initialResponseMarker\");\n const asyncIterable = marshaller.deserialize(response.body, async (event) => {\n let unionMember = \"\";\n for (const key in event) {\n if (!hasOwn(event, key))\n continue;\n if (key !== \"__type\") {\n unionMember = key;\n break;\n }\n }\n const body = event[unionMember].body;\n if (unionMember === (initialMessageType ?? \"initial-response\")) {\n const dataObject = await this.deserializer.read(responseSchema, body);\n delete dataObject[eventStreamMember];\n return {\n [initialResponseMarker]: true,\n ...dataObject,\n };\n }\n else if (unionMember in memberSchemas) {\n const eventStreamSchema = memberSchemas[unionMember];\n if (eventStreamSchema.isStructSchema()) {\n const out = {};\n let hasBindings = false;\n for (const [name, member] of eventStreamSchema.structIterator()) {\n const { eventHeader, eventPayload } = member.getMergedTraits();\n hasBindings = hasBindings || Boolean(eventHeader || eventPayload);\n if (eventPayload) {\n if (member.isBlobSchema()) {\n out[name] = body;\n }\n else if (member.isStringSchema()) {\n out[name] = (this.serdeContext?.utf8Encoder ?? toUtf8)(body);\n }\n else if (member.isStructSchema()) {\n out[name] = await this.deserializer.read(member, body);\n }\n }\n else if (eventHeader) {\n const value = event[unionMember].headers[name]?.value;\n if (value != null) {\n if (member.isNumericSchema()) {\n if (value && typeof value === \"object\" && \"bytes\" in value) {\n out[name] = BigInt(value.toString());\n }\n else {\n out[name] = Number(value);\n }\n }\n else {\n out[name] = value;\n }\n }\n }\n }\n return {\n [unionMember]: await this.readEventMember(eventStreamSchema, body, hasBindings, out),\n };\n }\n return {\n [unionMember]: await this.deserializer.read(eventStreamSchema, body),\n };\n }\n else {\n return {\n $unknown: event,\n };\n }\n });\n const asyncIterator = asyncIterable[Symbol.asyncIterator]();\n const firstEvent = await asyncIterator.next();\n if (firstEvent.done) {\n return asyncIterable;\n }\n if (firstEvent.value?.[initialResponseMarker]) {\n if (!responseSchema) {\n throw new Error(\"@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.\");\n }\n for (const key in firstEvent.value) {\n if (!hasOwn(firstEvent.value, key))\n continue;\n initialResponseContainer[key] = firstEvent.value[key];\n }\n }\n return {\n async *[Symbol.asyncIterator]() {\n if (!firstEvent?.value?.[initialResponseMarker]) {\n yield firstEvent.value;\n }\n while (true) {\n const { done, value } = await asyncIterator.next();\n if (done) {\n break;\n }\n yield value;\n }\n },\n };\n }\n async readEventMember(eventStreamSchema, body, hasBindings, out) {\n let ErrCtor;\n const staticStructuralSchema = eventStreamSchema.getSchema();\n if (Array.isArray(staticStructuralSchema) && staticStructuralSchema[0] === -3) {\n const namespace = staticStructuralSchema[1];\n const nsRegistry = TypeRegistry.for(namespace);\n this.compositeErrorRegistry?.copyFrom(nsRegistry);\n ErrCtor = (this.compositeErrorRegistry ?? nsRegistry)?.getErrorCtor(staticStructuralSchema);\n }\n const dataObject = hasBindings\n ? out\n : body.byteLength === 0\n ? {}\n : await this.deserializer.read(eventStreamSchema, body);\n if (ErrCtor) {\n const message = dataObject.message ?? dataObject.Message ?? \"Unknown\";\n const metadata = {};\n const $fault = eventStreamSchema.getMergedTraits().error;\n if ($fault) {\n metadata.$fault = $fault;\n }\n return Object.assign(new ErrCtor({}), metadata, {\n message,\n }, dataObject);\n }\n return dataObject;\n }\n writeEventBody(unionMember, unionSchema, event) {\n const serializer = this.serializer;\n let eventType = unionMember;\n let explicitPayloadMember = null;\n let explicitPayloadContentType;\n const isKnownSchema = (() => {\n const struct = unionSchema.getSchema();\n return struct[4].includes(unionMember);\n })();\n const additionalHeaders = {};\n if (!isKnownSchema) {\n const [type, value] = event[unionMember];\n eventType = type;\n serializer.write(15, value);\n }\n else {\n const eventSchema = unionSchema.getMemberSchema(unionMember);\n if (eventSchema.isStructSchema()) {\n for (const [memberName, memberSchema] of eventSchema.structIterator()) {\n const { eventHeader, eventPayload } = memberSchema.getMergedTraits();\n if (eventPayload) {\n explicitPayloadMember = memberName;\n }\n else if (eventHeader) {\n const value = event[unionMember][memberName];\n let type = \"binary\";\n if (memberSchema.isNumericSchema()) {\n if ((-2) ** 31 <= value && value <= 2 ** 31 - 1) {\n type = \"integer\";\n }\n else {\n type = \"long\";\n }\n }\n else if (memberSchema.isTimestampSchema()) {\n type = \"timestamp\";\n }\n else if (memberSchema.isStringSchema()) {\n type = \"string\";\n }\n else if (memberSchema.isBooleanSchema()) {\n type = \"boolean\";\n }\n if (value != null) {\n additionalHeaders[memberName] = {\n type,\n value,\n };\n delete event[unionMember][memberName];\n }\n }\n }\n if (explicitPayloadMember !== null) {\n const payloadSchema = eventSchema.getMemberSchema(explicitPayloadMember);\n if (payloadSchema.isBlobSchema()) {\n explicitPayloadContentType = \"application/octet-stream\";\n }\n else if (payloadSchema.isStringSchema()) {\n explicitPayloadContentType = \"text/plain\";\n }\n serializer.write(payloadSchema, event[unionMember][explicitPayloadMember]);\n }\n else {\n serializer.write(eventSchema, event[unionMember]);\n }\n }\n else if (eventSchema.isUnitSchema()) {\n serializer.write(eventSchema, {});\n }\n else {\n throw new Error(\"@smithy/core/event-streams - non-struct member not supported in event stream union.\");\n }\n }\n const messageSerialization = serializer.flush() ?? new Uint8Array();\n const body = typeof messageSerialization === \"string\"\n ? (this.serdeContext?.utf8Decoder ?? fromUtf8)(messageSerialization)\n : messageSerialization;\n return {\n body,\n eventType,\n explicitPayloadContentType,\n additionalHeaders,\n };\n }\n}\n","export { EventStreamCodec } from \"./eventstream-codec/EventStreamCodec\";\nexport { HeaderMarshaller } from \"./eventstream-codec/HeaderMarshaller\";\nexport { Int64 } from \"./eventstream-codec/Int64\";\nexport { MessageDecoderStream } from \"./eventstream-codec/MessageDecoderStream\";\nexport { MessageEncoderStream } from \"./eventstream-codec/MessageEncoderStream\";\nexport { SmithyMessageDecoderStream } from \"./eventstream-codec/SmithyMessageDecoderStream\";\nexport { SmithyMessageEncoderStream } from \"./eventstream-codec/SmithyMessageEncoderStream\";\nexport { EventStreamMarshaller, eventStreamSerdeProvider } from \"./eventstream-serde/EventStreamMarshaller\";\nexport { readableStreamToIterable, iterableToReadableStream } from \"./eventstream-serde/utils\";\nexport { EventStreamMarshaller as UniversalEventStreamMarshaller, eventStreamSerdeProvider as universalEventStreamSerdeProvider, } from \"./eventstream-serde-universal/EventStreamMarshaller\";\nexport { getChunkedStream } from \"./eventstream-serde-universal/getChunkedStream\";\nexport { getUnmarshalledStream, getMessageUnmarshaller } from \"./eventstream-serde-universal/getUnmarshalledStream\";\nexport { resolveEventStreamSerdeConfig } from \"./eventstream-serde-config-resolver/EventStreamSerdeConfig\";\nexport { EventStreamSerde } from \"./EventStreamSerde\";\n"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13],"mappings":";;;;AAkCA,SAAS,OAAO,OAAO;CACnB,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KACnB,MAAM,MAAM;CAEhB,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,KAAK;EACzB,MAAM,EAAE;EACR,IAAI,MAAM,OAAO,GACb;CACR;AACJ;;;CA3C0C,WAAA;CAC7B,QAAb,MAAa,MAAM;EACf;EACA,YAAY,OAAO;GACf,KAAK,QAAQ;GACb,IAAI,MAAM,eAAe,GACrB,MAAM,IAAI,MAAM,uCAAuC;EAE/D;EACA,OAAO,WAAW,QAAQ;GACtB,IAAI,SAAS,sBAA6B,SAAS,qBAC/C,MAAM,IAAI,MAAM,GAAG,OAAO,oEAAoE;GAElG,MAAM,wBAAQ,IAAI,WAAW,CAAC;GAC9B,KAAK,IAAI,IAAI,GAAG,YAAY,KAAK,IAAI,KAAK,MAAM,MAAM,CAAC,GAAG,IAAI,MAAM,YAAY,GAAG,KAAK,aAAa,KACjG,MAAM,KAAK;GAEf,IAAI,SAAS,GACT,OAAO,KAAK;GAEhB,OAAO,IAAI,MAAM,KAAK;EAC1B;EACA,UAAU;GACN,MAAM,QAAQ,KAAK,MAAM,MAAM,CAAC;GAChC,MAAM,WAAW,MAAM,KAAK;GAC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AAa,eAAe,GACjC,OAAO;YAEN,IAAI,aAAa,gBAAgB,GAClC,OAAO;OAEX,IAAI,SAAS,MAAM;QACf,kBAAkB,cAAc;SAC5B;SACA;QACJ;QACA,OAAO,MAAM,YAAY,CAAC;OAC9B;MACJ;KACJ;KACA,IAAI,0BAA0B,MAAM;MAChC,MAAM,gBAAgB,YAAY,gBAAgB,qBAAqB;MACvE,IAAI,cAAc,aAAa,GAC3B,6BAA6B;WAE5B,IAAI,cAAc,eAAe,GAClC,6BAA6B;MAEjC,WAAW,MAAM,eAAe,MAAM,YAAY,CAAC,sBAAsB;KAC7E,OAEI,WAAW,MAAM,aAAa,MAAM,YAAY;IAExD,OACK,IAAI,YAAY,aAAa,GAC9B,WAAW,MAAM,aAAa,CAAC,CAAC;SAGhC,MAAM,IAAI,MAAM,qFAAqF;GAE7G;GACA,MAAM,uBAAuB,WAAW,MAAM,qBAAK,IAAI,WAAW;GAIlE,OAAO;IACH,MAJS,OAAO,yBAAyB,YACtC,KAAK,cAAc,eAAe,SAAA,CAAU,oBAAoB,IACjE;IAGF;IACA;IACA;GACJ;EACJ;CACJ;;;;;;;;;;CC5R2G,2BAAA;;CAMtD,sBAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { D as
|
|
2
|
-
import { a as renderText,
|
|
1
|
+
import { D as checkInvariant, E as validateScenario, O as checkInvariants, a as explore, o as replay, s as restrictSpec, t as observeCore } from "./src-DPCF2XGv.mjs";
|
|
2
|
+
import { a as renderText, f as checkedRung, i as renderSpecs, l as specLadder, o as renderTrace, s as emitRegressionTest, t as renderJson, u as testedRung, y as describeVerdict } from "./src-ClXnIi6O.mjs";
|
|
3
|
+
import { t as aggregate } from "./provers-DS44OeEm.mjs";
|
|
3
4
|
// packages/core/src/spec-verdict.ts
|
|
4
5
|
/** One line per spec verdict, for error messages; full rendering lives in `report`. */
|
|
5
6
|
function describeSpecVerdict(v) {
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../core/src/spec-verdict.ts"],"sourcesContent":["/**\n * Spec verdicts: what is known about one property of one pure function.\n * Kept apart from scenario verdicts in every report. The ladder runs\n * `CHECKED` (held on every input the simulator passed), then `TESTED` (held\n * on inputs generated from the binders' domains), then `PROVEN` (an engine\n * proved it for every input); `CONFLICT` when engines disagree.\n */\n\ninterface SpecVerdictBase {\n /** The module, as the scenario names it. */\n readonly module: string;\n readonly function: string;\n /** The property's export name in the spec file. */\n readonly property: string;\n /** The property as written. */\n readonly text: string;\n readonly assumptions: readonly string[];\n}\n\nexport interface Checked extends SpecVerdictBase {\n readonly kind: \"CHECKED\";\n /** Distinct inputs the property was evaluated on. */\n readonly inputs: number;\n /** Distinct inputs outside the claim: a precondition failed, or a value fell outside its binder's domain. */\n readonly discarded: number;\n}\n\n/** The property held on inputs generated from its binders' domains, and on the simulator's where it passed any. */\nexport interface Tested extends SpecVerdictBase {\n readonly kind: \"TESTED\";\n /** Generated assignments the property held on. */\n readonly inputs: number;\n /** Generated assignments outside the claim: a precondition failed. */\n readonly discarded: number;\n /** The seed the assignments were drawn from; the same seed draws the same assignments. */\n readonly seed: string;\n /** Distinct inputs the simulator passed that the property also held on, when it passed any. */\n readonly checked?: number;\n}\n\n/** One assignment that breaks the property, as JavaScript literals, and where it came from. */\nexport interface Counterexample {\n /** In the property's binder order. */\n readonly binders: readonly { readonly name: string; readonly value: string }[];\n /** The simulator's call the assignment was taken from; absent when it was generated. */\n readonly call?: string;\n /** Set when evaluating the property threw instead of returning false. */\n readonly error?: string;\n}\n\nexport interface Refuted extends SpecVerdictBase {\n readonly kind: \"REFUTED\";\n /** The rung that found the counterexample: a rung of the simulator, or an engine by name. */\n readonly rung: \"CHECKED\" | \"TESTED\" | \"PROVEN\";\n /** The engine, when the rung is PROVEN. */\n readonly engine?: { readonly name: string; readonly version: string };\n readonly counterexample: Counterexample;\n}\n\n/** Proved for every input by a named engine; the lower rungs' evidence is kept beside it. */\nexport interface Proven extends SpecVerdictBase {\n readonly kind: \"PROVEN\";\n readonly engine: { readonly name: string; readonly version: string };\n /** Generated inputs the TESTED rung held on, when it ran. */\n readonly tested?: number;\n /** Distinct inputs the simulator passed that the CHECKED rung held on, when it passed any. */\n readonly checked?: number;\n}\n\n/** Two engines disagree: one proves, one refutes. Never resolved automatically. */\nexport interface Conflict extends SpecVerdictBase {\n readonly kind: \"CONFLICT\";\n readonly proven: { readonly name: string; readonly version: string };\n readonly refuted: {\n readonly name: string;\n readonly version: string;\n readonly counterexample?: Counterexample;\n };\n}\n\nexport type SpecUnknownCause = \"gave_up\" | \"unsupported\" | \"unavailable\";\n\nexport interface SpecUnknown extends SpecVerdictBase {\n readonly kind: \"UNKNOWN\";\n readonly cause: SpecUnknownCause;\n readonly reason: string;\n}\n\nexport type SpecVerdict = Checked | Tested | Proven | Refuted | Conflict | SpecUnknown;\n\n/** One line per spec verdict, for error messages; full rendering lives in `report`. */\nexport function describeSpecVerdict(v: SpecVerdict): string {\n const what = `${v.function} ${v.property}`;\n switch (v.kind) {\n case \"CHECKED\":\n return `CHECKED ${what}: held on ${v.inputs} input(s) the simulator passed`;\n case \"TESTED\":\n return `TESTED ${what}: held on ${v.inputs} generated input(s)`;\n case \"PROVEN\":\n return `PROVEN ${what}: by ${v.engine.name} ${v.engine.version}`;\n case \"CONFLICT\":\n return `CONFLICT ${what}: ${v.proven.name} proves it, ${v.refuted.name} refutes it`;\n case \"REFUTED\": {\n const c = v.counterexample;\n const where = c.call ?? c.binders.map((b) => `${b.name} = ${b.value}`).join(\", \");\n return `REFUTED ${what}: ${where}${c.error ? ` threw ${c.error}` : \"\"}`;\n }\n case \"UNKNOWN\":\n return `UNKNOWN ${what}: ${v.cause}: ${v.reason}`;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../core/src/spec-verdict.ts"],"sourcesContent":["/**\n * Spec verdicts: what is known about one property of one pure function.\n * Kept apart from scenario verdicts in every report. The ladder runs\n * `CHECKED` (held on every input the simulator passed), then `TESTED` (held\n * on inputs generated from the binders' domains), then `PROVEN` (an engine\n * proved it for every input); `CONFLICT` when engines disagree.\n */\n\ninterface SpecVerdictBase {\n /** The module, as the scenario names it. */\n readonly module: string;\n readonly function: string;\n /** The property's export name in the spec file. */\n readonly property: string;\n /** The property as written. */\n readonly text: string;\n readonly assumptions: readonly string[];\n}\n\nexport interface Checked extends SpecVerdictBase {\n readonly kind: \"CHECKED\";\n /** Distinct inputs the property was evaluated on. */\n readonly inputs: number;\n /** Distinct inputs outside the claim: a precondition failed, or a value fell outside its binder's domain. */\n readonly discarded: number;\n}\n\n/** The property held on inputs generated from its binders' domains, and on the simulator's where it passed any. */\nexport interface Tested extends SpecVerdictBase {\n readonly kind: \"TESTED\";\n /** Generated assignments the property held on. */\n readonly inputs: number;\n /** Generated assignments outside the claim: a precondition failed. */\n readonly discarded: number;\n /** The seed the assignments were drawn from; the same seed draws the same assignments. */\n readonly seed: string;\n /** Distinct inputs the simulator passed that the property also held on, when it passed any. */\n readonly checked?: number;\n}\n\n/** One assignment that breaks the property, as JavaScript literals, and where it came from. */\nexport interface Counterexample {\n /** In the property's binder order. */\n readonly binders: readonly { readonly name: string; readonly value: string }[];\n /** The simulator's call the assignment was taken from; absent when it was generated. */\n readonly call?: string;\n /** Set when evaluating the property threw instead of returning false. */\n readonly error?: string;\n}\n\nexport interface Refuted extends SpecVerdictBase {\n readonly kind: \"REFUTED\";\n /** The rung that found the counterexample: a rung of the simulator, or an engine by name. */\n readonly rung: \"CHECKED\" | \"TESTED\" | \"PROVEN\";\n /** The engine, when the rung is PROVEN. */\n readonly engine?: { readonly name: string; readonly version: string };\n readonly counterexample: Counterexample;\n}\n\n/** Proved for every input by a named engine; the lower rungs' evidence is kept beside it. */\nexport interface Proven extends SpecVerdictBase {\n readonly kind: \"PROVEN\";\n readonly engine: { readonly name: string; readonly version: string };\n /** Generated inputs the TESTED rung held on, when it ran. */\n readonly tested?: number;\n /** Distinct inputs the simulator passed that the CHECKED rung held on, when it passed any. */\n readonly checked?: number;\n}\n\n/** Two engines disagree: one proves, one refutes. Never resolved automatically. */\nexport interface Conflict extends SpecVerdictBase {\n readonly kind: \"CONFLICT\";\n readonly proven: { readonly name: string; readonly version: string };\n readonly refuted: {\n readonly name: string;\n readonly version: string;\n readonly counterexample?: Counterexample;\n };\n}\n\nexport type SpecUnknownCause = \"gave_up\" | \"unsupported\" | \"unavailable\";\n\nexport interface SpecUnknown extends SpecVerdictBase {\n readonly kind: \"UNKNOWN\";\n readonly cause: SpecUnknownCause;\n readonly reason: string;\n}\n\nexport type SpecVerdict = Checked | Tested | Proven | Refuted | Conflict | SpecUnknown;\n\n/** One line per spec verdict, for error messages; full rendering lives in `report`. */\nexport function describeSpecVerdict(v: SpecVerdict): string {\n const what = `${v.function} ${v.property}`;\n switch (v.kind) {\n case \"CHECKED\":\n return `CHECKED ${what}: held on ${v.inputs} input(s) the simulator passed`;\n case \"TESTED\":\n return `TESTED ${what}: held on ${v.inputs} generated input(s)`;\n case \"PROVEN\":\n return `PROVEN ${what}: by ${v.engine.name} ${v.engine.version}`;\n case \"CONFLICT\":\n return `CONFLICT ${what}: ${v.proven.name} proves it, ${v.refuted.name} refutes it`;\n case \"REFUTED\": {\n const c = v.counterexample;\n const where = c.call ?? c.binders.map((b) => `${b.name} = ${b.value}`).join(\", \");\n return `REFUTED ${what}: ${where}${c.error ? ` threw ${c.error}` : \"\"}`;\n }\n case \"UNKNOWN\":\n return `UNKNOWN ${what}: ${v.cause}: ${v.reason}`;\n }\n}\n"],"mappings":";;;;;AA2FA,SAAgB,oBAAoB,GAAwB;CAC1D,MAAM,OAAO,GAAG,EAAE,SAAS,GAAG,EAAE;CAChC,QAAQ,EAAE,MAAV;EACE,KAAK,WACH,OAAO,WAAW,KAAK,YAAY,EAAE,OAAO;EAC9C,KAAK,UACH,OAAO,UAAU,KAAK,YAAY,EAAE,OAAO;EAC7C,KAAK,UACH,OAAO,UAAU,KAAK,OAAO,EAAE,OAAO,KAAK,GAAG,EAAE,OAAO;EACzD,KAAK,YACH,OAAO,YAAY,KAAK,IAAI,EAAE,OAAO,KAAK,cAAc,EAAE,QAAQ,KAAK;EACzE,KAAK,WAAW;GACd,MAAM,IAAI,EAAE;GAEZ,OAAO,WAAW,KAAK,IADT,EAAE,QAAQ,EAAE,QAAQ,KAAK,MAAM,GAAG,EAAE,KAAK,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,IAAI,IAC7C,EAAE,QAAQ,UAAU,EAAE,UAAU;EACrE;EACA,KAAK,WACH,OAAO,WAAW,KAAK,IAAI,EAAE,MAAM,IAAI,EAAE;CAC7C;AACF"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// packages/prover/src/provers.ts
|
|
2
|
+
/**
|
|
3
|
+
* The simulator's verdicts for a module (CHECKED, TESTED, REFUTED, UNKNOWN,
|
|
4
|
+
* `total` included) combined with what the engines proved. A simulator
|
|
5
|
+
* counterexample stands. One engine proving is `PROVEN`, the lower rungs'
|
|
6
|
+
* counts kept beside it; an engine refuting where nothing else did is
|
|
7
|
+
* `REFUTED` at the PROVEN rung; one proving and another refuting is
|
|
8
|
+
* `CONFLICT`. An engine that gave up, could not run or does not take the
|
|
9
|
+
* function leaves the verdict as it was, with why among the assumptions.
|
|
10
|
+
*/
|
|
11
|
+
function aggregate(module, verdicts, reports) {
|
|
12
|
+
return verdicts.map((v) => {
|
|
13
|
+
if (v.module !== module) return v;
|
|
14
|
+
const says = reports.map((r) => ({
|
|
15
|
+
engine: r.engine,
|
|
16
|
+
outcome: r.proofs.results.find((p) => p.function === v.function && p.property === v.property)?.outcome
|
|
17
|
+
})).filter((x) => x.outcome !== void 0);
|
|
18
|
+
if (says.length === 0) return v;
|
|
19
|
+
const proven = says.find((x) => x.outcome.kind === "PROVEN");
|
|
20
|
+
const refuted = says.find((x) => x.outcome.kind === "REFUTED");
|
|
21
|
+
if (v.kind === "REFUTED" || v.kind === "CONFLICT") {
|
|
22
|
+
if (v.kind === "REFUTED" && proven?.outcome.kind === "PROVEN") return {
|
|
23
|
+
module: v.module,
|
|
24
|
+
function: v.function,
|
|
25
|
+
property: v.property,
|
|
26
|
+
text: v.text,
|
|
27
|
+
kind: "CONFLICT",
|
|
28
|
+
proven: proven.outcome.engine,
|
|
29
|
+
refuted: {
|
|
30
|
+
name: "simulator",
|
|
31
|
+
version: v.rung,
|
|
32
|
+
counterexample: v.counterexample
|
|
33
|
+
},
|
|
34
|
+
assumptions: [...v.assumptions, ...proven.outcome.assumptions]
|
|
35
|
+
};
|
|
36
|
+
return v;
|
|
37
|
+
}
|
|
38
|
+
if (proven?.outcome.kind === "PROVEN" && refuted?.outcome.kind === "REFUTED") return {
|
|
39
|
+
module: v.module,
|
|
40
|
+
function: v.function,
|
|
41
|
+
property: v.property,
|
|
42
|
+
text: v.text,
|
|
43
|
+
kind: "CONFLICT",
|
|
44
|
+
proven: proven.outcome.engine,
|
|
45
|
+
refuted: {
|
|
46
|
+
name: refuted.outcome.engine.name,
|
|
47
|
+
version: refuted.outcome.engine.version,
|
|
48
|
+
...refuted.outcome.counterexample ? { counterexample: refuted.outcome.counterexample } : {}
|
|
49
|
+
},
|
|
50
|
+
assumptions: [...proven.outcome.assumptions, ...refuted.outcome.assumptions]
|
|
51
|
+
};
|
|
52
|
+
if (refuted?.outcome.kind === "REFUTED") return {
|
|
53
|
+
module: v.module,
|
|
54
|
+
function: v.function,
|
|
55
|
+
property: v.property,
|
|
56
|
+
text: v.text,
|
|
57
|
+
kind: "REFUTED",
|
|
58
|
+
rung: "PROVEN",
|
|
59
|
+
engine: refuted.outcome.engine,
|
|
60
|
+
counterexample: refuted.outcome.counterexample ?? { binders: [] },
|
|
61
|
+
assumptions: refuted.outcome.assumptions
|
|
62
|
+
};
|
|
63
|
+
if (proven?.outcome.kind === "PROVEN") return {
|
|
64
|
+
module: v.module,
|
|
65
|
+
function: v.function,
|
|
66
|
+
property: v.property,
|
|
67
|
+
text: v.text,
|
|
68
|
+
kind: "PROVEN",
|
|
69
|
+
engine: proven.outcome.engine,
|
|
70
|
+
...v.kind === "TESTED" ? { tested: v.inputs } : {},
|
|
71
|
+
...v.kind === "TESTED" && v.checked !== void 0 ? { checked: v.checked } : v.kind === "CHECKED" ? { checked: v.inputs } : {},
|
|
72
|
+
assumptions: [...proven.outcome.assumptions, ...v.assumptions]
|
|
73
|
+
};
|
|
74
|
+
const notes = says.map((x) => x.outcome.kind === "UNKNOWN" ? `not PROVEN by ${x.engine}: ${x.outcome.cause}: ${x.outcome.reason}` : `${x.engine}: ${x.outcome.kind}`);
|
|
75
|
+
return {
|
|
76
|
+
...v,
|
|
77
|
+
assumptions: [...v.assumptions, ...notes]
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
export { aggregate as t };
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=provers-DS44OeEm.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provers-DS44OeEm.mjs","names":[],"sources":["../../prover/src/provers.ts"],"sourcesContent":["/**\n * The `Prover` interface every engine implements, first-party or not, and\n * the aggregation of what engines say into the ladder's verdicts. An\n * engine takes a module's source with its specs and the functions to\n * prove and answers per property: `PROVEN` with its name, version and\n * assumptions, or `UNKNOWN` as `gave_up` (a proof did not close, or timed\n * out), `unsupported` (outside its subset) or `unavailable` (not\n * installed). An engine that refutes gives `REFUTED` with a counterexample\n * when it has one. Engines run over a process boundary; nothing here\n * spawns anything.\n */\n\nimport type { Counterexample, SpecVerdict } from \"@eutaxy/core\";\nimport type { ModuleSpecs, SpecError } from \"@eutaxy/spec\";\n\nexport interface EngineId {\n readonly name: string;\n readonly version: string;\n}\n\nexport type ProofOutcome =\n | { readonly kind: \"PROVEN\"; readonly engine: EngineId; readonly assumptions: readonly string[] }\n | {\n readonly kind: \"REFUTED\";\n readonly engine: EngineId;\n readonly counterexample?: Counterexample;\n readonly assumptions: readonly string[];\n }\n | {\n readonly kind: \"UNKNOWN\";\n readonly cause: \"gave_up\" | \"unsupported\" | \"unavailable\";\n readonly reason: string;\n };\n\nexport interface PropertyProof {\n readonly function: string;\n /** The property's export name in the spec file. */\n readonly property: string;\n readonly outcome: ProofOutcome;\n}\n\n/** A property an engine gave up on, with the statement it tried to prove, for a proof to be supplied. */\nexport interface OpenGoal {\n readonly function: string;\n readonly property: string;\n /** The statement in the engine's language, as it emitted it. */\n readonly statement: string;\n /** Why the engine gave up: its own words, first line. */\n readonly reason: string;\n}\n\nexport interface ModuleProofs {\n readonly results: readonly PropertyProof[];\n /** Specs that did not read: properties asked for and never checked. */\n readonly specErrors: readonly SpecError[];\n /**\n * The properties given up on that a supplied proof could close, when the engine takes supplied proofs\n * and answered (empty when it closed every one; absent when it could not run or finish).\n */\n readonly goals?: readonly OpenGoal[];\n}\n\nexport interface ProveInput {\n /** The module's source text. */\n readonly source: string;\n /** The module's specs, read from its spec file. */\n readonly specs: ModuleSpecs;\n /** The functions to prove; every one with specs when omitted. */\n readonly functions?: readonly string[];\n /** The module's path, under which its imports resolve; without it the module stands alone. */\n readonly modulePath?: string;\n /** The spec file's path, for an engine that replays a counterexample through the spec itself. */\n readonly specPath?: string;\n readonly timeoutMs?: number;\n}\n\nexport interface Prover {\n readonly name: string;\n /** Whether the engine can run here, or why not. */\n available(): Promise<{ readonly version: string } | { readonly unavailable: string }>;\n prove(input: ProveInput): Promise<ModuleProofs>;\n}\n\n/** What an engine said about one module, by its name. */\nexport interface EngineReport {\n readonly engine: string;\n readonly proofs: ModuleProofs;\n}\n\n/**\n * The simulator's verdicts for a module (CHECKED, TESTED, REFUTED, UNKNOWN,\n * `total` included) combined with what the engines proved. A simulator\n * counterexample stands. One engine proving is `PROVEN`, the lower rungs'\n * counts kept beside it; an engine refuting where nothing else did is\n * `REFUTED` at the PROVEN rung; one proving and another refuting is\n * `CONFLICT`. An engine that gave up, could not run or does not take the\n * function leaves the verdict as it was, with why among the assumptions.\n */\nexport function aggregate(\n module: string,\n verdicts: readonly SpecVerdict[],\n reports: readonly EngineReport[],\n): SpecVerdict[] {\n return verdicts.map((v) => {\n if (v.module !== module) return v;\n const says = reports\n .map((r) => ({\n engine: r.engine,\n outcome: r.proofs.results.find(\n (p) => p.function === v.function && p.property === v.property,\n )?.outcome,\n }))\n .filter((x): x is { engine: string; outcome: ProofOutcome } => x.outcome !== undefined);\n if (says.length === 0) return v;\n const proven = says.find((x) => x.outcome.kind === \"PROVEN\");\n const refuted = says.find((x) => x.outcome.kind === \"REFUTED\");\n if (v.kind === \"REFUTED\" || v.kind === \"CONFLICT\") {\n // The simulator's counterexample is a fact; an engine proving against it is a conflict too.\n if (v.kind === \"REFUTED\" && proven?.outcome.kind === \"PROVEN\")\n return {\n module: v.module,\n function: v.function,\n property: v.property,\n text: v.text,\n kind: \"CONFLICT\",\n proven: proven.outcome.engine,\n refuted: { name: \"simulator\", version: v.rung, counterexample: v.counterexample },\n assumptions: [...v.assumptions, ...proven.outcome.assumptions],\n };\n return v;\n }\n if (proven?.outcome.kind === \"PROVEN\" && refuted?.outcome.kind === \"REFUTED\")\n return {\n module: v.module,\n function: v.function,\n property: v.property,\n text: v.text,\n kind: \"CONFLICT\",\n proven: proven.outcome.engine,\n refuted: {\n name: refuted.outcome.engine.name,\n version: refuted.outcome.engine.version,\n ...(refuted.outcome.counterexample\n ? { counterexample: refuted.outcome.counterexample }\n : {}),\n },\n assumptions: [...proven.outcome.assumptions, ...refuted.outcome.assumptions],\n };\n if (refuted?.outcome.kind === \"REFUTED\")\n return {\n module: v.module,\n function: v.function,\n property: v.property,\n text: v.text,\n kind: \"REFUTED\",\n rung: \"PROVEN\",\n engine: refuted.outcome.engine,\n counterexample: refuted.outcome.counterexample ?? { binders: [] },\n assumptions: refuted.outcome.assumptions,\n };\n if (proven?.outcome.kind === \"PROVEN\")\n return {\n module: v.module,\n function: v.function,\n property: v.property,\n text: v.text,\n kind: \"PROVEN\",\n engine: proven.outcome.engine,\n ...(v.kind === \"TESTED\" ? { tested: v.inputs } : {}),\n ...(v.kind === \"TESTED\" && v.checked !== undefined\n ? { checked: v.checked }\n : v.kind === \"CHECKED\"\n ? { checked: v.inputs }\n : {}),\n assumptions: [...proven.outcome.assumptions, ...v.assumptions],\n };\n // Every engine fell short: say so beside the verdict that stands.\n const notes = says.map((x) =>\n x.outcome.kind === \"UNKNOWN\"\n ? `not PROVEN by ${x.engine}: ${x.outcome.cause}: ${x.outcome.reason}`\n : `${x.engine}: ${x.outcome.kind}`,\n );\n return { ...v, assumptions: [...v.assumptions, ...notes] };\n });\n}\n"],"mappings":";;;;;;;;;;AAkGA,SAAgB,UACd,QACA,UACA,SACe;CACf,OAAO,SAAS,KAAK,MAAM;EACzB,IAAI,EAAE,WAAW,QAAQ,OAAO;EAChC,MAAM,OAAO,QACV,KAAK,OAAO;GACX,QAAQ,EAAE;GACV,SAAS,EAAE,OAAO,QAAQ,MACvB,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,QACvD,CAAC,EAAE;EACL,EAAE,CAAC,CACF,QAAQ,MAAsD,EAAE,YAAY,KAAA,CAAS;EACxF,IAAI,KAAK,WAAW,GAAG,OAAO;EAC9B,MAAM,SAAS,KAAK,MAAM,MAAM,EAAE,QAAQ,SAAS,QAAQ;EAC3D,MAAM,UAAU,KAAK,MAAM,MAAM,EAAE,QAAQ,SAAS,SAAS;EAC7D,IAAI,EAAE,SAAS,aAAa,EAAE,SAAS,YAAY;GAEjD,IAAI,EAAE,SAAS,aAAa,QAAQ,QAAQ,SAAS,UACnD,OAAO;IACL,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,UAAU,EAAE;IACZ,MAAM,EAAE;IACR,MAAM;IACN,QAAQ,OAAO,QAAQ;IACvB,SAAS;KAAE,MAAM;KAAa,SAAS,EAAE;KAAM,gBAAgB,EAAE;IAAe;IAChF,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,QAAQ,WAAW;GAC/D;GACF,O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WAC5D,GAAG,EAAE,OAAO,IAAI,EAAE,QAAQ,MAChC;EACA,OAAO;GAAE,GAAG;GAAG,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,KAAK;EAAE;CAC3D,CAAC;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as seedPrng, L as canonicalJson, M as nextFloat, N as nextInt, P as nextU32 } from "./src-DPCF2XGv.mjs";
|
|
2
2
|
import { n as isSpec } from "./combinators-CVjxodAJ.mjs";
|
|
3
3
|
// packages/core/src/verdict.ts
|
|
4
4
|
/** One line per verdict, for error messages; full rendering lives in `report`. */
|
|
@@ -1417,86 +1417,6 @@ function checkSpecModule(module, specs, props, namespace, observed, options = {}
|
|
|
1417
1417
|
});
|
|
1418
1418
|
});
|
|
1419
1419
|
}
|
|
1420
|
-
// packages/prover/src/provers.ts
|
|
1421
|
-
/**
|
|
1422
|
-
* The simulator's verdicts for a module (CHECKED, TESTED, REFUTED, UNKNOWN,
|
|
1423
|
-
* `total` included) combined with what the engines proved. A simulator
|
|
1424
|
-
* counterexample stands. One engine proving is `PROVEN`, the lower rungs'
|
|
1425
|
-
* counts kept beside it; an engine refuting where nothing else did is
|
|
1426
|
-
* `REFUTED` at the PROVEN rung; one proving and another refuting is
|
|
1427
|
-
* `CONFLICT`. An engine that gave up, could not run or does not take the
|
|
1428
|
-
* function leaves the verdict as it was, with why among the assumptions.
|
|
1429
|
-
*/
|
|
1430
|
-
function aggregate(module, verdicts, reports) {
|
|
1431
|
-
return verdicts.map((v) => {
|
|
1432
|
-
if (v.module !== module) return v;
|
|
1433
|
-
const says = reports.map((r) => ({
|
|
1434
|
-
engine: r.engine,
|
|
1435
|
-
outcome: r.proofs.results.find((p) => p.function === v.function && p.property === v.property)?.outcome
|
|
1436
|
-
})).filter((x) => x.outcome !== void 0);
|
|
1437
|
-
if (says.length === 0) return v;
|
|
1438
|
-
const proven = says.find((x) => x.outcome.kind === "PROVEN");
|
|
1439
|
-
const refuted = says.find((x) => x.outcome.kind === "REFUTED");
|
|
1440
|
-
if (v.kind === "REFUTED" || v.kind === "CONFLICT") {
|
|
1441
|
-
if (v.kind === "REFUTED" && proven?.outcome.kind === "PROVEN") return {
|
|
1442
|
-
module: v.module,
|
|
1443
|
-
function: v.function,
|
|
1444
|
-
property: v.property,
|
|
1445
|
-
text: v.text,
|
|
1446
|
-
kind: "CONFLICT",
|
|
1447
|
-
proven: proven.outcome.engine,
|
|
1448
|
-
refuted: {
|
|
1449
|
-
name: "simulator",
|
|
1450
|
-
version: v.rung,
|
|
1451
|
-
counterexample: v.counterexample
|
|
1452
|
-
},
|
|
1453
|
-
assumptions: [...v.assumptions, ...proven.outcome.assumptions]
|
|
1454
|
-
};
|
|
1455
|
-
return v;
|
|
1456
|
-
}
|
|
1457
|
-
if (proven?.outcome.kind === "PROVEN" && refuted?.outcome.kind === "REFUTED") return {
|
|
1458
|
-
module: v.module,
|
|
1459
|
-
function: v.function,
|
|
1460
|
-
property: v.property,
|
|
1461
|
-
text: v.text,
|
|
1462
|
-
kind: "CONFLICT",
|
|
1463
|
-
proven: proven.outcome.engine,
|
|
1464
|
-
refuted: {
|
|
1465
|
-
name: refuted.outcome.engine.name,
|
|
1466
|
-
version: refuted.outcome.engine.version,
|
|
1467
|
-
...refuted.outcome.counterexample ? { counterexample: refuted.outcome.counterexample } : {}
|
|
1468
|
-
},
|
|
1469
|
-
assumptions: [...proven.outcome.assumptions, ...refuted.outcome.assumptions]
|
|
1470
|
-
};
|
|
1471
|
-
if (refuted?.outcome.kind === "REFUTED") return {
|
|
1472
|
-
module: v.module,
|
|
1473
|
-
function: v.function,
|
|
1474
|
-
property: v.property,
|
|
1475
|
-
text: v.text,
|
|
1476
|
-
kind: "REFUTED",
|
|
1477
|
-
rung: "PROVEN",
|
|
1478
|
-
engine: refuted.outcome.engine,
|
|
1479
|
-
counterexample: refuted.outcome.counterexample ?? { binders: [] },
|
|
1480
|
-
assumptions: refuted.outcome.assumptions
|
|
1481
|
-
};
|
|
1482
|
-
if (proven?.outcome.kind === "PROVEN") return {
|
|
1483
|
-
module: v.module,
|
|
1484
|
-
function: v.function,
|
|
1485
|
-
property: v.property,
|
|
1486
|
-
text: v.text,
|
|
1487
|
-
kind: "PROVEN",
|
|
1488
|
-
engine: proven.outcome.engine,
|
|
1489
|
-
...v.kind === "TESTED" ? { tested: v.inputs } : {},
|
|
1490
|
-
...v.kind === "TESTED" && v.checked !== void 0 ? { checked: v.checked } : v.kind === "CHECKED" ? { checked: v.inputs } : {},
|
|
1491
|
-
assumptions: [...proven.outcome.assumptions, ...v.assumptions]
|
|
1492
|
-
};
|
|
1493
|
-
const notes = says.map((x) => x.outcome.kind === "UNKNOWN" ? `not PROVEN by ${x.engine}: ${x.outcome.cause}: ${x.outcome.reason}` : `${x.engine}: ${x.outcome.kind}`);
|
|
1494
|
-
return {
|
|
1495
|
-
...v,
|
|
1496
|
-
assumptions: [...v.assumptions, ...notes]
|
|
1497
|
-
};
|
|
1498
|
-
});
|
|
1499
|
-
}
|
|
1500
1420
|
// packages/report/src/regression.ts
|
|
1501
1421
|
/**
|
|
1502
1422
|
* The Vitest regression emitter. Given a violation, produce a test file that
|
|
@@ -1701,6 +1621,6 @@ function renderText(verdict) {
|
|
|
1701
1621
|
for (const a of verdict.assumptions) out.push(` - ${a}`);
|
|
1702
1622
|
return out.join("\n");
|
|
1703
1623
|
}
|
|
1704
|
-
export {
|
|
1624
|
+
export { render as _, renderText as a, checkSpecModule as c, shrinkRefutation as d, checkedRung as f, endpointNumber as g, endpointBigInt as h, renderSpecs as i, specLadder as l, conforms as m, renderSpecReport as n, renderTrace as o, evaluate as p, renderSpecReportJson as r, emitRegressionTest as s, renderJson as t, testedRung as u, describeType as v, describeVerdict as y };
|
|
1705
1625
|
|
|
1706
|
-
//# sourceMappingURL=src-
|
|
1626
|
+
//# sourceMappingURL=src-ClXnIi6O.mjs.map
|