@prisma/composer-prisma-cloud 0.2.0-dev.9 → 0.3.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/buckets-main.mjs +795 -0
  2. package/dist/buckets-main.mjs.map +1 -0
  3. package/dist/compute-main.mjs +559 -0
  4. package/dist/compute-main.mjs.map +1 -0
  5. package/dist/control.mjs +41 -1243
  6. package/dist/control.mjs.map +1 -1
  7. package/dist/cron/index.mjs +2 -3
  8. package/dist/cron/index.mjs.map +1 -1
  9. package/dist/cron/scheduler-entrypoint.mjs.map +1 -1
  10. package/dist/cron/scheduler-service.mjs +2 -3
  11. package/dist/cron/scheduler-service.mjs.map +1 -1
  12. package/dist/email/email-entrypoint.mjs.map +1 -1
  13. package/dist/email/email-service.mjs +2 -3
  14. package/dist/email/email-service.mjs.map +1 -1
  15. package/dist/email/index.mjs +2 -3
  16. package/dist/email/index.mjs.map +1 -1
  17. package/dist/email/testing.mjs.map +1 -1
  18. package/dist/get-port-BYnpbW5H.mjs +111 -0
  19. package/dist/get-port-BYnpbW5H.mjs.map +1 -0
  20. package/dist/index.mjs +4 -2
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/local-target.d.mts +12 -0
  23. package/dist/local-target.d.mts.map +1 -0
  24. package/dist/local-target.mjs +6185 -0
  25. package/dist/local-target.mjs.map +1 -0
  26. package/dist/param-BTzY0ne5-CW6ojZ3E.mjs +66 -0
  27. package/dist/param-BTzY0ne5-CW6ojZ3E.mjs.map +1 -0
  28. package/dist/pg-connection-CadPZuEK-CF3FsSQu.mjs +79 -0
  29. package/dist/pg-connection-CadPZuEK-CF3FsSQu.mjs.map +1 -0
  30. package/dist/postgres-main.mjs +602 -0
  31. package/dist/postgres-main.mjs.map +1 -0
  32. package/dist/preflight-names-BPL-qsZF-BfoRgbgb.mjs +1252 -0
  33. package/dist/preflight-names-BPL-qsZF-BfoRgbgb.mjs.map +1 -0
  34. package/dist/{prisma-next-BvBwGCIt-CSauMX4l.mjs → prisma-next-BvBwGCIt-DssgnctU.mjs} +3 -78
  35. package/dist/prisma-next-BvBwGCIt-DssgnctU.mjs.map +1 -0
  36. package/dist/prisma-next.mjs +1 -1
  37. package/dist/{provisioned-edges-B_XS1Mz--NFJgcXK7.mjs → provisioned-edges-C1wSO3cx-YC5C19f9.mjs} +5 -65
  38. package/dist/provisioned-edges-C1wSO3cx-YC5C19f9.mjs.map +1 -0
  39. package/dist/secret-rz_ZqNeq-_xd97Jd9.mjs +47 -0
  40. package/dist/secret-rz_ZqNeq-_xd97Jd9.mjs.map +1 -0
  41. package/dist/segments-NpKN-46R-C_LQ2urs.mjs +1454 -0
  42. package/dist/segments-NpKN-46R-C_LQ2urs.mjs.map +1 -0
  43. package/dist/{serializer-D8_84XWO-DA2B6YbX.mjs → serializer-CJiOhF2d-DJUjQj1i.mjs} +4 -44
  44. package/dist/serializer-CJiOhF2d-DJUjQj1i.mjs.map +1 -0
  45. package/dist/storage/index.mjs +2 -3
  46. package/dist/storage/index.mjs.map +1 -1
  47. package/dist/storage/storage-entrypoint.mjs +4 -21
  48. package/dist/storage/storage-entrypoint.mjs.map +1 -1
  49. package/dist/storage/storage-service.mjs +2 -3
  50. package/dist/storage/storage-service.mjs.map +1 -1
  51. package/dist/storage/testing.d.mts +7 -6
  52. package/dist/storage/testing.d.mts.map +1 -1
  53. package/dist/storage/testing.mjs +4 -21
  54. package/dist/storage/testing.mjs.map +1 -1
  55. package/dist/streams/index.mjs +2 -3
  56. package/dist/streams/index.mjs.map +1 -1
  57. package/dist/streams/streams-entrypoint.mjs.map +1 -1
  58. package/dist/streams/streams-service.mjs +2 -3
  59. package/dist/streams/streams-service.mjs.map +1 -1
  60. package/dist/testing.mjs +1 -1
  61. package/dist/testing.mjs.map +1 -1
  62. package/package.json +21 -14
  63. package/src/exports/local-target.ts +1 -0
  64. package/dist/prisma-next-BvBwGCIt-CSauMX4l.mjs.map +0 -1
  65. package/dist/provisioned-edges-B_XS1Mz--NFJgcXK7.mjs.map +0 -1
  66. package/dist/serializer-D8_84XWO-DA2B6YbX.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segments-NpKN-46R-C_LQ2urs.mjs","names":["fs","path"],"sources":["../../../../node_modules/graceful-fs/polyfills.js","../../../../node_modules/graceful-fs/legacy-streams.js","../../../../node_modules/graceful-fs/clone.js","../../../../node_modules/graceful-fs/graceful-fs.js","../../../../node_modules/retry/lib/retry_operation.js","../../../../node_modules/retry/lib/retry.js","../../../../node_modules/retry/index.js","../../../../node_modules/signal-exit/signals.js","../../../../node_modules/signal-exit/index.js","../../../../node_modules/proper-lockfile/lib/mtime-precision.js","../../../../node_modules/proper-lockfile/lib/lockfile.js","../../../../node_modules/proper-lockfile/lib/adapter.js","../../../../node_modules/proper-lockfile/index.js","../../../1-prisma-cloud/0-lowering/dev-emulators/dist/segments-NpKN-46R.mjs"],"sourcesContent":["var constants = require('constants')\n\nvar origCwd = process.cwd\nvar cwd = null\n\nvar platform = process.env.GRACEFUL_FS_PLATFORM || process.platform\n\nprocess.cwd = function() {\n if (!cwd)\n cwd = origCwd.call(process)\n return cwd\n}\ntry {\n process.cwd()\n} catch (er) {}\n\n// This check is needed until node.js 12 is required\nif (typeof process.chdir === 'function') {\n var chdir = process.chdir\n process.chdir = function (d) {\n cwd = null\n chdir.call(process, d)\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)\n}\n\nmodule.exports = patch\n\nfunction patch (fs) {\n // (re-)implement some things that are known busted or missing.\n\n // lchmod, broken prior to 0.6.2\n // back-port the fix here.\n if (constants.hasOwnProperty('O_SYMLINK') &&\n process.version.match(/^v0\\.6\\.[0-2]|^v0\\.5\\./)) {\n patchLchmod(fs)\n }\n\n // lutimes implementation, or no-op\n if (!fs.lutimes) {\n patchLutimes(fs)\n }\n\n // https://github.com/isaacs/node-graceful-fs/issues/4\n // Chown should not fail on einval or eperm if non-root.\n // It should not fail on enosys ever, as this just indicates\n // that a fs doesn't support the intended operation.\n\n fs.chown = chownFix(fs.chown)\n fs.fchown = chownFix(fs.fchown)\n fs.lchown = chownFix(fs.lchown)\n\n fs.chmod = chmodFix(fs.chmod)\n fs.fchmod = chmodFix(fs.fchmod)\n fs.lchmod = chmodFix(fs.lchmod)\n\n fs.chownSync = chownFixSync(fs.chownSync)\n fs.fchownSync = chownFixSync(fs.fchownSync)\n fs.lchownSync = chownFixSync(fs.lchownSync)\n\n fs.chmodSync = chmodFixSync(fs.chmodSync)\n fs.fchmodSync = chmodFixSync(fs.fchmodSync)\n fs.lchmodSync = chmodFixSync(fs.lchmodSync)\n\n fs.stat = statFix(fs.stat)\n fs.fstat = statFix(fs.fstat)\n fs.lstat = statFix(fs.lstat)\n\n fs.statSync = statFixSync(fs.statSync)\n fs.fstatSync = statFixSync(fs.fstatSync)\n fs.lstatSync = statFixSync(fs.lstatSync)\n\n // if lchmod/lchown do not exist, then make them no-ops\n if (fs.chmod && !fs.lchmod) {\n fs.lchmod = function (path, mode, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchmodSync = function () {}\n }\n if (fs.chown && !fs.lchown) {\n fs.lchown = function (path, uid, gid, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchownSync = function () {}\n }\n\n // on Windows, A/V software can lock the directory, causing this\n // to fail with an EACCES or EPERM if the directory contains newly\n // created files. Try again on failure, for up to 60 seconds.\n\n // Set the timeout this long because some Windows Anti-Virus, such as Parity\n // bit9, may lock files for up to a minute, causing npm package install\n // failures. Also, take care to yield the scheduler. Windows scheduling gives\n // CPU to a busy looping process, which can cause the program causing the lock\n // contention to be starved of CPU by node, so the contention doesn't resolve.\n if (platform === \"win32\") {\n fs.rename = typeof fs.rename !== 'function' ? fs.rename\n : (function (fs$rename) {\n function rename (from, to, cb) {\n var start = Date.now()\n var backoff = 0;\n fs$rename(from, to, function CB (er) {\n if (er\n && (er.code === \"EACCES\" || er.code === \"EPERM\" || er.code === \"EBUSY\")\n && Date.now() - start < 60000) {\n setTimeout(function() {\n fs.stat(to, function (stater, st) {\n if (stater && stater.code === \"ENOENT\")\n fs$rename(from, to, CB);\n else\n cb(er)\n })\n }, backoff)\n if (backoff < 100)\n backoff += 10;\n return;\n }\n if (cb) cb(er)\n })\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)\n return rename\n })(fs.rename)\n }\n\n // if read() returns EAGAIN, then just try it again.\n fs.read = typeof fs.read !== 'function' ? fs.read\n : (function (fs$read) {\n function read (fd, buffer, offset, length, position, callback_) {\n var callback\n if (callback_ && typeof callback_ === 'function') {\n var eagCounter = 0\n callback = function (er, _, __) {\n if (er && er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n callback_.apply(this, arguments)\n }\n }\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n\n // This ensures `util.promisify` works as it does for native `fs.read`.\n if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)\n return read\n })(fs.read)\n\n fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync\n : (function (fs$readSync) { return function (fd, buffer, offset, length, position) {\n var eagCounter = 0\n while (true) {\n try {\n return fs$readSync.call(fs, fd, buffer, offset, length, position)\n } catch (er) {\n if (er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n continue\n }\n throw er\n }\n }\n }})(fs.readSync)\n\n function patchLchmod (fs) {\n fs.lchmod = function (path, mode, callback) {\n fs.open( path\n , constants.O_WRONLY | constants.O_SYMLINK\n , mode\n , function (err, fd) {\n if (err) {\n if (callback) callback(err)\n return\n }\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n fs.fchmod(fd, mode, function (err) {\n fs.close(fd, function(err2) {\n if (callback) callback(err || err2)\n })\n })\n })\n }\n\n fs.lchmodSync = function (path, mode) {\n var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)\n\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n var threw = true\n var ret\n try {\n ret = fs.fchmodSync(fd, mode)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n }\n\n function patchLutimes (fs) {\n if (constants.hasOwnProperty(\"O_SYMLINK\") && fs.futimes) {\n fs.lutimes = function (path, at, mt, cb) {\n fs.open(path, constants.O_SYMLINK, function (er, fd) {\n if (er) {\n if (cb) cb(er)\n return\n }\n fs.futimes(fd, at, mt, function (er) {\n fs.close(fd, function (er2) {\n if (cb) cb(er || er2)\n })\n })\n })\n }\n\n fs.lutimesSync = function (path, at, mt) {\n var fd = fs.openSync(path, constants.O_SYMLINK)\n var ret\n var threw = true\n try {\n ret = fs.futimesSync(fd, at, mt)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n\n } else if (fs.futimes) {\n fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }\n fs.lutimesSync = function () {}\n }\n }\n\n function chmodFix (orig) {\n if (!orig) return orig\n return function (target, mode, cb) {\n return orig.call(fs, target, mode, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chmodFixSync (orig) {\n if (!orig) return orig\n return function (target, mode) {\n try {\n return orig.call(fs, target, mode)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n\n function chownFix (orig) {\n if (!orig) return orig\n return function (target, uid, gid, cb) {\n return orig.call(fs, target, uid, gid, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chownFixSync (orig) {\n if (!orig) return orig\n return function (target, uid, gid) {\n try {\n return orig.call(fs, target, uid, gid)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n function statFix (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = null\n }\n function callback (er, stats) {\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n if (cb) cb.apply(this, arguments)\n }\n return options ? orig.call(fs, target, options, callback)\n : orig.call(fs, target, callback)\n }\n }\n\n function statFixSync (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options) {\n var stats = options ? orig.call(fs, target, options)\n : orig.call(fs, target)\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n return stats;\n }\n }\n\n // ENOSYS means that the fs doesn't support the op. Just ignore\n // that, because it doesn't matter.\n //\n // if there's no getuid, or if getuid() is something other\n // than 0, and the error is EINVAL or EPERM, then just ignore\n // it.\n //\n // This specific case is a silent failure in cp, install, tar,\n // and most other unix tools that manage permissions.\n //\n // When running as root, or if other types of errors are\n // encountered, then it's strict.\n function chownErOk (er) {\n if (!er)\n return true\n\n if (er.code === \"ENOSYS\")\n return true\n\n var nonroot = !process.getuid || process.getuid() !== 0\n if (nonroot) {\n if (er.code === \"EINVAL\" || er.code === \"EPERM\")\n return true\n }\n\n return false\n }\n}\n","var Stream = require('stream').Stream\n\nmodule.exports = legacy\n\nfunction legacy (fs) {\n return {\n ReadStream: ReadStream,\n WriteStream: WriteStream\n }\n\n function ReadStream (path, options) {\n if (!(this instanceof ReadStream)) return new ReadStream(path, options);\n\n Stream.call(this);\n\n var self = this;\n\n this.path = path;\n this.fd = null;\n this.readable = true;\n this.paused = false;\n\n this.flags = 'r';\n this.mode = 438; /*=0666*/\n this.bufferSize = 64 * 1024;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.encoding) this.setEncoding(this.encoding);\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.end === undefined) {\n this.end = Infinity;\n } else if ('number' !== typeof this.end) {\n throw TypeError('end must be a Number');\n }\n\n if (this.start > this.end) {\n throw new Error('start must be <= end');\n }\n\n this.pos = this.start;\n }\n\n if (this.fd !== null) {\n process.nextTick(function() {\n self._read();\n });\n return;\n }\n\n fs.open(this.path, this.flags, this.mode, function (err, fd) {\n if (err) {\n self.emit('error', err);\n self.readable = false;\n return;\n }\n\n self.fd = fd;\n self.emit('open', fd);\n self._read();\n })\n }\n\n function WriteStream (path, options) {\n if (!(this instanceof WriteStream)) return new WriteStream(path, options);\n\n Stream.call(this);\n\n this.path = path;\n this.fd = null;\n this.writable = true;\n\n this.flags = 'w';\n this.encoding = 'binary';\n this.mode = 438; /*=0666*/\n this.bytesWritten = 0;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.start < 0) {\n throw new Error('start must be >= zero');\n }\n\n this.pos = this.start;\n }\n\n this.busy = false;\n this._queue = [];\n\n if (this.fd === null) {\n this._open = fs.open;\n this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);\n this.flush();\n }\n }\n}\n","'use strict'\n\nmodule.exports = clone\n\nvar getPrototypeOf = Object.getPrototypeOf || function (obj) {\n return obj.__proto__\n}\n\nfunction clone (obj) {\n if (obj === null || typeof obj !== 'object')\n return obj\n\n if (obj instanceof Object)\n var copy = { __proto__: getPrototypeOf(obj) }\n else\n var copy = Object.create(null)\n\n Object.getOwnPropertyNames(obj).forEach(function (key) {\n Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))\n })\n\n return copy\n}\n","var fs = require('fs')\nvar polyfills = require('./polyfills.js')\nvar legacy = require('./legacy-streams.js')\nvar clone = require('./clone.js')\n\nvar util = require('util')\n\n/* istanbul ignore next - node 0.x polyfill */\nvar gracefulQueue\nvar previousSymbol\n\n/* istanbul ignore else - node 0.x polyfill */\nif (typeof Symbol === 'function' && typeof Symbol.for === 'function') {\n gracefulQueue = Symbol.for('graceful-fs.queue')\n // This is used in testing by future versions\n previousSymbol = Symbol.for('graceful-fs.previous')\n} else {\n gracefulQueue = '___graceful-fs.queue'\n previousSymbol = '___graceful-fs.previous'\n}\n\nfunction noop () {}\n\nfunction publishQueue(context, queue) {\n Object.defineProperty(context, gracefulQueue, {\n get: function() {\n return queue\n }\n })\n}\n\nvar debug = noop\nif (util.debuglog)\n debug = util.debuglog('gfs4')\nelse if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || ''))\n debug = function() {\n var m = util.format.apply(util, arguments)\n m = 'GFS4: ' + m.split(/\\n/).join('\\nGFS4: ')\n console.error(m)\n }\n\n// Once time initialization\nif (!fs[gracefulQueue]) {\n // This queue can be shared by multiple loaded instances\n var queue = global[gracefulQueue] || []\n publishQueue(fs, queue)\n\n // Patch fs.close/closeSync to shared queue version, because we need\n // to retry() whenever a close happens *anywhere* in the program.\n // This is essential when multiple graceful-fs instances are\n // in play at the same time.\n fs.close = (function (fs$close) {\n function close (fd, cb) {\n return fs$close.call(fs, fd, function (err) {\n // This function uses the graceful-fs shared queue\n if (!err) {\n resetQueue()\n }\n\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n })\n }\n\n Object.defineProperty(close, previousSymbol, {\n value: fs$close\n })\n return close\n })(fs.close)\n\n fs.closeSync = (function (fs$closeSync) {\n function closeSync (fd) {\n // This function uses the graceful-fs shared queue\n fs$closeSync.apply(fs, arguments)\n resetQueue()\n }\n\n Object.defineProperty(closeSync, previousSymbol, {\n value: fs$closeSync\n })\n return closeSync\n })(fs.closeSync)\n\n if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || '')) {\n process.on('exit', function() {\n debug(fs[gracefulQueue])\n require('assert').equal(fs[gracefulQueue].length, 0)\n })\n }\n}\n\nif (!global[gracefulQueue]) {\n publishQueue(global, fs[gracefulQueue]);\n}\n\nmodule.exports = patch(clone(fs))\nif (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {\n module.exports = patch(fs)\n fs.__patched = true;\n}\n\nfunction patch (fs) {\n // Everything that references the open() function needs to be in here\n polyfills(fs)\n fs.gracefulify = patch\n\n fs.createReadStream = createReadStream\n fs.createWriteStream = createWriteStream\n var fs$readFile = fs.readFile\n fs.readFile = readFile\n function readFile (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$readFile(path, options, cb)\n\n function go$readFile (path, options, cb, startTime) {\n return fs$readFile(path, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$writeFile = fs.writeFile\n fs.writeFile = writeFile\n function writeFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$writeFile(path, data, options, cb)\n\n function go$writeFile (path, data, options, cb, startTime) {\n return fs$writeFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$appendFile = fs.appendFile\n if (fs$appendFile)\n fs.appendFile = appendFile\n function appendFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$appendFile(path, data, options, cb)\n\n function go$appendFile (path, data, options, cb, startTime) {\n return fs$appendFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$copyFile = fs.copyFile\n if (fs$copyFile)\n fs.copyFile = copyFile\n function copyFile (src, dest, flags, cb) {\n if (typeof flags === 'function') {\n cb = flags\n flags = 0\n }\n return go$copyFile(src, dest, flags, cb)\n\n function go$copyFile (src, dest, flags, cb, startTime) {\n return fs$copyFile(src, dest, flags, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$readdir = fs.readdir\n fs.readdir = readdir\n var noReaddirOptionVersions = /^v[0-5]\\./\n function readdir (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n var go$readdir = noReaddirOptionVersions.test(process.version)\n ? function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n : function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, options, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n\n return go$readdir(path, options, cb)\n\n function fs$readdirCallback (path, options, cb, startTime) {\n return function (err, files) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([\n go$readdir,\n [path, options, cb],\n err,\n startTime || Date.now(),\n Date.now()\n ])\n else {\n if (files && files.sort)\n files.sort()\n\n if (typeof cb === 'function')\n cb.call(this, err, files)\n }\n }\n }\n }\n\n if (process.version.substr(0, 4) === 'v0.8') {\n var legStreams = legacy(fs)\n ReadStream = legStreams.ReadStream\n WriteStream = legStreams.WriteStream\n }\n\n var fs$ReadStream = fs.ReadStream\n if (fs$ReadStream) {\n ReadStream.prototype = Object.create(fs$ReadStream.prototype)\n ReadStream.prototype.open = ReadStream$open\n }\n\n var fs$WriteStream = fs.WriteStream\n if (fs$WriteStream) {\n WriteStream.prototype = Object.create(fs$WriteStream.prototype)\n WriteStream.prototype.open = WriteStream$open\n }\n\n Object.defineProperty(fs, 'ReadStream', {\n get: function () {\n return ReadStream\n },\n set: function (val) {\n ReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n Object.defineProperty(fs, 'WriteStream', {\n get: function () {\n return WriteStream\n },\n set: function (val) {\n WriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n // legacy names\n var FileReadStream = ReadStream\n Object.defineProperty(fs, 'FileReadStream', {\n get: function () {\n return FileReadStream\n },\n set: function (val) {\n FileReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n var FileWriteStream = WriteStream\n Object.defineProperty(fs, 'FileWriteStream', {\n get: function () {\n return FileWriteStream\n },\n set: function (val) {\n FileWriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n function ReadStream (path, options) {\n if (this instanceof ReadStream)\n return fs$ReadStream.apply(this, arguments), this\n else\n return ReadStream.apply(Object.create(ReadStream.prototype), arguments)\n }\n\n function ReadStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n if (that.autoClose)\n that.destroy()\n\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n that.read()\n }\n })\n }\n\n function WriteStream (path, options) {\n if (this instanceof WriteStream)\n return fs$WriteStream.apply(this, arguments), this\n else\n return WriteStream.apply(Object.create(WriteStream.prototype), arguments)\n }\n\n function WriteStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n that.destroy()\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n }\n })\n }\n\n function createReadStream (path, options) {\n return new fs.ReadStream(path, options)\n }\n\n function createWriteStream (path, options) {\n return new fs.WriteStream(path, options)\n }\n\n var fs$open = fs.open\n fs.open = open\n function open (path, flags, mode, cb) {\n if (typeof mode === 'function')\n cb = mode, mode = null\n\n return go$open(path, flags, mode, cb)\n\n function go$open (path, flags, mode, cb, startTime) {\n return fs$open(path, flags, mode, function (err, fd) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n return fs\n}\n\nfunction enqueue (elem) {\n debug('ENQUEUE', elem[0].name, elem[1])\n fs[gracefulQueue].push(elem)\n retry()\n}\n\n// keep track of the timeout between retry() calls\nvar retryTimer\n\n// reset the startTime and lastTime to now\n// this resets the start of the 60 second overall timeout as well as the\n// delay between attempts so that we'll retry these jobs sooner\nfunction resetQueue () {\n var now = Date.now()\n for (var i = 0; i < fs[gracefulQueue].length; ++i) {\n // entries that are only a length of 2 are from an older version, don't\n // bother modifying those since they'll be retried anyway.\n if (fs[gracefulQueue][i].length > 2) {\n fs[gracefulQueue][i][3] = now // startTime\n fs[gracefulQueue][i][4] = now // lastTime\n }\n }\n // call retry to make sure we're actively processing the queue\n retry()\n}\n\nfunction retry () {\n // clear the timer and remove it to help prevent unintended concurrency\n clearTimeout(retryTimer)\n retryTimer = undefined\n\n if (fs[gracefulQueue].length === 0)\n return\n\n var elem = fs[gracefulQueue].shift()\n var fn = elem[0]\n var args = elem[1]\n // these items may be unset if they were added by an older graceful-fs\n var err = elem[2]\n var startTime = elem[3]\n var lastTime = elem[4]\n\n // if we don't have a startTime we have no way of knowing if we've waited\n // long enough, so go ahead and retry this item now\n if (startTime === undefined) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args)\n } else if (Date.now() - startTime >= 60000) {\n // it's been more than 60 seconds total, bail now\n debug('TIMEOUT', fn.name, args)\n var cb = args.pop()\n if (typeof cb === 'function')\n cb.call(null, err)\n } else {\n // the amount of time between the last attempt and right now\n var sinceAttempt = Date.now() - lastTime\n // the amount of time between when we first tried, and when we last tried\n // rounded up to at least 1\n var sinceStart = Math.max(lastTime - startTime, 1)\n // backoff. wait longer than the total time we've been retrying, but only\n // up to a maximum of 100ms\n var desiredDelay = Math.min(sinceStart * 1.2, 100)\n // it's been long enough since the last retry, do it again\n if (sinceAttempt >= desiredDelay) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args.concat([startTime]))\n } else {\n // if we can't do this job yet, push it to the end of the queue\n // and let the next iteration check again\n fs[gracefulQueue].push(elem)\n }\n }\n\n // schedule our next run if one isn't already scheduled\n if (retryTimer === undefined) {\n retryTimer = setTimeout(retry, 0)\n }\n}\n","function RetryOperation(timeouts, options) {\n // Compatibility for the old (timeouts, retryForever) signature\n if (typeof options === 'boolean') {\n options = { forever: options };\n }\n\n this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));\n this._timeouts = timeouts;\n this._options = options || {};\n this._maxRetryTime = options && options.maxRetryTime || Infinity;\n this._fn = null;\n this._errors = [];\n this._attempts = 1;\n this._operationTimeout = null;\n this._operationTimeoutCb = null;\n this._timeout = null;\n this._operationStart = null;\n\n if (this._options.forever) {\n this._cachedTimeouts = this._timeouts.slice(0);\n }\n}\nmodule.exports = RetryOperation;\n\nRetryOperation.prototype.reset = function() {\n this._attempts = 1;\n this._timeouts = this._originalTimeouts;\n}\n\nRetryOperation.prototype.stop = function() {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n\n this._timeouts = [];\n this._cachedTimeouts = null;\n};\n\nRetryOperation.prototype.retry = function(err) {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n\n if (!err) {\n return false;\n }\n var currentTime = new Date().getTime();\n if (err && currentTime - this._operationStart >= this._maxRetryTime) {\n this._errors.unshift(new Error('RetryOperation timeout occurred'));\n return false;\n }\n\n this._errors.push(err);\n\n var timeout = this._timeouts.shift();\n if (timeout === undefined) {\n if (this._cachedTimeouts) {\n // retry forever, only keep last error\n this._errors.splice(this._errors.length - 1, this._errors.length);\n this._timeouts = this._cachedTimeouts.slice(0);\n timeout = this._timeouts.shift();\n } else {\n return false;\n }\n }\n\n var self = this;\n var timer = setTimeout(function() {\n self._attempts++;\n\n if (self._operationTimeoutCb) {\n self._timeout = setTimeout(function() {\n self._operationTimeoutCb(self._attempts);\n }, self._operationTimeout);\n\n if (self._options.unref) {\n self._timeout.unref();\n }\n }\n\n self._fn(self._attempts);\n }, timeout);\n\n if (this._options.unref) {\n timer.unref();\n }\n\n return true;\n};\n\nRetryOperation.prototype.attempt = function(fn, timeoutOps) {\n this._fn = fn;\n\n if (timeoutOps) {\n if (timeoutOps.timeout) {\n this._operationTimeout = timeoutOps.timeout;\n }\n if (timeoutOps.cb) {\n this._operationTimeoutCb = timeoutOps.cb;\n }\n }\n\n var self = this;\n if (this._operationTimeoutCb) {\n this._timeout = setTimeout(function() {\n self._operationTimeoutCb();\n }, self._operationTimeout);\n }\n\n this._operationStart = new Date().getTime();\n\n this._fn(this._attempts);\n};\n\nRetryOperation.prototype.try = function(fn) {\n console.log('Using RetryOperation.try() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = function(fn) {\n console.log('Using RetryOperation.start() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = RetryOperation.prototype.try;\n\nRetryOperation.prototype.errors = function() {\n return this._errors;\n};\n\nRetryOperation.prototype.attempts = function() {\n return this._attempts;\n};\n\nRetryOperation.prototype.mainError = function() {\n if (this._errors.length === 0) {\n return null;\n }\n\n var counts = {};\n var mainError = null;\n var mainErrorCount = 0;\n\n for (var i = 0; i < this._errors.length; i++) {\n var error = this._errors[i];\n var message = error.message;\n var count = (counts[message] || 0) + 1;\n\n counts[message] = count;\n\n if (count >= mainErrorCount) {\n mainError = error;\n mainErrorCount = count;\n }\n }\n\n return mainError;\n};\n","var RetryOperation = require('./retry_operation');\n\nexports.operation = function(options) {\n var timeouts = exports.timeouts(options);\n return new RetryOperation(timeouts, {\n forever: options && options.forever,\n unref: options && options.unref,\n maxRetryTime: options && options.maxRetryTime\n });\n};\n\nexports.timeouts = function(options) {\n if (options instanceof Array) {\n return [].concat(options);\n }\n\n var opts = {\n retries: 10,\n factor: 2,\n minTimeout: 1 * 1000,\n maxTimeout: Infinity,\n randomize: false\n };\n for (var key in options) {\n opts[key] = options[key];\n }\n\n if (opts.minTimeout > opts.maxTimeout) {\n throw new Error('minTimeout is greater than maxTimeout');\n }\n\n var timeouts = [];\n for (var i = 0; i < opts.retries; i++) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n if (options && options.forever && !timeouts.length) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n // sort the array numerically ascending\n timeouts.sort(function(a,b) {\n return a - b;\n });\n\n return timeouts;\n};\n\nexports.createTimeout = function(attempt, opts) {\n var random = (opts.randomize)\n ? (Math.random() + 1)\n : 1;\n\n var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt));\n timeout = Math.min(timeout, opts.maxTimeout);\n\n return timeout;\n};\n\nexports.wrap = function(obj, options, methods) {\n if (options instanceof Array) {\n methods = options;\n options = null;\n }\n\n if (!methods) {\n methods = [];\n for (var key in obj) {\n if (typeof obj[key] === 'function') {\n methods.push(key);\n }\n }\n }\n\n for (var i = 0; i < methods.length; i++) {\n var method = methods[i];\n var original = obj[method];\n\n obj[method] = function retryWrapper(original) {\n var op = exports.operation(options);\n var args = Array.prototype.slice.call(arguments, 1);\n var callback = args.pop();\n\n args.push(function(err) {\n if (op.retry(err)) {\n return;\n }\n if (err) {\n arguments[0] = op.mainError();\n }\n callback.apply(this, arguments);\n });\n\n op.attempt(function() {\n original.apply(obj, args);\n });\n }.bind(obj, original);\n obj[method].options = options;\n }\n};\n","module.exports = require('./lib/retry');","// This is not the set of all possible signals.\n//\n// It IS, however, the set of all signals that trigger\n// an exit on either Linux or BSD systems. Linux is a\n// superset of the signal names supported on BSD, and\n// the unknown signals just fail to register, so we can\n// catch that easily enough.\n//\n// Don't bother with SIGKILL. It's uncatchable, which\n// means that we can't fire any callbacks anyway.\n//\n// If a user does happen to register a handler on a non-\n// fatal signal like SIGWINCH or something, and then\n// exit, it'll end up firing `process.emit('exit')`, so\n// the handler will be fired anyway.\n//\n// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n// artificially, inherently leave the process in a\n// state from which it is not safe to try and enter JS\n// listeners.\nmodule.exports = [\n 'SIGABRT',\n 'SIGALRM',\n 'SIGHUP',\n 'SIGINT',\n 'SIGTERM'\n]\n\nif (process.platform !== 'win32') {\n module.exports.push(\n 'SIGVTALRM',\n 'SIGXCPU',\n 'SIGXFSZ',\n 'SIGUSR2',\n 'SIGTRAP',\n 'SIGSYS',\n 'SIGQUIT',\n 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n )\n}\n\nif (process.platform === 'linux') {\n module.exports.push(\n 'SIGIO',\n 'SIGPOLL',\n 'SIGPWR',\n 'SIGSTKFLT',\n 'SIGUNUSED'\n )\n}\n","// Note: since nyc uses this module to output coverage, any lines\n// that are in the direct sync flow of nyc's outputCoverage are\n// ignored, since we can never get coverage for them.\n// grab a reference to node's real process object right away\nvar process = global.process\n\nconst processOk = function (process) {\n return process &&\n typeof process === 'object' &&\n typeof process.removeListener === 'function' &&\n typeof process.emit === 'function' &&\n typeof process.reallyExit === 'function' &&\n typeof process.listeners === 'function' &&\n typeof process.kill === 'function' &&\n typeof process.pid === 'number' &&\n typeof process.on === 'function'\n}\n\n// some kind of non-node environment, just no-op\n/* istanbul ignore if */\nif (!processOk(process)) {\n module.exports = function () {\n return function () {}\n }\n} else {\n var assert = require('assert')\n var signals = require('./signals.js')\n var isWin = /^win/i.test(process.platform)\n\n var EE = require('events')\n /* istanbul ignore if */\n if (typeof EE !== 'function') {\n EE = EE.EventEmitter\n }\n\n var emitter\n if (process.__signal_exit_emitter__) {\n emitter = process.__signal_exit_emitter__\n } else {\n emitter = process.__signal_exit_emitter__ = new EE()\n emitter.count = 0\n emitter.emitted = {}\n }\n\n // Because this emitter is a global, we have to check to see if a\n // previous version of this library failed to enable infinite listeners.\n // I know what you're about to say. But literally everything about\n // signal-exit is a compromise with evil. Get used to it.\n if (!emitter.infinite) {\n emitter.setMaxListeners(Infinity)\n emitter.infinite = true\n }\n\n module.exports = function (cb, opts) {\n /* istanbul ignore if */\n if (!processOk(global.process)) {\n return function () {}\n }\n assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')\n\n if (loaded === false) {\n load()\n }\n\n var ev = 'exit'\n if (opts && opts.alwaysLast) {\n ev = 'afterexit'\n }\n\n var remove = function () {\n emitter.removeListener(ev, cb)\n if (emitter.listeners('exit').length === 0 &&\n emitter.listeners('afterexit').length === 0) {\n unload()\n }\n }\n emitter.on(ev, cb)\n\n return remove\n }\n\n var unload = function unload () {\n if (!loaded || !processOk(global.process)) {\n return\n }\n loaded = false\n\n signals.forEach(function (sig) {\n try {\n process.removeListener(sig, sigListeners[sig])\n } catch (er) {}\n })\n process.emit = originalProcessEmit\n process.reallyExit = originalProcessReallyExit\n emitter.count -= 1\n }\n module.exports.unload = unload\n\n var emit = function emit (event, code, signal) {\n /* istanbul ignore if */\n if (emitter.emitted[event]) {\n return\n }\n emitter.emitted[event] = true\n emitter.emit(event, code, signal)\n }\n\n // { <signal>: <listener fn>, ... }\n var sigListeners = {}\n signals.forEach(function (sig) {\n sigListeners[sig] = function listener () {\n /* istanbul ignore if */\n if (!processOk(global.process)) {\n return\n }\n // If there are no other listeners, an exit is coming!\n // Simplest way: remove us and then re-send the signal.\n // We know that this will kill the process, so we can\n // safely emit now.\n var listeners = process.listeners(sig)\n if (listeners.length === emitter.count) {\n unload()\n emit('exit', null, sig)\n /* istanbul ignore next */\n emit('afterexit', null, sig)\n /* istanbul ignore next */\n if (isWin && sig === 'SIGHUP') {\n // \"SIGHUP\" throws an `ENOSYS` error on Windows,\n // so use a supported signal instead\n sig = 'SIGINT'\n }\n /* istanbul ignore next */\n process.kill(process.pid, sig)\n }\n }\n })\n\n module.exports.signals = function () {\n return signals\n }\n\n var loaded = false\n\n var load = function load () {\n if (loaded || !processOk(global.process)) {\n return\n }\n loaded = true\n\n // This is the number of onSignalExit's that are in play.\n // It's important so that we can count the correct number of\n // listeners on signals, and don't wait for the other one to\n // handle it instead of us.\n emitter.count += 1\n\n signals = signals.filter(function (sig) {\n try {\n process.on(sig, sigListeners[sig])\n return true\n } catch (er) {\n return false\n }\n })\n\n process.emit = processEmit\n process.reallyExit = processReallyExit\n }\n module.exports.load = load\n\n var originalProcessReallyExit = process.reallyExit\n var processReallyExit = function processReallyExit (code) {\n /* istanbul ignore if */\n if (!processOk(global.process)) {\n return\n }\n process.exitCode = code || /* istanbul ignore next */ 0\n emit('exit', process.exitCode, null)\n /* istanbul ignore next */\n emit('afterexit', process.exitCode, null)\n /* istanbul ignore next */\n originalProcessReallyExit.call(process, process.exitCode)\n }\n\n var originalProcessEmit = process.emit\n var processEmit = function processEmit (ev, arg) {\n if (ev === 'exit' && processOk(global.process)) {\n /* istanbul ignore else */\n if (arg !== undefined) {\n process.exitCode = arg\n }\n var ret = originalProcessEmit.apply(this, arguments)\n /* istanbul ignore next */\n emit('exit', process.exitCode, null)\n /* istanbul ignore next */\n emit('afterexit', process.exitCode, null)\n /* istanbul ignore next */\n return ret\n } else {\n return originalProcessEmit.apply(this, arguments)\n }\n }\n}\n","'use strict';\n\nconst cacheSymbol = Symbol();\n\nfunction probe(file, fs, callback) {\n const cachedPrecision = fs[cacheSymbol];\n\n if (cachedPrecision) {\n return fs.stat(file, (err, stat) => {\n /* istanbul ignore if */\n if (err) {\n return callback(err);\n }\n\n callback(null, stat.mtime, cachedPrecision);\n });\n }\n\n // Set mtime by ceiling Date.now() to seconds + 5ms so that it's \"not on the second\"\n const mtime = new Date((Math.ceil(Date.now() / 1000) * 1000) + 5);\n\n fs.utimes(file, mtime, mtime, (err) => {\n /* istanbul ignore if */\n if (err) {\n return callback(err);\n }\n\n fs.stat(file, (err, stat) => {\n /* istanbul ignore if */\n if (err) {\n return callback(err);\n }\n\n const precision = stat.mtime.getTime() % 1000 === 0 ? 's' : 'ms';\n\n // Cache the precision in a non-enumerable way\n Object.defineProperty(fs, cacheSymbol, { value: precision });\n\n callback(null, stat.mtime, precision);\n });\n });\n}\n\nfunction getMtime(precision) {\n let now = Date.now();\n\n if (precision === 's') {\n now = Math.ceil(now / 1000) * 1000;\n }\n\n return new Date(now);\n}\n\nmodule.exports.probe = probe;\nmodule.exports.getMtime = getMtime;\n","'use strict';\n\nconst path = require('path');\nconst fs = require('graceful-fs');\nconst retry = require('retry');\nconst onExit = require('signal-exit');\nconst mtimePrecision = require('./mtime-precision');\n\nconst locks = {};\n\nfunction getLockFile(file, options) {\n return options.lockfilePath || `${file}.lock`;\n}\n\nfunction resolveCanonicalPath(file, options, callback) {\n if (!options.realpath) {\n return callback(null, path.resolve(file));\n }\n\n // Use realpath to resolve symlinks\n // It also resolves relative paths\n options.fs.realpath(file, callback);\n}\n\nfunction acquireLock(file, options, callback) {\n const lockfilePath = getLockFile(file, options);\n\n // Use mkdir to create the lockfile (atomic operation)\n options.fs.mkdir(lockfilePath, (err) => {\n if (!err) {\n // At this point, we acquired the lock!\n // Probe the mtime precision\n return mtimePrecision.probe(lockfilePath, options.fs, (err, mtime, mtimePrecision) => {\n // If it failed, try to remove the lock..\n /* istanbul ignore if */\n if (err) {\n options.fs.rmdir(lockfilePath, () => {});\n\n return callback(err);\n }\n\n callback(null, mtime, mtimePrecision);\n });\n }\n\n // If error is not EEXIST then some other error occurred while locking\n if (err.code !== 'EEXIST') {\n return callback(err);\n }\n\n // Otherwise, check if lock is stale by analyzing the file mtime\n if (options.stale <= 0) {\n return callback(Object.assign(new Error('Lock file is already being held'), { code: 'ELOCKED', file }));\n }\n\n options.fs.stat(lockfilePath, (err, stat) => {\n if (err) {\n // Retry if the lockfile has been removed (meanwhile)\n // Skip stale check to avoid recursiveness\n if (err.code === 'ENOENT') {\n return acquireLock(file, { ...options, stale: 0 }, callback);\n }\n\n return callback(err);\n }\n\n if (!isLockStale(stat, options)) {\n return callback(Object.assign(new Error('Lock file is already being held'), { code: 'ELOCKED', file }));\n }\n\n // If it's stale, remove it and try again!\n // Skip stale check to avoid recursiveness\n removeLock(file, options, (err) => {\n if (err) {\n return callback(err);\n }\n\n acquireLock(file, { ...options, stale: 0 }, callback);\n });\n });\n });\n}\n\nfunction isLockStale(stat, options) {\n return stat.mtime.getTime() < Date.now() - options.stale;\n}\n\nfunction removeLock(file, options, callback) {\n // Remove lockfile, ignoring ENOENT errors\n options.fs.rmdir(getLockFile(file, options), (err) => {\n if (err && err.code !== 'ENOENT') {\n return callback(err);\n }\n\n callback();\n });\n}\n\nfunction updateLock(file, options) {\n const lock = locks[file];\n\n // Just for safety, should never happen\n /* istanbul ignore if */\n if (lock.updateTimeout) {\n return;\n }\n\n lock.updateDelay = lock.updateDelay || options.update;\n lock.updateTimeout = setTimeout(() => {\n lock.updateTimeout = null;\n\n // Stat the file to check if mtime is still ours\n // If it is, we can still recover from a system sleep or a busy event loop\n options.fs.stat(lock.lockfilePath, (err, stat) => {\n const isOverThreshold = lock.lastUpdate + options.stale < Date.now();\n\n // If it failed to update the lockfile, keep trying unless\n // the lockfile was deleted or we are over the threshold\n if (err) {\n if (err.code === 'ENOENT' || isOverThreshold) {\n return setLockAsCompromised(file, lock, Object.assign(err, { code: 'ECOMPROMISED' }));\n }\n\n lock.updateDelay = 1000;\n\n return updateLock(file, options);\n }\n\n const isMtimeOurs = lock.mtime.getTime() === stat.mtime.getTime();\n\n if (!isMtimeOurs) {\n return setLockAsCompromised(\n file,\n lock,\n Object.assign(\n new Error('Unable to update lock within the stale threshold'),\n { code: 'ECOMPROMISED' }\n ));\n }\n\n const mtime = mtimePrecision.getMtime(lock.mtimePrecision);\n\n options.fs.utimes(lock.lockfilePath, mtime, mtime, (err) => {\n const isOverThreshold = lock.lastUpdate + options.stale < Date.now();\n\n // Ignore if the lock was released\n if (lock.released) {\n return;\n }\n\n // If it failed to update the lockfile, keep trying unless\n // the lockfile was deleted or we are over the threshold\n if (err) {\n if (err.code === 'ENOENT' || isOverThreshold) {\n return setLockAsCompromised(file, lock, Object.assign(err, { code: 'ECOMPROMISED' }));\n }\n\n lock.updateDelay = 1000;\n\n return updateLock(file, options);\n }\n\n // All ok, keep updating..\n lock.mtime = mtime;\n lock.lastUpdate = Date.now();\n lock.updateDelay = null;\n updateLock(file, options);\n });\n });\n }, lock.updateDelay);\n\n // Unref the timer so that the nodejs process can exit freely\n // This is safe because all acquired locks will be automatically released\n // on process exit\n\n // We first check that `lock.updateTimeout.unref` exists because some users\n // may be using this module outside of NodeJS (e.g., in an electron app),\n // and in those cases `setTimeout` return an integer.\n /* istanbul ignore else */\n if (lock.updateTimeout.unref) {\n lock.updateTimeout.unref();\n }\n}\n\nfunction setLockAsCompromised(file, lock, err) {\n // Signal the lock has been released\n lock.released = true;\n\n // Cancel lock mtime update\n // Just for safety, at this point updateTimeout should be null\n /* istanbul ignore if */\n if (lock.updateTimeout) {\n clearTimeout(lock.updateTimeout);\n }\n\n if (locks[file] === lock) {\n delete locks[file];\n }\n\n lock.options.onCompromised(err);\n}\n\n// ----------------------------------------------------------\n\nfunction lock(file, options, callback) {\n /* istanbul ignore next */\n options = {\n stale: 10000,\n update: null,\n realpath: true,\n retries: 0,\n fs,\n onCompromised: (err) => { throw err; },\n ...options,\n };\n\n options.retries = options.retries || 0;\n options.retries = typeof options.retries === 'number' ? { retries: options.retries } : options.retries;\n options.stale = Math.max(options.stale || 0, 2000);\n options.update = options.update == null ? options.stale / 2 : options.update || 0;\n options.update = Math.max(Math.min(options.update, options.stale / 2), 1000);\n\n // Resolve to a canonical file path\n resolveCanonicalPath(file, options, (err, file) => {\n if (err) {\n return callback(err);\n }\n\n // Attempt to acquire the lock\n const operation = retry.operation(options.retries);\n\n operation.attempt(() => {\n acquireLock(file, options, (err, mtime, mtimePrecision) => {\n if (operation.retry(err)) {\n return;\n }\n\n if (err) {\n return callback(operation.mainError());\n }\n\n // We now own the lock\n const lock = locks[file] = {\n lockfilePath: getLockFile(file, options),\n mtime,\n mtimePrecision,\n options,\n lastUpdate: Date.now(),\n };\n\n // We must keep the lock fresh to avoid staleness\n updateLock(file, options);\n\n callback(null, (releasedCallback) => {\n if (lock.released) {\n return releasedCallback &&\n releasedCallback(Object.assign(new Error('Lock is already released'), { code: 'ERELEASED' }));\n }\n\n // Not necessary to use realpath twice when unlocking\n unlock(file, { ...options, realpath: false }, releasedCallback);\n });\n });\n });\n });\n}\n\nfunction unlock(file, options, callback) {\n options = {\n fs,\n realpath: true,\n ...options,\n };\n\n // Resolve to a canonical file path\n resolveCanonicalPath(file, options, (err, file) => {\n if (err) {\n return callback(err);\n }\n\n // Skip if the lock is not acquired\n const lock = locks[file];\n\n if (!lock) {\n return callback(Object.assign(new Error('Lock is not acquired/owned by you'), { code: 'ENOTACQUIRED' }));\n }\n\n lock.updateTimeout && clearTimeout(lock.updateTimeout); // Cancel lock mtime update\n lock.released = true; // Signal the lock has been released\n delete locks[file]; // Delete from locks\n\n removeLock(file, options, callback);\n });\n}\n\nfunction check(file, options, callback) {\n options = {\n stale: 10000,\n realpath: true,\n fs,\n ...options,\n };\n\n options.stale = Math.max(options.stale || 0, 2000);\n\n // Resolve to a canonical file path\n resolveCanonicalPath(file, options, (err, file) => {\n if (err) {\n return callback(err);\n }\n\n // Check if lockfile exists\n options.fs.stat(getLockFile(file, options), (err, stat) => {\n if (err) {\n // If does not exist, file is not locked. Otherwise, callback with error\n return err.code === 'ENOENT' ? callback(null, false) : callback(err);\n }\n\n // Otherwise, check if lock is stale by analyzing the file mtime\n return callback(null, !isLockStale(stat, options));\n });\n });\n}\n\nfunction getLocks() {\n return locks;\n}\n\n// Remove acquired locks on exit\n/* istanbul ignore next */\nonExit(() => {\n for (const file in locks) {\n const options = locks[file].options;\n\n try { options.fs.rmdirSync(getLockFile(file, options)); } catch (e) { /* Empty */ }\n }\n});\n\nmodule.exports.lock = lock;\nmodule.exports.unlock = unlock;\nmodule.exports.check = check;\nmodule.exports.getLocks = getLocks;\n","'use strict';\n\nconst fs = require('graceful-fs');\n\nfunction createSyncFs(fs) {\n const methods = ['mkdir', 'realpath', 'stat', 'rmdir', 'utimes'];\n const newFs = { ...fs };\n\n methods.forEach((method) => {\n newFs[method] = (...args) => {\n const callback = args.pop();\n let ret;\n\n try {\n ret = fs[`${method}Sync`](...args);\n } catch (err) {\n return callback(err);\n }\n\n callback(null, ret);\n };\n });\n\n return newFs;\n}\n\n// ----------------------------------------------------------\n\nfunction toPromise(method) {\n return (...args) => new Promise((resolve, reject) => {\n args.push((err, result) => {\n if (err) {\n reject(err);\n } else {\n resolve(result);\n }\n });\n\n method(...args);\n });\n}\n\nfunction toSync(method) {\n return (...args) => {\n let err;\n let result;\n\n args.push((_err, _result) => {\n err = _err;\n result = _result;\n });\n\n method(...args);\n\n if (err) {\n throw err;\n }\n\n return result;\n };\n}\n\nfunction toSyncOptions(options) {\n // Shallow clone options because we are oging to mutate them\n options = { ...options };\n\n // Transform fs to use the sync methods instead\n options.fs = createSyncFs(options.fs || fs);\n\n // Retries are not allowed because it requires the flow to be sync\n if (\n (typeof options.retries === 'number' && options.retries > 0) ||\n (options.retries && typeof options.retries.retries === 'number' && options.retries.retries > 0)\n ) {\n throw Object.assign(new Error('Cannot use retries with the sync api'), { code: 'ESYNC' });\n }\n\n return options;\n}\n\nmodule.exports = {\n toPromise,\n toSync,\n toSyncOptions,\n};\n","'use strict';\n\nconst lockfile = require('./lib/lockfile');\nconst { toPromise, toSync, toSyncOptions } = require('./lib/adapter');\n\nasync function lock(file, options) {\n const release = await toPromise(lockfile.lock)(file, options);\n\n return toPromise(release);\n}\n\nfunction lockSync(file, options) {\n const release = toSync(lockfile.lock)(file, toSyncOptions(options));\n\n return toSync(release);\n}\n\nfunction unlock(file, options) {\n return toPromise(lockfile.unlock)(file, options);\n}\n\nfunction unlockSync(file, options) {\n return toSync(lockfile.unlock)(file, toSyncOptions(options));\n}\n\nfunction check(file, options) {\n return toPromise(lockfile.check)(file, options);\n}\n\nfunction checkSync(file, options) {\n return toSync(lockfile.check)(file, toSyncOptions(options));\n}\n\nmodule.exports = lock;\nmodule.exports.lock = lock;\nmodule.exports.unlock = unlock;\nmodule.exports.lockSync = lockSync;\nmodule.exports.unlockSync = unlockSync;\nmodule.exports.check = check;\nmodule.exports.checkSync = checkSync;\n","import * as fs from \"node:fs\";\nimport { spawn } from \"node:child_process\";\nimport * as fs$1 from \"node:fs/promises\";\nimport * as os from \"node:os\";\nimport * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport getPort, { portNumbers } from \"get-port\";\nimport * as properLockfile from \"proper-lockfile\";\nimport { randomUUID } from \"node:crypto\";\n//#region src/state-file.ts\n/**\n* Temp-then-rename JSON state-file writes behind one in-process queue (spec\n* local-dev § 2, \"API hygiene, both daemons\"): each daemon is single-process,\n* so concurrent HTTP handlers mutating the same state file serialize their\n* writes through a `StateFile` instance instead of racing each other on disk.\n*/\nvar StateFile = class {\n\tfilePath;\n\tmode;\n\tqueue = Promise.resolve();\n\tconstructor(filePath, mode) {\n\t\tthis.filePath = filePath;\n\t\tthis.mode = mode;\n\t}\n\t/** Serializes `value` to disk, temp-then-rename, behind this file's write queue. */\n\twrite(value) {\n\t\tconst next = this.queue.then(() => this.writeNow(value));\n\t\tthis.queue = next.catch(() => void 0);\n\t\treturn next;\n\t}\n\t/** Resolves once every write() call made so far has landed on disk — for graceful shutdown, so a SIGTERM can't race an in-flight write and lose it. */\n\tflush() {\n\t\treturn this.queue;\n\t}\n\tasync writeNow(value) {\n\t\tconst dir = path.dirname(this.filePath);\n\t\tawait fs$1.mkdir(dir, { recursive: true });\n\t\tconst tmpPath = path.join(dir, `.${path.basename(this.filePath)}.${randomUUID()}.tmp`);\n\t\tconst json = `${JSON.stringify(value, null, 2)}\\n`;\n\t\tawait fs$1.writeFile(tmpPath, json, this.mode !== void 0 ? { mode: this.mode } : void 0);\n\t\tawait fs$1.rename(tmpPath, this.filePath);\n\t\tif (this.mode !== void 0) await fs$1.chmod(this.filePath, this.mode);\n\t}\n};\nfunction isEnoent$1(err) {\n\treturn err instanceof Error && \"code\" in err && err.code === \"ENOENT\";\n}\n/**\n* Reads and parses a JSON state file, narrowing the parsed value with\n* `isValid` (a real type predicate, not a cast — the file's shape is only\n* trustworthy because this daemon is its only writer, but a foreign or\n* corrupt file on disk must not be treated as valid state). `undefined` when\n* absent, unreadable, or shaped wrong.\n*/\nasync function readJsonFile(filePath, isValid) {\n\tlet raw;\n\ttry {\n\t\traw = await fs$1.readFile(filePath, \"utf8\");\n\t} catch (err) {\n\t\tif (isEnoent$1(err)) return void 0;\n\t\tthrow err;\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\treturn;\n\t}\n\treturn isValid(parsed) ? parsed : void 0;\n}\n//#endregion\n//#region src/daemon.ts\n/**\n* The shared daemon layer (local-dev spec § 2): a machine-scoped registry of\n* running emulator daemons (`compute`, `buckets`), and `ensureDaemon` /\n* `stopDaemon` to start, adopt, or replace them. Every daemon is a detached,\n* `unref()`'d child process that outlives whatever called `ensureDaemon` —\n* the registry is how a later call finds it again.\n*\n* `registryRoot` defaults to `~/.prisma-composer/emulators/` and governs\n* every path this module manages for a given daemon: the registry JSON\n* itself, the daemon's own state directory, and its stdio log file. The\n* `{ registryRoot }` override exists solely so tests never touch the real\n* home directory; production code never passes it.\n*/\nconst MIN_PORT = 4300;\nconst MAX_PORT = 65535;\nconst EXISTING_HEALTH_TIMEOUT_MS = 2e3;\nconst START_HEALTH_BUDGET_MS = 1e4;\nconst HEALTH_POLL_INTERVAL_MS = 200;\nconst TERMINATE_GRACE_MS = 5e3;\nconst TERMINATE_POLL_INTERVAL_MS = 150;\nconst LOCK_RETRY_INTERVAL_MS = 250;\nconst LOCK_WAIT_BUDGET_MS = 1e4;\nconst LOCK_STALE_MS = 1e4;\n/** Spec § 2 step 5: a FRESH allocation (no persisted port) tries at most this many distinct port candidates before the pinned failure error. */\nconst MAX_FRESH_PORT_CANDIDATES = 5;\nfunction isErrnoException(err) {\n\treturn err instanceof Error && \"code\" in err;\n}\nfunction isEnoent(err) {\n\treturn isErrnoException(err) && err.code === \"ENOENT\";\n}\nfunction isRegistryEntry(value) {\n\treturn typeof value === \"object\" && value !== null && \"pid\" in value && typeof value.pid === \"number\" && \"port\" in value && typeof value.port === \"number\" && \"version\" in value && typeof value.version === \"string\" && \"logPath\" in value && typeof value.logPath === \"string\";\n}\nfunction isHealthBody(value) {\n\treturn typeof value === \"object\" && value !== null && \"version\" in value && typeof value.version === \"string\";\n}\nfunction isPackageJson(value) {\n\treturn typeof value === \"object\" && value !== null && \"version\" in value && typeof value.version === \"string\";\n}\nfunction sleep(ms) {\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\n}\n/** `~/.prisma-composer/emulators/` — `registryRoot`'s default. */\nfunction defaultRegistryRoot() {\n\treturn path.join(os.homedir(), \".prisma-composer\", \"emulators\");\n}\n/** `<registryRoot>/<name>.json`. */\nfunction registryFilePath(registryRoot, name) {\n\treturn path.join(registryRoot, `${name}.json`);\n}\n/** `<registryRoot>/<name>/` — the daemon's own `--state-dir`. */\nfunction daemonStateDir(registryRoot, name) {\n\treturn path.join(registryRoot, name);\n}\n/** `<registryRoot>/<name>.log` — the daemon's stdio log. */\nfunction daemonLogPath(registryRoot, name) {\n\treturn path.join(registryRoot, `${name}.log`);\n}\n/** Compute's and postgres's root namespace is their own JSON admin API; buckets' root namespace is the S3 wire, so its health lives under `/_pcdev/`. */\nfunction healthPathFor(name) {\n\treturn name === \"buckets\" ? \"/_pcdev/health\" : \"/health\";\n}\n/** `@internal/dev-emulators`'s own `package.json` version — what \"version\" means everywhere in this package. */\nfunction readOwnVersion() {\n\tconst here = path.dirname(fileURLToPath(import.meta.url));\n\tconst pkgPath = path.join(here, \"..\", \"package.json\");\n\tconst raw = fs.readFileSync(pkgPath, \"utf8\");\n\tconst parsed = JSON.parse(raw);\n\tif (!isPackageJson(parsed)) throw new Error(`could not read a version string from ${pkgPath}`);\n\treturn parsed.version;\n}\n/** `process.kill(pid, 0)` existence probe — true unless the pid is provably gone (ESRCH). */\nfunction isPidAlive(pid) {\n\ttry {\n\t\tprocess.kill(pid, 0);\n\t\treturn true;\n\t} catch (err) {\n\t\tif (isErrnoException(err) && err.code === \"EPERM\") return true;\n\t\treturn false;\n\t}\n}\nasync function readRegistryEntry(registryRoot, name) {\n\treturn readJsonFile(registryFilePath(registryRoot, name), isRegistryEntry);\n}\nasync function probeHealth(port, healthPath, timeoutMs) {\n\ttry {\n\t\tconst res = await fetch(`http://127.0.0.1:${port}${healthPath}`, { signal: AbortSignal.timeout(timeoutMs) });\n\t\tif (!res.ok) return void 0;\n\t\tconst body = await res.json();\n\t\treturn isHealthBody(body) ? body : void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\n/**\n* Polls the health path up to `budgetMs`, but returns immediately once the\n* child exits — a dead child can never become healthy, and the port-retry\n* protocol (spec § 2 step 5) needs to move to the next candidate right\n* away rather than exhausting a live-process budget on one that isn't\n* live. Only a child that stays alive without becoming healthy consumes\n* the full budget.\n*\n* Verifies the health response's OWN version, not just that something\n* answered: if our child failed to bind (a foreign process already held\n* the port) that foreign process may itself answer `/health` successfully\n* — a version mismatch there is exactly the \"port taken\" case, not a false\n* \"healthy\", and must not be reported as such.\n*/\nasync function awaitHealthy(child, port, healthPath, ownVersion, budgetMs) {\n\tlet exited = false;\n\tchild.once(\"exit\", () => {\n\t\texited = true;\n\t});\n\tconst deadline = Date.now() + budgetMs;\n\tdo {\n\t\tif (exited) return {\n\t\t\thealthy: false,\n\t\t\texitedBeforeHealthy: true\n\t\t};\n\t\tconst remaining = deadline - Date.now();\n\t\tconst health = await probeHealth(port, healthPath, Math.max(200, Math.min(1e3, remaining)));\n\t\tif (health && health.version === ownVersion) return {\n\t\t\thealthy: true,\n\t\t\texitedBeforeHealthy: false\n\t\t};\n\t\tif (exited) return {\n\t\t\thealthy: false,\n\t\t\texitedBeforeHealthy: true\n\t\t};\n\t\tawait sleep(HEALTH_POLL_INTERVAL_MS);\n\t} while (Date.now() < deadline);\n\treturn {\n\t\thealthy: false,\n\t\texitedBeforeHealthy: exited\n\t};\n}\n/** SIGTERM, wait up to `graceMs` for the pid to exit, then SIGKILL. A no-op if the pid is already gone. */\nasync function terminate(pid, graceMs) {\n\tif (!isPidAlive(pid)) return;\n\ttry {\n\t\tprocess.kill(pid, \"SIGTERM\");\n\t} catch {\n\t\treturn;\n\t}\n\tconst deadline = Date.now() + graceMs;\n\twhile (Date.now() < deadline) {\n\t\tif (!isPidAlive(pid)) return;\n\t\tawait sleep(TERMINATE_POLL_INTERVAL_MS);\n\t}\n\tif (isPidAlive(pid)) try {\n\t\tprocess.kill(pid, \"SIGKILL\");\n\t} catch {}\n}\n/** Every port recorded by any registry entry under `registryRoot` — the two daemons share one port pool. */\nasync function usedPorts(registryRoot) {\n\tlet names;\n\ttry {\n\t\tnames = await fs$1.readdir(registryRoot);\n\t} catch (err) {\n\t\tif (isEnoent(err)) return /* @__PURE__ */ new Set();\n\t\tthrow err;\n\t}\n\tconst ports = /* @__PURE__ */ new Set();\n\tfor (const fname of names) {\n\t\tif (!fname.endsWith(\".json\")) continue;\n\t\tconst entry = await readJsonFile(path.join(registryRoot, fname), isRegistryEntry);\n\t\tif (entry) ports.add(entry.port);\n\t}\n\treturn ports;\n}\n/**\n* The smallest genuinely free port at or above `min`, skipping every port\n* already recorded in the registry — persistence and the range policy\n* (`min`, \"skip registry-used ports\") stay ours; whether a given candidate\n* is actually bindable is `get-port`'s (spec § 2's dependency razor — a\n* hand-rolled probe already produced a real cross-platform bug: a Linux-only\n* self-collision from checking two bind scopes concurrently).\n*/\nasync function smallestUnused(used, min) {\n\treturn getPort({\n\t\tport: portNumbers(min, MAX_PORT),\n\t\texclude: used\n\t});\n}\n/** Spawns the daemon binary detached, stdio appended to `logPath`. Doesn't wait for health. */\nfunction spawnDaemonProcess(entryPath, port, stateDir, logPath) {\n\tconst logFd = fs.openSync(logPath, \"a\");\n\tlet child;\n\ttry {\n\t\tchild = spawn(process.execPath, [\n\t\t\tentryPath,\n\t\t\t\"--port\",\n\t\t\tString(port),\n\t\t\t\"--state-dir\",\n\t\t\tstateDir\n\t\t], {\n\t\t\tdetached: true,\n\t\t\tstdio: [\n\t\t\t\t\"ignore\",\n\t\t\t\tlogFd,\n\t\t\t\tlogFd\n\t\t\t]\n\t\t});\n\t} finally {\n\t\tfs.closeSync(logFd);\n\t}\n\tchild.unref();\n\treturn child;\n}\n/**\n* Reads the registry entry and classifies it. \"dead-or-unhealthy\" covers\n* both a provably dead pid AND a live pid that fails health — the latter\n* can't be confirmed as our daemon (a reused pid after a reboot, a hung\n* foreign process), so it is never signaled, only dropped.\n*/\nasync function observeExisting(registryFile, healthPath, ownVersion) {\n\tconst entry = await readJsonFile(registryFile, isRegistryEntry);\n\tif (!entry) return { kind: \"absent\" };\n\tif (!isPidAlive(entry.pid)) return {\n\t\tkind: \"dead-or-unhealthy\",\n\t\tentry\n\t};\n\tconst health = await probeHealth(entry.port, healthPath, EXISTING_HEALTH_TIMEOUT_MS);\n\tif (health && health.version === ownVersion) return {\n\t\tkind: \"healthy\",\n\t\tentry\n\t};\n\tif (health && health.version !== ownVersion) return {\n\t\tkind: \"stale-version\",\n\t\tentry\n\t};\n\treturn {\n\t\tkind: \"dead-or-unhealthy\",\n\t\tentry\n\t};\n}\n/**\n* `<registryRoot>/.<name>.lock-target` — the file `proper-lockfile` locks\n* for the concurrent-ensure protocol (it marks the lock as a sibling\n* `<file>.lock` directory it manages itself). A stable, never-deleted file:\n* unlike the registry JSON, which this module removes and rewrites\n* repeatedly while ensuring, the lock target must exist continuously for\n* `proper-lockfile`'s `realpath` resolution.\n*/\nfunction lockFilePath(registryRoot, name) {\n\treturn path.join(registryRoot, `.${name}.lock-target`);\n}\n/**\n* Acquires the concurrent-ensure protocol's inter-process lock (spec § 2)\n* via `proper-lockfile` — its staleness/compromise semantics are adopted\n* wholesale rather than re-implementing pid liveness checking on top (the\n* dependency razor: commodity locking is exactly where unforeseen edge\n* cases hide). Polls roughly every 250 ms for up to a 10 s budget; on\n* exhaustion (`ELOCKED`, meaning a live, non-stale holder never let go),\n* throws the pinned timeout error. Any other failure propagates as-is.\n*/\nasync function acquireLock(registryRoot, name) {\n\tawait fs$1.mkdir(registryRoot, { recursive: true });\n\tconst target = lockFilePath(registryRoot, name);\n\tawait fs$1.writeFile(target, \"\", { flag: \"a\" });\n\tconst retries = Math.max(1, Math.floor(LOCK_WAIT_BUDGET_MS / LOCK_RETRY_INTERVAL_MS));\n\ttry {\n\t\treturn await properLockfile.lock(target, {\n\t\t\tstale: LOCK_STALE_MS,\n\t\t\tretries: {\n\t\t\t\tretries,\n\t\t\t\tminTimeout: LOCK_RETRY_INTERVAL_MS,\n\t\t\t\tmaxTimeout: LOCK_RETRY_INTERVAL_MS,\n\t\t\t\tfactor: 1\n\t\t\t}\n\t\t});\n\t} catch (err) {\n\t\tif (isErrnoException(err) && err.code === \"ELOCKED\") throw new Error(`timed out waiting for another process ensuring the ${name} emulator — remove ${target}.lock if stale.`);\n\t\tthrow err;\n\t}\n}\n/**\n* Ensure the named daemon is running and healthy at this package's version,\n* starting or replacing it as needed (spec § 2 `daemon.ts`). Idempotent —\n* safe to call repeatedly, including across unrelated processes on the same\n* machine, and safe under concurrent callers across processes: the\n* observe→spawn→persist critical section is serialized per daemon name by\n* an inter-process lock (the \"Concurrent-ensure protocol\").\n*\n* `entry` is the resolved absolute path to the daemon program to spawn —\n* the CALLER resolves it (local-dev spec § 2's publish note). This module\n* used to resolve it itself via `import.meta.resolve('@internal/dev-emulators/…')`,\n* which only works in-repo: `@internal/*` are private workspace packages a\n* published npm consumer never receives. In-repo callers (including tests)\n* still resolve `@internal/dev-emulators/*-main` the same way; a published\n* consumer resolves its own public subpaths instead.\n*/\nasync function ensureDaemon(name, entry, opts = {}) {\n\tconst registryRoot = opts.registryRoot ?? defaultRegistryRoot();\n\tconst registryFile = registryFilePath(registryRoot, name);\n\tconst healthPath = healthPathFor(name);\n\tconst ownVersion = readOwnVersion();\n\tconst quick = await observeExisting(registryFile, healthPath, ownVersion);\n\tif (quick.kind === \"healthy\") return { url: `http://127.0.0.1:${quick.entry.port}` };\n\tconst release = await acquireLock(registryRoot, name);\n\ttry {\n\t\tconst observed = await observeExisting(registryFile, healthPath, ownVersion);\n\t\tif (observed.kind === \"healthy\") return { url: `http://127.0.0.1:${observed.entry.port}` };\n\t\tlet reusablePort;\n\t\tif (observed.kind === \"stale-version\") {\n\t\t\treusablePort = observed.entry.port;\n\t\t\tawait terminate(observed.entry.pid, TERMINATE_GRACE_MS);\n\t\t\tawait fs$1.rm(registryFile, { force: true });\n\t\t} else if (observed.kind === \"dead-or-unhealthy\") {\n\t\t\treusablePort = observed.entry.port;\n\t\t\tawait fs$1.rm(registryFile, { force: true });\n\t\t}\n\t\tconst isFreshAllocation = reusablePort === void 0;\n\t\tconst maxAttempts = isFreshAllocation ? MAX_FRESH_PORT_CANDIDATES : 1;\n\t\tlet port = reusablePort ?? await smallestUnused(await usedPorts(registryRoot), MIN_PORT);\n\t\tconst stateDir = daemonStateDir(registryRoot, name);\n\t\tconst logPath = daemonLogPath(registryRoot, name);\n\t\tawait fs$1.mkdir(stateDir, { recursive: true });\n\t\tawait fs$1.mkdir(path.dirname(logPath), { recursive: true });\n\t\tfor (let attempt = 1;; attempt++) {\n\t\t\tconst child = spawnDaemonProcess(entry, port, stateDir, logPath);\n\t\t\tif (child.pid === void 0) throw new Error(`failed to spawn the ${name} emulator — see ${logPath}.`);\n\t\t\tawait new StateFile(registryFile).write({\n\t\t\t\tpid: child.pid,\n\t\t\t\tport,\n\t\t\t\tversion: ownVersion,\n\t\t\t\tlogPath\n\t\t\t});\n\t\t\tconst outcome = await awaitHealthy(child, port, healthPath, ownVersion, START_HEALTH_BUDGET_MS);\n\t\t\tif (outcome.healthy) return { url: `http://127.0.0.1:${port}` };\n\t\t\tif (!(isFreshAllocation && outcome.exitedBeforeHealthy && attempt < maxAttempts)) {\n\t\t\t\tawait terminate(child.pid, TERMINATE_GRACE_MS);\n\t\t\t\tawait fs$1.rm(registryFile, { force: true });\n\t\t\t\tthrow new Error(`${name} emulator failed to start on port ${port} — see ${logPath}.`);\n\t\t\t}\n\t\t\tawait fs$1.rm(registryFile, { force: true });\n\t\t\tport = await smallestUnused(await usedPorts(registryRoot), port + 1);\n\t\t}\n\t} finally {\n\t\tawait release();\n\t}\n}\n/** SIGTERM/SIGKILL + registry cleanup. Not called by any v1 command — an operator escape hatch, exported for tests. */\nasync function stopDaemon(name, opts = {}) {\n\tconst registryFile = registryFilePath(opts.registryRoot ?? defaultRegistryRoot(), name);\n\tconst entry = await readJsonFile(registryFile, isRegistryEntry);\n\tif (entry) await terminate(entry.pid, TERMINATE_GRACE_MS);\n\tawait fs$1.rm(registryFile, { force: true });\n}\n//#endregion\n//#region src/segments.ts\n/**\n* API hygiene shared by both daemons (local-dev spec § 2): every `<app>`,\n* `<id>`, and `<name>` path segment must match this shape or the request is\n* a 400 naming the segment.\n*/\nconst SEGMENT_RE = /^[a-z0-9][a-z0-9-]*$/;\nfunction isValidSegment(segment) {\n\treturn segment.length <= 63 && SEGMENT_RE.test(segment);\n}\n//#endregion\nexport { ensureDaemon as a, readOwnVersion as c, stopDaemon as d, StateFile as f, defaultRegistryRoot as i, readRegistryEntry as l, daemonLogPath as n, healthPathFor as o, readJsonFile as p, daemonStateDir as r, isPidAlive as s, isValidSegment as t, registryFilePath as u };\n\n//# sourceMappingURL=segments-NpKN-46R.mjs.map"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12],"mappings":";;;;;;;;;;;;CAAA,IAAI,YAAA,UAAoB,WAAW;CAEnC,IAAI,UAAU,QAAQ;CACtB,IAAI,MAAM;CAEV,IAAI,WAAW,QAAQ,IAAI,wBAAwB,QAAQ;CAE3D,QAAQ,MAAM,WAAW;EACvB,IAAI,CAAC,KACH,MAAM,QAAQ,KAAK,OAAO;EAC5B,OAAO;CACT;CACA,IAAI;EACF,QAAQ,IAAI;CACd,SAAS,IAAI,CAAC;CAGd,IAAI,OAAO,QAAQ,UAAU,YAAY;EACvC,IAAI,QAAQ,QAAQ;EACpB,QAAQ,QAAQ,SAAU,GAAG;GAC3B,MAAM;GACN,MAAM,KAAK,SAAS,CAAC;EACvB;EACA,IAAI,OAAO,gBAAgB,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;CAC9C,IAAI;CACJ,IAAI;EACH,MAAM,MAAM,KAAK,SAAS,UAAU,MAAM;CAC3C,SAAS,KAAK;EACb,IAAI,WAAW,GAAG,GAAG,OAAO,KAAK;EACjC,MAAM;CACP;CACA,IAAI;CACJ,IAAI;EACH,SAAS,KAAK,MAAM,GAAG;CACxB,QAAQ;EACP;CACD;CACA,OAAO,QAAQ,MAAM,IAAI,SAAS,KAAK;AACxC;AA4BA,SAAS,iBAAiB,KAAK;CAC9B,OAAO,eAAe,SAAS,UAAU;AAC1C;AAUA,SAAS,cAAc,OAAO;CAC7B,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,aAAa,SAAS,OAAO,MAAM,YAAY;AACtG;;AAyBA,SAAS,iBAAiB;CACzB,MAAM,OAAO,KAAK,QAAQ,cAAc,OAAO,KAAK,GAAG,CAAC;CACxD,MAAM,UAAU,KAAK,KAAK,MAAM,MAAM,cAAc;CACpD,MAAM,MAAM,GAAG,aAAa,SAAS,MAAM;CAC3C,MAAM,SAAS,KAAK,MAAM,GAAG;CAC7B,IAAI,CAAC,cAAc,MAAM,GAAG,MAAM,IAAI,MAAM,wCAAwC,SAAS;CAC7F,OAAO,OAAO;AACf;;AAEA,SAAS,WAAW,KAAK;CACxB,IAAI;EACH,QAAQ,KAAK,KAAK,CAAC;EACnB,OAAO;CACR,SAAS,KAAK;EACb,IAAI,iBAAiB,GAAG,KAAK,IAAI,SAAS,SAAS,OAAO;EAC1D,OAAO;CACR;AACD;;;;;;AAoRA,MAAM,aAAa;AACnB,SAAS,eAAe,SAAS;CAChC,OAAO,QAAQ,UAAU,MAAM,WAAW,KAAK,OAAO;AACvD"}
@@ -1,47 +1,7 @@
1
- import { secretSource } from "@prisma/composer";
1
+ import { n as secretName } from "./secret-rz_ZqNeq-_xd97Jd9.mjs";
2
2
  import { blindCast } from "@prisma/composer/casts";
3
3
  import { type } from "arktype";
4
- //#region ../../1-prisma-cloud/1-extensions/target/dist/serializer-D8_84XWO.mjs
5
- /**
6
- * Brands the payload `envSecret` builds. Core's `secretSource()` is a public
7
- * SPI, so a user could bypass `envSecret` and bind a raw `secretSource('x')`;
8
- * the brand lets `secretName` reject such a source (or another target's) with a
9
- * clear error instead of reading an absent `.name`.
10
- */
11
- const PRISMA_CLOUD_SECRET_SOURCE = blindCast(Symbol.for("prisma:prisma-cloud-secret-source"));
12
- const RESERVED_SECRET_PREFIX = "COMPOSER_";
13
- const POISONED_SECRET_NAMES = /* @__PURE__ */ new Set(["DATABASE_URL", "DATABASE_URL_POOLED"]);
14
- /**
15
- * Binds a secret slot to a named Prisma Cloud platform env var (ADR-0029). The
16
- * value is provisioned out-of-band; only the name is carried. The name may not
17
- * use the framework's reserved `COMPOSER_` prefix or the poisoned
18
- * `DATABASE_URL(_POOLED)` keys.
19
- */
20
- function envSecret(name) {
21
- if (typeof name !== "string" || name.length === 0) throw new Error("envSecret() requires a non-empty platform env-var name, e.g. envSecret('STRIPE_SECRET_KEY').");
22
- if (name.startsWith(RESERVED_SECRET_PREFIX)) throw new Error(`envSecret name "${name}" may not start with "${RESERVED_SECRET_PREFIX}" — that prefix is reserved for the framework's own generated config keys.`);
23
- if (POISONED_SECRET_NAMES.has(name)) throw new Error(`envSecret name "${name}" is reserved — ${[...POISONED_SECRET_NAMES].join(" and ")} are poisoned at project provision and cannot back a secret.`);
24
- return secretSource({
25
- [PRISMA_CLOUD_SECRET_SOURCE]: true,
26
- name
27
- });
28
- }
29
- /** True only for a payload that `envSecret` built — i.e. one carrying the brand. */
30
- function isEnvSecretPayload(payload) {
31
- return typeof payload === "object" && payload !== null && blindCast(payload)[PRISMA_CLOUD_SECRET_SOURCE] === true;
32
- }
33
- /**
34
- * Reads the Prisma Cloud env-var name back out of a secret binding's opaque
35
- * source. A source not built by `envSecret` (a raw `secretSource(...)` or
36
- * another target's source) carries no name — reject it here. `secretName` runs
37
- * in preflight before any provisioning, so a foreign source fails early and
38
- * clearly rather than producing a broken deploy with an undefined name.
39
- */
40
- function secretName(binding) {
41
- const payload = binding.source.payload;
42
- if (!isEnvSecretPayload(payload)) throw new Error(`secret slot "${binding.slot}" of service "${binding.serviceAddress}" is bound to a source not created by envSecret() — bind secrets with envSecret('NAME') from @prisma/composer-prisma-cloud.`);
43
- return payload.name;
44
- }
4
+ //#region ../../1-prisma-cloud/1-extensions/target/dist/serializer-CJiOhF2d.mjs
45
5
  /**
46
6
  * Walks a node's own params, then each dependency input's connection params —
47
7
  * the same enumeration order `configOf` uses, but carrying the raw
@@ -286,6 +246,6 @@ function standardValidateSync(schema, value) {
286
246
  return result.value;
287
247
  }
288
248
  //#endregion
289
- export { encode as a, paramEntries as c, secretPointerRows as d, stash as f, deserializeSecrets as i, readOrigin as l, stashSecrets as m, configKey as n, encodeParamPointer as o, stashProviderParams as p, deserialize as r, envSecret as s, ORIGIN_KEY_NAME as t, secretName as u };
249
+ export { encode as a, readOrigin as c, stashProviderParams as d, stashSecrets as f, deserializeSecrets as i, secretPointerRows as l, configKey as n, encodeParamPointer as o, deserialize as r, paramEntries as s, ORIGIN_KEY_NAME as t, stash as u };
290
250
 
291
- //# sourceMappingURL=serializer-D8_84XWO-DA2B6YbX.mjs.map
251
+ //# sourceMappingURL=serializer-CJiOhF2d-DJUjQj1i.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializer-CJiOhF2d-DJUjQj1i.mjs","names":[],"sources":["../../../1-prisma-cloud/1-extensions/target/dist/serializer-CJiOhF2d.mjs"],"sourcesContent":["import { n as secretName } from \"./secret-rz_ZqNeq.mjs\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { type } from \"arktype\";\n//#region src/serializer.ts\n/**\n* Walks a node's own params, then each dependency input's connection params —\n* the same enumeration order `configOf` uses, but carrying the raw\n* `ConfigParam` (with its `serialize`/`deserialize`) instead of a pure-data\n* projection.\n*/\nfunction paramEntries(node) {\n\tconst entries = [];\n\tfor (const [input, value] of Object.entries(node.inputs)) {\n\t\tif (typeof value !== \"object\" || value === null) continue;\n\t\tconst params = blindCast(value).connection.params;\n\t\tfor (const [name, param] of Object.entries(params)) entries.push({\n\t\t\towner: { input },\n\t\t\tname,\n\t\t\tparam\n\t\t});\n\t}\n\tfor (const [name, param] of Object.entries(node.params)) entries.push({\n\t\towner: \"service\",\n\t\tname,\n\t\tparam\n\t});\n\treturn entries;\n}\nconst configKey = (address, d) => {\n\tconst segments = address.split(\".\").filter((s) => s.length > 0);\n\tconst owner = d.owner === \"service\" ? [] : [d.owner.input];\n\treturn [\n\t\t\"COMPOSER\",\n\t\t...segments,\n\t\t...owner,\n\t\td.name\n\t].join(\"_\").toUpperCase();\n};\n/**\n* Typed value → its stored string. Service-own literals are JSON-encoded; a\n* dependency-input value is a provisioning ref at deploy (and a resolved\n* string at boot) and passes through untouched — LANDMINE: JSON-encoding it\n* would break the ordering edge Alchemy resolves through it.\n*/\nfunction encode(owner, value) {\n\treturn owner === \"service\" ? JSON.stringify(value) : blindCast(value);\n}\n/** Reverses `encode`: JSON-parse a service-own value, take a dependency-input value raw. */\nfunction decode(owner, raw) {\n\treturn owner === \"service\" ? JSON.parse(raw) : raw;\n}\nconst PARAM_POINTER_PREFIX = \"@composer-param-pointer:\";\n/** True iff `raw` is a param pointer row (as opposed to a JSON-encoded literal). */\nconst isParamPointerRow = (raw) => raw.startsWith(PARAM_POINTER_PREFIX);\n/** Builds a param pointer row's stored value from the platform var NAME it points to. */\nconst encodeParamPointer = (name) => `${PARAM_POINTER_PREFIX}${name}`;\n/** Reverses `encodeParamPointer`: the platform var NAME a pointer row points to. */\nconst decodeParamPointer = (raw) => raw.slice(24);\nfunction coerce(raw, d, key) {\n\tif (!(raw !== void 0 && raw !== \"\")) {\n\t\tif (d.param.default !== void 0) return d.param.default;\n\t\tif (d.param.optional === true) return void 0;\n\t\tthrow new Error(`missing required config param \"${d.name}\" (env ${key})`);\n\t}\n\tif (d.owner === \"service\" && isParamPointerRow(raw)) return coerceEnvSourcedParam(raw, d, key);\n\ttry {\n\t\treturn standardValidateSync(d.param.schema, decode(d.owner, raw));\n\t} catch (cause) {\n\t\tconst message = cause instanceof Error ? cause.message : String(cause);\n\t\tthrow new Error(`invalid value for config param \"${d.name}\" (env ${key}): ${message}`);\n\t}\n}\n/**\n* Boot resolution for an env-sourced param: double-lookup (pointer → platform\n* var), then the param's own schema on the raw string — no JSON decode, and\n* no redaction (it's config, not a secret). An UNSET platform var is a loud\n* boot failure naming both the param and the platform var; an EMPTY string is\n* not special-cased here — it reaches the schema like any other value, so it\n* passes iff the schema accepts it (deliberately unlike a literal param's own\n* \"\"-means-absent rule, and unlike a secret's non-empty requirement).\n*/\nfunction coerceEnvSourcedParam(raw, d, key) {\n\tconst platformVar = decodeParamPointer(raw);\n\tconst value = process.env[platformVar];\n\tif (value === void 0) throw new Error(`env-sourced config param \"${d.name}\" (env ${key} → ${platformVar}) is unset: the platform variable \"${platformVar}\" was not injected — the deploy did not provision it.`);\n\ttry {\n\t\treturn standardValidateSync(d.param.schema, value);\n\t} catch (cause) {\n\t\tconst message = cause instanceof Error ? cause.message : String(cause);\n\t\tthrow new Error(`invalid value for env-sourced config param \"${d.name}\" (env ${key} → ${platformVar}): ${message}`);\n\t}\n}\n/**\n* Boot: read each declared param from env by its key, reverse the param's own\n* serialization (missing/invalid fails loudly), assemble the typed Config.\n* Secrets ride a separate channel (deserializeSecrets), not this one.\n*/\nconst deserialize = (node, address) => {\n\tconst service = {};\n\tconst inputs = {};\n\tfor (const d of paramEntries(node)) {\n\t\tconst key = configKey(address, d);\n\t\tconst value = coerce(process.env[key], d, key);\n\t\tif (d.owner === \"service\") service[d.name] = value;\n\t\telse {\n\t\t\tlet bucket = inputs[d.owner.input];\n\t\t\tif (bucket === void 0) {\n\t\t\t\tbucket = {};\n\t\t\t\tinputs[d.owner.input] = bucket;\n\t\t\t}\n\t\t\tbucket[d.name] = value;\n\t\t}\n\t}\n\treturn {\n\t\tservice,\n\t\tinputs\n\t};\n};\n/**\n* run()'s setup step: write the resolved config to the environment under\n* address-free keys (configKey(\"\", d) + each serialize suffix), which load()\n* reads back with no address. Uses env, not a module variable, because a\n* framework may fork worker processes that inherit env but not memory.\n* Writes only these keys; nothing else is touched.\n*/\nconst stash = (node, config) => {\n\tfor (const d of paramEntries(node)) {\n\t\tconst value = d.owner === \"service\" ? config.service[d.name] : config.inputs[d.owner.input]?.[d.name];\n\t\tif (value === void 0) continue;\n\t\tprocess.env[configKey(\"\", d)] = encode(d.owner, value);\n\t}\n};\n/** The pointer-row key for a secret slot: COMPOSER_<addr>_<slot> (secrets are service-level). */\nconst secretKey = (address, slot) => configKey(address, {\n\towner: \"service\",\n\tname: slot\n});\n/**\n* Deploy: the pointer rows for a node's secret slots — each slot's key mapped to\n* the platform NAME the root bound it to (looked up in `graph.secrets`). Never a\n* value. A declared slot with no binding is a Load-invariant violation (Load\n* binds every slot), surfaced loudly here rather than written as a blank row.\n*/\nfunction secretPointerRows(node, address, bindings) {\n\tconst rows = [];\n\tfor (const slot of Object.keys(node.secretSlots)) {\n\t\tconst binding = bindings.find((b) => b.serviceAddress === address && b.slot === slot);\n\t\tif (binding === void 0) throw new Error(`secret slot \"${slot}\" of \"${address}\" has no bound platform name — Load should have bound it (ADR-0029).`);\n\t\trows.push({\n\t\t\tkey: secretKey(address, slot),\n\t\t\tname: secretName(binding)\n\t\t});\n\t}\n\treturn rows;\n}\n/**\n* Boot: resolve every secret slot to its value by double-lookup — read the\n* pointer key (the platform NAME), then read that platform var. A missing\n* pointer or a missing/empty platform value is a loud failure naming both keys.\n* Returns a plain Record for core's `hydrateSecrets` to box.\n*/\nconst deserializeSecrets = (node, address) => {\n\tconst values = {};\n\tfor (const slot of Object.keys(node.secretSlots)) {\n\t\tconst key = secretKey(address, slot);\n\t\tconst name = process.env[key];\n\t\tif (name === void 0 || name === \"\") throw new Error(`missing secret pointer for slot \"${slot}\" (env ${key}) — the deploy did not write it.`);\n\t\tconst value = process.env[name];\n\t\tif (value === void 0 || value === \"\") throw new Error(`secret \"${slot}\" is not provisioned (env ${key} → ${name}): the platform var \"${name}\" is unset or empty.`);\n\t\tvalues[slot] = value;\n\t}\n\treturn values;\n};\n/**\n* run()'s setup step for secrets: re-emit each slot's pointer NAME under its\n* address-free key, so the address-free `deserializeSecrets` double-looks-up\n* identically. Never the value — the value stays only in the platform var.\n*/\nconst stashSecrets = (node, address) => {\n\tfor (const slot of Object.keys(node.secretSlots)) {\n\t\tconst name = process.env[secretKey(address, slot)];\n\t\tif (name === void 0) continue;\n\t\tprocess.env[secretKey(\"\", slot)] = name;\n\t}\n};\n/**\n* Boot: for each reserved provider param, read its address-scoped row through\n* the same `coerce` a declared param uses (JSON-decode, schema-validate), and\n* re-emit it address-free — `stash`'s counterpart for this separate\n* declaration space. A param is declared optional here unconditionally: an\n* absent row means \"never provisioned\" (local dev, tests, a provider with no\n* registered value for this deploy), never a boot failure, so nothing is\n* stashed and the runtime reader that owns this slot falls back to its own\n* pass-through behavior.\n*/\nfunction stashProviderParams(entries, address) {\n\tfor (const entry of entries) {\n\t\tconst d = {\n\t\t\towner: \"service\",\n\t\t\tname: entry.name,\n\t\t\tparam: {\n\t\t\t\tschema: entry.schema,\n\t\t\t\toptional: true\n\t\t\t}\n\t\t};\n\t\tconst key = configKey(address, d);\n\t\tconst value = coerce(process.env[key], d, key);\n\t\tif (value === void 0) continue;\n\t\tprocess.env[configKey(\"\", d)] = encode(\"service\", value);\n\t}\n}\n/** The framework-resolved origin row: COMPOSER_<addr>_ORIGIN. Written per\n* compute service at serialize — the service's own provisioned endpoint URL,\n* riding the reserved-provider-param machinery (`origin-key.ts`'s\n* `ORIGIN_PARAM`); never a declared param, never in config(). A harness with\n* no deploy behind it supplies it by setting `COMPOSER_ORIGIN` to the\n* JSON-encoded origin URL — exactly how the existing entrypoint tests supply\n* their other `COMPOSER_*` rows. */\nconst ORIGIN_KEY_NAME = \"ORIGIN\";\n/**\n* Reads this service's origin back out of the address-free stash\n* `stashProviderParams` wrote for the ORIGIN entry. `COMPOSER_ORIGIN` unset is\n* a loud failure — a deployed environment always writes it, so an unset row\n* means either a local harness that hasn't supplied it or a boot() called\n* before run().\n*/\nfunction readOrigin() {\n\tconst d = {\n\t\towner: \"service\",\n\t\tname: ORIGIN_KEY_NAME,\n\t\tparam: {\n\t\t\tschema: type(\"string\"),\n\t\t\toptional: true\n\t\t}\n\t};\n\tconst key = configKey(\"\", d);\n\tconst value = coerce(process.env[key], d, key);\n\tif (value === void 0) throw new Error(\"this service's origin is not available (env COMPOSER_ORIGIN is unset) — a deployed environment writes it automatically; a local harness must supply it like any other config value (set COMPOSER_ORIGIN to the JSON-encoded origin URL).\");\n\treturn blindCast(value);\n}\n/** Synchronous Standard Schema validation — see the matching note in core's `config.ts`. */\nfunction standardValidateSync(schema, value) {\n\tconst result = schema[\"~standard\"].validate(value);\n\tif (result instanceof Promise) throw new Error(\"config param schema validation must be synchronous — async Standard Schema validators are not supported for config params\");\n\tif (result.issues !== void 0) throw new Error(`config param validation failed: ${result.issues.map((issue) => issue.message).join(\"; \")}`);\n\treturn result.value;\n}\n//#endregion\nexport { encode as a, readOrigin as c, stashProviderParams as d, stashSecrets as f, deserializeSecrets as i, secretPointerRows as l, configKey as n, encodeParamPointer as o, deserialize as r, paramEntries as s, ORIGIN_KEY_NAME as t, stash as u };\n\n//# sourceMappingURL=serializer-CJiOhF2d.mjs.map"],"mappings":";;;;;;;;;;AAUA,SAAS,aAAa,MAAM;CAC3B,MAAM,UAAU,CAAC;CACjB,KAAK,MAAM,CAAC,OAAO,UAAU,OAAO,QAAQ,KAAK,MAAM,GAAG;EACzD,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM;EACjD,MAAM,SAAS,UAAU,KAAK,CAAC,CAAC,WAAW;EAC3C,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,GAAG,QAAQ,KAAK;GAChE,OAAO,EAAE,MAAM;GACf;GACA;EACD,CAAC;CACF;CACA,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,KAAK,MAAM,GAAG,QAAQ,KAAK;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AS,SAAS;CAC9C,KAAK,MAAM,SAAS,SAAS;EAC5B,MAAM,IAAI;GACT,OAAO;GACP,MAAM,MAAM;GACZ,OAAO;IACN,QAAQ,MAAM;IACd,UAAU;GACX;EACD;EACA,MAAM,MAAM,UAAU,SAAS,CAAC;EAChC,MAAM,QAAQ,OAAO,QAAQ,IAAI,MAAM,GAAG,GAAG;EAC7C,IAAI,UAAU,KAAK,GAAG;EACtB,QAAQ,IAAI,UAAU,IAAI,CAAC,KAAK,OAAO,WAAW,KAAK;CACxD;AACD;;;;;;;;AAQA,MAAM,kBAAkB;;;;;;;;AAQxB,SAAS,aAAa;CACrB,MAAM,IAAI;EACT,OAAO;EACP,MAAM;EACN,OAAO;GACN,QAAQ,KAAK,QAAQ;GACrB,UAAU;EACX;CACD;CACA,MAAM,MAAM,UAAU,IAAI,CAAC;CAC3B,MAAM,QAAQ,OAAO,QAAQ,IAAI,MAAM,GAAG,GAAG;CAC7C,IAAI,UAAU,KAAK,GAAG,MAAM,IAAI,MAAM,0OAA0O;CAChR,OAAO,UAAU,KAAK;AACvB;;AAEA,SAAS,qBAAqB,QAAQ,OAAO;CAC5C,MAAM,SAAS,OAAO,YAAY,CAAC,SAAS,KAAK;CACjD,IAAI,kBAAkB,SAAS,MAAM,IAAI,MAAM,2HAA2H;CAC1K,IAAI,OAAO,WAAW,KAAK,GAAG,MAAM,IAAI,MAAM,mCAAmC,OAAO,OAAO,KAAK,UAAU,MAAM,OAAO,CAAC,CAAC,KAAK,IAAI,GAAG;CACzI,OAAO,OAAO;AACf"}
@@ -3,7 +3,7 @@ import { blindCast } from "@prisma/composer/casts";
3
3
  import { type } from "arktype";
4
4
  import { RPC_PEER_KEY } from "@prisma/composer/service-rpc";
5
5
  import node from "@prisma/composer/node";
6
- blindCast(Symbol.for("prisma:prisma-cloud-secret-source"));
6
+ //#region ../../1-prisma-cloud/1-extensions/target/dist/serializer-CJiOhF2d.mjs
7
7
  /**
8
8
  * Walks a node's own params, then each dependency input's connection params —
9
9
  * the same enumeration order `configOf` uses, but carrying the raw
@@ -228,7 +228,7 @@ function standardValidateSync(schema, value) {
228
228
  return result.value;
229
229
  }
230
230
  //#endregion
231
- //#region ../../1-prisma-cloud/1-extensions/target/dist/provisioned-edges-B_XS1Mz-.mjs
231
+ //#region ../../1-prisma-cloud/1-extensions/target/dist/provisioned-edges-C1wSO3cx.mjs
232
232
  /**
233
233
  * The service's own origin as a reserved provider param (ADR-0031): the ONE
234
234
  * brand and the ONE entry — shared by control.ts (which registers the
@@ -334,7 +334,6 @@ const RESERVED_PROVIDER_PARAMS = [
334
334
  STREAMS_API_KEY_PARAM,
335
335
  ORIGIN_PARAM
336
336
  ];
337
- blindCast(Symbol.for("prisma:prisma-cloud-param-source"));
338
337
  Object.freeze({
339
338
  kind: "s3",
340
339
  __cmp: {