{"version":3,"file":"server.mjs","names":["#init","#body","#init","#eventInitDict"],"sources":["../node_modules/@hono/node-server/dist/constants-BXAKTxRC.cjs","../node_modules/hono/dist/cjs/helper/websocket/index.js","../node_modules/@hono/node-server/dist/index.cjs","../src/channels/github.ts","../src/agents/mention.ts","../src/common/formatting/summary.ts","../src/github/reporter.ts","../src/review/config.ts","../src/review/instructions.ts","../src/tools/suggest-change.ts","../src/agents/reviewer.ts","../src/common/telemetry.ts","../src/mcp/connect.ts","../src/review/prompt/fileInfo.ts","../src/review/context.ts","../src/review/diff.ts","../src/review/constants.ts","../src/review/utils/filterFiles.ts","../src/workflows/review.ts","../.flue-vite/_entry_server.ts"],"sourcesContent":["\n//#region src/utils/response/constants.ts\nconst X_ALREADY_SENT = \"x-hono-already-sent\";\n\n//#endregion\nObject.defineProperty(exports, 'X_ALREADY_SENT', {\n  enumerable: true,\n  get: function () {\n    return X_ALREADY_SENT;\n  }\n});","var __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n  for (var name in all)\n    __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n  if (from && typeof from === \"object\" || typeof from === \"function\") {\n    for (let key of __getOwnPropNames(from))\n      if (!__hasOwnProp.call(to, key) && key !== except)\n        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n  }\n  return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar websocket_exports = {};\n__export(websocket_exports, {\n  WSContext: () => WSContext,\n  createWSMessageEvent: () => createWSMessageEvent,\n  defineWebSocketHelper: () => defineWebSocketHelper\n});\nmodule.exports = __toCommonJS(websocket_exports);\nclass WSContext {\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}\nconst createWSMessageEvent = (source) => {\n  return new MessageEvent(\"message\", {\n    data: source\n  });\n};\nconst 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};\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  WSContext,\n  createWSMessageEvent,\n  defineWebSocketHelper\n});\n","Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\nconst require_constants = require('./constants-BXAKTxRC.cjs');\nlet node_http = require(\"node:http\");\nlet node_http2 = require(\"node:http2\");\nlet node_stream = require(\"node:stream\");\nlet hono_ws = require(\"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 ||= node_stream.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 = node_stream.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 (node_stream.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 node_http2.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 node_http2.Http2ServerRequest ? incoming.authority : incoming.headers.host) || defaultHostname;\n\tif (!host) throw new RequestError(\"Missing host header\");\n\tlet scheme;\n\tif (incoming instanceof node_http2.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 node_http2.Http2ServerRequest) {\n\t\ttry {\n\t\t\tincoming.stream?.close?.(node_http2.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[require_constants.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 node_http2.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()} ${node_http.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 = (0, hono_ws.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 || node_http.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\nexports.RequestError = RequestError;\nexports.createAdaptorServer = createAdaptorServer;\nexports.getRequestListener = getRequestListener;\nexports.serve = serve;\nexports.upgradeWebSocket = upgradeWebSocket;","import { randomUUID } from 'node:crypto'\nimport { type GitHubChannel, createGitHubChannel } from '@flue/github'\nimport { defineTool, dispatch } from '@flue/runtime'\nimport { Octokit } from 'octokit'\nimport * as v from 'valibot'\nimport mention from '../agents/mention'\n\n/**\n * GitHub channel — the webhook (server) deployment mode. Lets people summon\n * Shippie by commenting `/shippie ...` on an issue or pull request. Verified\n * deliveries are dispatched to the `mention` agent, which replies via Octokit.\n *\n * Served at `POST /channels/github/webhook` on the built server. Requires\n * GITHUB_WEBHOOK_SECRET (verify inbound) and GITHUB_TOKEN (outbound comments).\n * This is separate from the one-shot CI review (action.yml / `flue run review`).\n */\n\nconst MENTION = '/shippie'\n\nexport interface IssueRef {\n  owner: string\n  repo: string\n  issueNumber: number\n}\n\nexport const client = new Octokit({ auth: process.env.GITHUB_TOKEN })\n\n// Flue bundles and loads every discovered module (including this channel) when\n// the server starts or a workflow runs, so this must NOT throw at import time\n// when the webhook secret is absent (e.g. during one-shot `flue run review`).\n// Fall back to an UNGUESSABLE per-process random secret so the module loads\n// inertly AND signature verification fails closed (all deliveries 401) until a\n// real GITHUB_WEBHOOK_SECRET is configured. A constant fallback would let an\n// attacker forge webhook deliveries when the secret is unset.\nconst WEBHOOK_SECRET =\n  process.env.GITHUB_WEBHOOK_SECRET || `shippie-unconfigured-${randomUUID()}`\n\nexport const channel: GitHubChannel = createGitHubChannel({\n  webhookSecret: WEBHOOK_SECRET,\n\n  async webhook({ delivery }) {\n    if (delivery.name === 'issue_comment' && delivery.payload.action === 'created') {\n      const { repository, issue, comment, sender } = delivery.payload\n      if (sender?.type === 'Bot') return undefined\n      if (!comment.body?.toLowerCase().includes(MENTION)) return undefined\n\n      const ref: IssueRef = {\n        owner: repository.owner.login,\n        repo: repository.name,\n        issueNumber: issue.number,\n      }\n      await dispatch(mention, {\n        id: channel.conversationKey(ref),\n        input: {\n          type: 'github.mention',\n          isPullRequest: Boolean(issue.pull_request),\n          title: issue.title,\n          author: sender?.login,\n          request: comment.body,\n        },\n      })\n      return undefined\n    }\n\n    if (\n      delivery.name === 'pull_request_review_comment' &&\n      delivery.payload.action === 'created'\n    ) {\n      const { repository, pull_request, comment, sender } = delivery.payload\n      if (sender?.type === 'Bot') return undefined\n      if (!comment.body?.toLowerCase().includes(MENTION)) return undefined\n\n      const ref: IssueRef = {\n        owner: repository.owner.login,\n        repo: repository.name,\n        issueNumber: pull_request.number,\n      }\n      await dispatch(mention, {\n        id: channel.conversationKey(ref),\n        input: {\n          type: 'github.mention',\n          isPullRequest: true,\n          title: pull_request.title,\n          author: sender?.login,\n          request: comment.body,\n          path: comment.path,\n          line: comment.line ?? null,\n        },\n      })\n      return undefined\n    }\n\n    return undefined\n  },\n})\n\n/** Tool: post a reply comment on the issue/PR that summoned Shippie. */\nexport const commentOnIssue = (ref: IssueRef) =>\n  defineTool({\n    name: 'comment_on_github_issue',\n    description:\n      'Post your reply as a comment on the GitHub issue or pull request that mentioned you.',\n    parameters: v.object({\n      body: v.pipe(\n        v.string(),\n        v.minLength(1),\n        v.description('The markdown comment to post.')\n      ),\n    }),\n    async execute({ body }) {\n      const res = await client.rest.issues.createComment({\n        owner: ref.owner,\n        repo: ref.repo,\n        issue_number: ref.issueNumber,\n        body,\n      })\n      return `Comment posted: ${res.data.html_url}`\n    },\n  })\n\n/** Tool: fetch the unified diff of the pull request that summoned Shippie. */\nexport const getPullRequestDiff = (ref: IssueRef) =>\n  defineTool({\n    name: 'get_pull_request_diff',\n    description:\n      'Fetch the unified diff of the pull request that mentioned you. Call this before reviewing a PR.',\n    parameters: v.object({}),\n    async execute() {\n      const res = await client.rest.pulls.get({\n        owner: ref.owner,\n        repo: ref.repo,\n        pull_number: ref.issueNumber,\n        mediaType: { format: 'diff' },\n      })\n      // With the `diff` media type, GitHub returns the raw diff as a string.\n      return typeof res.data === 'string' ? res.data : JSON.stringify(res.data)\n    },\n  })\n","import { createAgent } from '@flue/runtime'\nimport { channel, commentOnIssue, getPullRequestDiff } from '../channels/github'\n\n/**\n * The `/shippie` mention agent (webhook/channel mode). Dispatched by the GitHub\n * channel when someone comments `/shippie ...` on an issue or PR. It reads the\n * request, optionally fetches the PR diff, and replies with a single comment.\n *\n * Runs on a deployed Flue server (not a repo checkout), so it works through the\n * GitHub API tools rather than a `local()` sandbox.\n */\nexport default createAgent(({ id }) => {\n  const ref = channel.parseConversationKey(id)\n\n  return {\n    model: process.env.SHIPPIE_MODEL ?? 'anthropic/claude-sonnet-4-6',\n    instructions: `You are Shippie, an automated code-review agent summoned by a \"/shippie\" command on ${ref.owner}/${ref.repo} #${ref.issueNumber}.\n\nThe incoming message describes the user's request. Decide what they want:\n- If it is a pull request and they ask you to review it (e.g. \"/shippie review\"), call get_pull_request_diff, review the changed code for bugs, exposed secrets, missing tests, and risky changes, then write a concise review.\n- For any other question, answer it helpfully and concisely based on the request and what you can fetch.\n\nRules:\n- Be brief and specific. Do not restate the whole diff back to the user.\n- Only raise issues you are confident about.\n- ALWAYS finish by calling comment_on_github_issue exactly once with your reply (markdown).`,\n    tools: [commentOnIssue(ref), getPullRequestDiff(ref)],\n  }\n})\n","/**\n * Constants for formatting comments\n */\nexport const FORMATTING = {\n  SUMMARY_TITLE: '## General Summary 🏴‍☠️',\n  SEPARATOR: '\\n\\n---\\n\\n',\n  SIGN_OFF: '### Review powered by [Shippie 🚢](https://github.com/mattzcarey/shippie)',\n  CTA: `<details>\n<summary>🚀 Good review?</summary>\n\n---\n\n**Help us improve!** Your feedback and support make Shippie better for everyone.\n\n⭐ **Quick win?** [Star the repo](https://github.com/mattzcarey/shippie) if you find it useful  \n💡 **Have ideas?** [Open a discussion](https://github.com/mattzcarey/shippie/discussions)\n🛠️ **Wanna chat about agents?** [Send me a DM](https://x.com/mattzcarey)\n\n\n---\n\n*Sponsor the project* to preview features and influence the roadmap\n\n👉 [YOUR COMPANY HERE](https://sustain.dev/sponsor/shippie) 👈\n\n</details>`,\n  TOOL_CALLS_TITLE: '🛠️ Tool Calls',\n  TOKEN_USAGE_TITLE: '📊 Token Usage',\n}\n\n/**\n * Formats a thread comment with title, content, and sign-off\n */\nexport const formatSummary = (comment: string): string => {\n  return `${FORMATTING.SUMMARY_TITLE}\\n\\n${comment}${FORMATTING.SEPARATOR}${FORMATTING.SIGN_OFF}\\n\\n${FORMATTING.CTA}`\n}\n","import { appendFile, mkdir, writeFile } from 'node:fs/promises'\nimport { isAbsolute, join, relative } from 'node:path'\nimport { Octokit } from 'octokit'\nimport { FORMATTING, formatSummary } from '../common/formatting/summary'\nimport type { ReviewConfig } from '../review/config'\n\nexport interface ReviewCommentInput {\n  filePath: string\n  comment: string\n  startLine?: number\n  endLine?: number\n}\n\n/** Posts review output to GitHub (CI) or to a local file (dev). */\nexport interface Reporter {\n  postReviewComment: (input: ReviewCommentInput) => Promise<string | undefined>\n  postSummary: (comment: string) => Promise<string | undefined>\n}\n\n/** Make a workspace-absolute path relative to the repo root for the GitHub API. */\nconst toRepoPath = (workspace: string, filePath: string): string =>\n  isAbsolute(filePath) ? relative(workspace, filePath) : filePath\n\nconst createGithubReporter = (cfg: ReviewConfig): Reporter => {\n  const target = cfg.github\n  if (!target) {\n    throw new Error(\n      'GitHub reporter requires owner/repo/prNumber. Is this running on a PR?'\n    )\n  }\n  const octokit = new Octokit({ auth: target.token })\n  const { owner, repo, prNumber } = target\n\n  const resolveCommitId = async (): Promise<string> => {\n    if (cfg.headSha) return cfg.headSha\n    const pr = await octokit.rest.pulls.get({ owner, repo, pull_number: prNumber })\n    return pr.data.head.sha\n  }\n\n  return {\n    postReviewComment: async ({ filePath, comment, startLine, endLine }) => {\n      const path = toRepoPath(cfg.workspace, filePath)\n      const commit_id = await resolveCommitId()\n      const line = endLine ?? startLine\n      try {\n        const multiLine = startLine && endLine && startLine !== endLine\n        const { data } = await octokit.rest.pulls.createReviewComment({\n          owner,\n          repo,\n          pull_number: prNumber,\n          commit_id,\n          body: comment,\n          path,\n          line,\n          ...(multiLine\n            ? { start_line: startLine, start_side: 'RIGHT', side: 'RIGHT' }\n            : {}),\n        })\n        return data.html_url\n      } catch (error) {\n        // Surface the error to the model so it can adjust the line/path.\n        throw new Error(\n          `Failed to post review comment on ${path}: ${error instanceof Error ? error.message : String(error)}`\n        )\n      }\n    },\n\n    postSummary: async (comment) => {\n      const body = formatSummary(comment)\n      const { data: existing } = await octokit.rest.issues.listComments({\n        owner,\n        repo,\n        issue_number: prNumber,\n      })\n      const prior = existing.find((c) => c.body?.includes(FORMATTING.SIGN_OFF))\n      if (prior) {\n        const { data } = await octokit.rest.issues.updateComment({\n          owner,\n          repo,\n          comment_id: prior.id,\n          body,\n        })\n        return data.html_url\n      }\n      const { data } = await octokit.rest.issues.createComment({\n        owner,\n        repo,\n        issue_number: prNumber,\n        body,\n      })\n      return data.html_url\n    },\n  }\n}\n\n// One report file per process so inline comments (posted by the agent's\n// reporter, created in the agent initializer) and the summary (posted by the\n// workflow's reporter) land in the SAME file, even though they come from two\n// separate createReporter() calls.\nconst LOCAL_RUN_TIMESTAMP = new Date().toISOString().replace(/:/g, '-')\n\nconst createLocalReporter = (cfg: ReviewConfig): Reporter => {\n  const reviewDir = join(cfg.workspace, '.shippie', 'review')\n  const reviewFile = join(reviewDir, `local_${LOCAL_RUN_TIMESTAMP}.md`)\n\n  const ensureDir = async (): Promise<void> => {\n    await mkdir(reviewDir, { recursive: true })\n    await writeFile(join(reviewDir, '.gitignore'), '*').catch(() => {})\n  }\n\n  return {\n    postReviewComment: async ({ filePath, comment, startLine, endLine }) => {\n      await ensureDir()\n      const path = toRepoPath(cfg.workspace, filePath)\n      const loc = startLine\n        ? `:${startLine}${endLine && endLine !== startLine ? `-${endLine}` : ''}`\n        : ''\n      await appendFile(reviewFile, `### ${path}${loc}\\n\\n${comment}\\n\\n`)\n      return `Comment written to ${reviewFile}`\n    },\n    postSummary: async (comment) => {\n      await ensureDir()\n      await appendFile(reviewFile, `${formatSummary(comment)}\\n`)\n      return `Summary written to ${reviewFile}`\n    },\n  }\n}\n\nexport const createReporter = (cfg: ReviewConfig): Reporter => {\n  // On the github platform without PR context (owner/repo/prNumber), degrade to\n  // local file output with a visible warning rather than crashing the review.\n  if (cfg.platform === 'github' && !cfg.github) {\n    console.error(\n      '[shippie] platform is \"github\" but no PR context was found (owner/repo/prNumber). ' +\n        'Falling back to local file output. Set GITHUB_TOKEN + PR metadata to post on the PR.'\n    )\n    return createLocalReporter(cfg)\n  }\n  return cfg.platform === 'github' ? createGithubReporter(cfg) : createLocalReporter(cfg)\n}\n","import type { ThinkingLevel } from '@flue/runtime'\n\n/**\n * Remote MCP server entry. Flue only supports remote (HTTP/SSE) MCP transports,\n * so unlike the old `.mcp.json` there is no `command`/stdio option. MCP servers\n * are supplied via the GitHub Action config (payload or `SHIPPIE_MCP_SERVERS`),\n * never from a checked-in `.mcp.json`.\n */\nexport interface McpServerInput {\n  url: string\n  transport?: 'streamable-http' | 'sse'\n  headers?: Record<string, string>\n}\n\nexport type ReviewPlatform = 'github' | 'local'\n\n/** Payload accepted by the `review` workflow (`flue run review --payload '{...}'`). */\nexport interface ReviewPayload {\n  platform?: ReviewPlatform\n  /** Path to the repository checkout to review. Defaults to GITHUB_WORKSPACE or cwd. */\n  workspace?: string\n  /** Flue model specifier, e.g. `anthropic/claude-sonnet-4-6`. */\n  model?: string\n  thinkingLevel?: ThinkingLevel\n  reviewLanguage?: string\n  ignore?: string[]\n  customInstructions?: string\n  /** Anonymous usage telemetry. Defaults to true; set false to opt out. */\n  telemetry?: boolean\n  owner?: string\n  repo?: string\n  prNumber?: number\n  baseSha?: string\n  headSha?: string\n  mcpServers?: Record<string, McpServerInput>\n}\n\nexport interface GithubTarget {\n  owner: string\n  repo: string\n  prNumber: number\n  token: string\n}\n\nexport interface ReviewConfig {\n  platform: ReviewPlatform\n  workspace: string\n  model: string\n  thinkingLevel: ThinkingLevel\n  reviewLanguage: string\n  ignore?: string[]\n  customInstructions?: string\n  telemetry: boolean\n  baseSha?: string\n  headSha?: string\n  github?: GithubTarget\n  mcpServers: Record<string, McpServerInput>\n}\n\nconst DEFAULT_MODEL = 'anthropic/claude-sonnet-4-6'\nconst DEFAULT_THINKING: ThinkingLevel = 'medium'\n\nconst parseMcpServers = (\n  payload: ReviewPayload,\n  env: NodeJS.ProcessEnv\n): Record<string, McpServerInput> => {\n  if (payload.mcpServers && Object.keys(payload.mcpServers).length > 0) {\n    return payload.mcpServers\n  }\n  const raw = env.SHIPPIE_MCP_SERVERS\n  if (!raw) return {}\n  try {\n    const parsed = JSON.parse(raw) as Record<string, unknown>\n    // Accept either a bare map of servers or a `{ mcpServers: {...} }` wrapper.\n    const servers =\n      parsed && typeof parsed === 'object' && 'mcpServers' in parsed\n        ? (parsed.mcpServers as Record<string, McpServerInput>)\n        : (parsed as Record<string, McpServerInput>)\n    return servers ?? {}\n  } catch {\n    return {}\n  }\n}\n\n/**\n * Resolves the full review configuration from the workflow payload and the\n * environment. Payload values win; GitHub Actions env vars fill the gaps.\n */\nexport const resolveReviewConfig = (\n  payload: ReviewPayload | undefined,\n  env: NodeJS.ProcessEnv = process.env\n): ReviewConfig => {\n  const p = payload ?? {}\n\n  const platform: ReviewPlatform = p.platform ?? (env.GITHUB_ACTIONS ? 'github' : 'local')\n  const workspace = p.workspace ?? env.GITHUB_WORKSPACE ?? process.cwd()\n  const model = p.model ?? env.SHIPPIE_MODEL ?? DEFAULT_MODEL\n  const thinkingLevel =\n    p.thinkingLevel ?? (env.SHIPPIE_THINKING_LEVEL as ThinkingLevel) ?? DEFAULT_THINKING\n  const reviewLanguage = p.reviewLanguage ?? env.SHIPPIE_REVIEW_LANGUAGE ?? 'English'\n  const baseSha = p.baseSha ?? env.BASE_SHA\n  const headSha = p.headSha ?? env.HEAD_SHA ?? env.GITHUB_SHA\n\n  const ignore =\n    p.ignore ??\n    (env.SHIPPIE_IGNORE\n      ? env.SHIPPIE_IGNORE.split(',')\n          .map((g) => g.trim())\n          .filter(Boolean)\n      : undefined)\n  const customInstructions = p.customInstructions ?? env.SHIPPIE_CUSTOM_INSTRUCTIONS\n  const telemetry = p.telemetry ?? env.SHIPPIE_TELEMETRY !== 'false'\n\n  let github: GithubTarget | undefined\n  if (platform === 'github') {\n    const repoSlug = env.GITHUB_REPOSITORY ?? '/'\n    const owner = p.owner ?? repoSlug.split('/')[0]\n    const repo = p.repo ?? repoSlug.split('/')[1]\n    const prNumber = p.prNumber ?? Number(env.SHIPPIE_PR_NUMBER ?? '0')\n    const token = env.GITHUB_TOKEN ?? ''\n    if (owner && repo && prNumber > 0) {\n      github = { owner, repo, prNumber, token }\n    }\n  }\n\n  return {\n    platform,\n    workspace,\n    model,\n    thinkingLevel,\n    reviewLanguage,\n    ignore,\n    customInstructions,\n    telemetry,\n    baseSha,\n    headSha,\n    github,\n    mcpServers: parseMcpServers(p, env),\n  }\n}\n","import { readFile } from 'node:fs/promises'\nimport { join } from 'node:path'\nimport type { ReviewConfig } from './config'\n\n// Root-level project context files, read directly so they always land in the\n// system prompt. Flue natively discovers AGENTS.md + .agents/skills/ for the\n// sandbox, but CLAUDE.md is not flue-native, so we inject both explicitly.\nconst PROJECT_CONTEXT_FILES = ['AGENTS.md', 'AGENT.md', 'CLAUDE.md']\n\nconst reviewSystemPrompt = (reviewLanguage: string): string =>\n  `You are an expert software engineer acting as a meticulous pull request reviewer.\nKeep going until the review is complete. Investigate before you judge.\n\n// Goal\nReview the changed code in the provided diff, post actionable inline comments on real problems,\nand finish by returning a concise summary of the pull request's intent and risks.\n\n// Tools\n- Use the built-in \\`read\\`, \\`grep\\`, \\`glob\\`, and \\`bash\\` tools to investigate the codebase,\n  the surrounding code of a change, tests, and how things are used. You may run \\`git\\`, the\n  project's test runner, or linters via \\`bash\\` when it helps verify correctness.\n- Use \\`suggest_change\\` to post an inline review comment on a specific file and line range.\n  ONLY comment on files with actionable problems. If a file is fine, do not comment on it.\n  If several issues are on nearby lines, combine them into one comment spanning those lines.\n- You may delegate focused investigation to a sub-agent with the \\`task\\` tool.\n\n// Understanding the diff\n- Line numbers reference the NEW version of each file.\n- A range marked \"(deletion)\" is a pure deletion (content removed, nothing added there).\n- Only review lines that were added or removed. Ignore unchanged context.\n\n// Rules for review\n- Functionality: ensure changes do not break existing behaviour; investigate when unsure.\n- Testing: flag missing or inadequate tests for the changed behaviour.\n- Security: flag secrets/API keys in plaintext and obvious injection/authz issues as highest risk.\n- Best practices: clean, DRY, SOLID where applicable — but only raise issues you are confident about.\n- Brevity: keep comments short and specific. If many similar issues exist, comment on the most critical.\n- Confidence: do not comment on unfamiliar libraries unless you are sure there is a problem.\n- Tone: only flag negatives. Do not praise. Provide concrete code suggestions where useful using\n  a fenced \\`\\`\\`suggestion\\`\\`\\` block with a direct replacement for the line(s).\n- Feedback language: write all comments and the summary in ${reviewLanguage}.\n\n// Finish\nWhen you have posted all inline comments, end your turn with a brief, specific summary of the\npull request as your final message: what it changes, why, and any edge cases or risks a reviewer\nshould know about. This final message is posted as the PR summary comment.`\n\n/** Reads root-level AGENTS.md / AGENT.md / CLAUDE.md from the workspace, if present. */\nconst readProjectContext = async (workspace: string): Promise<string> => {\n  const sections: string[] = []\n  for (const fileName of PROJECT_CONTEXT_FILES) {\n    try {\n      const content = (await readFile(join(workspace, fileName), 'utf8')).trim()\n      if (content) {\n        sections.push(`## ${fileName}\\n${content}`)\n      }\n    } catch {\n      // Not present — skip.\n    }\n  }\n  if (sections.length === 0) return ''\n  return `\\n\\n// Project context (follow these project-specific rules)\\n${sections.join('\\n\\n')}`\n}\n\n/**\n * Builds the agent's instructions: the review system prompt, optional custom\n * instructions, and the project's root-level context files.\n */\nexport const buildInstructions = async (cfg: ReviewConfig): Promise<string> => {\n  const custom = cfg.customInstructions\n    ? `\\n\\n// Custom instructions\\n${cfg.customInstructions}`\n    : ''\n  const projectContext = await readProjectContext(cfg.workspace)\n  return `${reviewSystemPrompt(cfg.reviewLanguage)}${custom}${projectContext}`\n}\n","import { defineTool } from '@flue/runtime'\nimport * as v from 'valibot'\nimport type { Reporter } from '../github/reporter'\n\n/**\n * `suggest_change` — posts an inline review comment on a file line or range.\n * Replaces the old AI-SDK `suggest_change` tool; the reporter handles GitHub or\n * local output. Errors are thrown so the agent can correct the line/path.\n */\nexport const createSuggestChangeTool = (reporter: Reporter) =>\n  defineTool({\n    name: 'suggest_change',\n    description:\n      'Post an inline review comment on a specific file and line range. Only use this on files with actionable problems. If several issues are on nearby lines, combine them into one comment that spans all of those lines. Include a fenced ```suggestion``` block with a direct replacement when proposing a concrete fix.',\n    parameters: v.object({\n      filePath: v.pipe(\n        v.string(),\n        v.minLength(1),\n        v.description('Path to the file, relative to the repo root or absolute.')\n      ),\n      comment: v.pipe(\n        v.string(),\n        v.minLength(1),\n        v.description('The review comment. Short, specific, and actionable.')\n      ),\n      startLine: v.optional(\n        v.pipe(\n          v.number(),\n          v.description('First line of the range (new-file line number).')\n        )\n      ),\n      endLine: v.optional(\n        v.pipe(\n          v.number(),\n          v.description('Last line of the range (new-file line number).')\n        )\n      ),\n    }),\n    execute: async ({ filePath, comment, startLine, endLine }) => {\n      const url = await reporter.postReviewComment({\n        filePath,\n        comment,\n        startLine,\n        endLine,\n      })\n      return url ? `Comment posted: ${url}` : 'Comment posted.'\n    },\n  })\n","import { createAgent } from '@flue/runtime'\nimport { local } from '@flue/runtime/node'\nimport { createReporter } from '../github/reporter'\nimport { type ReviewPayload, resolveReviewConfig } from '../review/config'\nimport { buildInstructions } from '../review/instructions'\nimport { createSuggestChangeTool } from '../tools/suggest-change'\n\n/**\n * The Shippie code-review agent. Runs in a `local()` sandbox over the repo\n * checkout, with the built-in pi tools (`read`/`grep`/`glob`/`bash`/`task`) plus\n * the `suggest_change` tool for posting inline review comments.\n *\n * The initializer re-runs on every harness init; it reads the workflow payload\n * and environment to resolve model, instructions, and the reporter binding.\n */\nexport default createAgent<ReviewPayload>(async ({ payload, env }) => {\n  const cfg = resolveReviewConfig(payload, env as NodeJS.ProcessEnv)\n  const reporter = createReporter(cfg)\n\n  return {\n    model: cfg.model,\n    thinkingLevel: cfg.thinkingLevel,\n    sandbox: local({ cwd: cfg.workspace }),\n    cwd: cfg.workspace,\n    instructions: await buildInstructions(cfg),\n    tools: [createSuggestChangeTool(reporter)],\n  }\n})\n","import { createHash, randomUUID } from 'node:crypto'\n\nconst TELEMETRY_URL = 'https://telemetry.shippie.dev/events'\n\n/** Anonymous, opt-out usage telemetry. Disable with SHIPPIE_TELEMETRY=false. */\nexport interface TelemetryInput {\n  enabled: boolean\n  /** Stable seed (owner/repo or workspace path) hashed into an anonymous id. */\n  repoSeed: string\n  platform: string\n  model: string\n  reviewed: number\n}\n\nconst anonId = (seed: string): string =>\n  createHash('sha256').update(seed).digest('hex').slice(0, 32)\n\n/**\n * Fire-and-forget anonymous \"review_started\" event. Never throws and never\n * blocks the review; aborts after 3s. No code or file contents are sent — only\n * an anonymized repo id, the platform, the model, and host info.\n */\nexport const sendReviewStarted = (input: TelemetryInput): void => {\n  if (!input.enabled) return\n\n  const event = {\n    event_type: 'review_started',\n    run_id: randomUUID(),\n    repo_id: anonId(input.repoSeed),\n    platform: input.platform,\n    model: input.model,\n    reviewed: input.reviewed,\n    system: {\n      platform: process.platform,\n      arch: process.arch,\n      node_version: process.version,\n      shippie_version: process.env.npm_package_version ?? 'unknown',\n    },\n  }\n\n  void fetch(TELEMETRY_URL, {\n    method: 'POST',\n    headers: { 'content-type': 'application/json' },\n    body: JSON.stringify(event),\n    signal: AbortSignal.timeout(3000),\n  }).catch(() => {})\n}\n","import { type ToolDefinition, connectMcpServer } from '@flue/runtime'\nimport type { McpServerInput } from '../review/config'\n\nexport interface McpConnection {\n  tools: ToolDefinition[]\n  close: () => Promise<void>\n}\n\n/**\n * Connects to the MCP servers supplied via the GitHub Action config (NOT a\n * `.mcp.json`). Flue supports remote HTTP/SSE transports only, so each entry\n * must be a `url`. A server that fails to connect is skipped (logged to stderr)\n * rather than aborting the whole review.\n */\nexport const connectMcpServers = async (\n  servers: Record<string, McpServerInput>\n): Promise<McpConnection> => {\n  const entries = Object.entries(servers)\n  if (entries.length === 0) {\n    return { tools: [], close: async () => {} }\n  }\n\n  const connections = (\n    await Promise.all(\n      entries.map(async ([name, opts]) => {\n        try {\n          return await connectMcpServer(name, {\n            url: opts.url,\n            transport: opts.transport,\n            headers: opts.headers,\n          })\n        } catch (error) {\n          console.error(\n            `[shippie] Failed to connect MCP server \"${name}\": ${error instanceof Error ? error.message : String(error)}`\n          )\n          return null\n        }\n      })\n    )\n  ).filter((c): c is NonNullable<typeof c> => c !== null)\n\n  return {\n    tools: connections.flatMap((c) => c.tools),\n    close: async () => {\n      await Promise.all(connections.map((c) => c.close().catch(() => {})))\n    },\n  }\n}\n","import { relative } from 'node:path'\nimport type { LineRange, ReviewFile } from '../../common/types'\n\n// Define the structure for a node in the file tree\ninterface TreeNode {\n  name: string\n  children: { [key: string]: TreeNode }\n  isEndOfPath?: boolean // Mark if a node represents a file\n  changedLines?: LineRange[] // Store changed lines for file nodes\n  fullPath?: string // Optional: Store full path for context if needed\n}\n\n/**\n * Builds a file tree structure from a list of ReviewFile objects.\n * Uses paths relative to the workspace root.\n * @param files - An array of ReviewFile objects with absolute paths.\n * @param workspaceRoot - The absolute path to the workspace root.\n * @returns The root TreeNode of the generated file tree.\n */\nconst buildFileTree = (files: ReviewFile[], workspaceRoot: string): TreeNode => {\n  const root: TreeNode = { name: 'root', children: {} }\n\n  for (const file of files) {\n    // Use path relative to workspace root for building the tree structure\n    const relativePath = relative(workspaceRoot, file.fileName)\n    const parts = relativePath.split('/')\n    let currentNode = root\n\n    for (const [index, part] of parts.entries()) {\n      if (!part) continue // Skip empty parts (e.g., from multiple slashes)\n\n      if (!currentNode.children[part]) {\n        currentNode.children[part] = { name: part, children: {} }\n      }\n      currentNode = currentNode.children[part]\n      if (index === parts.length - 1) {\n        currentNode.isEndOfPath = true // Mark as a file\n        currentNode.changedLines = file.changedLines // Store the changed lines\n        currentNode.fullPath = file.fileName // Store original full path if needed\n      }\n    }\n  }\n\n  return root\n}\n\n/**\n * Formats line ranges into a compact string.\n * E.g., [{start: 1, end: 1}, {start: 5, end: 7}] -> \"1, 5-7\"\n * E.g., [{start: 10, end: 10, isPureDeletion: true}] -> \"10 (deletion)\"\n * @param ranges - Array of LineRange objects.\n * @returns A formatted string representation of the line ranges.\n */\nconst formatLineRanges = (ranges?: LineRange[]): string => {\n  if (!ranges || ranges.length === 0) {\n    return ''\n  }\n  // Sort ranges just in case they aren't\n  ranges.sort((a, b) => a.start - b.start)\n  return ranges\n    .map((range) => {\n      if (range.isPureDeletion) {\n        return `${range.start} (deletion)`\n      }\n      return range.start === range.end ? `${range.start}` : `${range.start}-${range.end}`\n    })\n    .join(', ')\n}\n\n/**\n * Formats a file tree node and its children into a string representation.\n * Includes changed line numbers for file nodes.\n * @param node - The TreeNode to format.\n * @param prefix - The prefix string for indentation and tree lines.\n * @param isLast - Whether this node is the last child of its parent.\n * @returns A string representation of the file tree branch.\n */\nconst formatTreeToString = (node: TreeNode, prefix = '', isLast = true): string => {\n  let output = ''\n  // Only add the node itself to the output if it's not the root\n  if (node.name !== 'root') {\n    let nodeString = `${prefix}${isLast ? '└── ' : '├── '}${node.name}`\n    // If it's a file node, append the formatted line ranges\n    if (node.isEndOfPath) {\n      const formattedLines = formatLineRanges(node.changedLines)\n      if (formattedLines) {\n        nodeString += `: ${formattedLines}`\n      }\n    }\n    output += `${nodeString}\\n`\n  }\n\n  const childrenKeys = Object.keys(node.children).sort() // Sort for consistent order\n  for (const [index, key] of childrenKeys.entries()) {\n    const child = node.children[key]\n    const isLastChild = index === childrenKeys.length - 1\n    // Adjust prefix for children:\n    // - If the current node is not root, add padding based on whether it was the last child.\n    // - If the current node is root, children start with no padding.\n    const childPrefix = node.name === 'root' ? '' : `${prefix}${isLast ? '    ' : '│   '}`\n    output += formatTreeToString(child, childPrefix, isLastChild)\n  }\n\n  return output\n}\n\n/**\n * Creates a preamble string containing context for the AI review.\n * Includes a placeholder for the review goal and a file tree visualization\n * of the files, including changed line numbers.\n *\n * @param files - An array of ReviewFile objects representing all files changed in the review.\n * @param workspaceRoot - The absolute path to the workspace root (used for relative paths).\n * @param goal - Optional review goal string.\n * @returns A markdown formatted string to be prepended to the AI prompt.\n */\nexport const createFileInfo = (files: ReviewFile[], workspaceRoot: string): string => {\n  const fileTree = buildFileTree(files, workspaceRoot || '')\n  const fileTreeString = formatTreeToString(fileTree, '', true).trim()\n\n  return `Files changed for this review (paths relative to root, includes line ranges):\\n${fileTreeString}\\n---\\n`\n}\n","import { relative } from 'node:path'\nimport type { ReviewFileWithDiff } from './diff'\nimport { createFileInfo } from './prompt/fileInfo'\n\n/**\n * Builds the user prompt for a review: a file tree with changed line ranges,\n * followed by the raw unified diff of each file under review. The agent can read\n * the full current files and surrounding code with its built-in tools.\n */\nexport const buildReviewPrompt = (\n  files: ReviewFileWithDiff[],\n  workspace: string\n): string => {\n  const fileTree = createFileInfo(files, workspace)\n\n  const diffs = files\n    .map((file) => {\n      const path = relative(workspace, file.fileName)\n      return `### ${path}\\n\\`\\`\\`diff\\n${file.diff}\\n\\`\\`\\``\n    })\n    .join('\\n\\n')\n\n  return `${fileTree}\nBelow are the diffs for the files changed in this pull request. Review them, investigate the\nsurrounding code with your tools, and post inline comments on real problems with \\`suggest_change\\`.\n\n${diffs}`\n}\n","import { execFile } from 'node:child_process'\nimport { readFile } from 'node:fs/promises'\nimport { join } from 'node:path'\nimport { promisify } from 'node:util'\nimport type { LineRange, ReviewFile } from '../common/types'\nimport type { ReviewConfig } from './config'\n\nconst execFileAsync = promisify(execFile)\n\n/** A changed file plus the raw unified diff for that file. */\nexport interface ReviewFileWithDiff extends ReviewFile {\n  diff: string\n}\n\n/** Parsed changed file (no content) — what {@link parseDiff} returns. */\nexport interface ParsedDiffFile {\n  fileName: string\n  changedLines: LineRange[]\n  diff: string\n}\n\n// AMRT = Added/Modified/Renamed/Type-changed. -U0 = no context lines.\nconst DIFF_OPTS = ['--diff-filter=AMRT', '-U0']\n\n/**\n * A git revision/ref/SHA we are willing to pass to `git diff`. baseSha/headSha\n * can originate from the workflow payload, so reject shell metacharacters and a\n * leading \"-\" (which git would treat as an option) to prevent argument\n * injection. We also run git via execFile (no shell), so there is no shell to\n * inject into either.\n */\nconst SAFE_REF = /^[\\w./~^-]+$/\nconst assertSafeRef = (value: string, label: string): string => {\n  if (!SAFE_REF.test(value) || value.startsWith('-')) {\n    throw new Error(`Invalid ${label}: ${JSON.stringify(value)}`)\n  }\n  return value\n}\n\n/** Build the argv for `git diff` (no shell — every value is a discrete arg). */\nexport const buildDiffArgs = (cfg: ReviewConfig): string[] => {\n  const args = ['-C', cfg.workspace, 'diff', ...DIFF_OPTS]\n  if (cfg.baseSha && cfg.headSha) {\n    // Three-dot range: diff from the merge-base of base..head — matches GitHub's\n    // \"Files changed\" view and excludes changes that landed on the base branch\n    // after this PR branched.\n    const base = assertSafeRef(cfg.baseSha, 'baseSha')\n    const head = assertSafeRef(cfg.headSha, 'headSha')\n    args.push(`${base}...${head}`)\n  } else {\n    // Local default: review staged changes.\n    args.push('--cached')\n  }\n  return args\n}\n\n/**\n * Parses the combined output of `git diff -U0` into per-file changed-line ranges\n * (referenced from the new file) and the raw diff text for each file.\n */\nexport const parseDiff = (rawDiff: string, workspace: string): ParsedDiffFile[] => {\n  const diffHeaderRegex = /^diff --git a\\/(.+) b\\/(.+)$/\n  const hunkHeaderRegex = /^@@ -(\\d+)(?:,(\\d+))? \\+(\\d+)(?:,(\\d+))? @@/\n\n  const files: ParsedDiffFile[] = []\n  let current: ParsedDiffFile | null = null\n\n  for (const line of rawDiff.split('\\n')) {\n    const headerMatch = line.match(diffHeaderRegex)\n    if (headerMatch) {\n      current = {\n        fileName: join(workspace, headerMatch[2]),\n        changedLines: [],\n        diff: line,\n      }\n      files.push(current)\n      continue\n    }\n\n    if (!current) continue\n    current.diff += `\\n${line}`\n\n    const hunkMatch = line.match(hunkHeaderRegex)\n    if (!hunkMatch) continue\n\n    const oldLineCount = hunkMatch[2] ? Number.parseInt(hunkMatch[2], 10) : 1\n    const newStartLine = Number.parseInt(hunkMatch[3], 10)\n    const newLineCount = hunkMatch[4] ? Number.parseInt(hunkMatch[4], 10) : 1\n\n    if (newLineCount > 0) {\n      current.changedLines.push({\n        start: newStartLine,\n        end: newStartLine + newLineCount - 1,\n      })\n    } else if (oldLineCount > 0) {\n      // Pure deletion: anchor at the line where content was removed.\n      current.changedLines.push({\n        start: newStartLine,\n        end: newStartLine,\n        isPureDeletion: true,\n      })\n    }\n  }\n\n  return files\n}\n\n/**\n * Computes the changed files for the review using a single `git diff -U0` call.\n * Returns each file with its content, changed-line ranges, and raw diff.\n */\nexport const getChangedFiles = async (\n  cfg: ReviewConfig\n): Promise<{ files: ReviewFileWithDiff[]; rawDiff: string }> => {\n  const { stdout: rawDiff } = await execFileAsync('git', buildDiffArgs(cfg), {\n    maxBuffer: 1024 * 1024 * 20,\n  })\n\n  if (!rawDiff.trim()) {\n    return { files: [], rawDiff: '' }\n  }\n\n  const files = await Promise.all(\n    parseDiff(rawDiff, cfg.workspace).map(async (file): Promise<ReviewFileWithDiff> => {\n      let fileContent = ''\n      try {\n        fileContent = await readFile(file.fileName, 'utf8')\n      } catch {\n        // File may have been deleted/renamed; the diff still carries the change.\n      }\n      return { ...file, fileContent }\n    })\n  )\n\n  return { files, rawDiff }\n}\n","export const languageMap: { [key: string]: string } = {\n  '.js': 'JavaScript',\n  '.ts': 'TypeScript',\n  '.py': 'Python',\n  '.sh': 'Shell',\n  '.go': 'Go',\n  '.rs': 'Rust',\n  '.tsx': 'TypeScript',\n  '.jsx': 'JavaScript',\n  '.dart': 'Dart',\n  '.php': 'PHP',\n  '.cpp': 'C++',\n  '.h': 'C++',\n  '.c': 'C',\n  '.cxx': 'C++',\n  '.hpp': 'C++',\n  '.hxx': 'C++',\n  '.cs': 'C#',\n  '.rb': 'Ruby',\n  '.kt': 'Kotlin',\n  '.kts': 'Kotlin',\n  '.java': 'Java',\n  '.vue': 'Vue',\n  '.tf': 'Terraform',\n  '.hcl': 'Terraform',\n  '.swift': 'Swift',\n  '.md': 'Markdown',\n  '.mdx': 'Markdown',\n  '.mdc': 'Markdown (Cursor rules)',\n  '.txt': 'Text',\n  '.json': 'JSON',\n  '.yaml': 'YAML',\n  '.yml': 'YAML',\n  '.toml': 'TOML',\n  '.html': 'HTML',\n}\n\nexport const defaultIgnoredGlobs = new Set([\n  '**/*.d.ts',\n  'dist/**',\n  'node_modules/**',\n  '**/package-lock.json',\n  '**/*.lock',\n])\n","import { relative } from 'node:path'\nimport picomatch from 'picomatch'\nimport type { ReviewFile } from '../../common/types'\nimport { defaultIgnoredGlobs } from '../constants'\n\n/**\n * Drops files matching the ignore globs. `fileName` is absolute, but ignore\n * globs (e.g. `dist/**`, `node_modules/**`) are repo-relative, so pass the\n * `workspace` to match against the workspace-relative path — otherwise\n * directory globs never match an absolute path and ignored files slip through.\n */\nexport const filterFiles = (\n  files: ReviewFile[],\n  ignoredGlobs?: string[],\n  workspace?: string\n): ReviewFile[] => {\n  const globs = ignoredGlobs ?? Array.from(defaultIgnoredGlobs)\n\n  if (globs.length === 0) {\n    return files\n  }\n\n  const isMatch = picomatch(globs, { dot: true })\n\n  return files.filter((file) => {\n    const candidate = workspace ? relative(workspace, file.fileName) : file.fileName\n    return !isMatch(candidate)\n  })\n}\n","import type { FlueContext, WorkflowRouteHandler } from '@flue/runtime'\nimport reviewer from '../agents/reviewer'\nimport { sendReviewStarted } from '../common/telemetry'\nimport { createReporter } from '../github/reporter'\nimport { connectMcpServers } from '../mcp/connect'\nimport { type ReviewPayload, resolveReviewConfig } from '../review/config'\nimport { buildReviewPrompt } from '../review/context'\nimport { type ReviewFileWithDiff, getChangedFiles } from '../review/diff'\nimport { filterFiles } from '../review/utils/filterFiles'\n\n/**\n * Exposes `POST /workflows/review` on the built server (`node dist/server.mjs`),\n * so the self-built package can run locally over HTTP as well as via `flue run`.\n */\nexport const route: WorkflowRouteHandler = async (_c, next) => next()\n\n/**\n * One-shot code review. Run with:\n *   flue run review --target node --payload '{\"platform\":\"github\", ...}'\n *\n * Computes the PR diff, runs the reviewer agent (which posts inline comments via\n * `suggest_change`), then posts the summary. Returns a JSON result on stdout.\n */\nexport async function run({ init, payload, env }: FlueContext<ReviewPayload>) {\n  const cfg = resolveReviewConfig(payload, env as NodeJS.ProcessEnv)\n\n  const { files } = await getChangedFiles(cfg)\n  const filtered = filterFiles(files, cfg.ignore, cfg.workspace) as ReviewFileWithDiff[]\n\n  if (filtered.length === 0) {\n    return { reviewed: 0, summaryPosted: false, message: 'No changed files to review.' }\n  }\n\n  sendReviewStarted({\n    enabled: cfg.telemetry,\n    repoSeed: cfg.github ? `${cfg.github.owner}/${cfg.github.repo}` : cfg.workspace,\n    platform: cfg.platform,\n    model: cfg.model,\n    reviewed: filtered.length,\n  })\n\n  const mcp = await connectMcpServers(cfg.mcpServers)\n  try {\n    const harness = await init(reviewer, { tools: mcp.tools })\n    const session = await harness.session()\n\n    const prompt = buildReviewPrompt(filtered, cfg.workspace)\n    // Use the agent's final message as the summary rather than a structured\n    // `result` schema: response_format/json_schema is not supported by every\n    // provider (e.g. Cloudflare Workers AI returns 400), and a free-text final\n    // message keeps the workflow model-agnostic.\n    const response = await session.prompt(prompt)\n    const summary =\n      response.text?.trim() || 'Shippie completed the review; see the inline comments.'\n\n    const reporter = createReporter(cfg)\n    const summaryUrl = await reporter.postSummary(summary)\n\n    return {\n      reviewed: filtered.length,\n      summaryPosted: Boolean(summaryUrl),\n      summaryUrl,\n      summary,\n    }\n  } finally {\n    await mcp.close()\n  }\n}\n","\n// Auto-generated by flue (target: node)\nimport { getPackagedSkills } from 'virtual:flue/packaged-skills';\nimport { serve } from '@hono/node-server';\nimport { sqlite } from '@flue/runtime/node';\nimport {\n  Bash,\n  InMemoryFs,\n  createFlueContext,\n  createNodeAgentCoordinator,\n  createNodeDispatchQueue,\n  bashFactoryToSessionEnv,\n  resolveModel,\n  configureFlueRuntime,\n  createDefaultFlueApp,\n  invokeWorkflowAttached,\n  invokeDirectAttached,\n  generateWorkflowRunId,\n} from '@flue/runtime/internal';\nimport * as handler_mention_0 from \"/home/runner/work/shippie/shippie/src/agents/mention.ts\";\nimport * as handler_reviewer_1 from \"/home/runner/work/shippie/shippie/src/agents/reviewer.ts\";\nimport * as workflow_review_0 from \"/home/runner/work/shippie/shippie/src/workflows/review.ts\";\nimport * as channel_github_0 from \"/home/runner/work/shippie/shippie/src/channels/github.ts\";\n\n\n\n// ─── Config ─────────────────────────────────────────────────────────────────\n\nconst packagedSkills = getPackagedSkills();\n\n\nfunction normalizeBuiltModules(agentModules, workflowModules, channelModules = {}) {\n  const manifest = { agents: [], workflows: [] };\n  const createdAgents = {};\n  const dispatchAgentNames = new Map();\n  const workflowHandlers = {};\n  const localWorkflowHandlers = {};\n  const agentRouteMiddleware = {};\n  const workflowRouteMiddleware = {};\n  const channelHandlers = {};\n  for (const [name, mod] of Object.entries(agentModules)) {\n    if (!mod.default || mod.default.__flueCreatedAgent !== true || typeof mod.default.initialize !== 'function') throw new Error('[flue] Agent \"' + name + '\" must default-export createAgent(...).');\n    if (mod.route !== undefined && typeof mod.route !== 'function') throw new Error('[flue] Agent \"' + name + '\" route export must be a callable Hono middleware value.');\n    if (mod.description !== undefined && (typeof mod.description !== 'string' || mod.description.trim().length === 0)) throw new Error('[flue] Agent \"' + name + '\" description export must be a non-empty string.');\n    const transports = {};\n    if (typeof mod.route === 'function') transports.http = true;\n    const entry = { name, transports, created: true };\n    if (mod.description !== undefined) entry.description = mod.description;\n    manifest.agents.push(entry);\n    createdAgents[name] = mod.default;\n    const previousDispatchName = dispatchAgentNames.get(mod.default);\n    if (previousDispatchName !== undefined) throw new Error('[flue] Agents \"' + previousDispatchName + '\" and \"' + name + '\" default-export the same created agent value. Use distinct createAgent(...) values for dispatchable agent modules.');\n    dispatchAgentNames.set(mod.default, name);\n    if (typeof mod.route === 'function') agentRouteMiddleware[name] = mod.route;\n  }\n\n  for (const [name, mod] of Object.entries(workflowModules)) {\n    if (typeof mod.run !== 'function') throw new Error('[flue] Workflow \"' + name + '\" must export a callable run value.');\n    if (mod.route !== undefined && typeof mod.route !== 'function') throw new Error('[flue] Workflow \"' + name + '\" route export must be a callable Hono middleware value.');\n    const transports = {};\n    if (typeof mod.route === 'function') transports.http = true;\n    manifest.workflows.push({ name, transports });\n    localWorkflowHandlers[name] = mod.run;\n    if (transports.http) workflowHandlers[name] = mod.run;\n    if (typeof mod.route === 'function') workflowRouteMiddleware[name] = mod.route;\n  }\n\n  for (const [name, mod] of Object.entries(channelModules)) {\n    const channel = mod.channel;\n    if (!channel || typeof channel !== 'object' || Array.isArray(channel)) throw new Error('[flue] Channel \"' + name + '\" must export a created channel as the named \"channel\" binding.');\n    if (!Array.isArray(channel.routes) || channel.routes.length === 0) throw new Error('[flue] Channel \"' + name + '\" must declare at least one route.');\n    const routes = {};\n    for (const route of channel.routes) {\n      if (!route || typeof route !== 'object' || Array.isArray(route)) throw new Error('[flue] Channel \"' + name + '\" contains an invalid route declaration.');\n      if (typeof route.method !== 'string' || !/^[A-Z]+$/.test(route.method)) throw new Error('[flue] Channel \"' + name + '\" route method must contain only uppercase ASCII letters.');\n      if (typeof route.path !== 'string' || route.path.length < 2 || !route.path.startsWith('/') || route.path.startsWith('//') || route.path.includes('?') || route.path.includes('#')) throw new Error('[flue] Channel \"' + name + '\" route path must be a non-empty absolute suffix without a query or fragment.');\n      const segments = route.path.split('/');\n      if (segments.some((segment) => segment === '.' || segment === '..')) throw new Error('[flue] Channel \"' + name + '\" route path must remain beneath its channel namespace.');\n      if (typeof route.handler !== 'function') throw new Error('[flue] Channel \"' + name + '\" route handler must be callable.');\n      const key = route.method + ' ' + route.path;\n      if (routes[key] !== undefined) throw new Error('[flue] Channel \"' + name + '\" declares duplicate route \"' + key + '\".');\n      routes[key] = route.handler;\n    }\n    channelHandlers[name] = routes;\n  }\n\n  return { manifest, createdAgents, dispatchAgentNames, workflowHandlers, localWorkflowHandlers, agentRouteMiddleware, workflowRouteMiddleware, channelHandlers };\n}\n\n\nconst agentModules = {\n  \"mention\": handler_mention_0,\n  \"reviewer\": handler_reviewer_1,\n};\nconst workflowModules = {\n  \"review\": workflow_review_0,\n};\nconst channelModules = {\n  \"github\": channel_github_0,\n};\nconst normalized = normalizeBuiltModules(agentModules, workflowModules, channelModules);\nconst { manifest, createdAgents, dispatchAgentNames, workflowHandlers, localWorkflowHandlers, agentRouteMiddleware, workflowRouteMiddleware, channelHandlers } = normalized;\n\nconst isLocalMode = process.env.FLUE_MODE === 'local';\nconst localCliTarget = process.env.FLUE_CLI_TARGET;\nconst localCliName = process.env.FLUE_CLI_NAME;\nconst localCliId = process.env.FLUE_CLI_ID;\n// IPC mode requires the explicit internal gate set by the Flue CLI in\n// addition to the target vars, so user-supplied FLUE_CLI_* values alone\n// can never switch a production server into IPC mode.\nconst isLocalCliMode =\n  process.env.FLUE_INTERNAL_CLI_IPC === '1' &&\n  (localCliTarget !== undefined || localCliName !== undefined || localCliId !== undefined);\nconst hasIpcChannel = typeof process.send === 'function';\nif (isLocalCliMode && !hasIpcChannel) {\n  console.warn('[flue] FLUE_INTERNAL_CLI_IPC is set but no IPC channel was inherited; ignoring it and starting the HTTP server.');\n}\n\n// ─── Sandbox Environments ───────────────────────────────────────────────────\n\n/**\n * Create an empty in-memory sandbox (default).\n * Uses InMemoryFs (no real filesystem access) with sensible defaults:\n * cwd = /home/user, /tmp exists, /bin and /usr/bin exist.\n */\nasync function createDefaultEnv() {\n  const fs = new InMemoryFs();\n  return bashFactoryToSessionEnv(() => new Bash({\n    fs,\n    network: { dangerouslyAllowFullInternetAccess: true },\n  }));\n}\n\n// Default persistence for Node — in-memory SQLite, process lifetime.\nconst defaultAdapter = sqlite();\nif (defaultAdapter.migrate) await defaultAdapter.migrate();\nconst { executionStore, runStore, eventStreamStore } = await defaultAdapter.connect();\nconst persistenceAdapter = defaultAdapter;\nconst agentCoordinator = createNodeAgentCoordinator({\n  submissions: executionStore.submissions,\n  sessions: executionStore.sessions,\n  agents: createdAgents,\n  createContext: createContextForRequest,\n  eventStreamStore,\n});\nconst dispatchQueue = createNodeDispatchQueue(agentCoordinator);\n\n// Build per-agent durable admission factories so HTTP prompts enter\n// the same durable submission lifecycle as dispatches.\nconst createAdmission = Object.fromEntries(\n  Object.keys(createdAgents).map((name) => [\n    name,\n    (instanceId) => agentCoordinator.createAdmission(name, instanceId),\n  ]),\n);\n\nfunction createContextForRequest(id, runId, payload, req, initialEventIndex, dispatchId) {\n  return createFlueContext({\n    id,\n    runId,\n    dispatchId,\n    payload,\n    initialEventIndex,\n    env: process.env,\n    req,\n    agentConfig: { packagedSkills, resolveModel },\n    createDefaultEnv,\n    defaultStore: executionStore.sessions,\n    submissionStore: executionStore.submissions,\n  });\n}\n\n// ─── Runtime seed ───────────────────────────────────────────────────────────\n\n// Seed the public flue() sub-app with everything it needs to dispatch agent\n// requests in-process. Must run before `flue()` handles any request — by\n// virtue of being a top-level statement, it executes before `serve(...)`\n// below binds the listener. User app.ts files that call `flue()` at top\n// level are also fine because Hono routes are lazy: they read this config\n// only when a request arrives.\nconfigureFlueRuntime({\n  target: 'node',\n  devMode: isLocalMode,\n  runtimeVersion: \"1.0.0-beta.1\",\n  manifest,\n  createAdmission,\n  dispatchQueue,\n  resolveDispatchAgentName: (agent) => dispatchAgentNames.get(agent),\n  workflowHandlers,\n  agentRouteMiddleware,\n  workflowRouteMiddleware,\n  channelHandlers,\n  createContext: createContextForRequest,\n  runStore,\n  eventStreamStore,\n});\n\n// Reconcile any interrupted submissions from a previous process.\n// This is best-effort on startup — errors are logged but do not block the server.\nagentCoordinator.reconcileSubmissions().catch((error) => {\n  console.error('[flue] Startup submission reconciliation failed:', error);\n});\n\n// ─── App composition ────────────────────────────────────────────────────────\n\n// No app.ts: build the default app via @flue/runtime so the generated entry\n// stays `hono`-free (users only need hono in their node_modules when\n// they author their own app.ts). The default mounts `flue()` at root\n// and renders canonical Flue envelopes for unmatched paths.\nconst flueApp = createDefaultFlueApp();\n\n// ─── Start ──────────────────────────────────────────────────────────────────\n\nfunction sendLocalMessage(message, done) {\n  if (!process.send) throw new Error('[flue] Local CLI execution requires an inherited IPC connection.');\n  process.send(message, done);\n}\n\nfunction localRequest() {\n  return new Request('https://flue.invalid/_cli', { method: 'POST' });\n}\n\nfunction localErrorMessage(reason, requestId) {\n  return { type: 'error', requestId, error: { type: 'invalid_request', message: reason, details: reason } };\n}\n\nfunction failLocalStartup(reason) {\n  sendLocalMessage(localErrorMessage(reason), () => process.exit(1));\n}\n\nfunction parseIpcWorkflowMessage(raw) {\n  if (!raw || typeof raw !== 'object' || raw.type !== 'invoke' || typeof raw.requestId !== 'string') {\n    throw new Error('IPC workflow messages must have type \"invoke\" and a string requestId.');\n  }\n  return { type: 'invoke', requestId: raw.requestId, payload: raw.payload === undefined ? {} : raw.payload };\n}\n\nfunction parseIpcAgentMessage(raw) {\n  if (!raw || typeof raw !== 'object' || typeof raw.requestId !== 'string') {\n    throw new Error('IPC agent messages must have a string requestId.');\n  }\n  if (raw.type !== 'prompt' || typeof raw.message !== 'string') {\n    throw new Error('IPC agent messages must have type \"prompt\" with a string message.');\n  }\n  return { type: 'prompt', requestId: raw.requestId, message: raw.message };\n}\n\nfunction ipcErrorMessage(error, requestId, runId) {\n  const publicError = error instanceof Error\n    ? { type: 'internal_error', message: error.message, details: error.message }\n    : { type: 'internal_error', message: String(error), details: String(error) };\n  return runId === undefined\n    ? { type: 'error', requestId, error: publicError }\n    : { type: 'error', requestId, runId, error: publicError };\n}\n\nfunction startLocalWorkflow(name) {\n  const handler = localWorkflowHandlers[name];\n  if (!handler) {\n    failLocalStartup('Unknown workflow: ' + name);\n    return;\n  }\n  let invoked = false;\n  sendLocalMessage({ type: 'ready', target: 'workflow', name });\n  process.on('message', (raw) => {\n    let message;\n    try {\n      message = parseIpcWorkflowMessage(raw);\n      if (invoked) {\n        sendLocalMessage(localErrorMessage('Local workflow execution accepts one invocation only.', message.requestId));\n        return;\n      }\n      invoked = true;\n    } catch (error) {\n      sendLocalMessage(ipcErrorMessage(error));\n      return;\n    }\n    const runId = generateWorkflowRunId();\n    sendLocalMessage({ type: 'started', requestId: message.requestId, runId });\n    void invokeWorkflowAttached({\n      workflowName: name,\n      id: runId,\n      runId,\n      payload: message.payload,\n      request: localRequest(),\n      handler,\n      createContext: createContextForRequest,\n      onEvent: (event) => sendLocalMessage({ type: 'event', requestId: message.requestId, runId, event }),\n      runStore,\n      eventStreamStore,\n    }).then(\n      (invocation) => sendLocalMessage({ type: 'result', requestId: message.requestId, runId, result: invocation.result ?? null }, () => process.exit(0)),\n      (error) => sendLocalMessage(ipcErrorMessage(error, message.requestId, runId), () => process.exit(1)),\n    );\n  });\n}\n\nfunction startLocalAgent(name, id) {\n  if (!id) {\n    failLocalStartup('Local agent connection requires an instance id.');\n    return;\n  }\n  if (!createAdmission[name]) {\n    failLocalStartup('Unknown agent for admission: ' + name);\n    return;\n  }\n  sendLocalMessage({ type: 'ready', target: 'agent', name, instanceId: id });\n  process.on('message', (raw) => {\n    let message;\n    try {\n      message = parseIpcAgentMessage(raw);\n    } catch (error) {\n      sendLocalMessage(ipcErrorMessage(error));\n      return;\n    }\n    let didStart = false;\n    void invokeDirectAttached({\n      payload: { message: message.message },\n      admitAttachedSubmission: createAdmission[name](id),\n      onEvent: (event) => {\n        if (!didStart) {\n          didStart = true;\n          sendLocalMessage({ type: 'started', requestId: message.requestId });\n        }\n        sendLocalMessage({ type: 'event', requestId: message.requestId, event });\n      },\n    }).then(\n      (result) => sendLocalMessage({ type: 'result', requestId: message.requestId, result: result ?? null }),\n      (error) => sendLocalMessage(ipcErrorMessage(error, message.requestId)),\n    );\n  });\n}\n\nif (isLocalCliMode && hasIpcChannel) {\n  if (!localCliName || (localCliTarget !== 'workflow' && localCliTarget !== 'agent')) {\n    failLocalStartup('Invalid local CLI target configuration.');\n  } else if (localCliTarget === 'workflow') {\n    startLocalWorkflow(localCliName);\n  } else {\n    startLocalAgent(localCliName, localCliId);\n  }\n  process.on('disconnect', async () => {\n    await agentCoordinator.shutdown();\n    if (persistenceAdapter.close) await persistenceAdapter.close();\n    process.exit(0);\n  });\n} else {\n  const port = parseInt(process.env.PORT || '3000', 10);\n  const server = serve({\n    fetch: (request, env) => flueApp.fetch(request, env),\n    port,\n    serverOptions: { requestTimeout: 0 },\n  });\n  console.log('[flue] Server listening on http://localhost:' + port);\n  if (isLocalMode) {\n    console.log('[flue] Mode: local');\n  }\n  console.log('[flue] Agents: ' + \"mention, reviewer\");\n  let shuttingDown = false;\n  async function stop(signal, exitCode) {\n    if (shuttingDown) return;\n    shuttingDown = true;\n    console.error('[flue] Received ' + signal + ', shutting down...');\n    // Backstop: force-exit if any shutdown step stalls past the coordinator's\n    // own drain timeout. unref() so the timer never keeps the process alive.\n    setTimeout(() => {\n      console.error('[flue] Shutdown timed out, exiting.');\n      process.exit(exitCode);\n    }, 60_000).unref();\n    // 1. Drain active submissions (abort at turn boundary, wait with timeout).\n    await agentCoordinator.shutdown();\n    // 2. Close persistence adapter.\n    if (persistenceAdapter.close) await persistenceAdapter.close();\n    // 3. Close HTTP server. Destroy open connections (long-poll and SSE\n    // readers are held open indefinitely) so close() can settle.\n    await new Promise((resolve) => {\n      server.close(resolve);\n      server.closeAllConnections();\n    });\n    console.error('[flue] Stopped.');\n    process.exit(exitCode);\n  }\n  process.on('SIGINT', () => { void stop('SIGINT', 130); });\n  process.on('SIGTERM', () => { void stop('SIGT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