@sm-lab/recipes 0.2.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 +164 -0
- package/dist/cl-activate-CPqr6v_D.mjs +653 -0
- package/dist/cl-activate-CPqr6v_D.mjs.map +1 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +1353 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/cm.d.mts +87 -0
- package/dist/cm.d.mts.map +1 -0
- package/dist/cm.mjs +305 -0
- package/dist/cm.mjs.map +1 -0
- package/dist/context-BiYdAnKn.d.mts +8397 -0
- package/dist/context-BiYdAnKn.d.mts.map +1 -0
- package/dist/index.d.mts +393 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/topup-B2NzJV7_.mjs +437 -0
- package/dist/topup-B2NzJV7_.mjs.map +1 -0
- package/package.json +65 -0
package/dist/cli.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.mjs","names":["#body","#init","#eventInitDict","operatorId"],"sources":["../../../node_modules/.pnpm/hono@4.12.27/node_modules/hono/dist/helper/websocket/index.js","../../../node_modules/.pnpm/@hono+node-server@2.0.6_hono@4.12.27/node_modules/@hono/node-server/dist/index.mjs","../../../packages/core/src/admin.ts","../../../packages/core/src/cli.ts","../../../packages/core/src/completion.ts","../src/cli/define.ts","../src/cli/commands/shared.ts","../src/cli/commands/cm.ts","../src/cli/commands/csm.ts","../src/cli/program.ts","../src/cli/index.ts"],"sourcesContent":["// src/helper/websocket/index.ts\nvar WSContext = class {\n #init;\n constructor(init) {\n this.#init = init;\n this.raw = init.raw;\n this.url = init.url ? new URL(init.url) : null;\n this.protocol = init.protocol ?? null;\n }\n send(source, options) {\n this.#init.send(source, options ?? {});\n }\n raw;\n binaryType = \"arraybuffer\";\n get readyState() {\n return this.#init.readyState;\n }\n url;\n protocol;\n close(code, reason) {\n this.#init.close(code, reason);\n }\n};\nvar createWSMessageEvent = (source) => {\n return new MessageEvent(\"message\", {\n data: source\n });\n};\nvar defineWebSocketHelper = (handler) => {\n return ((...args) => {\n if (typeof args[0] === \"function\") {\n const [createEvents, options] = args;\n return async function upgradeWebSocket(c, next) {\n const events = await createEvents(c);\n const result = await handler(c, events, options);\n if (result) {\n return result;\n }\n await next();\n };\n } else {\n const [c, events, options] = args;\n return (async () => {\n const upgraded = await handler(c, events, options);\n if (!upgraded) {\n throw new Error(\"Failed to upgrade WebSocket\");\n }\n return upgraded;\n })();\n }\n });\n};\nexport {\n WSContext,\n createWSMessageEvent,\n defineWebSocketHelper\n};\n","import { t as X_ALREADY_SENT } from \"./constants-BLSFu_RU.mjs\";\nimport { STATUS_CODES, createServer } from \"node:http\";\nimport { Http2ServerRequest, constants } from \"node:http2\";\nimport { Readable } from \"node:stream\";\nimport { defineWebSocketHelper } from \"hono/ws\";\n\n//#region src/error.ts\nvar RequestError = class extends Error {\n\tconstructor(message, options) {\n\t\tsuper(message, options);\n\t\tthis.name = \"RequestError\";\n\t}\n};\n\n//#endregion\n//#region src/url.ts\nconst reValidRequestUrl = /^\\/[!#$&-;=?-\\[\\]_a-z~]*$/;\nconst reDotSegment = /\\/\\.\\.?(?:[/?#]|$)/;\nconst reValidHost = /^[a-z0-9._-]+(?::(?:[1-5]\\d{3,4}|[6-9]\\d{3}))?$/;\nconst buildUrl = (scheme, host, incomingUrl) => {\n\tconst url = `${scheme}://${host}${incomingUrl}`;\n\tif (!reValidHost.test(host)) {\n\t\tconst urlObj = new URL(url);\n\t\tif (urlObj.hostname.length !== host.length && urlObj.hostname !== (host.includes(\":\") ? host.replace(/:\\d+$/, \"\") : host).toLowerCase()) throw new RequestError(\"Invalid host header\");\n\t\treturn urlObj.href;\n\t} else if (incomingUrl.length === 0) return url + \"/\";\n\telse {\n\t\tif (incomingUrl.charCodeAt(0) !== 47) throw new RequestError(\"Invalid URL\");\n\t\tif (!reValidRequestUrl.test(incomingUrl) || reDotSegment.test(incomingUrl)) return new URL(url).href;\n\t\treturn url;\n\t}\n};\n\n//#endregion\n//#region src/request.ts\nconst toRequestError = (e) => {\n\tif (e instanceof RequestError) return e;\n\treturn new RequestError(e.message, { cause: e });\n};\nconst GlobalRequest = global.Request;\nvar Request$1 = class extends GlobalRequest {\n\tconstructor(input, options) {\n\t\tif (typeof input === \"object\" && getRequestCache in input) {\n\t\t\tconst hasReplacementBody = options !== void 0 && \"body\" in options && options.body != null;\n\t\t\tif (input[bodyConsumedDirectlyKey] && !hasReplacementBody) throw new TypeError(\"Cannot construct a Request with a Request object that has already been used.\");\n\t\t\tinput = input[getRequestCache]();\n\t\t}\n\t\tif (typeof (options?.body)?.getReader !== \"undefined\") options.duplex ??= \"half\";\n\t\tsuper(input, options);\n\t}\n};\nconst newHeadersFromIncoming = (incoming) => {\n\tconst headerRecord = [];\n\tconst rawHeaders = incoming.rawHeaders;\n\tfor (let i = 0, len = rawHeaders.length; i < len; i += 2) {\n\t\tconst key = rawHeaders[i];\n\t\tif (key.charCodeAt(0) !== 58) headerRecord.push([key, rawHeaders[i + 1]]);\n\t}\n\treturn new Headers(headerRecord);\n};\nconst wrapBodyStream = Symbol(\"wrapBodyStream\");\nconst newRequestFromIncoming = (method, url, headers, incoming, abortController) => {\n\tconst init = {\n\t\tmethod,\n\t\theaders,\n\t\tsignal: abortController.signal\n\t};\n\tif (method === \"TRACE\") {\n\t\tinit.method = \"GET\";\n\t\tconst req = new Request$1(url, init);\n\t\tObject.defineProperty(req, \"method\", { get() {\n\t\t\treturn \"TRACE\";\n\t\t} });\n\t\treturn req;\n\t}\n\tif (!(method === \"GET\" || method === \"HEAD\")) if (\"rawBody\" in incoming && incoming.rawBody instanceof Buffer) init.body = new ReadableStream({ start(controller) {\n\t\tcontroller.enqueue(incoming.rawBody);\n\t\tcontroller.close();\n\t} });\n\telse if (incoming[wrapBodyStream]) {\n\t\tlet reader;\n\t\tinit.body = new ReadableStream({ async pull(controller) {\n\t\t\ttry {\n\t\t\t\treader ||= Readable.toWeb(incoming).getReader();\n\t\t\t\tconst { done, value } = await reader.read();\n\t\t\t\tif (done) controller.close();\n\t\t\t\telse controller.enqueue(value);\n\t\t\t} catch (error) {\n\t\t\t\tcontroller.error(error);\n\t\t\t}\n\t\t} });\n\t} else init.body = Readable.toWeb(incoming);\n\treturn new Request$1(url, init);\n};\nconst getRequestCache = Symbol(\"getRequestCache\");\nconst requestCache = Symbol(\"requestCache\");\nconst incomingKey = Symbol(\"incomingKey\");\nconst urlKey = Symbol(\"urlKey\");\nconst methodKey = Symbol(\"methodKey\");\nconst headersKey = Symbol(\"headersKey\");\nconst abortControllerKey = Symbol(\"abortControllerKey\");\nconst getAbortController = Symbol(\"getAbortController\");\nconst abortRequest = Symbol(\"abortRequest\");\nconst bodyBufferKey = Symbol(\"bodyBuffer\");\nconst bodyReadPromiseKey = Symbol(\"bodyReadPromise\");\nconst bodyConsumedDirectlyKey = Symbol(\"bodyConsumedDirectly\");\nconst bodyLockReaderKey = Symbol(\"bodyLockReader\");\nconst abortReasonKey = Symbol(\"abortReason\");\nconst newBodyUnusableError = () => {\n\treturn /* @__PURE__ */ new TypeError(\"Body is unusable\");\n};\nconst rejectBodyUnusable = () => {\n\treturn Promise.reject(newBodyUnusableError());\n};\nconst textDecoder = new TextDecoder();\nconst consumeBodyDirectOnce = (request) => {\n\tif (request[bodyConsumedDirectlyKey]) return rejectBodyUnusable();\n\trequest[bodyConsumedDirectlyKey] = true;\n};\nconst toArrayBuffer = (buf) => {\n\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n};\nconst contentType = (request) => {\n\treturn (request[headersKey] ||= newHeadersFromIncoming(request[incomingKey])).get(\"content-type\") || \"\";\n};\nconst methodTokenRegExp = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/;\nconst normalizeIncomingMethod = (method) => {\n\tif (typeof method !== \"string\" || method.length === 0) return \"GET\";\n\tswitch (method) {\n\t\tcase \"DELETE\":\n\t\tcase \"GET\":\n\t\tcase \"HEAD\":\n\t\tcase \"OPTIONS\":\n\t\tcase \"POST\":\n\t\tcase \"PUT\": return method;\n\t}\n\tconst upper = method.toUpperCase();\n\tswitch (upper) {\n\t\tcase \"DELETE\":\n\t\tcase \"GET\":\n\t\tcase \"HEAD\":\n\t\tcase \"OPTIONS\":\n\t\tcase \"POST\":\n\t\tcase \"PUT\": return upper;\n\t\tdefault: return method;\n\t}\n};\nconst validateDirectReadMethod = (method) => {\n\tif (!methodTokenRegExp.test(method)) return /* @__PURE__ */ new TypeError(`'${method}' is not a valid HTTP method.`);\n\tconst normalized = method.toUpperCase();\n\tif (normalized === \"CONNECT\" || normalized === \"TRACK\" || normalized === \"TRACE\" && method !== \"TRACE\") return /* @__PURE__ */ new TypeError(`'${method}' HTTP method is unsupported.`);\n};\nconst readBodyWithFastPath = (request, method, fromBuffer) => {\n\tif (request[bodyConsumedDirectlyKey]) return rejectBodyUnusable();\n\tconst methodName = request.method;\n\tif (methodName === \"GET\" || methodName === \"HEAD\") return request[getRequestCache]()[method]();\n\tconst methodValidationError = validateDirectReadMethod(methodName);\n\tif (methodValidationError) return Promise.reject(methodValidationError);\n\tif (request[requestCache]) {\n\t\tif (methodName !== \"TRACE\") return request[requestCache][method]();\n\t}\n\tconst alreadyUsedError = consumeBodyDirectOnce(request);\n\tif (alreadyUsedError) return alreadyUsedError;\n\tconst raw = readRawBodyIfAvailable(request);\n\tif (raw) {\n\t\tconst result = Promise.resolve(fromBuffer(raw, request));\n\t\trequest[bodyBufferKey] = void 0;\n\t\treturn result;\n\t}\n\treturn readBodyDirect(request).then((buf) => {\n\t\tconst result = fromBuffer(buf, request);\n\t\trequest[bodyBufferKey] = void 0;\n\t\treturn result;\n\t});\n};\nconst readRawBodyIfAvailable = (request) => {\n\tconst incoming = request[incomingKey];\n\tif (\"rawBody\" in incoming && incoming.rawBody instanceof Buffer) return incoming.rawBody;\n};\nconst readBodyDirect = (request) => {\n\tif (request[bodyBufferKey]) return Promise.resolve(request[bodyBufferKey]);\n\tif (request[bodyReadPromiseKey]) return request[bodyReadPromiseKey];\n\tconst incoming = request[incomingKey];\n\tif (Readable.isDisturbed(incoming)) return rejectBodyUnusable();\n\tconst promise = new Promise((resolve, reject) => {\n\t\tconst chunks = [];\n\t\tlet settled = false;\n\t\tconst finish = (callback) => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tcleanup();\n\t\t\tcallback();\n\t\t};\n\t\tconst onData = (chunk) => {\n\t\t\tchunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));\n\t\t};\n\t\tconst onEnd = () => {\n\t\t\tfinish(() => {\n\t\t\t\tconst buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks);\n\t\t\t\trequest[bodyBufferKey] = buffer;\n\t\t\t\tresolve(buffer);\n\t\t\t});\n\t\t};\n\t\tconst onError = (error) => {\n\t\t\tfinish(() => {\n\t\t\t\treject(error);\n\t\t\t});\n\t\t};\n\t\tconst onClose = () => {\n\t\t\tif (incoming.readableEnded) {\n\t\t\t\tonEnd();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfinish(() => {\n\t\t\t\tif (incoming.errored) {\n\t\t\t\t\treject(incoming.errored);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst reason = request[abortReasonKey];\n\t\t\t\tif (reason !== void 0) {\n\t\t\t\t\treject(reason instanceof Error ? reason : new Error(String(reason)));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treject(/* @__PURE__ */ new Error(\"Client connection prematurely closed.\"));\n\t\t\t});\n\t\t};\n\t\tconst cleanup = () => {\n\t\t\tincoming.off(\"data\", onData);\n\t\t\tincoming.off(\"end\", onEnd);\n\t\t\tincoming.off(\"error\", onError);\n\t\t\tincoming.off(\"close\", onClose);\n\t\t\trequest[bodyReadPromiseKey] = void 0;\n\t\t};\n\t\tincoming.on(\"data\", onData);\n\t\tincoming.on(\"end\", onEnd);\n\t\tincoming.on(\"error\", onError);\n\t\tincoming.on(\"close\", onClose);\n\t\tqueueMicrotask(() => {\n\t\t\tif (settled) return;\n\t\t\tif (incoming.readableEnded) onEnd();\n\t\t\telse if (incoming.errored) onError(incoming.errored);\n\t\t\telse if (incoming.destroyed) onClose();\n\t\t});\n\t});\n\trequest[bodyReadPromiseKey] = promise;\n\treturn promise;\n};\nconst requestPrototype = {\n\tget method() {\n\t\treturn this[methodKey];\n\t},\n\tget url() {\n\t\treturn this[urlKey];\n\t},\n\tget headers() {\n\t\treturn this[headersKey] ||= newHeadersFromIncoming(this[incomingKey]);\n\t},\n\t[abortRequest](reason) {\n\t\tif (this[abortReasonKey] === void 0) this[abortReasonKey] = reason;\n\t\tconst abortController = this[abortControllerKey];\n\t\tif (abortController && !abortController.signal.aborted) abortController.abort(reason);\n\t},\n\t[getAbortController]() {\n\t\tthis[abortControllerKey] ||= new AbortController();\n\t\tif (this[abortReasonKey] !== void 0 && !this[abortControllerKey].signal.aborted) this[abortControllerKey].abort(this[abortReasonKey]);\n\t\treturn this[abortControllerKey];\n\t},\n\t[getRequestCache]() {\n\t\tconst abortController = this[getAbortController]();\n\t\tif (this[requestCache]) return this[requestCache];\n\t\tconst method = this.method;\n\t\tif (this[bodyConsumedDirectlyKey] && !(method === \"GET\" || method === \"HEAD\")) {\n\t\t\tthis[bodyBufferKey] = void 0;\n\t\t\tconst init = {\n\t\t\t\tmethod: method === \"TRACE\" ? \"GET\" : method,\n\t\t\t\theaders: this.headers,\n\t\t\t\tsignal: abortController.signal\n\t\t\t};\n\t\t\tif (method !== \"TRACE\") {\n\t\t\t\tinit.body = new ReadableStream({ start(c) {\n\t\t\t\t\tc.close();\n\t\t\t\t} });\n\t\t\t\tinit.duplex = \"half\";\n\t\t\t}\n\t\t\tconst req = new Request$1(this[urlKey], init);\n\t\t\tif (method === \"TRACE\") Object.defineProperty(req, \"method\", { get() {\n\t\t\t\treturn \"TRACE\";\n\t\t\t} });\n\t\t\treturn this[requestCache] = req;\n\t\t}\n\t\treturn this[requestCache] = newRequestFromIncoming(this.method, this[urlKey], this.headers, this[incomingKey], abortController);\n\t},\n\tget body() {\n\t\tif (!this[bodyConsumedDirectlyKey]) return this[getRequestCache]().body;\n\t\tconst request = this[getRequestCache]();\n\t\tif (!this[bodyLockReaderKey] && request.body) this[bodyLockReaderKey] = request.body.getReader();\n\t\treturn request.body;\n\t},\n\tget bodyUsed() {\n\t\tif (this[bodyConsumedDirectlyKey]) return true;\n\t\tif (this[requestCache]) return this[requestCache].bodyUsed;\n\t\treturn false;\n\t}\n};\nObject.defineProperty(requestPrototype, \"signal\", { get() {\n\treturn this[getAbortController]().signal;\n} });\n[\n\t\"cache\",\n\t\"credentials\",\n\t\"destination\",\n\t\"integrity\",\n\t\"mode\",\n\t\"redirect\",\n\t\"referrer\",\n\t\"referrerPolicy\",\n\t\"keepalive\"\n].forEach((k) => {\n\tObject.defineProperty(requestPrototype, k, { get() {\n\t\treturn this[getRequestCache]()[k];\n\t} });\n});\n[\"clone\", \"formData\"].forEach((k) => {\n\tObject.defineProperty(requestPrototype, k, { value: function() {\n\t\tif (this[bodyConsumedDirectlyKey]) {\n\t\t\tif (k === \"clone\") throw newBodyUnusableError();\n\t\t\treturn rejectBodyUnusable();\n\t\t}\n\t\treturn this[getRequestCache]()[k]();\n\t} });\n});\nObject.defineProperty(requestPrototype, \"text\", { value: function() {\n\treturn readBodyWithFastPath(this, \"text\", (buf) => textDecoder.decode(buf));\n} });\nObject.defineProperty(requestPrototype, \"arrayBuffer\", { value: function() {\n\treturn readBodyWithFastPath(this, \"arrayBuffer\", (buf) => toArrayBuffer(buf));\n} });\nObject.defineProperty(requestPrototype, \"blob\", { value: function() {\n\treturn readBodyWithFastPath(this, \"blob\", (buf, request) => {\n\t\tconst type = contentType(request);\n\t\tconst init = type ? { headers: { \"content-type\": type } } : void 0;\n\t\treturn new Response(buf, init).blob();\n\t});\n} });\nObject.defineProperty(requestPrototype, \"json\", { value: function() {\n\tif (this[bodyConsumedDirectlyKey]) return rejectBodyUnusable();\n\treturn this.text().then(JSON.parse);\n} });\nObject.defineProperty(requestPrototype, Symbol.for(\"nodejs.util.inspect.custom\"), { value: function(depth, options, inspectFn) {\n\treturn `Request (lightweight) ${inspectFn({\n\t\tmethod: this.method,\n\t\turl: this.url,\n\t\theaders: this.headers,\n\t\tnativeRequest: this[requestCache]\n\t}, {\n\t\t...options,\n\t\tdepth: depth == null ? null : depth - 1\n\t})}`;\n} });\nObject.setPrototypeOf(requestPrototype, Request$1.prototype);\nconst newRequest = (incoming, defaultHostname) => {\n\tconst req = Object.create(requestPrototype);\n\treq[incomingKey] = incoming;\n\treq[methodKey] = normalizeIncomingMethod(incoming.method);\n\tconst incomingUrl = incoming.url || \"\";\n\tif (incomingUrl[0] !== \"/\" && (incomingUrl.startsWith(\"http://\") || incomingUrl.startsWith(\"https://\"))) {\n\t\tif (incoming instanceof Http2ServerRequest) throw new RequestError(\"Absolute URL for :path is not allowed in HTTP/2\");\n\t\ttry {\n\t\t\treq[urlKey] = new URL(incomingUrl).href;\n\t\t} catch (e) {\n\t\t\tthrow new RequestError(\"Invalid absolute URL\", { cause: e });\n\t\t}\n\t\treturn req;\n\t}\n\tconst host = (incoming instanceof Http2ServerRequest ? incoming.authority : incoming.headers.host) || defaultHostname;\n\tif (!host) throw new RequestError(\"Missing host header\");\n\tlet scheme;\n\tif (incoming instanceof Http2ServerRequest) {\n\t\tscheme = incoming.scheme;\n\t\tif (!(scheme === \"http\" || scheme === \"https\")) throw new RequestError(\"Unsupported scheme\");\n\t} else scheme = incoming.socket && incoming.socket.encrypted ? \"https\" : \"http\";\n\ttry {\n\t\treq[urlKey] = buildUrl(scheme, host, incomingUrl);\n\t} catch (e) {\n\t\tif (e instanceof RequestError) throw e;\n\t\telse throw new RequestError(\"Invalid URL\", { cause: e });\n\t}\n\treturn req;\n};\n\n//#endregion\n//#region src/response.ts\nconst defaultContentType = \"text/plain; charset=UTF-8\";\nconst responseCache = Symbol(\"responseCache\");\nconst getResponseCache = Symbol(\"getResponseCache\");\nconst cacheKey = Symbol(\"cache\");\nconst GlobalResponse = global.Response;\nvar Response$1 = class Response$1 {\n\t#body;\n\t#init;\n\t[getResponseCache]() {\n\t\tconst cache = this[cacheKey];\n\t\tconst liveHeaders = cache && cache[2] instanceof Headers ? cache[2] : void 0;\n\t\tdelete this[cacheKey];\n\t\treturn this[responseCache] ||= new GlobalResponse(this.#body, liveHeaders ? {\n\t\t\tstatus: this.#init?.status,\n\t\t\tstatusText: this.#init?.statusText,\n\t\t\theaders: liveHeaders\n\t\t} : this.#init);\n\t}\n\tconstructor(body, init) {\n\t\tlet headers;\n\t\tthis.#body = body;\n\t\tif (init instanceof Response$1) {\n\t\t\tconst cachedGlobalResponse = init[responseCache];\n\t\t\tif (cachedGlobalResponse) {\n\t\t\t\tthis.#init = cachedGlobalResponse;\n\t\t\t\tthis[getResponseCache]();\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tthis.#init = init.#init;\n\t\t\t\theaders = new Headers(init.headers);\n\t\t\t}\n\t\t} else this.#init = init;\n\t\tif (body == null || typeof body === \"string\" || typeof body?.getReader !== \"undefined\" || body instanceof Blob || body instanceof Uint8Array) this[cacheKey] = [\n\t\t\tinit?.status || 200,\n\t\t\tbody ?? null,\n\t\t\theaders || init?.headers\n\t\t];\n\t}\n\tget headers() {\n\t\tconst cache = this[cacheKey];\n\t\tif (cache) {\n\t\t\tif (!(cache[2] instanceof Headers)) cache[2] = new Headers(cache[2] || (cache[1] === null ? void 0 : { \"content-type\": defaultContentType }));\n\t\t\treturn cache[2];\n\t\t}\n\t\treturn this[getResponseCache]().headers;\n\t}\n\tget status() {\n\t\treturn this[cacheKey]?.[0] ?? this[getResponseCache]().status;\n\t}\n\tget ok() {\n\t\tconst status = this.status;\n\t\treturn status >= 200 && status < 300;\n\t}\n};\n[\n\t\"body\",\n\t\"bodyUsed\",\n\t\"redirected\",\n\t\"statusText\",\n\t\"trailers\",\n\t\"type\",\n\t\"url\"\n].forEach((k) => {\n\tObject.defineProperty(Response$1.prototype, k, { get() {\n\t\treturn this[getResponseCache]()[k];\n\t} });\n});\n[\n\t\"arrayBuffer\",\n\t\"blob\",\n\t\"clone\",\n\t\"formData\",\n\t\"json\",\n\t\"text\"\n].forEach((k) => {\n\tObject.defineProperty(Response$1.prototype, k, { value: function() {\n\t\treturn this[getResponseCache]()[k]();\n\t} });\n});\nObject.defineProperty(Response$1.prototype, Symbol.for(\"nodejs.util.inspect.custom\"), { value: function(depth, options, inspectFn) {\n\treturn `Response (lightweight) ${inspectFn({\n\t\tstatus: this.status,\n\t\theaders: this.headers,\n\t\tok: this.ok,\n\t\tnativeResponse: this[responseCache]\n\t}, {\n\t\t...options,\n\t\tdepth: depth == null ? null : depth - 1\n\t})}`;\n} });\nObject.setPrototypeOf(Response$1, GlobalResponse);\nObject.setPrototypeOf(Response$1.prototype, GlobalResponse.prototype);\nconst validRedirectUrl = /^https?:\\/\\/[!#-;=?-[\\]_a-z~A-Z]+$/;\nconst parseRedirectUrl = (url) => {\n\tif (url instanceof URL) return url.href;\n\tif (validRedirectUrl.test(url)) return url;\n\treturn new URL(url).href;\n};\nconst validRedirectStatuses = new Set([\n\t301,\n\t302,\n\t303,\n\t307,\n\t308\n]);\nObject.defineProperty(Response$1, \"redirect\", {\n\tvalue: function redirect(url, status = 302) {\n\t\tif (!validRedirectStatuses.has(status)) throw new RangeError(\"Invalid status code\");\n\t\treturn new Response$1(null, {\n\t\t\tstatus,\n\t\t\theaders: { location: parseRedirectUrl(url) }\n\t\t});\n\t},\n\twritable: true,\n\tconfigurable: true\n});\nObject.defineProperty(Response$1, \"json\", {\n\tvalue: function json(data, init) {\n\t\tconst body = JSON.stringify(data);\n\t\tif (body === void 0) throw new TypeError(\"The data is not JSON serializable\");\n\t\tconst initHeaders = init?.headers;\n\t\tlet headers;\n\t\tif (initHeaders) {\n\t\t\theaders = new Headers(initHeaders);\n\t\t\tif (!headers.has(\"content-type\")) headers.set(\"content-type\", \"application/json\");\n\t\t} else headers = { \"content-type\": \"application/json\" };\n\t\treturn new Response$1(body, {\n\t\t\tstatus: init?.status ?? 200,\n\t\t\tstatusText: init?.statusText,\n\t\t\theaders\n\t\t});\n\t},\n\twritable: true,\n\tconfigurable: true\n});\n\n//#endregion\n//#region src/utils.ts\nasync function readWithoutBlocking(readPromise) {\n\treturn Promise.race([readPromise, Promise.resolve().then(() => Promise.resolve(void 0))]);\n}\nfunction writeFromReadableStreamDefaultReader(reader, writable, currentReadPromise) {\n\tconst cancel = (error) => {\n\t\treader.cancel(error).catch(() => {});\n\t};\n\twritable.on(\"close\", cancel);\n\twritable.on(\"error\", cancel);\n\t(currentReadPromise ?? reader.read()).then(flow, handleStreamError);\n\treturn reader.closed.finally(() => {\n\t\twritable.off(\"close\", cancel);\n\t\twritable.off(\"error\", cancel);\n\t});\n\tfunction handleStreamError(error) {\n\t\tif (error) writable.destroy(error);\n\t}\n\tfunction onDrain() {\n\t\treader.read().then(flow, handleStreamError);\n\t}\n\tfunction flow({ done, value }) {\n\t\ttry {\n\t\t\tif (done) writable.end();\n\t\t\telse if (!writable.write(value)) writable.once(\"drain\", onDrain);\n\t\t\telse return reader.read().then(flow, handleStreamError);\n\t\t} catch (e) {\n\t\t\thandleStreamError(e);\n\t\t}\n\t}\n}\nfunction writeFromReadableStream(stream, writable) {\n\tif (stream.locked) throw new TypeError(\"ReadableStream is locked.\");\n\telse if (writable.destroyed) return;\n\treturn writeFromReadableStreamDefaultReader(stream.getReader(), writable);\n}\nconst buildOutgoingHttpHeaders = (headers, defaultContentType) => {\n\tconst res = {};\n\tif (!(headers instanceof Headers)) headers = new Headers(headers ?? void 0);\n\tif (headers.has(\"set-cookie\")) {\n\t\tconst cookies = [];\n\t\tfor (const [k, v] of headers) if (k === \"set-cookie\") cookies.push(v);\n\t\telse res[k] = v;\n\t\tif (cookies.length > 0) res[\"set-cookie\"] = cookies;\n\t} else for (const [k, v] of headers) res[k] = v;\n\tif (defaultContentType) res[\"content-type\"] ??= defaultContentType;\n\treturn res;\n};\n\n//#endregion\n//#region src/listener.ts\nconst outgoingEnded = Symbol(\"outgoingEnded\");\nconst incomingDraining = Symbol(\"incomingDraining\");\nconst DRAIN_TIMEOUT_MS = 500;\nconst MAX_DRAIN_BYTES = 64 * 1024 * 1024;\nconst drainIncoming = (incoming) => {\n\tconst incomingWithDrainState = incoming;\n\tif (incoming.destroyed || incomingWithDrainState[incomingDraining]) return;\n\tincomingWithDrainState[incomingDraining] = true;\n\tif (incoming instanceof Http2ServerRequest) {\n\t\ttry {\n\t\t\tincoming.stream?.close?.(constants.NGHTTP2_NO_ERROR);\n\t\t} catch {}\n\t\treturn;\n\t}\n\tlet bytesRead = 0;\n\tconst cleanup = () => {\n\t\tclearTimeout(timer);\n\t\tincoming.off(\"data\", onData);\n\t\tincoming.off(\"end\", cleanup);\n\t\tincoming.off(\"error\", cleanup);\n\t};\n\tconst forceClose = () => {\n\t\tcleanup();\n\t\tconst socket = incoming.socket;\n\t\tif (socket && !socket.destroyed) socket.destroySoon();\n\t};\n\tconst timer = setTimeout(forceClose, DRAIN_TIMEOUT_MS);\n\ttimer.unref?.();\n\tconst onData = (chunk) => {\n\t\tbytesRead += chunk.length;\n\t\tif (bytesRead > MAX_DRAIN_BYTES) forceClose();\n\t};\n\tincoming.on(\"data\", onData);\n\tincoming.on(\"end\", cleanup);\n\tincoming.on(\"error\", cleanup);\n\tincoming.resume();\n};\nconst makeCloseHandler = (req, incoming, outgoing, needsBodyCleanup) => () => {\n\tif (incoming.errored) req[abortRequest](incoming.errored.toString());\n\telse if (!outgoing.writableFinished) req[abortRequest](\"Client connection prematurely closed.\");\n\tif (needsBodyCleanup && !incoming.readableEnded) setTimeout(() => {\n\t\tif (!incoming.readableEnded) setTimeout(() => {\n\t\t\tdrainIncoming(incoming);\n\t\t});\n\t});\n};\nconst isImmediateCacheableResponse = (res) => {\n\tif (!(cacheKey in res)) return false;\n\tconst body = res[cacheKey][1];\n\treturn body === null || typeof body === \"string\" || body instanceof Uint8Array;\n};\nconst handleRequestError = () => new Response(null, { status: 400 });\nconst handleFetchError = (e) => new Response(null, { status: e instanceof Error && (e.name === \"TimeoutError\" || e.constructor.name === \"TimeoutError\") ? 504 : 500 });\nconst handleResponseError = (e, outgoing) => {\n\tconst err = e instanceof Error ? e : new Error(\"unknown error\", { cause: e });\n\tif (err.code === \"ERR_STREAM_PREMATURE_CLOSE\") console.info(\"The user aborted a request.\");\n\telse {\n\t\tconsole.error(e);\n\t\tif (!outgoing.headersSent) outgoing.writeHead(500, { \"Content-Type\": \"text/plain\" });\n\t\toutgoing.end(`Error: ${err.message}`);\n\t\toutgoing.destroy(err);\n\t}\n};\nconst flushHeaders = (outgoing) => {\n\tif (\"flushHeaders\" in outgoing && outgoing.writable) outgoing.flushHeaders();\n};\nconst responseViaCache = async (res, outgoing) => {\n\tlet [status, body, header] = res[cacheKey];\n\tif (!header) {\n\t\tif (body === null) {\n\t\t\toutgoing.writeHead(status);\n\t\t\toutgoing.end();\n\t\t} else if (typeof body === \"string\") {\n\t\t\toutgoing.writeHead(status, {\n\t\t\t\t\"Content-Type\": defaultContentType,\n\t\t\t\t\"Content-Length\": Buffer.byteLength(body)\n\t\t\t});\n\t\t\toutgoing.end(body);\n\t\t} else if (body instanceof Uint8Array) {\n\t\t\toutgoing.writeHead(status, {\n\t\t\t\t\"Content-Type\": defaultContentType,\n\t\t\t\t\"Content-Length\": body.byteLength\n\t\t\t});\n\t\t\toutgoing.end(body);\n\t\t} else if (body instanceof Blob) {\n\t\t\toutgoing.writeHead(status, {\n\t\t\t\t\"Content-Type\": defaultContentType,\n\t\t\t\t\"Content-Length\": body.size\n\t\t\t});\n\t\t\toutgoing.end(new Uint8Array(await body.arrayBuffer()));\n\t\t} else {\n\t\t\toutgoing.writeHead(status, { \"Content-Type\": defaultContentType });\n\t\t\tflushHeaders(outgoing);\n\t\t\tawait writeFromReadableStream(body, outgoing)?.catch((e) => handleResponseError(e, outgoing));\n\t\t}\n\t\toutgoing[outgoingEnded]?.();\n\t\treturn;\n\t}\n\tlet hasContentLength = false;\n\tif (header instanceof Headers) {\n\t\thasContentLength = header.has(\"content-length\");\n\t\theader = buildOutgoingHttpHeaders(header, body === null ? void 0 : defaultContentType);\n\t} else if (Array.isArray(header)) {\n\t\tconst headerObj = new Headers(header);\n\t\thasContentLength = headerObj.has(\"content-length\");\n\t\theader = buildOutgoingHttpHeaders(headerObj, body === null ? void 0 : defaultContentType);\n\t} else for (const key in header) if (key.length === 14 && key.toLowerCase() === \"content-length\") {\n\t\thasContentLength = true;\n\t\tbreak;\n\t}\n\tif (!hasContentLength) {\n\t\tif (typeof body === \"string\") header[\"Content-Length\"] = Buffer.byteLength(body);\n\t\telse if (body instanceof Uint8Array) header[\"Content-Length\"] = body.byteLength;\n\t\telse if (body instanceof Blob) header[\"Content-Length\"] = body.size;\n\t}\n\toutgoing.writeHead(status, header);\n\tif (body == null) outgoing.end();\n\telse if (typeof body === \"string\" || body instanceof Uint8Array) outgoing.end(body);\n\telse if (body instanceof Blob) outgoing.end(new Uint8Array(await body.arrayBuffer()));\n\telse {\n\t\tflushHeaders(outgoing);\n\t\tawait writeFromReadableStream(body, outgoing)?.catch((e) => handleResponseError(e, outgoing));\n\t}\n\toutgoing[outgoingEnded]?.();\n};\nconst isPromise = (res) => typeof res.then === \"function\";\nconst responseViaResponseObject = async (res, outgoing, options = {}) => {\n\tif (isPromise(res)) if (options.errorHandler) try {\n\t\tres = await res;\n\t} catch (err) {\n\t\tconst errRes = await options.errorHandler(err);\n\t\tif (!errRes) return;\n\t\tres = errRes;\n\t}\n\telse res = await res.catch(handleFetchError);\n\tif (cacheKey in res) return responseViaCache(res, outgoing);\n\tconst resHeaderRecord = buildOutgoingHttpHeaders(res.headers, res.body === null ? void 0 : defaultContentType);\n\tif (res.body) {\n\t\tconst reader = res.body.getReader();\n\t\tconst values = [];\n\t\tlet done = false;\n\t\tlet currentReadPromise = void 0;\n\t\tif (resHeaderRecord[\"transfer-encoding\"] !== \"chunked\") {\n\t\t\tlet maxReadCount = 2;\n\t\t\tfor (let i = 0; i < maxReadCount; i++) {\n\t\t\t\tcurrentReadPromise ||= reader.read();\n\t\t\t\tconst chunk = await readWithoutBlocking(currentReadPromise).catch((e) => {\n\t\t\t\t\tconsole.error(e);\n\t\t\t\t\tdone = true;\n\t\t\t\t});\n\t\t\t\tif (!chunk) {\n\t\t\t\t\tif (i === 1) {\n\t\t\t\t\t\tawait new Promise((resolve) => setTimeout(resolve));\n\t\t\t\t\t\tmaxReadCount = 3;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcurrentReadPromise = void 0;\n\t\t\t\tif (chunk.value) values.push(chunk.value);\n\t\t\t\tif (chunk.done) {\n\t\t\t\t\tdone = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (done && !(\"content-length\" in resHeaderRecord)) resHeaderRecord[\"content-length\"] = values.reduce((acc, value) => acc + value.length, 0);\n\t\t}\n\t\toutgoing.writeHead(res.status, resHeaderRecord);\n\t\tvalues.forEach((value) => {\n\t\t\toutgoing.write(value);\n\t\t});\n\t\tif (done) outgoing.end();\n\t\telse {\n\t\t\tif (values.length === 0) flushHeaders(outgoing);\n\t\t\tawait writeFromReadableStreamDefaultReader(reader, outgoing, currentReadPromise);\n\t\t}\n\t} else if (resHeaderRecord[X_ALREADY_SENT]) {} else {\n\t\toutgoing.writeHead(res.status, resHeaderRecord);\n\t\toutgoing.end();\n\t}\n\toutgoing[outgoingEnded]?.();\n};\nconst getRequestListener = (fetchCallback, options = {}) => {\n\tconst autoCleanupIncoming = options.autoCleanupIncoming ?? true;\n\tif (options.overrideGlobalObjects !== false && global.Request !== Request$1) {\n\t\tObject.defineProperty(global, \"Request\", { value: Request$1 });\n\t\tObject.defineProperty(global, \"Response\", { value: Response$1 });\n\t}\n\treturn async (incoming, outgoing) => {\n\t\tlet res, req;\n\t\tlet needsBodyCleanup = false;\n\t\tlet closeHandlerAttached = false;\n\t\tconst ensureCloseHandler = () => {\n\t\t\tif (!req || closeHandlerAttached) return;\n\t\t\tcloseHandlerAttached = true;\n\t\t\toutgoing.on(\"close\", makeCloseHandler(req, incoming, outgoing, needsBodyCleanup));\n\t\t};\n\t\ttry {\n\t\t\treq = newRequest(incoming, options.hostname);\n\t\t\tneedsBodyCleanup = autoCleanupIncoming && !(incoming.method === \"GET\" || incoming.method === \"HEAD\");\n\t\t\tif (needsBodyCleanup) {\n\t\t\t\tincoming[wrapBodyStream] = true;\n\t\t\t\tif (incoming instanceof Http2ServerRequest) outgoing[outgoingEnded] = () => {\n\t\t\t\t\tif (!incoming.readableEnded) setTimeout(() => {\n\t\t\t\t\t\tif (!incoming.readableEnded) setTimeout(() => {\n\t\t\t\t\t\t\tincoming.destroy();\n\t\t\t\t\t\t\toutgoing.destroy();\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t}\n\t\t\tres = fetchCallback(req, {\n\t\t\t\tincoming,\n\t\t\t\toutgoing\n\t\t\t});\n\t\t\tif (!isPromise(res) && isImmediateCacheableResponse(res)) {\n\t\t\t\tif (needsBodyCleanup && !incoming.readableEnded) outgoing.once(\"finish\", () => {\n\t\t\t\t\tif (!incoming.readableEnded) drainIncoming(incoming);\n\t\t\t\t});\n\t\t\t\treturn responseViaCache(res, outgoing);\n\t\t\t}\n\t\t\tensureCloseHandler();\n\t\t} catch (e) {\n\t\t\tif (!res) if (options.errorHandler) {\n\t\t\t\tensureCloseHandler();\n\t\t\t\tres = await options.errorHandler(req ? e : toRequestError(e));\n\t\t\t\tif (!res) return;\n\t\t\t} else if (!req) res = handleRequestError();\n\t\t\telse res = handleFetchError(e);\n\t\t\telse return handleResponseError(e, outgoing);\n\t\t}\n\t\ttry {\n\t\t\treturn await responseViaResponseObject(res, outgoing, options);\n\t\t} catch (e) {\n\t\t\treturn handleResponseError(e, outgoing);\n\t\t}\n\t};\n};\n\n//#endregion\n//#region src/websocket.ts\n/**\n* @link https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent\n*/\nconst CloseEvent = globalThis.CloseEvent ?? class extends Event {\n\t#eventInitDict;\n\tconstructor(type, eventInitDict = {}) {\n\t\tsuper(type, eventInitDict);\n\t\tthis.#eventInitDict = eventInitDict;\n\t}\n\tget wasClean() {\n\t\treturn this.#eventInitDict.wasClean ?? false;\n\t}\n\tget code() {\n\t\treturn this.#eventInitDict.code ?? 0;\n\t}\n\tget reason() {\n\t\treturn this.#eventInitDict.reason ?? \"\";\n\t}\n};\nconst generateConnectionSymbol = () => Symbol(\"connection\");\nconst CONNECTION_SYMBOL_KEY = Symbol(\"CONNECTION_SYMBOL_KEY\");\nconst WAIT_FOR_WEBSOCKET_SYMBOL = Symbol(\"WAIT_FOR_WEBSOCKET_SYMBOL\");\nconst responseHeadersToSkip = new Set([\n\t\"connection\",\n\t\"content-length\",\n\t\"keep-alive\",\n\t\"proxy-authenticate\",\n\t\"proxy-authorization\",\n\t\"te\",\n\t\"trailer\",\n\t\"transfer-encoding\",\n\t\"upgrade\",\n\t\"sec-websocket-accept\",\n\t\"sec-websocket-extensions\",\n\t\"sec-websocket-protocol\"\n]);\nconst appendResponseHeaders = (headers, responseHeaders) => {\n\tif (!responseHeaders) return;\n\tresponseHeaders.forEach((value, key) => {\n\t\tif (responseHeadersToSkip.has(key.toLowerCase())) return;\n\t\theaders.push(`${key}: ${value}`);\n\t});\n};\nconst rejectUpgradeRequest = (socket, status, responseHeaders) => {\n\tconst responseLines = [\"Connection: close\", \"Content-Length: 0\"];\n\tappendResponseHeaders(responseLines, responseHeaders);\n\tsocket.end(`HTTP/1.1 ${status.toString()} ${STATUS_CODES[status] ?? \"\"}\\r\\n${responseLines.join(\"\\r\\n\")}\\r\\n\\r\n`);\n};\nconst createUpgradeRequest = (request) => {\n\tconst protocol = request.socket.encrypted ? \"https\" : \"http\";\n\tconst url = new URL(request.url ?? \"/\", `${protocol}://${request.headers.host ?? \"localhost\"}`);\n\tconst headers = new Headers();\n\tfor (const key in request.headers) {\n\t\tconst value = request.headers[key];\n\t\tif (!value) continue;\n\t\theaders.append(key, Array.isArray(value) ? value[0] : value);\n\t}\n\treturn new Request(url, { headers });\n};\nconst setupWebSocket = (options) => {\n\tconst { server, fetchCallback, wss } = options;\n\tconst waiterMap = /* @__PURE__ */ new Map();\n\twss.on(\"connection\", (ws, request) => {\n\t\tconst waiter = waiterMap.get(request);\n\t\tif (waiter) {\n\t\t\twaiter.resolve(ws);\n\t\t\twaiterMap.delete(request);\n\t\t}\n\t});\n\tconst waitForWebSocket = (request, connectionSymbol) => {\n\t\treturn new Promise((resolve) => {\n\t\t\twaiterMap.set(request, {\n\t\t\t\tresolve,\n\t\t\t\tconnectionSymbol\n\t\t\t});\n\t\t});\n\t};\n\tserver.on(\"upgrade\", async (request, socket, head) => {\n\t\tif (request.headers.upgrade?.toLowerCase() !== \"websocket\") return;\n\t\tconst env = {\n\t\t\tincoming: request,\n\t\t\toutgoing: void 0,\n\t\t\twss,\n\t\t\t[WAIT_FOR_WEBSOCKET_SYMBOL]: waitForWebSocket\n\t\t};\n\t\tlet status = 400;\n\t\tlet responseHeaders;\n\t\ttry {\n\t\t\tconst response = await fetchCallback(createUpgradeRequest(request), env);\n\t\t\tif (response instanceof Response) {\n\t\t\t\tstatus = response.status;\n\t\t\t\tresponseHeaders = response.headers;\n\t\t\t}\n\t\t} catch {\n\t\t\tif (server.listenerCount(\"upgrade\") === 1) rejectUpgradeRequest(socket, 500);\n\t\t\treturn;\n\t\t}\n\t\tconst waiter = waiterMap.get(request);\n\t\tif (!waiter || waiter.connectionSymbol !== env[CONNECTION_SYMBOL_KEY]) {\n\t\t\twaiterMap.delete(request);\n\t\t\tif (server.listenerCount(\"upgrade\") === 1) rejectUpgradeRequest(socket, status, responseHeaders);\n\t\t\treturn;\n\t\t}\n\t\tconst addResponseHeaders = (headers) => {\n\t\t\tappendResponseHeaders(headers, responseHeaders);\n\t\t};\n\t\twss.on(\"headers\", addResponseHeaders);\n\t\ttry {\n\t\t\twss.handleUpgrade(request, socket, head, (ws) => {\n\t\t\t\twss.emit(\"connection\", ws, request);\n\t\t\t});\n\t\t} finally {\n\t\t\twss.off(\"headers\", addResponseHeaders);\n\t\t}\n\t});\n\tserver.on(\"close\", () => {\n\t\twss.close();\n\t});\n};\nconst upgradeWebSocket = defineWebSocketHelper(async (c, events, options) => {\n\tif (c.req.header(\"upgrade\")?.toLowerCase() !== \"websocket\") return;\n\tconst env = c.env;\n\tconst waitForWebSocket = env[WAIT_FOR_WEBSOCKET_SYMBOL];\n\tif (!waitForWebSocket || !env.incoming) return new Response(null, { status: 500 });\n\tconst connectionSymbol = generateConnectionSymbol();\n\tenv[CONNECTION_SYMBOL_KEY] = connectionSymbol;\n\t(async () => {\n\t\tconst ws = await waitForWebSocket(env.incoming, connectionSymbol);\n\t\tconst messagesReceivedInStarting = [];\n\t\tconst bufferMessage = (data, isBinary) => {\n\t\t\tmessagesReceivedInStarting.push([data, isBinary]);\n\t\t};\n\t\tws.on(\"message\", bufferMessage);\n\t\tconst ctx = {\n\t\t\tbinaryType: \"arraybuffer\",\n\t\t\tclose(code, reason) {\n\t\t\t\tws.close(code, reason);\n\t\t\t},\n\t\t\tprotocol: ws.protocol,\n\t\t\traw: ws,\n\t\t\tget readyState() {\n\t\t\t\treturn ws.readyState;\n\t\t\t},\n\t\t\tsend(source, opts) {\n\t\t\t\tws.send(source, { compress: opts?.compress });\n\t\t\t},\n\t\t\turl: new URL(c.req.url)\n\t\t};\n\t\ttry {\n\t\t\tevents?.onOpen?.(new Event(\"open\"), ctx);\n\t\t} catch (e) {\n\t\t\t(options?.onError ?? console.error)(e);\n\t\t}\n\t\tconst handleMessage = (data, isBinary) => {\n\t\t\tconst datas = Array.isArray(data) ? data : [data];\n\t\t\tfor (const data of datas) try {\n\t\t\t\tevents?.onMessage?.(new MessageEvent(\"message\", { data: isBinary ? data instanceof ArrayBuffer ? data : data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength) : typeof data === \"string\" ? data : Buffer.from(data).toString(\"utf-8\") }), ctx);\n\t\t\t} catch (e) {\n\t\t\t\t(options?.onError ?? console.error)(e);\n\t\t\t}\n\t\t};\n\t\tws.off(\"message\", bufferMessage);\n\t\tfor (const message of messagesReceivedInStarting) handleMessage(...message);\n\t\tws.on(\"message\", (data, isBinary) => {\n\t\t\thandleMessage(data, isBinary);\n\t\t});\n\t\tws.on(\"close\", (code, reason) => {\n\t\t\ttry {\n\t\t\t\tevents?.onClose?.(new CloseEvent(\"close\", {\n\t\t\t\t\tcode,\n\t\t\t\t\treason: reason.toString()\n\t\t\t\t}), ctx);\n\t\t\t} catch (e) {\n\t\t\t\t(options?.onError ?? console.error)(e);\n\t\t\t}\n\t\t});\n\t\tws.on(\"error\", (error) => {\n\t\t\ttry {\n\t\t\t\tevents?.onError?.(new ErrorEvent(\"error\", { error }), ctx);\n\t\t\t} catch (e) {\n\t\t\t\t(options?.onError ?? console.error)(e);\n\t\t\t}\n\t\t});\n\t})();\n\treturn new Response();\n});\n\n//#endregion\n//#region src/server.ts\nconst createAdaptorServer = (options) => {\n\tconst fetchCallback = options.fetch;\n\tconst requestListener = getRequestListener(fetchCallback, {\n\t\thostname: options.hostname,\n\t\toverrideGlobalObjects: options.overrideGlobalObjects,\n\t\tautoCleanupIncoming: options.autoCleanupIncoming\n\t});\n\tconst server = (options.createServer || createServer)(options.serverOptions || {}, requestListener);\n\tif (options.websocket && options.websocket.server) {\n\t\tif (options.websocket.server.options.noServer !== true) throw new Error(\"WebSocket server must be created with { noServer: true } option\");\n\t\tsetupWebSocket({\n\t\t\tserver,\n\t\t\tfetchCallback,\n\t\t\twss: options.websocket.server\n\t\t});\n\t}\n\treturn server;\n};\nconst serve = (options, listeningListener) => {\n\tconst server = createAdaptorServer(options);\n\tserver.listen(options?.port ?? 3e3, options.hostname, () => {\n\t\tconst serverInfo = server.address();\n\t\tlisteningListener && listeningListener(serverInfo);\n\t});\n\treturn server;\n};\n\n//#endregion\nexport { RequestError, createAdaptorServer, getRequestListener, serve, upgradeWebSocket };","import { readFileSync } from 'node:fs';\nimport type { Hono } from 'hono';\n\n// Process start, captured once at module load (bundled into each consumer, so this is\n// effectively the consumer process's start time).\nconst START_TIME = Date.now();\n\nlet shutdownHandler: (() => void) | null = null;\n\n/** Register the graceful-shutdown closure that `POST /admin/shutdown` invokes. Called by startServer. */\nexport function setShutdownHandler(fn: () => void): void {\n shutdownHandler = fn;\n}\n\n/**\n * Read the consuming package's version from its package.json at runtime.\n *\n * Pass `import.meta.url` from the CONSUMER module. core is bundled into each consumer, so\n * after the build this code runs from the consumer's `dist/` and package.json sits one\n * level up (`../package.json`). Never throws — returns 'unknown' on any failure.\n */\nexport function readPackageVersion(metaUrl: string): string {\n try {\n const pkg = JSON.parse(readFileSync(new URL('../package.json', metaUrl), 'utf8')) as {\n version?: string;\n };\n return pkg.version ?? 'unknown';\n } catch {\n return 'unknown';\n }\n}\n\nexport interface BaseStatus {\n ok: true;\n version: string;\n startedAt: string;\n uptimeSeconds: number;\n}\n\nexport interface AdminRoutesOptions {\n /** Server version, typically `readPackageVersion(import.meta.url)`. */\n version: string;\n /** App-specific fields merged into the `/admin/status` payload (e.g. validator/pin counts). */\n getStatus?: () => Record<string, unknown>;\n}\n\n/**\n * Register the admin surface shared by every sm-lab service:\n * GET /admin/status → { ok, version, startedAt, uptimeSeconds, ...getStatus() }\n * POST /admin/shutdown → graceful shutdown (deferred 50ms so the response flushes first)\n */\nexport function registerAdminRoutes(app: Hono, opts: AdminRoutesOptions): void {\n app.get('/admin/status', (c) => {\n const base: BaseStatus = {\n ok: true,\n version: opts.version,\n startedAt: new Date(START_TIME).toISOString(),\n uptimeSeconds: Math.floor((Date.now() - START_TIME) / 1000),\n };\n return c.json({ ...base, ...opts.getStatus?.() });\n });\n\n app.post('/admin/shutdown', (c) => {\n if (shutdownHandler) setTimeout(shutdownHandler, 50);\n return c.json({ message: 'shutting down' });\n });\n}\n","import { Command } from 'commander';\n\n/** Climb to the root program so commands at any nesting depth can read root-level options (e.g. --url). */\nexport function findRoot(cmd: Command): Command {\n let c = cmd;\n while (c.parent) c = c.parent;\n return c;\n}\n\nexport interface ClientTarget {\n /** Env var holding the server URL (e.g. CL_MOCK_URL). */\n envVar: string;\n /** Default port when neither --url nor the env var is set. */\n defaultPort: number;\n}\n\n/** Resolve the target server URL: root `--url` option → env var → `http://127.0.0.1:<defaultPort>`. */\nexport function resolveUrl(cmd: Command, target: ClientTarget): string {\n const opts = findRoot(cmd).opts() as { url?: string };\n return opts.url ?? process.env[target.envVar] ?? `http://127.0.0.1:${target.defaultPort}`;\n}\n\n/** Format seconds as a compact `1h 2m 3s` string (omits leading zero units). */\nexport function formatUptime(seconds: number): string {\n const h = Math.floor(seconds / 3600);\n const m = Math.floor((seconds % 3600) / 60);\n const s = seconds % 60;\n const parts: string[] = [];\n if (h) parts.push(`${h}h`);\n if (m || h) parts.push(`${m}m`);\n parts.push(`${s}s`);\n return parts.join(' ');\n}\n\nexport interface BaseStatusResponse {\n ok: boolean;\n version: string;\n startedAt: string;\n uptimeSeconds: number;\n}\n\nexport interface StatusCommandOptions<T extends BaseStatusResponse> extends ClientTarget {\n /** App-specific help text; defaults to 'Show status of a running server'. */\n description?: string;\n /** Print app-specific lines after the shared header (URL/Status/Version/Started/Uptime). */\n render?: (data: T, url: string) => void;\n}\n\n/**\n * Build a `status` command: GET /admin/status, print the shared header, then app-specific\n * lines via `render`. `--json` dumps the raw payload. On connect failure prints\n * `Error: <url> offline (<reason>)` to stderr and exits 1 — offline is a legitimate answer, and\n * the `Error:` prefix + exit 1 keep the machine I/O contract uniform with the other commands.\n */\nexport function createStatusCommand<T extends BaseStatusResponse>(\n opts: StatusCommandOptions<T>,\n): Command {\n return new Command('status')\n .description(opts.description ?? 'Show status of a running server')\n .option('--json', 'output raw JSON')\n .action(async (cmdOpts: { json?: boolean }, cmd: Command) => {\n const url = resolveUrl(cmd, opts);\n let res: Response;\n try {\n res = await fetch(`${url}/admin/status`);\n } catch (err) {\n console.error(\n 'Error:',\n `${url} offline (${err instanceof Error ? err.message : String(err)})`,\n );\n process.exit(1);\n }\n if (!res.ok) {\n console.error(`Unexpected response: ${res.status}`);\n process.exit(1);\n }\n const data = (await res.json()) as T;\n if (cmdOpts.json) {\n console.log(JSON.stringify(data, null, 2));\n return;\n }\n console.log(`URL: ${url}`);\n console.log(`Status: ok`);\n console.log(`Version: ${data.version}`);\n console.log(`Started: ${data.startedAt}`);\n console.log(`Uptime: ${formatUptime(data.uptimeSeconds)}`);\n opts.render?.(data, url);\n });\n}\n\nexport interface StopCommandOptions extends ClientTarget {\n /** App-specific help text; defaults to 'Stop a running server'. */\n description?: string;\n}\n\n/** Build a `stop` command: POST /admin/shutdown to the resolved URL. */\nexport function createStopCommand(target: StopCommandOptions): Command {\n return new Command('stop')\n .description(target.description ?? 'Stop a running server')\n .action(async (_cmdOpts: unknown, cmd: Command) => {\n const url = resolveUrl(cmd, target);\n let res: Response;\n try {\n res = await fetch(`${url}/admin/shutdown`, { method: 'POST' });\n } catch (err) {\n console.error(\n `Failed to connect to ${url}: ${err instanceof Error ? err.message : String(err)}`,\n );\n process.exit(1);\n }\n if (res.ok) {\n console.log('Server shutting down');\n } else {\n console.error(`Unexpected response: ${res.status}`);\n process.exit(1);\n }\n });\n}\n","import { Argument, Command } from 'commander';\nimport type { Option } from 'commander';\nimport { findRoot } from './cli';\n\nexport type CompletionShell = 'bash' | 'zsh' | 'fish';\n\nconst SHELLS: readonly CompletionShell[] = ['bash', 'zsh', 'fish'];\n\n// -- Normalised command tree --------------------------------------------------\n// commander@15 has no completion support, so we snapshot the registered tree\n// into plain data and emit a fully static script per shell (no runtime hooks).\n\ninterface OptionNode {\n /** Short flag with dash, e.g. `-c`. */\n short?: string;\n /** Long flag with dashes, e.g. `--count`. */\n long?: string;\n description: string;\n /** True when the option consumes a value (`<x>` or `[x]`). */\n takesValue: boolean;\n choices?: string[];\n}\n\ninterface ArgNode {\n name: string;\n description: string;\n variadic: boolean;\n choices?: string[];\n}\n\ninterface CommandNode {\n name: string;\n aliases: string[];\n description: string;\n /** Canonical subcommand names from the root down to this node ([] for the root itself). */\n path: string[];\n options: OptionNode[];\n args: ArgNode[];\n children: CommandNode[];\n}\n\nfunction firstLine(text: string): string {\n return (text.split('\\n')[0] ?? '').trim();\n}\n\nfunction toNode(cmd: Command, path: string[]): CommandNode {\n return {\n name: cmd.name(),\n aliases: [...cmd.aliases()],\n description: firstLine(cmd.description()),\n path,\n options: cmd.options\n .filter((o: Option) => !o.hidden)\n .map((o: Option) => ({\n short: o.short,\n long: o.long,\n description: firstLine(o.description),\n takesValue: o.required || o.optional,\n choices: o.argChoices ? [...o.argChoices] : undefined,\n })),\n args: cmd.registeredArguments.map((a: Argument) => ({\n name: a.name(),\n description: firstLine(a.description),\n variadic: a.variadic,\n choices: a.argChoices ? [...a.argChoices] : undefined,\n })),\n children: cmd.commands.map((c) => toNode(c, [...path, c.name()])),\n };\n}\n\n/** Flatten in registration order — the emitters iterate this, so output is deterministic. */\nfunction walk(node: CommandNode): CommandNode[] {\n return [node, ...node.children.flatMap(walk)];\n}\n\nfunction namesOf(node: CommandNode): string[] {\n return [node.name, ...node.aliases];\n}\n\n// -- fish ---------------------------------------------------------------------\n\nfunction fishQuote(s: string): string {\n return `'${s.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}'`;\n}\n\nfunction emitFish(bin: string, root: CommandNode): string {\n const lines = [\n `# fish completion for ${bin}`,\n `# Load with: ${bin} completion fish | source`,\n `# Or install: ${bin} completion fish > ~/.config/fish/completions/${bin}.fish`,\n ];\n for (const node of walk(root)) {\n const seen = node.path.map((p) => `__fish_seen_subcommand_from ${p}`);\n const childNames = node.children.flatMap(namesOf);\n const hereParts = [...seen];\n // `-f` on subcommand candidates suppresses file completion at this position;\n // positions with no matching rule keep fish's default file completion.\n if (childNames.length > 0) {\n hereParts.push(`not __fish_seen_subcommand_from ${childNames.join(' ')}`);\n }\n const here = hereParts.length > 0 ? ` -n ${fishQuote(hereParts.join('; and '))}` : '';\n for (const child of node.children) {\n for (const name of namesOf(child)) {\n lines.push(`complete -c ${bin}${here} -f -a ${name} -d ${fishQuote(child.description)}`);\n }\n }\n for (const opt of node.options) {\n let line = `complete -c ${bin}${here}`;\n if (opt.short) line += ` -s ${opt.short.replace(/^-+/, '')}`;\n if (opt.long) line += ` -l ${opt.long.replace(/^-+/, '')}`;\n if (opt.takesValue) {\n line += opt.choices ? ` -x -a ${fishQuote(opt.choices.join(' '))}` : ' -r';\n }\n line += ` -d ${fishQuote(opt.description)}`;\n lines.push(line);\n }\n const atArgs = seen.length > 0 ? ` -n ${fishQuote(seen.join('; and '))}` : '';\n for (const arg of node.args) {\n if (arg.choices) {\n const desc = arg.description || arg.name;\n lines.push(\n `complete -c ${bin}${atArgs} -f -a ${fishQuote(arg.choices.join(' '))} -d ${fishQuote(desc)}`,\n );\n }\n }\n }\n return `${lines.join('\\n')}\\n`;\n}\n\n// -- bash ---------------------------------------------------------------------\n\nfunction sanitizeIdent(bin: string): string {\n return bin.replace(/[^A-Za-z0-9_]/g, '_');\n}\n\n/**\n * Case arms that descend the known subcommand tree token by token, normalising\n * aliases to the canonical path so a single lookup table serves both spellings.\n */\nfunction descentCases(root: CommandNode, indent: string): string[] {\n return walk(root)\n .filter((node) => node.path.length > 0)\n .map((node) => {\n const parent = node.path.slice(0, -1).join(' ');\n const patterns = namesOf(node)\n .map((name) => `\"${parent ? `${parent} ${name}` : name}\"`)\n .join('|');\n return `${indent}${patterns}) path=\"${node.path.join(' ')}\" ;;`;\n });\n}\n\nfunction emitBash(bin: string, root: CommandNode): string {\n const fn = `_${sanitizeIdent(bin)}_completions`;\n const optCases = walk(root).map((node) => {\n const subs = node.children.flatMap(namesOf).join(' ');\n const flags = node.options\n .flatMap((o) => [o.short, o.long])\n .filter((f): f is string => f !== undefined)\n .join(' ');\n const args = node.args.flatMap((a) => a.choices ?? []).join(' ');\n return ` \"${node.path.join(' ')}\") subs=\"${subs}\"; flags=\"${flags}\"; args=\"${args}\" ;;`;\n });\n return [\n `# bash completion for ${bin}`,\n `# Load with: source <(${bin} completion bash)`,\n `${fn}() {`,\n ' local cur path try w i subs flags args',\n ' cur=\"${COMP_WORDS[COMP_CWORD]}\"',\n ' path=\"\"',\n ' for ((i = 1; i < COMP_CWORD; i++)); do',\n ' w=\"${COMP_WORDS[i]}\"',\n ' [[ \"$w\" == -* ]] && continue',\n ' try=\"${path:+$path }$w\"',\n ' case \"$try\" in',\n ...descentCases(root, ' '),\n ' *) ;;',\n ' esac',\n ' done',\n ' subs=\"\"; flags=\"\"; args=\"\"',\n ' case \"$path\" in',\n ...optCases,\n ' esac',\n ' if [[ \"$cur\" == -* ]]; then',\n ' COMPREPLY=($(compgen -W \"$flags\" -- \"$cur\"))',\n ' elif [[ -n \"$subs\" ]]; then',\n ' COMPREPLY=($(compgen -W \"$subs\" -- \"$cur\"))',\n ' elif [[ -n \"$args\" ]]; then',\n ' COMPREPLY=($(compgen -W \"$args\" -- \"$cur\"))',\n ' else',\n ' COMPREPLY=($(compgen -f -- \"$cur\"))',\n ' fi',\n '}',\n `complete -F ${fn} ${bin}`,\n '',\n ].join('\\n');\n}\n\n// -- zsh ----------------------------------------------------------------------\n\nfunction zshItem(name: string, description: string): string {\n const entry = `${name}:${description}`.replace(/'/g, `'\\\\''`);\n return `'${entry}'`;\n}\n\nfunction emitZsh(bin: string, root: CommandNode): string {\n const fn = `_${sanitizeIdent(bin)}`;\n const optCases = walk(root).map((node) => {\n const subs = node.children\n .flatMap((child) => namesOf(child).map((name) => zshItem(name, child.description)))\n .join(' ');\n const flags = node.options\n .flatMap((o) =>\n [o.short, o.long]\n .filter((f): f is string => f !== undefined)\n .map((f) => zshItem(f, o.description)),\n )\n .join(' ');\n const args = node.args\n .flatMap((a) => (a.choices ?? []).map((c) => zshItem(c, a.description || a.name)))\n .join(' ');\n const body = [\n subs ? `subs=(${subs})` : undefined,\n flags ? `flags=(${flags})` : undefined,\n args ? `argwords=(${args})` : undefined,\n ]\n .filter((p) => p !== undefined)\n .join('; ');\n return ` \"${node.path.join(' ')}\") ${body ? `${body} ` : ''};;`;\n });\n return [\n `#compdef ${bin}`,\n `# zsh completion for ${bin}`,\n `# Install: ${bin} completion zsh > \"\\${fpath[1]}/_${bin}\" (then restart zsh)`,\n `${fn}() {`,\n ' local -a subs flags argwords',\n ' local path=\"\" try w',\n ' for w in \"${(@)words[2,CURRENT-1]}\"; do',\n ' [[ \"$w\" == -* ]] && continue',\n ' try=\"${path:+$path }$w\"',\n ' case \"$try\" in',\n ...descentCases(root, ' '),\n ' *) ;;',\n ' esac',\n ' done',\n ' case \"$path\" in',\n ...optCases,\n ' esac',\n ' if [[ \"$PREFIX\" == -* ]]; then',\n \" (( ${#flags[@]} )) && _describe -t options 'option' flags\",\n ' elif (( ${#subs[@]} )); then',\n \" _describe -t commands 'command' subs\",\n ' elif (( ${#argwords[@]} )); then',\n \" _describe -t values 'value' argwords\",\n ' else',\n ' _files',\n ' fi',\n '}',\n `if [[ \"\\${funcstack[1]}\" == \"${fn}\" ]]; then`,\n ` ${fn} \"$@\"`,\n 'else',\n ` compdef ${fn} ${bin}`,\n 'fi',\n '',\n ].join('\\n');\n}\n\n// -- public API -----------------------------------------------------------------\n\n/**\n * Build a fully static, self-contained shell-completion script for `root`'s command\n * tree (subcommands at any depth, aliases, flags, option/argument choices). Pure:\n * output depends only on the tree, iterated in registration order.\n */\nexport function buildCompletionScript(root: Command, shell: CompletionShell): string {\n const bin = root.name();\n const tree = toNode(root, []);\n switch (shell) {\n case 'fish':\n return emitFish(bin, tree);\n case 'bash':\n return emitBash(bin, tree);\n case 'zsh':\n return emitZsh(bin, tree);\n }\n}\n\n/**\n * Build a `completion <shell>` subcommand that prints the static completion script\n * for the ROOT program (resolved by walking `.parent`) to stdout.\n */\nexport function createCompletionCommand(): Command {\n return new Command('completion')\n .description(\n 'Print a static shell-completion script for bash, zsh or fish. ' +\n 'Load it in your shell, e.g. fish: `sm-cl completion fish | source`',\n )\n .addArgument(new Argument('<shell>', 'target shell').choices(SHELLS))\n .action((shell: CompletionShell, _opts: unknown, cmd: Command) => {\n process.stdout.write(buildCompletionScript(findRoot(cmd), shell));\n });\n}\n","import { Command } from 'commander';\nimport { isAddress, isHex, parseEther } from 'viem';\nimport type { Hex } from '@sm-lab/receipts';\nimport { connect, type Ctx } from '../context';\n\nexport interface OptionSpec {\n /** commander flag spec, e.g. '--operator-id <id>'. NEVER use a `--no-*` long name (negation). */\n flag: string;\n /** the recipe opts property this maps to, e.g. 'noId' (decoupled from the flag). */\n key: string;\n // Method form (params are checked bivariantly under strictFunctionTypes) so that a\n // narrow coercer like toBigInt(s: string) stays assignable. Single-value coercers\n // receive string; repeatable coercers receive string[].\n coerce(raw: string | string[]): unknown;\n required?: boolean;\n repeatable?: boolean;\n description?: string;\n /**\n * Force (true) or forbid (false) positional acceptance, overriding the default heuristic\n * (required && !repeatable). Set true to make an optional option positional, or to expose a\n * repeatable option as the trailing **variadic** positional — which then MUST be declared last.\n */\n positional?: boolean;\n}\n\nexport interface RecipeCommand<O = Record<string, unknown>, R = unknown> {\n name: string;\n summary: string;\n options: OptionSpec[];\n // Method form (bivariant params) so descriptors with narrowed opts/result types —\n // e.g. run(ctx, o: { noId: bigint }) — remain assignable to RecipeCommand[].\n run(ctx: Ctx, opts: O): Promise<R> | R;\n report(result: R, opts: O): string[];\n /** cm/csm-only commands set this; it forces ctx.module and overrides global --module. */\n module?: 'cm' | 'csm';\n needsClMock?: boolean;\n}\n\n// --- coercers (string → typed) ---\nexport function toBigInt(s: string): bigint {\n return BigInt(s); // throws SyntaxError on garbage\n}\nexport function toNumber(s: string): number {\n const n = Number(s);\n if (Number.isNaN(n)) throw new Error(`not a number: ${s}`);\n return n;\n}\n/** ETH (decimal string) → wei bigint. String-based; 1 wei → 1n. */\nexport function toEth(s: string): bigint {\n return parseEther(s);\n}\nexport function toHexValue(s: string): Hex {\n if (!isHex(s)) throw new Error(`not a 0x-hex value: ${s}`);\n return s;\n}\nexport function toAddressValue(s: string): Hex {\n if (!isAddress(s)) throw new Error(`not an address: ${s}`);\n return s as Hex;\n}\nexport function identity(s: string): string {\n return s;\n}\n/** Repeatable '--pair <noId:bps>' → [bigint, bigint][]. */\nexport function toPairs(raw: string[]): [bigint, bigint][] {\n return raw.map((p) => {\n const [a, b] = p.split(':');\n if (a === undefined || b === undefined) throw new Error(`bad pair \"${p}\", want noId:bps`);\n return [BigInt(a), BigInt(b)] as [bigint, bigint];\n });\n}\n/** Repeatable '--address <addr>' → Hex[]. */\nexport function toAddresses(raw: string[]): Hex[] {\n return raw.map(toAddressValue);\n}\n\n/** kebab name of a flag's long form, e.g. '--operator-id <id>' → 'operator-id'. */\nexport function flagName(flag: string): string {\n const long = flag.split(/[ ,]+/).find((t) => t.startsWith('--'));\n return (long ?? flag).replace(/^--/, '').replace(/<.*$/, '').trim();\n}\n\n/** commander's camelCased property name for a flag spec (mirrors commander's own rule). */\nexport function flagProp(flag: string): string {\n return flagName(flag).replace(/-([a-z])/g, (_m, c: string) => c.toUpperCase());\n}\n\nexport const bigintReplacer = (_k: string, v: unknown): unknown =>\n typeof v === 'bigint' ? v.toString() : v;\n\n/** anvil's default listen address — the fallback when neither --rpc-url nor RPC_URL is set. */\nexport const DEFAULT_RPC_URL = 'http://127.0.0.1:8545';\n\n/** Run an async action; print thrown errors cleanly and exit non-zero. */\nexport function run(fn: () => Promise<void>): void {\n fn().catch((err: unknown) => {\n console.error('Error:', err instanceof Error ? err.message : String(err));\n process.exit(1);\n });\n}\n\nconst collect = (v: string, acc: string[]): string[] => [...acc, v];\n\n// Help fallback derived from the coercer's contract, so a spec without a `description`\n// never renders as a bare flag in --help. Keyed by identity — descriptors reference the\n// exported coercers directly. `identity` stays undescribed (nothing can be inferred).\nconst COERCER_HELP: ReadonlyMap<unknown, string> = new Map<unknown, string>([\n [toEth, 'amount in ETH (decimal, 1-wei exact)'],\n [toBigInt, 'unsigned integer'],\n [toNumber, 'number'],\n [toHexValue, '0x-prefixed hex value'],\n [toAddressValue, '0x… address'],\n [toAddresses, '0x… address'],\n [toPairs, 'noId:bps pair'],\n]);\n\nconst optionHelp = (o: OptionSpec): string => o.description ?? COERCER_HELP.get(o.coerce) ?? '';\n\n/** Whether an option is also accepted positionally — explicit `positional`, else required && !repeatable. */\nconst isPositional = (o: OptionSpec): boolean => o.positional ?? (!!o.required && !o.repeatable);\n\nexport function defineCommand(desc: RecipeCommand, connectImpl: typeof connect = connect): Command {\n const cmd = new Command(desc.name).description(desc.summary);\n for (const o of desc.options) {\n if (o.repeatable) cmd.option(o.flag, optionHelp(o), collect, []);\n else cmd.option(o.flag, optionHelp(o));\n }\n // Selected options are ALSO accepted positionally, in declaration order:\n // `operator-info 0` == `operator-info --operator-id 0`. Default: every required,\n // non-repeatable option; an option can opt in/out with `positional`. A repeatable positional\n // is variadic (`[name...]`) and — per commander — must be the last argument. Declared\n // `[optional]` so the flag form still works; the loop below enforces required-ness + precedence.\n const positionals = desc.options.filter(isPositional);\n const variadicAt = positionals.findIndex((o) => o.repeatable);\n if (variadicAt >= 0 && variadicAt !== positionals.length - 1)\n throw new Error(`${desc.name}: a repeatable positional must be declared last (it is variadic)`);\n for (const o of positionals)\n cmd.argument(`[${flagName(o.flag)}${o.repeatable ? '...' : ''}]`, optionHelp(o));\n // The positional-alias feature is invisible in commander's generated usage (\"[options]\"),\n // so surface the accepted order explicitly in every command's help.\n if (positionals.length > 0) {\n const order = positionals.map((o) => flagName(o.flag) + (o.repeatable ? '...' : '')).join(', ');\n cmd.addHelpText(\n 'after',\n `\\nRequired options may be passed positionally in this order: ${order}`,\n );\n }\n\n // commander calls the action with (...positionalValues, localOpts, command); we ignore the\n // leading values + local opts and read everything off `command` — robust to the arg count.\n cmd.action((...actionArgs: unknown[]) => {\n const command = actionArgs.at(-1) as Command;\n const positionalValues = command.processedArgs as (string | string[] | undefined)[];\n run(async () => {\n const g = command.optsWithGlobals() as Record<string, unknown>;\n const opts: Record<string, unknown> = {};\n for (const o of desc.options) {\n // a positional (when supplied) takes precedence over the flag for the same value. For a\n // variadic positional, an empty array means \"none given\" — fall back to the repeatable flag.\n const posIndex = positionals.indexOf(o);\n const posVal = posIndex >= 0 ? positionalValues[posIndex] : undefined;\n const posSupplied = o.repeatable\n ? Array.isArray(posVal) && posVal.length > 0\n : posVal != null;\n const raw = posSupplied ? posVal : g[flagProp(o.flag)];\n const empty = raw === undefined || (o.repeatable && (raw as string[]).length === 0);\n if (empty) {\n if (o.required) throw new Error(`missing required option ${o.flag.split(' ')[0]}`);\n continue;\n }\n opts[o.key] = o.coerce(raw as string | string[]);\n }\n const moduleName = desc.module ?? (g.module as 'csm' | 'cm' | undefined);\n if (!moduleName) throw new Error('set --module <csm|cm>');\n const rpcUrl = (g.rpcUrl as string | undefined) ?? process.env.RPC_URL ?? DEFAULT_RPC_URL;\n const clMockUrl = (g.clMockUrl as string | undefined) ?? process.env.CL_MOCK_URL;\n if (desc.needsClMock && !clMockUrl)\n throw new Error(`${desc.name} needs --cl-mock-url or CL_MOCK_URL`);\n\n const ctx = await connectImpl({ module: moduleName, rpcUrl, clMockUrl });\n const result = await desc.run(ctx, opts);\n if (g.json) {\n console.log(\n JSON.stringify(result === undefined ? { ok: true } : result, bigintReplacer, 2),\n );\n } else {\n for (const line of desc.report(result, opts)) console.log(line);\n }\n });\n });\n return cmd;\n}\n","import { formatEther } from 'viem';\nimport type { Hex } from '@sm-lab/receipts';\nimport {\n identity,\n toAddressValue,\n toBigInt,\n toEth,\n toHexValue,\n toNumber,\n type RecipeCommand,\n} from '../define';\nimport { addKeys } from '../../recipes/add-keys';\nimport { operatorInfo } from '../../recipes/operator-info';\nimport { deposit } from '../../recipes/deposit';\nimport { unvet, exit } from '../../recipes/vetting';\nimport { increaseAllocatedBalance, topUpActiveKeys } from '../../recipes/topup';\nimport { slash, withdraw } from '../../recipes/validators';\nimport {\n reportPenalty,\n cancelPenalty,\n settlePenalty,\n compensatePenalty,\n} from '../../recipes/penalties';\nimport { addBond, createBondDebt } from '../../recipes/bond';\nimport {\n proposeManager,\n confirmManager,\n proposeReward,\n confirmReward,\n} from '../../recipes/address-changes';\nimport { makeRewards, submitRewards } from '../../recipes/rewards';\nimport { clActivate } from '../../recipes/cl-activate';\nimport { getPubkey, getKeyBalance } from '../../recipes/reads';\nimport { warpBy, snapshot, revert } from '../../recipes/chain';\n\nconst operatorId = {\n flag: '--operator-id <id>',\n key: 'noId',\n coerce: toBigInt,\n required: true,\n description: 'node operator id (uint)',\n};\nconst keyIndex = {\n flag: '--key-index <i>',\n key: 'keyIndex',\n coerce: toBigInt,\n required: true,\n description: 'zero-based key index within the operator',\n};\nconst seedHex = {\n flag: '--seed <hex>',\n key: 'seed',\n coerce: toHexValue,\n description: 'deterministic seed (0x-hex); omit for fresh randomness',\n};\nconst cidEscape = (which: string) => ({\n coerce: identity,\n description: `skip IPFS pinning by supplying the ${which} CID — no running sm-ipfs needed`,\n});\n\nexport const sharedCommands: RecipeCommand[] = [\n {\n name: 'add-keys',\n summary: 'add N fresh validator keys to an operator (pays bond, as manager)',\n options: [\n operatorId,\n { flag: '--count <n>', key: 'count', coerce: toNumber, required: true },\n seedHex,\n ],\n run: (ctx, o: { noId: bigint; count: number; seed?: Hex }) => addKeys(ctx, o),\n report: (r: { publicKeys: Hex[] }, o: { noId: bigint; count: number }) => [\n `operator ${o.noId}: +${o.count} keys`,\n `pubkeys: ${r.publicKeys.join(', ')}`,\n ],\n },\n {\n name: 'operator-info',\n summary:\n \"read a node operator's on-chain record (addresses + key counts); one field per line, --json for the raw object\",\n options: [operatorId],\n run: (ctx, o: { noId: bigint }) => operatorInfo(ctx, o),\n report: (r: Record<string, unknown>, o: { noId: bigint }) => [\n `operator ${o.noId}:`,\n ...Object.entries(r).map(([k, v]) => ` ${k}: ${String(v)}`),\n ],\n },\n {\n name: 'deposit',\n summary: 'deposit N depositable keys (as the StakingRouter)',\n options: [{ flag: '--count <n>', key: 'count', coerce: toBigInt, required: true }],\n run: (ctx, o: { count: bigint }) => deposit(ctx, o),\n report: (r: { deposited: bigint }) => [`deposited: ${r.deposited}`],\n },\n {\n name: 'unvet',\n summary: 'set an operator vetted-keys count down (as the StakingRouter)',\n options: [\n operatorId,\n { flag: '--vetted-keys <n>', key: 'vettedKeys', coerce: toBigInt, required: true },\n ],\n run: (ctx, o: { noId: bigint; vettedKeys: bigint }) => unvet(ctx, o),\n report: (_r, o: { noId: bigint; vettedKeys: bigint }) => [\n `operator ${o.noId}: vetted=${o.vettedKeys}`,\n ],\n },\n {\n name: 'exit',\n summary: 'report exited keys for an operator (as the StakingRouter)',\n options: [\n operatorId,\n { flag: '--exited-keys <n>', key: 'exitedKeys', coerce: toBigInt, required: true },\n ],\n run: (ctx, o: { noId: bigint; exitedKeys: bigint }) => exit(ctx, o),\n report: (_r, o: { noId: bigint; exitedKeys: bigint }) => [\n `operator ${o.noId}: exited=${o.exitedKeys}`,\n ],\n },\n {\n name: 'increase-allocated-balance',\n summary: \"top up one deposited key's allocated balance (ETH)\",\n options: [\n operatorId,\n keyIndex,\n { flag: '--amount <eth>', key: 'amountWei', coerce: toEth, required: true },\n ],\n run: (ctx, o: { noId: bigint; keyIndex: bigint; amountWei: bigint }) =>\n increaseAllocatedBalance(ctx, o),\n report: (r: { amountWei: bigint }) => [`+${formatEther(r.amountWei)} ETH allocated`],\n },\n {\n name: 'top-up-active-keys',\n summary:\n 'allocate deposit balance to every active key of an operator, in key-index order (TopUpQueueOps FIFO), as the StakingRouter; capped at 2016 ETH per key',\n options: [operatorId],\n run: (ctx, o: { noId: bigint }) => topUpActiveKeys(ctx, o),\n report: (r: { toppedUp: number }) => [`topped up ${r.toppedUp} key(s)`],\n },\n {\n name: 'slash',\n summary: 'slash a validator key (Verifier-gated)',\n options: [operatorId, keyIndex],\n run: (ctx, o: { noId: bigint; keyIndex: bigint }) => slash(ctx, o),\n report: (_r, o: { noId: bigint; keyIndex: bigint }) => [\n `slashed operator ${o.noId} key ${o.keyIndex}`,\n ],\n },\n {\n name: 'withdraw',\n summary: 'report a withdrawn validator (Verifier-gated); balances in ETH',\n options: [\n operatorId,\n keyIndex,\n { flag: '--exit-balance <eth>', key: 'exitBalance', coerce: toEth, required: true },\n { flag: '--slashing-penalty <eth>', key: 'slashingPenalty', coerce: toEth },\n ],\n run: (\n ctx,\n o: { noId: bigint; keyIndex: bigint; exitBalance: bigint; slashingPenalty?: bigint },\n ) => withdraw(ctx, o),\n report: (_r, o: { noId: bigint; keyIndex: bigint }) => [\n `withdrew operator ${o.noId} key ${o.keyIndex}`,\n ],\n },\n {\n name: 'report-penalty',\n summary: 'report a general delayed penalty (ETH amount)',\n options: [\n operatorId,\n { flag: '--amount <eth>', key: 'amount', coerce: toEth, required: true },\n { flag: '--penalty-type <hex>', key: 'penaltyType', coerce: toHexValue },\n { flag: '--details <text>', key: 'details', coerce: identity },\n ],\n run: (ctx, o: { noId: bigint; amount: bigint; penaltyType?: Hex; details?: string }) =>\n reportPenalty(ctx, o),\n report: (_r, o: { noId: bigint; amount: bigint }) => [\n `reported penalty ${formatEther(o.amount)} ETH on operator ${o.noId}`,\n ],\n },\n {\n name: 'cancel-penalty',\n summary: 'cancel a reported general delayed penalty (ETH amount)',\n options: [operatorId, { flag: '--amount <eth>', key: 'amount', coerce: toEth, required: true }],\n run: (ctx, o: { noId: bigint; amount: bigint }) => cancelPenalty(ctx, o),\n report: (_r, o: { noId: bigint }) => [`cancelled penalty on operator ${o.noId}`],\n },\n {\n name: 'settle-penalty',\n summary: \"settle an operator's general delayed penalty (optional ETH cap)\",\n options: [operatorId, { flag: '--max-amount <eth>', key: 'maxAmount', coerce: toEth }],\n run: (ctx, o: { noId: bigint; maxAmount?: bigint }) => settlePenalty(ctx, o),\n report: (_r, o: { noId: bigint }) => [`settled penalty on operator ${o.noId}`],\n },\n {\n name: 'compensate-penalty',\n summary: \"compensate (pay off) an operator's penalty (as manager)\",\n options: [operatorId],\n run: (ctx, o: { noId: bigint }) => compensatePenalty(ctx, o),\n report: (_r, o: { noId: bigint }) => [`compensated penalty on operator ${o.noId}`],\n },\n {\n name: 'add-bond',\n summary: 'add bond to an operator (ETH)',\n options: [operatorId, { flag: '--amount <eth>', key: 'amount', coerce: toEth, required: true }],\n run: (ctx, o: { noId: bigint; amount: bigint }) => addBond(ctx, o),\n report: (_r, o: { noId: bigint; amount: bigint }) => [\n `added ${formatEther(o.amount)} ETH bond to operator ${o.noId}`,\n ],\n },\n {\n name: 'create-bond-debt',\n summary: 'create a bond debt by penalizing an operator (ETH)',\n options: [operatorId, { flag: '--amount <eth>', key: 'amount', coerce: toEth, required: true }],\n run: (ctx, o: { noId: bigint; amount: bigint }) => createBondDebt(ctx, o),\n report: (r: { penaltyCovered: boolean }, o: { noId: bigint }) => [\n `operator ${o.noId}: debt created (penaltyCovered=${r.penaltyCovered})`,\n ],\n },\n {\n name: 'propose-manager',\n summary: 'propose a new manager address (as current manager)',\n options: [\n operatorId,\n { flag: '--proposed <address>', key: 'proposed', coerce: toAddressValue, required: true },\n ],\n run: (ctx, o: { noId: bigint; proposed: Hex }) => proposeManager(ctx, o),\n report: (_r, o: { noId: bigint; proposed: Hex }) => [\n `operator ${o.noId}: proposed manager ${o.proposed}`,\n ],\n },\n {\n name: 'confirm-manager',\n summary: 'confirm the proposed manager address (as proposed manager)',\n options: [operatorId],\n run: (ctx, o: { noId: bigint }) => confirmManager(ctx, o),\n report: (_r, o: { noId: bigint }) => [`operator ${o.noId}: manager confirmed`],\n },\n {\n name: 'propose-reward',\n summary: 'propose a new reward address (as current manager)',\n options: [\n operatorId,\n { flag: '--proposed <address>', key: 'proposed', coerce: toAddressValue, required: true },\n ],\n run: (ctx, o: { noId: bigint; proposed: Hex }) => proposeReward(ctx, o),\n report: (_r, o: { noId: bigint; proposed: Hex }) => [\n `operator ${o.noId}: proposed reward ${o.proposed}`,\n ],\n },\n {\n name: 'confirm-reward',\n summary: 'confirm the proposed reward address (as proposed reward addr)',\n options: [operatorId],\n run: (ctx, o: { noId: bigint }) => confirmReward(ctx, o),\n report: (_r, o: { noId: bigint }) => [`operator ${o.noId}: reward confirmed`],\n },\n {\n name: 'make-rewards',\n summary: 'build the cumulative rewards tree + pin to IPFS (no submit)',\n options: [\n seedHex,\n { flag: '--tree-cid <cid>', key: 'treeCid', ...cidEscape('tree') },\n { flag: '--log-cid <cid>', key: 'logCid', ...cidEscape('report-log') },\n ],\n run: (ctx, o: { seed?: Hex; treeCid?: string; logCid?: string }) => makeRewards(ctx, o),\n report: (r: { treeRoot: Hex; treeCid: string; logCid: string; distributed: bigint }) => [\n `tree root: ${r.treeRoot}`,\n `tree CID: ${r.treeCid || '(none)'}`,\n `log CID: ${r.logCid || '(none)'}`,\n `distributed: ${formatEther(r.distributed)} ETH`,\n ],\n },\n {\n name: 'submit-rewards',\n summary: 'build AND submit a rewards report (warps to the next frame)',\n options: [\n seedHex,\n { flag: '--tree-cid <cid>', key: 'treeCid', ...cidEscape('tree') },\n { flag: '--log-cid <cid>', key: 'logCid', ...cidEscape('report-log') },\n ],\n run: async (ctx, o: { seed?: Hex; treeCid?: string; logCid?: string }) =>\n submitRewards(ctx, await makeRewards(ctx, o)),\n report: (r: { submitted: boolean; refSlot?: bigint; reportHash?: Hex }) =>\n r.submitted\n ? [`submitted at refSlot ${r.refSlot}`, `reportHash: ${r.reportHash}`]\n : ['skipped: empty report (zero root)'],\n },\n {\n name: 'cl-activate',\n summary:\n 'mark a key active_ongoing on a running cl-mock (requires --cl-mock-url or CL_MOCK_URL)',\n needsClMock: true,\n options: [operatorId, keyIndex],\n run: (ctx, o: { noId: bigint; keyIndex: bigint }) => clActivate(ctx, o),\n report: (r: { pubkey: Hex; status: string; effectiveBalanceGwei: bigint }) => [\n `${r.pubkey}: ${r.status} @ ${r.effectiveBalanceGwei} gwei`,\n ],\n },\n {\n name: 'get-pubkey',\n summary: \"read a key's pubkey\",\n options: [operatorId, keyIndex],\n run: (ctx, o: { noId: bigint; keyIndex: bigint }) => getPubkey(ctx, o),\n report: (r: Hex) => [r],\n },\n {\n name: 'get-key-balance',\n summary: \"read a key's allocated balance\",\n options: [operatorId, keyIndex],\n run: (ctx, o: { noId: bigint; keyIndex: bigint }) => getKeyBalance(ctx, o),\n report: (r: bigint) => [`${formatEther(r)} ETH (${r} wei)`],\n },\n {\n name: 'warp',\n summary: 'advance the fork clock by N seconds',\n options: [{ flag: '--by <seconds>', key: 'by', coerce: toBigInt, required: true }],\n run: (ctx, o: { by: bigint }) => warpBy(ctx, o.by),\n report: (_r, o: { by: bigint }) => [`warped by ${o.by} seconds`],\n },\n {\n name: 'snapshot',\n summary: 'take an EVM snapshot, print its id',\n options: [],\n run: (ctx) => snapshot(ctx),\n report: (r: Hex) => [`snapshot id: ${r}`],\n },\n {\n name: 'revert',\n summary: 'revert the fork to a snapshot id',\n options: [{ flag: '--id <hex>', key: 'id', coerce: toHexValue, required: true }],\n run: (ctx, o: { id: Hex }) => revert(ctx, o.id),\n report: (_r, o: { id: Hex }) => [`reverted to ${o.id}`],\n },\n];\n","import type { Hex } from '@sm-lab/receipts';\nimport {\n identity,\n toAddresses,\n toAddressValue,\n toBigInt,\n toHexValue,\n toPairs,\n type RecipeCommand,\n} from '../define';\nimport {\n createCuratedOperator,\n createOperatorGroup,\n resetOperatorGroup,\n setBondCurveWeight,\n seedCm,\n} from '../../cm';\nimport { resolveGate } from '../../context';\nimport { setGateAddrs } from '../../recipes/set-gate';\n\nconst operatorId = {\n flag: '--operator-id <id>',\n key: 'noId',\n coerce: toBigInt,\n required: true,\n description: 'node operator id (uint)',\n};\n\nconst cmSelectorHelp =\n 'gate selector: po|pto|pgo|do|eeo|iodc|iodcp, gate index 0-6, or 0x… address';\n\nexport const cmCommands: RecipeCommand[] = [\n {\n name: 'seed',\n summary: 'seed a realistic cm fork (3 operators, a group, keyed/deposited/topped-up)',\n module: 'cm',\n options: [\n {\n flag: '--selector <name>',\n key: 'selector',\n coerce: identity,\n description: `${cmSelectorHelp} (default: po)`,\n },\n {\n flag: '--seed <hex>',\n key: 'seed',\n coerce: toHexValue,\n description: 'deterministic seed (0x-hex); omit for fresh randomness',\n },\n ],\n run: (ctx, o: { selector?: string; seed?: Hex }) => seedCm(ctx, o),\n report: (r: { noIds: bigint[]; operators: Hex[] }) => [\n `seeded operators: ${r.noIds.join(', ')}`,\n `addresses: ${r.operators.join(', ')}`,\n ],\n },\n {\n name: 'create-curated-operator',\n summary:\n \"create a curated node operator through a cm gate as --operator (the new operator's address); prints the new operator id\",\n module: 'cm',\n options: [\n {\n flag: '--selector <name>',\n key: 'selector',\n coerce: identity,\n required: true,\n description: cmSelectorHelp,\n },\n { flag: '--operator <address>', key: 'operator', coerce: toAddressValue, required: true },\n ],\n run: (ctx, o: { selector: string; operator: Hex }) => createCuratedOperator(ctx, o),\n report: (r: { noId: bigint }) => [`created operator ${r.noId}`],\n },\n {\n name: 'create-operator-group',\n summary: 'create a MetaRegistry operator group (--pair noId:bps, must sum to 10000)',\n module: 'cm',\n options: [\n {\n flag: '--pair <noId:bps>',\n key: 'pairs',\n coerce: toPairs,\n repeatable: true,\n required: true,\n },\n ],\n run: (ctx, o: { pairs: [bigint, bigint][] }) => createOperatorGroup(ctx, o),\n report: (r: {\n subNodeOperators: { nodeOperatorId: bigint; share: number }[];\n resetGroupIds: bigint[];\n }) => [\n `group created: ${r.subNodeOperators.length} member(s)`,\n `members: ${r.subNodeOperators.map((s) => `${s.nodeOperatorId}@${s.share}bps`).join(', ')}`,\n ...(r.resetGroupIds.length ? [`reset prior groups: ${r.resetGroupIds.join(', ')}`] : []),\n ],\n },\n {\n name: 'reset-operator-group',\n summary: \"reset an operator's group membership\",\n module: 'cm',\n options: [operatorId],\n run: (ctx, o: { noId: bigint }) => resetOperatorGroup(ctx, o),\n report: (_r, o: { noId: bigint }) => [`reset group for operator ${o.noId}`],\n },\n {\n name: 'set-bond-curve-weight',\n summary:\n 'set the MetaRegistry bond-curve weight for a curve id (impersonates the role holder read from the contract)',\n module: 'cm',\n options: [\n { flag: '--curve-id <n>', key: 'curveId', coerce: toBigInt, required: true },\n { flag: '--weight <n>', key: 'weight', coerce: toBigInt, required: true },\n ],\n run: (ctx, o: { curveId: bigint; weight: bigint }) => setBondCurveWeight(ctx, o),\n report: (r: { curveId: bigint; weight: bigint }) => [`curve ${r.curveId} weight=${r.weight}`],\n },\n {\n name: 'set-gate',\n summary: 'build + install a gate address tree (pins to IPFS unless --cid)',\n module: 'cm',\n // Positional form leads with the selector, then the variadic addresses:\n // `cm set-gate pto 0xabc… 0xdef…` == `cm set-gate --selector pto --address 0xabc… --address 0xdef…`\n options: [\n {\n flag: '--selector <name>',\n key: 'selector',\n coerce: identity,\n positional: true,\n description: `${cmSelectorHelp} (default: po)`,\n },\n {\n flag: '--address <addr>',\n key: 'addresses',\n coerce: toAddresses,\n repeatable: true,\n required: true,\n positional: true,\n },\n {\n flag: '--cid <cid>',\n key: 'cid',\n coerce: identity,\n description: 'skip IPFS pinning by supplying the CID — no running sm-ipfs needed',\n },\n ],\n run: (ctx, o: { addresses: Hex[]; selector?: string; cid?: string }) => setGateAddrs(ctx, o),\n report: (r: { treeRoot: Hex; treeCid: string }) => [\n `tree root: ${r.treeRoot}`,\n `tree CID: ${r.treeCid}`,\n ],\n },\n {\n name: 'resolve-gate',\n summary: 'resolve a cm gate contract address by selector (read-only); prints the address',\n module: 'cm',\n options: [\n {\n flag: '--selector <name>',\n key: 'selector',\n coerce: identity,\n required: true,\n description: cmSelectorHelp,\n },\n ],\n run: (ctx, o: { selector: string }) => resolveGate(ctx, o.selector),\n report: (r: Hex, o: { selector: string }) => [`${o.selector} → ${r}`],\n },\n];\n","import type { Hex } from '@sm-lab/receipts';\nimport { identity, toAddresses, type RecipeCommand } from '../define';\nimport { resolveGate } from '../../context';\nimport { setGateAddrs } from '../../recipes/set-gate';\n\nconst csmSelectorHelp = 'gate selector: ics (VettedGate) | idvtc (v3-only) | 0x… gate address';\n\nexport const csmCommands: RecipeCommand[] = [\n {\n name: 'set-gate',\n summary: 'build + install a gate address tree (pins to IPFS unless --cid)',\n module: 'csm',\n // Positional form leads with the selector, then the variadic addresses:\n // `set-gate idvtc 0xabc… 0xdef…` == `set-gate --selector idvtc --address 0xabc… --address 0xdef…`\n options: [\n {\n flag: '--selector <name>',\n key: 'selector',\n coerce: identity,\n positional: true,\n description: `${csmSelectorHelp} (default: ics)`,\n },\n {\n flag: '--address <addr>',\n key: 'addresses',\n coerce: toAddresses,\n repeatable: true,\n required: true,\n positional: true,\n },\n {\n flag: '--cid <cid>',\n key: 'cid',\n coerce: identity,\n description: 'skip IPFS pinning by supplying the CID — no running sm-ipfs needed',\n },\n ],\n run: (ctx, o: { addresses: Hex[]; selector?: string; cid?: string }) => setGateAddrs(ctx, o),\n report: (r: { treeRoot: Hex; treeCid: string }) => [\n `tree root: ${r.treeRoot}`,\n `tree CID: ${r.treeCid}`,\n ],\n },\n {\n name: 'resolve-gate',\n summary: 'resolve a csm gate contract address by selector (read-only); prints the address',\n module: 'csm',\n options: [\n {\n flag: '--selector <name>',\n key: 'selector',\n coerce: identity,\n required: true,\n description: csmSelectorHelp,\n },\n ],\n run: (ctx, o: { selector: string }) => resolveGate(ctx, o.selector),\n report: (r: Hex, o: { selector: string }) => [`${o.selector} → ${r}`],\n },\n];\n","import { Command } from 'commander';\nimport { createCompletionCommand, readPackageVersion } from '@sm-lab/core';\nimport { connect } from '../context';\nimport { defineCommand, type RecipeCommand } from './define';\nimport { sharedCommands } from './commands/shared';\nimport { cmCommands } from './commands/cm';\nimport { csmCommands } from './commands/csm';\n\n/** Pre-bind shared descriptors to a module so they run group-form without --module. */\nconst withModule = (descs: RecipeCommand[], module: 'cm' | 'csm'): RecipeCommand[] =>\n descs.map((d) => ({ ...d, module }));\n\n// addCommand does NOT copy configureHelp settings (only the .command() factory does), so\n// apply showGlobalOptions to every node — leaf --help must list --json/--module/--rpc-url.\nconst showGlobals = (c: Command): void => {\n c.configureHelp({ showGlobalOptions: true });\n for (const child of c.commands) showGlobals(child);\n};\n\nexport function buildProgram(connectImpl: typeof connect = connect): Command {\n const program = new Command()\n .name('sm-recipes')\n .description('Prepare Lido SM on-chain state on an anvil fork (run-and-exit recipes)')\n .version(readPackageVersion(import.meta.url))\n .option('--rpc-url <url>', 'anvil fork RPC URL (default: $RPC_URL or http://127.0.0.1:8545)')\n .option('--module <csm|cm>', 'target module for shared commands')\n .option('--cl-mock-url <url>', 'cl-mock URL for cl-activate (default: $CL_MOCK_URL)')\n .option('--json', 'emit the raw result as JSON')\n .addHelpText(\n 'after',\n `\nExamples:\n sm-recipes operator-info 0 --module csm --json\n sm-recipes csm operator-info 0 --json\n sm-recipes add-keys 0 --module cm --json\n sm-recipes cm seed --json\n sm-recipes completion fish | source`,\n )\n // `sm-recipes help [cmd]` mirrors `--help` (and the cm/csm groups get it too).\n .helpCommand(true);\n\n for (const desc of sharedCommands) program.addCommand(defineCommand(desc, connectImpl));\n program.addCommand(createCompletionCommand());\n\n // Each group lists its own recipes first, then mirrors every shared recipe with the\n // module pre-bound — so `sm-recipes csm <shared>` works without --module, alongside the\n // top-level `--module` form. cm/csm names are disjoint from shared, so no collisions.\n const cm = new Command('cm').description('cm recipes + shared recipes (module forced to cm)');\n for (const desc of [...cmCommands, ...withModule(sharedCommands, 'cm')])\n cm.addCommand(defineCommand(desc, connectImpl));\n program.addCommand(cm);\n\n const csm = new Command('csm').description('csm recipes + shared recipes (module forced to csm)');\n for (const desc of [...csmCommands, ...withModule(sharedCommands, 'csm')])\n csm.addCommand(defineCommand(desc, connectImpl));\n program.addCommand(csm);\n\n showGlobals(program);\n\n return program;\n}\n","#!/usr/bin/env node\n\n// eslint-disable-next-line import/no-unassigned-import -- side-effect import: loads .env\nimport 'dotenv/config';\nimport { buildProgram } from './program';\n\nbuildProgram().parse();\n"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;;;;ACuCA,MAAM,gBAAgB,OAAO;AAC7B,IAAI,YAAY,cAAc,cAAc;CAC3C,YAAY,OAAO,SAAS;EAC3B,IAAI,OAAO,UAAU,YAAY,mBAAmB,OAAO;GAC1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UAAU,6BAA6B,CAAC,CAC/C,YACC,SACA;;;;;;sCAOF,CAAC,CAEA,YAAY,IAAI;CAEnB,KAAK,MAAM,QAAQ,gBAAgB,QAAQ,WAAW,cAAc,MAAM,WAAW,CAAC;CACtF,QAAQ,WAAW,wBAAwB,CAAC;CAK5C,MAAM,KAAK,IAAI,QAAQ,IAAI,CAAC,CAAC,YAAY,mDAAmD;CAC5F,KAAK,MAAM,QAAQ,CAAC,GAAG,YAAY,GAAG,WAAW,gBAAgB,IAAI,CAAC,GACpE,GAAG,WAAW,cAAc,MAAM,WAAW,CAAC;CAChD,QAAQ,WAAW,EAAE;CAErB,MAAM,MAAM,IAAI,QAAQ,KAAK,CAAC,CAAC,YAAY,qDAAqD;CAChG,KAAK,MAAM,QAAQ,CAAC,GAAG,aAAa,GAAG,WAAW,gBAAgB,KAAK,CAAC,GACtE,IAAI,WAAW,cAAc,MAAM,WAAW,CAAC;CACjD,QAAQ,WAAW,GAAG;CAEtB,YAAY,OAAO;CAEnB,OAAO;AACT;;;ACtDA,aAAa,CAAC,CAAC,MAAM"}
|
package/dist/cm.d.mts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { i as Ctx, t as CmGateSelector } from "./context-BiYdAnKn.mjs";
|
|
2
|
+
import { Hex } from "@sm-lab/receipts";
|
|
3
|
+
|
|
4
|
+
//#region src/cm/index.d.ts
|
|
5
|
+
interface CreateCuratedOperatorOptions {
|
|
6
|
+
/** cm gate selector (po/pto/…) or a raw 0x… address. */
|
|
7
|
+
selector: CmGateSelector | string;
|
|
8
|
+
/** The new operator's address; also the merkle leaf proven into the temp tree. */
|
|
9
|
+
operator: Hex;
|
|
10
|
+
/** Second leaf for the N=2 temp tree; derived deterministically from `operator` if omitted. */
|
|
11
|
+
extra?: Hex;
|
|
12
|
+
name?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
}
|
|
15
|
+
interface CreateCuratedOperatorResult {
|
|
16
|
+
noId: bigint;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Create a node operator through a curated gate by temporarily installing a 2-leaf merkle
|
|
20
|
+
* tree that admits `operator`, creating the operator, then restoring the gate's original
|
|
21
|
+
* tree. (Port of `NodeOperators.createCuratedOperator`; no post-assertions — returns noId.)
|
|
22
|
+
*/
|
|
23
|
+
declare function createCuratedOperator(ctx: Ctx, opts: CreateCuratedOperatorOptions): Promise<CreateCuratedOperatorResult>;
|
|
24
|
+
interface CreateOperatorGroupOptions {
|
|
25
|
+
/** [nodeOperatorId, shareBps] pairs; shares in basis points (e.g. 6000 = 60%), must sum to 10000. */
|
|
26
|
+
pairs: [bigint, bigint][];
|
|
27
|
+
/** Optional group name (Solidity leaves it ''); default ''. */
|
|
28
|
+
name?: string;
|
|
29
|
+
}
|
|
30
|
+
interface CreateOperatorGroupResult {
|
|
31
|
+
/** The sub-node-operators written into the NO_GROUP_ID group, in input order. */
|
|
32
|
+
subNodeOperators: {
|
|
33
|
+
nodeOperatorId: bigint;
|
|
34
|
+
share: number;
|
|
35
|
+
}[];
|
|
36
|
+
/** Group ids reset to EMPTY_GROUP first (operators previously in a group), de-duplicated. */
|
|
37
|
+
resetGroupIds: bigint[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Create a node-operator group on the MetaRegistry: reset any pre-existing memberships of the
|
|
41
|
+
* named operators, then write a fresh group under `NO_GROUP_ID`. Port of
|
|
42
|
+
* `MetaRegistryHelpers.createOperatorGroup` (the `MANAGE_OPERATOR_GROUPS_ROLE` member acts).
|
|
43
|
+
*/
|
|
44
|
+
declare function createOperatorGroup(ctx: Ctx, opts: CreateOperatorGroupOptions): Promise<CreateOperatorGroupResult>;
|
|
45
|
+
interface ResetOperatorGroupResult {
|
|
46
|
+
groupId: bigint;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Reset the operator group that contains `noId` to its empty state. Port of
|
|
50
|
+
* `MetaRegistryHelpers.resetOperatorGroup`; throws if the operator is in no group.
|
|
51
|
+
*/
|
|
52
|
+
declare function resetOperatorGroup(ctx: Ctx, opts: {
|
|
53
|
+
noId: bigint;
|
|
54
|
+
}): Promise<ResetOperatorGroupResult>;
|
|
55
|
+
/**
|
|
56
|
+
* Set a bond-curve weight on the MetaRegistry. Port of
|
|
57
|
+
* `MetaRegistryHelpers.setBondCurveWeight` (the `SET_BOND_CURVE_WEIGHT_ROLE` member acts).
|
|
58
|
+
*/
|
|
59
|
+
declare function setBondCurveWeight(ctx: Ctx, opts: {
|
|
60
|
+
curveId: bigint;
|
|
61
|
+
weight: bigint;
|
|
62
|
+
}): Promise<{
|
|
63
|
+
curveId: bigint;
|
|
64
|
+
weight: bigint;
|
|
65
|
+
}>;
|
|
66
|
+
interface SeedCmOptions {
|
|
67
|
+
/** cm gate selector for the 3 created operators (default 'po' = CuratedGates[0]). */
|
|
68
|
+
selector?: CmGateSelector | string;
|
|
69
|
+
/** Deterministic seed for the operator addresses + key material. Omit → fresh random. */
|
|
70
|
+
seed?: Hex;
|
|
71
|
+
}
|
|
72
|
+
interface SeedCmResult {
|
|
73
|
+
/** The 3 created operators' noIds, in creation order (a/b/c). */
|
|
74
|
+
noIds: [bigint, bigint, bigint];
|
|
75
|
+
/** The operator addresses generated for the gate, parallel to `noIds`. */
|
|
76
|
+
operators: [Hex, Hex, Hex];
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Seed a realistic cm fork in one call: create 3 gate operators, group them 34/33/33, then key /
|
|
80
|
+
* deposit / top-up across 3 rounds (and add a final key to two of them). Port of `fork.just
|
|
81
|
+
* seed-cm`. Composes already-tested recipes; uses the noIds returned by `createCuratedOperator`
|
|
82
|
+
* (not hardcoded 0/1/2) so it is correct on a non-fresh fork too. Deterministic when `seed` is set.
|
|
83
|
+
*/
|
|
84
|
+
declare function seedCm(ctx: Ctx, opts?: SeedCmOptions): Promise<SeedCmResult>;
|
|
85
|
+
//#endregion
|
|
86
|
+
export { CreateCuratedOperatorOptions, CreateCuratedOperatorResult, CreateOperatorGroupOptions, CreateOperatorGroupResult, ResetOperatorGroupResult, SeedCmOptions, SeedCmResult, createCuratedOperator, createOperatorGroup, resetOperatorGroup, seedCm, setBondCurveWeight };
|
|
87
|
+
//# sourceMappingURL=cm.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cm.d.mts","names":[],"sources":["../src/cm/index.ts"],"mappings":";;;;UAeiB,4BAAA;;EAEf,QAAA,EAAU,cAAA;EAFiC;EAI3C,QAAA,EAAU,GAAA;EAFA;EAIV,KAAA,GAAQ,GAAA;EACR,IAAA;EACA,WAAA;AAAA;AAAA,UAGe,2BAAA;EACf,IAAI;AAAA;;;;;;iBAQgB,qBAAA,CACpB,GAAA,EAAK,GAAA,EACL,IAAA,EAAM,4BAAA,GACL,OAAA,CAAQ,2BAAA;AAAA,UAoFM,0BAAA;EAhGA;EAkGf,KAAA;;EAEA,IAAI;AAAA;AAAA,UAGW,yBAAA;EA9F0B;EAgGzC,gBAAA;IAAoB,cAAA;IAAwB,KAAA;EAAA;EA7F3C;EA+FD,aAAA;AAAA;;;;;;iBAQoB,mBAAA,CACpB,GAAA,EAAK,GAAA,EACL,IAAA,EAAM,0BAAA,GACL,OAAA,CAAQ,yBAAA;AAAA,UAsEM,wBAAA;EACf,OAAO;AAAA;;;;AAzFH;iBAgGgB,kBAAA,CACpB,GAAA,EAAK,GAAA,EACL,IAAA;EAAQ,IAAA;AAAA,IACP,OAAA,CAAQ,wBAAA;;;;;iBA0CW,kBAAA,CACpB,GAAA,EAAK,GAAA,EACL,IAAA;EAAQ,OAAA;EAAiB,MAAA;AAAA,IACxB,OAAO;EAAG,OAAA;EAAiB,MAAA;AAAA;AAAA,UAiCb,aAAA;EA/JN;EAiKT,QAAA,GAAW,cAAA;EAjKH;EAmKR,IAAA,GAAO,GAAG;AAAA;AAAA,UAGK,YAAA;EAvKT;EAyKN,KAAA;EAxKC;EA0KD,SAAA,GAAY,GAAA,EAAK,GAAA,EAAK,GAAA;AAA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