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,694 @@
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("managedHostModuleEdges"); return managedHostModuleEdges; }
5
+ function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("managedHostModuleEdges"); 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("project_boundaries"); return project_boundaries; }
8
+ function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("project_boundaries"); 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("prepared_load_results"); return prepared_load_results; }
11
+ function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("prepared_load_results"); return __eliscript_const_error(); }
12
+ import "eliscript/runtime/unicode-case.mjs";
13
+ import { c as __eliscript_at, d as __eliscript_at_direct } from "data:text/javascript;base64,dmFyIG09UmVmbGVjdC5hcHBseSx0dD1OdW1iZXIucHJvdG90eXBlLnZhbHVlT2Ysaj1OdW1iZXIucHJvdG90eXBlLnRvU3RyaW5nLFU9TnVtYmVyLG50PU9iamVjdC5jcmVhdGUsaD1CaWdJbnQsZXQ9RGF0YVZpZXcsb3Q9QXJyYXlCdWZmZXIsaXQ9RGF0YVZpZXcucHJvdG90eXBlLnNldE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+TChpLGYsU3QoYix1KSk7VChwLHB0LHt2YWx1ZToodSk9PnUgaW5zdGFuY2VvZiBpLGNvbmZpZ3VyYWJsZTohMH0pO2xldCByPXMoRSxwLFt2b2lkIDBdKTt1dChyLGZ0KG8pKTtsZXQgbD1hdChvKTtmb3IobGV0IHU9MDt1PGwubGVuZ3RoO3UrKylUKHIsbFt1XSxsdChvLGxbdV0pKTtyZXR1cm4gcn1yZXR1cm4gcyh0LG4sZSl9fWZ1bmN0aW9uIFJ0KHQsbil7bGV0IGU9dFtuXTtyZXR1cm4oLi4ubyk9PkwoZSx0LG8pfWZ1bmN0aW9uIEF0KHQsbiwuLi5lKXtsZXQgbz10W25dO3JldHVybiBMKG8sdCxlKX1leHBvcnR7UnQgYXMgYyxBdCBhcyBkfTs=";
14
+ const __eliscript_truthy = (value) => value !== false && value != null;
15
+ const __eliscript_number_intrinsic = globalThis.Number;
16
+ const __eliscript_bigint_intrinsic = globalThis.BigInt;
17
+ const __eliscript_numeric_apply = globalThis.Reflect.apply;
18
+ const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
19
+ const __eliscript_numeric_error = globalThis.TypeError;
20
+ const __eliscript_numeric_trim = globalThis.String.prototype.trim;
21
+ const __eliscript_numeric_slice = globalThis.String.prototype.slice;
22
+ const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
23
+ const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
24
+ const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
25
+ const __eliscript_numeric_primitive = (value) => {
26
+ if (!__eliscript_numeric_object(value)) return value;
27
+ const exotic = value[__eliscript_numeric_symbol];
28
+ if (exotic !== void 0 && exotic !== null) {
29
+ const result = __eliscript_numeric_apply(exotic, value, ["number"]);
30
+ if (!__eliscript_numeric_object(result)) return result;
31
+ throw new __eliscript_numeric_error("Cannot convert object to primitive value");
32
+ }
33
+ for (let index = 0; index < 2; index++) {
34
+ const method = value[index === 0 ? "valueOf" : "toString"];
35
+ if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
36
+ const result = __eliscript_numeric_apply(method, value, []);
37
+ if (!__eliscript_numeric_object(result)) return result;
38
+ }
39
+ }
40
+ throw new __eliscript_numeric_error("Cannot convert object to primitive value");
41
+ };
42
+ const __eliscript_to_number = (value) => {
43
+ const primitive = __eliscript_numeric_primitive(value);
44
+ if (typeof primitive === "string") {
45
+ const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
46
+ if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
47
+ let first = 2;
48
+ while (first < text.length && text[first] === "0") first++;
49
+ if (first === text.length) return 0;
50
+ const prefix = text[1];
51
+ const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
52
+ if (text.length - first > limit) return 1 / 0;
53
+ const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
54
+ return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
55
+ }
56
+ }
57
+ return __eliscript_number_intrinsic(primitive);
58
+ };
59
+ const __eliscript_numeric = (value) => {
60
+ if (typeof value === "number" || typeof value === "bigint") return value;
61
+ const primitive = __eliscript_numeric_primitive(value);
62
+ if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
63
+ return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
64
+ };
65
+ const __eliscript_implicit_number = (value) => {
66
+ if (typeof value === "number") return value;
67
+ const primitive = __eliscript_numeric_primitive(value);
68
+ if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
69
+ return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
70
+ };
71
+ const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
72
+ const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
73
+ const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
74
+ const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
75
+ const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
76
+ const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
77
+ const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
78
+ const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
79
+ const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
80
+ const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
81
+ const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
82
+ const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
83
+ const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
84
+ const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
85
+ const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
86
+ const __eliscript_numeric_relation = (operator, left, right) => {
87
+ if (typeof left === "number" && typeof right === "number") {
88
+ if (operator === "<") return left < right;
89
+ if (operator === "<=") return left <= right;
90
+ if (operator === ">") return left > right;
91
+ return left >= right;
92
+ }
93
+ let a = __eliscript_numeric_primitive(left);
94
+ let b = __eliscript_numeric_primitive(right);
95
+ const x = typeof a, y = typeof b;
96
+ if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
97
+ a = __eliscript_numeric(a);
98
+ b = __eliscript_numeric(b);
99
+ }
100
+ if (operator === "<") return a < b;
101
+ if (operator === "<=") return a <= b;
102
+ if (operator === ">") return a > b;
103
+ return a >= b;
104
+ };
105
+
106
+ import * as legacy from "./managed-module-graph-legacy.mjs";
107
+ import {bindManagedSourceBoundary, withManagedSourceBoundary, withManagedSourceBindingPoll, withManagedSourceDecode, registerManagedSourceDecodeRuntime} from "./managed-source-view.mjs";
108
+ import {compile_string} from "../../dist/bootstrap/compiler.mjs";
109
+ const managedHostModuleEdges = (legacy)["managedHostModuleEdges"];
110
+ __eliscript_tdz_ready_0 = true;
111
+ const project_boundaries = new (globalThis.WeakMap)();
112
+ __eliscript_tdz_ready_1 = true;
113
+ const prepared_load_results = new (globalThis.WeakMap)();
114
+ __eliscript_tdz_ready_2 = true;
115
+ function prepared_project_plan(descriptor) {
116
+ {
117
+ let project = (descriptor)["project"];
118
+ let bindings = (project)["preparedBindings"];
119
+ let cells = new (globalThis.Map)();
120
+ let exports = new (globalThis.Map)();
121
+ let modules = [];
122
+ if ((bindings === undefined)) {
123
+ return null;
124
+ } else {
125
+ if ((!__eliscript_truthy(Array.isArray(bindings)))) {
126
+ ((__eliscript_value_1) => { throw __eliscript_value_1; })(new (globalThis.TypeError)("prepared project bindings must be an array"));
127
+ }
128
+ (bindings)["forEach"](((binding) => {
129
+ if ((!__eliscript_truthy(((__eliscript_value_2) => (__eliscript_truthy(__eliscript_value_2) ? ((__eliscript_value_3) => (__eliscript_truthy(__eliscript_value_3) ? ((__eliscript_value_4) => (__eliscript_truthy(__eliscript_value_4) ? ((__eliscript_value_5) => (__eliscript_truthy(__eliscript_value_5) ? ((__eliscript_value_6) => (__eliscript_truthy(__eliscript_value_6) ? ((__eliscript_value_7) => (__eliscript_truthy(__eliscript_value_7) ? ((__eliscript_value_8) => (__eliscript_truthy(__eliscript_value_8) ? (__eliscript_numeric_relation("<", (binding)["index"], ((descriptor)["module"])["bindingCount"]) && (!__eliscript_truthy((cells)["has"]((binding)["index"])))) : __eliscript_value_8))(Number.isSafeInteger(((descriptor)["module"])["bindingCount"])) : __eliscript_value_7))(__eliscript_numeric_relation(">=", (binding)["index"], 0)) : __eliscript_value_6))(Number.isSafeInteger((binding)["index"])) : __eliscript_value_5))((((__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; } })((binding)["mutable"]) === "boolean")) : __eliscript_value_4))((((__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; } })((binding)["name"]) === "string")) : __eliscript_value_3))(((binding)["kind"] === 0)) : __eliscript_value_2))(binding)))) {
130
+ ((__eliscript_value_9) => { throw __eliscript_value_9; })(new (globalThis.TypeError)("invalid canonical prepared project binding"));
131
+ }
132
+ return (cells)["set"]((binding)["index"], binding);
133
+ }));
134
+ ((project)["modules"])["forEach"](((module) => {
135
+ {
136
+ const __eliscript_value_10 = [];
137
+ const __eliscript_value_11 = [];
138
+ const __eliscript_value_12 = new (globalThis.Set)();
139
+ {
140
+ let remaining = __eliscript_value_10;
141
+ let forwarded = __eliscript_value_11;
142
+ let names = __eliscript_value_12;
143
+ ((module)["steps"])["forEach"](((step) => {
144
+ return ((step)["initializes"])["forEach"](((binding) => {
145
+ if (__eliscript_truthy(((__eliscript_value_13) => (__eliscript_truthy(__eliscript_value_13) ? (cells)["has"]((binding)["index"]) : __eliscript_value_13))(((binding)["kind"] === 0)))) {
146
+ return ((__eliscript_value_14) => { throw __eliscript_value_14; })(new (globalThis.TypeError)("prepared project cell also has a lexical initialization phase"));
147
+ } else {
148
+ return null;
149
+ }
150
+ }));
151
+ }));
152
+ ((module)["exports"])["forEach"](((binding) => {
153
+ {
154
+ const __eliscript_value_15 = ((__eliscript_value_16) => (__eliscript_truthy(__eliscript_value_16) ? (cells)["get"]((binding)["index"]) : __eliscript_value_16))(((binding)["kind"] === 0));
155
+ {
156
+ let prepared = __eliscript_value_15;
157
+ 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; } })((binding)["name"]) === "string") && (!__eliscript_truthy((names)["has"]((binding)["name"])))))) {
158
+ ((__eliscript_value_17) => { throw __eliscript_value_17; })(new (globalThis.TypeError)("invalid managed project export"));
159
+ }
160
+ (names)["add"]((binding)["name"]);
161
+ if (__eliscript_truthy(prepared)) {
162
+ if ((!((binding)["mutable"] === (prepared)["mutable"]))) {
163
+ ((__eliscript_value_18) => { throw __eliscript_value_18; })(new (globalThis.TypeError)("conflicting canonical prepared project binding"));
164
+ }
165
+ return (forwarded)["push"](binding);
166
+ } else {
167
+ return (remaining)["push"](binding);
168
+ }
169
+ }
170
+ }
171
+ }));
172
+ if (__eliscript_numeric_relation(">", ((forwarded) ?? []).length, 0)) {
173
+ (exports)["set"]((module)["id"], forwarded);
174
+ }
175
+ return (modules)["push"](Object.assign(({}), module, ({"exports": remaining})));
176
+ }
177
+ }
178
+ }));
179
+ if (((exports)["size"] === 0)) {
180
+ return null;
181
+ } else {
182
+ return ({"descriptor": Object.assign(({}), descriptor, ({"project": Object.assign(({}), project, ({"modules": modules}))})), "exports": exports});
183
+ }
184
+ }
185
+ }
186
+ }
187
+ function prepared_relative(from, to) {
188
+ {
189
+ const __eliscript_value_19 = (from)["split"]("/");
190
+ const __eliscript_value_20 = (to)["split"]("/");
191
+ const __eliscript_value_21 = [];
192
+ {
193
+ let left = __eliscript_value_19;
194
+ let right = __eliscript_value_20;
195
+ let parts = __eliscript_value_21;
196
+ (left)["pop"]();
197
+ while ((__eliscript_numeric_relation(">", ((left) ?? []).length, 0) && __eliscript_numeric_relation(">", ((right) ?? []).length, 0) && ((left)[0] === (right)[0]))) {
198
+ (left)["shift"]();
199
+ (right)["shift"]();
200
+ }
201
+ (left)["forEach"](((part) => {
202
+ return (parts)["push"]("..");
203
+ }));
204
+ (right)["forEach"](((part) => {
205
+ return (parts)["push"](part);
206
+ }));
207
+ {
208
+ const __eliscript_value_22 = __eliscript_at_direct(parts, "join", "/");
209
+ {
210
+ let path = __eliscript_value_22;
211
+ if (__eliscript_truthy((path)["startsWith"]("."))) {
212
+ return path;
213
+ } else {
214
+ return ("./" + path);
215
+ }
216
+ }
217
+ }
218
+ }
219
+ }
220
+ }
221
+ function prepared_binding_source(file, registry, bindings) {
222
+ {
223
+ const __eliscript_value_23 = new (globalThis.Set)();
224
+ const __eliscript_value_24 = "__prepared_registry";
225
+ const __eliscript_value_25 = [];
226
+ const __eliscript_value_26 = 0;
227
+ {
228
+ let names = __eliscript_value_23;
229
+ let alias = __eliscript_value_24;
230
+ let forms = __eliscript_value_25;
231
+ let index = __eliscript_value_26;
232
+ (bindings)["forEach"](((binding) => {
233
+ return (names)["add"]((binding)["name"]);
234
+ }));
235
+ while (__eliscript_truthy((names)["has"](alias))) {
236
+ ((alias = (alias + "_")));
237
+ }
238
+ (forms)["push"]((String("(import ") + String(JSON.stringify(prepared_relative(file, registry))) + String(" :as ") + String(alias) + String(")")));
239
+ (bindings)["forEach"](((binding) => {
240
+ {
241
+ let name = (binding)["name"];
242
+ let default$ = (name === "default");
243
+ let local = (__eliscript_truthy(default$) ? (String(alias) + String("_default_") + String(index)) : name);
244
+ let next = (String(alias) + String("_next_") + String(index));
245
+ (forms)["push"]((String("(defvar ") + String(local) + String(" (js-call (") + String(alias) + String("/graph) :read 0 ") + String((binding)["index"]) + String("))")));
246
+ (forms)["push"]((String("(js-call (") + String(alias) + String("/graph) :watch 0 ") + String((binding)["index"]) + String(" (lambda (") + String(next) + String(") (setq ") + String(local) + String(" ") + String(next) + String(")))")));
247
+ (forms)["push"]((__eliscript_truthy(default$) ? (String("(export-default ") + String(local) + String(")")) : (String("(export ") + String(local) + String(")"))));
248
+ return ((index = (index + 1)));
249
+ }
250
+ }));
251
+ return compile_string(__eliscript_at_direct(forms, "join", "\n"), (file + ".prepared.eli"));
252
+ }
253
+ }
254
+ }
255
+ function prepared_project_facades(plan, options) {
256
+ {
257
+ let base = (legacy)["createManagedProjectFacades"]((plan)["descriptor"], options);
258
+ let files = ((base)["files"])["map"](((file) => {
259
+ {
260
+ const __eliscript_value_27 = ((plan)["exports"])["get"]((file)["id"]);
261
+ {
262
+ let bindings = __eliscript_value_27;
263
+ if ((!__eliscript_truthy(bindings))) {
264
+ return file;
265
+ } else {
266
+ return Object.freeze(({"id": (file)["id"], "source": (String((file)["source"]) + String("\n") + String(prepared_binding_source((file)["id"], (base)["registry"], bindings)))}));
267
+ }
268
+ }
269
+ }
270
+ }));
271
+ return Object.freeze(Object.assign(({}), base, ({"files": Object.freeze(files)})));
272
+ }
273
+ }
274
+ function createManagedProjectFacades(descriptor, ...arguments$) {
275
+ {
276
+ let options = (__eliscript_numeric_relation(">", ((arguments$) ?? []).length, 0) ? (arguments$)[0] : undefined);
277
+ let plan = prepared_project_plan(descriptor);
278
+ if (__eliscript_truthy(plan)) {
279
+ return prepared_project_facades(plan, options);
280
+ } else {
281
+ return (legacy)["createManagedProjectFacades"](descriptor, options);
282
+ }
283
+ }
284
+ }
285
+ async function loadManagedProjectGraph(runtime, descriptor, ...arguments$) {
286
+ return (await (async (options) => {
287
+ return (await (async (plan) => {
288
+ return ((!__eliscript_truthy(plan)) ? await ((legacy)["loadManagedProjectGraph"](runtime, descriptor, options)) : (await (async (configuration) => {
289
+ return (await (async (facades) => {
290
+ return ((loaded) => {
291
+ return ((previous) => {
292
+ if (__eliscript_truthy(previous)) {
293
+ return previous;
294
+ } else {
295
+ {
296
+ const __eliscript_value_28 = Object.freeze(Object.assign(({}), loaded, ({"facades": facades})));
297
+ {
298
+ let result = __eliscript_value_28;
299
+ ((__eliscript_tdz_read_2()))["set"](loaded, result);
300
+ return result;
301
+ }
302
+ }
303
+ }
304
+ })(((__eliscript_tdz_read_2()))["get"](loaded));
305
+ })(await ((legacy)["loadManagedProjectGraph"](runtime, (plan)["descriptor"], options)));
306
+ })(prepared_project_facades(plan, ({"entry": (((configuration)["projectEntry"] == null) ? ((descriptor)["project"])["entry"] : (configuration)["projectEntry"]), "privateDirectory": (configuration)["projectPrivateDirectory"]}))));
307
+ })(((options === undefined) ? ({}) : options))));
308
+ })(prepared_project_plan(descriptor)));
309
+ })((__eliscript_numeric_relation(">", ((arguments$) ?? []).length, 0) ? (arguments$)[0] : undefined)));
310
+ }
311
+ function pure_project_description(descriptor) {
312
+ {
313
+ const __eliscript_value_29 = ["hostCapabilities", "hostModules"];
314
+ const __eliscript_value_30 = 0;
315
+ const __eliscript_value_31 = true;
316
+ {
317
+ let fields = __eliscript_value_29;
318
+ let index = __eliscript_value_30;
319
+ let pure = __eliscript_value_31;
320
+ while (__eliscript_truthy(((__eliscript_value_32) => (__eliscript_truthy(__eliscript_value_32) ? __eliscript_numeric_relation("<", index, ((fields) ?? []).length) : __eliscript_value_32))(pure))) {
321
+ {
322
+ const __eliscript_value_33 = Object.getOwnPropertyDescriptor(descriptor, (fields)[index]);
323
+ {
324
+ let field = __eliscript_value_33;
325
+ if (__eliscript_truthy(field)) {
326
+ if ((!__eliscript_truthy(((__eliscript_value_34) => (__eliscript_truthy(__eliscript_value_34) ? ((__eliscript_value_35) => (__eliscript_truthy(__eliscript_value_35) ? __eliscript_value_35 : ((__eliscript_value_36) => (__eliscript_truthy(__eliscript_value_36) ? ((((field)["value"]) ?? []).length === 0) : __eliscript_value_36))(Array.isArray((field)["value"]))))(((field)["value"] === undefined)) : __eliscript_value_34))(Object.hasOwn(field, "value"))))) {
327
+ ((pure = false));
328
+ }
329
+ }
330
+ }
331
+ }
332
+ ((index = (index + 1)));
333
+ }
334
+ return pure;
335
+ }
336
+ }
337
+ }
338
+ function graph_method(descriptors, name, method) {
339
+ {
340
+ let entry = (descriptors)[name];
341
+ let previous = (entry)["value"];
342
+ Object.defineProperties(method, ({"name": ({"value": (previous)["name"]}), "length": ({"value": (previous)["length"]})}));
343
+ return ((entry)["value"] = method);
344
+ }
345
+ }
346
+ function observed_project_method(method, receiver, name, state) {
347
+ return ((...arguments$) => {
348
+ if (((name === "close") || (name === "closeModule"))) {
349
+ return (() => {
350
+ try {
351
+ return __eliscript_at(Reflect, "apply")(method, receiver, arguments$);
352
+ } finally {
353
+ ((state)["stopped"] = true);
354
+ }
355
+ })();
356
+ } else {
357
+ return withManagedSourceBoundary((state)["observer"], (() => {
358
+ return __eliscript_at(Reflect, "apply")(method, receiver, arguments$);
359
+ }));
360
+ }
361
+ });
362
+ }
363
+ function observeManagedProjectExports(exports, graph) {
364
+ {
365
+ let state = (__eliscript_truthy(graph) ? ((__eliscript_tdz_read_1()))["get"](graph) : null);
366
+ let entry = (__eliscript_truthy(state) ? Object.getOwnPropertyDescriptor(exports, "value-async-drain") : null);
367
+ if ((!__eliscript_truthy(((__eliscript_value_37) => (__eliscript_truthy(__eliscript_value_37) ? (((__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; } })((entry)["value"]) === "function") : __eliscript_value_37))(entry)))) {
368
+ return exports;
369
+ } else {
370
+ {
371
+ let descriptors = Object.getOwnPropertyDescriptors(exports);
372
+ let facade = Object.create(Object.getPrototypeOf(exports));
373
+ let drain = (entry)["value"];
374
+ graph_method(descriptors, "value-async-drain", ((...arguments$) => {
375
+ return (() => {
376
+ try {
377
+ return __eliscript_at(Reflect, "apply")(drain, exports, arguments$);
378
+ } finally {
379
+ if ((!__eliscript_truthy((state)["queued"]))) {
380
+ ((state)["queued"] = true);
381
+ globalThis.queueMicrotask((() => {
382
+ ((state)["queued"] = false);
383
+ return (() => {
384
+ try {
385
+ return withManagedSourceBoundary((state)["observer"], (() => {
386
+ return undefined;
387
+ }));
388
+ } catch (ignored) {
389
+ return null;
390
+ }
391
+ })();
392
+ }));
393
+ }
394
+ }
395
+ })();
396
+ }));
397
+ Object.defineProperties(facade, descriptors);
398
+ return Object.freeze(facade);
399
+ }
400
+ }
401
+ }
402
+ }
403
+ function observeManagedProjectRuntime(runtime, graph) {
404
+ {
405
+ const __eliscript_value_38 = (__eliscript_truthy(graph) ? ((__eliscript_tdz_read_1()))["get"](graph) : null);
406
+ {
407
+ let state = __eliscript_value_38;
408
+ if ((!__eliscript_truthy(state))) {
409
+ return runtime;
410
+ } else {
411
+ {
412
+ let descriptors = Object.getOwnPropertyDescriptors(runtime);
413
+ let facade = Object.create(Object.getPrototypeOf(runtime));
414
+ (Reflect.ownKeys(descriptors))["forEach"](((name) => {
415
+ {
416
+ let entry = (descriptors)[name];
417
+ let value = (entry)["value"];
418
+ if (__eliscript_truthy(((__eliscript_value_39) => (__eliscript_truthy(__eliscript_value_39) ? value : __eliscript_value_39))((name === "project")))) {
419
+ {
420
+ let project_descriptors = Object.getOwnPropertyDescriptors(value);
421
+ let project = Object.create(Object.getPrototypeOf(value));
422
+ (Reflect.ownKeys(project_descriptors))["forEach"](((key) => {
423
+ {
424
+ let property = (project_descriptors)[key];
425
+ let method = (property)["value"];
426
+ 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; } })(method) === "function")) {
427
+ return graph_method(project_descriptors, key, observed_project_method(method, value, key, state));
428
+ } else {
429
+ return null;
430
+ }
431
+ }
432
+ }));
433
+ Object.defineProperties(project, project_descriptors);
434
+ return ((entry)["value"] = Object.freeze(project));
435
+ }
436
+ } else {
437
+ if ((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "function")) {
438
+ return graph_method(descriptors, name, observed_project_method(value, runtime, name, state));
439
+ } else {
440
+ return null;
441
+ }
442
+ }
443
+ }
444
+ }));
445
+ Object.defineProperties(facade, descriptors);
446
+ registerManagedSourceDecodeRuntime(facade, runtime);
447
+ return Object.freeze(facade);
448
+ }
449
+ }
450
+ }
451
+ }
452
+ }
453
+ function createManagedModuleGraph(descriptor, ...arguments$) {
454
+ {
455
+ let options = (__eliscript_numeric_relation(">", ((arguments$) ?? []).length, 0) ? (arguments$)[0] : undefined);
456
+ let base = (legacy)["createManagedModuleGraph"](descriptor, options);
457
+ let descriptors = Object.getOwnPropertyDescriptors(base);
458
+ let facade = Object.create(Object.getPrototypeOf(base));
459
+ let prepared = false;
460
+ let preparing = false;
461
+ let prepare_notifications = [];
462
+ let declarations = new (globalThis.Map)();
463
+ let pure = pure_project_description(descriptor);
464
+ let known = new (globalThis.Set)();
465
+ let watched = new (globalThis.Map)();
466
+ let state = ({"stopped": false, "syncing": false});
467
+ let observer = undefined;
468
+ if (__eliscript_truthy(pure)) {
469
+ ((observer = (() => {
470
+ if (__eliscript_truthy(((__eliscript_value_40) => (__eliscript_truthy(__eliscript_value_40) ? ((!__eliscript_truthy((base)["closed"])) && (!__eliscript_truthy((state)["stopped"])) && (!__eliscript_truthy((state)["syncing"]))) : __eliscript_value_40))(prepared))) {
471
+ ((state)["syncing"] = true);
472
+ return (() => {
473
+ try {
474
+ {
475
+ const __eliscript_value_41 = true;
476
+ {
477
+ let changed = __eliscript_value_41;
478
+ while (__eliscript_truthy(((__eliscript_value_42) => (__eliscript_truthy(__eliscript_value_42) ? ((!__eliscript_truthy((base)["closed"])) && (!__eliscript_truthy((state)["stopped"]))) : __eliscript_value_42))(changed))) {
479
+ ((changed = false));
480
+ (watched)["forEach"](((entry, key) => {
481
+ {
482
+ const __eliscript_value_43 = bindManagedSourceBoundary(withManagedSourceBindingPoll(observer, (() => {
483
+ return (base)["read"]((entry)["kind"], (entry)["index"]);
484
+ })), observer);
485
+ {
486
+ let value = __eliscript_value_43;
487
+ if ((!__eliscript_truthy(Object.is(value, (entry)["value"])))) {
488
+ ((entry)["value"] = value);
489
+ ((changed = true));
490
+ return (base)["bindingChanged"]((entry)["kind"], (entry)["index"], value);
491
+ } else {
492
+ return null;
493
+ }
494
+ }
495
+ }
496
+ }));
497
+ }
498
+ return null;
499
+ }
500
+ }
501
+ } finally {
502
+ ((state)["syncing"] = false);
503
+ }
504
+ })();
505
+ } else {
506
+ return null;
507
+ }
508
+ })));
509
+ ((state)["observer"] = observer);
510
+ ((__eliscript_tdz_read_1()))["set"](facade, state);
511
+ }
512
+ ((((descriptor)["hostModules"] == null) ? [] : (descriptor)["hostModules"]))["forEach"](((declaration) => {
513
+ return (declarations)["set"]((declaration)["id"], declaration);
514
+ }));
515
+ (((descriptors)["attachRuntime"])["value"] = ((runtime) => {
516
+ (base)["attachRuntime"](runtime);
517
+ registerManagedSourceDecodeRuntime(facade, runtime);
518
+ return facade;
519
+ }));
520
+ (((descriptors)["prepare"])["value"] = (() => {
521
+ ((preparing = true));
522
+ return (() => {
523
+ try {
524
+ (base)["prepare"]();
525
+ ((prepared = true), (preparing = false));
526
+ {
527
+ const __eliscript_value_44 = prepare_notifications;
528
+ {
529
+ let pending = __eliscript_value_44;
530
+ ((prepare_notifications = []));
531
+ (pending)["forEach"](((entry) => {
532
+ return (base)["bindingChanged"]((entry)[0], (entry)[1], (entry)[2]);
533
+ }));
534
+ }
535
+ }
536
+ return facade;
537
+ } finally {
538
+ ((preparing = false), (prepare_notifications = []));
539
+ }
540
+ })();
541
+ }));
542
+ graph_method(descriptors, "bindingChanged", ((kind, index, value) => {
543
+ if ((!__eliscript_truthy(preparing))) {
544
+ return (base)["bindingChanged"](kind, index, value);
545
+ } else {
546
+ if ((!__eliscript_truthy(((__eliscript_value_45) => (__eliscript_truthy(__eliscript_value_45) ? ((__eliscript_value_46) => (__eliscript_truthy(__eliscript_value_46) ? __eliscript_numeric_relation(">=", index, 0) : __eliscript_value_46))(Number.isSafeInteger(index)) : __eliscript_value_45))(((kind === 0) || (kind === 1)))))) {
547
+ ((__eliscript_value_47) => { throw __eliscript_value_47; })(new (globalThis.TypeError)("invalid managed project cell"));
548
+ }
549
+ (prepare_notifications)["push"]([kind, index, value]);
550
+ return undefined;
551
+ }
552
+ }));
553
+ if (__eliscript_truthy(pure)) {
554
+ graph_method(descriptors, "read", ((kind, index) => {
555
+ return withManagedSourceBoundary(observer, (() => {
556
+ {
557
+ const __eliscript_value_48 = (base)["read"](kind, index);
558
+ {
559
+ let value = __eliscript_value_48;
560
+ (known)["add"]((String(kind) + String(":") + String(index)));
561
+ return value;
562
+ }
563
+ }
564
+ }));
565
+ }));
566
+ graph_method(descriptors, "bindHoisted", ((kind, index, fn) => {
567
+ return withManagedSourceBoundary(observer, (() => {
568
+ return (base)["bindHoisted"](kind, index, fn);
569
+ }));
570
+ }));
571
+ graph_method(descriptors, "invoke", ((kind, index, receiver, arguments$, newTarget) => {
572
+ return withManagedSourceBoundary(observer, (() => {
573
+ return (base)["invoke"](kind, index, receiver, arguments$, newTarget);
574
+ }));
575
+ }));
576
+ graph_method(descriptors, "step", ((name) => {
577
+ return withManagedSourceBoundary(observer, (() => {
578
+ return (base)["step"](name);
579
+ }));
580
+ }));
581
+ graph_method(descriptors, "watch", ((kind, index, listener) => {
582
+ {
583
+ let stop = (base)["watch"](kind, index, listener);
584
+ let key = (String(kind) + String(":") + String(index));
585
+ let entry = (watched)["get"](key);
586
+ if (__eliscript_truthy(((__eliscript_value_49) => (__eliscript_truthy(__eliscript_value_49) ? (known)["has"](key) : __eliscript_value_49))((!__eliscript_truthy(entry))))) {
587
+ (() => {
588
+ try {
589
+ return ((entry = ({"kind": kind, "index": index, "listeners": new (globalThis.Set)(), "value": withManagedSourceBoundary(observer, (() => {
590
+ return (base)["read"](kind, index);
591
+ }))})));
592
+ } catch (error) {
593
+ stop();
594
+ return ((__eliscript_value_50) => { throw __eliscript_value_50; })(error);
595
+ }
596
+ })();
597
+ (watched)["set"](key, entry);
598
+ }
599
+ if (__eliscript_truthy(entry)) {
600
+ ((entry)["listeners"])["add"](listener);
601
+ }
602
+ return (() => {
603
+ stop();
604
+ if (__eliscript_truthy(entry)) {
605
+ ((entry)["listeners"])["delete"](listener);
606
+ if ((((entry)["listeners"])["size"] === 0)) {
607
+ return (watched)["delete"](key);
608
+ } else {
609
+ return null;
610
+ }
611
+ } else {
612
+ return null;
613
+ }
614
+ });
615
+ }
616
+ }));
617
+ graph_method(descriptors, "close", (() => {
618
+ return (() => {
619
+ try {
620
+ return (base)["close"]();
621
+ } finally {
622
+ ((state)["stopped"] = true);
623
+ (watched)["clear"]();
624
+ (known)["clear"]();
625
+ }
626
+ })();
627
+ }));
628
+ }
629
+ (((descriptors)["namespace"])["value"] = ((id, resolver) => {
630
+ if (__eliscript_truthy((base)["closed"])) {
631
+ ((__eliscript_value_51) => { throw __eliscript_value_51; })(new (globalThis.Error)("managed module graph is closed"));
632
+ }
633
+ if ((!__eliscript_truthy((base)["attached"]))) {
634
+ ((__eliscript_value_52) => { throw __eliscript_value_52; })(new (globalThis.Error)("managed module graph transport is not attached"));
635
+ }
636
+ if ((!__eliscript_truthy(prepared))) {
637
+ ((__eliscript_value_53) => { throw __eliscript_value_53; })(new (globalThis.ReferenceError)("managed project has not been prepared"));
638
+ }
639
+ {
640
+ const __eliscript_value_54 = (declarations)["get"](id);
641
+ {
642
+ let declaration = __eliscript_value_54;
643
+ if ((!__eliscript_truthy(declaration))) {
644
+ ((__eliscript_value_55) => { throw __eliscript_value_55; })(new (globalThis.TypeError)("undeclared mixed host module"));
645
+ }
646
+ return ((base)["hostModules"])["declare"](id, (() => {
647
+ {
648
+ const __eliscript_value_56 = resolver();
649
+ {
650
+ let namespace = __eliscript_value_56;
651
+ if ((!((!(namespace === null)) && (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(namespace) === "object")))) {
652
+ ((__eliscript_value_57) => { throw __eliscript_value_57; })(new (globalThis.TypeError)("expected an actual ESM module namespace"));
653
+ }
654
+ {
655
+ const __eliscript_value_58 = Reflect.ownKeys(namespace);
656
+ {
657
+ let names = __eliscript_value_58;
658
+ ((declaration)["allowedExports"])["forEach"](((name) => {
659
+ if ((!__eliscript_truthy((names)["includes"](name)))) {
660
+ return ((__eliscript_value_59) => { throw __eliscript_value_59; })(new (globalThis.SyntaxError)(("host module does not provide export " + JSON.stringify(name))));
661
+ } else {
662
+ return null;
663
+ }
664
+ }));
665
+ }
666
+ }
667
+ return namespace;
668
+ }
669
+ }
670
+ }));
671
+ }
672
+ }
673
+ }));
674
+ (["prepare", "step", "read", "bindHoisted", "invoke"])["forEach"](((name) => {
675
+ {
676
+ let entry = (descriptors)[name];
677
+ let method = (entry)["value"];
678
+ 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; } })(method) === "function")) {
679
+ return graph_method(descriptors, name, ((...arguments$) => {
680
+ return withManagedSourceDecode((() => {
681
+ return __eliscript_at(Reflect, "apply")(method, facade, arguments$);
682
+ }), facade);
683
+ }));
684
+ } else {
685
+ return null;
686
+ }
687
+ }
688
+ }));
689
+ Object.defineProperties(facade, descriptors);
690
+ return Object.freeze(facade);
691
+ }
692
+ }
693
+ export {managedHostModuleEdges, createManagedProjectFacades, loadManagedProjectGraph, createManagedModuleGraph, observeManagedProjectRuntime, observeManagedProjectExports};
694
+ //# sourceMappingURL=managed-module-graph.mjs.map