eutaxy 0.0.0-stage → 0.5.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.
Files changed (43) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +16 -2
  3. package/dist/aws.d.mts +15464 -0
  4. package/dist/aws.d.mts.map +1 -0
  5. package/dist/aws.mjs +24057 -0
  6. package/dist/aws.mjs.map +1 -0
  7. package/dist/bin.d.mts +1 -0
  8. package/dist/bin.mjs +17 -0
  9. package/dist/bin.mjs.map +1 -0
  10. package/dist/checksum-DhS6ofSm.mjs +6049 -0
  11. package/dist/checksum-DhS6ofSm.mjs.map +1 -0
  12. package/dist/cli-NqY61bpo.mjs +2 -0
  13. package/dist/cli.d.mts +8 -0
  14. package/dist/cli.d.mts.map +1 -0
  15. package/dist/cli.mjs +2 -0
  16. package/dist/cloudflare.d.mts +272 -0
  17. package/dist/cloudflare.d.mts.map +1 -0
  18. package/dist/cloudflare.mjs +1815 -0
  19. package/dist/cloudflare.mjs.map +1 -0
  20. package/dist/es5-DtZuPEgt.mjs +1721 -0
  21. package/dist/es5-DtZuPEgt.mjs.map +1 -0
  22. package/dist/event-streams-BANyO9xt.mjs +801 -0
  23. package/dist/event-streams-BANyO9xt.mjs.map +1 -0
  24. package/dist/explore-BHYvAZKN.d.mts +84 -0
  25. package/dist/explore-BHYvAZKN.d.mts.map +1 -0
  26. package/dist/index.d.mts +252 -0
  27. package/dist/index.d.mts.map +1 -0
  28. package/dist/index.mjs +261 -0
  29. package/dist/index.mjs.map +1 -0
  30. package/dist/platform-eVgCMbX0.d.mts +385 -0
  31. package/dist/platform-eVgCMbX0.d.mts.map +1 -0
  32. package/dist/rolldown-runtime-C1I3wEg2.mjs +43 -0
  33. package/dist/src-BD3jkjgG.mjs +477 -0
  34. package/dist/src-BD3jkjgG.mjs.map +1 -0
  35. package/dist/src-C19_yfMM.mjs +2237 -0
  36. package/dist/src-C19_yfMM.mjs.map +1 -0
  37. package/dist/src-CgfGiH25.mjs +1546 -0
  38. package/dist/src-CgfGiH25.mjs.map +1 -0
  39. package/dist/src-s6uYyC0B.mjs +89 -0
  40. package/dist/src-s6uYyC0B.mjs.map +1 -0
  41. package/dist/verdict-evEM5Gxx.mjs +12 -0
  42. package/dist/verdict-evEM5Gxx.mjs.map +1 -0
  43. package/package.json +76 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-streams-BANyO9xt.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,M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as Schedule, b as Violation, n as Platform, o as ScenarioSpec, r as Bounds } from "./platform-eVgCMbX0.mjs";
2
+ interface BoundsReached {
3
+ readonly runs: number;
4
+ readonly effectPoints: number;
5
+ readonly faultsInjected: number;
6
+ readonly elapsedMs: number;
7
+ /**
8
+ * Present when exploration was exhaustive: how many distinct schedules ran
9
+ * (runs that only repeated an order the reduction had covered are not
10
+ * counted), and whether every schedule within the bounds was reached
11
+ * before the budget ran out.
12
+ */
13
+ readonly exhaustive?: {
14
+ readonly complete: boolean;
15
+ readonly schedules: number;
16
+ readonly reduction: boolean;
17
+ };
18
+ }
19
+ interface VerdictBase {
20
+ readonly scenario: string;
21
+ readonly seed: number | string;
22
+ readonly reached: BoundsReached;
23
+ readonly assumptions: readonly string[];
24
+ }
25
+ interface Shrunk {
26
+ readonly faultsRemoved: number;
27
+ readonly eventsRemoved: number;
28
+ readonly runs: number;
29
+ }
30
+ interface Violated extends VerdictBase {
31
+ readonly kind: "VIOLATED";
32
+ readonly violation: Violation;
33
+ /** The replayed, shrunk trace that breaks the invariant. */
34
+ readonly trace: EffectLog;
35
+ readonly schedule: Schedule;
36
+ /** Ids of the drive's events that remain after shrinking. */
37
+ readonly keptEvents: readonly string[];
38
+ readonly shrunk: Shrunk;
39
+ }
40
+ interface Bounded extends VerdictBase {
41
+ readonly kind: "BOUNDED";
42
+ readonly bounds: Bounds;
43
+ }
44
+ type UnsupportedCause = "unsupported_api" | "not_replayable" | "module_state_leak" | "unsupported_bounds";
45
+ interface Unsupported extends VerdictBase {
46
+ readonly kind: "UNSUPPORTED";
47
+ readonly cause: UnsupportedCause;
48
+ readonly reason: string;
49
+ }
50
+ type ScenarioVerdict = Violated | Bounded | Unsupported;
51
+ /** One line per verdict, for error messages; full rendering lives in `report`. */
52
+ declare function describeVerdict(v: ScenarioVerdict): string;
53
+ interface ExploreOptions {
54
+ readonly seed: number | string;
55
+ /** Hard cap on runs, in addition to the scenario's time budget. */
56
+ readonly maxRuns?: number;
57
+ /** Probability of injecting at an eligible effect point. */
58
+ readonly faultProbability?: number;
59
+ /** Clock for the time budget; injectable for tests. */
60
+ readonly now?: () => number;
61
+ /** Hard cap on replay runs spent shrinking a violation. */
62
+ readonly maxShrinkRuns?: number;
63
+ /**
64
+ * How many of the first exploration runs to replay in reverse order
65
+ * before reporting BOUNDED, to detect module-level state leaking between
66
+ * runs. 0 disables the pass.
67
+ */
68
+ readonly leakCheckRuns?: number;
69
+ /**
70
+ * Explore every schedule within the bounds, each once, instead of drawing
71
+ * schedules from the seed: every fault (or none) at every effect point
72
+ * that may still take one, and every order of turns. With `reduction`
73
+ * (the default), turns of different invocations on different targets
74
+ * commute and only one order of them is run.
75
+ */
76
+ readonly exhaustive?: boolean | {
77
+ readonly reduction?: boolean;
78
+ };
79
+ }
80
+ /** Re-run a recorded schedule exactly. */
81
+ declare function replay(spec: ScenarioSpec, platform: Platform, schedule: Schedule): Promise<EffectLog>;
82
+ declare function explore(spec: ScenarioSpec, platform: Platform, options: ExploreOptions): Promise<ScenarioVerdict>;
83
+ export { BoundsReached as a, Violated as c, Bounded as i, describeVerdict as l, explore as n, ScenarioVerdict as o, replay as r, Unsupported as s, ExploreOptions as t };
84
+ //# sourceMappingURL=explore-BHYvAZKN.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"explore-BHYvAZKN.d.mts","names":[],"sources":["../../core/src/verdict.ts","../../engine/src/explore.ts"],"mappings":";UAOiB;WACN;WACA;WACA;WACA;;;;;;;WAOA;aACE;aACA;aACA;;;UAIH;WACC;WACA;WACA,SAAS;WACT;;UAGM;WACN;WACA;WACA;;UAGM,iBAAiB;WACvB;WACA,WAAW;;WAEX,OAAO;WACP,UAAU;;WAEV;WACA,QAAQ;;UAGF,gBAAgB;WACtB;WACA,QAAQ;;KAGP;UAMK,oBAAoB;WAC1B;WACA,OAAO;WACP;;KAGC,kBAAkB,WAAW,UAAU;;iBAGnC,gBAAgB,GAAG;UC3ClB;WACN;;WAEA;;WAEA;;WAEA;;WAEA;;;;;;WAMA;;;;;;;;WAQA;aAAkC;;;;iBAqKvB,OACpB,MAAM,cACN,UAAU,UACV,UAAU,WACT,QAAQ;iBAIW,QACpB,MAAM,cACN,UAAU,UACV,SAAS,iBACR,QAAQ"}
@@ -0,0 +1,252 @@
1
+ import { C as FaultDecision, D as EffectRecord, E as EffectLog, S as checkInvariants, T as Schedule, _ as RowCondition, b as Violation, d as AtMostOncePerKey, f as EffectSelector, g as Refines, h as Invariant, l as validateScenario, m as Implies, n as Platform, o as ScenarioSpec, p as EveryRow, r as Bounds, t as EventRef, u as AtLeastOnce, v as StateQuery, w as FaultKind, x as checkInvariant, y as Unique } from "./platform-eVgCMbX0.mjs";
2
+ import { a as BoundsReached, c as Violated, i as Bounded, l as describeVerdict, n as explore, o as ScenarioVerdict, r as replay, s as Unsupported, t as ExploreOptions } from "./explore-BHYvAZKN.mjs";
3
+ /**
4
+ * Spec verdicts: what is known about one property of one pure function.
5
+ * Kept apart from scenario verdicts in every report. The ladder starts at
6
+ * `CHECKED` (held on every input the simulator passed); `TESTED` and
7
+ * `PROVEN` come with the provers.
8
+ */
9
+ interface SpecVerdictBase {
10
+ /** The module, as the scenario names it. */
11
+ readonly module: string;
12
+ readonly function: string;
13
+ /** The `@ensures` name, or `@total` / `@throws` for those markers. */
14
+ readonly property: string;
15
+ /** The property as written. */
16
+ readonly text: string;
17
+ readonly assumptions: readonly string[];
18
+ }
19
+ interface Checked extends SpecVerdictBase {
20
+ readonly kind: "CHECKED";
21
+ /** Distinct inputs the property was evaluated on. */
22
+ readonly inputs: number;
23
+ /** Distinct inputs outside the claim: a precondition failed, or a value fell outside its binder's domain. */
24
+ readonly discarded: number;
25
+ }
26
+ /** One assignment that breaks the property, as JavaScript literals, and the call it came from. */
27
+ interface Counterexample {
28
+ /** In the property's binder order. */
29
+ readonly binders: readonly {
30
+ readonly name: string;
31
+ readonly value: string;
32
+ }[];
33
+ readonly call: string;
34
+ /** Set when evaluating the property threw instead of returning false. */
35
+ readonly error?: string;
36
+ }
37
+ interface Refuted extends SpecVerdictBase {
38
+ readonly kind: "REFUTED";
39
+ readonly rung: "CHECKED";
40
+ readonly counterexample: Counterexample;
41
+ }
42
+ type SpecUnknownCause = "gave_up" | "unsupported" | "unavailable";
43
+ interface SpecUnknown extends SpecVerdictBase {
44
+ readonly kind: "UNKNOWN";
45
+ readonly cause: SpecUnknownCause;
46
+ readonly reason: string;
47
+ }
48
+ type SpecVerdict = Checked | Refuted | SpecUnknown;
49
+ /** One line per spec verdict, for error messages; full rendering lives in `report`. */
50
+ export declare function describeSpecVerdict(v: SpecVerdict): string;
51
+ interface ObservedCall {
52
+ readonly function: string;
53
+ /** The arguments as passed; primitives exactly, objects by reference. */
54
+ readonly args: readonly unknown[];
55
+ readonly threw: boolean;
56
+ }
57
+ interface CoreObserver {
58
+ readonly calls: readonly ObservedCall[];
59
+ /** Functions that could not be observed, with why. */
60
+ readonly unobservable: {
61
+ readonly [fn: string]: string;
62
+ };
63
+ /** Put the original exports back. Safe to call twice. */
64
+ restore(): void;
65
+ }
66
+ export declare function observeCore(namespace: object, functions: readonly string[]): CoreObserver;
67
+ /** The scenario restricted to the kept events, with per-message invariants re-derived. */
68
+ export declare function restrictSpec(platform: Platform, spec: ScenarioSpec, keepIds: readonly string[]): ScenarioSpec;
69
+ /**
70
+ * SpecIR: function specs as plain data. The surface syntax is Lemma
71
+ * (https://github.com/jessealama/lemma-lang, grammar.ebnf and
72
+ * semantics.md); the IR is Eutaxy's own, so engines and the simulator read
73
+ * one shape whatever the annotation looked like. Leaves are opaque
74
+ * TypeScript expressions, kept as written.
75
+ */
76
+ /** Lemma's binder domains. */
77
+ type Domain = "int" | "nat" | "number" | "boolean" | "string" | "bigint";
78
+ /**
79
+ * One end of an interval: a numeric literal as written (sign included), or
80
+ * `∞` / `-∞` for either infinity. `[` and `]` include the endpoint.
81
+ */
82
+ interface Endpoint {
83
+ readonly value: string;
84
+ readonly inclusive: boolean;
85
+ }
86
+ /** A binder's constraint: an interval for numeric domains, a whole-string regex for `string`. */
87
+ type Guard = {
88
+ readonly kind: "interval";
89
+ readonly lower: Endpoint;
90
+ readonly upper: Endpoint;
91
+ } | {
92
+ readonly kind: "regex";
93
+ readonly pattern: string;
94
+ readonly flags: string;
95
+ };
96
+ interface Binder {
97
+ readonly name: string;
98
+ readonly domain: Domain;
99
+ readonly guard?: Guard;
100
+ }
101
+ /**
102
+ * A formula over boolean atoms. Atoms and equation sides are TypeScript
103
+ * expressions, verbatim. `and` and `or` are n-ary (both are associative);
104
+ * `implies` keeps Lemma's chain: every segment but the last is an
105
+ * antecedent. An implication at a property's root is not a formula node but
106
+ * the property's preconditions (`Property.requires`).
107
+ */
108
+ type Formula = {
109
+ readonly kind: "atom";
110
+ readonly text: string;
111
+ } | {
112
+ readonly kind: "equation";
113
+ readonly left: string;
114
+ readonly right: string;
115
+ /** `≢` rather than `≡`. */
116
+ readonly negated: boolean;
117
+ } | {
118
+ readonly kind: "not";
119
+ readonly operand: Formula;
120
+ } | {
121
+ readonly kind: "and" | "or";
122
+ readonly operands: readonly Formula[];
123
+ } | {
124
+ readonly kind: "implies";
125
+ readonly antecedents: readonly Formula[];
126
+ readonly consequent: Formula;
127
+ } | {
128
+ readonly kind: "iff";
129
+ readonly left: Formula;
130
+ readonly right: Formula;
131
+ };
132
+ /**
133
+ * A universally quantified claim: for every assignment of the binders from
134
+ * their (guarded) domains where every precondition holds, `claim` holds.
135
+ * Assignments failing a precondition are outside the claim.
136
+ */
137
+ interface Property {
138
+ readonly binders: readonly Binder[];
139
+ readonly requires: readonly Formula[];
140
+ readonly claim: Formula;
141
+ }
142
+ /** An `@ensures{name}` annotation. */
143
+ interface NamedProperty {
144
+ readonly name: string;
145
+ readonly property: Property;
146
+ /** The annotation's property text, as written. */
147
+ readonly text: string;
148
+ }
149
+ /** The specs on one exported function. */
150
+ interface FunctionSpec {
151
+ readonly name: string;
152
+ /** Parameter names in order; null for a destructured or rest parameter. */
153
+ readonly params: readonly (string | null)[];
154
+ readonly ensures: readonly NamedProperty[];
155
+ /** `@total`: the function terminates on every input. */
156
+ readonly total: boolean;
157
+ /** `@throws`: the function throws (Lemma has not fixed its semantics yet). */
158
+ readonly throws: boolean;
159
+ /** 1-based line of the declaration. */
160
+ readonly line: number;
161
+ }
162
+ /** A problem with an annotation, located in the module. */
163
+ interface SpecError {
164
+ readonly line: number;
165
+ readonly message: string;
166
+ }
167
+ /** Every spec in one module, the names it exports, and the annotations that did not parse. */
168
+ interface ModuleSpecs {
169
+ readonly functions: readonly FunctionSpec[];
170
+ readonly exports: readonly string[];
171
+ readonly errors: readonly SpecError[];
172
+ }
173
+ export declare function extractSpecs(source: string): ModuleSpecs;
174
+ /** A property that is not Lemma. `stage` says which part rejected it. */
175
+ export declare class LemmaSyntaxError extends Error {
176
+ readonly stage: "prefix" | "formula";
177
+ constructor(stage: "prefix" | "formula", message: string);
178
+ }
179
+ /** Parse the text after `@ensures{name}`. Throws LemmaSyntaxError. */
180
+ export declare function parseProperty(text: string): Property;
181
+ /** The outcome a predicate returns for one assignment. */
182
+ type PredicateOutcome = "held" | "discarded" | "refuted";
183
+ /** The property as Lemma text (what follows `@ensures{name}`). */
184
+ export declare function printProperty(p: Property): string;
185
+ /** What generated predicates call when free names did not resolve. */
186
+ export declare function lemmaUnresolved(names: readonly string[]): never;
187
+ /** The atom check generated predicates call: its argument when it is a boolean. */
188
+ export declare function lemmaBool(value: unknown): boolean;
189
+ interface CheckedInput {
190
+ readonly module: string;
191
+ readonly fn: FunctionSpec;
192
+ readonly property: NamedProperty;
193
+ /** The calls the simulator made, with their arguments. */
194
+ readonly calls: readonly {
195
+ readonly args: readonly unknown[];
196
+ }[];
197
+ /** The compiled predicate over the binders, or undefined when it could not be built. */
198
+ readonly predicate: ((...binders: never[]) => PredicateOutcome) | undefined;
199
+ /** Why the function's calls could not be observed, when they could not. */
200
+ readonly unobservable?: string;
201
+ }
202
+ export declare function checkedRung(input: CheckedInput): SpecVerdict;
203
+ /** Compiled predicates of a module, by function and property name. */
204
+ interface ModulePredicates {
205
+ readonly [fn: string]: {
206
+ readonly [property: string]: (...binders: never[]) => PredicateOutcome;
207
+ };
208
+ }
209
+ /** Every spec verdict for one module, from what was observed of its calls. */
210
+ export declare function checkSpecModule(module: string, specs: ModuleSpecs, predicates: ModulePredicates, observed: {
211
+ readonly calls: readonly {
212
+ readonly function: string;
213
+ readonly args: readonly unknown[];
214
+ }[];
215
+ readonly unobservable: {
216
+ readonly [fn: string]: string;
217
+ };
218
+ }): SpecVerdict[];
219
+ interface RegressionTestOptions {
220
+ /** Import lines for the scenario, the platform's dependencies, and anything the platform expression needs. */
221
+ readonly imports: readonly string[];
222
+ /** An expression evaluating to the `Platform` (may reference the imports). */
223
+ readonly platform: string;
224
+ /** An expression evaluating to the `ScenarioSpec`. */
225
+ readonly scenario: string;
226
+ /** Module that exports `replay`, `restrictSpec` and `checkInvariants`; the public facade by default. */
227
+ readonly engineModule?: string;
228
+ readonly expect?: "holds" | "violates";
229
+ /**
230
+ * Core functions to observe during the replay, as `refines` needs their
231
+ * decisions in the log: an expression for each module's namespace (from
232
+ * the imports) and the functions to observe on it.
233
+ */
234
+ readonly observe?: readonly {
235
+ readonly namespace: string;
236
+ readonly functions: readonly string[];
237
+ }[];
238
+ }
239
+ export declare function emitRegressionTest(verdict: Violated, options: RegressionTestOptions): string;
240
+ /**
241
+ * The JSON report: one object, canonical, with a schema version at the top.
242
+ * Spec verdicts, when there are any, sit beside the scenario's, never in it.
243
+ */
244
+ export declare function renderJson(verdict: ScenarioVerdict, specs?: readonly SpecVerdict[]): string;
245
+ /** Spec verdicts as text: one line each, a counterexample under a refutation. */
246
+ export declare function renderSpecs(specs: readonly SpecVerdict[]): string;
247
+ /** The trace as a fixed-width table; evidence rows are marked with `*`. */
248
+ export declare function renderTrace(log: EffectLog, evidence?: readonly number[]): string;
249
+ /** A readable report: verdict, what it rests on, and for a violation the schedule and trace. */
250
+ export declare function renderText(verdict: ScenarioVerdict): string;
251
+ export { type AtLeastOnce, type AtMostOncePerKey, type Binder, type Bounded, type Bounds, type BoundsReached, type Checked, type CoreObserver, type Counterexample, type Domain, type EffectLog, type EffectRecord, type EffectSelector, type EventRef, type EveryRow, type ExploreOptions, type FaultDecision, type FaultKind, type Formula, type FunctionSpec, type Guard, type Implies, type Invariant, type ModulePredicates, type ModuleSpecs, type NamedProperty, type ObservedCall, type Platform, type Property, type Refines, type Refuted, type RegressionTestOptions, type RowCondition, type ScenarioSpec, type ScenarioVerdict, type Schedule, type SpecUnknown, type SpecVerdict, type StateQuery, type Unique, type Unsupported, type Violated, type Violation, checkInvariant, checkInvariants, describeVerdict, explore, replay, validateScenario };
252
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../core/src/spec-verdict.ts","../../engine/src/observe.ts","../../engine/src/shrink.ts","../../spec/src/ir.ts","../../spec/src/extract.ts","../../spec/src/parse.ts","../../spec/src/predicate.ts","../../spec/src/print.ts","../../prover/src/checked.ts","../../report/src/regression.ts","../../report/src/render.ts"],"mappings":";;;;;;;;UAOU;;WAEC;WACA;;WAEA;;WAEA;WACA;;UAGM,gBAAgB;WACtB;;WAEA;;WAEA;;;UAIM;;WAEN;aAA6B;aAAuB;;WACpD;;WAEA;;UAGM,gBAAgB;WACtB;WACA;WACA,gBAAgB;;KAGf;UAEK,oBAAoB;WAC1B;WACA,OAAO;WACP;;KAGC,cAAc,UAAU,UAAU;;wBAG9B,oBAAoB,GAAG;UCnCtB;WACN;;WAEA;WACA;;UAGM;WACN,gBAAgB;;WAEhB;cAA0B;;;EAEnC;;wBA0Cc,YAAY,mBAAmB,+BAA+B;;wBCjC9D,aACd,UAAU,UACV,MAAM,cACN,6BACC;;;;;;;;;KCjCS;;;;;UAQK;WACN;WACA;;;KAIC;WACG;WAA2B,OAAO;WAAmB,OAAO;;WAC5D;WAAwB;WAA0B;;UAEhD;WACN;WACA,QAAQ;WACR,QAAQ;;;;;;;;;KAUP;WAC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