eliscript 0.0.1 → 0.0.3

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 (417) hide show
  1. package/README.md +61 -0
  2. package/bootstrap/README.md +26 -0
  3. package/bootstrap/backends/README.md +515 -0
  4. package/bootstrap/backends/async.eli +230 -0
  5. package/bootstrap/backends/binary.eli +173 -0
  6. package/bootstrap/backends/capabilities.eli +74 -0
  7. package/bootstrap/backends/elf.eli +246 -0
  8. package/bootstrap/backends/managed.eli +5976 -0
  9. package/bootstrap/backends/memory.eli +100 -0
  10. package/bootstrap/backends/native.eli +2000 -0
  11. package/bootstrap/backends/numeric.eli +1362 -0
  12. package/bootstrap/backends/optimize.eli +79 -0
  13. package/bootstrap/backends/regexp.eli +2263 -0
  14. package/bootstrap/backends/sha256.eli +138 -0
  15. package/bootstrap/backends/wasm.eli +1161 -0
  16. package/bootstrap/compiler/analyzer.eli +165 -77
  17. package/bootstrap/compiler/compiler.eli +43 -19
  18. package/bootstrap/compiler/emitter.eli +780 -170
  19. package/bootstrap/compiler/expander.eli +136 -45
  20. package/bootstrap/compiler/formatter.eli +8 -1
  21. package/bootstrap/compiler/ir.eli +148 -45
  22. package/bootstrap/compiler/lower.eli +29 -2
  23. package/bootstrap/compiler/project.eli +51 -21
  24. package/bootstrap/compiler/reader.eli +128 -36
  25. package/bootstrap/compiler/source-map.eli +46 -4
  26. package/bootstrap/compiler/symbol.eli +2 -1
  27. package/bootstrap/compiler/syntax.eli +47 -12
  28. package/bootstrap/compiler/transient-analysis.eli +40 -4
  29. package/bootstrap/host/check-cli-legacy.mjs +163 -0
  30. package/bootstrap/host/check-cli.mjs +59 -158
  31. package/bootstrap/host/check-cli.mjs.map +1 -0
  32. package/bootstrap/host/compiler-session.eli +1579 -0
  33. package/bootstrap/host/compiler-tools.eli +513 -0
  34. package/bootstrap/host/eliscript-cli.mjs +53 -33
  35. package/bootstrap/host/eliscript-cli.mjs.map +1 -0
  36. package/bootstrap/host/project-cli-legacy.mjs +295 -0
  37. package/bootstrap/host/project-cli.mjs +74 -289
  38. package/bootstrap/host/project-cli.mjs.map +1 -0
  39. package/bootstrap/host/project-legacy.mjs +1080 -0
  40. package/bootstrap/host/project.mjs +210 -1060
  41. package/bootstrap/host/project.mjs.map +1 -0
  42. package/bootstrap/runtime/UNICODE-LICENSE.txt +39 -0
  43. package/bootstrap/runtime/memory.eli +30379 -0
  44. package/browser/host.mjs +732 -11
  45. package/browser/worker.mjs +6 -3
  46. package/compiler/eliscript-analyzer.el +371 -4
  47. package/compiler/eliscript-cli.el +84 -1
  48. package/compiler/eliscript-emitter.el +1189 -256
  49. package/compiler/eliscript-expander.el +147 -10
  50. package/compiler/eliscript-ir-emitter.el +725 -208
  51. package/compiler/eliscript-lower.el +127 -1
  52. package/compiler/eliscript-portable.el +177 -51
  53. package/compiler/eliscript-project.el +20 -2
  54. package/compiler/eliscript-reader.el +141 -57
  55. package/compiler/eliscript-source-map.el +26 -12
  56. package/compiler/eliscript-transient-analysis.el +382 -19
  57. package/dist/backends/async.mjs +561 -0
  58. package/dist/backends/async.mjs.macro-origins.json +1 -0
  59. package/dist/backends/async.mjs.map +1 -0
  60. package/dist/backends/binary.mjs +381 -0
  61. package/dist/backends/binary.mjs.macro-origins.json +1 -0
  62. package/dist/backends/binary.mjs.map +1 -0
  63. package/dist/backends/capabilities.mjs +237 -0
  64. package/dist/backends/capabilities.mjs.macro-origins.json +1 -0
  65. package/dist/backends/capabilities.mjs.map +1 -0
  66. package/dist/backends/elf.mjs +540 -0
  67. package/dist/backends/elf.mjs.macro-origins.json +1 -0
  68. package/dist/backends/elf.mjs.map +1 -0
  69. package/dist/backends/managed.mjs +10616 -0
  70. package/dist/backends/managed.mjs.macro-origins.json +1 -0
  71. package/dist/backends/managed.mjs.map +1 -0
  72. package/dist/backends/memory.mjs +278 -0
  73. package/dist/backends/memory.mjs.macro-origins.json +1 -0
  74. package/dist/backends/memory.mjs.map +1 -0
  75. package/dist/backends/native.mjs +4099 -0
  76. package/dist/backends/native.mjs.macro-origins.json +1 -0
  77. package/dist/backends/native.mjs.map +1 -0
  78. package/dist/backends/numeric.mjs +2458 -0
  79. package/dist/backends/numeric.mjs.macro-origins.json +1 -0
  80. package/dist/backends/numeric.mjs.map +1 -0
  81. package/dist/backends/optimize.mjs +204 -0
  82. package/dist/backends/optimize.mjs.macro-origins.json +1 -0
  83. package/dist/backends/optimize.mjs.map +1 -0
  84. package/dist/backends/regexp.mjs +2033 -0
  85. package/dist/backends/regexp.mjs.macro-origins.json +1 -0
  86. package/dist/backends/regexp.mjs.map +1 -0
  87. package/dist/backends/sha256.mjs +310 -0
  88. package/dist/backends/sha256.mjs.macro-origins.json +1 -0
  89. package/dist/backends/sha256.mjs.map +1 -0
  90. package/dist/backends/wasm.mjs +2258 -0
  91. package/dist/backends/wasm.mjs.macro-origins.json +1 -0
  92. package/dist/backends/wasm.mjs.map +1 -0
  93. package/dist/bootstrap/analyzer.mjs +1908 -776
  94. package/dist/bootstrap/analyzer.mjs.macro-origins.json +1 -0
  95. package/dist/bootstrap/analyzer.mjs.map +1 -1
  96. package/dist/bootstrap/compiler.mjs +450 -142
  97. package/dist/bootstrap/compiler.mjs.macro-origins.json +1 -0
  98. package/dist/bootstrap/compiler.mjs.map +1 -1
  99. package/dist/bootstrap/emitter.mjs +3083 -909
  100. package/dist/bootstrap/emitter.mjs.macro-origins.json +1 -0
  101. package/dist/bootstrap/emitter.mjs.map +1 -1
  102. package/dist/bootstrap/expander.mjs +2887 -1233
  103. package/dist/bootstrap/expander.mjs.macro-origins.json +1 -0
  104. package/dist/bootstrap/expander.mjs.map +1 -1
  105. package/dist/bootstrap/formatter.mjs +582 -218
  106. package/dist/bootstrap/formatter.mjs.macro-origins.json +1 -0
  107. package/dist/bootstrap/formatter.mjs.map +1 -1
  108. package/dist/bootstrap/ir.mjs +670 -116
  109. package/dist/bootstrap/ir.mjs.macro-origins.json +1 -0
  110. package/dist/bootstrap/ir.mjs.map +1 -1
  111. package/dist/bootstrap/lower.mjs +866 -257
  112. package/dist/bootstrap/lower.mjs.macro-origins.json +1 -0
  113. package/dist/bootstrap/lower.mjs.map +1 -1
  114. package/dist/bootstrap/package.json +1 -0
  115. package/dist/bootstrap/project.mjs +1168 -498
  116. package/dist/bootstrap/project.mjs.macro-origins.json +1 -0
  117. package/dist/bootstrap/project.mjs.map +1 -1
  118. package/dist/bootstrap/reader.mjs +674 -175
  119. package/dist/bootstrap/reader.mjs.macro-origins.json +1 -0
  120. package/dist/bootstrap/reader.mjs.map +1 -1
  121. package/dist/bootstrap/runtime/math.mjs +1117 -0
  122. package/dist/bootstrap/runtime/math.mjs.map +1 -0
  123. package/dist/bootstrap/runtime/unicode-case-data.mjs +10125 -0
  124. package/dist/bootstrap/runtime/unicode-case-data.mjs.map +1 -0
  125. package/dist/bootstrap/runtime/unicode-case.mjs +281 -0
  126. package/dist/bootstrap/runtime/unicode-case.mjs.map +1 -0
  127. package/dist/bootstrap/source-map.mjs +430 -119
  128. package/dist/bootstrap/source-map.mjs.macro-origins.json +1 -0
  129. package/dist/bootstrap/source-map.mjs.map +1 -1
  130. package/dist/bootstrap/symbol.mjs +229 -53
  131. package/dist/bootstrap/symbol.mjs.macro-origins.json +1 -0
  132. package/dist/bootstrap/symbol.mjs.map +1 -1
  133. package/dist/bootstrap/syntax.mjs +205 -7
  134. package/dist/bootstrap/syntax.mjs.macro-origins.json +1 -0
  135. package/dist/bootstrap/syntax.mjs.map +1 -1
  136. package/dist/bootstrap/transient-analysis.mjs +1185 -489
  137. package/dist/bootstrap/transient-analysis.mjs.macro-origins.json +1 -0
  138. package/dist/bootstrap/transient-analysis.mjs.map +1 -1
  139. package/dist/browser/compiler.js +199 -6478
  140. package/dist/browser/host.mjs +1078 -0
  141. package/dist/browser/loader.js +1 -0
  142. package/dist/browser/loader.mjs +231 -0
  143. package/dist/browser/worker.mjs +63 -0
  144. package/dist/compiler-artifact.json +1 -0
  145. package/dist/host/compiler-session.mjs +2980 -0
  146. package/dist/host/compiler-session.mjs.macro-origins.json +1 -0
  147. package/dist/host/compiler-session.mjs.map +1 -0
  148. package/dist/host/compiler-tools.mjs +1084 -0
  149. package/dist/host/compiler-tools.mjs.macro-origins.json +1 -0
  150. package/dist/host/compiler-tools.mjs.map +1 -0
  151. package/dist/literal-sources/runtime/core/collection-internals.eli +60 -0
  152. package/dist/literal-sources/runtime/core/collection.eli +639 -0
  153. package/dist/literal-sources/runtime/core/data-text.eli +290 -0
  154. package/dist/literal-sources/runtime/core/data.eli +22 -0
  155. package/dist/literal-sources/runtime/core/identifier.eli +44 -0
  156. package/dist/literal-sources/runtime/core/lazy-sequence.eli +131 -0
  157. package/dist/literal-sources/runtime/core/list.eli +19 -0
  158. package/dist/literal-sources/runtime/core/map.eli +9 -0
  159. package/dist/literal-sources/runtime/core/metadata-internals.eli +6 -0
  160. package/dist/literal-sources/runtime/core/metadata.eli +40 -0
  161. package/dist/literal-sources/runtime/core/object.eli +8 -0
  162. package/dist/literal-sources/runtime/core/order.eli +123 -0
  163. package/dist/literal-sources/runtime/core/persistent-kind.eli +28 -0
  164. package/dist/literal-sources/runtime/core/protocol-error.eli +32 -0
  165. package/dist/literal-sources/runtime/core/protocol.eli +28 -0
  166. package/dist/literal-sources/runtime/core/queue.eli +9 -0
  167. package/dist/literal-sources/runtime/core/record.eli +191 -0
  168. package/dist/literal-sources/runtime/core/regex.eli +158 -0
  169. package/dist/literal-sources/runtime/core/sequence.eli +305 -0
  170. package/dist/literal-sources/runtime/core/set-algebra.eli +28 -0
  171. package/dist/literal-sources/runtime/core/set.eli +9 -0
  172. package/dist/literal-sources/runtime/core/sorted.eli +408 -0
  173. package/dist/literal-sources/runtime/core/text.eli +14 -0
  174. package/dist/literal-sources/runtime/core/transducer.eli +268 -0
  175. package/dist/literal-sources/runtime/core/transient.eli +17 -0
  176. package/dist/literal-sources/runtime/core/truth.eli +4 -0
  177. package/dist/literal-sources/runtime/core/type.eli +232 -0
  178. package/dist/literal-sources/runtime/core/value-internals.eli +13 -0
  179. package/dist/literal-sources/runtime/core/value.eli +19 -0
  180. package/dist/literal-sources/runtime/core/vector.eli +25 -0
  181. package/dist/literal-sources/runtime/literals.eli +23 -0
  182. package/dist/literal-sources/runtime/testing/value.eli +6 -0
  183. package/dist/literal-sources/runtime/wire/http-rpc.eli +362 -0
  184. package/dist/literal-sources/runtime/wire/markdown.eli +275 -0
  185. package/dist/literal-sources/runtime/wire/schema.eli +193 -0
  186. package/dist/literal-sources/stdlib/bit.eli +36 -0
  187. package/dist/literal-sources/stdlib/core/data.eli +306 -0
  188. package/dist/literal-sources/stdlib/core/object.eli +89 -0
  189. package/dist/literal-sources/stdlib/core/protocol.eli +451 -0
  190. package/dist/literal-sources/stdlib/core/set.eli +312 -0
  191. package/dist/literal-sources/stdlib/core/text.eli +103 -0
  192. package/dist/literal-sources/stdlib/managed-literal-protocols.eli +494 -0
  193. package/dist/literal-sources/stdlib/managed-literals.eli +1469 -0
  194. package/dist/literal-sources/stdlib/managed-queue-state.eli +65 -0
  195. package/dist/literal-sources/stdlib/managed-sorted-state.eli +233 -0
  196. package/dist/literal-sources/stdlib/managed-transient-state.eli +348 -0
  197. package/dist/literal-sources/stdlib/managed-value-state.eli +153 -0
  198. package/dist/literal-sources/stdlib/managed-vector-view-state.eli +102 -0
  199. package/dist/literal-sources/stdlib/persistent-list.eli +145 -0
  200. package/dist/literal-sources/stdlib/persistent-map.eli +724 -0
  201. package/dist/literal-sources/stdlib/persistent-set.eli +236 -0
  202. package/dist/literal-sources/stdlib/persistent-vector.eli +359 -0
  203. package/dist/literal-sources/stdlib/value.eli +325 -0
  204. package/dist/package.json +10 -0
  205. package/dist/runtime/math.mjs +1116 -0
  206. package/dist/runtime/math.mjs.macro-origins.json +1 -0
  207. package/dist/runtime/math.mjs.map +1 -0
  208. package/dist/runtime/unicode-case-data.mjs +10124 -0
  209. package/dist/runtime/unicode-case-data.mjs.macro-origins.json +1 -0
  210. package/dist/runtime/unicode-case-data.mjs.map +1 -0
  211. package/dist/runtime/unicode-case.mjs +280 -0
  212. package/dist/runtime/unicode-case.mjs.macro-origins.json +1 -0
  213. package/dist/runtime/unicode-case.mjs.map +1 -0
  214. package/dist/runtime.eli +30379 -0
  215. package/dist/stage3-release.json +1 -0
  216. package/editor/README.md +1 -1
  217. package/editor/eliscript-mode.el +1 -1
  218. package/editor/eliscript-repl.el +1 -1
  219. package/package.json +106 -11
  220. package/platform/http.mjs +20 -0
  221. package/runtime/array-text.mjs +159 -0
  222. package/runtime/core/map-internals.mjs +27 -9
  223. package/runtime/core/object-impl.mjs +26 -17
  224. package/runtime/core/object-impl.mjs.map +1 -1
  225. package/runtime/core/protocol-impl.mjs +682 -255
  226. package/runtime/core/protocol-impl.mjs.map +1 -1
  227. package/runtime/core/protocol.mjs +4 -0
  228. package/runtime/core/record.mjs +23 -2
  229. package/runtime/core/regex.mjs +4 -0
  230. package/runtime/core/sorted.mjs +53 -0
  231. package/runtime/core/text-impl.mjs +167 -48
  232. package/runtime/core/text-impl.mjs.map +1 -1
  233. package/runtime/core/type.mjs +75 -3
  234. package/runtime/core/vector.mjs +6 -0
  235. package/runtime/math.eli +429 -0
  236. package/runtime/math.mjs +1116 -0
  237. package/runtime/math.mjs.map +1 -0
  238. package/runtime/number-radix.mjs +105 -0
  239. package/runtime/unicode-case-data.eli +29 -0
  240. package/runtime/unicode-case-data.mjs +10124 -0
  241. package/runtime/unicode-case-data.mjs.map +1 -0
  242. package/runtime/unicode-case.eli +100 -0
  243. package/runtime/unicode-case.mjs +280 -0
  244. package/runtime/unicode-case.mjs.map +1 -0
  245. package/runtime/wire/http-rpc.mjs +168 -0
  246. package/runtime/wire/markdown.mjs +196 -0
  247. package/runtime/wire/schema.mjs +109 -0
  248. package/stdlib/README.md +54 -0
  249. package/stdlib/core/protocol.eli +81 -17
  250. package/stdlib/core/seq.eli +1 -1
  251. package/stdlib/core/zipper.eli +172 -72
  252. package/stdlib/gepo.eli +12 -0
  253. package/stdlib/interop/js.eli +56 -15
  254. package/stdlib/managed-literal-protocols.eli +494 -0
  255. package/stdlib/managed-literals.eli +1469 -0
  256. package/stdlib/managed-protocol-error.eli +32 -0
  257. package/stdlib/managed-queue-state.eli +65 -0
  258. package/stdlib/managed-runtime-collection-internals.eli +60 -0
  259. package/stdlib/managed-runtime-collection.eli +639 -0
  260. package/stdlib/managed-runtime-data-text.eli +290 -0
  261. package/stdlib/managed-runtime-data.eli +22 -0
  262. package/stdlib/managed-runtime-identifier.eli +44 -0
  263. package/stdlib/managed-runtime-lazy-sequence.eli +131 -0
  264. package/stdlib/managed-runtime-list.eli +19 -0
  265. package/stdlib/managed-runtime-literals.eli +23 -0
  266. package/stdlib/managed-runtime-map.eli +9 -0
  267. package/stdlib/managed-runtime-metadata-internals.eli +6 -0
  268. package/stdlib/managed-runtime-metadata.eli +40 -0
  269. package/stdlib/managed-runtime-object.eli +8 -0
  270. package/stdlib/managed-runtime-order.eli +123 -0
  271. package/stdlib/managed-runtime-persistent-kind.eli +28 -0
  272. package/stdlib/managed-runtime-protocol.eli +28 -0
  273. package/stdlib/managed-runtime-queue.eli +9 -0
  274. package/stdlib/managed-runtime-record.eli +191 -0
  275. package/stdlib/managed-runtime-regex.eli +158 -0
  276. package/stdlib/managed-runtime-sequence.eli +305 -0
  277. package/stdlib/managed-runtime-set-algebra.eli +28 -0
  278. package/stdlib/managed-runtime-set.eli +9 -0
  279. package/stdlib/managed-runtime-sorted.eli +408 -0
  280. package/stdlib/managed-runtime-text.eli +14 -0
  281. package/stdlib/managed-runtime-transducer.eli +268 -0
  282. package/stdlib/managed-runtime-transient.eli +17 -0
  283. package/stdlib/managed-runtime-truth.eli +4 -0
  284. package/stdlib/managed-runtime-type.eli +232 -0
  285. package/stdlib/managed-runtime-value-internals.eli +13 -0
  286. package/stdlib/managed-runtime-value.eli +19 -0
  287. package/stdlib/managed-runtime-vector.eli +25 -0
  288. package/stdlib/managed-sorted-state.eli +233 -0
  289. package/stdlib/managed-testing-value.eli +6 -0
  290. package/stdlib/managed-transient-state.eli +348 -0
  291. package/stdlib/managed-value-state.eli +153 -0
  292. package/stdlib/managed-vector-view-state.eli +102 -0
  293. package/stdlib/managed-wire-http-rpc.eli +362 -0
  294. package/stdlib/managed-wire-markdown.eli +275 -0
  295. package/stdlib/managed-wire-schema.eli +193 -0
  296. package/stdlib/mdp.eli +7 -0
  297. package/stdlib/mds.eli +4 -0
  298. package/stdlib/persistent-vector.eli +23 -6
  299. package/tools/acceptance/check-legacy.mjs +687 -0
  300. package/tools/acceptance/check.eli +431 -0
  301. package/tools/acceptance/compile-evidence.el +49 -0
  302. package/tools/acceptance/finalize-legacy.mjs +498 -0
  303. package/tools/acceptance/finalize.eli +270 -0
  304. package/tools/backends/benchmark.mjs +175 -0
  305. package/tools/backends/build.mjs +135 -0
  306. package/tools/backends/compile.mjs +94 -0
  307. package/tools/backends/compiler-bootstrap.mjs +1001 -0
  308. package/tools/backends/compiler-browser.mjs +361 -0
  309. package/tools/backends/compiler-build.mjs +1628 -0
  310. package/tools/backends/compiler-cli-legacy.mjs +334 -0
  311. package/tools/backends/compiler-cli.mjs +29 -0
  312. package/tools/backends/compiler-corpus-bit.mjs +234 -0
  313. package/tools/backends/compiler-corpus-cli-adapters-legacy.mjs +362 -0
  314. package/tools/backends/compiler-corpus-cli-adapters.mjs +247 -0
  315. package/tools/backends/compiler-corpus-debugging.mjs +221 -0
  316. package/tools/backends/compiler-corpus-emitter.mjs +324 -0
  317. package/tools/backends/compiler-corpus-evaluation-adapters.mjs +65 -0
  318. package/tools/backends/compiler-corpus-execution-legacy.mjs +769 -0
  319. package/tools/backends/compiler-corpus-execution.mjs +3324 -0
  320. package/tools/backends/compiler-corpus-fuzz.mjs +229 -0
  321. package/tools/backends/compiler-corpus-generations.mjs +208 -0
  322. package/tools/backends/compiler-corpus-host-context-legacy.mjs +114 -0
  323. package/tools/backends/compiler-corpus-host-context.mjs +550 -0
  324. package/tools/backends/compiler-corpus-identity-host.mjs +553 -0
  325. package/tools/backends/compiler-corpus-identity-value-adapters-legacy.mjs +298 -0
  326. package/tools/backends/compiler-corpus-identity-value-adapters.mjs +69 -0
  327. package/tools/backends/compiler-corpus-isolated-exports.mjs +21 -0
  328. package/tools/backends/compiler-corpus-legacy.mjs +1155 -0
  329. package/tools/backends/compiler-corpus-literal-provider.mjs +282 -0
  330. package/tools/backends/compiler-corpus-managed-adapters-legacy.mjs +334 -0
  331. package/tools/backends/compiler-corpus-managed-adapters.mjs +937 -0
  332. package/tools/backends/compiler-corpus-managed-cases.mjs +179 -0
  333. package/tools/backends/compiler-corpus-managed-fixtures-legacy.mjs +879 -0
  334. package/tools/backends/compiler-corpus-managed-fixtures.mjs +1287 -0
  335. package/tools/backends/compiler-corpus-matchers.mjs +173 -0
  336. package/tools/backends/compiler-corpus-original-program.mjs +612 -0
  337. package/tools/backends/compiler-corpus-process.mjs +765 -0
  338. package/tools/backends/compiler-corpus-program-driver.mjs +306 -0
  339. package/tools/backends/compiler-corpus-project-adapters-legacy.mjs +497 -0
  340. package/tools/backends/compiler-corpus-project-adapters.mjs +340 -0
  341. package/tools/backends/compiler-corpus-project-entry-host.mjs +511 -0
  342. package/tools/backends/compiler-corpus-project-transport.mjs +151 -0
  343. package/tools/backends/compiler-corpus-raw-fixture-observer.mjs +1438 -0
  344. package/tools/backends/compiler-corpus-raw-language-fixtures.mjs +1456 -0
  345. package/tools/backends/compiler-corpus-raw-math-fixture.mjs +346 -0
  346. package/tools/backends/compiler-corpus-raw-special-fixtures.mjs +523 -0
  347. package/tools/backends/compiler-corpus-reference-legacy.mjs +263 -0
  348. package/tools/backends/compiler-corpus-reference.mjs +241 -0
  349. package/tools/backends/compiler-corpus-runtime-adapters-legacy.mjs +843 -0
  350. package/tools/backends/compiler-corpus-runtime-adapters.mjs +663 -0
  351. package/tools/backends/compiler-corpus-source-archive.mjs +206 -0
  352. package/tools/backends/compiler-corpus-tools-artifact-adapters.mjs +410 -0
  353. package/tools/backends/compiler-corpus-tools-cli.mjs +363 -0
  354. package/tools/backends/compiler-corpus-tools-reference.mjs +264 -0
  355. package/tools/backends/compiler-corpus.mjs +2054 -0
  356. package/tools/backends/compiler-debug.mjs +142 -0
  357. package/tools/backends/compiler-matrix.mjs +1955 -0
  358. package/tools/backends/compiler-metadata.mjs +203 -0
  359. package/tools/backends/compiler-package-browser.mjs +120 -0
  360. package/tools/backends/compiler-package-legacy.mjs +654 -0
  361. package/tools/backends/compiler-package.mjs +464 -0
  362. package/tools/backends/compiler-project.mjs +126 -0
  363. package/tools/backends/compiler-session.mjs +843 -0
  364. package/tools/backends/compiler-sha256.mjs +152 -0
  365. package/tools/backends/compiler-unicode-profile-host.mjs +196 -0
  366. package/tools/backends/compiler-worker.mjs +573 -0
  367. package/tools/backends/dist/bootstrap-js-stages.mjs +919 -0
  368. package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -0
  369. package/tools/backends/dist/managed-ir-inventory.mjs +488 -0
  370. package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -0
  371. package/tools/backends/dist/record-grid.mjs +1256 -0
  372. package/tools/backends/dist/record-grid.mjs.map +1 -0
  373. package/tools/backends/dist/release-cli.mjs +462 -0
  374. package/tools/backends/dist/release-cli.mjs.map +1 -0
  375. package/tools/backends/dist/run-artifact.mjs +517 -0
  376. package/tools/backends/dist/run-artifact.mjs.map +1 -0
  377. package/tools/backends/eliscript/compiler-corpus-bit.eli +77 -0
  378. package/tools/backends/eliscript/compiler-corpus-debugging.eli +70 -0
  379. package/tools/backends/eliscript/compiler-corpus-project-entry-host.eli +256 -0
  380. package/tools/backends/managed-foreign-binding.mjs +497 -0
  381. package/tools/backends/managed-host-legacy.mjs +1181 -0
  382. package/tools/backends/managed-host-lifecycle.mjs +310 -0
  383. package/tools/backends/managed-host-object-provider.mjs +155 -0
  384. package/tools/backends/managed-host-object-realm.mjs +797 -0
  385. package/tools/backends/managed-host-proxy.mjs +71 -0
  386. package/tools/backends/managed-host-runtime.mjs +5868 -0
  387. package/tools/backends/managed-host.mjs +716 -0
  388. package/tools/backends/managed-module-graph-legacy.mjs +308 -0
  389. package/tools/backends/managed-module-graph.mjs +694 -0
  390. package/tools/backends/managed-runtime-host-legacy.mjs +195 -0
  391. package/tools/backends/managed-runtime.mjs +939 -0
  392. package/tools/backends/managed-source-view-legacy.mjs +332 -0
  393. package/tools/backends/managed-source-view.mjs +959 -0
  394. package/tools/backends/memory-runtime.mjs +100 -0
  395. package/tools/backends/native-benchmark.mjs +88 -0
  396. package/tools/backends/native-managed-runtime.mjs +677 -0
  397. package/tools/backends/native-memory.mjs +768 -0
  398. package/tools/backends/native-node-memory.mjs +142 -0
  399. package/tools/backends/native-node-runner.mjs +99 -0
  400. package/tools/backends/native-node-watchdog.mjs +19 -0
  401. package/tools/backends/native-node-worker.mjs +75 -0
  402. package/tools/backends/stage3-targets.mjs +493 -0
  403. package/tools/bootstrap-command.el +13 -0
  404. package/tools/bootstrap-runtime.el +101 -0
  405. package/tools/bootstrap-seed.el +55 -0
  406. package/tools/project/check-cli.eli +31 -0
  407. package/tools/project/project-cli.eli +42 -0
  408. package/tools/project/project.eli +122 -0
  409. package/tools/runtime/unicode-case-profiles.mjs +13 -0
  410. package/tools/runtime/unicode-case-runtime.el +57 -0
  411. package/tools/testing/source-debugging-corpus-host.eli +16 -0
  412. package/tools/testing/source-debugging.eli +139 -0
  413. package/tools/testing/stdlib-bit-corpus-host.eli +21 -0
  414. package/tools/testing/stdlib-bit-corpus-host.mjs +118 -0
  415. package/tools/testing/stdlib-bit.eli +104 -0
  416. package/tools/testing/stdlib-bit.mjs +255 -0
  417. package/bin/eliscript-bootstrap +0 -15
@@ -0,0 +1,3324 @@
1
+ // Generated by Eliscript. Do not edit.
2
+ import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "data:text/javascript;base64,Y29uc3QgRSA9IFJlZmVyZW5jZUVycm9yOyBjb25zdCBUID0gVHlwZUVycm9yOyBleHBvcnQgZnVuY3Rpb24gdGR6KG5hbWUpIHsgdGhyb3cgbmV3IEUoIkNhbm5vdCBhY2Nlc3MgJyIgKyBuYW1lICsgIicgYmVmb3JlIGluaXRpYWxpemF0aW9uIik7IH0gZXhwb3J0IGZ1bmN0aW9uIGltbXV0YWJsZSgpIHsgdGhyb3cgbmV3IFQoIkFzc2lnbm1lbnQgdG8gY29uc3RhbnQgdmFyaWFibGUuIik7IH0K";
3
+ var __eliscript_tdz_ready_0;
4
+ function __eliscript_tdz_read_0() { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("resolveOriginalCorpusRequest"); return resolveOriginalCorpusRequest; }
5
+ function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("resolveOriginalCorpusRequest"); return __eliscript_const_error(); }
6
+ var __eliscript_tdz_ready_1;
7
+ function __eliscript_tdz_read_1() { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("originalProgramArguments"); return originalProgramArguments; }
8
+ function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("originalProgramArguments"); return __eliscript_const_error(); }
9
+ var __eliscript_tdz_ready_2;
10
+ function __eliscript_tdz_read_2() { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("compareCompilerCorpusObservation"); return compareCompilerCorpusObservation; }
11
+ function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("compareCompilerCorpusObservation"); return __eliscript_const_error(); }
12
+ var __eliscript_tdz_ready_3;
13
+ function __eliscript_tdz_read_3() { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("original_host_tool_files"); return original_host_tool_files; }
14
+ function __eliscript_tdz_write_3(__eliscript_tdz_value_3) { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("original_host_tool_files"); return __eliscript_const_error(); }
15
+ var __eliscript_tdz_ready_4;
16
+ function __eliscript_tdz_read_4() { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("original_host_tool_maintained"); return original_host_tool_maintained; }
17
+ function __eliscript_tdz_write_4(__eliscript_tdz_value_4) { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("original_host_tool_maintained"); return __eliscript_const_error(); }
18
+ var __eliscript_tdz_ready_5;
19
+ function __eliscript_tdz_read_5() { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("canonical_native_core_records"); return canonical_native_core_records; }
20
+ function __eliscript_tdz_write_5(__eliscript_tdz_value_5) { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("canonical_native_core_records"); return __eliscript_const_error(); }
21
+ var __eliscript_tdz_ready_6;
22
+ function __eliscript_tdz_read_6() { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("prepareOriginalSeedCorpusRecord"); return prepareOriginalSeedCorpusRecord; }
23
+ function __eliscript_tdz_write_6(__eliscript_tdz_value_6) { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("prepareOriginalSeedCorpusRecord"); return __eliscript_const_error(); }
24
+ import "eliscript/runtime/unicode-case.mjs";
25
+ import { c as __eliscript_at, d as __eliscript_at_direct } from "data:text/javascript;base64,dmFyIG09UmVmbGVjdC5hcHBseSx0dD1OdW1iZXIucHJvdG90eXBlLnZhbHVlT2Ysaj1OdW1iZXIucHJvdG90eXBlLnRvU3RyaW5nLFU9TnVtYmVyLG50PU9iamVjdC5jcmVhdGUsaD1CaWdJbnQsZXQ9RGF0YVZpZXcsb3Q9QXJyYXlCdWZmZXIsaXQ9RGF0YVZpZXcucHJvdG90eXBlLnNldEZsb2F0NjQsSj1EYXRhVmlldy5wcm90b3R5cGUuZ2V0VWludDMyLHJ0PVJhbmdlRXJyb3I7ZnVuY3Rpb24gY3QodCxuKXtsZXQgZT1oKG4pLG89aCh0KSxpPSIiO2lmKG88MG4pbz0tbztkb3tsZXQgZj1vJWU7aT0iMDEyMzQ1Njc4OWFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6IltVKGYpXStpLG8vPWV9d2hpbGUobyE9PTBuKTtyZXR1cm4gdDwwPyItIitpOml9ZnVuY3Rpb24gc3QodCxuKXtsZXQgZT1uZXcgZXQobmV3IG90KDgpKTttKGl0LGUsWzAsdCwhMV0pO2xldCBvPW0oSixlLFswLCExXSksaT1tKEosZSxbNCwhMV0pLGY9bz4+PjIwJjIwNDcsYj1vJjEwNDg1NzUscD1vPj4+MzEscj1oKGIpPDwzMm58aChpKTtpZihmIT09MClyKz0xbjw8NTJuO3I8PD0ybjtsZXQgbD00bix1PWY+MSYmYj09PTAmJmk9PT0wPzFuOjJuLGs9Mm47aWYoZj49MTA3NSl7bGV0IGM9aChmLTEwNzUpO3I8PD1jLHU8PD1jLGs8PD1jfWVsc2UgbDw8PWgoZj09PTA/MTA3NDoxMDc1LWYpO2xldCBkPWgobiksZz1udChudWxsKSxhPTAsUz0wLEQ9MDtpZihyPGwpd2hpbGUocjxsKXtpZihyKjJuPmwmJnIraz5sKWJyZWFrO3IqPWQsdSo9ZCxrKj1kLFMtLX1lbHNlIHdoaWxlKHI+PWwqZClsKj1kLFMrKztmb3IoOzspe2xldCBjPVUoci9sKTtyJT1sO2xldCBJPXI8dSx4PXIraz5sO2dbYSsrXT1jLEQ9RCoobiYxKStjJjE7bGV0IHE9cioybixQPXE+bHx8cT09PWwmJkQ9PT0xO2lmKFAmJnh8fCFQJiZJKXtpZihQKXtsZXQgUj1hLEI9ITA7d2hpbGUoUj4wJiZCKXtSLS07bGV0IEg9Z1tSXSsxO2lmKEg9PT1uKWdbUl09MDtlbHNlIGdbUl09SCxCPSExfWlmKEIpZ1swXT0xLFMrK31icmVha31pZihhPj02NCl0aHJvdyBuZXcgcnQoIm51bWJlciByYWRpeCBmb3JtYXR0aW5nIGRpZCBub3QgY29udmVyZ2UiKTtyKj1kLHUqPWQsayo9ZH13aGlsZShhPjEmJmdbYS0xXT09PTApYS0tO2xldCB3PSIiO2lmKFM8MCl7dz0iMC4iO2ZvcihsZXQgYz0wO2M8LTEtUztjKyspdys9IjAiO2ZvcihsZXQgYz0wO2M8YTtjKyspdys9IjAxMjM0NTY3ODlhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5eiJbZ1tjXV19ZWxzZXtsZXQgYz1TKzEsST1jPmE/YzphO2ZvcihsZXQgeD0wO3g8STt4Kyspe2lmKHg9PT1jJiZjPGEpdys9Ii4iO3crPXg8YT8iMDEyMzQ1Njc4OWFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6IltnW3hdXToiMCJ9fXJldHVybiBwPyItIit3Ond9ZnVuY3Rpb24gRyh0LG4pe2xldCBlO3RyeXtlPW0odHQsdCxbXSl9Y2F0Y2h7cmV0dXJuIG0oaix0LFtuXSl9bGV0IG89MTA7aWYobiE9PXZvaWQgMCl7bGV0IGk9K247aWYobz1pIT09aT8wOmktaSUxLG88Mnx8bz4zNnx8byE9PW8pcmV0dXJuIG0oaixlLFtvXSl9aWYobz09PTEwfHxlPT09MHx8ZSE9PWV8fGU9PT0xLzB8fGU9PT0tMS8wKXJldHVybiBtKGosZSxbMTBdKTtyZXR1cm4gZSUxPT09MD9jdChlLG8pOnN0KGUsbyl9dmFyIHM9UmVmbGVjdC5hcHBseSxNPUZ1bmN0aW9uLnByb3RvdHlwZS5jYWxsLE49RnVuY3Rpb24ucHJvdG90eXBlLmFwcGx5LEU9RnVuY3Rpb24ucHJvdG90eXBlLmJpbmQsVD1PYmplY3QuZGVmaW5lUHJvcGVydHksbHQ9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcixmdD1PYmplY3QuZ2V0UHJvdG90eXBlT2YsdXQ9T2JqZWN0LnNldFByb3RvdHlwZU9mLGF0PVJlZmxlY3Qub3duS2V5cyxwdD1TeW1ib2wuaGFzSW5zdGFuY2UsVj1BcnJheS5pc0FycmF5LEs9QXJyYXkucHJvdG90eXBlLmpvaW4sej1BcnJheS5wcm90b3R5cGUudG9TdHJpbmcseXQ9T2JqZWN0LnByb3RvdHlwZS50b1N0cmluZyxidD1TdHJpbmcsQz1UeXBlRXJyb3IsZHQ9U3ltYm9sLnRvUHJpbWl0aXZlLGd0PVdlYWtTZXQucHJvdG90eXBlLmhhcyx3dD1XZWFrU2V0LnByb3RvdHlwZS5hZGQseHQ9V2Vha1NldC5wcm90b3R5cGUuZGVsZXRlLEY9bmV3IFdlYWtTZXQsTz1udWxsLFc9KHQpPT50IT09bnVsbCYmKHR5cGVvZiB0PT09Im9iamVjdCJ8fHR5cGVvZiB0PT09ImZ1bmN0aW9uInx8dHlwZW9mIHQ+InUiJiZ0IT09dm9pZCAwKSxBPSh0KT0+dHlwZW9mIHQ9PT0iZnVuY3Rpb24ifHx0eXBlb2YgdD4idSImJnQhPT12b2lkIDA7ZnVuY3Rpb24gaHQoKXtsZXQgbj1uZXcgQygiY3ljbGljIGFycmF5IHRleHQgY29udmVyc2lvbiIpO3Rocm93IG4uZWxpc2NyaXB0RGlhZ25vc3RpYz17Zm9ybWF0OiJlbGlzY3JpcHQtZGlhZ25vc3RpYyIsdmVyc2lvbjoxLGNvZGU6IkVMSS1SVDAwMDkiLHNldmVyaXR5OiJlcnJvciIscGhhc2U6InJ1bnRpbWUiLG1lc3NhZ2U6ImN5Y2xpYyBhcnJheSB0ZXh0IGNvbnZlcnNpb24ifSxufWZ1bmN0aW9uIG10KHQpe2lmKCFXKHQpKXJldHVybiB0O2xldCBuPXRbZHRdO2lmKG4hPT12b2lkIDAmJm4hPT1udWxsKXtsZXQgZT1zKG4sdCxbInN0cmluZyJdKTtpZighVyhlKSlyZXR1cm4gZTt0aHJvdyBuZXcgQygiQ2Fubm90IGNvbnZlcnQgb2JqZWN0IHRvIHByaW1pdGl2ZSB2YWx1ZSIpfWZvcihsZXQgZT0wO2U8MjtlKyspe2xldCBvPXRbZT09PTA/InRvU3RyaW5nIjoidmFsdWVPZiJdO2lmKEEobykpe2xldCBpPW89PT16JiZWKHQpP3YodCk6cyhvLHQsW10pO2lmKCFXKGkpKXJldHVybiBpfX10aHJvdyBuZXcgQygiQ2Fubm90IGNvbnZlcnQgb2JqZWN0IHRvIHByaW1pdGl2ZSB2YWx1ZSIpfWZ1bmN0aW9uIFEodCl7bGV0IG49bXQodCk7aWYodHlwZW9mIG49PT0ic3ltYm9sIil0aHJvdyBuZXcgQygiQ2Fubm90IGNvbnZlcnQgYSBTeW1ib2wgdmFsdWUgdG8gYSBzdHJpbmciKTtyZXR1cm4gYnQobil9ZnVuY3Rpb24gXyh0LG4pe2xldCBlPSt0Lmxlbmd0aCxvPWUhPT1lfHxlPD0wPzA6ZT49OTAwNzE5OTI1NDc0MDk5MT85MDA3MTk5MjU0NzQwOTkxOmUtZSUxLGk9bj09PXZvaWQgMD8iLCI6UShuKSxmPU89PT1udWxsO2lmKGYpTz10O2Vsc2V7aWYodD09PU98fHMoZ3QsRixbdF0pKWh0KCk7cyh3dCxGLFt0XSl9dHJ5e2xldCBiPSIiO2ZvcihsZXQgcD0wO3A8bztwKyspe2lmKHApYis9aTtsZXQgcj10W3BdO2lmKHIhPT1udWxsJiZyIT09dm9pZCAwKWIrPVEocil9cmV0dXJuIGJ9ZmluYWxseXtpZihmKU89bnVsbDtlbHNlIHMoeHQsRixbdF0pfX1mdW5jdGlvbiB2KHQpe2xldCBuPXQuam9pbjtyZXR1cm4gQShuKT9uPT09Sz9fKHQsdm9pZCAwKTpzKG4sdCxbXSk6cyh5dCx0LFtdKX1mdW5jdGlvbiB5KHQsbil7cmV0dXJuIG48dC5sZW5ndGg/dFtuXTp2b2lkIDB9ZnVuY3Rpb24gWCh0LG4pe2xldCBlPVtdO2ZvcihsZXQgbz1uO288dC5sZW5ndGg7bysrKVQoZSxlLmxlbmd0aCx7dmFsdWU6dFtvXSx3cml0YWJsZTohMCxlbnVtZXJhYmxlOiEwLGNvbmZpZ3VyYWJsZTohMH0pO3JldHVybiBlfWZ1bmN0aW9uIFN0KHQsbil7bGV0IGU9W107Zm9yKGxldCBvPTA7bzx0Lmxlbmd0aCtuLmxlbmd0aDtvKyspVChlLG8se3ZhbHVlOm88dC5sZW5ndGg/dFtvXTpuW28tdC5sZW5ndGhdLHdyaXRhYmxlOiEwLGVudW1lcmFibGU6ITAsY29uZmlndXJhYmxlOiEwfSk7cmV0dXJuIGV9ZnVuY3Rpb24gWSguLi50KXtyZXR1cm4gdH1mdW5jdGlvbiBaKHQsbil7cmV0dXJuIG4/cyhOLFksW3ZvaWQgMCx0XSk6cyhZLHZvaWQgMCx0KX1mdW5jdGlvbiBMKHQsbixlKXtmb3IoOzspe2lmKHQ9PT1qKXJldHVybiBHKG4seShlLDApKTtpZih0PT09SyYmVihuKSlyZXR1cm4gXyhuLHkoZSwwKSk7aWYodD09PXomJlYobikpcmV0dXJuIHYobik7aWYodD09PU0pe2lmKCFBKG4pKXJldHVybiBzKHQsbixlKTtsZXQgbz1uLGk9eShlLDApO2U9WChlLDEpLHQ9byxuPWk7Y29udGludWV9aWYodD09PU4pe2lmKCFBKG4pKXJldHVybiBzKHQsbixlKTtsZXQgbz1uLGk9eShlLDApO2U9Wih5KGUsMSksITApLHQ9byxuPWk7Y29udGludWV9aWYodD09PXMpe2xldCBvPXkoZSwwKSxpPXkoZSwxKTtpZighQShvKSlyZXR1cm4gcyh0LG4sZSk7ZT1aKHkoZSwyKSwhMSksdD1vLG49aTtjb250aW51ZX1pZih0PT09RSl7bGV0IG89cyh0LG4sZSk7aWYobiE9PWomJm4hPT1LJiZuIT09eiYmbiE9PU0mJm4hPT1OJiZuIT09cyYmbiE9PUUpcmV0dXJuIG87bGV0IGk9bixmPXkoZSwwKSxiPVgoZSwxKSxwPSguLi51KT0+TChpLGYsU3QoYix1KSk7VChwLHB0LHt2YWx1ZToodSk9PnUgaW5zdGFuY2VvZiBpLGNvbmZpZ3VyYWJsZTohMH0pO2xldCByPXMoRSxwLFt2b2lkIDBdKTt1dChyLGZ0KG8pKTtsZXQgbD1hdChvKTtmb3IobGV0IHU9MDt1PGwubGVuZ3RoO3UrKylUKHIsbFt1XSxsdChvLGxbdV0pKTtyZXR1cm4gcn1yZXR1cm4gcyh0LG4sZSl9fWZ1bmN0aW9uIFJ0KHQsbil7bGV0IGU9dFtuXTtyZXR1cm4oLi4ubyk9PkwoZSx0LG8pfWZ1bmN0aW9uIEF0KHQsbiwuLi5lKXtsZXQgbz10W25dO3JldHVybiBMKG8sdCxlKX1leHBvcnR7UnQgYXMgYyxBdCBhcyBkfTs=";
26
+ const __eliscript_truthy = (value) => value !== false && value != null;
27
+ const __eliscript_number_intrinsic = globalThis.Number;
28
+ const __eliscript_bigint_intrinsic = globalThis.BigInt;
29
+ const __eliscript_numeric_apply = globalThis.Reflect.apply;
30
+ const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
31
+ const __eliscript_numeric_error = globalThis.TypeError;
32
+ const __eliscript_numeric_trim = globalThis.String.prototype.trim;
33
+ const __eliscript_numeric_slice = globalThis.String.prototype.slice;
34
+ const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
35
+ const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
36
+ const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
37
+ const __eliscript_numeric_primitive = (value) => {
38
+ if (!__eliscript_numeric_object(value)) return value;
39
+ const exotic = value[__eliscript_numeric_symbol];
40
+ if (exotic !== void 0 && exotic !== null) {
41
+ const result = __eliscript_numeric_apply(exotic, value, ["number"]);
42
+ if (!__eliscript_numeric_object(result)) return result;
43
+ throw new __eliscript_numeric_error("Cannot convert object to primitive value");
44
+ }
45
+ for (let index = 0; index < 2; index++) {
46
+ const method = value[index === 0 ? "valueOf" : "toString"];
47
+ if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
48
+ const result = __eliscript_numeric_apply(method, value, []);
49
+ if (!__eliscript_numeric_object(result)) return result;
50
+ }
51
+ }
52
+ throw new __eliscript_numeric_error("Cannot convert object to primitive value");
53
+ };
54
+ const __eliscript_to_number = (value) => {
55
+ const primitive = __eliscript_numeric_primitive(value);
56
+ if (typeof primitive === "string") {
57
+ const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
58
+ if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
59
+ let first = 2;
60
+ while (first < text.length && text[first] === "0") first++;
61
+ if (first === text.length) return 0;
62
+ const prefix = text[1];
63
+ const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
64
+ if (text.length - first > limit) return 1 / 0;
65
+ const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
66
+ return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
67
+ }
68
+ }
69
+ return __eliscript_number_intrinsic(primitive);
70
+ };
71
+ const __eliscript_numeric = (value) => {
72
+ if (typeof value === "number" || typeof value === "bigint") return value;
73
+ const primitive = __eliscript_numeric_primitive(value);
74
+ if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
75
+ return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
76
+ };
77
+ const __eliscript_implicit_number = (value) => {
78
+ if (typeof value === "number") return value;
79
+ const primitive = __eliscript_numeric_primitive(value);
80
+ if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
81
+ return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
82
+ };
83
+ const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
84
+ const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
85
+ const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
86
+ const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
87
+ const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
88
+ const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
89
+ const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
90
+ const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
91
+ const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
92
+ const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
93
+ const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
94
+ const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
95
+ const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
96
+ const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
97
+ const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
98
+ const __eliscript_numeric_relation = (operator, left, right) => {
99
+ if (typeof left === "number" && typeof right === "number") {
100
+ if (operator === "<") return left < right;
101
+ if (operator === "<=") return left <= right;
102
+ if (operator === ">") return left > right;
103
+ return left >= right;
104
+ }
105
+ let a = __eliscript_numeric_primitive(left);
106
+ let b = __eliscript_numeric_primitive(right);
107
+ const x = typeof a, y = typeof b;
108
+ if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
109
+ a = __eliscript_numeric(a);
110
+ b = __eliscript_numeric(b);
111
+ }
112
+ if (operator === "<") return a < b;
113
+ if (operator === "<=") return a <= b;
114
+ if (operator === ">") return a > b;
115
+ return a >= b;
116
+ };
117
+
118
+ import assert from "node:assert/strict";
119
+ import {readFile, writeFile, mkdir, mkdtemp, readdir, lstat, realpath, symlink, copyFile} from "node:fs/promises";
120
+ import {constants} from "node:fs";
121
+ import {resolve, join, relative, isAbsolute, sep, posix} from "node:path";
122
+ import {pathToFileURL} from "node:url";
123
+ import {createHash} from "node:crypto";
124
+ import {Buffer} from "node:buffer";
125
+ import * as legacy from "./compiler-corpus-execution-legacy.mjs";
126
+ import {independentCompilerResources, buildIndependentCompiler, compilerMetadataDigest} from "./compiler-build.mjs";
127
+ import {prepareOriginalSeedSources, originalSequenceNativeInteropP, transportOriginalSequenceRuntime, compilerCorpusRequest, compilerCorpusFunctionalResources, bindOriginalFunctionalResourceInputs} from "./compiler-corpus.mjs";
128
+ import {loadLiteralSources} from "./build.mjs";
129
+ import {openCompilerArtifact, saveCompilerMetadata} from "./compiler-bootstrap.mjs";
130
+ import {archiveProduct} from "./compiler-matrix.mjs";
131
+ import {instantiateManagedRuntimeWithHostModules, loadManagedHostModules} from "./managed-runtime.mjs";
132
+ import {instantiateNativeManagedRuntime, snapshotNativeManagedRuntimeABI} from "./native-managed-runtime.mjs";
133
+ import {prepareOriginalLiteralHostProvider} from "./compiler-corpus-literal-provider.mjs";
134
+ import {executeOriginalProgram, executeCompilerSessionProgram} from "./compiler-corpus-original-program.mjs";
135
+ import {originalCorpusExecutionPolicy, runOriginalCorpusProcess} from "./compiler-corpus-process.mjs";
136
+ import {read_string} from "../../dist/bootstrap/reader.mjs";
137
+ import {compile_string} from "../../dist/bootstrap/compiler.mjs";
138
+ import {loadCompiler} from "../../bootstrap/host/bun.mjs";
139
+ const resolveOriginalCorpusRequest = (legacy)["resolveOriginalCorpusRequest"];
140
+ __eliscript_tdz_ready_0 = true;
141
+ const originalProgramArguments = (legacy)["originalProgramArguments"];
142
+ __eliscript_tdz_ready_1 = true;
143
+ const compareCompilerCorpusObservation = (legacy)["compareCompilerCorpusObservation"];
144
+ __eliscript_tdz_ready_2 = true;
145
+ function field(value, key) {
146
+ if ((value == null)) {
147
+ return undefined;
148
+ } else {
149
+ return (value)[key];
150
+ }
151
+ }
152
+ function fallback(value, other) {
153
+ if ((value == null)) {
154
+ return other;
155
+ } else {
156
+ return value;
157
+ }
158
+ }
159
+ function execution_digest(bytes) {
160
+ return ((createHash("sha256"))["update"](bytes))["digest"]("hex");
161
+ }
162
+ function original_host_enabled(value) {
163
+ return ((!(value == null)) && (!(value === false)) && (!(value === 0)) && (!(value === "")) && (!__eliscript_truthy(((__eliscript_value_1) => (__eliscript_truthy(__eliscript_value_1) ? Number.isNaN(value) : __eliscript_value_1))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "number")))));
164
+ }
165
+ function seed_original_host(record, configuration) {
166
+ {
167
+ const __eliscript_value_2 = field(field(record, "execution"), "hostRuntime");
168
+ {
169
+ let host = __eliscript_value_2;
170
+ if ((!(host == null))) {
171
+ return host;
172
+ } else {
173
+ if (__eliscript_truthy(((__eliscript_value_3) => (__eliscript_truthy(__eliscript_value_3) ? __eliscript_value_3 : original_host_enabled(field(field(record, "execution"), "requiresBun"))))(((configuration)["programHost"] === "bun")))) {
174
+ return "bun";
175
+ } else {
176
+ return "node";
177
+ }
178
+ }
179
+ }
180
+ }
181
+ }
182
+ async function seed_child_output(command, arguments$, source_root, signal, evidence_root, context = null) {
183
+ await (mkdir(evidence_root, ({"recursive": true})));
184
+ return (await (async (directory) => {
185
+ return (await (async (configured) => {
186
+ return ((receipt) => {
187
+ return (receipt)["stdout"];
188
+ })(await (runOriginalCorpusProcess(command, arguments$, ({"cwd": source_root, "signal": signal, "directory": directory, "caseId": field((configured)["record"], "id"), "target": (configured)["target"], "sourceIdentity": (configured)["sourceIdentity"], "policy": originalCorpusExecutionPolicy(configured)}))));
189
+ })(fallback(context, ({"record": ({"execution": ({})}), "target": "javascript", "options": ({})}))));
190
+ })(await (mkdtemp(resolve(evidence_root, "process-")))));
191
+ }
192
+ function seed_project_groups(record) {
193
+ {
194
+ let request = field(record, "request");
195
+ let portable = field(request, "portableEntries");
196
+ let groups = new (globalThis.Map)();
197
+ let by_id = new (globalThis.Map)();
198
+ let pruned = (!(portable == null));
199
+ if (__eliscript_truthy(pruned)) {
200
+ if ((!__eliscript_truthy(((__eliscript_value_4) => (__eliscript_truthy(__eliscript_value_4) ? ((__eliscript_value_5) => (__eliscript_truthy(__eliscript_value_5) ? (portable)["every"](((name) => {
201
+ return ((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(name) === "string") && __eliscript_numeric_relation(">", ((name) ?? []).length, 0));
202
+ })) : __eliscript_value_5))(__eliscript_numeric_relation(">", ((portable) ?? []).length, 0)) : __eliscript_value_4))(Array.isArray(portable))))) {
203
+ ((__eliscript_value_6) => { throw __eliscript_value_6; })(new (globalThis.TypeError)("original Seed portable entries must retain their entry names"));
204
+ }
205
+ }
206
+ if (__eliscript_truthy(((__eliscript_value_7) => (__eliscript_truthy(__eliscript_value_7) ? __eliscript_value_7 : (field(request, "resolveImports") === true)))(pruned))) {
207
+ ((record)["modules"])["forEach"](((item) => {
208
+ {
209
+ const __eliscript_value_8 = (item)["id"];
210
+ const __eliscript_value_9 = (item)["filename"];
211
+ {
212
+ let id = __eliscript_value_8;
213
+ let filename = __eliscript_value_9;
214
+ if (__eliscript_truthy(((__eliscript_value_10) => (__eliscript_truthy(__eliscript_value_10) ? ((__eliscript_value_11) => (__eliscript_truthy(__eliscript_value_11) ? (id)["endsWith"](".mjs") : __eliscript_value_11))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(filename) === "string")) : __eliscript_value_10))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(id) === "string")))) {
215
+ {
216
+ const __eliscript_value_12 = (String((id)["slice"](0, -4)) + String(".eli"));
217
+ {
218
+ let source_id = __eliscript_value_12;
219
+ if (__eliscript_truthy(((__eliscript_value_13) => (__eliscript_truthy(__eliscript_value_13) ? __eliscript_value_13 : (filename)["endsWith"]((String("/") + String(source_id)))))((filename === source_id)))) {
220
+ {
221
+ let prefix = (filename)["slice"](0, __eliscript_numeric_sub(((filename) ?? []).length, ((source_id) ?? []).length));
222
+ let group = (groups)["get"](prefix);
223
+ if ((!__eliscript_truthy(group))) {
224
+ ((group = ({"prefix": prefix, "records": []})));
225
+ (groups)["set"](prefix, group);
226
+ }
227
+ ((group)["records"])["push"](item);
228
+ return (by_id)["set"](id, group);
229
+ }
230
+ } else {
231
+ return null;
232
+ }
233
+ }
234
+ }
235
+ } else {
236
+ return null;
237
+ }
238
+ }
239
+ }
240
+ }));
241
+ {
242
+ const __eliscript_value_14 = (by_id)["get"]((record)["entry"]);
243
+ {
244
+ let entry_group = __eliscript_value_14;
245
+ if (__eliscript_truthy(((__eliscript_value_15) => (__eliscript_truthy(__eliscript_value_15) ? ((!__eliscript_truthy(entry_group)) && ((__eliscript_value_16, __eliscript_value_17) => (__eliscript_value_16 !== __eliscript_value_17))((((record)["modules"]) ?? []).length, 1)) : __eliscript_value_15))(pruned))) {
246
+ ((__eliscript_value_18) => { throw __eliscript_value_18; })(new (globalThis.TypeError)("original Seed portable source and output layouts differ"));
247
+ }
248
+ if ((!__eliscript_truthy(((__eliscript_value_19) => (__eliscript_truthy(__eliscript_value_19) ? (!__eliscript_truthy(entry_group)) : __eliscript_value_19))(pruned)))) {
249
+ return ({"groups": groups, "byId": by_id, "portableEntries": portable, "entryGroup": entry_group, "pruned": pruned});
250
+ } else {
251
+ return null;
252
+ }
253
+ }
254
+ }
255
+ } else {
256
+ return null;
257
+ }
258
+ }
259
+ }
260
+ function seed_relative_path(value) {
261
+ if ((!((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "string") && __eliscript_numeric_relation(">", ((value) ?? []).length, 0) && (!__eliscript_truthy(isAbsolute(value))) && (!__eliscript_truthy((value)["includes"]("\\"))) && (!__eliscript_truthy((value)["includes"](":"))) && (!__eliscript_truthy((value)["includes"]("\u0000"))) && (!__eliscript_truthy(((value)["split"]("/"))["some"](((part) => {
262
+ return ((part === "") || (part === ".") || (part === ".."));
263
+ }))))))) {
264
+ ((__eliscript_value_20) => { throw __eliscript_value_20; })(new (globalThis.TypeError)("original Seed source identities must remain relative to their archive"));
265
+ }
266
+ return value;
267
+ }
268
+ function seed_authenticated_record(record, configuration) {
269
+ if (((configuration)["sourceAssets"] === undefined)) {
270
+ return record;
271
+ } else {
272
+ {
273
+ let proofs = ({"sourceAssets": (configuration)["sourceAssets"], "literalSources": (configuration)["literalSources"], "literalSourceIdentity": (configuration)["literalSourceIdentity"]});
274
+ let retained = field((record)["original"], "functionalResourceInputs");
275
+ if (__eliscript_truthy(retained)) {
276
+ compilerCorpusFunctionalResources(record, ({"functionalRuntimeProfile": "small"}));
277
+ }
278
+ {
279
+ const __eliscript_value_21 = prepareOriginalSeedSources(record, proofs);
280
+ {
281
+ let request = __eliscript_value_21;
282
+ if (((request == null) || (!((request)["resolveImports"] === true)))) {
283
+ return record;
284
+ } else {
285
+ {
286
+ let original = (record)["original"];
287
+ let private$ = copy(record, ({"modules": (request)["modules"], "request": request, "original": copy(original)}));
288
+ if (__eliscript_truthy(retained)) {
289
+ bindOriginalFunctionalResourceInputs(({"evidence": (configuration)["sourceAssets"], "records": [private$]}));
290
+ }
291
+ return private$;
292
+ }
293
+ }
294
+ }
295
+ }
296
+ }
297
+ }
298
+ }
299
+ function seed_host_tokens(source) {
300
+ {
301
+ const __eliscript_value_22 = [];
302
+ const __eliscript_value_23 = 0;
303
+ const __eliscript_value_24 = new (globalThis.RegExp)("^[$A-Z_a-z][$\\w]*");
304
+ const __eliscript_value_25 = new (globalThis.RegExp)("^(?:0[xob][0-9a-f_]+|[0-9][0-9_.]*(?:e[+-]?[0-9_]+)?)", "i");
305
+ {
306
+ let result = __eliscript_value_22;
307
+ let at = __eliscript_value_23;
308
+ let identifier = __eliscript_value_24;
309
+ let number = __eliscript_value_25;
310
+ while (__eliscript_numeric_relation("<", at, ((source) ?? []).length)) {
311
+ {
312
+ let start = at;
313
+ let character = (source)[at];
314
+ let previous = (result)["at"](-1);
315
+ if (__eliscript_truthy((new (globalThis.RegExp)("\\s"))["test"](character))) {
316
+ ((at = (at + 1)));
317
+ } else {
318
+ if (((character === "/") && ((source)[(at + 1)] === "/"))) {
319
+ while ((__eliscript_numeric_relation("<", at, ((source) ?? []).length) && ((__eliscript_value_26, __eliscript_value_27) => (__eliscript_value_26 !== __eliscript_value_27))((source)[at], "\n"))) {
320
+ ((at = (at + 1)));
321
+ }
322
+ } else {
323
+ if (((character === "/") && ((source)[(at + 1)] === "*"))) {
324
+ {
325
+ const __eliscript_value_28 = (source)["indexOf"]("*/", (at + 2));
326
+ {
327
+ let end = __eliscript_value_28;
328
+ if (__eliscript_numeric_relation("<", end, 0)) {
329
+ ((__eliscript_value_29) => { throw __eliscript_value_29; })(new (globalThis.TypeError)("unterminated original Seed host comment"));
330
+ }
331
+ ((at = (end + 2)));
332
+ }
333
+ }
334
+ } else {
335
+ if (((character === "\"") || (character === "'") || (character === "`"))) {
336
+ ((at = (at + 1)));
337
+ {
338
+ const __eliscript_value_30 = false;
339
+ {
340
+ let closed = __eliscript_value_30;
341
+ while ((__eliscript_numeric_relation("<", at, ((source) ?? []).length) && (!__eliscript_truthy(closed)))) {
342
+ {
343
+ const __eliscript_value_31 = (source)[at];
344
+ {
345
+ let next = __eliscript_value_31;
346
+ ((at = (at + 1)));
347
+ if ((next === "\\")) {
348
+ ((at = (at + 1)));
349
+ } else {
350
+ if ((next === character)) {
351
+ ((closed = true));
352
+ } else {
353
+
354
+ }
355
+ }
356
+ }
357
+ }
358
+ }
359
+ if ((!__eliscript_truthy(closed))) {
360
+ ((__eliscript_value_32) => { throw __eliscript_value_32; })(new (globalThis.TypeError)("unterminated original Seed host string"));
361
+ }
362
+ }
363
+ }
364
+ (result)["push"](({"type": "string", "text": (source)["slice"](start, at)}));
365
+ } else {
366
+ if (__eliscript_truthy(((__eliscript_value_33) => (__eliscript_truthy(__eliscript_value_33) ? ((__eliscript_value_34) => (__eliscript_truthy(__eliscript_value_34) ? __eliscript_value_34 : ((__eliscript_value_35) => (__eliscript_truthy(__eliscript_value_35) ? __eliscript_value_35 : ((__eliscript_value_36) => (__eliscript_truthy(__eliscript_value_36) ? (["return", "throw", "case", "yield", "await"])["includes"](field(previous, "text")) : __eliscript_value_36))((field(previous, "type") === "identifier"))))(((!__eliscript_truthy((["identifier", "number", "string"])["includes"](field(previous, "type")))) && (!__eliscript_truthy(([")", "]", "}"])["includes"](field(previous, "text"))))))))((previous == null)) : __eliscript_value_33))((character === "/")))) {
367
+ ((at = (at + 1)));
368
+ {
369
+ const __eliscript_value_37 = false;
370
+ const __eliscript_value_38 = false;
371
+ {
372
+ let bracket = __eliscript_value_37;
373
+ let closed = __eliscript_value_38;
374
+ while ((__eliscript_numeric_relation("<", at, ((source) ?? []).length) && (!__eliscript_truthy(closed)))) {
375
+ {
376
+ const __eliscript_value_39 = (source)[at];
377
+ {
378
+ let next = __eliscript_value_39;
379
+ ((at = (at + 1)));
380
+ if ((next === "\\")) {
381
+ ((at = (at + 1)));
382
+ } else {
383
+ if ((next === "[")) {
384
+ ((bracket = true));
385
+ } else {
386
+ if ((next === "]")) {
387
+ ((bracket = false));
388
+ } else {
389
+ if (((next === "/") && (!__eliscript_truthy(bracket)))) {
390
+ ((closed = true));
391
+ } else {
392
+
393
+ }
394
+ }
395
+ }
396
+ }
397
+ }
398
+ }
399
+ }
400
+ if ((!__eliscript_truthy(closed))) {
401
+ ((__eliscript_value_40) => { throw __eliscript_value_40; })(new (globalThis.TypeError)("unterminated original Seed host regular expression"));
402
+ }
403
+ }
404
+ }
405
+ while (__eliscript_truthy(((__eliscript_value_41) => (__eliscript_truthy(__eliscript_value_41) ? (new (globalThis.RegExp)("[a-z]", "i"))["test"]((source)[at]) : __eliscript_value_41))(__eliscript_numeric_relation("<", at, ((source) ?? []).length)))) {
406
+ ((at = (at + 1)));
407
+ }
408
+ (result)["push"](({"type": "regexp", "text": (source)["slice"](start, at)}));
409
+ } else {
410
+ {
411
+ let rest = (source)["slice"](at);
412
+ let word = (identifier)["exec"](rest);
413
+ let digits = ((!__eliscript_truthy(word)) ? (number)["exec"](rest) : null);
414
+ if (__eliscript_truthy(word)) {
415
+ ((at = (at + (((word)[0]) ?? []).length)));
416
+ (result)["push"](({"type": "identifier", "text": (word)[0]}));
417
+ } else {
418
+ if (__eliscript_truthy(digits)) {
419
+ ((at = (at + (((digits)[0]) ?? []).length)));
420
+ (result)["push"](({"type": "number", "text": (digits)[0]}));
421
+ } else {
422
+ ((at = (at + 1)));
423
+ (result)["push"](({"type": "punctuation", "text": character}));
424
+ }
425
+ }
426
+ }
427
+ }
428
+ }
429
+ }
430
+ }
431
+ }
432
+ }
433
+ }
434
+ return result;
435
+ }
436
+ }
437
+ }
438
+ function seed_host_string(token) {
439
+ if (__eliscript_truthy(((__eliscript_value_42) => (__eliscript_truthy(__eliscript_value_42) ? (((token)["type"] === "string") && ((__eliscript_value_43, __eliscript_value_44) => (__eliscript_value_43 !== __eliscript_value_44))(((token)["text"])[0], "`")) : __eliscript_value_42))(token))) {
440
+ {
441
+ const __eliscript_value_45 = (token)["text"];
442
+ const __eliscript_value_46 = "";
443
+ const __eliscript_value_47 = 1;
444
+ const __eliscript_value_48 = ({"n": "\n", "r": "\r", "t": "\t", "b": "\b", "f": "\f", "v": "\u000b", "0": "\u0000"});
445
+ {
446
+ let source = __eliscript_value_45;
447
+ let value = __eliscript_value_46;
448
+ let at = __eliscript_value_47;
449
+ let escapes = __eliscript_value_48;
450
+ while (__eliscript_numeric_relation("<", at, __eliscript_numeric_decrement(((source) ?? []).length))) {
451
+ {
452
+ const __eliscript_value_49 = (source)[at];
453
+ {
454
+ let character = __eliscript_value_49;
455
+ if ((character === "\\")) {
456
+ ((at = (at + 1)));
457
+ ((character = (source)[at]));
458
+ if (__eliscript_truthy(Object.hasOwn(escapes, character))) {
459
+ ((character = (escapes)[character]));
460
+ } else {
461
+ if ((character === "\n")) {
462
+ ((character = ""));
463
+ } else {
464
+ if ((character === "\r")) {
465
+ if (((source)[(at + 1)] === "\n")) {
466
+ ((at = (at + 1)));
467
+ }
468
+ ((character = ""));
469
+ } else {
470
+ if (((character === "u") || (character === "x"))) {
471
+ {
472
+ let count = ((character === "u") ? 4 : 2);
473
+ let hex = (source)["slice"]((at + 1), (at + count + 1));
474
+ if ((!__eliscript_truthy((new (globalThis.RegExp)(("^[0-9a-f]{" + count + "}$"), "i"))["test"](hex)))) {
475
+ ((__eliscript_value_50) => { throw __eliscript_value_50; })(new (globalThis.TypeError)("unsupported original Seed host import escape"));
476
+ }
477
+ ((character = String.fromCharCode(Number.parseInt(hex, 16))));
478
+ ((at = (at + count)));
479
+ }
480
+ } else {
481
+
482
+ }
483
+ }
484
+ }
485
+ }
486
+ }
487
+ ((value = (value + character)));
488
+ }
489
+ }
490
+ ((at = (at + 1)));
491
+ }
492
+ return value;
493
+ }
494
+ }
495
+ } else {
496
+ return null;
497
+ }
498
+ }
499
+ function seed_declared_host_provider_p(record, path) {
500
+ return ((__eliscript_value_51) => (__eliscript_truthy(__eliscript_value_51) ? (fallback(field((record)["request"], "hostSources"), []))["some"](((provider) => {
501
+ return ((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(field(provider, "source")) === "string") && (field(provider, "id") === path));
502
+ })) : __eliscript_value_51))((path)["endsWith"](".mjs"));
503
+ }
504
+ function seed_host_source_entries(record, by_id, by_file, outputs) {
505
+ {
506
+ let execution = (record)["execution"];
507
+ let source = field(execution, "hostSource");
508
+ let host = field(execution, "host");
509
+ let result = [];
510
+ if (((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(source) === "string") && __eliscript_numeric_relation(">", ((source) ?? []).length, 0) && (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(host) === "string"))) {
511
+ {
512
+ const __eliscript_value_52 = seed_host_tokens(source);
513
+ const __eliscript_value_53 = 0;
514
+ {
515
+ let tokens = __eliscript_value_52;
516
+ let index = __eliscript_value_53;
517
+ while (__eliscript_numeric_relation("<", index, ((tokens) ?? []).length)) {
518
+ if (((field((tokens)[index], "text") === "import") && ((__eliscript_value_54, __eliscript_value_55) => (__eliscript_value_54 !== __eliscript_value_55))(field((tokens)[__eliscript_numeric_decrement(index)], "text"), "."))) {
519
+ {
520
+ let next = field((tokens)[(index + 1)], "text");
521
+ let token = (tokens)[(index + 1)];
522
+ if ((next === "(")) {
523
+ ((token = (tokens)[(index + 2)]));
524
+ if ((field(token, "type") === "string")) {
525
+ if ((!(field((tokens)[(index + 3)], "text") === ")"))) {
526
+ ((token = undefined));
527
+ }
528
+ } else {
529
+ if (((field(token, "text") === "new") && (field((tokens)[(index + 3)], "text") === "URL") && (field((tokens)[(index + 4)], "text") === "(") && (field((tokens)[(index + 6)], "text") === ",") && (field((tokens)[(index + 7)], "text") === "import") && (field((tokens)[(index + 8)], "text") === ".") && (field((tokens)[(index + 9)], "text") === "meta") && (field((tokens)[(index + 10)], "text") === ".") && (field((tokens)[(index + 11)], "text") === "url") && (field((tokens)[(index + 12)], "text") === ")") && (field((tokens)[(index + 13)], "text") === ")"))) {
530
+ ((token = (tokens)[(index + 5)]));
531
+ } else {
532
+ ((token = undefined));
533
+ }
534
+ }
535
+ } else {
536
+ if ((next === ".")) {
537
+ ((token = undefined));
538
+ } else {
539
+ if (((__eliscript_value_56, __eliscript_value_57) => (__eliscript_value_56 !== __eliscript_value_57))(field(token, "type"), "string")) {
540
+ {
541
+ const __eliscript_value_58 = (index + 1);
542
+ {
543
+ let cursor = __eliscript_value_58;
544
+ ((token = undefined));
545
+ while ((__eliscript_numeric_relation("<", cursor, ((tokens) ?? []).length) && ((__eliscript_value_59, __eliscript_value_60) => (__eliscript_value_59 !== __eliscript_value_60))(field((tokens)[cursor], "text"), ";") && (token === undefined))) {
546
+ if ((field((tokens)[cursor], "text") === "from")) {
547
+ ((token = (tokens)[(cursor + 1)]));
548
+ }
549
+ ((cursor = (cursor + 1)));
550
+ }
551
+ }
552
+ }
553
+ } else {
554
+
555
+ }
556
+ }
557
+ }
558
+ {
559
+ const __eliscript_value_61 = seed_host_string(token);
560
+ {
561
+ let specifier = __eliscript_value_61;
562
+ if (__eliscript_truthy(((__eliscript_value_62) => (__eliscript_truthy(__eliscript_value_62) ? (specifier)["startsWith"](".") : __eliscript_value_62))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(specifier) === "string")))) {
563
+ {
564
+ let path = (posix)["normalize"](__eliscript_at(posix, "join")((posix)["dirname"](host), specifier));
565
+ let id = (__eliscript_truthy((path)["endsWith"](".eli")) ? ((path)["slice"](0, -4) + ".mjs") : path);
566
+ let item = ((!__eliscript_truthy(seed_declared_host_provider_p(record, path))) ? ((__eliscript_value_63) => (__eliscript_truthy(__eliscript_value_63) ? __eliscript_value_63 : ((__eliscript_value_64) => (__eliscript_truthy(__eliscript_value_64) ? __eliscript_value_64 : (outputs)["get"](path)))((by_file)["get"](path))))((by_id)["get"](id)) : null);
567
+ if (__eliscript_truthy(item)) {
568
+ (result)["push"]((item)["id"]);
569
+ }
570
+ }
571
+ }
572
+ }
573
+ }
574
+ }
575
+ }
576
+ ((index = (index + 1)));
577
+ }
578
+ }
579
+ }
580
+ }
581
+ return result;
582
+ }
583
+ }
584
+ function seed_source_entries(record, by_id, by_file, outputs, entries) {
585
+ {
586
+ const __eliscript_value_65 = (entries)["slice"]();
587
+ const __eliscript_value_66 = new (globalThis.Set)();
588
+ const __eliscript_value_67 = [];
589
+ const __eliscript_value_68 = 0;
590
+ {
591
+ let pending = __eliscript_value_65;
592
+ let seen = __eliscript_value_66;
593
+ let result = __eliscript_value_67;
594
+ let index = __eliscript_value_68;
595
+ while (__eliscript_numeric_relation("<", index, ((pending) ?? []).length)) {
596
+ {
597
+ let id = (pending)[index];
598
+ let item = (by_id)["get"](id);
599
+ if ((!__eliscript_truthy(item))) {
600
+ ((__eliscript_value_69) => { throw __eliscript_value_69; })(new (globalThis.TypeError)("original Seed entry is outside its authenticated source graph"));
601
+ }
602
+ if ((!__eliscript_truthy((seen)["has"](id)))) {
603
+ (seen)["add"](id);
604
+ (result)["push"](id);
605
+ {
606
+ const __eliscript_value_70 = read_string((item)["source"], (item)["filename"]);
607
+ {
608
+ let forms = __eliscript_value_70;
609
+ while (__eliscript_numeric_relation(">", ((forms) ?? []).length, 0)) {
610
+ {
611
+ let form = (forms)["shift"]();
612
+ let children = (form)["items"];
613
+ let head = ((__eliscript_value_71) => (__eliscript_truthy(__eliscript_value_71) ? ((__eliscript_value_72) => (__eliscript_truthy(__eliscript_value_72) ? ((children)[0])["name"] : __eliscript_value_72))(__eliscript_numeric_relation(">", ((children) ?? []).length, 0)) : __eliscript_value_71))(Array.isArray(children));
614
+ if ((head === "module")) {
615
+ __eliscript_at(Reflect, "apply")((forms)["push"], forms, (children)["slice"](2));
616
+ } else {
617
+ if (((head === "import") || (head === "import-portable"))) {
618
+ {
619
+ const __eliscript_value_73 = ((children)[1])["value"];
620
+ {
621
+ let specifier = __eliscript_value_73;
622
+ if (__eliscript_truthy(((__eliscript_value_74) => (__eliscript_truthy(__eliscript_value_74) ? (specifier)["startsWith"](".") : __eliscript_value_74))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(specifier) === "string")))) {
623
+ {
624
+ let physical = (posix)["normalize"](__eliscript_at(posix, "join")((posix)["dirname"]((item)["filename"]), specifier));
625
+ let virtual = (posix)["normalize"](__eliscript_at(posix, "join")((posix)["dirname"](id), specifier));
626
+ let dependency = ((!__eliscript_truthy(seed_declared_host_provider_p(record, physical))) ? ((__eliscript_value_75) => (__eliscript_truthy(__eliscript_value_75) ? __eliscript_value_75 : ((__eliscript_value_76) => (__eliscript_truthy(__eliscript_value_76) ? __eliscript_value_76 : ((__eliscript_value_77) => (__eliscript_truthy(__eliscript_value_77) ? __eliscript_value_77 : ((__eliscript_value_78) => (__eliscript_truthy(__eliscript_value_78) ? __eliscript_value_78 : ((__eliscript_value_79) => (__eliscript_truthy(__eliscript_value_79) ? __eliscript_value_79 : (outputs)["get"](virtual)))((by_file)["get"](virtual))))((by_id)["get"](virtual))))((by_id)["get"](physical))))((outputs)["get"](physical))))((by_file)["get"](physical)) : null);
627
+ if (__eliscript_truthy(dependency)) {
628
+ (pending)["push"]((dependency)["id"]);
629
+ }
630
+ }
631
+ }
632
+ }
633
+ }
634
+ } else {
635
+
636
+ }
637
+ }
638
+ }
639
+ }
640
+ }
641
+ }
642
+ }
643
+ }
644
+ ((index = (index + 1)));
645
+ }
646
+ return result;
647
+ }
648
+ }
649
+ }
650
+ async function seed_authenticated_source_graph(record, output, product, source_root, signal) {
651
+ return (await (async (records) => {
652
+ return (await (async (request) => {
653
+ return (await (async (by_id) => {
654
+ return (await (async (by_file) => {
655
+ return (await (async (outputs) => {
656
+ return (await (async (index) => {
657
+ return (await (async (compiled) => {
658
+ return (await (async (arguments$) => {
659
+ return (await (async () => {
660
+ (await (async () => {
661
+ while (__eliscript_numeric_relation("<", index, ((records) ?? []).length)) {
662
+ (await (async (item) => {
663
+ return (await (async (id) => {
664
+ return (await (async (filename) => {
665
+ return (await (async (source) => {
666
+ return (await (async (destination) => {
667
+ return (await (async () => {
668
+ if ((!__eliscript_truthy(((__eliscript_value_80) => (__eliscript_truthy(__eliscript_value_80) ? ((__eliscript_value_81) => (__eliscript_truthy(__eliscript_value_81) ? ((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(source) === "string") && (!__eliscript_truthy((by_id)["has"](id))) && (!__eliscript_truthy((by_file)["has"](filename)))) : __eliscript_value_81))((id)["endsWith"](".mjs")) : __eliscript_value_80))((filename)["endsWith"](".eli"))))) {
669
+ ((__eliscript_value_82) => { throw __eliscript_value_82; })(new (globalThis.TypeError)("original Seed requires distinct complete authenticated source modules"));
670
+ }
671
+ (by_id)["set"](id, item);
672
+ (by_file)["set"](filename, item);
673
+ (outputs)["set"](destination, item);
674
+ return (await (async (input) => {
675
+ await (mkdir(resolve(input, ".."), ({"recursive": true})));
676
+ return await (writeFile(input, source));
677
+ })(resolve(output, "sources", filename)));
678
+ })());
679
+ })(((filename)["slice"](0, -4) + ".mjs")));
680
+ })((item)["source"]));
681
+ })(seed_relative_path((item)["filename"])));
682
+ })(seed_relative_path((item)["id"])));
683
+ })((records)[index]));
684
+ ((index = (index + 1)));
685
+ }
686
+ return null;
687
+ })());
688
+ {
689
+ const __eliscript_value_83 = (request)["portableEntries"];
690
+ const __eliscript_value_84 = fallback((request)["entries"], [(record)["entry"]]);
691
+ {
692
+ let portable = __eliscript_value_83;
693
+ let entries = __eliscript_value_84;
694
+ if ((!__eliscript_truthy(((__eliscript_value_85) => (__eliscript_truthy(__eliscript_value_85) ? __eliscript_numeric_relation(">", ((entries) ?? []).length, 0) : __eliscript_value_85))(Array.isArray(entries))))) {
695
+ ((__eliscript_value_86) => { throw __eliscript_value_86; })(new (globalThis.TypeError)("original Seed requires its declared project entries"));
696
+ }
697
+ if ((portable === undefined)) {
698
+ ((entries = seed_source_entries(record, by_id, by_file, outputs, (entries)["concat"](seed_host_source_entries(record, by_id, by_file, outputs)))));
699
+ }
700
+ if ((!(portable === undefined))) {
701
+ if ((!__eliscript_truthy(((__eliscript_value_87) => (__eliscript_truthy(__eliscript_value_87) ? ((__eliscript_value_88) => (__eliscript_truthy(__eliscript_value_88) ? (portable)["every"](((name) => {
702
+ return ((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(name) === "string") && __eliscript_numeric_relation(">", ((name) ?? []).length, 0));
703
+ })) : __eliscript_value_88))(__eliscript_numeric_relation(">", ((portable) ?? []).length, 0)) : __eliscript_value_87))(Array.isArray(portable))))) {
704
+ ((__eliscript_value_89) => { throw __eliscript_value_89; })(new (globalThis.TypeError)("original Seed portable entries must retain their entry names"));
705
+ }
706
+ (portable)["forEach"](((name) => {
707
+ return (arguments$)["push"]("--portable", name);
708
+ }));
709
+ ((entries = [(record)["entry"]]));
710
+ }
711
+ (entries)["forEach"](((id) => {
712
+ {
713
+ const __eliscript_value_90 = (by_id)["get"](id);
714
+ {
715
+ let item = __eliscript_value_90;
716
+ if ((!__eliscript_truthy(item))) {
717
+ ((__eliscript_value_91) => { throw __eliscript_value_91; })(new (globalThis.TypeError)("original Seed entry is outside its authenticated source graph"));
718
+ }
719
+ return (arguments$)["push"](resolve(output, "sources", (item)["filename"]));
720
+ }
721
+ }
722
+ }));
723
+ }
724
+ }
725
+ await (seed_child_output(resolve(source_root, "bin/eliscript-seed-build"), arguments$, source_root, signal, output));
726
+ (await (async (bytes) => {
727
+ return (await (async (manifest) => {
728
+ return (await (async (seen) => {
729
+ return (await (async () => {
730
+ if ((!__eliscript_truthy(((__eliscript_value_92) => (__eliscript_truthy(__eliscript_value_92) ? Array.isArray((manifest)["modules"]) : __eliscript_value_92))(((manifest)["format"] === "eliscript-project"))))) {
731
+ ((__eliscript_value_93) => { throw __eliscript_value_93; })(new (globalThis.Error)("original Seed project manifest is missing"));
732
+ }
733
+ await (writeFile(resolve(output, "seed-project-0.json"), bytes));
734
+ ((index = 0));
735
+ (await (async () => {
736
+ while (__eliscript_numeric_relation("<", index, (((manifest)["modules"]) ?? []).length)) {
737
+ (await (async (emitted) => {
738
+ return (await (async (id) => {
739
+ return (await (async (item) => {
740
+ return (await (async (path) => {
741
+ return (await (async (map) => {
742
+ return (await (async () => {
743
+ ((!__eliscript_truthy((await (async (__eliscript_value_94) => (__eliscript_truthy(__eliscript_value_94) ? (await (async (__eliscript_value_95) => (__eliscript_truthy(__eliscript_value_95) ? (await (async (__eliscript_value_96) => (__eliscript_truthy(__eliscript_value_96) ? (await (async (__eliscript_value_97) => (__eliscript_truthy(__eliscript_value_97) ? (await (async (__eliscript_value_98) => (__eliscript_truthy(__eliscript_value_98) ? ((emitted)["sourceMapDigest"] === execution_digest(await (readFile(map)))) : __eliscript_value_98))(((emitted)["outputDigest"] === execution_digest(await (readFile(path)))))) : __eliscript_value_97))(((emitted)["sourceDigest"] === execution_digest((Buffer)["from"]((item)["source"], "utf8"))))) : __eliscript_value_96))(((emitted)["source"] === (item)["filename"]))) : __eliscript_value_95))((!__eliscript_truthy((seen)["has"](id))))) : __eliscript_value_94))(item)))) ? ((__eliscript_value_99) => { throw __eliscript_value_99; })(new (globalThis.Error)("original Seed project output identity differs from its authenticated graph")) : null);
744
+ (seen)["add"](id);
745
+ return (await (async (alias_id) => {
746
+ return (await (async (alias) => {
747
+ return (await (async () => {
748
+ (((__eliscript_value_100, __eliscript_value_101) => (__eliscript_value_100 !== __eliscript_value_101))(alias_id, id) ? (await (async () => {
749
+ if (__eliscript_truthy(((__eliscript_value_102) => (__eliscript_truthy(__eliscript_value_102) ? __eliscript_value_102 : (fallback((request)["hostSources"], []))["some"](((provider) => {
750
+ return ((provider)["id"] === alias_id);
751
+ }))))((outputs)["has"](alias_id)))) {
752
+ ((__eliscript_value_103) => { throw __eliscript_value_103; })(new (globalThis.TypeError)("original Seed output alias conflicts with its authenticated graph"));
753
+ }
754
+ await (mkdir(resolve(alias, ".."), ({"recursive": true})));
755
+ await (symlink(relative(resolve(alias, ".."), path), alias));
756
+ return await (symlink(relative(resolve(alias, ".."), map), (alias + ".map")));
757
+ })()) : null);
758
+ return (compiled)["push"](({"id": alias_id, "path": alias, "sourceMapPath": (alias + ".map"), "seedPath": id, "seedMapPath": (emitted)["sourceMap"]}));
759
+ })());
760
+ })(resolve(product, alias_id)));
761
+ })((item)["id"]));
762
+ })());
763
+ })(resolve(product, seed_relative_path((emitted)["sourceMap"]))));
764
+ })(resolve(product, id)));
765
+ })((outputs)["get"](id)));
766
+ })(seed_relative_path((emitted)["output"])));
767
+ })(((manifest)["modules"])[index]));
768
+ ((index = (index + 1)));
769
+ }
770
+ return null;
771
+ })());
772
+ if ((!__eliscript_truthy((compiled)["some"](((item) => {
773
+ return ((item)["id"] === (record)["entry"]);
774
+ }))))) {
775
+ return ((__eliscript_value_104) => { throw __eliscript_value_104; })(new (globalThis.Error)("original Seed project did not emit its declared entry"));
776
+ } else {
777
+ return null;
778
+ }
779
+ })());
780
+ })(new (globalThis.Set)()));
781
+ })(JSON.parse(__eliscript_at_direct(bytes, "toString", "utf8"))));
782
+ })(await (readFile(resolve(product, "eliscript-project.json")))));
783
+ return compiled;
784
+ })());
785
+ })(["--no-cache", "--root", resolve(output, "sources"), "--out-dir", product]));
786
+ })([]));
787
+ })(0));
788
+ })(new (globalThis.Map)()));
789
+ })(new (globalThis.Map)()));
790
+ })(new (globalThis.Map)()));
791
+ })((record)["request"]));
792
+ })((record)["modules"]));
793
+ }
794
+ function seed_host_entry_ids(record) {
795
+ {
796
+ const __eliscript_value_105 = new (globalThis.Map)();
797
+ const __eliscript_value_106 = new (globalThis.Map)();
798
+ const __eliscript_value_107 = new (globalThis.Map)();
799
+ {
800
+ let by_id = __eliscript_value_105;
801
+ let by_file = __eliscript_value_106;
802
+ let outputs = __eliscript_value_107;
803
+ ((record)["modules"])["forEach"](((item) => {
804
+ (by_id)["set"]((item)["id"], item);
805
+ (by_file)["set"]((item)["filename"], item);
806
+ return (outputs)["set"]((((item)["filename"])["slice"](0, -4) + ".mjs"), item);
807
+ }));
808
+ if ((((record)["request"])["portableEntries"] === undefined)) {
809
+ return Array.from(new (globalThis.Set)(seed_host_source_entries(record, by_id, by_file, outputs)));
810
+ } else {
811
+ return [];
812
+ }
813
+ }
814
+ }
815
+ }
816
+ async function seed_cached_source_graph(record, configuration, output, product, source_root, signal, cache) {
817
+ return (await (async (identity) => {
818
+ return (await (async (key) => {
819
+ return (await (async (origin) => {
820
+ return (await (async (origin_product) => {
821
+ return (await (async () => {
822
+ if ((!__eliscript_truthy((cache)["has"](key)))) {
823
+ (cache)["set"](key, ((async () => {
824
+ await (mkdir(origin_product, ({"recursive": true})));
825
+ return (await (async (modules) => {
826
+ return (await (async (files) => {
827
+ return (await (async (index) => {
828
+ return (await (async () => {
829
+ (await (async () => {
830
+ while (__eliscript_numeric_relation("<", index, ((modules) ?? []).length)) {
831
+ (await (async (module) => {
832
+ return (await (async (names, position) => {
833
+ return (await (async () => {
834
+ while (__eliscript_numeric_relation("<", position, ((names) ?? []).length)) {
835
+ (await (async (path) => {
836
+ return ((bytes) => {
837
+ return (files)["push"](({"path": path, "bytes": ((bytes) ?? []).length, "sha256": execution_digest(bytes)}));
838
+ })(await (readFile(resolve(origin_product, path))));
839
+ })((names)[position]));
840
+ ((position = (position + 1)));
841
+ }
842
+ return null;
843
+ })());
844
+ })([(module)["seedPath"], (module)["seedMapPath"]], 0));
845
+ })((modules)[index]));
846
+ ((index = (index + 1)));
847
+ }
848
+ return null;
849
+ })());
850
+ return ({"identity": identity, "directory": origin_product, "modules": modules, "files": files});
851
+ })());
852
+ })(0));
853
+ })([]));
854
+ })(await (seed_authenticated_source_graph(record, origin, origin_product, source_root, signal))));
855
+ }))());
856
+ }
857
+ return (await (async (compiled) => {
858
+ return (await (async (files) => {
859
+ return (await (async (actual) => {
860
+ return (await (async (index) => {
861
+ return (await (async () => {
862
+ (await (async () => {
863
+ while (__eliscript_numeric_relation("<", index, (((record)["modules"]) ?? []).length)) {
864
+ (await (async (module) => {
865
+ return (await (async (path) => {
866
+ return (await (async () => {
867
+ await (mkdir(resolve(path, ".."), ({"recursive": true})));
868
+ return await (writeFile(path, (module)["source"]));
869
+ })());
870
+ })(resolve(output, "sources", seed_relative_path((module)["filename"]))));
871
+ })(((record)["modules"])[index]));
872
+ ((index = (index + 1)));
873
+ }
874
+ return null;
875
+ })());
876
+ ((index = 0));
877
+ (await (async () => {
878
+ while (__eliscript_numeric_relation("<", index, ((files) ?? []).length)) {
879
+ (await (async (file) => {
880
+ return (await (async (id) => {
881
+ return (await (async (source) => {
882
+ return (await (async (destination) => {
883
+ return (await (async (bytes) => {
884
+ return (await (async () => {
885
+ if ((!((((bytes) ?? []).length === (file)["bytes"]) && (execution_digest(bytes) === (file)["sha256"])))) {
886
+ ((__eliscript_value_108) => { throw __eliscript_value_108; })(new (globalThis.Error)("independent Seed cached compiler product identity differs"));
887
+ }
888
+ await (mkdir(resolve(destination, ".."), ({"recursive": true})));
889
+ await (copyFile(source, destination, (constants)["COPYFILE_EXCL"]));
890
+ return ((!(execution_digest(await (readFile(destination))) === (file)["sha256"])) ? ((__eliscript_value_109) => { throw __eliscript_value_109; })(new (globalThis.Error)("independent Seed copied compiler product identity differs")) : null);
891
+ })());
892
+ })(await (readFile(source))));
893
+ })(resolve(product, id)));
894
+ })(resolve((compiled)["directory"], id)));
895
+ })(seed_relative_path((file)["path"])));
896
+ })((files)[index]));
897
+ ((index = (index + 1)));
898
+ }
899
+ return null;
900
+ })());
901
+ ((index = 0));
902
+ (await (async () => {
903
+ while (__eliscript_numeric_relation("<", index, (((compiled)["modules"]) ?? []).length)) {
904
+ (await (async (module) => {
905
+ return (await (async (id) => {
906
+ return (await (async (path) => {
907
+ return (await (async (map) => {
908
+ return (await (async () => {
909
+ (((__eliscript_value_110, __eliscript_value_111) => (__eliscript_value_110 !== __eliscript_value_111))(id, (module)["seedPath"]) ? (await (async () => {
910
+ await (mkdir(resolve(path, ".."), ({"recursive": true})));
911
+ await (symlink(relative(resolve(path, ".."), resolve(product, (module)["seedPath"])), path));
912
+ return await (symlink(relative(resolve(path, ".."), resolve(product, (module)["seedMapPath"])), map));
913
+ })()) : null);
914
+ return (actual)["push"](({"id": id, "path": path, "sourceMapPath": map}));
915
+ })());
916
+ })((path + ".map")));
917
+ })(resolve(product, id)));
918
+ })(seed_relative_path((module)["id"])));
919
+ })(((compiled)["modules"])[index]));
920
+ ((index = (index + 1)));
921
+ }
922
+ return null;
923
+ })());
924
+ await (writeFile(resolve(output, "seed-product.json"), (JSON.stringify(({"producer": "emacs-seed", "sourceIdentity": identity, "compiledDirectory": (compiled)["directory"], "files": files}), null, 2) + "\n")));
925
+ return actual;
926
+ })());
927
+ })(0));
928
+ })([]));
929
+ })((compiled)["files"]));
930
+ })(await ((cache)["get"](key))));
931
+ })());
932
+ })(resolve(origin, "product")));
933
+ })(resolve((configuration)["directory"], "seed-compiled-cache", identity)));
934
+ })(("compiled:" + identity)));
935
+ })(compilerMetadataDigest(({"entry": (record)["entry"], "modules": (record)["modules"], "request": (record)["request"], "hostEntries": seed_host_entry_ids(record), "sourceRoot": source_root, "emacs": (configuration)["emacs"]}))));
936
+ }
937
+ async function seed_project_output(group, plan, record, output, product, source_root, signal, ordinal) {
938
+ return (await (async (root) => {
939
+ return (await (async (arguments$) => {
940
+ return (await (async (pruned) => {
941
+ return (await (async (inputs) => {
942
+ return (await (async (allowed) => {
943
+ return (await (async (modules) => {
944
+ return (await (async () => {
945
+ if (__eliscript_truthy(pruned)) {
946
+ ((plan)["portableEntries"])["forEach"](((name) => {
947
+ return (arguments$)["push"]("--portable", name);
948
+ }));
949
+ }
950
+ (inputs)["forEach"](((item) => {
951
+ if (((!__eliscript_truthy(pruned)) || ((item)["id"] === (record)["entry"]))) {
952
+ return (arguments$)["push"](resolve(output, "sources", (item)["filename"]));
953
+ } else {
954
+ return null;
955
+ }
956
+ }));
957
+ await (seed_child_output(resolve(source_root, "bin/eliscript-seed-build"), arguments$, source_root, signal, output));
958
+ (await (async (bytes) => {
959
+ return (await (async (manifest) => {
960
+ return (await (async () => {
961
+ if ((!__eliscript_truthy(((__eliscript_value_112) => (__eliscript_truthy(__eliscript_value_112) ? Array.isArray((manifest)["modules"]) : __eliscript_value_112))(((manifest)["format"] === "eliscript-project"))))) {
962
+ ((__eliscript_value_113) => { throw __eliscript_value_113; })(new (globalThis.Error)("original Seed project manifest is missing"));
963
+ }
964
+ await (writeFile(resolve(output, (String("seed-project-") + String(ordinal) + String(".json"))), bytes));
965
+ ((manifest)["modules"])["forEach"](((module) => {
966
+ if ((!__eliscript_truthy((allowed)["has"]((module)["output"])))) {
967
+ return ((__eliscript_value_114) => { throw __eliscript_value_114; })(new (globalThis.Error)("original Seed project emitted an undeclared module"));
968
+ } else {
969
+ return null;
970
+ }
971
+ }));
972
+ return (await (async (records, index) => {
973
+ return (await (async () => {
974
+ while (__eliscript_numeric_relation("<", index, ((records) ?? []).length)) {
975
+ (await (async (item) => {
976
+ return (await (async (id) => {
977
+ return (await (async (path) => {
978
+ return (await (async (map) => {
979
+ return (await (async () => {
980
+ ((!(await (async (__eliscript_value_115) => (__eliscript_truthy(__eliscript_value_115) ? (await (async (__eliscript_value_116) => (__eliscript_truthy(__eliscript_value_116) ? (execution_digest(await (readFile(map))) === (item)["sourceMapDigest"]) : __eliscript_value_116))((execution_digest(await (readFile(path))) === (item)["outputDigest"]))) : __eliscript_value_115))(((item)["source"] === (String((id)["slice"](0, -4)) + String(".eli")))))) ? ((__eliscript_value_117) => { throw __eliscript_value_117; })(new (globalThis.Error)("original Seed project output identity differs")) : null);
981
+ return (modules)["push"](({"id": id, "path": path, "sourceMapPath": map}));
982
+ })());
983
+ })(resolve(product, (item)["sourceMap"])));
984
+ })(resolve(product, id)));
985
+ })((item)["output"]));
986
+ })((records)[index]));
987
+ ((index = (index + 1)));
988
+ }
989
+ return null;
990
+ })());
991
+ })((manifest)["modules"], 0));
992
+ })());
993
+ })(JSON.parse(__eliscript_at_direct(bytes, "toString", "utf8"))));
994
+ })(await (readFile(resolve(product, "eliscript-project.json")))));
995
+ return modules;
996
+ })());
997
+ })([]));
998
+ })(new (globalThis.Set)((inputs)["map"](((item) => {
999
+ return (item)["id"];
1000
+ })))));
1001
+ })((group)["records"]));
1002
+ })((plan)["pruned"]));
1003
+ })(["--no-cache", "--root", root, "--out-dir", product]));
1004
+ })(resolve(output, "sources", (group)["prefix"])));
1005
+ }
1006
+ async function execute_seed_program(record, configuration, original_host, key, cache) {
1007
+ return (await (async (original_record) => {
1008
+ return (await (async (record) => {
1009
+ return (await (async (source_root) => {
1010
+ return (await (async (directory) => {
1011
+ return (await (async (signal) => {
1012
+ return (await (async (output) => {
1013
+ return (await (async (product) => {
1014
+ return (await (async (modules) => {
1015
+ return (await (async (records) => {
1016
+ return (await (async (index) => {
1017
+ return (await (async (authenticated) => {
1018
+ return (await (async (plan) => {
1019
+ return (await (async (completed) => {
1020
+ return (await (async (compiled) => {
1021
+ return (await (async () => {
1022
+ await (mkdir(product, ({"recursive": true})));
1023
+ (__eliscript_truthy(authenticated) ? (await (async () => {
1024
+ ((modules = await (seed_cached_source_graph(record, configuration, output, product, source_root, signal, cache))));
1025
+ return ((index = ((records) ?? []).length));
1026
+ })()) : null);
1027
+ (__eliscript_truthy(plan) ? (await (async () => {
1028
+ (await (async () => {
1029
+ while (__eliscript_numeric_relation("<", index, ((records) ?? []).length)) {
1030
+ (await (async (item) => {
1031
+ return (await (async (input) => {
1032
+ return (await (async () => {
1033
+ await (mkdir(resolve(input, ".."), ({"recursive": true})));
1034
+ return await (writeFile(input, (item)["source"]));
1035
+ })());
1036
+ })(resolve(output, "sources", (item)["filename"])));
1037
+ })((records)[index]));
1038
+ ((index = (index + 1)));
1039
+ }
1040
+ return null;
1041
+ })());
1042
+ return ((index = 0));
1043
+ })()) : null);
1044
+ (await (async () => {
1045
+ while (__eliscript_numeric_relation("<", index, ((records) ?? []).length)) {
1046
+ (await (async (item) => {
1047
+ return (await (async (input) => {
1048
+ return (await (async (path) => {
1049
+ return (await (async (group) => {
1050
+ return (await (async (project) => {
1051
+ return (__eliscript_truthy(((__eliscript_value_120) => (__eliscript_truthy(__eliscript_value_120) ? ((__eliscript_value_121) => (__eliscript_truthy(__eliscript_value_121) ? (!(group === (plan)["entryGroup"])) : __eliscript_value_121))((plan)["pruned"]) : __eliscript_value_120))(plan)) ? null : (__eliscript_truthy(project) ? ((!__eliscript_truthy((completed)["has"](group))) ? (await (async () => {
1052
+ ((emitted) => {
1053
+ return (emitted)["forEach"](((module) => {
1054
+ return (compiled)["set"]((module)["id"], module);
1055
+ }));
1056
+ })(await (seed_project_output(group, plan, record, output, product, source_root, signal, (completed)["size"])));
1057
+ return (completed)["add"](group);
1058
+ })()) : null) : (await (async () => {
1059
+ ((!__eliscript_truthy(plan)) ? (await (async () => {
1060
+ await (mkdir(resolve(input, ".."), ({"recursive": true})));
1061
+ return await (writeFile(input, (item)["source"]));
1062
+ })()) : null);
1063
+ await (mkdir(resolve(path, ".."), ({"recursive": true})));
1064
+ (await (async (arguments$) => {
1065
+ if ((!(field((record)["request"], "portableEntries") == null))) {
1066
+ (((record)["request"])["portableEntries"])["forEach"](((name) => {
1067
+ return (arguments$)["push"]("--portable", name);
1068
+ }));
1069
+ }
1070
+ (arguments$)["push"](input);
1071
+ return await (seed_child_output(resolve(source_root, "bin/eliscript-seed"), arguments$, source_root, signal, output));
1072
+ })(["--source-map", "--output", path]));
1073
+ return (compiled)["set"]((item)["id"], ({"id": (item)["id"], "path": path}));
1074
+ })())));
1075
+ })(((__eliscript_value_118) => (__eliscript_truthy(__eliscript_value_118) ? ((__eliscript_value_119) => (__eliscript_truthy(__eliscript_value_119) ? __eliscript_value_119 : __eliscript_numeric_relation(">", (((group)["records"]) ?? []).length, 1)))((plan)["pruned"]) : __eliscript_value_118))(group)));
1076
+ })((__eliscript_truthy(plan) ? ((plan)["byId"])["get"]((item)["id"]) : null)));
1077
+ })(resolve(product, (item)["id"])));
1078
+ })(resolve(output, "sources", (item)["filename"])));
1079
+ })((records)[index]));
1080
+ ((index = (index + 1)));
1081
+ }
1082
+ return null;
1083
+ })());
1084
+ if ((!__eliscript_truthy(authenticated))) {
1085
+ (records)["forEach"](((item) => {
1086
+ {
1087
+ const __eliscript_value_122 = (compiled)["get"]((item)["id"]);
1088
+ {
1089
+ let module = __eliscript_value_122;
1090
+ if (__eliscript_truthy(module)) {
1091
+ return (modules)["push"](module);
1092
+ } else {
1093
+ return null;
1094
+ }
1095
+ }
1096
+ }
1097
+ }));
1098
+ }
1099
+ return (await (async (artifact) => {
1100
+ return (await (async (options) => {
1101
+ return (await (async (context) => {
1102
+ return (((field(field(record, "execution"), "kind") === "compiler-session-program") || (!__eliscript_truthy(original_host_enabled(field(field(record, "execution"), "compilerGenerations"))))) ? await (executeCompilerCorpusRecord(context)) : (await (async (seed) => {
1103
+ return (await (async (session) => {
1104
+ return (await (async (failed) => {
1105
+ return (await (async () => {
1106
+ try {
1107
+ return await (executeCompilerCorpusRecord(copy(context, ({"session": session}))));
1108
+ } catch (error) {
1109
+ ((failed = true));
1110
+ return ((__eliscript_value_123) => { throw __eliscript_value_123; })(error);
1111
+ } finally {
1112
+ (await (async () => {
1113
+ try {
1114
+ return await ((session)["close"]());
1115
+ } catch (error) {
1116
+ if ((!__eliscript_truthy(failed))) {
1117
+ return ((__eliscript_value_124) => { throw __eliscript_value_124; })(error);
1118
+ } else {
1119
+ return null;
1120
+ }
1121
+ }
1122
+ })());
1123
+ }
1124
+ })());
1125
+ })(false));
1126
+ })(await (openCompilerArtifact(seed, (configuration)["sessionOptions"]))));
1127
+ })(await (buildIndependentCompiler(({"host": "javascript", "sourceRoot": source_root, "outputRoot": resolve(output, "independent-seed-compiler"), "profile": fallback((configuration)["profile"], "small"), "budget": (configuration)["budget"], "memory": (configuration)["memory"], "auto": (configuration)["auto"], "nativeTarget": (configuration)["nativeTarget"], "retainIR": true, "debug": true, "signal": signal}))))));
1128
+ })(({"artifact": artifact, "record": record, "target": "javascript", "independentSeedProgram": true, "sourceAssets": (configuration)["sourceAssets"], "sourceRoot": source_root, "signal": signal, "options": options, "directory": output, "archiveProduct": (async (value, ...arguments$) => {
1129
+ return (await (async (name, target) => {
1130
+ return await (archiveProduct(value, target, resolve(output, name)));
1131
+ })((((((arguments$) ?? []).length === 0) || ((arguments$)[0] === undefined)) ? "product" : (arguments$)[0]), ((__eliscript_numeric_relation("<", ((arguments$) ?? []).length, 2) || ((arguments$)[1] === undefined)) ? "javascript" : (arguments$)[1])));
1132
+ })})));
1133
+ })(({"programHost": original_host, "node": (configuration)["node"], "bun": (configuration)["bun"], "profile": (configuration)["profile"], "budget": (configuration)["budget"], "memory": (configuration)["memory"], "auto": (configuration)["auto"], "nativeTarget": (configuration)["nativeTarget"], "sessionOptions": (configuration)["sessionOptions"], "functionalRuntimeProfile": (configuration)["functionalRuntimeProfile"], "bootstrapManifestPath": (configuration)["bootstrapManifestPath"]})));
1134
+ })(({"target": "javascript", "entry": (record)["entry"], "path": resolve(product, (record)["entry"]), "directory": product, "modules": modules})));
1135
+ })());
1136
+ })(new (globalThis.Map)()));
1137
+ })(new (globalThis.Set)()));
1138
+ })(((!__eliscript_truthy(authenticated)) ? seed_project_groups(record) : null)));
1139
+ })((!(original_record === record))));
1140
+ })(0));
1141
+ })((record)["modules"]));
1142
+ })([]));
1143
+ })(resolve(output, "product")));
1144
+ })(resolve(directory, execution_digest(key))));
1145
+ })((configuration)["signal"]));
1146
+ })((configuration)["directory"]));
1147
+ })((configuration)["sourceRoot"]));
1148
+ })(seed_authenticated_record(record, configuration)));
1149
+ })(record));
1150
+ }
1151
+ function createOriginalSeedOracle(...arguments$) {
1152
+ {
1153
+ let options = (((((arguments$) ?? []).length === 0) || ((arguments$)[0] === undefined)) ? ({}) : (arguments$)[0]);
1154
+ let configuration = ({});
1155
+ let keys = ["sourceRoot", "emacs", "signal", "directory", "node", "bun", "programHost", "profile", "budget", "memory", "auto", "nativeTarget", "sessionOptions", "sourceAssets", "literalSources", "literalSourceIdentity", "programCache"];
1156
+ if ((options == null)) {
1157
+ ((__eliscript_value_125) => { throw __eliscript_value_125; })(new (globalThis.TypeError)("original Seed oracle options must be an object"));
1158
+ }
1159
+ (keys)["forEach"](((key) => {
1160
+ return Object.defineProperty(configuration, key, ({"value": (options)[key], "enumerable": true, "configurable": true}));
1161
+ }));
1162
+ if (__eliscript_truthy(Object.hasOwn(options, "bootstrapManifestPath"))) {
1163
+ Object.defineProperty(configuration, "bootstrapManifestPath", ({"value": (options)["bootstrapManifestPath"], "enumerable": true}));
1164
+ }
1165
+ if (__eliscript_truthy(Object.hasOwn(options, "functionalRuntimeProfile"))) {
1166
+ Object.defineProperty(configuration, "functionalRuntimeProfile", ({"value": (options)["functionalRuntimeProfile"], "enumerable": true}));
1167
+ }
1168
+ (["sourceAssets", "literalSources", "literalSourceIdentity"])["forEach"](((key) => {
1169
+ {
1170
+ const __eliscript_value_126 = (configuration)[key];
1171
+ {
1172
+ let values = __eliscript_value_126;
1173
+ if (__eliscript_truthy(Array.isArray(values))) {
1174
+ return Object.defineProperty(configuration, key, ({"value": Object.freeze((values)["map"](((value) => {
1175
+ return Object.freeze(Object.assign(({}), value));
1176
+ }))), "enumerable": true}));
1177
+ } else {
1178
+ return null;
1179
+ }
1180
+ }
1181
+ }
1182
+ }));
1183
+ {
1184
+ let original = (legacy)["createOriginalSeedOracle"](configuration);
1185
+ let shared_cache = (!((configuration)["programCache"] === undefined));
1186
+ let suites = (((configuration)["programCache"] === undefined) ? new (globalThis.Map)() : (configuration)["programCache"]);
1187
+ let binding = compilerMetadataDigest(({"sourceRoot": (configuration)["sourceRoot"], "emacs": (configuration)["emacs"], "bootstrapManifestPath": (configuration)["bootstrapManifestPath"], "sourceAssets": (configuration)["sourceAssets"], "literalSources": (configuration)["literalSources"], "literalSourceIdentity": (configuration)["literalSourceIdentity"]}));
1188
+ (() => {
1189
+ try {
1190
+ return __eliscript_at(Reflect, "apply")(((globalThis.Map)["prototype"])["has"], suites, [null]);
1191
+ } catch (error) {
1192
+ return ((__eliscript_value_127) => { throw __eliscript_value_127; })(new (globalThis.TypeError)("original Seed program cache must be a Map"));
1193
+ }
1194
+ })();
1195
+ return (async (context) => {
1196
+ return (await (async (record) => {
1197
+ return (await (async (target) => {
1198
+ return ((!(field(field(record, "expected"), "kind") === "seed-program")) ? await (original(context)) : (await (async () => {
1199
+ if ((!(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })((configuration)["directory"]) === "string"))) {
1200
+ ((__eliscript_value_128) => { throw __eliscript_value_128; })(new (globalThis.TypeError)("original program Seed oracle requires an explicit evidence directory"));
1201
+ }
1202
+ return (await (async (host) => {
1203
+ return (await (async (key) => {
1204
+ return (await (async () => {
1205
+ if ((!__eliscript_truthy((suites)["has"](key)))) {
1206
+ (suites)["set"](key, execute_seed_program(record, configuration, host, key, suites));
1207
+ }
1208
+ return await ((suites)["get"](key));
1209
+ })());
1210
+ })(("program:" + compilerMetadataDigest(({"kind": "original-seed-program", "record": record, "host": host, "binding": binding, "configuration": (__eliscript_truthy(shared_cache) ? ({"node": (configuration)["node"], "bun": (configuration)["bun"], "profile": (configuration)["profile"], "budget": (configuration)["budget"], "memory": (configuration)["memory"], "auto": (configuration)["auto"], "nativeTarget": (configuration)["nativeTarget"], "sessionOptions": (configuration)["sessionOptions"]}) : null)})))));
1211
+ })(seed_original_host(record, configuration)));
1212
+ })()));
1213
+ })((context)["target"]));
1214
+ })((context)["record"]));
1215
+ });
1216
+ }
1217
+ }
1218
+ }
1219
+ const original_host_tool_files = ["tools/backends/build.mjs", "tools/backends/managed-runtime.mjs", "tools/backends/native-managed-runtime.mjs", "tests/helpers/managed-literal-nth-node-selfhosted.mjs"];
1220
+ __eliscript_tdz_ready_3 = true;
1221
+ const original_host_tool_maintained = "tests/eliscript/managed-literal-nth-node.eli";
1222
+ __eliscript_tdz_ready_4 = true;
1223
+ function projection_fail() {
1224
+ return ((__eliscript_value_129) => { throw __eliscript_value_129; })(new (globalThis.TypeError)("original literal host tool projection identity differs"));
1225
+ }
1226
+ async function projection_source(root, real_root, file, hash) {
1227
+ return (await (async (path) => {
1228
+ return (await (async (details) => {
1229
+ return (await (async (canonical) => {
1230
+ return (await (async (part) => {
1231
+ return (await (async () => {
1232
+ ((!__eliscript_truthy((await (async (__eliscript_value_130) => (__eliscript_truthy(__eliscript_value_130) ? (await (async (__eliscript_value_131) => (__eliscript_truthy(__eliscript_value_131) ? (await (async (__eliscript_value_132) => (__eliscript_truthy(__eliscript_value_132) ? (await (async (__eliscript_value_133) => (__eliscript_truthy(__eliscript_value_133) ? (await (async (__eliscript_value_134) => (__eliscript_truthy(__eliscript_value_134) ? (await (async (__eliscript_value_135) => (__eliscript_truthy(__eliscript_value_135) ? (execution_digest(await (readFile(path))) === hash) : __eliscript_value_135))((canonical === resolve(real_root, file)))) : __eliscript_value_134))((!__eliscript_truthy((part)["startsWith"]((".." + sep)))))) : __eliscript_value_133))((!(part === "..")))) : __eliscript_value_132))((!__eliscript_truthy(isAbsolute(part))))) : __eliscript_value_131))((!__eliscript_truthy((details)["isSymbolicLink"]())))) : __eliscript_value_130))((details)["isFile"]())))) ? projection_fail() : null);
1233
+ return canonical;
1234
+ })());
1235
+ })(relative(real_root, canonical)));
1236
+ })(await (realpath(path))));
1237
+ })(await (lstat(path))));
1238
+ })(resolve(root, file)));
1239
+ }
1240
+ async function project_original_host_tools(context) {
1241
+ return (await (async (record) => {
1242
+ return (await (async (execution) => {
1243
+ return (await (async (projection) => {
1244
+ return (await (async (files) => {
1245
+ return (await (async (assets) => {
1246
+ return (await (async (source_root) => {
1247
+ return (await (async (root_real) => {
1248
+ return (await (async (seen) => {
1249
+ return (await (async (approved) => {
1250
+ return (await (async () => {
1251
+ if ((!__eliscript_truthy(((__eliscript_value_136) => (__eliscript_truthy(__eliscript_value_136) ? ((__eliscript_value_137) => (__eliscript_truthy(__eliscript_value_137) ? ((__eliscript_value_138) => (__eliscript_truthy(__eliscript_value_138) ? Array.isArray(assets) : __eliscript_value_138))((((files) ?? []).length === (((__eliscript_tdz_read_3())) ?? []).length)) : __eliscript_value_137))(Array.isArray(files)) : __eliscript_value_136))((field(projection, "kind") === "literal-runtime-host-tools"))))) {
1252
+ projection_fail();
1253
+ }
1254
+ (await (async (index) => {
1255
+ return (await (async () => {
1256
+ while (__eliscript_numeric_relation("<", index, ((files) ?? []).length)) {
1257
+ (await (async (item) => {
1258
+ return (await (async (id) => {
1259
+ return (await (async (hash) => {
1260
+ return (await (async (matches) => {
1261
+ return (await (async () => {
1262
+ if ((!__eliscript_truthy(((__eliscript_value_139) => (__eliscript_truthy(__eliscript_value_139) ? ((__eliscript_value_140) => (__eliscript_truthy(__eliscript_value_140) ? ((__eliscript_value_141) => (__eliscript_truthy(__eliscript_value_141) ? ((__eliscript_value_142) => (__eliscript_truthy(__eliscript_value_142) ? ((__eliscript_value_143) => (__eliscript_truthy(__eliscript_value_143) ? ((((matches) ?? []).length === 1) && (((matches)[0])["sourceSha256"] === hash)) : __eliscript_value_143))((new (globalThis.RegExp)("^[0-9a-f]{64}$"))["test"](hash)) : __eliscript_value_142))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(hash) === "string")) : __eliscript_value_141))((!__eliscript_truthy((seen)["has"](id)))) : __eliscript_value_140))((field(item, "sourceFile") === id)) : __eliscript_value_139))(((__eliscript_tdz_read_3()))["includes"](id))))) {
1263
+ projection_fail();
1264
+ }
1265
+ (seen)["add"](id);
1266
+ return (approved)["push"](({"id": id, "hash": hash, "path": await (projection_source(source_root, root_real, id, hash))}));
1267
+ })());
1268
+ })((assets)["filter"](((asset) => {
1269
+ return ((asset)["file"] === id);
1270
+ }))));
1271
+ })(field(item, "sourceSha256")));
1272
+ })(field(item, "id")));
1273
+ })((files)[index]));
1274
+ ((index = (index + 1)));
1275
+ }
1276
+ return null;
1277
+ })());
1278
+ })(0));
1279
+ (await (async (matches) => {
1280
+ if ((!(((matches) ?? []).length === 1))) {
1281
+ projection_fail();
1282
+ }
1283
+ return (await (async (hash) => {
1284
+ if ((!__eliscript_truthy(((__eliscript_value_144) => (__eliscript_truthy(__eliscript_value_144) ? (new (globalThis.RegExp)("^[0-9a-f]{64}$"))["test"](hash) : __eliscript_value_144))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(hash) === "string"))))) {
1285
+ projection_fail();
1286
+ }
1287
+ return await (projection_source(source_root, root_real, (__eliscript_tdz_read_4()), hash));
1288
+ })(((matches)[0])["sourceSha256"]));
1289
+ })((assets)["filter"](((asset) => {
1290
+ return ((asset)["file"] === (__eliscript_tdz_read_4()));
1291
+ }))));
1292
+ (await (async (artifact) => {
1293
+ return (await (async (directory) => {
1294
+ return (await (async (details) => {
1295
+ return (await (async (index) => {
1296
+ return (await (async () => {
1297
+ if ((!__eliscript_truthy(((__eliscript_value_145) => (__eliscript_truthy(__eliscript_value_145) ? (!__eliscript_truthy((details)["isSymbolicLink"]())) : __eliscript_value_145))((details)["isDirectory"]())))) {
1298
+ projection_fail();
1299
+ }
1300
+ return (await (async () => {
1301
+ while (__eliscript_numeric_relation("<", index, ((approved) ?? []).length)) {
1302
+ (await (async (item) => {
1303
+ return (await (async (segments) => {
1304
+ return (await (async (parent) => {
1305
+ return (await (async (position) => {
1306
+ return (await (async () => {
1307
+ (await (async () => {
1308
+ while (__eliscript_numeric_relation("<", position, __eliscript_numeric_decrement(((segments) ?? []).length))) {
1309
+ ((parent = join(parent, (segments)[position])));
1310
+ (await (async () => {
1311
+ try {
1312
+ return await (mkdir(parent));
1313
+ } catch (error) {
1314
+ if ((!((error)["code"] === "EEXIST"))) {
1315
+ return ((__eliscript_value_146) => { throw __eliscript_value_146; })(error);
1316
+ } else {
1317
+ return null;
1318
+ }
1319
+ }
1320
+ })());
1321
+ ((details) => {
1322
+ if ((!__eliscript_truthy(((__eliscript_value_147) => (__eliscript_truthy(__eliscript_value_147) ? (!__eliscript_truthy((details)["isSymbolicLink"]())) : __eliscript_value_147))((details)["isDirectory"]())))) {
1323
+ return projection_fail();
1324
+ } else {
1325
+ return null;
1326
+ }
1327
+ })(await (lstat(parent)));
1328
+ ((position = (position + 1)));
1329
+ }
1330
+ return null;
1331
+ })());
1332
+ return (await (async (path) => {
1333
+ return (await (async () => {
1334
+ try {
1335
+ return await (symlink((item)["path"], path, "file"));
1336
+ } catch (error) {
1337
+ if ((!((error)["code"] === "EEXIST"))) {
1338
+ ((__eliscript_value_148) => { throw __eliscript_value_148; })(error);
1339
+ }
1340
+ return (await (async (details) => {
1341
+ return ((!__eliscript_truthy((await (async (__eliscript_value_149) => (__eliscript_truthy(__eliscript_value_149) ? (await (async (__eliscript_value_150) => (__eliscript_truthy(__eliscript_value_150) ? (execution_digest(await (readFile(path))) === (item)["hash"]) : __eliscript_value_150))((await (realpath(path)) === (item)["path"]))) : __eliscript_value_149))((details)["isSymbolicLink"]())))) ? projection_fail() : null);
1342
+ })(await (lstat(path))));
1343
+ }
1344
+ })());
1345
+ })(join(parent, (segments)[__eliscript_numeric_decrement(((segments) ?? []).length)])));
1346
+ })());
1347
+ })(0));
1348
+ })(directory));
1349
+ })(((item)["id"])["split"]("/")));
1350
+ })((approved)[index]));
1351
+ ((index = (index + 1)));
1352
+ }
1353
+ return null;
1354
+ })());
1355
+ })());
1356
+ })(0));
1357
+ })(await (lstat(directory))));
1358
+ })(fallback((artifact)["directory"], resolve((artifact)["path"], ".."))));
1359
+ })((context)["artifact"]));
1360
+ return context;
1361
+ })());
1362
+ })([]));
1363
+ })(new (globalThis.Set)()));
1364
+ })(await (realpath(source_root))));
1365
+ })((context)["sourceRoot"]));
1366
+ })(field((record)["original"], "sourceAssets")));
1367
+ })(field(projection, "files")));
1368
+ })((execution)["hostToolProjection"]));
1369
+ })((record)["execution"]));
1370
+ })((context)["record"]));
1371
+ }
1372
+ function copy(...sources) {
1373
+ {
1374
+ const __eliscript_value_151 = ({});
1375
+ const __eliscript_value_152 = 0;
1376
+ {
1377
+ let out = __eliscript_value_151;
1378
+ let index = __eliscript_value_152;
1379
+ while (__eliscript_numeric_relation("<", index, ((sources) ?? []).length)) {
1380
+ {
1381
+ const __eliscript_value_153 = (sources)[index];
1382
+ {
1383
+ let source = __eliscript_value_153;
1384
+ if ((!(source == null))) {
1385
+ {
1386
+ const __eliscript_value_154 = Reflect.ownKeys(globalThis.Object(source));
1387
+ const __eliscript_value_155 = 0;
1388
+ {
1389
+ let keys = __eliscript_value_154;
1390
+ let at = __eliscript_value_155;
1391
+ while (__eliscript_numeric_relation("<", at, ((keys) ?? []).length)) {
1392
+ {
1393
+ let key = (keys)[at];
1394
+ let descriptor = Object.getOwnPropertyDescriptor(source, key);
1395
+ if (__eliscript_truthy((descriptor)["enumerable"])) {
1396
+ Object.defineProperty(out, key, ({"value": (source)[key], "writable": true, "enumerable": true, "configurable": true}));
1397
+ }
1398
+ }
1399
+ ((at = (at + 1)));
1400
+ }
1401
+ }
1402
+ }
1403
+ }
1404
+ }
1405
+ }
1406
+ ((index = (index + 1)));
1407
+ }
1408
+ return out;
1409
+ }
1410
+ }
1411
+ }
1412
+ function compilerCorpusRuntimeAcceptance(record, options) {
1413
+ return compilerCorpusFunctionalResources(record, options);
1414
+ }
1415
+ function prepareCompilerCorpusRuntimeContext(context, acceptance) {
1416
+ if ((acceptance === undefined)) {
1417
+ return context;
1418
+ } else {
1419
+ {
1420
+ let record = (context)["record"];
1421
+ let resources = independentCompilerResources(({"profile": (acceptance)["effectiveRuntimeProfile"]}));
1422
+ let memory = fallback((record)["memory"], (resources)["memory"]);
1423
+ let execution = copy((record)["execution"], ({"runtimeOptions": copy((acceptance)["effectiveRuntimeOptions"])}));
1424
+ return copy(context, ({"options": copy((context)["options"], ({"memory": memory})), "record": copy(record, ({"execution": execution}))}));
1425
+ }
1426
+ }
1427
+ }
1428
+ async function prepareCompilerCorpusSourceMapContext(context) {
1429
+ return (await (async (record) => {
1430
+ return (await (async (execution) => {
1431
+ return (__eliscript_truthy(((__eliscript_value_156) => (__eliscript_truthy(__eliscript_value_156) ? __eliscript_value_156 : (((context)["target"] === "javascript") || ((__eliscript_value_157, __eliscript_value_158) => (__eliscript_value_157 !== __eliscript_value_158))(field(execution, "kind"), "original-program") || (!(field(execution, "compilerSourceMaps") === true)))))(Object.hasOwn(context, "failure"))) ? context : (await (async (options) => {
1432
+ (["sourceAssets", "literalSources", "literalSourceIdentity"])["forEach"](((key) => {
1433
+ if (__eliscript_truthy(Object.hasOwn(context, key))) {
1434
+ return ((options)[key] = (context)[key]);
1435
+ } else {
1436
+ return null;
1437
+ }
1438
+ }));
1439
+ return (await (async (request) => {
1440
+ return ((planned) => {
1441
+ return ((ids) => {
1442
+ return ((available) => {
1443
+ return (() => {
1444
+ if ((!__eliscript_truthy(((__eliscript_value_159) => (__eliscript_truthy(__eliscript_value_159) ? ((__eliscript_value_160) => (__eliscript_truthy(__eliscript_value_160) ? Array.isArray(field(planned, "modules")) : __eliscript_value_160))((field(planned, "version") === 1)) : __eliscript_value_159))((field(planned, "format") === "eliscript-project-plan"))))) {
1445
+ ((__eliscript_value_161) => { throw __eliscript_value_161; })(new (globalThis.TypeError)("original source maps require the selected compiler's actual project plan"));
1446
+ }
1447
+ ((request)["modules"])["forEach"](((module) => {
1448
+ return (available)["set"]((module)["id"], module);
1449
+ }));
1450
+ ((planned)["modules"])["forEach"](((module) => {
1451
+ {
1452
+ const __eliscript_value_162 = (module)["id"];
1453
+ {
1454
+ let id = __eliscript_value_162;
1455
+ if ((!__eliscript_truthy(((__eliscript_value_163) => (__eliscript_truthy(__eliscript_value_163) ? ((__eliscript_value_164) => (__eliscript_truthy(__eliscript_value_164) ? (!__eliscript_truthy((ids)["has"](id))) : __eliscript_value_164))((available)["has"](id)) : __eliscript_value_163))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(id) === "string"))))) {
1456
+ ((__eliscript_value_165) => { throw __eliscript_value_165; })(new (globalThis.TypeError)("original source map plan contains an absent or duplicate source module"));
1457
+ }
1458
+ return (ids)["add"](id);
1459
+ }
1460
+ }
1461
+ }));
1462
+ {
1463
+ let modules = ((request)["modules"])["filter"](((module) => {
1464
+ return (ids)["has"]((module)["id"]);
1465
+ }));
1466
+ let private_request = copy(request, ({"modules": modules}));
1467
+ let private_record = copy(record, ({"modules": modules, "request": private_request}));
1468
+ return copy(context, ({"record": private_record}));
1469
+ }
1470
+ })();
1471
+ })(new (globalThis.Map)());
1472
+ })(new (globalThis.Set)());
1473
+ })(await (((context)["session"])["request"](copy(request, ({"operation": "project-plan"})), ({"signal": (context)["signal"]}))));
1474
+ })(compilerCorpusRequest(record, "javascript", options)));
1475
+ })(copy((context)["options"]))));
1476
+ })(field(record, "execution")));
1477
+ })((context)["record"]));
1478
+ }
1479
+ function value_record(value) {
1480
+ if ((value === undefined)) {
1481
+ return ({"$eliscriptObservation": "undefined"});
1482
+ } else {
1483
+ if ((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "bigint")) {
1484
+ return ({"$eliscriptObservation": "bigint", "decimal": globalThis.String(value)});
1485
+ } else {
1486
+ if (__eliscript_truthy(((__eliscript_value_166) => (__eliscript_truthy(__eliscript_value_166) ? Object.is(value, -0.0) : __eliscript_value_166))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "number")))) {
1487
+ return ({"$eliscriptObservation": "-0"});
1488
+ } else {
1489
+ if (((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "number") && (!__eliscript_truthy(Number.isFinite(value))))) {
1490
+ return ({"$eliscriptObservation": globalThis.String(value)});
1491
+ } else {
1492
+ if (__eliscript_truthy(Array.isArray(value))) {
1493
+ return (value)["map"](value_record);
1494
+ } else {
1495
+ if (((!(value === null)) && (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "object"))) {
1496
+ return Object.fromEntries((Object.entries(value))["map"](((pair) => {
1497
+ return [(pair)[0], value_record((pair)[1])];
1498
+ })));
1499
+ } else {
1500
+ return value;
1501
+ }
1502
+ }
1503
+ }
1504
+ }
1505
+ }
1506
+ }
1507
+ }
1508
+ function diagnostic(error) {
1509
+ {
1510
+ const __eliscript_value_167 = ({"kind": "diagnostic", "name": fallback(field(error, "name"), "Error"), "message": fallback(field(error, "message"), globalThis.String(error))});
1511
+ {
1512
+ let out = __eliscript_value_167;
1513
+ if ((!(field(error, "eliscriptDiagnostic") === undefined))) {
1514
+ ((out)["diagnostic"] = globalThis.structuredClone((error)["eliscriptDiagnostic"]));
1515
+ }
1516
+ return out;
1517
+ }
1518
+ }
1519
+ }
1520
+ function box(adapter, value) {
1521
+ if ((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "bigint")) {
1522
+ return (adapter)["bigint"](value);
1523
+ } else {
1524
+ if ((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "number")) {
1525
+ return (adapter)["number"](value);
1526
+ } else {
1527
+ if ((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "string")) {
1528
+ return (adapter)["string"](value);
1529
+ } else {
1530
+ if (((value === null) || (!(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "object")))) {
1531
+ return value;
1532
+ } else {
1533
+ {
1534
+ const __eliscript_value_168 = [];
1535
+ {
1536
+ let children = __eliscript_value_168;
1537
+ return (() => {
1538
+ try {
1539
+ if (__eliscript_truthy(Array.isArray(value))) {
1540
+ return (adapter)["sourceArray"]((value)["map"](((item) => {
1541
+ {
1542
+ const __eliscript_value_169 = box(adapter, item);
1543
+ {
1544
+ let child = __eliscript_value_169;
1545
+ (children)["push"](child);
1546
+ return child;
1547
+ }
1548
+ }
1549
+ })));
1550
+ } else {
1551
+ return (adapter)["sourceObject"](Object.fromEntries((Object.entries(value))["map"](((pair) => {
1552
+ {
1553
+ const __eliscript_value_170 = box(adapter, (pair)[1]);
1554
+ {
1555
+ let child = __eliscript_value_170;
1556
+ (children)["push"](child);
1557
+ return [(pair)[0], child];
1558
+ }
1559
+ }
1560
+ }))));
1561
+ }
1562
+ } finally {
1563
+ (children)["forEach"](((child) => {
1564
+ return (adapter)["release"](child);
1565
+ }));
1566
+ }
1567
+ })();
1568
+ }
1569
+ }
1570
+ }
1571
+ }
1572
+ }
1573
+ }
1574
+ }
1575
+ function managed_value(adapter, value) {
1576
+ if (((value === null) || (!(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "object")))) {
1577
+ return value;
1578
+ } else {
1579
+ if (((value)["kind"] === 4)) {
1580
+ return (adapter)["readNumber"](value);
1581
+ } else {
1582
+ if (((value)["kind"] === 5)) {
1583
+ return (adapter)["readString"](value);
1584
+ } else {
1585
+ if (((value)["kind"] === 34)) {
1586
+ return (adapter)["readBigInt"](value);
1587
+ } else {
1588
+ if (((value)["kind"] === 13)) {
1589
+ {
1590
+ const __eliscript_value_171 = ({});
1591
+ const __eliscript_value_172 = (adapter)["objectKeys"](value);
1592
+ const __eliscript_value_173 = 0;
1593
+ {
1594
+ let result = __eliscript_value_171;
1595
+ let keys = __eliscript_value_172;
1596
+ let index = __eliscript_value_173;
1597
+ (() => {
1598
+ try {
1599
+ while (__eliscript_numeric_relation("<", index, (adapter)["length"](keys))) {
1600
+ {
1601
+ let key = (adapter)["get"](keys, index);
1602
+ let child = (adapter)["objectGet"](value, key);
1603
+ (() => {
1604
+ try {
1605
+ return Object.defineProperty(result, (adapter)["readString"](key), ({"value": managed_value(adapter, child), "enumerable": true, "writable": true, "configurable": true}));
1606
+ } finally {
1607
+ (adapter)["release"](child);
1608
+ (adapter)["release"](key);
1609
+ }
1610
+ })();
1611
+ }
1612
+ ((index = (index + 1)));
1613
+ }
1614
+ return null;
1615
+ } finally {
1616
+ (adapter)["release"](keys);
1617
+ }
1618
+ })();
1619
+ return result;
1620
+ }
1621
+ }
1622
+ } else {
1623
+ if (((value)["kind"] === 14)) {
1624
+ return Array.from(({"length": (adapter)["length"](value)}), ((unused, index) => {
1625
+ {
1626
+ const __eliscript_value_174 = (adapter)["get"](value, index);
1627
+ {
1628
+ let child = __eliscript_value_174;
1629
+ return (() => {
1630
+ try {
1631
+ return managed_value(adapter, child);
1632
+ } finally {
1633
+ (adapter)["release"](child);
1634
+ }
1635
+ })();
1636
+ }
1637
+ }
1638
+ }));
1639
+ } else {
1640
+ return ((__eliscript_value_175) => { throw __eliscript_value_175; })(new (globalThis.TypeError)("original corpus observation has an unsupported source value kind"));
1641
+ }
1642
+ }
1643
+ }
1644
+ }
1645
+ }
1646
+ }
1647
+ }
1648
+ function exports_sequence_p(context) {
1649
+ {
1650
+ let record = (context)["record"];
1651
+ let steps = field(record, "steps");
1652
+ let found = false;
1653
+ let valid = true;
1654
+ let index = 0;
1655
+ if (__eliscript_truthy(((__eliscript_value_176) => (__eliscript_truthy(__eliscript_value_176) ? ((__eliscript_value_177) => (__eliscript_truthy(__eliscript_value_177) ? ((__eliscript_value_178) => (__eliscript_truthy(__eliscript_value_178) ? __eliscript_value_178 : ((__eliscript_value_179) => (__eliscript_truthy(__eliscript_value_179) ? __eliscript_value_179 : ((__eliscript_value_180) => (__eliscript_truthy(__eliscript_value_180) ? ((__eliscript_value_181) => (__eliscript_truthy(__eliscript_value_181) ? __eliscript_value_181 : (steps)["some"](((step) => {
1656
+ {
1657
+ let request = field(step, "request");
1658
+ let operation = field(((__eliscript_value_182) => (__eliscript_truthy(__eliscript_value_182) ? Object.getOwnPropertyDescriptor(request, "operation") : __eliscript_value_182))(request), "value");
1659
+ let phased = field(((__eliscript_value_183) => (__eliscript_truthy(__eliscript_value_183) ? Object.getOwnPropertyDescriptor(request, "phased") : __eliscript_value_183))(request), "value");
1660
+ let entries = field(((__eliscript_value_184) => (__eliscript_truthy(__eliscript_value_184) ? Object.getOwnPropertyDescriptor(request, "entries") : __eliscript_value_184))(request), "value");
1661
+ return ((__eliscript_value_185) => (__eliscript_truthy(__eliscript_value_185) ? ((__eliscript_value_186) => (__eliscript_truthy(__eliscript_value_186) ? ((__eliscript_value_187) => (__eliscript_truthy(__eliscript_value_187) ? ((__eliscript_value_188) => (__eliscript_truthy(__eliscript_value_188) ? __eliscript_numeric_relation(">", ((entries) ?? []).length, 0) : __eliscript_value_188))(Array.isArray(entries)) : __eliscript_value_187))((phased === true)) : __eliscript_value_186))((operation === "project")) : __eliscript_value_185))((field(field(step, "artifact"), "kind") === "exports"));
1662
+ }
1663
+ }))))(((record)["id"] === "original-sequence:managed-language-intrinsics-source")) : __eliscript_value_180))(((context)["target"] === "javascript"))))(((context)["target"] === "native"))))(((context)["target"] === "wasm")) : __eliscript_value_177))(Array.isArray(steps)) : __eliscript_value_176))((field(record, "kind") === "sequence")))) {
1664
+ while (__eliscript_truthy(((__eliscript_value_189) => (__eliscript_truthy(__eliscript_value_189) ? __eliscript_numeric_relation("<", index, ((steps) ?? []).length) : __eliscript_value_189))(valid))) {
1665
+ {
1666
+ let step = (steps)[index];
1667
+ let kind = field((step)["artifact"], "kind");
1668
+ if ((kind === "exports")) {
1669
+ ((found = true));
1670
+ }
1671
+ {
1672
+ const __eliscript_value_190 = (step)["request"];
1673
+ {
1674
+ let request = __eliscript_value_190;
1675
+ if (((!(request == null)) && (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(request) === "object"))) {
1676
+ {
1677
+ const __eliscript_value_191 = field(Object.getOwnPropertyDescriptor(request, "operation"), "value");
1678
+ {
1679
+ let operation = __eliscript_value_191;
1680
+ if (__eliscript_truthy((["project", "project-ir", "emit-ir", "emit-memory-ir", "emit-typed-memory"])["includes"](operation))) {
1681
+ ((found = true));
1682
+ }
1683
+ }
1684
+ }
1685
+ }
1686
+ }
1687
+ }
1688
+ if ((((!(kind === undefined)) && (!(kind === "exports"))) || (((__eliscript_value_192, __eliscript_value_193) => (__eliscript_value_192 !== __eliscript_value_193))((context)["target"], "javascript") && (((step)["backendTarget"] === "javascript") || (field((step)["request"], "target") === "javascript"))))) {
1689
+ ((valid = false));
1690
+ }
1691
+ }
1692
+ ((index = (index + 1)));
1693
+ }
1694
+ return ((__eliscript_value_194) => (__eliscript_truthy(__eliscript_value_194) ? found : __eliscript_value_194))(valid);
1695
+ } else {
1696
+ return null;
1697
+ }
1698
+ }
1699
+ }
1700
+ function export_stage(evidence, stage) {
1701
+ return ((evidence)["stage"] = stage);
1702
+ }
1703
+ function export_evidence(evidence) {
1704
+ {
1705
+ const __eliscript_value_195 = ({"stage": (evidence)["stage"], "callIndex": (evidence)["callIndex"], "completedCalls": (evidence)["completedCalls"]});
1706
+ {
1707
+ let out = __eliscript_value_195;
1708
+ if (__eliscript_truthy(Object.hasOwn(evidence, "callName"))) {
1709
+ ((out)["callName"] = (evidence)["callName"]);
1710
+ }
1711
+ if (__eliscript_truthy(Object.hasOwn(evidence, "argumentIndex"))) {
1712
+ ((out)["argumentIndex"] = (evidence)["argumentIndex"]);
1713
+ }
1714
+ return out;
1715
+ }
1716
+ }
1717
+ }
1718
+ function export_failure(evidence) {
1719
+ if ((!__eliscript_truthy(Object.hasOwn(evidence, "failure")))) {
1720
+ return ((evidence)["failure"] = export_evidence(evidence));
1721
+ } else {
1722
+ return null;
1723
+ }
1724
+ }
1725
+ function export_diagnostic(error, evidence) {
1726
+ {
1727
+ const __eliscript_value_196 = diagnostic(error);
1728
+ {
1729
+ let out = __eliscript_value_196;
1730
+ if (__eliscript_truthy(Object.hasOwn(evidence, "stage"))) {
1731
+ ((out)["execution"] = (__eliscript_truthy(Object.hasOwn(evidence, "failure")) ? (evidence)["failure"] : export_evidence(evidence)));
1732
+ }
1733
+ return out;
1734
+ }
1735
+ }
1736
+ }
1737
+ async function managed_runtime(artifact, options, resources, evidence) {
1738
+ export_stage(evidence, "runtime-options");
1739
+ return (await (async (configuration) => {
1740
+ return (await (async (target) => {
1741
+ return ((target === "wasm") ? (await (async () => {
1742
+ export_stage(evidence, "artifact-read");
1743
+ return (await (async (bytes) => {
1744
+ export_stage(evidence, "instantiate");
1745
+ return await (instantiateManagedRuntimeWithHostModules(bytes, configuration));
1746
+ })((globalThis.Uint8Array)["from"](await (readFile((artifact)["path"])))));
1747
+ })()) : (await (async () => {
1748
+ export_stage(evidence, "instantiate");
1749
+ return await (instantiateNativeManagedRuntime((artifact)["path"], ({"typed": (artifact)["typed"], "descriptor": (artifact)["descriptor"]}), copy((resources)["memory"], configuration, ({"nativeTarget": fallback((artifact)["nativeTarget"], fallback((options)["nativeTarget"], (((globalThis.process)["platform"] === "linux") ? "arm64-linux" : "arm64-macos")))}))));
1750
+ })()));
1751
+ })((artifact)["target"]));
1752
+ })(copy((resources)["budget"], ({"auto": (resources)["auto"]}), (options)["runtimeOptions"], (__eliscript_truthy((artifact)["debug"]) ? ({"debug": (artifact)["debug"]}) : null), ({"moduleBaseURL": fallback((options)["moduleBaseURL"], (pathToFileURL((artifact)["path"]))["href"]), "projectModuleBaseURL": fallback((options)["projectModuleBaseURL"], (pathToFileURL((resolve((artifact)["path"], "..") + "/")))["href"]), "projectEntry": (artifact)["entry"], "importModule": fallback((options)["importModule"], field((options)["runtimeOptions"], "importModule")), "hostModules": fallback((options)["hostModules"], field((options)["runtimeOptions"], "hostModules"))}))));
1753
+ }
1754
+ function exported_error_message(adapter, error, evidence) {
1755
+ export_stage(evidence, "error-owner-validation");
1756
+ if (((error === null) || ((!(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(error) === "object")) && (!(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(error) === "function"))))) {
1757
+ return field(error, "message");
1758
+ } else {
1759
+ {
1760
+ const __eliscript_value_197 = false;
1761
+ {
1762
+ let owned = __eliscript_value_197;
1763
+ (() => {
1764
+ try {
1765
+ (adapter)["pin"](error);
1766
+ return ((owned = true));
1767
+ } catch (not_managed) {
1768
+ return null;
1769
+ }
1770
+ })();
1771
+ if ((!__eliscript_truthy(owned))) {
1772
+ export_stage(evidence, "host-error-message");
1773
+ return field(error, "message");
1774
+ } else {
1775
+ {
1776
+ const __eliscript_value_198 = undefined;
1777
+ const __eliscript_value_199 = undefined;
1778
+ const __eliscript_value_200 = false;
1779
+ const __eliscript_value_201 = undefined;
1780
+ const __eliscript_value_202 = false;
1781
+ {
1782
+ let key = __eliscript_value_198;
1783
+ let child = __eliscript_value_199;
1784
+ let complete = __eliscript_value_200;
1785
+ let cleanup = __eliscript_value_201;
1786
+ let cleanup_failed = __eliscript_value_202;
1787
+ return (() => {
1788
+ try {
1789
+ {
1790
+ const __eliscript_value_203 = (((error)["kind"] === 13) ? (() => {
1791
+ export_stage(evidence, "error-key");
1792
+ ((key = (adapter)["string"]("message")));
1793
+ export_stage(evidence, "error-message");
1794
+ ((child = (adapter)["objectGet"](error, key)));
1795
+ export_stage(evidence, "error-value-decode");
1796
+ if (((child === null) || (child === false) || (child === true) || (child === undefined))) {
1797
+ return child;
1798
+ } else {
1799
+ if (__eliscript_truthy(([4, 5, 34])["includes"]((child)["kind"]))) {
1800
+ return managed_value(adapter, child);
1801
+ } else {
1802
+ return (adapter)["toHostValue"](child);
1803
+ }
1804
+ }
1805
+ })() : (() => {
1806
+ export_stage(evidence, "error-decode");
1807
+ {
1808
+ const __eliscript_value_204 = (adapter)["toHostValue"](error);
1809
+ {
1810
+ let value = __eliscript_value_204;
1811
+ export_stage(evidence, "error-message");
1812
+ return field(value, "message");
1813
+ }
1814
+ }
1815
+ })());
1816
+ {
1817
+ let message = __eliscript_value_203;
1818
+ ((complete = true));
1819
+ return message;
1820
+ }
1821
+ }
1822
+ } catch (failure) {
1823
+ export_failure(evidence);
1824
+ return ((__eliscript_value_205) => { throw __eliscript_value_205; })(failure);
1825
+ } finally {
1826
+ export_stage(evidence, "error-release");
1827
+ {
1828
+ const __eliscript_value_206 = 0;
1829
+ const __eliscript_value_207 = [child, key, error, error];
1830
+ {
1831
+ let index = __eliscript_value_206;
1832
+ let values = __eliscript_value_207;
1833
+ while (__eliscript_numeric_relation("<", index, ((values) ?? []).length)) {
1834
+ (() => {
1835
+ try {
1836
+ return (adapter)["release"]((values)[index]);
1837
+ } catch (failure) {
1838
+ if ((!__eliscript_truthy(cleanup_failed))) {
1839
+ return ((cleanup_failed = true), (cleanup = failure));
1840
+ } else {
1841
+ return null;
1842
+ }
1843
+ }
1844
+ })();
1845
+ ((index = (index + 1)));
1846
+ }
1847
+ }
1848
+ }
1849
+ if (__eliscript_truthy(((__eliscript_value_208) => (__eliscript_truthy(__eliscript_value_208) ? cleanup_failed : __eliscript_value_208))(complete))) {
1850
+ ((__eliscript_value_209) => { throw __eliscript_value_209; })(cleanup);
1851
+ }
1852
+ }
1853
+ })();
1854
+ }
1855
+ }
1856
+ }
1857
+ }
1858
+ }
1859
+ }
1860
+ }
1861
+ async function execute_isolated_exports(context, artifact, contract, resources, evidence) {
1862
+ export_stage(evidence, "isolated-child");
1863
+ return (await (async (source_root) => {
1864
+ return (await (async (runner) => {
1865
+ return (await (async (maintained) => {
1866
+ return (await (async (directory) => {
1867
+ return (await (async (input) => {
1868
+ return (await (async (output) => {
1869
+ return (await (async (options) => {
1870
+ return (await (async (original_options) => {
1871
+ return (await (async (saved_artifact) => {
1872
+ return (await (async () => {
1873
+ (["runtimeOptions", "moduleBaseURL", "projectModuleBaseURL", "nativeTarget"])["forEach"](((key) => {
1874
+ if (__eliscript_truthy(Object.hasOwn(original_options, key))) {
1875
+ return ((options)[key] = (original_options)[key]);
1876
+ } else {
1877
+ return null;
1878
+ }
1879
+ }));
1880
+ if (((!((original_options)["importModule"] === undefined)) || (!((original_options)["hostModules"] === undefined)) || (!(field((original_options)["runtimeOptions"], "importModule") === undefined)) || (!(field((original_options)["runtimeOptions"], "hostModules") === undefined)))) {
1881
+ ((__eliscript_value_210) => { throw __eliscript_value_210; })(new (globalThis.TypeError)("isolated export recipes require their original deployed ESM provider graph"));
1882
+ }
1883
+ if (((artifact)["target"] === "native")) {
1884
+ {
1885
+ const __eliscript_value_211 = snapshotNativeManagedRuntimeABI(({"typed": (artifact)["typed"], "descriptor": (artifact)["descriptor"]}));
1886
+ {
1887
+ let abi = __eliscript_value_211;
1888
+ ((saved_artifact)["typed"] = (abi)["typed"]);
1889
+ ((saved_artifact)["descriptor"] = (abi)["descriptor"]);
1890
+ }
1891
+ }
1892
+ }
1893
+ return (await (async (proof) => {
1894
+ if (__eliscript_truthy((context)["transportEvidence"])) {
1895
+ if ((!__eliscript_truthy(((context)["transportEvidence"])["isolatedExports"]))) {
1896
+ (((context)["transportEvidence"])["isolatedExports"] = []);
1897
+ }
1898
+ (((context)["transportEvidence"])["isolatedExports"])["push"](proof);
1899
+ }
1900
+ await (saveCompilerMetadata(input, ({"artifact": saved_artifact, "contract": contract, "resources": resources, "sourceRoot": source_root, "options": options})));
1901
+ await (runOriginalCorpusProcess(fallback((original_options)["node"], fallback(((globalThis.process)["env"])["NODE"], "node")), [resolve(source_root, runner), input, output], ({"directory": directory, "caseId": ((context)["record"])["id"], "target": (artifact)["target"], "sourceIdentity": (context)["sourceIdentity"], "policy": originalCorpusExecutionPolicy(context), "cwd": (context)["directory"], "signal": (context)["signal"]})));
1902
+ return ((result) => {
1903
+ if ((!__eliscript_truthy(((__eliscript_value_212) => (__eliscript_truthy(__eliscript_value_212) ? (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })((result)["failed"]) === "boolean") : __eliscript_value_212))(result)))) {
1904
+ ((__eliscript_value_213) => { throw __eliscript_value_213; })(new (globalThis.Error)("isolated corpus export child did not return its original result"));
1905
+ }
1906
+ if (__eliscript_truthy((result)["evidence"])) {
1907
+ Object.assign(evidence, (result)["evidence"]);
1908
+ }
1909
+ if ((!__eliscript_truthy((result)["failed"]))) {
1910
+ return (result)["value"];
1911
+ } else {
1912
+ if (((result)["failureKind"] === "undefined")) {
1913
+ return ((__eliscript_value_214) => { throw __eliscript_value_214; })(undefined);
1914
+ } else {
1915
+ if (((result)["failureKind"] === "primitive")) {
1916
+ {
1917
+ const __eliscript_value_215 = (result)["thrown"];
1918
+ {
1919
+ let value = __eliscript_value_215;
1920
+ if (__eliscript_truthy(((__eliscript_value_216) => (__eliscript_truthy(__eliscript_value_216) ? (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "object") : __eliscript_value_216))(value))) {
1921
+ ((value = (((value)["$eliscriptObservation"] === "-0") ? -0.0 : (((value)["$eliscriptObservation"] === "NaN") ? globalThis.NaN : (((value)["$eliscriptObservation"] === "Infinity") ? globalThis.Infinity : (((value)["$eliscriptObservation"] === "-Infinity") ? __eliscript_numeric_neg(globalThis.Infinity) : (((value)["$eliscriptObservation"] === "bigint") ? globalThis.BigInt((value)["decimal"]) : value)))))));
1922
+ }
1923
+ return ((__eliscript_value_217) => { throw __eliscript_value_217; })(value);
1924
+ }
1925
+ }
1926
+ } else {
1927
+ {
1928
+ let description = (result)["error"];
1929
+ let error = new (globalThis.Error)((description)["message"]);
1930
+ ((error)["name"] = (description)["name"]);
1931
+ if (__eliscript_truthy(Object.hasOwn(description, "diagnostic"))) {
1932
+ ((error)["eliscriptDiagnostic"] = (description)["diagnostic"]);
1933
+ }
1934
+ return ((__eliscript_value_218) => { throw __eliscript_value_218; })(error);
1935
+ }
1936
+ }
1937
+ }
1938
+ }
1939
+ })(JSON.parse(await (readFile(output, "utf8"))));
1940
+ })(({"file": runner, "sha256": execution_digest(await (readFile(resolve(source_root, runner)))), "sourceFile": maintained, "sourceSha256": execution_digest(await (readFile(resolve(source_root, maintained)))), "input": input, "result": output})));
1941
+ })());
1942
+ })(copy(artifact, ({"typed": undefined}))));
1943
+ })((context)["options"]));
1944
+ })(({})));
1945
+ })(resolve(directory, "result.json")));
1946
+ })(resolve(directory, "input.json")));
1947
+ })(await (mkdtemp(resolve((context)["directory"], "isolated-exports-")))));
1948
+ })("tools/backends/eliscript/compiler-corpus-isolated-exports.eli"));
1949
+ })("tools/backends/compiler-corpus-isolated-exports.mjs"));
1950
+ })((context)["sourceRoot"]));
1951
+ }
1952
+ function decodeCompilerCorpusObservation(value) {
1953
+ if (__eliscript_truthy(Array.isArray(value))) {
1954
+ return (value)["map"](decodeCompilerCorpusObservation);
1955
+ } else {
1956
+ if (((!(value === null)) && (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "object"))) {
1957
+ if (__eliscript_truthy(Object.hasOwn(value, "$eliscriptObservation"))) {
1958
+ {
1959
+ let kind = (value)["$eliscriptObservation"];
1960
+ let keys = Object.keys(value);
1961
+ if ((!((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(kind) === "string") && (((keys) ?? []).length === ((kind === "bigint") ? 2 : 1))))) {
1962
+ ((__eliscript_value_219) => { throw __eliscript_value_219; })(new (globalThis.TypeError)("invalid compiler corpus observation marker"));
1963
+ }
1964
+ if ((kind === "undefined")) {
1965
+ return undefined;
1966
+ } else {
1967
+ if ((kind === "-0")) {
1968
+ return -0.0;
1969
+ } else {
1970
+ if ((kind === "NaN")) {
1971
+ return globalThis.NaN;
1972
+ } else {
1973
+ if ((kind === "Infinity")) {
1974
+ return globalThis.Infinity;
1975
+ } else {
1976
+ if ((kind === "-Infinity")) {
1977
+ return __eliscript_numeric_neg(globalThis.Infinity);
1978
+ } else {
1979
+ if ((kind === "bigint")) {
1980
+ if ((!__eliscript_truthy(((__eliscript_value_220) => (__eliscript_truthy(__eliscript_value_220) ? ((__eliscript_value_221) => (__eliscript_truthy(__eliscript_value_221) ? (new (globalThis.RegExp)("^-?(?:0|[1-9][0-9]*)$"))["test"]((value)["decimal"]) : __eliscript_value_221))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })((value)["decimal"]) === "string")) : __eliscript_value_220))(Object.hasOwn(value, "decimal"))))) {
1981
+ ((__eliscript_value_222) => { throw __eliscript_value_222; })(new (globalThis.TypeError)("invalid compiler corpus BigInt observation"));
1982
+ }
1983
+ return globalThis.BigInt((value)["decimal"]);
1984
+ } else {
1985
+ return ((__eliscript_value_223) => { throw __eliscript_value_223; })(new (globalThis.TypeError)("unknown compiler corpus observation marker"));
1986
+ }
1987
+ }
1988
+ }
1989
+ }
1990
+ }
1991
+ }
1992
+ }
1993
+ } else {
1994
+ return Object.fromEntries((Object.entries(value))["map"](((entry) => {
1995
+ return [(entry)[0], decodeCompilerCorpusObservation((entry)[1])];
1996
+ })));
1997
+ }
1998
+ } else {
1999
+ return value;
2000
+ }
2001
+ }
2002
+ }
2003
+ async function execute_exports(context, artifact, contract, resources, evidence) {
2004
+ if (__eliscript_truthy(Object.hasOwn(contract, "valueEncoding"))) {
2005
+ if ((!(((contract)["valueEncoding"] === "eliscript-observation-v1") && (((context)["record"])["id"] === "original-sequence:managed-language-intrinsics-source")))) {
2006
+ ((__eliscript_value_224) => { throw __eliscript_value_224; })(new (globalThis.TypeError)("encoded export observations require their exact original intrinsic recipe"));
2007
+ }
2008
+ }
2009
+ return (((contract)["isolated"] === true) ? await (execute_isolated_exports(context, artifact, contract, resources, evidence)) : await (execute_target_exports(context, artifact, contract, resources, evidence)));
2010
+ }
2011
+ async function execute_target_exports(context, artifact, contract, resources, evidence) {
2012
+ if (__eliscript_truthy(Object.hasOwn(contract, "valueEncoding"))) {
2013
+ if ((!((contract)["valueEncoding"] === "eliscript-observation-v1"))) {
2014
+ ((__eliscript_value_225) => { throw __eliscript_value_225; })(new (globalThis.TypeError)("unknown compiler corpus value encoding"));
2015
+ }
2016
+ ((contract = decodeCompilerCorpusObservation(contract)));
2017
+ }
2018
+ return (((artifact)["target"] === "javascript") ? await (execute_javascript_exports(context, artifact, contract, evidence)) : await (execute_local_exports(context, artifact, contract, resources, evidence)));
2019
+ }
2020
+ async function load_javascript_export_modules(context, artifact) {
2021
+ return (await (async (directory) => {
2022
+ return (await (async (source) => {
2023
+ return (await (async () => {
2024
+ await (writeFile(resolve(directory, "compiler.mjs"), compile_string(source, "original-javascript-export-namespace.eli")));
2025
+ return (await (async (reader) => {
2026
+ return (await (async (namespace) => {
2027
+ return (await (async (descriptor) => {
2028
+ return (await (async (provided) => {
2029
+ return await (loadManagedHostModules(descriptor, provided));
2030
+ })(({"hostModules": new (globalThis.Map)([["original-javascript-exports", namespace]])})));
2031
+ })(({"hostModules": [({"id": "original-javascript-exports", "specifier": (pathToFileURL((artifact)["path"]))["href"], "referrer": "compiler-corpus-execution.mjs", "allowedExports": [], "namespace": true})]})));
2032
+ })((reader)["readSelectedNamespace"]()));
2033
+ })(await (loadCompiler(directory))));
2034
+ })());
2035
+ })((String("(import ") + String(JSON.stringify((pathToFileURL((artifact)["path"]))["href"])) + String(" :as selectedNamespace)\n(defun readSelectedNamespace () selectedNamespace)\n(export readSelectedNamespace)"))));
2036
+ })(await (mkdtemp(resolve((context)["directory"], "javascript-export-namespace-")))));
2037
+ }
2038
+ async function execute_javascript_exports(context, artifact, contract, evidence) {
2039
+ return (await (async (modules) => {
2040
+ return (await (async (observations) => {
2041
+ return (await (async () => {
2042
+ await (mkdir(modules, ({"recursive": true})));
2043
+ (await (async () => {
2044
+ try {
2045
+ return await (symlink(resolve((context)["sourceRoot"]), join(modules, "eliscript"), "dir"));
2046
+ } catch (error) {
2047
+ if ((!((error)["code"] === "EEXIST"))) {
2048
+ return ((__eliscript_value_226) => { throw __eliscript_value_226; })(error);
2049
+ } else {
2050
+ return null;
2051
+ }
2052
+ }
2053
+ })());
2054
+ export_stage(evidence, "javascript-import");
2055
+ (await (async (loaded) => {
2056
+ return (await (async (module) => {
2057
+ return (await (async (values) => {
2058
+ return (await (async (calls) => {
2059
+ return (await (async (index) => {
2060
+ return (await (async () => {
2061
+ while (__eliscript_numeric_relation("<", index, ((values) ?? []).length)) {
2062
+ {
2063
+ let pair = (values)[index];
2064
+ let name = (pair)[0];
2065
+ let value = (module)[name];
2066
+ (assert)["deepStrictEqual"](value, (pair)[1]);
2067
+ (observations)["push"](({"name": name, "value": value_record(value)}));
2068
+ }
2069
+ ((index = (index + 1)));
2070
+ }
2071
+ ((index = 0));
2072
+ ((evidence)["completedCalls"] = 0);
2073
+ return (await (async () => {
2074
+ while (__eliscript_numeric_relation("<", index, ((calls) ?? []).length)) {
2075
+ (await (async (call) => {
2076
+ return (await (async (value) => {
2077
+ return (await (async (error) => {
2078
+ return (await (async (failed) => {
2079
+ return (await (async () => {
2080
+ ((evidence)["callIndex"] = index);
2081
+ ((evidence)["callName"] = (call)["name"]);
2082
+ export_stage(evidence, "javascript-call");
2083
+ (await (async () => {
2084
+ try {
2085
+ return ((value = await (__eliscript_at(Reflect, "apply")((module)[fallback((call)["javascriptName"], (call)["name"])], module, (call)["args"]))));
2086
+ } catch (caught) {
2087
+ return ((failed = true), (error = caught));
2088
+ }
2089
+ })());
2090
+ if ((!((call)["error"] === undefined))) {
2091
+ (assert)["ok"](failed, "original exported call must throw");
2092
+ (assert)["strictEqual"](field(error, "message"), (call)["error"]);
2093
+ (observations)["push"](({"name": (call)["name"], "error": (call)["error"]}));
2094
+ } else {
2095
+ if (__eliscript_truthy(failed)) {
2096
+ ((__eliscript_value_227) => { throw __eliscript_value_227; })(error);
2097
+ }
2098
+ (assert)["deepStrictEqual"](value, (call)["expected"]);
2099
+ (observations)["push"](({"name": (call)["name"], "value": value_record(value)}));
2100
+ }
2101
+ return ((evidence)["completedCalls"] = (index + 1));
2102
+ })());
2103
+ })(false));
2104
+ })(undefined));
2105
+ })(undefined));
2106
+ })((calls)[index]));
2107
+ ((index = (index + 1)));
2108
+ }
2109
+ return null;
2110
+ })());
2111
+ })());
2112
+ })(0));
2113
+ })(fallback((contract)["calls"], [])));
2114
+ })(Object.entries(fallback((contract)["values"], ({})))));
2115
+ })((loaded)["get"]("original-javascript-exports")));
2116
+ })(await (load_javascript_export_modules(context, artifact))));
2117
+ return observations;
2118
+ })());
2119
+ })([]));
2120
+ })(resolve((artifact)["path"], "..", "node_modules")));
2121
+ }
2122
+ async function executeIsolatedCompilerCorpusExports(input) {
2123
+ return (await (async (evidence, context) => {
2124
+ return (await (async () => {
2125
+ try {
2126
+ return ((value) => {
2127
+ return ({"failed": false, "value": value, "evidence": evidence});
2128
+ })(await (execute_target_exports(context, (input)["artifact"], (input)["contract"], (input)["resources"], evidence)));
2129
+ } catch (error) {
2130
+ return ({"failed": true, "evidence": evidence, "failureKind": ((error === undefined) ? "undefined" : (((error === null) || (!((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(error) === "object") || (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(error) === "function")))) ? "primitive" : "error")), "thrown": (((error === null) || (!((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(error) === "object") || (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(error) === "function")))) ? value_record(error) : null), "error": diagnostic(error)});
2131
+ }
2132
+ })());
2133
+ })(({}), ({"sourceRoot": (input)["sourceRoot"], "options": (input)["options"]})));
2134
+ }
2135
+ async function execute_local_exports(context, artifact, contract, resources, evidence) {
2136
+ ((evidence)["callIndex"] = -1);
2137
+ ((evidence)["completedCalls"] = 0);
2138
+ return ((adapter) => {
2139
+ return ((observations) => {
2140
+ return ((failed) => {
2141
+ return ((names) => {
2142
+ return (() => {
2143
+ try {
2144
+ export_stage(evidence, "auto");
2145
+ (adapter)["auto"](fallback((contract)["auto"], 65536));
2146
+ export_stage(evidence, "export-values");
2147
+ {
2148
+ const __eliscript_value_228 = Object.entries(fallback((contract)["values"], ({})));
2149
+ const __eliscript_value_229 = 0;
2150
+ {
2151
+ let values = __eliscript_value_228;
2152
+ let index = __eliscript_value_229;
2153
+ while (__eliscript_numeric_relation("<", index, ((values) ?? []).length)) {
2154
+ {
2155
+ let entry = (values)[index];
2156
+ let name = (entry)[0];
2157
+ let expected = (entry)[1];
2158
+ let value = (() => {
2159
+ export_stage(evidence, "export-get");
2160
+ return (adapter)["getExport"](name);
2161
+ })();
2162
+ (() => {
2163
+ try {
2164
+ export_stage(evidence, "export-decode");
2165
+ (assert)["deepStrictEqual"](managed_value(adapter, value), expected);
2166
+ return (observations)["push"](({"name": name, "value": value_record(managed_value(adapter, value))}));
2167
+ } catch (error) {
2168
+ export_failure(evidence);
2169
+ return ((__eliscript_value_230) => { throw __eliscript_value_230; })(error);
2170
+ } finally {
2171
+ export_stage(evidence, "export-release");
2172
+ (adapter)["release"](value);
2173
+ }
2174
+ })();
2175
+ }
2176
+ ((index = (index + 1)));
2177
+ }
2178
+ }
2179
+ }
2180
+ {
2181
+ const __eliscript_value_231 = fallback((contract)["calls"], []);
2182
+ const __eliscript_value_232 = 0;
2183
+ {
2184
+ let calls = __eliscript_value_231;
2185
+ let index = __eliscript_value_232;
2186
+ while (__eliscript_numeric_relation("<", index, ((calls) ?? []).length)) {
2187
+ ((evidence)["callIndex"] = index);
2188
+ Reflect.deleteProperty(evidence, "callName");
2189
+ Reflect.deleteProperty(evidence, "argumentIndex");
2190
+ export_stage(evidence, "call-contract");
2191
+ {
2192
+ let call = (calls)[index];
2193
+ let args = [];
2194
+ let value = undefined;
2195
+ let error = undefined;
2196
+ let call_failed = false;
2197
+ (() => {
2198
+ try {
2199
+ export_stage(evidence, "arguments");
2200
+ ((call)["args"])["forEach"](((arg, position) => {
2201
+ ((evidence)["argumentIndex"] = position);
2202
+ return (args)["push"](box(adapter, arg));
2203
+ }));
2204
+ Reflect.deleteProperty(evidence, "argumentIndex");
2205
+ export_stage(evidence, "call-name");
2206
+ {
2207
+ const __eliscript_value_233 = (call)["name"];
2208
+ const __eliscript_value_234 = (call)["javascriptName"];
2209
+ {
2210
+ let name = __eliscript_value_233;
2211
+ let alias = __eliscript_value_234;
2212
+ if (__eliscript_truthy(((__eliscript_value_235) => (__eliscript_truthy(__eliscript_value_235) ? ((__eliscript_value_236) => (__eliscript_truthy(__eliscript_value_236) ? (names)["has"](alias) : __eliscript_value_236))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(alias) === "string")) : __eliscript_value_235))((!__eliscript_truthy((names)["has"](name)))))) {
2213
+ ((name = alias));
2214
+ }
2215
+ ((evidence)["callName"] = (__eliscript_truthy((names)["has"](name)) ? (name)["slice"](0, 256) : "<unexported>"));
2216
+ export_stage(evidence, "invoke");
2217
+ (() => {
2218
+ try {
2219
+ return ((value = (adapter)["invoke"](name, args)));
2220
+ } catch (caught) {
2221
+ return ((call_failed = true), (error = caught));
2222
+ }
2223
+ })();
2224
+ }
2225
+ }
2226
+ if ((!((call)["error"] === undefined))) {
2227
+ export_stage(evidence, "error-assertion");
2228
+ (assert)["ok"](call_failed, "original exported call must throw");
2229
+ {
2230
+ const __eliscript_value_237 = exported_error_message(adapter, error, evidence);
2231
+ {
2232
+ let message = __eliscript_value_237;
2233
+ export_stage(evidence, "error-assertion");
2234
+ (assert)["strictEqual"](message, (call)["error"]);
2235
+ }
2236
+ }
2237
+ return (observations)["push"](({"name": (call)["name"], "error": (call)["error"]}));
2238
+ } else {
2239
+ if (__eliscript_truthy(call_failed)) {
2240
+ ((__eliscript_value_238) => { throw __eliscript_value_238; })(error);
2241
+ }
2242
+ export_stage(evidence, "result-decode");
2243
+ {
2244
+ const __eliscript_value_239 = managed_value(adapter, value);
2245
+ {
2246
+ let actual = __eliscript_value_239;
2247
+ export_stage(evidence, "result-assertion");
2248
+ (assert)["deepStrictEqual"](actual, (call)["expected"]);
2249
+ return (observations)["push"](({"name": (call)["name"], "value": value_record(actual)}));
2250
+ }
2251
+ }
2252
+ }
2253
+ } catch (error) {
2254
+ export_failure(evidence);
2255
+ return ((__eliscript_value_240) => { throw __eliscript_value_240; })(error);
2256
+ } finally {
2257
+ export_stage(evidence, "release-result");
2258
+ (adapter)["release"](value);
2259
+ export_stage(evidence, "release-arguments");
2260
+ (args)["forEach"](((arg) => {
2261
+ return (adapter)["release"](arg);
2262
+ }));
2263
+ }
2264
+ })();
2265
+ }
2266
+ ((evidence)["completedCalls"] = (index + 1));
2267
+ ((index = (index + 1)));
2268
+ }
2269
+ }
2270
+ }
2271
+ return observations;
2272
+ } catch (error) {
2273
+ export_failure(evidence);
2274
+ ((failed = true));
2275
+ return ((__eliscript_value_241) => { throw __eliscript_value_241; })(error);
2276
+ } finally {
2277
+ {
2278
+ const __eliscript_value_242 = undefined;
2279
+ const __eliscript_value_243 = false;
2280
+ const __eliscript_value_244 = [(() => {
2281
+ export_stage(evidence, "close-module");
2282
+ return (adapter)["closeModule"]();
2283
+ }), (() => {
2284
+ export_stage(evidence, "collect");
2285
+ return (adapter)["collect"]();
2286
+ }), (() => {
2287
+ export_stage(evidence, "live-check");
2288
+ return (assert)["strictEqual"]((adapter)["live"](), 0);
2289
+ }), (() => {
2290
+ export_stage(evidence, "frame-check");
2291
+ return (assert)["strictEqual"](((adapter)["stats"]())["frameDepth"], 0);
2292
+ }), (() => {
2293
+ export_stage(evidence, "close");
2294
+ if (__eliscript_truthy((adapter)["close"])) {
2295
+ return (adapter)["close"]();
2296
+ } else {
2297
+ return null;
2298
+ }
2299
+ })];
2300
+ const __eliscript_value_245 = 0;
2301
+ {
2302
+ let cleanup = __eliscript_value_242;
2303
+ let cleanup_failed = __eliscript_value_243;
2304
+ let actions = __eliscript_value_244;
2305
+ let index = __eliscript_value_245;
2306
+ while (__eliscript_numeric_relation("<", index, ((actions) ?? []).length)) {
2307
+ (() => {
2308
+ try {
2309
+ return ((actions)[index])();
2310
+ } catch (error) {
2311
+ if ((!__eliscript_truthy(cleanup_failed))) {
2312
+ export_failure(evidence);
2313
+ return ((cleanup_failed = true), (cleanup = error));
2314
+ } else {
2315
+ return null;
2316
+ }
2317
+ }
2318
+ })();
2319
+ ((index = (index + 1)));
2320
+ }
2321
+ if (__eliscript_truthy(((__eliscript_value_246) => (__eliscript_truthy(__eliscript_value_246) ? cleanup_failed : __eliscript_value_246))((!__eliscript_truthy(failed))))) {
2322
+ ((__eliscript_value_247) => { throw __eliscript_value_247; })(cleanup);
2323
+ }
2324
+ }
2325
+ }
2326
+ }
2327
+ })();
2328
+ })((() => {
2329
+ export_stage(evidence, "descriptor-functions");
2330
+ return new (globalThis.Set)((((artifact)["descriptor"])["functions"])["map"](((item) => {
2331
+ return (item)["name"];
2332
+ })));
2333
+ })());
2334
+ })(false);
2335
+ })([]);
2336
+ })(await (managed_runtime(artifact, (context)["options"], resources, evidence)));
2337
+ }
2338
+ function check_response(step, response, results) {
2339
+ if (__eliscript_truthy(Object.hasOwn(step, "expected"))) {
2340
+ (assert)["deepStrictEqual"](response, (step)["expected"]);
2341
+ }
2342
+ {
2343
+ const __eliscript_value_248 = fallback((step)["expectFields"], []);
2344
+ const __eliscript_value_249 = 0;
2345
+ {
2346
+ let fields = __eliscript_value_248;
2347
+ let index = __eliscript_value_249;
2348
+ while (__eliscript_numeric_relation("<", index, ((fields) ?? []).length)) {
2349
+ {
2350
+ let entry = (fields)[index];
2351
+ let actual = response;
2352
+ ((entry)["path"])["forEach"](((key) => {
2353
+ return ((actual = (actual)[key]));
2354
+ }));
2355
+ (assert)["deepStrictEqual"](actual, (entry)["value"]);
2356
+ }
2357
+ ((index = (index + 1)));
2358
+ }
2359
+ }
2360
+ }
2361
+ if ((!((step)["containsData"] === undefined))) {
2362
+ (assert)["ok"]((JSON.parse((response)["data"]))["includes"]((step)["containsData"]));
2363
+ }
2364
+ (fallback((step)["includesJavascript"], []))["forEach"](((text) => {
2365
+ return (assert)["ok"](((response)["javascript"])["includes"](text));
2366
+ }));
2367
+ (fallback((step)["excludesJavascript"], []))["forEach"](((text) => {
2368
+ return (assert)["ok"]((!__eliscript_truthy(((response)["javascript"])["includes"](text))));
2369
+ }));
2370
+ if (__eliscript_truthy((step)["containsField"])) {
2371
+ (assert)["ok"](((response)[((step)["containsField"])["field"]])["includes"](((step)["containsField"])["text"]));
2372
+ }
2373
+ if (__eliscript_truthy((step)["negativeZeroAt"])) {
2374
+ {
2375
+ const __eliscript_value_250 = JSON.parse((response)["ir"]);
2376
+ {
2377
+ let value = __eliscript_value_250;
2378
+ ((step)["negativeZeroAt"])["forEach"](((key) => {
2379
+ return ((value = (value)[key]));
2380
+ }));
2381
+ (assert)["ok"](Object.is(value, -0.0));
2382
+ }
2383
+ }
2384
+ }
2385
+ if (__eliscript_truthy((step)["canonicalEnvelope"])) {
2386
+ (assert)["ok"](((response)["canonicalIR"])["startsWith"]("{\"format\":\"eliscript-ir\",\"program\":{\"body\":"));
2387
+ (assert)["ok"](((response)["canonicalIR"])["endsWith"]("},\"version\":1}"));
2388
+ }
2389
+ if (__eliscript_truthy((step)["sameFieldsAs"])) {
2390
+ return (((step)["sameFieldsAs"])["fields"])["forEach"](((name) => {
2391
+ {
2392
+ const __eliscript_value_251 = field((results)["get"](((step)["sameFieldsAs"])["step"]), name);
2393
+ {
2394
+ let previous = __eliscript_value_251;
2395
+ return (assert)["deepStrictEqual"](((name === "ir") ? JSON.parse((response)[name]) : (response)[name]), ((name === "ir") ? JSON.parse(previous) : previous));
2396
+ }
2397
+ }
2398
+ }));
2399
+ } else {
2400
+ return null;
2401
+ }
2402
+ }
2403
+ async function execute_step(context, step, results, products, resources, evidence) {
2404
+ return (await (async (record) => {
2405
+ return (await (async (options) => {
2406
+ return (await (async (request) => {
2407
+ return (await (async (emission) => {
2408
+ return (await (async () => {
2409
+ if ((!__eliscript_truthy(((__eliscript_value_252) => (__eliscript_truthy(__eliscript_value_252) ? __eliscript_value_252 : (["wasm", "native", "javascript"])["includes"]((step)["backendTarget"])))(((step)["backendTarget"] === undefined))))) {
2410
+ ((__eliscript_value_253) => { throw __eliscript_value_253; })(new (globalThis.TypeError)("original backend diagnostic target is invalid"));
2411
+ }
2412
+ if (__eliscript_truthy(emission)) {
2413
+ ((request)["target"] = fallback((step)["backendTarget"], fallback((request)["target"], (context)["target"])));
2414
+ ((request)["memory"] = fallback((request)["memory"], fallback((record)["memory"], (resources)["memory"])));
2415
+ ((request)["nativeTarget"] = fallback((request)["nativeTarget"], fallback((record)["nativeTarget"], fallback((options)["nativeTarget"], (((globalThis.process)["platform"] === "linux") ? "arm64-linux" : "arm64-macos")))));
2416
+ ((request)["nativeFormat"] = fallback((request)["nativeFormat"], "library"));
2417
+ }
2418
+ return (await (async (response, error, request_failed) => {
2419
+ (await (async () => {
2420
+ try {
2421
+ return ((response = await (((context)["session"])["request"](request, ({"signal": (context)["signal"]})))));
2422
+ } catch (caught) {
2423
+ return ((request_failed = true), (error = caught));
2424
+ }
2425
+ })());
2426
+ return (__eliscript_truthy((step)["error"]) ? (() => {
2427
+ (assert)["ok"](request_failed, ("original request must fail: " + (step)["id"]));
2428
+ {
2429
+ const __eliscript_value_254 = (step)["error"];
2430
+ {
2431
+ let expected = __eliscript_value_254;
2432
+ if ((!((expected)["message"] === undefined))) {
2433
+ (assert)["strictEqual"](field(error, "message"), (expected)["message"]);
2434
+ }
2435
+ if ((!((expected)["contains"] === undefined))) {
2436
+ (assert)["ok"]((globalThis.String(fallback(field(error, "message"), error)))["includes"]((expected)["contains"]));
2437
+ }
2438
+ if ((!((expected)["code"] === undefined))) {
2439
+ (assert)["strictEqual"](field(field(error, "eliscriptDiagnostic"), "code"), (expected)["code"]);
2440
+ }
2441
+ if ((!((expected)["phase"] === undefined))) {
2442
+ (assert)["strictEqual"](field(field(error, "eliscriptDiagnostic"), "phase"), (expected)["phase"]);
2443
+ }
2444
+ (fallback((expected)["expectFields"], []))["forEach"](((entry) => {
2445
+ {
2446
+ const __eliscript_value_255 = field(error, "eliscriptDiagnostic");
2447
+ {
2448
+ let value = __eliscript_value_255;
2449
+ ((entry)["path"])["forEach"](((key) => {
2450
+ return ((value = field(value, key)));
2451
+ }));
2452
+ return (assert)["deepStrictEqual"](value, (entry)["value"]);
2453
+ }
2454
+ }
2455
+ }));
2456
+ }
2457
+ }
2458
+ return ({"id": (step)["id"], "error": diagnostic(error)});
2459
+ })() : (await (async () => {
2460
+ if (__eliscript_truthy(request_failed)) {
2461
+ ((__eliscript_value_256) => { throw __eliscript_value_256; })(error);
2462
+ }
2463
+ (results)["set"]((step)["id"], response);
2464
+ check_response(step, response, results);
2465
+ return (await (async (observation) => {
2466
+ (__eliscript_truthy(emission) ? (await (async (artifact) => {
2467
+ (products)["set"]((step)["id"], (artifact)["identitySha256"]);
2468
+ if (__eliscript_truthy((step)["sameProductAs"])) {
2469
+ (assert)["strictEqual"]((artifact)["identitySha256"], (products)["get"]((step)["sameProductAs"]));
2470
+ }
2471
+ (await (async (sidecars, index) => {
2472
+ return (await (async () => {
2473
+ while (__eliscript_numeric_relation("<", index, ((sidecars) ?? []).length)) {
2474
+ (await (async (sidecar) => {
2475
+ return (await (async (file) => {
2476
+ return (await (async () => {
2477
+ if (__eliscript_truthy(((__eliscript_value_257) => (__eliscript_truthy(__eliscript_value_257) ? __eliscript_value_257 : ((__eliscript_value_258) => (__eliscript_truthy(__eliscript_value_258) ? __eliscript_value_258 : (new (globalThis.RegExp)("[\\\\:\u0000]"))["test"](file)))(((file)["split"]("/"))["some"](((part) => {
2478
+ return ((part === "") || (part === ".") || (part === ".."));
2479
+ })))))((!(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(file) === "string"))))) {
2480
+ ((__eliscript_value_259) => { throw __eliscript_value_259; })(new (globalThis.Error)("original sidecar path is not relative"));
2481
+ }
2482
+ return (await (async (path) => {
2483
+ await (mkdir(resolve(path, ".."), ({"recursive": true})));
2484
+ return await (writeFile(path, (sidecar)["source"], ({"flag": "wx"})));
2485
+ })(join(resolve((artifact)["path"], ".."), file)));
2486
+ })());
2487
+ })((sidecar)["file"]));
2488
+ })((sidecars)[index]));
2489
+ ((index = (index + 1)));
2490
+ }
2491
+ return null;
2492
+ })());
2493
+ })(fallback((step)["sidecars"], []), 0));
2494
+ return ((field((step)["artifact"], "kind") === "exports") ? ((observation = await (execute_exports(context, artifact, (step)["artifact"], resources, evidence)))) : ((observation = ({"productIdentitySha256": (artifact)["identitySha256"]}))));
2495
+ })(await ((context)["archiveProduct"](response, ("sequence-" + (step)["id"]), (response)["target"])))) : null);
2496
+ return ({"id": (step)["id"], "result": value_record(observation)});
2497
+ })(response));
2498
+ })()));
2499
+ })(undefined, undefined, false));
2500
+ })());
2501
+ })((["project", "project-ir", "emit-ir", "emit-memory-ir", "emit-typed-memory"])["includes"]((request)["operation"])));
2502
+ })((__eliscript_tdz_read_0())((step)["request"], results)));
2503
+ })((context)["options"]));
2504
+ })((context)["record"]));
2505
+ }
2506
+ async function local_runtime_files(directory, prefix) {
2507
+ return (await (async (entries, files, index) => {
2508
+ (await (async () => {
2509
+ while (__eliscript_numeric_relation("<", index, ((entries) ?? []).length)) {
2510
+ (await (async (entry) => {
2511
+ return (await (async (name) => {
2512
+ return (await (async (id) => {
2513
+ return (__eliscript_truthy((entry)["isDirectory"]()) ? ((files = (files)["concat"](await (local_runtime_files(resolve(directory, name), id))))) : (__eliscript_truthy(((__eliscript_value_260) => (__eliscript_truthy(__eliscript_value_260) ? (name)["endsWith"](".mjs") : __eliscript_value_260))((entry)["isFile"]())) ? (files)["push"](id) : null));
2514
+ })((prefix + "/" + name)));
2515
+ })((entry)["name"]));
2516
+ })((entries)[index]));
2517
+ ((index = (index + 1)));
2518
+ }
2519
+ return null;
2520
+ })());
2521
+ return files;
2522
+ })(await (readdir(directory, ({"withFileTypes": true}))), [], 0));
2523
+ }
2524
+ const canonical_native_core_records = ["original-program:core-project-core", "original-program:core-project-utility", "original-program:core-project-persistent-values", "original-program:core-project-value-text", "original-program:core-project-public"];
2525
+ __eliscript_tdz_ready_5 = true;
2526
+ function canonical_native_sorted_record_p(record) {
2527
+ return ((__eliscript_value_261) => (__eliscript_truthy(__eliscript_value_261) ? ((__eliscript_value_262) => (__eliscript_truthy(__eliscript_value_262) ? ((__eliscript_value_263) => (__eliscript_truthy(__eliscript_value_263) ? (new (globalThis.RegExp)("^original-managed:sorted-core:(node|bun):auto-(65536|1)$"))["test"]((record)["id"]) : __eliscript_value_263))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(field(record, "id")) === "string")) : __eliscript_value_262))((field((record)["original"], "fixture") === "tests/fixtures/wasm-managed-sorted.eli")) : __eliscript_value_261))((field((record)["original"], "suite") === "tests/wasm-managed-sorted-core.test.mjs"));
2528
+ }
2529
+ function canonical_native_literal_seed_p(context) {
2530
+ {
2531
+ let record = (context)["record"];
2532
+ let execution = field(record, "execution");
2533
+ let original = field(record, "original");
2534
+ let expected = field(record, "expected");
2535
+ return (((context)["independentSeedProgram"] === true) && (field(record, "id") === "original-program:compiler-literal-runtime-complete") && (field(original, "suite") === "tests/literal-runtime.test.mjs") && (field(original, "fixture") === "tests/fixtures/literal-runtime.eli") && (field(execution, "kind") === "original-program") && (field(execution, "host") === "tests/__eliscript_original_literal_runtime_complete.mjs") && (field(execution, "runtimeProfile") === "compiler") && (field(execution, "referenceArtifact") === true) && (field(field(execution, "setupReplacement"), "kind") === "selected-and-independent-reference-compiler-directories") && (field(expected, "kind") === "seed-program") && (field(expected, "oracleRequired") === true));
2536
+ }
2537
+ }
2538
+ function native_provider_fail() {
2539
+ return ((__eliscript_value_264) => { throw __eliscript_value_264; })(new (globalThis.TypeError)("original canonical native provider identity conflicts with the selected product"));
2540
+ }
2541
+ async function prepareCompilerCorpusNativeProviders(context) {
2542
+ return (await (async (record) => {
2543
+ return (await (async (execution) => {
2544
+ return (await (async (sequence) => {
2545
+ return (await (async (sorted) => {
2546
+ return (await (async (literal_seed) => {
2547
+ return (__eliscript_truthy(((__eliscript_value_265) => (__eliscript_truthy(__eliscript_value_265) ? __eliscript_value_265 : (((__eliscript_value_266, __eliscript_value_267) => (__eliscript_value_266 !== __eliscript_value_267))((context)["target"], "javascript") || ((!__eliscript_truthy(sequence)) && (!__eliscript_truthy(sorted)) && (!__eliscript_truthy(literal_seed)) && (!__eliscript_truthy(((__eliscript_tdz_read_5()))["includes"](field(record, "id"))))))))(Object.hasOwn(context, "failure"))) ? context : (await (async () => {
2548
+ if ((!__eliscript_truthy(((__eliscript_value_268) => (__eliscript_truthy(__eliscript_value_268) ? ((__eliscript_value_269) => (__eliscript_truthy(__eliscript_value_269) ? __eliscript_value_269 : ((__eliscript_value_270) => (__eliscript_truthy(__eliscript_value_270) ? __eliscript_value_270 : ((__eliscript_value_271) => (__eliscript_truthy(__eliscript_value_271) ? __eliscript_value_271 : ((field(execution, "runtimeProfile") === "compiler") && (field((record)["original"], "suite") === "tests/core-stdlib.test.mjs"))))(literal_seed)))(sorted)))(sequence) : __eliscript_value_268))((field(execution, "kind") === "original-program"))))) {
2549
+ native_provider_fail();
2550
+ }
2551
+ return (await (async (artifact) => {
2552
+ return (await (async (modules) => {
2553
+ return (await (async (archived_providers) => {
2554
+ return (await (async (sources) => {
2555
+ return (await (async (source_root) => {
2556
+ return (await (async (runtime_root) => {
2557
+ return (await (async (files) => {
2558
+ return (await (async (required) => {
2559
+ return (await (async (seen) => {
2560
+ return (await (async (proofs) => {
2561
+ return (await (async (retained) => {
2562
+ return (await (async (index) => {
2563
+ return (await (async () => {
2564
+ if ((!__eliscript_truthy(((__eliscript_value_276) => (__eliscript_truthy(__eliscript_value_276) ? ((__eliscript_value_277) => (__eliscript_truthy(__eliscript_value_277) ? (!__eliscript_truthy((modules)["some"](((item) => {
2565
+ {
2566
+ const __eliscript_value_278 = field(item, "id");
2567
+ {
2568
+ let id = __eliscript_value_278;
2569
+ return ((__eliscript_value_279) => (__eliscript_truthy(__eliscript_value_279) ? ((__eliscript_value_280) => (__eliscript_truthy(__eliscript_value_280) ? __eliscript_value_280 : (id)["startsWith"]("runtime/")))((id === "runtime")) : __eliscript_value_279))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(id) === "string"));
2570
+ }
2571
+ }
2572
+ })))) : __eliscript_value_277))(Array.isArray(sources)) : __eliscript_value_276))(Array.isArray(modules))))) {
2573
+ native_provider_fail();
2574
+ }
2575
+ (await (async () => {
2576
+ while (__eliscript_numeric_relation("<", index, ((sources) ?? []).length)) {
2577
+ (await (async (item) => {
2578
+ return (await (async (id) => {
2579
+ return (await (async (declared) => {
2580
+ return (__eliscript_truthy(((__eliscript_value_281) => (__eliscript_truthy(__eliscript_value_281) ? (id)["startsWith"]("runtime/") : __eliscript_value_281))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(id) === "string"))) ? (await (async () => {
2581
+ if ((!__eliscript_truthy(((__eliscript_value_282) => (__eliscript_truthy(__eliscript_value_282) ? ((!__eliscript_truthy((seen)["has"](id))) && (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(declared) === "string")) : __eliscript_value_282))((required)["has"](id))))) {
2582
+ native_provider_fail();
2583
+ }
2584
+ (await (async (path) => {
2585
+ return (await (async (canonical) => {
2586
+ return (await (async (expected) => {
2587
+ return ((bytes) => {
2588
+ return (() => {
2589
+ if ((!__eliscript_truthy(((__eliscript_value_283) => (__eliscript_truthy(__eliscript_value_283) ? (bytes)["equals"]((Buffer)["from"](declared, "utf8")) : __eliscript_value_283))((canonical === expected))))) {
2590
+ native_provider_fail();
2591
+ }
2592
+ return (proofs)["push"](({"id": id, "sha256": execution_digest(bytes), "bytes": ((bytes) ?? []).length}));
2593
+ })();
2594
+ })(await (readFile(path)));
2595
+ })(resolve(runtime_root, (id)["slice"]((("runtime/") ?? []).length))));
2596
+ })(await (realpath(path))));
2597
+ })(resolve(source_root, id)));
2598
+ return (seen)["add"](id);
2599
+ })()) : (retained)["push"](item));
2600
+ })((__eliscript_truthy(archived_providers) ? request_native_provider_source(item) : field(item, "source"))));
2601
+ })((__eliscript_truthy(archived_providers) ? (item)["file"] : field(item, "id"))));
2602
+ })((sources)[index]));
2603
+ ((index = (index + 1)));
2604
+ }
2605
+ return null;
2606
+ })());
2607
+ if ((!((seen)["size"] === ((files) ?? []).length))) {
2608
+ native_provider_fail();
2609
+ }
2610
+ return (await (async (directory) => {
2611
+ return (await (async (runtime) => {
2612
+ return (await (async (package_source) => {
2613
+ return (await (async (package_name) => {
2614
+ return (await (async () => {
2615
+ (await (async () => {
2616
+ try {
2617
+ return (await (async (details) => {
2618
+ return ((!__eliscript_truthy((await (async (__eliscript_value_284) => (__eliscript_truthy(__eliscript_value_284) ? (await (realpath(runtime)) === runtime_root) : __eliscript_value_284))((details)["isSymbolicLink"]())))) ? native_provider_fail() : null);
2619
+ })(await (lstat(runtime))));
2620
+ } catch (error) {
2621
+ if ((!(field(error, "code") === "ENOENT"))) {
2622
+ return ((__eliscript_value_285) => { throw __eliscript_value_285; })(error);
2623
+ } else {
2624
+ return null;
2625
+ }
2626
+ }
2627
+ })());
2628
+ (await (async () => {
2629
+ try {
2630
+ return ((local) => {
2631
+ if (((local)["name"] === package_name)) {
2632
+ return native_provider_fail();
2633
+ } else {
2634
+ return null;
2635
+ }
2636
+ })(JSON.parse(await (readFile(resolve(directory, "package.json"), "utf8"))));
2637
+ } catch (error) {
2638
+ if ((!(field(error, "code") === "ENOENT"))) {
2639
+ return ((__eliscript_value_286) => { throw __eliscript_value_286; })(error);
2640
+ } else {
2641
+ return null;
2642
+ }
2643
+ }
2644
+ })());
2645
+ (proofs)["sort"](((a, b) => {
2646
+ if (__eliscript_numeric_relation("<", (a)["id"], (b)["id"])) {
2647
+ return -1;
2648
+ } else {
2649
+ if (__eliscript_numeric_relation(">", (a)["id"], (b)["id"])) {
2650
+ return 1;
2651
+ } else {
2652
+ return 0;
2653
+ }
2654
+ }
2655
+ }));
2656
+ {
2657
+ const __eliscript_value_287 = ({"policy": "canonical-source-runtime", "runtimeRoot": runtime_root, "packageSha256": execution_digest(package_source), "files": proofs, "identitySha256": compilerMetadataDigest(proofs)});
2658
+ {
2659
+ let proof = __eliscript_value_287;
2660
+ if ((!((context)["transportEvidence"] == null))) {
2661
+ (((context)["transportEvidence"])["nativeProviderIdentity"] = proof);
2662
+ }
2663
+ return copy(context, ({"nativeProviderIdentity": proof, "record": copy(record, ({"request": copy((record)["request"], ({"hostSources": (__eliscript_truthy(archived_providers) ? fallback(field((record)["request"], "hostSources"), []) : retained)}))}))}));
2664
+ }
2665
+ }
2666
+ })());
2667
+ })((JSON.parse(__eliscript_at_direct(package_source, "toString", "utf8")))["name"]));
2668
+ })(await (readFile(resolve(source_root, "package.json")))));
2669
+ })(resolve(directory, "runtime")));
2670
+ })(fallback((artifact)["directory"], resolve((artifact)["path"], ".."))));
2671
+ })());
2672
+ })(0));
2673
+ })([]));
2674
+ })([]));
2675
+ })(new (globalThis.Set)()));
2676
+ })(new (globalThis.Set)(files)));
2677
+ })(await (local_runtime_files(runtime_root, "runtime"))));
2678
+ })(await (realpath(resolve(source_root, "runtime")))));
2679
+ })((context)["sourceRoot"]));
2680
+ })((__eliscript_truthy(archived_providers) ? (fallback((context)["sourceAssets"], []))["filter"](((asset) => {
2681
+ return ((__eliscript_value_274) => (__eliscript_truthy(__eliscript_value_274) ? ((__eliscript_value_275) => (__eliscript_truthy(__eliscript_value_275) ? ((asset)["file"])["endsWith"](".mjs") : __eliscript_value_275))(((asset)["file"])["startsWith"]("runtime/")) : __eliscript_value_274))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })((asset)["file"]) === "string"));
2682
+ })) : field((record)["request"], "hostSources"))));
2683
+ })(((__eliscript_value_272) => (__eliscript_truthy(__eliscript_value_272) ? __eliscript_value_272 : ((__eliscript_value_273) => (__eliscript_truthy(__eliscript_value_273) ? (!__eliscript_truthy(Object.hasOwn((record)["request"], "hostSources"))) : __eliscript_value_273))(sorted)))(sequence)));
2684
+ })(field(artifact, "modules")));
2685
+ })((context)["artifact"]));
2686
+ })()));
2687
+ })(canonical_native_literal_seed_p(context)));
2688
+ })(canonical_native_sorted_record_p(record)));
2689
+ })(originalSequenceNativeInteropP(record)));
2690
+ })(field(record, "execution")));
2691
+ })((context)["record"]));
2692
+ }
2693
+ function request_native_provider_source(asset) {
2694
+ {
2695
+ const __eliscript_value_288 = (Buffer)["from"]((asset)["content"], "base64");
2696
+ {
2697
+ let bytes = __eliscript_value_288;
2698
+ if ((!(((asset)["encoding"] === "base64") && ((asset)["bytes"] === ((bytes) ?? []).length) && ((asset)["content"] === __eliscript_at_direct(bytes, "toString", "base64")) && ((asset)["sha256"] === execution_digest(bytes))))) {
2699
+ native_provider_fail();
2700
+ }
2701
+ return (new (globalThis.TextDecoder)("utf-8", ({"fatal": true, "ignoreBOM": true})))["decode"](bytes);
2702
+ }
2703
+ }
2704
+ }
2705
+ async function ensure_local_runtime_file(directory, id, source) {
2706
+ return (await (async (segments) => {
2707
+ return (await (async (parent) => {
2708
+ return (await (async (index) => {
2709
+ return (await (async () => {
2710
+ (await (async () => {
2711
+ while (__eliscript_numeric_relation("<", index, __eliscript_numeric_decrement(((segments) ?? []).length))) {
2712
+ ((parent = join(parent, (segments)[index])));
2713
+ await (mkdir(parent, ({"recursive": true})));
2714
+ ((details) => {
2715
+ if ((!__eliscript_truthy(((__eliscript_value_289) => (__eliscript_truthy(__eliscript_value_289) ? (!__eliscript_truthy((details)["isSymbolicLink"]())) : __eliscript_value_289))((details)["isDirectory"]())))) {
2716
+ return ((__eliscript_value_290) => { throw __eliscript_value_290; })(new (globalThis.Error)("original local runtime graph conflicts with emitted source"));
2717
+ } else {
2718
+ return null;
2719
+ }
2720
+ })(await (lstat(parent)));
2721
+ ((index = (index + 1)));
2722
+ }
2723
+ return null;
2724
+ })());
2725
+ return (await (async (path) => {
2726
+ return (await (async () => {
2727
+ try {
2728
+ return await (writeFile(path, source, ({"flag": "wx"})));
2729
+ } catch (error) {
2730
+ if ((!((error)["code"] === "EEXIST"))) {
2731
+ ((__eliscript_value_291) => { throw __eliscript_value_291; })(error);
2732
+ }
2733
+ return (await (async (details) => {
2734
+ return ((!__eliscript_truthy((await (async (__eliscript_value_292) => (__eliscript_truthy(__eliscript_value_292) ? (await (async (__eliscript_value_293) => (__eliscript_truthy(__eliscript_value_293) ? (await (readFile(path, "utf8")) === source) : __eliscript_value_293))((!__eliscript_truthy((details)["isSymbolicLink"]())))) : __eliscript_value_292))((details)["isFile"]())))) ? ((__eliscript_value_294) => { throw __eliscript_value_294; })(new (globalThis.Error)("original local runtime graph conflicts with emitted source")) : null);
2735
+ })(await (lstat(path))));
2736
+ }
2737
+ })());
2738
+ })(resolve(directory, id)));
2739
+ })());
2740
+ })(0));
2741
+ })(directory));
2742
+ })((id)["split"]("/")));
2743
+ }
2744
+ async function configure_local_runtime_package(context) {
2745
+ return (await (async (record) => {
2746
+ return (await (async (sources) => {
2747
+ return (await (async (declared) => {
2748
+ return (__eliscript_truthy(Array.isArray(sources)) ? (await (async () => {
2749
+ (sources)["forEach"](((source) => {
2750
+ if (((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })((source)["id"]) === "string") && (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })((source)["source"]) === "string"))) {
2751
+ return (declared)["set"]((source)["id"], (source)["source"]);
2752
+ } else {
2753
+ return null;
2754
+ }
2755
+ }));
2756
+ return (__eliscript_truthy(((__eliscript_value_295) => (__eliscript_truthy(__eliscript_value_295) ? ((__eliscript_value_296) => (__eliscript_truthy(__eliscript_value_296) ? (declared)["has"]("runtime/core/data-text.mjs") : __eliscript_value_296))((declared)["has"]("runtime/core/queue.mjs")) : __eliscript_value_295))((declared)["has"]("runtime/literals.mjs"))) ? (await (async (files) => {
2757
+ return (await (async (complete) => {
2758
+ return (__eliscript_truthy(complete) ? (await (async (artifact) => {
2759
+ return (await (async (directory) => {
2760
+ return (await (async (root_package) => {
2761
+ return (await (async (root_exports) => {
2762
+ return (await (async (exports) => {
2763
+ return (await (async (keys) => {
2764
+ return (await (async (index) => {
2765
+ return (await (async () => {
2766
+ while (__eliscript_numeric_relation("<", index, ((keys) ?? []).length)) {
2767
+ {
2768
+ let key = (keys)[index];
2769
+ let target = (root_exports)[key];
2770
+ if (__eliscript_truthy((key)["startsWith"]("./runtime/"))) {
2771
+ Object.defineProperty(exports, key, ({"value": target, "writable": true, "enumerable": true, "configurable": true}));
2772
+ }
2773
+ if (__eliscript_truthy(((__eliscript_value_297) => (__eliscript_truthy(__eliscript_value_297) ? ((__eliscript_value_298) => (__eliscript_truthy(__eliscript_value_298) ? ((__eliscript_value_299) => (__eliscript_truthy(__eliscript_value_299) ? ((__eliscript_value_300) => (__eliscript_truthy(__eliscript_value_300) ? ((__eliscript_value_301) => (__eliscript_truthy(__eliscript_value_301) ? ((__eliscript_value_302) => (__eliscript_truthy(__eliscript_value_302) ? (declared)["has"]((target)["slice"](2)) : __eliscript_value_302))((!__eliscript_truthy((target)["includes"]("*")))) : __eliscript_value_301))((target)["endsWith"](".mjs")) : __eliscript_value_300))((target)["startsWith"]("./platform/")) : __eliscript_value_299))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(target) === "string")) : __eliscript_value_298))((!__eliscript_truthy((key)["includes"]("*")))) : __eliscript_value_297))((key)["startsWith"]("./platform/")))) {
2774
+ {
2775
+ const __eliscript_value_303 = (target)["slice"](2);
2776
+ {
2777
+ let id = __eliscript_value_303;
2778
+ if ((!__eliscript_truthy((files)["includes"](id)))) {
2779
+ (files)["push"](id);
2780
+ }
2781
+ }
2782
+ }
2783
+ Object.defineProperty(exports, key, ({"value": target, "writable": true, "enumerable": true, "configurable": true}));
2784
+ }
2785
+ }
2786
+ ((index = (index + 1)));
2787
+ }
2788
+ (await (async (position) => {
2789
+ return (await (async () => {
2790
+ while (__eliscript_numeric_relation("<", position, ((files) ?? []).length)) {
2791
+ (await (async (id) => {
2792
+ return await (ensure_local_runtime_file(directory, id, (declared)["get"](id)));
2793
+ })((files)[position]));
2794
+ ((position = (position + 1)));
2795
+ }
2796
+ return null;
2797
+ })());
2798
+ })(0));
2799
+ return (await (async (path) => {
2800
+ return (await (async (source) => {
2801
+ return (await (async () => {
2802
+ try {
2803
+ return await (writeFile(path, source, ({"flag": "wx"})));
2804
+ } catch (error) {
2805
+ if ((!((error)["code"] === "EEXIST"))) {
2806
+ ((__eliscript_value_304) => { throw __eliscript_value_304; })(error);
2807
+ }
2808
+ return (await (async (details) => {
2809
+ return ((!__eliscript_truthy((await (async (__eliscript_value_305) => (__eliscript_truthy(__eliscript_value_305) ? (await (async (__eliscript_value_306) => (__eliscript_truthy(__eliscript_value_306) ? (await (readFile(path, "utf8")) === source) : __eliscript_value_306))((!__eliscript_truthy((details)["isSymbolicLink"]())))) : __eliscript_value_305))((details)["isFile"]())))) ? ((__eliscript_value_307) => { throw __eliscript_value_307; })(new (globalThis.Error)("original local runtime package conflicts with emitted source")) : null);
2810
+ })(await (lstat(path))));
2811
+ }
2812
+ })());
2813
+ })((JSON.stringify(({"name": (root_package)["name"], "type": "module", "exports": exports})) + "\n")));
2814
+ })(resolve(directory, "package.json")));
2815
+ })());
2816
+ })(0));
2817
+ })(Object.keys(root_exports)));
2818
+ })(Object.fromEntries([["./runtime/*", "./runtime/*"]])));
2819
+ })((root_package)["exports"]));
2820
+ })(JSON.parse(await (readFile(resolve((context)["sourceRoot"], "package.json"), "utf8")))));
2821
+ })(fallback((artifact)["directory"], resolve((artifact)["path"], ".."))));
2822
+ })((context)["artifact"])) : null);
2823
+ })((files)["every"](((id) => {
2824
+ return (declared)["has"](id);
2825
+ }))));
2826
+ })(await (local_runtime_files(resolve((context)["sourceRoot"], "runtime"), "runtime")))) : null);
2827
+ })()) : null);
2828
+ })(new (globalThis.Map)()));
2829
+ })(field((record)["request"], "hostSources")));
2830
+ })((context)["record"]));
2831
+ }
2832
+ function sequence_result_needed(steps, start, id) {
2833
+ {
2834
+ const __eliscript_value_308 = [];
2835
+ const __eliscript_value_309 = new (globalThis.WeakSet)();
2836
+ const __eliscript_value_310 = false;
2837
+ const __eliscript_value_311 = start;
2838
+ const __eliscript_value_312 = 0;
2839
+ {
2840
+ let pending = __eliscript_value_308;
2841
+ let seen = __eliscript_value_309;
2842
+ let needed = __eliscript_value_310;
2843
+ let index = __eliscript_value_311;
2844
+ let visits = __eliscript_value_312;
2845
+ (() => {
2846
+ try {
2847
+ while (__eliscript_numeric_relation("<", index, ((steps) ?? []).length)) {
2848
+ {
2849
+ const __eliscript_value_313 = Object.getOwnPropertyDescriptors((steps)[index]);
2850
+ {
2851
+ let descriptors = __eliscript_value_313;
2852
+ (["request", "sameFieldsAs"])["forEach"](((key) => {
2853
+ {
2854
+ const __eliscript_value_314 = (descriptors)[key];
2855
+ {
2856
+ let descriptor = __eliscript_value_314;
2857
+ if (__eliscript_truthy(descriptor)) {
2858
+ if (__eliscript_truthy(Object.hasOwn(descriptor, "value"))) {
2859
+ return (pending)["push"]((descriptor)["value"]);
2860
+ } else {
2861
+ return ((needed = true));
2862
+ }
2863
+ } else {
2864
+ return null;
2865
+ }
2866
+ }
2867
+ }
2868
+ }));
2869
+ }
2870
+ }
2871
+ ((index = (index + 1)));
2872
+ }
2873
+ while (((!__eliscript_truthy(needed)) && __eliscript_numeric_relation(">", ((pending) ?? []).length, 0))) {
2874
+ {
2875
+ const __eliscript_value_315 = (pending)["pop"]();
2876
+ {
2877
+ let value = __eliscript_value_315;
2878
+ if (((!(value == null)) && (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "object") && (!__eliscript_truthy((seen)["has"](value))))) {
2879
+ (seen)["add"](value);
2880
+ ((visits = (visits + 1)));
2881
+ if (__eliscript_numeric_relation(">", visits, 4096)) {
2882
+ ((needed = true));
2883
+ } else {
2884
+ {
2885
+ let descriptors = Object.getOwnPropertyDescriptors(value);
2886
+ let keys = Object.keys(descriptors);
2887
+ let position = 0;
2888
+ let prototype = Object.getPrototypeOf(value);
2889
+ if ((!__eliscript_truthy(((__eliscript_value_316) => (__eliscript_truthy(__eliscript_value_316) ? __eliscript_value_316 : ((__eliscript_value_317) => (__eliscript_truthy(__eliscript_value_317) ? __eliscript_value_317 : ((__eliscript_value_318) => (__eliscript_truthy(__eliscript_value_318) ? (prototype === (globalThis.Array)["prototype"]) : __eliscript_value_318))(Array.isArray(value))))((prototype === (globalThis.Object)["prototype"]))))((prototype === null))))) {
2890
+ ((needed = true));
2891
+ }
2892
+ if (__eliscript_truthy(Array.isArray(value))) {
2893
+ {
2894
+ const __eliscript_value_319 = ((descriptors)["length"])["value"];
2895
+ const __eliscript_value_320 = 0;
2896
+ {
2897
+ let length = __eliscript_value_319;
2898
+ let at = __eliscript_value_320;
2899
+ while (((!__eliscript_truthy(needed)) && __eliscript_numeric_relation("<", at, length))) {
2900
+ if ((!__eliscript_truthy(Object.hasOwn(descriptors, globalThis.String(at))))) {
2901
+ ((needed = true));
2902
+ }
2903
+ ((at = (at + 1)));
2904
+ }
2905
+ }
2906
+ }
2907
+ }
2908
+ while (((!__eliscript_truthy(needed)) && __eliscript_numeric_relation("<", position, ((keys) ?? []).length))) {
2909
+ {
2910
+ let key = (keys)[position];
2911
+ let descriptor = (descriptors)[key];
2912
+ if (__eliscript_truthy((descriptor)["enumerable"])) {
2913
+ if ((!__eliscript_truthy(Object.hasOwn(descriptor, "value")))) {
2914
+ ((needed = true));
2915
+ } else {
2916
+ {
2917
+ const __eliscript_value_321 = (descriptor)["value"];
2918
+ {
2919
+ let item = __eliscript_value_321;
2920
+ if ((((key === "$compilerCorpusRef") && (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(item) === "string") && (((item)["split"]("."))[0] === id)) || ((key === "step") && (item === id)))) {
2921
+ ((needed = true));
2922
+ }
2923
+ (pending)["push"](item);
2924
+ }
2925
+ }
2926
+ }
2927
+ }
2928
+ }
2929
+ ((position = (position + 1)));
2930
+ }
2931
+ }
2932
+ }
2933
+ }
2934
+ }
2935
+ }
2936
+ }
2937
+ return null;
2938
+ } catch (error) {
2939
+ return ((needed = true));
2940
+ }
2941
+ })();
2942
+ return needed;
2943
+ }
2944
+ }
2945
+ }
2946
+ function release_sequence_results(results, steps, start) {
2947
+ return (results)["forEach"](((value, id) => {
2948
+ if ((!__eliscript_truthy(sequence_result_needed(steps, start, id)))) {
2949
+ return (results)["delete"](id);
2950
+ } else {
2951
+ return null;
2952
+ }
2953
+ }));
2954
+ }
2955
+ async function check_required_managed_imports(context) {
2956
+ return (await (async (record) => {
2957
+ return (await (async (execution) => {
2958
+ return (await (async (target) => {
2959
+ return (__eliscript_truthy(((__eliscript_value_322) => (__eliscript_truthy(__eliscript_value_322) ? ((__eliscript_value_323) => (__eliscript_truthy(__eliscript_value_323) ? ((__eliscript_value_324) => (__eliscript_truthy(__eliscript_value_324) ? ((target === "wasm") || (target === "native")) : __eliscript_value_324))(Object.hasOwn(execution, "requiredManagedImports")) : __eliscript_value_323))((field(execution, "kind") === "original-program")) : __eliscript_value_322))((!__eliscript_truthy(Object.hasOwn(context, "failure"))))) ? (await (async (names) => {
2960
+ return (await (async (expected) => {
2961
+ return (await (async (artifact) => {
2962
+ return (await (async () => {
2963
+ (assert)["deepStrictEqual"]((execution)["requiredManagedImports"], expected);
2964
+ (assert)["deepStrictEqual"](((artifact)["descriptor"])["hostCapabilities"], expected);
2965
+ return ((target === "wasm") ? ((imports) => {
2966
+ (assert)["deepStrictEqual"]((imports)["map"](((item) => {
2967
+ return ({"module": (item)["module"], "name": (item)["name"], "kind": (item)["kind"]});
2968
+ })), (names)["map"](((name) => {
2969
+ return ({"module": "eliscript.host", "name": name, "kind": "function"});
2970
+ })));
2971
+ return (imports)["forEach"](((item) => {
2972
+ if (__eliscript_truthy(Object.hasOwn(item, "type"))) {
2973
+ return (assert)["deepStrictEqual"]((item)["type"], ({"parameters": ["i32", "i32"], "results": ["i32"]}));
2974
+ } else {
2975
+ return null;
2976
+ }
2977
+ }));
2978
+ })(globalThis.WebAssembly.Module.imports(new (globalThis.WebAssembly.Module)(new (globalThis.Uint8Array)(await (readFile((artifact)["path"])))))) : null);
2979
+ })());
2980
+ })((context)["artifact"]));
2981
+ })((names)["map"](((name) => {
2982
+ return ({"name": name, "module": "eliscript.host", "arity": 2, "abi": "managed-host-call-v1"});
2983
+ }))));
2984
+ })(["source-operation", "console-log-capture", "console-log"])) : null);
2985
+ })((context)["target"]));
2986
+ })(field(record, "execution")));
2987
+ })((context)["record"]));
2988
+ }
2989
+ async function execute_js_unicode_profile(context) {
2990
+ return (await (async (record) => {
2991
+ return (await (async (artifact) => {
2992
+ return (await (async (options) => {
2993
+ return (await (async (source_root) => {
2994
+ return (await (async (directory) => {
2995
+ return (await (async (profile) => {
2996
+ return (await (async (modules) => {
2997
+ return (await (async (profile_path) => {
2998
+ return (await (async () => {
2999
+ await (mkdir(modules, ({"recursive": true})));
3000
+ (await (async () => {
3001
+ try {
3002
+ return await (symlink(resolve(source_root), join(modules, "eliscript"), "dir"));
3003
+ } catch (error) {
3004
+ if ((!((error)["code"] === "EEXIST"))) {
3005
+ return ((__eliscript_value_325) => { throw __eliscript_value_325; })(error);
3006
+ } else {
3007
+ return null;
3008
+ }
3009
+ }
3010
+ })());
3011
+ await (mkdir(directory, ({"recursive": true})));
3012
+ await (writeFile(profile_path, JSON.stringify(profile)));
3013
+ return (await (async (command) => {
3014
+ return (await (async (host) => {
3015
+ return ((stdout) => {
3016
+ return ((observation) => {
3017
+ return (() => {
3018
+ (assert)["deepStrictEqual"](observation, ({"kind": "unicode-profile", "expectedSatisfied": true, "version": (profile)["version"], "checked": 1112064, "sigmaCases": (((profile)["sigma"]) ?? []).length, "hashes": ({"upper": (profile)["upper"], "lower": (profile)["lower"]})}));
3019
+ return observation;
3020
+ })();
3021
+ })(JSON.parse(stdout));
3022
+ })(await (seed_child_output(command, [host, resolve((artifact)["path"]), profile_path], source_root, (context)["signal"], directory, context)));
3023
+ })(resolve(source_root, "tools/backends/compiler-unicode-profile-host.mjs")));
3024
+ })(fallback((options)["node"], "node")));
3025
+ })());
3026
+ })(resolve(directory, "unicode-profile.json")));
3027
+ })(join(resolve((artifact)["path"], ".."), "node_modules")));
3028
+ })(((record)["execution"])["profile"]));
3029
+ })((context)["directory"]));
3030
+ })((context)["sourceRoot"]));
3031
+ })(fallback((context)["options"], ({}))));
3032
+ })((context)["artifact"]));
3033
+ })((context)["record"]));
3034
+ }
3035
+ async function prepareOriginalToolsCLIContext(context) {
3036
+ return (await (async (record) => {
3037
+ return (await (async (id) => {
3038
+ return (await (async (ids) => {
3039
+ return (__eliscript_truthy(((__eliscript_value_326) => (__eliscript_truthy(__eliscript_value_326) ? __eliscript_value_326 : (((__eliscript_value_327, __eliscript_value_328) => (__eliscript_value_327 !== __eliscript_value_328))((context)["target"], "javascript") || (!__eliscript_truthy((ids)["includes"](id))))))(Object.hasOwn(context, "failure"))) ? context : (await (async (original) => {
3040
+ return (await (async (execution) => {
3041
+ return (await (async (declaration) => {
3042
+ return (await (async (assets) => {
3043
+ return (await (async (files) => {
3044
+ return (await (async (source_root) => {
3045
+ return (await (async (host) => {
3046
+ return (await (async (manifest) => {
3047
+ return (await (async (seen) => {
3048
+ return (await (async (index) => {
3049
+ return (await (async () => {
3050
+ if ((!__eliscript_truthy(((__eliscript_value_329) => (__eliscript_truthy(__eliscript_value_329) ? ((__eliscript_value_330) => (__eliscript_truthy(__eliscript_value_330) ? ((__eliscript_value_331) => (__eliscript_truthy(__eliscript_value_331) ? ((__eliscript_value_332) => (__eliscript_truthy(__eliscript_value_332) ? ((__eliscript_value_333) => (__eliscript_truthy(__eliscript_value_333) ? ((__eliscript_value_334) => (__eliscript_truthy(__eliscript_value_334) ? ((__eliscript_value_335) => (__eliscript_truthy(__eliscript_value_335) ? ((__eliscript_value_336) => (__eliscript_truthy(__eliscript_value_336) ? ((__eliscript_value_337) => (__eliscript_truthy(__eliscript_value_337) ? ((__eliscript_value_338) => (__eliscript_truthy(__eliscript_value_338) ? Array.isArray((context)["sourceAssets"]) : __eliscript_value_338))(__eliscript_numeric_relation(">", ((manifest) ?? []).length, 0)) : __eliscript_value_337))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(manifest) === "string")) : __eliscript_value_336))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(host) === "string")) : __eliscript_value_335))((((assets) ?? []).length === 2)) : __eliscript_value_334))(Array.isArray(assets)) : __eliscript_value_333))((field(declaration, "kind") === "original-tools-final-cli")) : __eliscript_value_332))((((execution)["setupReplacement"])["kind"] === "selected-complete-compiler-artifacts")) : __eliscript_value_331))(((original)["host"] === "tests/compiler-session-tools.test.mjs")) : __eliscript_value_330))(((original)["suite"] === "tests/compiler-session-tools.test.mjs")) : __eliscript_value_329))(((execution)["kind"] === "compiler-session-program"))))) {
3051
+ ((__eliscript_value_339) => { throw __eliscript_value_339; })(new (globalThis.TypeError)("original tools CLI requires explicit final-stage transport and source evidence"));
3052
+ }
3053
+ (await (async () => {
3054
+ while (__eliscript_numeric_relation("<", index, ((assets) ?? []).length)) {
3055
+ (await (async (proof) => {
3056
+ return (await (async (file) => {
3057
+ return (await (async (archive) => {
3058
+ return (await (async (bytes) => {
3059
+ return (await (async () => {
3060
+ ((!__eliscript_truthy((await (async (__eliscript_value_340) => (__eliscript_truthy(__eliscript_value_340) ? (await (async (__eliscript_value_341) => (__eliscript_truthy(__eliscript_value_341) ? (await (async (__eliscript_value_342) => (__eliscript_truthy(__eliscript_value_342) ? (await (async (__eliscript_value_343) => (__eliscript_truthy(__eliscript_value_343) ? (await (async (__eliscript_value_344) => (__eliscript_truthy(__eliscript_value_344) ? (await (async (__eliscript_value_345) => (__eliscript_truthy(__eliscript_value_345) ? (await (async (__eliscript_value_346) => (__eliscript_truthy(__eliscript_value_346) ? (await (async (__eliscript_value_347) => (__eliscript_truthy(__eliscript_value_347) ? (await (realpath(resolve(source_root, file))) === resolve(await (realpath(source_root)), file)) : __eliscript_value_347))(((archive)["content"] === __eliscript_at_direct(bytes, "toString", "base64")))) : __eliscript_value_346))(((archive)["bytes"] === ((bytes) ?? []).length))) : __eliscript_value_345))(((archive)["encoding"] === "base64"))) : __eliscript_value_344))(((archive)["sha256"] === execution_digest(bytes)))) : __eliscript_value_343))(((proof)["sourceSha256"] === execution_digest(bytes)))) : __eliscript_value_342))(archive)) : __eliscript_value_341))((!__eliscript_truthy((seen)["has"](file))))) : __eliscript_value_340))((files)["includes"](file))))) ? ((__eliscript_value_348) => { throw __eliscript_value_348; })(new (globalThis.TypeError)("original tools CLI source evidence differs from its real transport")) : null);
3061
+ return (seen)["add"](file);
3062
+ })());
3063
+ })(await (readFile(resolve(source_root, file)))));
3064
+ })(((context)["sourceAssets"])["find"](((item) => {
3065
+ return ((item)["file"] === file);
3066
+ }))));
3067
+ })((proof)["file"]));
3068
+ })((assets)[index]));
3069
+ ((index = (index + 1)));
3070
+ }
3071
+ return null;
3072
+ })());
3073
+ return (await (async (before) => {
3074
+ return (await (async (after) => {
3075
+ return (await (async (at) => {
3076
+ return (await (async (artifact) => {
3077
+ return (await (async (directory) => {
3078
+ return (await (async (configuration) => {
3079
+ return (await (async (projected) => {
3080
+ return (await (async (proof) => {
3081
+ return (await (async () => {
3082
+ if ((!(__eliscript_numeric_relation(">=", at, 0) && ((host)["indexOf"](before, (at + 1)) === -1)))) {
3083
+ ((__eliscript_value_349) => { throw __eliscript_value_349; })(new (globalThis.TypeError)("original tools CLI path token changed"));
3084
+ }
3085
+ await (saveCompilerMetadata(resolve(directory, "__eliscript_tools_cli_projection.json"), proof));
3086
+ if ((!((context)["transportEvidence"] == null))) {
3087
+ (((context)["transportEvidence"])["originalToolsCLI"] = proof);
3088
+ }
3089
+ return copy(context, ({"record": copy(record, ({"execution": copy(execution, ({"hostSource": projected}))}))}));
3090
+ })());
3091
+ })(({"kind": "original-tools-final-cli", "version": 1, "recordId": id, "sourceRoot": source_root, "configurationPath": configuration, "producerPath": resolve(directory, (artifact)["path"]), "supportingDirectory": resolve((context)["directory"], "original-tool-products"), "bootstrapManifestPath": await (realpath(manifest)), "sourceAssets": assets, "originalHostSha256": execution_digest(host), "transportHostSha256": execution_digest(projected), "before": before, "after": after})));
3092
+ })((String((host)["slice"](0, at)) + String(after) + String((host)["slice"]((at + ((before) ?? []).length))))));
3093
+ })(resolve(directory, "__eliscript_original_compiler_session.json")));
3094
+ })(fallback((artifact)["directory"], resolve((artifact)["path"], ".."))));
3095
+ })((context)["artifact"]));
3096
+ })((host)["indexOf"](before)));
3097
+ })(JSON.stringify(resolve(source_root, "tools/backends/compiler-corpus-tools-cli.mjs"))));
3098
+ })(JSON.stringify(resolve(source_root, "tools/backends/compiler-cli.mjs"))));
3099
+ })());
3100
+ })(0));
3101
+ })(new (globalThis.Set)()));
3102
+ })(field((context)["options"], "bootstrapManifestPath")));
3103
+ })((execution)["hostSource"]));
3104
+ })((context)["sourceRoot"]));
3105
+ })(["tools/backends/eliscript/compiler-corpus-tools-cli.eli", "tools/backends/compiler-corpus-tools-cli.mjs"]));
3106
+ })(field(declaration, "sourceAssets")));
3107
+ })((original)["toolsCLITransport"]));
3108
+ })((record)["execution"]));
3109
+ })((record)["original"])));
3110
+ })(["original-tools-artifact:compiler-session-tools:node", "original-tools-artifact:compiler-session-tools:bun"]));
3111
+ })(field(record, "id")));
3112
+ })((context)["record"]));
3113
+ }
3114
+ async function prepareOriginalToolsDataReferenceContext(context) {
3115
+ return (await (async (record) => {
3116
+ return (await (async (id) => {
3117
+ return (await (async (ids) => {
3118
+ return (__eliscript_truthy(((__eliscript_value_350) => (__eliscript_truthy(__eliscript_value_350) ? __eliscript_value_350 : (((__eliscript_value_351, __eliscript_value_352) => (__eliscript_value_351 !== __eliscript_value_352))((context)["target"], "javascript") || (!__eliscript_truthy((ids)["includes"](id))))))(Object.hasOwn(context, "failure"))) ? context : (await (async (execution) => {
3119
+ return (await (async (original) => {
3120
+ return (await (async (declaration) => {
3121
+ return (await (async (assets) => {
3122
+ return (await (async (host) => {
3123
+ return (await (async (source_root) => {
3124
+ return (await (async (cli) => {
3125
+ return (await (async (original_host) => {
3126
+ return (await (async (files) => {
3127
+ return (await (async (seen) => {
3128
+ return (await (async (index) => {
3129
+ return (await (async () => {
3130
+ if ((!__eliscript_truthy(((__eliscript_value_353) => (__eliscript_truthy(__eliscript_value_353) ? ((__eliscript_value_354) => (__eliscript_truthy(__eliscript_value_354) ? ((__eliscript_value_355) => (__eliscript_truthy(__eliscript_value_355) ? ((__eliscript_value_356) => (__eliscript_truthy(__eliscript_value_356) ? ((__eliscript_value_357) => (__eliscript_truthy(__eliscript_value_357) ? ((__eliscript_value_358) => (__eliscript_truthy(__eliscript_value_358) ? ((__eliscript_value_359) => (__eliscript_truthy(__eliscript_value_359) ? ((__eliscript_value_360) => (__eliscript_truthy(__eliscript_value_360) ? ((__eliscript_value_361) => (__eliscript_truthy(__eliscript_value_361) ? Array.isArray((context)["sourceAssets"]) : __eliscript_value_361))((((assets) ?? []).length === ((files) ?? []).length)) : __eliscript_value_360))(Array.isArray(assets)) : __eliscript_value_359))(((!__eliscript_truthy(cli)) || (execution_digest(host) === (cli)["transportHostSha256"]))) : __eliscript_value_358))((execution_digest(original_host) === field(declaration, "hostSha256"))) : __eliscript_value_357))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(host) === "string")) : __eliscript_value_356))((field(declaration, "version") === 1)) : __eliscript_value_355))((field(declaration, "kind") === "original-tools-data-reference")) : __eliscript_value_354))(((original)["suite"] === "tests/compiler-session-tools.test.mjs")) : __eliscript_value_353))(((execution)["kind"] === "compiler-session-program"))))) {
3131
+ ((__eliscript_value_362) => { throw __eliscript_value_362; })(new (globalThis.TypeError)("original tools data reference requires its unchanged authenticated host"));
3132
+ }
3133
+ (await (async () => {
3134
+ while (__eliscript_numeric_relation("<", index, ((assets) ?? []).length)) {
3135
+ (await (async (proof) => {
3136
+ return (await (async (file) => {
3137
+ return (await (async (archive) => {
3138
+ return (await (async (bytes) => {
3139
+ return (await (async () => {
3140
+ ((!__eliscript_truthy((await (async (__eliscript_value_363) => (__eliscript_truthy(__eliscript_value_363) ? (await (async (__eliscript_value_364) => (__eliscript_truthy(__eliscript_value_364) ? (await (async (__eliscript_value_365) => (__eliscript_truthy(__eliscript_value_365) ? (await (async (__eliscript_value_366) => (__eliscript_truthy(__eliscript_value_366) ? (await (async (__eliscript_value_367) => (__eliscript_truthy(__eliscript_value_367) ? (await (async (__eliscript_value_368) => (__eliscript_truthy(__eliscript_value_368) ? (await (async (__eliscript_value_369) => (__eliscript_truthy(__eliscript_value_369) ? (await (async (__eliscript_value_370) => (__eliscript_truthy(__eliscript_value_370) ? (await (realpath(resolve(source_root, file))) === resolve(await (realpath(source_root)), file)) : __eliscript_value_370))(((archive)["content"] === __eliscript_at_direct(bytes, "toString", "base64")))) : __eliscript_value_369))(((archive)["bytes"] === ((bytes) ?? []).length))) : __eliscript_value_368))(((archive)["encoding"] === "base64"))) : __eliscript_value_367))(((archive)["sha256"] === execution_digest(bytes)))) : __eliscript_value_366))(((proof)["sourceSha256"] === execution_digest(bytes)))) : __eliscript_value_365))(archive)) : __eliscript_value_364))((!__eliscript_truthy((seen)["has"](file))))) : __eliscript_value_363))((files)["includes"](file))))) ? ((__eliscript_value_371) => { throw __eliscript_value_371; })(new (globalThis.TypeError)("original tools data reference source archive differs")) : null);
3141
+ return (seen)["add"](file);
3142
+ })());
3143
+ })(await (readFile(resolve(source_root, file)))));
3144
+ })(((context)["sourceAssets"])["find"](((item) => {
3145
+ return ((item)["file"] === file);
3146
+ }))));
3147
+ })((proof)["file"]));
3148
+ })((assets)[index]));
3149
+ ((index = (index + 1)));
3150
+ }
3151
+ return null;
3152
+ })());
3153
+ return (await (async (tokens) => {
3154
+ return (await (async (matches) => {
3155
+ return (await (async (token) => {
3156
+ return (await (async (before) => {
3157
+ return (await (async (module_file) => {
3158
+ return (await (async (after) => {
3159
+ return (await (async () => {
3160
+ if ((!((((matches) ?? []).length === 1) && ((host)["indexOf"](before, ((host)["indexOf"](before) + 1)) === -1)))) {
3161
+ ((__eliscript_value_372) => { throw __eliscript_value_372; })(new (globalThis.TypeError)("original tools child-process import changed"));
3162
+ }
3163
+ return (await (async (projected) => {
3164
+ return (await (async (artifact) => {
3165
+ return (await (async (directory) => {
3166
+ return (await (async (proof) => {
3167
+ return (await (async () => {
3168
+ await (saveCompilerMetadata(resolve(directory, "__eliscript_tools_data_reference.json"), proof));
3169
+ if (__eliscript_truthy((context)["transportEvidence"])) {
3170
+ (((context)["transportEvidence"])["originalToolsDataReference"] = proof);
3171
+ }
3172
+ return copy(context, ({"record": copy(record, ({"execution": copy(execution, ({"hostSource": projected}))}))}));
3173
+ })());
3174
+ })(({"kind": "original-tools-data-reference", "version": 1, "recordId": id, "sourceRoot": source_root, "configurationPath": resolve(directory, "__eliscript_original_compiler_session.json"), "sourceAssets": assets, "moduleFile": module_file, "runtimeFile": "runtime/unicode-case.mjs", "runtimeSha256": execution_digest(await (readFile(resolve(source_root, "runtime/unicode-case.mjs")))), "originalHostSource": original_host, "originalHostSha256": execution_digest(original_host), "transportHostSha256": execution_digest(projected), "importSites": ["compile", "aggregate-error", "edit-preview"]})));
3175
+ })(fallback((artifact)["directory"], resolve((artifact)["path"], ".."))));
3176
+ })((context)["artifact"]));
3177
+ })((host)["replace"](before, after)));
3178
+ })());
3179
+ })(JSON.stringify((pathToFileURL(resolve(source_root, module_file)))["href"])));
3180
+ })("tools/backends/compiler-corpus-tools-reference.mjs"));
3181
+ })(field(token, "text")));
3182
+ })((matches)[0]));
3183
+ })((tokens)["filter"](((token) => {
3184
+ return (seed_host_string(token) === "node:child_process");
3185
+ }))));
3186
+ })(seed_host_tokens(host)));
3187
+ })());
3188
+ })(0));
3189
+ })(new (globalThis.Set)()));
3190
+ })(["tools/backends/eliscript/compiler-corpus-tools-reference.eli", "tools/backends/compiler-corpus-tools-reference.mjs", "runtime/unicode-case.eli", "runtime/unicode-case.mjs", "runtime/unicode-case-data.eli", "runtime/unicode-case-data.mjs"]));
3191
+ })((__eliscript_truthy(cli) ? (host)["replace"]((cli)["after"], (cli)["before"]) : host)));
3192
+ })(field((context)["transportEvidence"], "originalToolsCLI")));
3193
+ })((context)["sourceRoot"]));
3194
+ })((execution)["hostSource"]));
3195
+ })(field(declaration, "sourceAssets")));
3196
+ })((original)["toolsDataReferenceTransport"]));
3197
+ })((record)["original"]));
3198
+ })((record)["execution"])));
3199
+ })(["original-tools-artifact:compiler-session-tools:node", "original-tools-artifact:compiler-session-tools:bun", "original-managed:compiler-session-tools:node", "original-managed:compiler-session-tools:bun"]));
3200
+ })(field(record, "id")));
3201
+ })((context)["record"]));
3202
+ }
3203
+ async function execute_compiler_corpus_record(context) {
3204
+ ((context = await (prepareOriginalToolsCLIContext(context))));
3205
+ ((context = await (prepareOriginalToolsDataReferenceContext(context))));
3206
+ (await (async (record) => {
3207
+ return (await (async (execution) => {
3208
+ return (await (async () => {
3209
+ (__eliscript_truthy(((__eliscript_value_374) => (__eliscript_truthy(__eliscript_value_374) ? Object.hasOwn(execution, "requiredManagedImports") : __eliscript_value_374))(execution)) ? await (check_required_managed_imports(context)) : null);
3210
+ return (__eliscript_truthy(((__eliscript_value_375) => (__eliscript_truthy(__eliscript_value_375) ? ((__eliscript_value_376) => (__eliscript_truthy(__eliscript_value_376) ? ((__eliscript_value_377) => (__eliscript_truthy(__eliscript_value_377) ? (field(execution, "kind") === "original-program") : __eliscript_value_377))(Object.hasOwn(execution, "hostToolProjection")) : __eliscript_value_376))((!__eliscript_truthy(Object.hasOwn(context, "failure")))) : __eliscript_value_375))(execution)) ? await (project_original_host_tools(context)) : null);
3211
+ })());
3212
+ })(((__eliscript_value_373) => (__eliscript_truthy(__eliscript_value_373) ? field(Object.getOwnPropertyDescriptor(record, "execution"), "value") : __eliscript_value_373))(record)));
3213
+ })(field(Object.getOwnPropertyDescriptor(context, "record"), "value")));
3214
+ if ((((context)["target"] === "javascript") && (!__eliscript_truthy(Object.hasOwn(context, "failure"))) && (field(((context)["record"])["execution"], "kind") === "original-program") && (!(field(((context)["record"])["execution"], "javascriptHostSource") === undefined)))) {
3215
+ {
3216
+ let record = (context)["record"];
3217
+ let execution = (record)["execution"];
3218
+ let source = (execution)["javascriptHostSource"];
3219
+ if ((!(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(source) === "string"))) {
3220
+ ((__eliscript_value_378) => { throw __eliscript_value_378; })(new (globalThis.TypeError)("original JavaScript host capability must retain its complete source"));
3221
+ }
3222
+ ((context = copy(context, ({"record": copy(record, ({"execution": copy(execution, ({"hostSource": source}))}))}))));
3223
+ }
3224
+ }
3225
+ (((!__eliscript_truthy(Object.hasOwn(context, "failure"))) && ((context)["target"] === "javascript") && (field(((context)["record"])["execution"], "kind") === "original-program")) ? await (configure_local_runtime_package(context)) : null);
3226
+ return (__eliscript_truthy(((__eliscript_value_379) => (__eliscript_truthy(__eliscript_value_379) ? __eliscript_value_379 : (!__eliscript_truthy(exports_sequence_p(context)))))(Object.hasOwn(context, "failure"))) ? (((!__eliscript_truthy(Object.hasOwn(context, "failure"))) && ((context)["target"] === "javascript") && (field(((context)["record"])["execution"], "kind") === "unicode-profile")) ? await (execute_js_unicode_profile(context)) : (await (async (kind) => {
3227
+ return (((!__eliscript_truthy(Object.hasOwn(context, "failure"))) && (kind === "original-program")) ? await (executeOriginalProgram(context)) : (((!__eliscript_truthy(Object.hasOwn(context, "failure"))) && (kind === "compiler-session-program")) ? await (executeCompilerSessionProgram(context)) : await ((legacy)["executeCompilerCorpusRecord"](context))));
3228
+ })(field(((context)["record"])["execution"], "kind")))) : (await (async (record) => {
3229
+ return (await (async (options) => {
3230
+ return (await (async (resources) => {
3231
+ return (await (async (configured) => {
3232
+ return (await (async (results) => {
3233
+ return (await (async (products) => {
3234
+ return (await (async (observations) => {
3235
+ return (await (async (satisfied) => {
3236
+ return (await (async (steps) => {
3237
+ return (await (async (index) => {
3238
+ return (await (async () => {
3239
+ (await (async () => {
3240
+ while (__eliscript_numeric_relation("<", index, ((steps) ?? []).length)) {
3241
+ (await (async (step, evidence) => {
3242
+ return (await (async () => {
3243
+ try {
3244
+ return (observations)["push"](await (execute_step(configured, step, results, products, resources, evidence)));
3245
+ } catch (error) {
3246
+ if (__eliscript_truthy(field((context)["signal"], "aborted"))) {
3247
+ ((__eliscript_value_380) => { throw __eliscript_value_380; })(((((context)["signal"])["reason"] === undefined) ? error : ((context)["signal"])["reason"]));
3248
+ }
3249
+ ((satisfied = false));
3250
+ return (observations)["push"](({"id": (step)["id"], "status": "failed", "error": export_diagnostic(error, evidence)}));
3251
+ }
3252
+ })());
3253
+ })((steps)[index], ({})));
3254
+ release_sequence_results(results, steps, (index + 1));
3255
+ ((index = (index + 1)));
3256
+ }
3257
+ return null;
3258
+ })());
3259
+ return ({"kind": "sequence", "expectedSatisfied": satisfied, "identity": observations});
3260
+ })());
3261
+ })(0));
3262
+ })((record)["steps"]));
3263
+ })(true));
3264
+ })([]));
3265
+ })(new (globalThis.Map)()));
3266
+ })(new (globalThis.Map)()));
3267
+ })(copy(context, ({"options": options}))));
3268
+ })(independentCompilerResources(options)));
3269
+ })(fallback((context)["options"], ({}))));
3270
+ })((context)["record"])));
3271
+ }
3272
+ function prepareOriginalProgramProcessLifetime(context) {
3273
+ {
3274
+ const __eliscript_value_381 = (context)["record"];
3275
+ {
3276
+ let record = __eliscript_value_381;
3277
+ if (__eliscript_truthy(((__eliscript_value_382) => (__eliscript_truthy(__eliscript_value_382) ? __eliscript_value_382 : ((!__eliscript_truthy((["wasm", "native"])["includes"]((context)["target"]))) || ((__eliscript_value_383, __eliscript_value_384) => (__eliscript_value_383 !== __eliscript_value_384))(field(record, "id"), "original-program:macro-generated-names-node"))))(Object.hasOwn(context, "failure")))) {
3278
+ return context;
3279
+ } else {
3280
+ {
3281
+ const __eliscript_value_385 = (record)["execution"];
3282
+ {
3283
+ let execution = __eliscript_value_385;
3284
+ if ((!(((execution)["kind"] === "original-program") && ((execution)["hostRuntime"] === "node") && ((execution)["host"] === "tests/__eliscript_original_generated_names_node.mjs") && (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })((execution)["hostSource"]) === "string") && (field((record)["original"], "suite") === "tests/macro-generated-names.test.mjs")))) {
3285
+ ((__eliscript_value_386) => { throw __eliscript_value_386; })(new (globalThis.TypeError)("original macro Node process lifetime boundary changed"));
3286
+ }
3287
+ return copy(context, ({"record": copy(record, ({"execution": copy(execution, ({"runtimeOptions": copy((execution)["runtimeOptions"], ({"originalHostLifetime": "process"}))}))}))}));
3288
+ }
3289
+ }
3290
+ }
3291
+ }
3292
+ }
3293
+ }
3294
+ async function executeCompilerCorpusRecord(context) {
3295
+ (__eliscript_truthy(((__eliscript_value_387) => (__eliscript_truthy(__eliscript_value_387) ? originalSequenceNativeInteropP((context)["record"]) : __eliscript_value_387))((!__eliscript_truthy(Object.hasOwn(context, "failure"))))) ? ((record) => {
3296
+ return ((context = copy(context, ({"record": record}))));
3297
+ })(transportOriginalSequenceRuntime((context)["record"], await (loadLiteralSources(({"sourceRoot": (context)["sourceRoot"]}))))) : null);
3298
+ ((context = await (prepareCompilerCorpusSourceMapContext(context))));
3299
+ return (await (async (acceptance) => {
3300
+ return (await (async (configured) => {
3301
+ return (await (async (provider) => {
3302
+ return (await (async () => {
3303
+ ((configured = prepareCompilerCorpusRuntimeContext(configured, acceptance)));
3304
+ ((configured = await (prepareOriginalLiteralHostProvider(configured))));
3305
+ ((configured = prepareOriginalProgramProcessLifetime(configured)));
3306
+ return ((observation) => {
3307
+ if ((!(acceptance === undefined))) {
3308
+ ((observation = copy(observation, acceptance)));
3309
+ }
3310
+ if ((provider === undefined)) {
3311
+ return observation;
3312
+ } else {
3313
+ return copy(observation, ({"nativeProviderIdentity": provider}));
3314
+ }
3315
+ })(await (execute_compiler_corpus_record(configured)));
3316
+ })());
3317
+ })(((configured === context) ? undefined : (configured)["nativeProviderIdentity"])));
3318
+ })(await (prepareCompilerCorpusNativeProviders(context))));
3319
+ })(compilerCorpusRuntimeAcceptance((context)["record"], (context)["options"])));
3320
+ }
3321
+ const prepareOriginalSeedCorpusRecord = seed_authenticated_record;
3322
+ __eliscript_tdz_ready_6 = true;
3323
+ export {prepareOriginalSeedCorpusRecord, resolveOriginalCorpusRequest, originalProgramArguments, createOriginalSeedOracle, executeCompilerCorpusRecord, executeIsolatedCompilerCorpusExports, decodeCompilerCorpusObservation, compilerCorpusRuntimeAcceptance, prepareCompilerCorpusRuntimeContext, prepareOriginalToolsCLIContext, prepareCompilerCorpusNativeProviders, prepareCompilerCorpusSourceMapContext, prepareOriginalProgramProcessLifetime, prepareOriginalToolsDataReferenceContext, compareCompilerCorpusObservation};
3324
+ //# sourceMappingURL=compiler-corpus-execution.mjs.map