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,937 @@
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("observation_counts"); return observation_counts; }
5
+ function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("observation_counts"); 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("suite"); return suite; }
8
+ function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("suite"); 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("retained"); return retained; }
11
+ function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("retained"); 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("maintained"); return maintained; }
14
+ function __eliscript_tdz_write_3(__eliscript_tdz_value_3) { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("maintained"); 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("fixture"); return fixture; }
17
+ function __eliscript_tdz_write_4(__eliscript_tdz_value_4) { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("fixture"); 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("identity_host"); return identity_host; }
20
+ function __eliscript_tdz_write_5(__eliscript_tdz_value_5) { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("identity_host"); 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("transient_fixture"); return transient_fixture; }
23
+ function __eliscript_tdz_write_6(__eliscript_tdz_value_6) { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("transient_fixture"); return __eliscript_const_error(); }
24
+ var __eliscript_tdz_ready_7;
25
+ function __eliscript_tdz_read_7() { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("transient_transports"); return transient_transports; }
26
+ function __eliscript_tdz_write_7(__eliscript_tdz_value_7) { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("transient_transports"); return __eliscript_const_error(); }
27
+ import "eliscript/runtime/unicode-case.mjs";
28
+ import { c as __eliscript_at, d as __eliscript_at_direct } from "data:text/javascript;base64,dmFyIG09UmVmbGVjdC5hcHBseSx0dD1OdW1iZXIucHJvdG90eXBlLnZhbHVlT2Ysaj1OdW1iZXIucHJvdG90eXBlLnRvU3RyaW5nLFU9TnVtYmVyLG50PU9iamVjdC5jcmVhdGUsaD1CaWdJbnQsZXQ9RGF0YVZpZXcsb3Q9QXJyYXlCdWZmZXIsaXQ9RGF0YVZpZXcucHJvdG90eXBlLnNldEZsb2F0NjQsSj1EYXRhVmlldy5wcm90b3R5cGUuZ2V0VWludDMyLHJ0PVJhbmdlRXJyb3I7ZnVuY3Rpb24gY3QodCxuKXtsZXQgZT1oKG4pLG89aCh0KSxpPSIiO2lmKG88MG4pbz0tbztkb3tsZXQgZj1vJWU7aT0iMDEyMzQ1Njc4OWFiY2RlZmdoaWprbG1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XSxsdChvLGxbdV0pKTtyZXR1cm4gcn1yZXR1cm4gcyh0LG4sZSl9fWZ1bmN0aW9uIFJ0KHQsbil7bGV0IGU9dFtuXTtyZXR1cm4oLi4ubyk9PkwoZSx0LG8pfWZ1bmN0aW9uIEF0KHQsbiwuLi5lKXtsZXQgbz10W25dO3JldHVybiBMKG8sdCxlKX1leHBvcnR7UnQgYXMgYyxBdCBhcyBkfTs=";
29
+ import { hashMap as __eliscript_hash_map, hashSet as __eliscript_hash_set, keyword as __eliscript_keyword, list as __eliscript_list, queue as __eliscript_queue, symbol as __eliscript_symbol, vector as __eliscript_vector } from "eliscript/runtime/literals.mjs";
30
+ const __eliscript_truthy = (value) => value !== false && value != null;
31
+ const __eliscript_number_intrinsic = globalThis.Number;
32
+ const __eliscript_bigint_intrinsic = globalThis.BigInt;
33
+ const __eliscript_numeric_apply = globalThis.Reflect.apply;
34
+ const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
35
+ const __eliscript_numeric_error = globalThis.TypeError;
36
+ const __eliscript_numeric_trim = globalThis.String.prototype.trim;
37
+ const __eliscript_numeric_slice = globalThis.String.prototype.slice;
38
+ const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
39
+ const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
40
+ const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
41
+ const __eliscript_numeric_primitive = (value) => {
42
+ if (!__eliscript_numeric_object(value)) return value;
43
+ const exotic = value[__eliscript_numeric_symbol];
44
+ if (exotic !== void 0 && exotic !== null) {
45
+ const result = __eliscript_numeric_apply(exotic, value, ["number"]);
46
+ if (!__eliscript_numeric_object(result)) return result;
47
+ throw new __eliscript_numeric_error("Cannot convert object to primitive value");
48
+ }
49
+ for (let index = 0; index < 2; index++) {
50
+ const method = value[index === 0 ? "valueOf" : "toString"];
51
+ if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
52
+ const result = __eliscript_numeric_apply(method, value, []);
53
+ if (!__eliscript_numeric_object(result)) return result;
54
+ }
55
+ }
56
+ throw new __eliscript_numeric_error("Cannot convert object to primitive value");
57
+ };
58
+ const __eliscript_to_number = (value) => {
59
+ const primitive = __eliscript_numeric_primitive(value);
60
+ if (typeof primitive === "string") {
61
+ const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
62
+ if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
63
+ let first = 2;
64
+ while (first < text.length && text[first] === "0") first++;
65
+ if (first === text.length) return 0;
66
+ const prefix = text[1];
67
+ const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
68
+ if (text.length - first > limit) return 1 / 0;
69
+ const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
70
+ return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
71
+ }
72
+ }
73
+ return __eliscript_number_intrinsic(primitive);
74
+ };
75
+ const __eliscript_numeric = (value) => {
76
+ if (typeof value === "number" || typeof value === "bigint") return value;
77
+ const primitive = __eliscript_numeric_primitive(value);
78
+ if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
79
+ return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
80
+ };
81
+ const __eliscript_implicit_number = (value) => {
82
+ if (typeof value === "number") return value;
83
+ const primitive = __eliscript_numeric_primitive(value);
84
+ if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
85
+ return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
86
+ };
87
+ const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
88
+ const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
89
+ const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
90
+ const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
91
+ const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
92
+ const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
93
+ const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
94
+ const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
95
+ const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
96
+ const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
97
+ const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
98
+ const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
99
+ const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
100
+ const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
101
+ const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
102
+ const __eliscript_numeric_relation = (operator, left, right) => {
103
+ if (typeof left === "number" && typeof right === "number") {
104
+ if (operator === "<") return left < right;
105
+ if (operator === "<=") return left <= right;
106
+ if (operator === ">") return left > right;
107
+ return left >= right;
108
+ }
109
+ let a = __eliscript_numeric_primitive(left);
110
+ let b = __eliscript_numeric_primitive(right);
111
+ const x = typeof a, y = typeof b;
112
+ if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
113
+ a = __eliscript_numeric(a);
114
+ b = __eliscript_numeric(b);
115
+ }
116
+ if (operator === "<") return a < b;
117
+ if (operator === "<=") return a <= b;
118
+ if (operator === ">") return a > b;
119
+ return a >= b;
120
+ };
121
+
122
+ import {createHash} from "node:crypto";
123
+ import {Buffer} from "node:buffer";
124
+ import {posix, resolve, join} from "node:path";
125
+ import {pathToFileURL} from "node:url";
126
+ import {tmpdir} from "node:os";
127
+ import {mkdtemp, mkdir, writeFile, readFile, rm, symlink} from "node:fs/promises";
128
+ import assert from "node:assert/strict";
129
+ import {originalCorpusExecutionPolicy, runOriginalCorpusProcess, readOriginalCorpusExecutionContext, readOriginalProcessHostDependency, bindOriginalProcessHostDependency} from "./compiler-corpus-process.mjs";
130
+ import {read_string} from "../../dist/bootstrap/reader.mjs";
131
+ import {compile_string, compile_ir_string} from "../../dist/bootstrap/compiler.mjs";
132
+ import {emit_expression} from "../../dist/bootstrap/emitter.mjs";
133
+ import {root, loadLiteralSources} from "./build.mjs";
134
+ import * as legacy from "./compiler-corpus-managed-adapters-legacy.mjs";
135
+ import {originalSourceCaseLocators} from "./compiler-corpus-managed-cases.mjs";
136
+ function originalManagedProgramCompletionSource(body) {
137
+ return (String("(defasync original-program-main () ") + String(body) + String(")\n") + String("(defconst original-program-completion (original-program-main))\n") + String("(js-call original-program-completion :catch (lambda (error)") + String(" (try (js-call (get globalThis.process :stderr) :write (str (funcall globalThis.String error) \"\\n\")) (catch ignored nil))") + String(" (put globalThis.process :exitCode 1)))\n") + String("(defun then (resolve reject) (js-call original-program-completion :then") + String(" (lambda (ignored) (funcall resolve undefined)) reject)) (export then)\n"));
138
+ }
139
+ async function originalManagedObservationLaunch(input) {
140
+ return (await (async (source) => {
141
+ return (await (async (engine) => {
142
+ return (await (async (source_root) => {
143
+ return (await (async (selected) => {
144
+ return (await (async (environment) => {
145
+ return (await (async (context_url) => {
146
+ return (await (async (base) => {
147
+ return (await (async () => {
148
+ if ((!__eliscript_truthy(((__eliscript_value_1) => (__eliscript_truthy(__eliscript_value_1) ? ((__eliscript_value_2) => (__eliscript_truthy(__eliscript_value_2) ? Array.isArray((input)["args"]) : __eliscript_value_2))((["node", "bun"])["includes"](engine)) : __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; } })(source) === "string"))))) {
149
+ fail("original observation requires unchanged source, host and arguments");
150
+ }
151
+ if ((!__eliscript_truthy(selected))) {
152
+ ((environment)["ELISCRIPT_ORIGINAL_PROGRAM_CONTEXT"] = undefined);
153
+ ((environment)["ELISCRIPT_ORIGINAL_TARGET"] = undefined);
154
+ if (__eliscript_truthy((environment)["NODE_OPTIONS"])) {
155
+ ((environment)["NODE_OPTIONS"] = __eliscript_at_direct((((environment)["NODE_OPTIONS"])["split"](new (globalThis.RegExp)("\\s+")))["filter"](((value) => {
156
+ return ((__eliscript_value_3, __eliscript_value_4) => (__eliscript_value_3 !== __eliscript_value_4))(value, (String("--import=") + String(context_url)));
157
+ })), "join", " "));
158
+ }
159
+ }
160
+ await (mkdir(base, ({"recursive": true})));
161
+ return (await (async (directory) => {
162
+ return (await (async (body) => {
163
+ return (await (async (driver) => {
164
+ return (await (async (cleanup) => {
165
+ return (await (async () => {
166
+ try {
167
+ await (mkdir(resolve(directory, "node_modules"), ({"recursive": true})));
168
+ await (symlink(root, resolve(directory, "node_modules/eliscript"), "dir"));
169
+ await (writeFile(body, source));
170
+ (await (async (bridge) => {
171
+ (bridge = ((specifier, filename) => {
172
+ return (async () => {
173
+ return (await (async (bridge_directory) => {
174
+ return (await (async (path) => {
175
+ return (await (async () => {
176
+ await (mkdir(bridge_directory, ({"recursive": true})));
177
+ await (writeFile(path, compile_string((String("(import ") + String(JSON.stringify(specifier)) + String(" :as originalNamespace)\n") + String("(defun readOriginalNamespace () originalNamespace)\n(export readOriginalNamespace)")), "original-observation-namespace.eli")));
178
+ return bridge_directory;
179
+ })());
180
+ })(resolve(bridge_directory, "compiler.mjs")));
181
+ })(resolve(directory, filename)));
182
+ });
183
+ }));
184
+ return (await (async (body_bridge, context_bridge) => {
185
+ return (await (async (forms) => {
186
+ return (await (async (url) => {
187
+ return (await (async () => {
188
+ if (__eliscript_truthy(selected)) {
189
+ (forms)["push"]((String("(import ") + String(JSON.stringify((pathToFileURL(resolve(root, "tools/backends/compiler-corpus-program-driver.mjs")))["href"])) + String(" recordOriginalWireFailure)")));
190
+ }
191
+ (forms)["push"]((String("(defconst url ") + String(JSON.stringify(url)) + String(")")));
192
+ (forms)["push"]("(defasync original-observation-main ()");
193
+ if (__eliscript_truthy(((__eliscript_value_6) => (__eliscript_truthy(__eliscript_value_6) ? (environment)["ELISCRIPT_ORIGINAL_PROGRAM_CONTEXT"] : __eliscript_value_6))(selected))) {
194
+ (forms)["push"]((String("(await (import-module ") + String(JSON.stringify(context_bridge)) + String("))")));
195
+ }
196
+ if (__eliscript_truthy(selected)) {
197
+ (forms)["push"]((String("(try (await (import-module url)) (catch error ") + String("(try (await (recordOriginalWireFailure (js-object :sourceRoot ") + String(JSON.stringify(source_root)) + String(" :host ") + String(JSON.stringify(body)) + String(") error)) (catch ignored nil)) (throw error)))")));
198
+ } else {
199
+ (forms)["push"]("(await (import-module url))");
200
+ }
201
+ (forms)["push"](")", originalManagedProgramCompletionSource("(await (original-observation-main))"));
202
+ return await (writeFile(driver, compile_string(__eliscript_at_direct(forms, "join", "\n"), "original-observation-driver.eli")));
203
+ })());
204
+ })(body_bridge));
205
+ })([(String("(import ") + String(JSON.stringify((pathToFileURL(resolve(root, "tools/backends/managed-runtime.mjs")))["href"])) + String(" loadManagedHostModules)") + String("(import ") + String(JSON.stringify((pathToFileURL(resolve(root, "bootstrap/host/bun.mjs")))["href"])) + String(" loadCompiler)")), (String("(defasync import-module (directory)") + String(" (let* ((namespace (await (loadCompiler directory)))") + String(" (descriptor (js-object :hostModules (js-array (js-object :id \"original-observation-body\"") + String(" :specifier (str directory \"/compiler.mjs\") :referrer \"original-observation-driver.mjs\"") + String(" :allowedExports (js-array \"readOriginalNamespace\") :namespace t))))") + String(" (provided (js-object :hostModules (new globalThis.Map (js-array (js-array \"original-observation-body\" namespace)))))") + String(" (modules (await (loadManagedHostModules descriptor provided))))") + String(" (await (js-call (js-call modules :get \"original-observation-body\") :readOriginalNamespace))))")), "(put globalThis.process :argv (js-call (js-array (aref (get globalThis.process :argv) 0)) :concat (js-call (get globalThis.process :argv) :slice 2)))"]));
206
+ })(await ((bridge((pathToFileURL(body))["href"], "body-loader"))()), (__eliscript_truthy(((__eliscript_value_5) => (__eliscript_truthy(__eliscript_value_5) ? (environment)["ELISCRIPT_ORIGINAL_PROGRAM_CONTEXT"] : __eliscript_value_5))(selected)) ? await ((bridge(context_url, "context-loader"))()) : null)));
207
+ })(null));
208
+ {
209
+ let preload = ((engine === "bun") ? ["--preload", resolve(source_root, "tests/fixtures/compiled-eli-bun-preload.mjs")] : ["--experimental-loader", resolve(source_root, "tests/fixtures/compiled-eli-node-loader.mjs")]);
210
+ let unused = null;
211
+ return ({"executable": ((environment)[((engine === "bun") ? __eliscript_keyword("BUN") : __eliscript_keyword("NODE"))] ?? engine), "args": (preload)["concat"]([driver], (input)["args"]), "env": environment, "cleanup": cleanup, "directory": directory});
212
+ }
213
+ } catch (error) {
214
+ (await (async () => {
215
+ try {
216
+ return await (cleanup());
217
+ } catch (ignored) {
218
+ return null;
219
+ }
220
+ })());
221
+ return ((__eliscript_value_7) => { throw __eliscript_value_7; })(error);
222
+ }
223
+ })());
224
+ })((async () => {
225
+ return await (rm(directory, ({"recursive": true, "force": true})));
226
+ })));
227
+ })(resolve(directory, "driver.mjs")));
228
+ })(resolve(directory, "body.mjs")));
229
+ })(await (mkdtemp(join(base, "original-observation-")))));
230
+ })());
231
+ })(((input)["directory"] ?? tmpdir())));
232
+ })((pathToFileURL(resolve(source_root, "tools/backends/compiler-corpus-host-context.mjs")))["href"]));
233
+ })(Object.assign(({}), (input)["environment"])));
234
+ })(((input)["selected"] ?? false)));
235
+ })((input)["sourceRoot"]));
236
+ })(((input)["engine"] ?? "node")));
237
+ })((input)["source"]));
238
+ }
239
+ async function runOriginalManagedObservation(input, context) {
240
+ return (await (async (record) => {
241
+ return (await (async (policy) => {
242
+ return (await (async (launch) => {
243
+ return (await (async (cleanup) => {
244
+ return (await (async (failed) => {
245
+ return (await (async (options) => {
246
+ return (await (async () => {
247
+ try {
248
+ return ((receipt) => {
249
+ return JSON.parse((receipt)["stdout"]);
250
+ })(await (runOriginalCorpusProcess((launch)["executable"], (launch)["args"], options)));
251
+ } catch (error) {
252
+ ((failed = true));
253
+ return ((__eliscript_value_9) => { throw __eliscript_value_9; })(error);
254
+ } finally {
255
+ (await (async () => {
256
+ try {
257
+ return await ((launch)["cleanup"]());
258
+ } catch (error) {
259
+ if ((!__eliscript_truthy(failed))) {
260
+ return ((__eliscript_value_10) => { throw __eliscript_value_10; })(error);
261
+ } else {
262
+ return null;
263
+ }
264
+ }
265
+ })());
266
+ }
267
+ })());
268
+ })(Object.assign(({}), context, ({"policy": policy, "cwd": (input)["sourceRoot"], "env": (launch)["env"], "cleanup": (async (child) => {
269
+ return (await (async (failure, caught) => {
270
+ (await (async () => {
271
+ try {
272
+ return (__eliscript_truthy(cleanup) ? await (cleanup(child)) : null);
273
+ } catch (error) {
274
+ return ((caught = true), (failure = error));
275
+ }
276
+ })());
277
+ (await (async () => {
278
+ try {
279
+ return await ((launch)["cleanup"]());
280
+ } catch (error) {
281
+ if ((!__eliscript_truthy(caught))) {
282
+ return ((caught = true), (failure = error));
283
+ } else {
284
+ return null;
285
+ }
286
+ }
287
+ })());
288
+ if (__eliscript_truthy(caught)) {
289
+ return ((__eliscript_value_8) => { throw __eliscript_value_8; })(failure);
290
+ } else {
291
+ return null;
292
+ }
293
+ })(undefined, false));
294
+ })}))));
295
+ })(false));
296
+ })((context)["cleanup"]));
297
+ })(await (originalManagedObservationLaunch(Object.assign(({}), input, ({"directory": (context)["directory"]}))))));
298
+ })(originalCorpusExecutionPolicy(Object.assign(({}), context, ({"record": record})))));
299
+ })(Object.assign(({}), (context)["record"], ({"execution": ({"timeoutMs": ((input)["timeoutMs"] ?? 30000)})}))));
300
+ }
301
+ async function runOriginalManagedSequenceHost(configuration) {
302
+ return (await (async (environment) => {
303
+ return (await (async (argv) => {
304
+ return (await (async (source_root) => {
305
+ return (await (async (reference) => {
306
+ return (await (async (product) => {
307
+ return (await (async (engine) => {
308
+ return (await (async (source) => {
309
+ return (await (async (family) => {
310
+ return (await (async (public_ids) => {
311
+ return (await (async (argument_ids) => {
312
+ return (await (async (inherited) => {
313
+ return (await (async (context) => {
314
+ return (await (async () => {
315
+ if ((!__eliscript_truthy(((__eliscript_value_11) => (__eliscript_truthy(__eliscript_value_11) ? ((__eliscript_value_12) => (__eliscript_truthy(__eliscript_value_12) ? product : __eliscript_value_12))(reference) : __eliscript_value_11))(source_root)))) {
316
+ fail("complete original managed corpus requires its independent Seed source graph");
317
+ }
318
+ return (await (async (relocate, observe) => {
319
+ (relocate = ((directory, selected) => {
320
+ return (source)["replace"](new (globalThis.RegExp)("from ([\"'])(?:\\.\\.\\/)+runtime\\/(core|testing)\\/([^\"']+)\\1", "g"), ((all, quote, category, filename) => {
321
+ {
322
+ let canonical = (String("runtime/") + String(category) + String("/") + String(filename));
323
+ let id = (__eliscript_truthy(selected) ? (String("public/") + String(canonical)) : canonical);
324
+ if (__eliscript_truthy(((__eliscript_value_13) => (__eliscript_truthy(__eliscript_value_13) ? (!__eliscript_truthy((public_ids)["has"](id))) : __eliscript_value_13))(selected))) {
325
+ fail((String("actual public source module ") + String(canonical)));
326
+ }
327
+ return (String("from ") + String(JSON.stringify((pathToFileURL(resolve((__eliscript_truthy(selected) ? directory : source_root), id)))["href"])));
328
+ }
329
+ }));
330
+ }));
331
+ (observe = ((directory, selected, role) => {
332
+ return runOriginalManagedObservation(({"source": relocate(directory, selected), "sourceRoot": source_root, "engine": engine, "recordId": (configuration)["recordId"], "args": (["original-host.mjs"])["concat"]((argument_ids)["map"](((id) => {
333
+ return resolve(directory, id);
334
+ }))), "selected": selected, "environment": environment, "timeoutMs": 30000}), Object.assign(({}), context, ({"directory": resolve((context)["directory"], role)})));
335
+ }));
336
+ return (await (async (expected) => {
337
+ return (await (async (actual) => {
338
+ return (await (async () => {
339
+ (assert)["deepEqual"](actual, expected);
340
+ ((family === "value-hash") ? (assert)["deepEqual"](actual, JSON.parse(await (readFile(resolve(source_root, "tests/fixtures/value-hashes.json"), "utf8")))) : null);
341
+ return (globalThis.console)["log"](JSON.stringify(expected));
342
+ })());
343
+ })(await (observe(product, true, "selected"))));
344
+ })(await (observe(reference, false, "reference"))));
345
+ })(null, null));
346
+ })());
347
+ })((__eliscript_truthy(inherited) ? readOriginalCorpusExecutionContext(inherited) : ({"directory": resolve(product, "original-observations"), "target": (environment)["ELISCRIPT_ORIGINAL_TARGET"], "caseId": (configuration)["recordId"], "sourceIdentity": (configuration)["sourceIdentity"], "options": ({})}))));
348
+ })((environment)["ELISCRIPT_ORIGINAL_EXECUTION_CONTEXT"]));
349
+ })(((family === "lazy-sequence") ? ["tests/fixtures/lazy-sequence.mjs"] : ((family === "core-text-object") ? ["public/runtime/core/text.mjs", "public/runtime/core/object.mjs"] : []))));
350
+ })(new (globalThis.Set)((configuration)["publicIds"])));
351
+ })((configuration)["family"]));
352
+ })((configuration)["source"]));
353
+ })((configuration)["engine"]));
354
+ })((argv)[2]));
355
+ })((environment)["ELISCRIPT_ORIGINAL_REFERENCE_PRODUCT_ROOT"]));
356
+ })((environment)["ELISCRIPT_ORIGINAL_SOURCE_ROOT"]));
357
+ })((globalThis.process)["argv"]));
358
+ })((globalThis.process)["env"]));
359
+ }
360
+ const observation_counts = new (globalThis.Map)();
361
+ __eliscript_tdz_ready_0 = true;
362
+ async function runInheritedOriginalManagedObservation(source, engine, arguments$, selected, configuration) {
363
+ return (await (async (environment) => {
364
+ return (await (async (inherited) => {
365
+ return (await (async (id) => {
366
+ return (await (async (position) => {
367
+ return (await (async (context) => {
368
+ return (await (async () => {
369
+ ((__eliscript_tdz_read_0()))["set"](id, (position + 1));
370
+ return await (runOriginalManagedObservation(({"source": source, "sourceRoot": (environment)["ELISCRIPT_ORIGINAL_SOURCE_ROOT"], "engine": ((engine === undefined) ? "node" : engine), "args": ((arguments$ === undefined) ? [] : arguments$), "selected": ((selected === undefined) ? false : selected), "environment": environment, "recordId": id, "timeoutMs": 30000}), Object.assign(({}), context, ({"directory": resolve((context)["directory"], (String("nested-") + String(position)))}))));
371
+ })());
372
+ })((__eliscript_truthy(inherited) ? readOriginalCorpusExecutionContext(inherited) : ({"directory": resolve(((globalThis.process)["argv"])[2], "original-observations"), "caseId": id, "target": (environment)["ELISCRIPT_ORIGINAL_TARGET"], "sourceIdentity": (configuration)["sourceIdentity"], "options": ({})}))));
373
+ })((__eliscript_truthy(((__eliscript_tdz_read_0()))["has"](id)) ? ((__eliscript_tdz_read_0()))["get"](id) : 0)));
374
+ })((configuration)["recordId"]));
375
+ })((environment)["ELISCRIPT_ORIGINAL_EXECUTION_CONTEXT"]));
376
+ })((globalThis.process)["env"]));
377
+ }
378
+ function original_observation_call_end(source, start) {
379
+ {
380
+ const __eliscript_value_14 = (start + (("originalObservation") ?? []).length);
381
+ const __eliscript_value_15 = 0;
382
+ const __eliscript_value_16 = null;
383
+ const __eliscript_value_17 = false;
384
+ const __eliscript_value_18 = false;
385
+ {
386
+ let index = __eliscript_value_14;
387
+ let depth = __eliscript_value_15;
388
+ let quote = __eliscript_value_16;
389
+ let escaped = __eliscript_value_17;
390
+ let done = __eliscript_value_18;
391
+ while ((__eliscript_numeric_relation("<", index, ((source) ?? []).length) && (!__eliscript_truthy(done)))) {
392
+ {
393
+ const __eliscript_value_19 = (source)[index];
394
+ {
395
+ let character = __eliscript_value_19;
396
+ if (__eliscript_truthy(quote)) {
397
+ if (__eliscript_truthy(escaped)) {
398
+ ((escaped = false));
399
+ } else {
400
+ if ((character === "\\")) {
401
+ ((escaped = true));
402
+ } else {
403
+ if ((character === quote)) {
404
+ ((quote = null));
405
+ } else {
406
+
407
+ }
408
+ }
409
+ }
410
+ } else {
411
+ if (__eliscript_truthy((["\"", "'", "`"])["includes"](character))) {
412
+ ((quote = character));
413
+ } else {
414
+ if ((character === "(")) {
415
+ ((depth = (depth + 1)));
416
+ } else {
417
+ if ((character === ")")) {
418
+ ((depth = __eliscript_numeric_decrement(depth)));
419
+ if ((depth === 0)) {
420
+ ((done = true));
421
+ }
422
+ } else {
423
+
424
+ }
425
+ }
426
+ }
427
+ }
428
+ }
429
+ }
430
+ ((index = (index + 1)));
431
+ }
432
+ if ((!__eliscript_truthy(done))) {
433
+ fail("original observation invocation has no complete argument boundary");
434
+ }
435
+ return index;
436
+ }
437
+ }
438
+ }
439
+ function migrate_original_observation_record(record, assets, helper_url) {
440
+ {
441
+ let execution = (record)["execution"];
442
+ let host = ((__eliscript_value_20) => (__eliscript_truthy(__eliscript_value_20) ? (execution)["hostSource"] : __eliscript_value_20))(execution);
443
+ if ((((__eliscript_value_21, __eliscript_value_22) => (__eliscript_value_21 !== __eliscript_value_22))(((__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_truthy((host)["includes"]("function originalObservation("))))) {
444
+ return record;
445
+ } else {
446
+ {
447
+ let begin = (host)["indexOf"]("function originalObservation(");
448
+ let end = (host)["indexOf"]("function plain(", begin);
449
+ let original = (record)["original"];
450
+ let configuration = ({"recordId": (record)["id"], "sourceIdentity": hash(host)});
451
+ let declaration = (String("(import ") + String(JSON.stringify(helper_url)) + String(" runInheritedOriginalManagedObservation)\n") + String("(defasync originalObservation (source &optional engine args selected)") + String(" (await (runInheritedOriginalManagedObservation source engine args selected (JSON/parse ") + String(JSON.stringify(JSON.stringify(configuration))) + String("))))"));
452
+ let tail = (host)["slice"](end);
453
+ let parts = [];
454
+ let position = 0;
455
+ let calls = 0;
456
+ if ((!__eliscript_truthy(((__eliscript_value_23) => (__eliscript_truthy(__eliscript_value_23) ? ((__eliscript_value_24) => (__eliscript_truthy(__eliscript_value_24) ? (new (globalThis.RegExp)("^original-managed:"))["test"]((record)["id"]) : __eliscript_value_24))(((host)["indexOf"]("function originalObservation(", (begin + 1)) === -1)) : __eliscript_value_23))(__eliscript_numeric_relation(">=", end, 0))))) {
457
+ fail("original observation helper no longer identifies one maintained wrapper");
458
+ }
459
+ {
460
+ const __eliscript_value_25 = (tail)["indexOf"]("originalObservation(", position);
461
+ {
462
+ let at = __eliscript_value_25;
463
+ while (__eliscript_numeric_relation(">=", at, 0)) {
464
+ {
465
+ let prefix = (tail)["slice"](0, at);
466
+ let finish = original_observation_call_end(tail, at);
467
+ let call = (tail)["slice"](at, finish);
468
+ if ((!__eliscript_truthy(((__eliscript_value_26) => (__eliscript_truthy(__eliscript_value_26) ? __eliscript_value_26 : ((__eliscript_value_27) => (__eliscript_truthy(__eliscript_value_27) ? __eliscript_value_27 : (prefix)["endsWith"]("assert.deepEqual(")))((prefix)["endsWith"]("const actual="))))((prefix)["endsWith"]("const expected="))))) {
469
+ fail("original observation call is outside its authenticated wrapper grammar");
470
+ }
471
+ {
472
+ let program = compile_ir_string((String("(async () (await (js* ") + String(JSON.stringify(call)) + String(")))")), "original-observation-await.eli");
473
+ let function_node = ((((program)["body"])[0])["children"])[0];
474
+ let awaited = (emit_expression(((function_node)["children"])[0]))["text"];
475
+ (parts)["push"]((tail)["slice"](position, at), awaited);
476
+ }
477
+ ((position = finish), (calls = (calls + 1)));
478
+ }
479
+ ((at = (tail)["indexOf"]("originalObservation(", position)));
480
+ }
481
+ }
482
+ }
483
+ (parts)["push"]((tail)["slice"](position));
484
+ {
485
+ const __eliscript_value_28 = (((original)["sourceAssets"] ?? []))["slice"]();
486
+ {
487
+ let combined = __eliscript_value_28;
488
+ (assets)["forEach"](((asset) => {
489
+ {
490
+ const __eliscript_value_29 = (combined)["find"](((item) => {
491
+ return ((item)["file"] === (asset)["file"]);
492
+ }));
493
+ {
494
+ let previous = __eliscript_value_29;
495
+ if (__eliscript_truthy(((__eliscript_value_30) => (__eliscript_truthy(__eliscript_value_30) ? ((__eliscript_value_31, __eliscript_value_32) => (__eliscript_value_31 !== __eliscript_value_32))((previous)["sourceSha256"], (asset)["sourceSha256"]) : __eliscript_value_30))(previous))) {
496
+ fail("original observation transport source identity conflicts");
497
+ }
498
+ if ((!__eliscript_truthy(previous))) {
499
+ return (combined)["push"](asset);
500
+ } else {
501
+ return null;
502
+ }
503
+ }
504
+ }
505
+ }));
506
+ return Object.assign(({}), record, ({"execution": Object.assign(({}), execution, ({"hostSource": (String((host)["slice"](0, begin)) + String((__eliscript_numeric_relation(">", calls, 0) ? compile_string(declaration, "original-observation-helper.eli") : "")) + String(__eliscript_at_direct(parts, "join", "")))})), "original": Object.assign(({}), original, ({"sourceAssets": combined, "observationTransport": ({"kind": "original-managed-observation", "version": 1, "originalHostSource": host, "originalHostSha256": hash(host), "calls": calls})}))}));
507
+ }
508
+ }
509
+ }
510
+ }
511
+ }
512
+ }
513
+ async function observation_transport_options(options) {
514
+ return (((options == null) || ((__eliscript_value_33, __eliscript_value_34) => (__eliscript_value_33 !== __eliscript_value_34))(((__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; } })((options)["add"]), "function") || ((__eliscript_value_35, __eliscript_value_36) => (__eliscript_value_35 !== __eliscript_value_36))(((__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; } })((options)["file"]), "function") || ((__eliscript_value_37, __eliscript_value_38) => (__eliscript_value_37 !== __eliscript_value_38))(((__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; } })((options)["text"]), "function") || ((options)["stableFiles"] == null)) ? options : (await (async (files) => {
515
+ return (await (async (assets) => {
516
+ return (await (async (index) => {
517
+ return (await (async (add) => {
518
+ return (await (async (helper_url) => {
519
+ return (await (async () => {
520
+ (await (async () => {
521
+ while (__eliscript_numeric_relation("<", index, ((files) ?? []).length)) {
522
+ (await (async (filename) => {
523
+ return ((identity) => {
524
+ return (assets)["push"](({"file": filename, "sourceSha256": (identity)["sha256"]}));
525
+ })(await ((options)["file"](filename)));
526
+ })((files)[index]));
527
+ ((index = (index + 1)));
528
+ }
529
+ return null;
530
+ })());
531
+ return Object.assign(({}), options, ({"add": ((record) => {
532
+ return add(migrate_original_observation_record(record, assets, helper_url));
533
+ })}));
534
+ })());
535
+ })((pathToFileURL(resolve((options)["sourceRoot"], "tools/backends/compiler-corpus-managed-adapters.mjs")))["href"]));
536
+ })((options)["add"]));
537
+ })(0));
538
+ })([]));
539
+ })(["tools/backends/eliscript/compiler-corpus-managed-adapters.eli", "tools/backends/compiler-corpus-managed-adapters.mjs", "tools/backends/compiler-corpus-managed-adapters-legacy.mjs", "tools/backends/eliscript/compiler-corpus-process.eli", "tools/backends/compiler-corpus-process.mjs", "tools/backends/eliscript/compiler-corpus-program-driver.eli", "tools/backends/compiler-corpus-program-driver.mjs", "tools/backends/eliscript/managed-source-view.eli", "tools/backends/managed-source-view.mjs"])));
540
+ }
541
+ const suite = "tests/wasm-managed-sequence-data.test.mjs";
542
+ __eliscript_tdz_ready_1 = true;
543
+ const retained = "tests/wasm-managed-sequence-data-test-legacy.mjs";
544
+ __eliscript_tdz_ready_2 = true;
545
+ const maintained = "tests/eliscript/wasm-managed-sequence-data.eli";
546
+ __eliscript_tdz_ready_3 = true;
547
+ const fixture = "tests/fixtures/wasm-managed-sequence-data.eli";
548
+ __eliscript_tdz_ready_4 = true;
549
+ const identity_host = "tools/backends/eliscript/compiler-corpus-project-entry-host.eli";
550
+ __eliscript_tdz_ready_5 = true;
551
+ const transient_fixture = "tests/fixtures/wasm-managed-transient-state.eli";
552
+ __eliscript_tdz_ready_6 = true;
553
+ const transient_transports = ["tools/backends/eliscript/compiler-corpus-host-context.eli", "tools/backends/compiler-corpus-host-context.mjs", "tools/backends/compiler-corpus-host-context-legacy.mjs", "tools/backends/original-program-bun-launcher.el"];
554
+ __eliscript_tdz_ready_7 = true;
555
+ function hash(source) {
556
+ return ((createHash("sha256"))["update"](source))["digest"]("hex");
557
+ }
558
+ function fail(message) {
559
+ return ((__eliscript_value_39) => { throw __eliscript_value_39; })(new (globalThis.TypeError)(message));
560
+ }
561
+ function transient_transport_record(record, assets) {
562
+ if ((!__eliscript_truthy(((__eliscript_value_40) => (__eliscript_truthy(__eliscript_value_40) ? (new (globalThis.RegExp)("^original-managed:transient-state:(?:node|bun):auto-(?:65536|1)$"))["test"]((record)["id"]) : __eliscript_value_40))((((record)["original"])["fixture"] === (__eliscript_tdz_read_6())))))) {
563
+ return record;
564
+ } else {
565
+ {
566
+ let original = (record)["original"];
567
+ let combined = (((original)["sourceAssets"] ?? []))["slice"]();
568
+ (assets)["forEach"](((asset) => {
569
+ {
570
+ const __eliscript_value_41 = (combined)["find"](((item) => {
571
+ return ((item)["file"] === (asset)["file"]);
572
+ }));
573
+ {
574
+ let previous = __eliscript_value_41;
575
+ if (__eliscript_truthy(((__eliscript_value_42) => (__eliscript_truthy(__eliscript_value_42) ? ((__eliscript_value_43, __eliscript_value_44) => (__eliscript_value_43 !== __eliscript_value_44))((previous)["sourceSha256"], (asset)["sourceSha256"]) : __eliscript_value_42))(previous))) {
576
+ fail("original transient host transport source identity conflicts");
577
+ }
578
+ if ((!__eliscript_truthy(previous))) {
579
+ return (combined)["push"](asset);
580
+ } else {
581
+ return null;
582
+ }
583
+ }
584
+ }
585
+ }));
586
+ return Object.assign(({}), record, ({"original": Object.assign(({}), original, ({"sourceAssets": combined}))}));
587
+ }
588
+ }
589
+ }
590
+ async function transient_transport_options(options) {
591
+ return (((options == null) || ((__eliscript_value_45, __eliscript_value_46) => (__eliscript_value_45 !== __eliscript_value_46))(((__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; } })((options)["add"]), "function") || ((__eliscript_value_47, __eliscript_value_48) => (__eliscript_value_47 !== __eliscript_value_48))(((__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; } })((options)["text"]), "function") || ((__eliscript_value_49, __eliscript_value_50) => (__eliscript_value_49 !== __eliscript_value_50))(((__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; } })((options)["file"]), "function") || ((options)["stableFiles"] == null) || (!__eliscript_truthy(((options)["stableFiles"])["has"]((__eliscript_tdz_read_6()))))) ? options : (await (async (assets, index, add) => {
592
+ (await (async () => {
593
+ while (__eliscript_numeric_relation("<", index, (((__eliscript_tdz_read_7())) ?? []).length)) {
594
+ (await (async (filename) => {
595
+ return ((identity) => {
596
+ return (assets)["push"](({"file": filename, "sourceSha256": (identity)["sha256"]}));
597
+ })(await ((options)["file"](filename)));
598
+ })(((__eliscript_tdz_read_7()))[index]));
599
+ ((index = (index + 1)));
600
+ }
601
+ return null;
602
+ })());
603
+ return Object.assign(({}), options, ({"add": ((record) => {
604
+ return add(transient_transport_record(record, assets));
605
+ })}));
606
+ })([], 0, (options)["add"])));
607
+ }
608
+ function required_imports() {
609
+ return (["source-operation", "console-log-capture", "console-log"])["map"](((name) => {
610
+ return ({"name": name, "module": "eliscript.host", "arity": 2, "abi": "managed-host-call-v1"});
611
+ }));
612
+ }
613
+ function linker_refusal_record(record) {
614
+ if (((__eliscript_value_51, __eliscript_value_52) => (__eliscript_value_51 !== __eliscript_value_52))((record)["id"], "original-managed:core-modules:missing-private-graph")) {
615
+ return record;
616
+ } else {
617
+ return Object.assign(({}), record, ({"steps": ((record)["steps"])["map"](((step) => {
618
+ if (((__eliscript_value_53, __eliscript_value_54) => (__eliscript_value_53 !== __eliscript_value_54))((step)["id"], "unrelated-path-refusal")) {
619
+ return step;
620
+ } else {
621
+ return Object.assign(({}), step, ({"request": Object.assign(({}), (step)["request"], ({"resolveImports": false}))}));
622
+ }
623
+ }))}));
624
+ }
625
+ }
626
+ function linker_refusal_options(options) {
627
+ {
628
+ const __eliscript_value_55 = Object.create(options);
629
+ const __eliscript_value_56 = (options)["add"];
630
+ {
631
+ let forwarded = __eliscript_value_55;
632
+ let add = __eliscript_value_56;
633
+ Object.defineProperty(forwarded, "add", ({"value": ((record) => {
634
+ return add(linker_refusal_record(record));
635
+ }), "enumerable": true, "writable": true, "configurable": true}));
636
+ return forwarded;
637
+ }
638
+ }
639
+ }
640
+ function assertion_case(item, cases) {
641
+ {
642
+ let parameters = JSON.stringify((item)["parameters"]);
643
+ let found = (cases)["filter"](((candidate) => {
644
+ {
645
+ const __eliscript_value_57 = (candidate)["originalCase"];
646
+ {
647
+ let actual = __eliscript_value_57;
648
+ return (((actual)["title"] === (item)["title"]) && (JSON.stringify((actual)["parameters"]) === parameters));
649
+ }
650
+ }
651
+ }));
652
+ if ((!(((found) ?? []).length === 1))) {
653
+ fail("original sequence assertion no longer identifies one authentic retained case");
654
+ }
655
+ return Object.assign(({}), item, ((found)[0])["originalCase"], ({"id": (item)["id"], "sourceFile": (__eliscript_tdz_read_2())}));
656
+ }
657
+ }
658
+ function sequence_module_id(path) {
659
+ {
660
+ const __eliscript_value_58 = (posix)["normalize"](path);
661
+ {
662
+ let normalized = __eliscript_value_58;
663
+ if (__eliscript_truthy((normalized)["endsWith"](".eli"))) {
664
+ return ((normalized)["slice"](0, -4) + ".mjs");
665
+ } else {
666
+ return normalized;
667
+ }
668
+ }
669
+ }
670
+ }
671
+ function sequence_relative_imports(module) {
672
+ {
673
+ const __eliscript_value_59 = read_string((module)["source"], (module)["filename"]);
674
+ const __eliscript_value_60 = [];
675
+ {
676
+ let pending = __eliscript_value_59;
677
+ let imports = __eliscript_value_60;
678
+ while (__eliscript_numeric_relation(">", ((pending) ?? []).length, 0)) {
679
+ {
680
+ let node = (pending)["shift"]();
681
+ let items = (node)["items"];
682
+ let head = ((__eliscript_value_61) => (__eliscript_truthy(__eliscript_value_61) ? ((__eliscript_value_62) => (__eliscript_truthy(__eliscript_value_62) ? ((items)[0])["name"] : __eliscript_value_62))(__eliscript_numeric_relation(">", ((items) ?? []).length, 0)) : __eliscript_value_61))(items);
683
+ if ((head === "module")) {
684
+ __eliscript_at(Reflect, "apply")((pending)["push"], pending, (items)["slice"](2));
685
+ } else {
686
+ if (((head === "import") || (head === "import-portable"))) {
687
+ {
688
+ const __eliscript_value_63 = ((items)[1])["value"];
689
+ {
690
+ let specifier = __eliscript_value_63;
691
+ if (__eliscript_truthy(((__eliscript_value_64) => (__eliscript_truthy(__eliscript_value_64) ? (specifier)["startsWith"](".") : __eliscript_value_64))((((__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")))) {
692
+ (imports)["push"](sequence_module_id(__eliscript_at(posix, "join")((posix)["dirname"]((module)["id"]), specifier)));
693
+ }
694
+ }
695
+ }
696
+ } else {
697
+
698
+ }
699
+ }
700
+ }
701
+ }
702
+ return imports;
703
+ }
704
+ }
705
+ }
706
+ function sequence_project_modules(original, libraries) {
707
+ {
708
+ const __eliscript_value_65 = [];
709
+ const __eliscript_value_66 = new (globalThis.Set)();
710
+ const __eliscript_value_67 = new (globalThis.Map)();
711
+ const __eliscript_value_68 = 0;
712
+ {
713
+ let modules = __eliscript_value_65;
714
+ let ids = __eliscript_value_66;
715
+ let canonical = __eliscript_value_67;
716
+ let index = __eliscript_value_68;
717
+ (libraries)["forEach"](((library) => {
718
+ return (canonical)["set"]((library)["id"], library);
719
+ }));
720
+ (original)["forEach"](((module) => {
721
+ (ids)["add"]((module)["id"]);
722
+ return (modules)["push"](Object.assign(({}), module, ({"filename": (((module)["id"])["slice"](0, -4) + ".eli")})));
723
+ }));
724
+ while (__eliscript_numeric_relation("<", index, ((modules) ?? []).length)) {
725
+ (sequence_relative_imports((modules)[index]))["forEach"](((target) => {
726
+ if ((!__eliscript_truthy((ids)["has"](target)))) {
727
+ {
728
+ const __eliscript_value_69 = (canonical)["get"](target);
729
+ {
730
+ let library = __eliscript_value_69;
731
+ if (__eliscript_truthy(library)) {
732
+ (ids)["add"](target);
733
+ return (modules)["push"](({"id": target, "filename": ((target)["slice"](0, -4) + ".eli"), "source": (library)["source"]}));
734
+ } else {
735
+ return null;
736
+ }
737
+ }
738
+ }
739
+ } else {
740
+ return null;
741
+ }
742
+ }));
743
+ ((index = (index + 1)));
744
+ }
745
+ return modules;
746
+ }
747
+ }
748
+ }
749
+ function sequence_record(record, cases, proof, assets, libraries) {
750
+ if (((__eliscript_value_70, __eliscript_value_71) => (__eliscript_value_70 !== __eliscript_value_71))(((record)["original"])["suite"], (__eliscript_tdz_read_1()))) {
751
+ return record;
752
+ } else {
753
+ {
754
+ let original = (record)["original"];
755
+ let bound = ((original)["cases"])["map"](((item) => {
756
+ return assertion_case(item, cases);
757
+ }));
758
+ let existing = (original)["sourceAssets"];
759
+ let source_assets = (((existing == null) ? [] : existing))["slice"]();
760
+ (assets)["forEach"](((asset) => {
761
+ {
762
+ const __eliscript_value_72 = (source_assets)["find"](((item) => {
763
+ return ((item)["file"] === (asset)["file"]);
764
+ }));
765
+ {
766
+ let previous = __eliscript_value_72;
767
+ if (__eliscript_truthy(previous)) {
768
+ if ((!((previous)["sourceSha256"] === (asset)["sourceSha256"]))) {
769
+ return fail("original sequence assertion source asset identity conflicts");
770
+ } else {
771
+ return null;
772
+ }
773
+ } else {
774
+ return (source_assets)["push"](asset);
775
+ }
776
+ }
777
+ }
778
+ }));
779
+ return Object.assign(({}), record, ({"modules": sequence_project_modules((record)["modules"], libraries), "execution": Object.assign(({}), (record)["execution"], ({"zeroImports": false, "requiredManagedImports": required_imports()})), "original": Object.assign(({}), original, ({"cases": bound, "assertionSource": proof, "sourceAssets": source_assets}))}));
780
+ }
781
+ }
782
+ }
783
+ function sequence_host_record(record, javascript) {
784
+ if (__eliscript_truthy(((__eliscript_value_73) => (__eliscript_truthy(__eliscript_value_73) ? (new (globalThis.RegExp)("^original-managed:sequence-data-standard-identities:(node|bun):auto-65536$"))["test"]((record)["id"]) : __eliscript_value_73))((((record)["original"])["suite"] === (__eliscript_tdz_read_1()))))) {
785
+ {
786
+ const __eliscript_value_74 = ((record)["execution"])["hostSource"];
787
+ {
788
+ let host = __eliscript_value_74;
789
+ return Object.assign(({}), record, ({"execution": Object.assign(({}), (record)["execution"], ({"hostSource": javascript})), "original": Object.assign(({}), (record)["original"], ({"observationTransport": ({"kind": "original-managed-standard-identities-host", "version": 1, "originalHostSource": host, "originalHostSha256": hash(host), "calls": 0})}))}));
790
+ }
791
+ }
792
+ } else {
793
+ return record;
794
+ }
795
+ }
796
+ function sequence_observation_record(record, inputs, helper_url) {
797
+ {
798
+ const __eliscript_value_75 = (new (globalThis.RegExp)("^original-managed:sequence-data-host-(transducer|core-stdlib|data-text|value-hash|lazy-sequence|core-text-object):(node|bun):auto-65536$"))["exec"]((record)["id"]);
799
+ {
800
+ let match = __eliscript_value_75;
801
+ if ((!__eliscript_truthy(match))) {
802
+ return record;
803
+ } else {
804
+ {
805
+ let family = (match)[1];
806
+ let input = (inputs)["get"](family);
807
+ let configuration = ({"family": family, "engine": (match)[2], "recordId": (record)["id"], "source": (input)["source"], "sourceIdentity": (input)["sourceSha256"], "publicIds": (((record)["modules"])["filter"](((item) => {
808
+ return ((item)["id"])["startsWith"]("public/runtime/");
809
+ })))["map"](((item) => {
810
+ return (item)["id"];
811
+ }))});
812
+ let host_source = (String("(import ") + String(JSON.stringify(helper_url)) + String(" runOriginalManagedSequenceHost)\n") + String(originalManagedProgramCompletionSource((String("(await (runOriginalManagedSequenceHost (JSON/parse ") + String(JSON.stringify(JSON.stringify(configuration))) + String(")))")))));
813
+ let original = (record)["original"];
814
+ let assets = ((original)["sourceAssets"])["slice"]();
815
+ if ((!__eliscript_truthy((assets)["some"](((asset) => {
816
+ return ((asset)["file"] === (input)["file"]);
817
+ }))))) {
818
+ (assets)["push"](({"file": (input)["file"], "sourceSha256": (input)["sourceSha256"]}));
819
+ }
820
+ return Object.assign(({}), record, ({"execution": Object.assign(({}), (record)["execution"], ({"hostSource": compile_string(host_source, "original-sequence-observation-host.eli")})), "original": Object.assign(({}), original, ({"sourceAssets": assets, "observationTransport": ({"kind": "original-managed-sequence-host", "version": 1, "originalHostSource": ((record)["execution"])["hostSource"], "originalHostSha256": hash(((record)["execution"])["hostSource"]), "sourceFile": (input)["file"], "sourceSha256": (input)["sourceSha256"]})}))}));
821
+ }
822
+ }
823
+ }
824
+ }
825
+ }
826
+ async function addOriginalManagedLibraryAdapters(options) {
827
+ ((options = await (observation_transport_options(await (transient_transport_options(options))))));
828
+ return (((options == null) || ((__eliscript_value_76, __eliscript_value_77) => (__eliscript_value_76 !== __eliscript_value_77))(((__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; } })((options)["text"]), "function") || ((__eliscript_value_78, __eliscript_value_79) => (__eliscript_value_78 !== __eliscript_value_79))(((__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; } })((options)["file"]), "function") || ((__eliscript_value_80, __eliscript_value_81) => (__eliscript_value_80 !== __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; } })((options)["add"]), "function") || ((options)["stableFiles"] == null)) ? await ((legacy)["addOriginalManagedLibraryAdapters"](options)) : ((!__eliscript_truthy(((options)["stableFiles"])["has"]((__eliscript_tdz_read_4())))) ? await ((legacy)["addOriginalManagedLibraryAdapters"](linker_refusal_options(options))) : (await (async (text) => {
829
+ return (await (async (file) => {
830
+ return (await (async (add) => {
831
+ return (await (async (source) => {
832
+ return (await (async (identity) => {
833
+ return (await (async (cases) => {
834
+ return (await (async (proof) => {
835
+ return (await (async (assets) => {
836
+ return (await (async (inputs) => {
837
+ return (await (async (files) => {
838
+ return (await (async (index) => {
839
+ return (await (async () => {
840
+ 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") && (hash(source) === (identity)["sha256"]) && ((Buffer)["byteLength"](source) === (identity)["bytes"])))) {
841
+ fail("original sequence assertion text differs from its source asset");
842
+ }
843
+ (await (async () => {
844
+ while (__eliscript_numeric_relation("<", index, ((files) ?? []).length)) {
845
+ (await (async (filename) => {
846
+ return ((asset) => {
847
+ return (assets)["push"](({"file": filename, "sourceSha256": (asset)["sha256"]}));
848
+ })(await (file(filename)));
849
+ })((files)[index]));
850
+ ((index = (index + 1)));
851
+ }
852
+ return null;
853
+ })());
854
+ return (await (async (libraries) => {
855
+ return (await (async (host_source) => {
856
+ return (await (async (host_identity) => {
857
+ return (await (async (javascript) => {
858
+ return (await (async (dependency) => {
859
+ return (await (async (forwarded) => {
860
+ return (await (async () => {
861
+ if ((!((hash(host_source) === (host_identity)["sha256"]) && ((Buffer)["byteLength"](host_source) === (host_identity)["bytes"])))) {
862
+ fail("original sequence identity host text differs from its source asset");
863
+ }
864
+ ((index = 0));
865
+ (await (async () => {
866
+ while (__eliscript_numeric_relation("<", index, ((libraries) ?? []).length)) {
867
+ (await (async (library) => {
868
+ return (await (async (filename) => {
869
+ return ((identity) => {
870
+ return (() => {
871
+ if ((!(hash((library)["source"]) === (identity)["sha256"]))) {
872
+ fail("original sequence canonical source differs from its source asset");
873
+ }
874
+ return (assets)["push"](({"file": filename, "sourceSha256": (identity)["sha256"]}));
875
+ })();
876
+ })(await (file(filename)));
877
+ })((library)["filename"]));
878
+ })((libraries)[index]));
879
+ ((index = (index + 1)));
880
+ }
881
+ return null;
882
+ })());
883
+ (await (async (families, position) => {
884
+ return (await (async () => {
885
+ while (__eliscript_numeric_relation("<", position, ((families) ?? []).length)) {
886
+ (await (async (family) => {
887
+ return (await (async (filename) => {
888
+ return (await (async (body) => {
889
+ return ((identity) => {
890
+ return (() => {
891
+ if ((!((hash(body) === (identity)["sha256"]) && ((Buffer)["byteLength"](body) === (identity)["bytes"])))) {
892
+ fail("original sequence host source differs from its authenticated bytes");
893
+ }
894
+ return (inputs)["set"](family, ({"source": body, "file": filename, "sourceSha256": (identity)["sha256"]}));
895
+ })();
896
+ })(await (file(filename)));
897
+ })(await (text(filename))));
898
+ })((String("tests/fixtures/") + String(family) + String("-host.mjs"))));
899
+ })((families)[position]));
900
+ ((position = (position + 1)));
901
+ }
902
+ return null;
903
+ })());
904
+ })(["transducer", "core-stdlib", "data-text", "value-hash", "lazy-sequence", "core-text-object"], 0));
905
+ ((forwarded)["text"] = (async (filename) => {
906
+ return ((filename === (__eliscript_tdz_read_1())) ? source : await (text(filename)));
907
+ }));
908
+ ((forwarded)["add"] = ((record) => {
909
+ {
910
+ let selected = linker_refusal_record(sequence_host_record(sequence_observation_record(sequence_record(record, cases, proof, assets, libraries), inputs, (pathToFileURL(resolve((options)["sourceRoot"], "tools/backends/compiler-corpus-managed-adapters.mjs")))["href"]), javascript));
911
+ let transport = ((selected)["original"])["observationTransport"];
912
+ return add((__eliscript_truthy(((__eliscript_value_82) => (__eliscript_truthy(__eliscript_value_82) ? ((transport)["kind"] === "original-managed-standard-identities-host") : __eliscript_value_82))(transport)) ? bindOriginalProcessHostDependency(selected, dependency) : selected));
913
+ }
914
+ }));
915
+ return await ((legacy)["addOriginalManagedLibraryAdapters"](forwarded));
916
+ })());
917
+ })(Object.assign(({}), options)));
918
+ })(await (readOriginalProcessHostDependency(options))));
919
+ })(compile_string(host_source, (__eliscript_tdz_read_5()))));
920
+ })(await (file((__eliscript_tdz_read_5())))));
921
+ })(await (text((__eliscript_tdz_read_5())))));
922
+ })(await (loadLiteralSources(({"sourceRoot": (options)["sourceRoot"]})))));
923
+ })());
924
+ })(0));
925
+ })([(__eliscript_tdz_read_1()), (__eliscript_tdz_read_2()), (__eliscript_tdz_read_3()), (__eliscript_tdz_read_5()), "tools/backends/eliscript/compiler-corpus-managed-adapters.eli", "tools/backends/compiler-corpus-managed-adapters.mjs", "tools/backends/eliscript/compiler-corpus-process.eli", "tools/backends/compiler-corpus-process.mjs", "tools/backends/eliscript/compiler-corpus-program-driver.eli", "tools/backends/compiler-corpus-program-driver.mjs", "tools/backends/eliscript/managed-source-view.eli", "tools/backends/managed-source-view.mjs", "tools/backends/eliscript/compiler-corpus-host-context.eli", "tools/backends/compiler-corpus-host-context.mjs", "tools/backends/eliscript/managed-foreign-binding.eli", "tools/backends/managed-foreign-binding.mjs", "tools/backends/eliscript/managed-host.eli", "tools/backends/managed-host.mjs", "tools/backends/managed-host-legacy.mjs", "tools/backends/eliscript/managed-host-runtime.eli", "tools/backends/managed-host-runtime.mjs", "tools/backends/managed-host-runtime.mjs.map", "tools/backends/eliscript/managed-host-lifecycle.eli", "tools/backends/managed-host-lifecycle.mjs", "tools/backends/eliscript/managed-host-object-provider.eli", "tools/backends/managed-host-object-provider.mjs", "tools/backends/eliscript/managed-host-object-realm.eli", "tools/backends/managed-host-object-realm.mjs"]));
926
+ })(new (globalThis.Map)()));
927
+ })([]));
928
+ })(({"file": (__eliscript_tdz_read_2()), "sourceSha256": (identity)["sha256"], "bytes": (identity)["bytes"]})));
929
+ })(originalSourceCaseLocators((__eliscript_tdz_read_1()), source)));
930
+ })(await (file((__eliscript_tdz_read_2())))));
931
+ })(await (text((__eliscript_tdz_read_2())))));
932
+ })((options)["add"]));
933
+ })((options)["file"]));
934
+ })((options)["text"]))));
935
+ }
936
+ export {addOriginalManagedLibraryAdapters, originalManagedObservationLaunch, runOriginalManagedObservation, runOriginalManagedSequenceHost, runInheritedOriginalManagedObservation, originalManagedProgramCompletionSource};
937
+ //# sourceMappingURL=compiler-corpus-managed-adapters.mjs.map