fenrir-runtime 0.0.1 → 0.3.0

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 (699) hide show
  1. package/Makefile +5 -11
  2. package/README.md +114 -48
  3. package/READMEs/turkish.md +156 -0
  4. package/example/.fenrir/archives/2026-03-14_21-07-26/.metadata.json +7 -0
  5. package/example/.fenrir/archives/2026-03-14_21-07-26/fenrir.json +9 -0
  6. package/example/.fenrir/archives/2026-03-14_21-07-26/main.fnr +67 -0
  7. package/example/{fenrir+aperium → .fenrir/archives/2026-03-14_21-07-26}/package-lock.json +93 -157
  8. package/example/.fenrir/archives/2026-03-14_21-07-26/package.json +8 -0
  9. package/example/.fenrir/archives/2026-03-14_21-07-32/.metadata.json +7 -0
  10. package/example/.fenrir/archives/2026-03-14_21-07-32/fenrir.json +9 -0
  11. package/example/.fenrir/archives/2026-03-14_21-07-32/main.fnr +67 -0
  12. package/example/.fenrir/archives/2026-03-14_21-07-32/package-lock.json +826 -0
  13. package/example/.fenrir/archives/2026-03-14_21-07-32/package.json +8 -0
  14. package/example/fenrir.json +4 -5
  15. package/example/main.fnr +96 -11
  16. package/example/node_modules/.package-lock.json +819 -0
  17. package/example/node_modules/accepts/HISTORY.md +250 -0
  18. package/example/node_modules/accepts/LICENSE +23 -0
  19. package/example/node_modules/accepts/README.md +140 -0
  20. package/example/node_modules/accepts/index.js +238 -0
  21. package/example/node_modules/accepts/package.json +47 -0
  22. package/example/node_modules/body-parser/LICENSE +23 -0
  23. package/example/node_modules/body-parser/README.md +494 -0
  24. package/example/node_modules/body-parser/index.js +71 -0
  25. package/example/node_modules/body-parser/lib/read.js +247 -0
  26. package/example/node_modules/body-parser/lib/types/json.js +158 -0
  27. package/example/node_modules/body-parser/lib/types/raw.js +42 -0
  28. package/example/node_modules/body-parser/lib/types/text.js +36 -0
  29. package/example/node_modules/body-parser/lib/types/urlencoded.js +142 -0
  30. package/example/node_modules/body-parser/lib/utils.js +98 -0
  31. package/example/node_modules/body-parser/package.json +52 -0
  32. package/example/node_modules/bytes/History.md +97 -0
  33. package/example/node_modules/bytes/LICENSE +23 -0
  34. package/example/node_modules/bytes/Readme.md +152 -0
  35. package/example/node_modules/bytes/index.js +170 -0
  36. package/example/node_modules/bytes/package.json +42 -0
  37. package/example/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
  38. package/example/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
  39. package/example/node_modules/call-bind-apply-helpers/.nycrc +9 -0
  40. package/example/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
  41. package/example/node_modules/call-bind-apply-helpers/LICENSE +21 -0
  42. package/example/node_modules/call-bind-apply-helpers/README.md +62 -0
  43. package/example/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
  44. package/example/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
  45. package/example/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
  46. package/example/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
  47. package/example/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
  48. package/example/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
  49. package/example/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
  50. package/example/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
  51. package/example/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
  52. package/example/node_modules/call-bind-apply-helpers/index.js +15 -0
  53. package/example/node_modules/call-bind-apply-helpers/package.json +85 -0
  54. package/example/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
  55. package/example/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
  56. package/example/node_modules/call-bind-apply-helpers/test/index.js +63 -0
  57. package/example/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
  58. package/example/node_modules/call-bound/.eslintrc +13 -0
  59. package/example/node_modules/call-bound/.github/FUNDING.yml +12 -0
  60. package/example/node_modules/call-bound/.nycrc +9 -0
  61. package/example/node_modules/call-bound/CHANGELOG.md +42 -0
  62. package/example/node_modules/call-bound/LICENSE +21 -0
  63. package/example/node_modules/call-bound/README.md +53 -0
  64. package/example/node_modules/call-bound/index.d.ts +94 -0
  65. package/example/node_modules/call-bound/index.js +19 -0
  66. package/example/node_modules/call-bound/package.json +99 -0
  67. package/example/node_modules/call-bound/test/index.js +61 -0
  68. package/example/node_modules/call-bound/tsconfig.json +10 -0
  69. package/example/node_modules/content-disposition/HISTORY.md +72 -0
  70. package/example/node_modules/content-disposition/LICENSE +22 -0
  71. package/example/node_modules/content-disposition/README.md +142 -0
  72. package/example/node_modules/content-disposition/index.js +458 -0
  73. package/example/node_modules/content-disposition/package.json +43 -0
  74. package/example/node_modules/content-type/HISTORY.md +29 -0
  75. package/example/node_modules/content-type/LICENSE +22 -0
  76. package/example/node_modules/content-type/README.md +94 -0
  77. package/example/node_modules/content-type/index.js +225 -0
  78. package/example/node_modules/content-type/package.json +42 -0
  79. package/example/node_modules/cookie/LICENSE +24 -0
  80. package/example/node_modules/cookie/README.md +317 -0
  81. package/example/node_modules/cookie/SECURITY.md +25 -0
  82. package/example/node_modules/cookie/index.js +335 -0
  83. package/example/node_modules/cookie/package.json +44 -0
  84. package/example/node_modules/cookie-signature/History.md +70 -0
  85. package/example/node_modules/cookie-signature/LICENSE +22 -0
  86. package/example/node_modules/cookie-signature/Readme.md +23 -0
  87. package/example/node_modules/cookie-signature/index.js +47 -0
  88. package/example/node_modules/cookie-signature/package.json +24 -0
  89. package/example/node_modules/debug/LICENSE +20 -0
  90. package/example/node_modules/debug/README.md +481 -0
  91. package/example/node_modules/debug/package.json +64 -0
  92. package/example/node_modules/debug/src/browser.js +272 -0
  93. package/example/node_modules/debug/src/common.js +292 -0
  94. package/example/node_modules/debug/src/index.js +10 -0
  95. package/example/node_modules/debug/src/node.js +263 -0
  96. package/example/node_modules/depd/History.md +103 -0
  97. package/example/node_modules/depd/LICENSE +22 -0
  98. package/example/node_modules/depd/Readme.md +280 -0
  99. package/example/node_modules/depd/index.js +538 -0
  100. package/example/node_modules/depd/lib/browser/index.js +77 -0
  101. package/example/node_modules/depd/package.json +45 -0
  102. package/example/node_modules/dunder-proto/.eslintrc +5 -0
  103. package/example/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
  104. package/example/node_modules/dunder-proto/.nycrc +13 -0
  105. package/example/node_modules/dunder-proto/CHANGELOG.md +24 -0
  106. package/example/node_modules/dunder-proto/LICENSE +21 -0
  107. package/example/node_modules/dunder-proto/README.md +54 -0
  108. package/example/node_modules/dunder-proto/get.d.ts +5 -0
  109. package/example/node_modules/dunder-proto/get.js +30 -0
  110. package/example/node_modules/dunder-proto/package.json +76 -0
  111. package/example/node_modules/dunder-proto/set.d.ts +5 -0
  112. package/example/node_modules/dunder-proto/set.js +35 -0
  113. package/example/node_modules/dunder-proto/test/get.js +34 -0
  114. package/example/node_modules/dunder-proto/test/index.js +4 -0
  115. package/example/node_modules/dunder-proto/test/set.js +50 -0
  116. package/example/node_modules/dunder-proto/tsconfig.json +9 -0
  117. package/example/node_modules/ee-first/LICENSE +22 -0
  118. package/example/node_modules/ee-first/README.md +80 -0
  119. package/example/node_modules/ee-first/index.js +95 -0
  120. package/example/node_modules/ee-first/package.json +29 -0
  121. package/example/node_modules/encodeurl/LICENSE +22 -0
  122. package/example/node_modules/encodeurl/README.md +109 -0
  123. package/example/node_modules/encodeurl/index.js +60 -0
  124. package/example/node_modules/encodeurl/package.json +40 -0
  125. package/example/node_modules/es-define-property/.eslintrc +13 -0
  126. package/example/node_modules/es-define-property/.github/FUNDING.yml +12 -0
  127. package/example/node_modules/es-define-property/.nycrc +9 -0
  128. package/example/node_modules/es-define-property/CHANGELOG.md +29 -0
  129. package/example/node_modules/es-define-property/LICENSE +21 -0
  130. package/example/node_modules/es-define-property/README.md +49 -0
  131. package/example/node_modules/es-define-property/index.d.ts +3 -0
  132. package/example/node_modules/es-define-property/index.js +14 -0
  133. package/example/node_modules/es-define-property/package.json +81 -0
  134. package/example/node_modules/es-define-property/test/index.js +56 -0
  135. package/example/node_modules/es-define-property/tsconfig.json +10 -0
  136. package/example/node_modules/es-errors/.eslintrc +5 -0
  137. package/example/node_modules/es-errors/.github/FUNDING.yml +12 -0
  138. package/example/node_modules/es-errors/CHANGELOG.md +40 -0
  139. package/example/node_modules/es-errors/LICENSE +21 -0
  140. package/example/node_modules/es-errors/README.md +55 -0
  141. package/example/node_modules/es-errors/eval.d.ts +3 -0
  142. package/example/node_modules/es-errors/eval.js +4 -0
  143. package/example/node_modules/es-errors/index.d.ts +3 -0
  144. package/example/node_modules/es-errors/index.js +4 -0
  145. package/example/node_modules/es-errors/package.json +80 -0
  146. package/example/node_modules/es-errors/range.d.ts +3 -0
  147. package/example/node_modules/es-errors/range.js +4 -0
  148. package/example/node_modules/es-errors/ref.d.ts +3 -0
  149. package/example/node_modules/es-errors/ref.js +4 -0
  150. package/example/node_modules/es-errors/syntax.d.ts +3 -0
  151. package/example/node_modules/es-errors/syntax.js +4 -0
  152. package/example/node_modules/es-errors/test/index.js +19 -0
  153. package/example/node_modules/es-errors/tsconfig.json +49 -0
  154. package/example/node_modules/es-errors/type.d.ts +3 -0
  155. package/example/node_modules/es-errors/type.js +4 -0
  156. package/example/node_modules/es-errors/uri.d.ts +3 -0
  157. package/example/node_modules/es-errors/uri.js +4 -0
  158. package/example/node_modules/es-object-atoms/.eslintrc +16 -0
  159. package/example/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
  160. package/example/node_modules/es-object-atoms/CHANGELOG.md +37 -0
  161. package/example/node_modules/es-object-atoms/LICENSE +21 -0
  162. package/example/node_modules/es-object-atoms/README.md +63 -0
  163. package/example/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
  164. package/example/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
  165. package/example/node_modules/es-object-atoms/ToObject.d.ts +7 -0
  166. package/example/node_modules/es-object-atoms/ToObject.js +10 -0
  167. package/example/node_modules/es-object-atoms/index.d.ts +3 -0
  168. package/example/node_modules/es-object-atoms/index.js +4 -0
  169. package/example/node_modules/es-object-atoms/isObject.d.ts +3 -0
  170. package/example/node_modules/es-object-atoms/isObject.js +6 -0
  171. package/example/node_modules/es-object-atoms/package.json +80 -0
  172. package/example/node_modules/es-object-atoms/test/index.js +38 -0
  173. package/example/node_modules/es-object-atoms/tsconfig.json +6 -0
  174. package/example/node_modules/escape-html/LICENSE +24 -0
  175. package/example/node_modules/escape-html/Readme.md +43 -0
  176. package/example/node_modules/escape-html/index.js +78 -0
  177. package/example/node_modules/escape-html/package.json +24 -0
  178. package/example/node_modules/etag/HISTORY.md +83 -0
  179. package/example/node_modules/etag/LICENSE +22 -0
  180. package/example/node_modules/etag/README.md +159 -0
  181. package/example/node_modules/etag/index.js +131 -0
  182. package/example/node_modules/etag/package.json +47 -0
  183. package/example/node_modules/express/LICENSE +24 -0
  184. package/example/node_modules/express/Readme.md +276 -0
  185. package/example/node_modules/express/index.js +11 -0
  186. package/example/node_modules/express/lib/application.js +631 -0
  187. package/example/node_modules/express/lib/express.js +81 -0
  188. package/example/node_modules/express/lib/request.js +514 -0
  189. package/example/node_modules/express/lib/response.js +1053 -0
  190. package/example/node_modules/express/lib/utils.js +271 -0
  191. package/example/node_modules/express/lib/view.js +205 -0
  192. package/example/node_modules/express/package.json +99 -0
  193. package/example/node_modules/finalhandler/HISTORY.md +239 -0
  194. package/example/node_modules/finalhandler/LICENSE +22 -0
  195. package/example/node_modules/finalhandler/README.md +150 -0
  196. package/example/node_modules/finalhandler/index.js +293 -0
  197. package/example/node_modules/finalhandler/package.json +47 -0
  198. package/example/node_modules/forwarded/HISTORY.md +21 -0
  199. package/example/node_modules/forwarded/LICENSE +22 -0
  200. package/example/node_modules/forwarded/README.md +57 -0
  201. package/example/node_modules/forwarded/index.js +90 -0
  202. package/example/node_modules/forwarded/package.json +45 -0
  203. package/example/node_modules/fresh/HISTORY.md +80 -0
  204. package/example/node_modules/fresh/LICENSE +23 -0
  205. package/example/node_modules/fresh/README.md +117 -0
  206. package/example/node_modules/fresh/index.js +136 -0
  207. package/example/node_modules/fresh/package.json +46 -0
  208. package/example/node_modules/function-bind/.eslintrc +21 -0
  209. package/example/node_modules/function-bind/.github/FUNDING.yml +12 -0
  210. package/example/node_modules/function-bind/.github/SECURITY.md +3 -0
  211. package/example/node_modules/function-bind/.nycrc +13 -0
  212. package/example/node_modules/function-bind/CHANGELOG.md +136 -0
  213. package/example/node_modules/function-bind/LICENSE +20 -0
  214. package/example/node_modules/function-bind/README.md +46 -0
  215. package/example/node_modules/function-bind/implementation.js +84 -0
  216. package/example/node_modules/function-bind/index.js +5 -0
  217. package/example/node_modules/function-bind/package.json +87 -0
  218. package/example/node_modules/function-bind/test/.eslintrc +9 -0
  219. package/example/node_modules/function-bind/test/index.js +252 -0
  220. package/example/node_modules/get-intrinsic/.eslintrc +42 -0
  221. package/example/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
  222. package/example/node_modules/get-intrinsic/.nycrc +9 -0
  223. package/example/node_modules/get-intrinsic/CHANGELOG.md +186 -0
  224. package/example/node_modules/get-intrinsic/LICENSE +21 -0
  225. package/example/node_modules/get-intrinsic/README.md +71 -0
  226. package/example/node_modules/get-intrinsic/index.js +378 -0
  227. package/example/node_modules/get-intrinsic/package.json +97 -0
  228. package/example/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
  229. package/example/node_modules/get-proto/.eslintrc +10 -0
  230. package/example/node_modules/get-proto/.github/FUNDING.yml +12 -0
  231. package/example/node_modules/get-proto/.nycrc +9 -0
  232. package/example/node_modules/get-proto/CHANGELOG.md +21 -0
  233. package/example/node_modules/get-proto/LICENSE +21 -0
  234. package/example/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
  235. package/example/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
  236. package/example/node_modules/get-proto/README.md +50 -0
  237. package/example/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
  238. package/example/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
  239. package/example/node_modules/get-proto/index.d.ts +5 -0
  240. package/example/node_modules/get-proto/index.js +27 -0
  241. package/example/node_modules/get-proto/package.json +81 -0
  242. package/example/node_modules/get-proto/test/index.js +68 -0
  243. package/example/node_modules/get-proto/tsconfig.json +9 -0
  244. package/example/node_modules/gopd/.eslintrc +16 -0
  245. package/example/node_modules/gopd/.github/FUNDING.yml +12 -0
  246. package/example/node_modules/gopd/CHANGELOG.md +45 -0
  247. package/example/node_modules/gopd/LICENSE +21 -0
  248. package/example/node_modules/gopd/README.md +40 -0
  249. package/example/node_modules/gopd/gOPD.d.ts +1 -0
  250. package/example/node_modules/gopd/gOPD.js +4 -0
  251. package/example/node_modules/gopd/index.d.ts +5 -0
  252. package/example/node_modules/gopd/index.js +15 -0
  253. package/example/node_modules/gopd/package.json +77 -0
  254. package/example/node_modules/gopd/test/index.js +36 -0
  255. package/example/node_modules/gopd/tsconfig.json +9 -0
  256. package/example/node_modules/has-symbols/.eslintrc +11 -0
  257. package/example/node_modules/has-symbols/.github/FUNDING.yml +12 -0
  258. package/example/node_modules/has-symbols/.nycrc +9 -0
  259. package/example/node_modules/has-symbols/CHANGELOG.md +91 -0
  260. package/example/node_modules/has-symbols/LICENSE +21 -0
  261. package/example/node_modules/has-symbols/README.md +46 -0
  262. package/example/node_modules/has-symbols/index.d.ts +3 -0
  263. package/example/node_modules/has-symbols/index.js +14 -0
  264. package/example/node_modules/has-symbols/package.json +111 -0
  265. package/example/node_modules/has-symbols/shams.d.ts +3 -0
  266. package/example/node_modules/has-symbols/shams.js +45 -0
  267. package/example/node_modules/has-symbols/test/index.js +22 -0
  268. package/example/node_modules/has-symbols/test/shams/core-js.js +29 -0
  269. package/example/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
  270. package/example/node_modules/has-symbols/test/tests.js +58 -0
  271. package/example/node_modules/has-symbols/tsconfig.json +10 -0
  272. package/example/node_modules/hasown/.eslintrc +5 -0
  273. package/example/node_modules/hasown/.github/FUNDING.yml +12 -0
  274. package/example/node_modules/hasown/.nycrc +13 -0
  275. package/example/node_modules/hasown/CHANGELOG.md +40 -0
  276. package/example/node_modules/hasown/LICENSE +21 -0
  277. package/example/node_modules/hasown/README.md +40 -0
  278. package/example/node_modules/hasown/index.d.ts +3 -0
  279. package/example/node_modules/hasown/index.js +8 -0
  280. package/example/node_modules/hasown/package.json +92 -0
  281. package/example/node_modules/hasown/tsconfig.json +6 -0
  282. package/example/node_modules/http-errors/HISTORY.md +186 -0
  283. package/example/node_modules/http-errors/LICENSE +23 -0
  284. package/example/node_modules/http-errors/README.md +169 -0
  285. package/example/node_modules/http-errors/index.js +290 -0
  286. package/example/node_modules/http-errors/package.json +54 -0
  287. package/example/node_modules/iconv-lite/LICENSE +21 -0
  288. package/example/node_modules/iconv-lite/README.md +138 -0
  289. package/example/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
  290. package/example/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
  291. package/example/node_modules/iconv-lite/encodings/index.js +23 -0
  292. package/example/node_modules/iconv-lite/encodings/internal.js +218 -0
  293. package/example/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
  294. package/example/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  295. package/example/node_modules/iconv-lite/encodings/sbcs-data.js +178 -0
  296. package/example/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  297. package/example/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  298. package/example/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  299. package/example/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  300. package/example/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  301. package/example/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  302. package/example/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
  303. package/example/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  304. package/example/node_modules/iconv-lite/encodings/utf16.js +187 -0
  305. package/example/node_modules/iconv-lite/encodings/utf32.js +307 -0
  306. package/example/node_modules/iconv-lite/encodings/utf7.js +283 -0
  307. package/example/node_modules/iconv-lite/lib/bom-handling.js +48 -0
  308. package/example/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
  309. package/example/node_modules/iconv-lite/lib/index.d.ts +129 -0
  310. package/example/node_modules/iconv-lite/lib/index.js +182 -0
  311. package/example/node_modules/iconv-lite/lib/streams.js +105 -0
  312. package/example/node_modules/iconv-lite/package.json +70 -0
  313. package/example/node_modules/iconv-lite/types/encodings.d.ts +423 -0
  314. package/example/node_modules/inherits/LICENSE +16 -0
  315. package/example/node_modules/inherits/README.md +42 -0
  316. package/example/node_modules/inherits/inherits.js +9 -0
  317. package/example/node_modules/inherits/inherits_browser.js +27 -0
  318. package/example/node_modules/inherits/package.json +29 -0
  319. package/example/node_modules/ipaddr.js/LICENSE +19 -0
  320. package/example/node_modules/ipaddr.js/README.md +233 -0
  321. package/example/node_modules/ipaddr.js/ipaddr.min.js +1 -0
  322. package/example/node_modules/ipaddr.js/lib/ipaddr.js +673 -0
  323. package/example/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +68 -0
  324. package/example/node_modules/ipaddr.js/package.json +35 -0
  325. package/example/node_modules/is-promise/LICENSE +19 -0
  326. package/example/node_modules/is-promise/index.d.ts +2 -0
  327. package/example/node_modules/is-promise/index.js +6 -0
  328. package/example/node_modules/is-promise/index.mjs +3 -0
  329. package/example/node_modules/is-promise/package.json +30 -0
  330. package/example/node_modules/is-promise/readme.md +33 -0
  331. package/example/node_modules/math-intrinsics/.eslintrc +16 -0
  332. package/example/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
  333. package/example/node_modules/math-intrinsics/CHANGELOG.md +24 -0
  334. package/example/node_modules/math-intrinsics/LICENSE +21 -0
  335. package/example/node_modules/math-intrinsics/README.md +50 -0
  336. package/example/node_modules/math-intrinsics/abs.d.ts +1 -0
  337. package/example/node_modules/math-intrinsics/abs.js +4 -0
  338. package/example/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
  339. package/example/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
  340. package/example/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
  341. package/example/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
  342. package/example/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
  343. package/example/node_modules/math-intrinsics/constants/maxValue.js +5 -0
  344. package/example/node_modules/math-intrinsics/floor.d.ts +1 -0
  345. package/example/node_modules/math-intrinsics/floor.js +4 -0
  346. package/example/node_modules/math-intrinsics/isFinite.d.ts +3 -0
  347. package/example/node_modules/math-intrinsics/isFinite.js +12 -0
  348. package/example/node_modules/math-intrinsics/isInteger.d.ts +3 -0
  349. package/example/node_modules/math-intrinsics/isInteger.js +16 -0
  350. package/example/node_modules/math-intrinsics/isNaN.d.ts +1 -0
  351. package/example/node_modules/math-intrinsics/isNaN.js +6 -0
  352. package/example/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
  353. package/example/node_modules/math-intrinsics/isNegativeZero.js +6 -0
  354. package/example/node_modules/math-intrinsics/max.d.ts +1 -0
  355. package/example/node_modules/math-intrinsics/max.js +4 -0
  356. package/example/node_modules/math-intrinsics/min.d.ts +1 -0
  357. package/example/node_modules/math-intrinsics/min.js +4 -0
  358. package/example/node_modules/math-intrinsics/mod.d.ts +3 -0
  359. package/example/node_modules/math-intrinsics/mod.js +9 -0
  360. package/example/node_modules/math-intrinsics/package.json +86 -0
  361. package/example/node_modules/math-intrinsics/pow.d.ts +1 -0
  362. package/example/node_modules/math-intrinsics/pow.js +4 -0
  363. package/example/node_modules/math-intrinsics/round.d.ts +1 -0
  364. package/example/node_modules/math-intrinsics/round.js +4 -0
  365. package/example/node_modules/math-intrinsics/sign.d.ts +3 -0
  366. package/example/node_modules/math-intrinsics/sign.js +11 -0
  367. package/example/node_modules/math-intrinsics/test/index.js +192 -0
  368. package/example/node_modules/math-intrinsics/tsconfig.json +3 -0
  369. package/example/node_modules/media-typer/HISTORY.md +50 -0
  370. package/example/node_modules/media-typer/LICENSE +22 -0
  371. package/example/node_modules/media-typer/README.md +93 -0
  372. package/example/node_modules/media-typer/index.js +143 -0
  373. package/example/node_modules/media-typer/package.json +33 -0
  374. package/example/node_modules/merge-descriptors/index.d.ts +11 -0
  375. package/example/node_modules/merge-descriptors/index.js +26 -0
  376. package/example/node_modules/merge-descriptors/license +11 -0
  377. package/example/node_modules/merge-descriptors/package.json +50 -0
  378. package/example/node_modules/merge-descriptors/readme.md +55 -0
  379. package/example/node_modules/mime-db/HISTORY.md +541 -0
  380. package/example/node_modules/mime-db/LICENSE +23 -0
  381. package/example/node_modules/mime-db/README.md +109 -0
  382. package/example/node_modules/mime-db/db.json +9342 -0
  383. package/example/node_modules/mime-db/index.js +12 -0
  384. package/example/node_modules/mime-db/package.json +56 -0
  385. package/example/node_modules/mime-types/HISTORY.md +428 -0
  386. package/example/node_modules/mime-types/LICENSE +23 -0
  387. package/example/node_modules/mime-types/README.md +126 -0
  388. package/example/node_modules/mime-types/index.js +211 -0
  389. package/example/node_modules/mime-types/mimeScore.js +57 -0
  390. package/example/node_modules/mime-types/package.json +49 -0
  391. package/example/node_modules/ms/index.js +162 -0
  392. package/example/node_modules/ms/license.md +21 -0
  393. package/example/node_modules/ms/package.json +38 -0
  394. package/example/node_modules/ms/readme.md +59 -0
  395. package/example/node_modules/negotiator/HISTORY.md +114 -0
  396. package/example/node_modules/negotiator/LICENSE +24 -0
  397. package/example/node_modules/negotiator/README.md +212 -0
  398. package/example/node_modules/negotiator/index.js +83 -0
  399. package/example/node_modules/negotiator/lib/charset.js +169 -0
  400. package/example/node_modules/negotiator/lib/encoding.js +205 -0
  401. package/example/node_modules/negotiator/lib/language.js +179 -0
  402. package/example/node_modules/negotiator/lib/mediaType.js +294 -0
  403. package/example/node_modules/negotiator/package.json +43 -0
  404. package/example/node_modules/object-inspect/.eslintrc +53 -0
  405. package/example/node_modules/object-inspect/.github/FUNDING.yml +12 -0
  406. package/example/node_modules/object-inspect/.nycrc +13 -0
  407. package/example/node_modules/object-inspect/CHANGELOG.md +424 -0
  408. package/example/node_modules/object-inspect/LICENSE +21 -0
  409. package/example/node_modules/object-inspect/example/all.js +23 -0
  410. package/example/node_modules/object-inspect/example/circular.js +6 -0
  411. package/example/node_modules/object-inspect/example/fn.js +5 -0
  412. package/example/node_modules/object-inspect/example/inspect.js +10 -0
  413. package/example/node_modules/object-inspect/index.js +544 -0
  414. package/example/node_modules/object-inspect/package-support.json +20 -0
  415. package/example/node_modules/object-inspect/package.json +105 -0
  416. package/example/node_modules/object-inspect/readme.markdown +84 -0
  417. package/example/node_modules/object-inspect/test/bigint.js +58 -0
  418. package/example/node_modules/object-inspect/test/browser/dom.js +15 -0
  419. package/example/node_modules/object-inspect/test/circular.js +16 -0
  420. package/example/node_modules/object-inspect/test/deep.js +12 -0
  421. package/example/node_modules/object-inspect/test/element.js +53 -0
  422. package/example/node_modules/object-inspect/test/err.js +48 -0
  423. package/example/node_modules/object-inspect/test/fakes.js +29 -0
  424. package/example/node_modules/object-inspect/test/fn.js +76 -0
  425. package/example/node_modules/object-inspect/test/global.js +17 -0
  426. package/example/node_modules/object-inspect/test/has.js +15 -0
  427. package/example/node_modules/object-inspect/test/holes.js +15 -0
  428. package/example/node_modules/object-inspect/test/indent-option.js +271 -0
  429. package/example/node_modules/object-inspect/test/inspect.js +139 -0
  430. package/example/node_modules/object-inspect/test/lowbyte.js +12 -0
  431. package/example/node_modules/object-inspect/test/number.js +58 -0
  432. package/example/node_modules/object-inspect/test/quoteStyle.js +26 -0
  433. package/example/node_modules/object-inspect/test/toStringTag.js +40 -0
  434. package/example/node_modules/object-inspect/test/undef.js +12 -0
  435. package/example/node_modules/object-inspect/test/values.js +261 -0
  436. package/example/node_modules/object-inspect/test-core-js.js +26 -0
  437. package/example/node_modules/object-inspect/util.inspect.js +1 -0
  438. package/example/node_modules/on-finished/HISTORY.md +98 -0
  439. package/example/node_modules/on-finished/LICENSE +23 -0
  440. package/example/node_modules/on-finished/README.md +162 -0
  441. package/example/node_modules/on-finished/index.js +234 -0
  442. package/example/node_modules/on-finished/package.json +39 -0
  443. package/example/node_modules/once/LICENSE +15 -0
  444. package/example/node_modules/once/README.md +79 -0
  445. package/example/node_modules/once/once.js +42 -0
  446. package/example/node_modules/once/package.json +33 -0
  447. package/example/node_modules/parseurl/HISTORY.md +58 -0
  448. package/example/node_modules/parseurl/LICENSE +24 -0
  449. package/example/node_modules/parseurl/README.md +133 -0
  450. package/example/node_modules/parseurl/index.js +158 -0
  451. package/example/node_modules/parseurl/package.json +40 -0
  452. package/example/node_modules/path-to-regexp/LICENSE +21 -0
  453. package/example/node_modules/path-to-regexp/Readme.md +224 -0
  454. package/example/node_modules/path-to-regexp/dist/index.d.ts +144 -0
  455. package/example/node_modules/path-to-regexp/dist/index.js +409 -0
  456. package/example/node_modules/path-to-regexp/dist/index.js.map +1 -0
  457. package/example/node_modules/path-to-regexp/package.json +64 -0
  458. package/example/node_modules/proxy-addr/HISTORY.md +161 -0
  459. package/example/node_modules/proxy-addr/LICENSE +22 -0
  460. package/example/node_modules/proxy-addr/README.md +139 -0
  461. package/example/node_modules/proxy-addr/index.js +327 -0
  462. package/example/node_modules/proxy-addr/package.json +47 -0
  463. package/example/node_modules/qs/.editorconfig +46 -0
  464. package/example/node_modules/qs/.github/FUNDING.yml +12 -0
  465. package/example/node_modules/qs/.github/SECURITY.md +11 -0
  466. package/example/node_modules/qs/.github/THREAT_MODEL.md +78 -0
  467. package/example/node_modules/qs/.nycrc +13 -0
  468. package/example/node_modules/qs/CHANGELOG.md +806 -0
  469. package/example/node_modules/qs/LICENSE.md +29 -0
  470. package/example/node_modules/qs/README.md +758 -0
  471. package/example/node_modules/qs/dist/qs.js +141 -0
  472. package/example/node_modules/qs/eslint.config.mjs +56 -0
  473. package/example/node_modules/qs/lib/formats.js +23 -0
  474. package/example/node_modules/qs/lib/index.js +11 -0
  475. package/example/node_modules/qs/lib/parse.js +373 -0
  476. package/example/node_modules/qs/lib/stringify.js +356 -0
  477. package/example/node_modules/qs/lib/utils.js +342 -0
  478. package/example/node_modules/qs/package.json +94 -0
  479. package/example/node_modules/qs/test/empty-keys-cases.js +267 -0
  480. package/example/node_modules/qs/test/parse.js +1568 -0
  481. package/example/node_modules/qs/test/stringify.js +1310 -0
  482. package/example/node_modules/qs/test/utils.js +404 -0
  483. package/example/node_modules/range-parser/HISTORY.md +56 -0
  484. package/example/node_modules/range-parser/LICENSE +23 -0
  485. package/example/node_modules/range-parser/README.md +84 -0
  486. package/example/node_modules/range-parser/index.js +162 -0
  487. package/example/node_modules/range-parser/package.json +44 -0
  488. package/example/node_modules/raw-body/LICENSE +22 -0
  489. package/example/node_modules/raw-body/README.md +223 -0
  490. package/example/node_modules/raw-body/index.d.ts +85 -0
  491. package/example/node_modules/raw-body/index.js +336 -0
  492. package/example/node_modules/raw-body/package.json +46 -0
  493. package/example/node_modules/router/HISTORY.md +228 -0
  494. package/example/node_modules/router/LICENSE +23 -0
  495. package/example/node_modules/router/README.md +416 -0
  496. package/example/node_modules/router/index.js +748 -0
  497. package/example/node_modules/router/lib/layer.js +247 -0
  498. package/example/node_modules/router/lib/route.js +242 -0
  499. package/example/node_modules/router/package.json +44 -0
  500. package/example/node_modules/safer-buffer/LICENSE +21 -0
  501. package/example/node_modules/safer-buffer/Porting-Buffer.md +268 -0
  502. package/example/node_modules/safer-buffer/Readme.md +156 -0
  503. package/example/node_modules/safer-buffer/dangerous.js +58 -0
  504. package/example/node_modules/safer-buffer/package.json +34 -0
  505. package/example/node_modules/safer-buffer/safer.js +77 -0
  506. package/example/node_modules/safer-buffer/tests.js +406 -0
  507. package/example/node_modules/send/LICENSE +23 -0
  508. package/example/node_modules/send/README.md +317 -0
  509. package/example/node_modules/send/index.js +997 -0
  510. package/example/node_modules/send/package.json +63 -0
  511. package/example/node_modules/serve-static/LICENSE +25 -0
  512. package/example/node_modules/serve-static/README.md +253 -0
  513. package/example/node_modules/serve-static/index.js +208 -0
  514. package/example/node_modules/serve-static/package.json +44 -0
  515. package/example/node_modules/setprototypeof/LICENSE +13 -0
  516. package/example/node_modules/setprototypeof/README.md +31 -0
  517. package/example/node_modules/setprototypeof/index.d.ts +2 -0
  518. package/example/node_modules/setprototypeof/index.js +17 -0
  519. package/example/node_modules/setprototypeof/package.json +38 -0
  520. package/example/node_modules/setprototypeof/test/index.js +24 -0
  521. package/example/node_modules/side-channel/.editorconfig +9 -0
  522. package/example/node_modules/side-channel/.eslintrc +12 -0
  523. package/example/node_modules/side-channel/.github/FUNDING.yml +12 -0
  524. package/example/node_modules/side-channel/.nycrc +13 -0
  525. package/example/node_modules/side-channel/CHANGELOG.md +110 -0
  526. package/example/node_modules/side-channel/LICENSE +21 -0
  527. package/example/node_modules/side-channel/README.md +61 -0
  528. package/example/node_modules/side-channel/index.d.ts +14 -0
  529. package/example/node_modules/side-channel/index.js +43 -0
  530. package/example/node_modules/side-channel/package.json +85 -0
  531. package/example/node_modules/side-channel/test/index.js +104 -0
  532. package/example/node_modules/side-channel/tsconfig.json +9 -0
  533. package/example/node_modules/side-channel-list/.editorconfig +9 -0
  534. package/example/node_modules/side-channel-list/.eslintrc +11 -0
  535. package/example/node_modules/side-channel-list/.github/FUNDING.yml +12 -0
  536. package/example/node_modules/side-channel-list/.nycrc +13 -0
  537. package/example/node_modules/side-channel-list/CHANGELOG.md +15 -0
  538. package/example/node_modules/side-channel-list/LICENSE +21 -0
  539. package/example/node_modules/side-channel-list/README.md +62 -0
  540. package/example/node_modules/side-channel-list/index.d.ts +13 -0
  541. package/example/node_modules/side-channel-list/index.js +113 -0
  542. package/example/node_modules/side-channel-list/list.d.ts +14 -0
  543. package/example/node_modules/side-channel-list/package.json +77 -0
  544. package/example/node_modules/side-channel-list/test/index.js +104 -0
  545. package/example/node_modules/side-channel-list/tsconfig.json +9 -0
  546. package/example/node_modules/side-channel-map/.editorconfig +9 -0
  547. package/example/node_modules/side-channel-map/.eslintrc +11 -0
  548. package/example/node_modules/side-channel-map/.github/FUNDING.yml +12 -0
  549. package/example/node_modules/side-channel-map/.nycrc +13 -0
  550. package/example/node_modules/side-channel-map/CHANGELOG.md +22 -0
  551. package/example/node_modules/side-channel-map/LICENSE +21 -0
  552. package/example/node_modules/side-channel-map/README.md +62 -0
  553. package/example/node_modules/side-channel-map/index.d.ts +15 -0
  554. package/example/node_modules/side-channel-map/index.js +68 -0
  555. package/example/node_modules/side-channel-map/package.json +80 -0
  556. package/example/node_modules/side-channel-map/test/index.js +114 -0
  557. package/example/node_modules/side-channel-map/tsconfig.json +9 -0
  558. package/example/node_modules/side-channel-weakmap/.editorconfig +9 -0
  559. package/example/node_modules/side-channel-weakmap/.eslintrc +12 -0
  560. package/example/node_modules/side-channel-weakmap/.github/FUNDING.yml +12 -0
  561. package/example/node_modules/side-channel-weakmap/.nycrc +13 -0
  562. package/example/node_modules/side-channel-weakmap/CHANGELOG.md +28 -0
  563. package/example/node_modules/side-channel-weakmap/LICENSE +21 -0
  564. package/example/node_modules/side-channel-weakmap/README.md +62 -0
  565. package/example/node_modules/side-channel-weakmap/index.d.ts +15 -0
  566. package/example/node_modules/side-channel-weakmap/index.js +84 -0
  567. package/example/node_modules/side-channel-weakmap/package.json +87 -0
  568. package/example/node_modules/side-channel-weakmap/test/index.js +114 -0
  569. package/example/node_modules/side-channel-weakmap/tsconfig.json +9 -0
  570. package/example/node_modules/statuses/HISTORY.md +87 -0
  571. package/example/node_modules/statuses/LICENSE +23 -0
  572. package/example/node_modules/statuses/README.md +139 -0
  573. package/example/node_modules/statuses/codes.json +65 -0
  574. package/example/node_modules/statuses/index.js +146 -0
  575. package/example/node_modules/statuses/package.json +49 -0
  576. package/example/node_modules/toidentifier/HISTORY.md +9 -0
  577. package/example/node_modules/toidentifier/LICENSE +21 -0
  578. package/example/node_modules/toidentifier/README.md +61 -0
  579. package/example/node_modules/toidentifier/index.js +32 -0
  580. package/example/node_modules/toidentifier/package.json +38 -0
  581. package/example/node_modules/type-is/HISTORY.md +292 -0
  582. package/example/node_modules/type-is/LICENSE +23 -0
  583. package/example/node_modules/type-is/README.md +198 -0
  584. package/example/node_modules/type-is/index.js +250 -0
  585. package/example/node_modules/type-is/package.json +47 -0
  586. package/example/node_modules/unpipe/HISTORY.md +4 -0
  587. package/example/node_modules/unpipe/LICENSE +22 -0
  588. package/example/node_modules/unpipe/README.md +43 -0
  589. package/example/node_modules/unpipe/index.js +69 -0
  590. package/example/node_modules/unpipe/package.json +27 -0
  591. package/example/node_modules/vary/HISTORY.md +39 -0
  592. package/example/node_modules/vary/LICENSE +22 -0
  593. package/example/node_modules/vary/README.md +101 -0
  594. package/example/node_modules/vary/index.js +149 -0
  595. package/example/node_modules/vary/package.json +43 -0
  596. package/example/node_modules/wrappy/LICENSE +15 -0
  597. package/example/node_modules/wrappy/README.md +36 -0
  598. package/example/node_modules/wrappy/package.json +29 -0
  599. package/example/node_modules/wrappy/wrappy.js +33 -0
  600. package/example/package-lock.json +101 -142
  601. package/example/package.json +2 -11
  602. package/package.json +11 -23
  603. package/src/cli/archiveSystem.js +119 -0
  604. package/src/cli/doctor.js +87 -0
  605. package/src/cli/index.js +99 -0
  606. package/src/cli/packageManager.js +52 -0
  607. package/src/cli/repl.js +108 -0
  608. package/src/cli/scaffolder.js +68 -0
  609. package/src/cli/testRunner.js +99 -0
  610. package/src/runtime/runner.js +383 -0
  611. package/src/stdlib/index.js +297 -0
  612. package/src/stdlib/sandbox.js +32 -0
  613. package/test_fenrir.sh +435 -0
  614. package/App/App.axaml +0 -8
  615. package/App/App.axaml.cs +0 -23
  616. package/App/FenrirLinux.csproj +0 -27
  617. package/App/LICENSE +0 -674
  618. package/App/MainWindow.axaml +0 -10
  619. package/App/MainWindow.axaml.cs +0 -16
  620. package/App/Program.cs +0 -19
  621. package/App/README.md +0 -24
  622. package/App/Views/InstallationView.axaml +0 -48
  623. package/App/Views/InstallationView.axaml.cs +0 -204
  624. package/App/Views/PasswordView.axaml +0 -34
  625. package/App/Views/PasswordView.axaml.cs +0 -62
  626. package/App/Views/WelcomeView.axaml +0 -63
  627. package/App/Views/WelcomeView.axaml.cs +0 -22
  628. package/App/app.manifest +0 -18
  629. package/App/images/screenshot1.png +0 -0
  630. package/App/images/screenshot2.png +0 -0
  631. package/App/obj/Debug/net9.0/Avalonia/Resources.Inputs.cache +0 -1
  632. package/App/obj/Debug/net9.0/Avalonia/original.dll +0 -0
  633. package/App/obj/Debug/net9.0/Avalonia/original.pdb +0 -0
  634. package/App/obj/Debug/net9.0/Avalonia/original.ref.dll +0 -0
  635. package/App/obj/Debug/net9.0/Avalonia/references +0 -202
  636. package/App/obj/Debug/net9.0/Avalonia/resources +0 -0
  637. package/App/obj/Debug/net9.0/FenrirLi.7B98506C.Up2Date +0 -0
  638. package/App/obj/Debug/net9.0/FenrirLinux.AssemblyInfo.cs +0 -22
  639. package/App/obj/Debug/net9.0/FenrirLinux.AssemblyInfoInputs.cache +0 -1
  640. package/App/obj/Debug/net9.0/FenrirLinux.GeneratedMSBuildEditorConfig.editorconfig +0 -35
  641. package/App/obj/Debug/net9.0/FenrirLinux.assets.cache +0 -0
  642. package/App/obj/Debug/net9.0/FenrirLinux.csproj.AssemblyReference.cache +0 -0
  643. package/App/obj/Debug/net9.0/FenrirLinux.csproj.CoreCompileInputs.cache +0 -1
  644. package/App/obj/Debug/net9.0/FenrirLinux.csproj.FileListAbsolute.txt +0 -135
  645. package/App/obj/Debug/net9.0/FenrirLinux.dll +0 -0
  646. package/App/obj/Debug/net9.0/FenrirLinux.genruntimeconfig.cache +0 -1
  647. package/App/obj/Debug/net9.0/FenrirLinux.pdb +0 -0
  648. package/App/obj/Debug/net9.0/apphost +0 -0
  649. package/App/obj/Debug/net9.0/ref/FenrirLinux.dll +0 -0
  650. package/App/obj/Debug/net9.0/refint/FenrirLinux.dll +0 -0
  651. package/App/obj/FenrirLinux.csproj.nuget.dgspec.json +0 -115
  652. package/App/obj/FenrirLinux.csproj.nuget.g.props +0 -26
  653. package/App/obj/FenrirLinux.csproj.nuget.g.targets +0 -9
  654. package/App/obj/Release/net9.0/linux-x64/Avalonia/Resources.Inputs.cache +0 -1
  655. package/App/obj/Release/net9.0/linux-x64/Avalonia/original.dll +0 -0
  656. package/App/obj/Release/net9.0/linux-x64/Avalonia/original.pdb +0 -0
  657. package/App/obj/Release/net9.0/linux-x64/Avalonia/original.ref.dll +0 -0
  658. package/App/obj/Release/net9.0/linux-x64/Avalonia/references +0 -194
  659. package/App/obj/Release/net9.0/linux-x64/Avalonia/resources +0 -0
  660. package/App/obj/Release/net9.0/linux-x64/FenrirLi.7B98506C.Up2Date +0 -0
  661. package/App/obj/Release/net9.0/linux-x64/FenrirLinux.AssemblyInfo.cs +0 -22
  662. package/App/obj/Release/net9.0/linux-x64/FenrirLinux.AssemblyInfoInputs.cache +0 -1
  663. package/App/obj/Release/net9.0/linux-x64/FenrirLinux.GeneratedMSBuildEditorConfig.editorconfig +0 -39
  664. package/App/obj/Release/net9.0/linux-x64/FenrirLinux.assets.cache +0 -0
  665. package/App/obj/Release/net9.0/linux-x64/FenrirLinux.csproj.AssemblyReference.cache +0 -0
  666. package/App/obj/Release/net9.0/linux-x64/FenrirLinux.csproj.CoreCompileInputs.cache +0 -1
  667. package/App/obj/Release/net9.0/linux-x64/FenrirLinux.csproj.FileListAbsolute.txt +0 -238
  668. package/App/obj/Release/net9.0/linux-x64/FenrirLinux.deps.json +0 -1317
  669. package/App/obj/Release/net9.0/linux-x64/FenrirLinux.dll +0 -0
  670. package/App/obj/Release/net9.0/linux-x64/FenrirLinux.genbundle.cache +0 -1
  671. package/App/obj/Release/net9.0/linux-x64/FenrirLinux.genpublishdeps.cache +0 -1
  672. package/App/obj/Release/net9.0/linux-x64/FenrirLinux.genruntimeconfig.cache +0 -1
  673. package/App/obj/Release/net9.0/linux-x64/FenrirLinux.pdb +0 -0
  674. package/App/obj/Release/net9.0/linux-x64/PublishOutputs.fac9e24064.txt +0 -4
  675. package/App/obj/Release/net9.0/linux-x64/apphost +0 -0
  676. package/App/obj/Release/net9.0/linux-x64/ref/FenrirLinux.dll +0 -0
  677. package/App/obj/Release/net9.0/linux-x64/refint/FenrirLinux.dll +0 -0
  678. package/App/obj/Release/net9.0/linux-x64/singlefilehost +0 -0
  679. package/App/obj/project.assets.json +0 -2463
  680. package/App/obj/project.nuget.cache +0 -47
  681. package/LICENSE +0 -674
  682. package/dist/archiveSystem.js +0 -219
  683. package/dist/cli.js +0 -188
  684. package/dist/packageManager.js +0 -98
  685. package/dist/parser.js +0 -24
  686. package/dist/runtime.js +0 -99
  687. package/dist/transformer.js +0 -120
  688. package/example/fenrir+aperium/aperium.json +0 -17
  689. package/example/fenrir+aperium/aperium_modules/hello-world/index.js +0 -4
  690. package/example/fenrir+aperium/aperium_modules/hello-world/module.json +0 -6
  691. package/example/fenrir+aperium/app.fnr +0 -19
  692. package/example/fenrir+aperium/package.json +0 -17
  693. package/src/archiveSystem.ts +0 -264
  694. package/src/cli.ts +0 -216
  695. package/src/packageManager.ts +0 -119
  696. package/src/parser.ts +0 -36
  697. package/src/runtime.ts +0 -111
  698. package/src/transformer.ts +0 -147
  699. package/tsconfig.json +0 -15
@@ -0,0 +1,383 @@
1
+ import { spawn } from 'child_process';
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+ import os from 'os';
5
+ import crypto from 'crypto';
6
+ import { fileURLToPath } from 'url';
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+
11
+ const transformCache = new Map();
12
+
13
+ function getCacheKey(source) {
14
+ return crypto.createHash('md5').update(source).digest('hex');
15
+ }
16
+
17
+ function transformFString(line) {
18
+ return line.replace(/f"((?:[^"\\]|\\.)*)"/g, (_, content) => {
19
+ const converted = content.replace(/\{([^}]+)\}/g, '${$1}');
20
+ return '`' + converted + '`';
21
+ }).replace(/f'((?:[^'\\]|\\.)*)'/g, (_, content) => {
22
+ const converted = content.replace(/\{([^}]+)\}/g, '${$1}');
23
+ return '`' + converted + '`';
24
+ });
25
+ }
26
+
27
+ function transformPipe(line) {
28
+ if (!line.includes('|>')) return line;
29
+
30
+ // Handle assignment: "const x = a |> b |> c"
31
+ const assignMatch = line.match(/^((?:const|let|var)\s+\w+\s*=\s*)(.+)$/);
32
+ const prefix = assignMatch ? assignMatch[1] : '';
33
+ const expr = assignMatch ? assignMatch[2] : line;
34
+
35
+ if (!expr.includes('|>')) return line;
36
+
37
+ const parts = expr.split('|>').map(s => s.trim());
38
+ let result = parts[0];
39
+ for (let i = 1; i < parts.length; i++) {
40
+ const fn = parts[i];
41
+ if (fn.includes('(')) {
42
+ result = fn.replace(/\(/, `(${result}, `);
43
+ } else {
44
+ result = `${fn}(${result})`;
45
+ }
46
+ }
47
+ return prefix + result;
48
+ }
49
+
50
+ function transformMatch(lines, startIdx) {
51
+ const matchLine = lines[startIdx].trim();
52
+ const m = matchLine.match(/^match\s+(.+?)\s*\{?\s*$/);
53
+ if (!m) return null;
54
+ const subject = m[1];
55
+ const arms = [];
56
+ let i = startIdx + 1;
57
+ let braceDepth = matchLine.endsWith('{') ? 1 : 0;
58
+ if (!matchLine.endsWith('{') && i < lines.length && lines[i].trim() === '{') {
59
+ i++;
60
+ braceDepth = 1;
61
+ }
62
+ while (i < lines.length && braceDepth > 0) {
63
+ const l = lines[i].trim();
64
+ if (l === '}') { braceDepth--; i++; continue; }
65
+ const arm = l.match(/^(.+?)\s*=>\s*(.+)$/);
66
+ if (arm) {
67
+ arms.push({ pattern: arm[1].trim(), body: arm[2].trim() });
68
+ }
69
+ i++;
70
+ }
71
+ const cases = arms.map(({ pattern, body }) => {
72
+ if (pattern === '_') return ` default: { ${body}; break; }`;
73
+ if (/^-?\d+$/.test(pattern) || pattern.startsWith('"') || pattern.startsWith("'")) {
74
+ return ` case ${pattern}: { ${body}; break; }`;
75
+ }
76
+ return ` case ${pattern}: { ${body}; break; }`;
77
+ });
78
+ const switchCode = `switch (${subject}) {\n${cases.join('\n')}\n}`;
79
+ return { code: switchCode, nextIdx: i };
80
+ }
81
+
82
+ function precompileLocal(fnrPath, dir) {
83
+ const hash = crypto.createHash('md5').update(fnrPath).digest('hex').slice(0, 8);
84
+ const outFile = path.join(dir, `dep_${hash}.mjs`);
85
+ if (fs.existsSync(outFile)) return outFile;
86
+ const src = fs.readFileSync(fnrPath, 'utf8');
87
+ const compiled = transform(src, fnrPath, dir);
88
+ const stdlibPath = path.join(__dirname, '..', 'stdlib', 'index.js');
89
+ const inject = fs.existsSync(stdlibPath)
90
+ ? `import { injectGlobals } from "file://${stdlibPath}";\ninjectGlobals();\n`
91
+ : '';
92
+ fs.writeFileSync(outFile, inject + '\n' + compiled, 'utf8');
93
+ return outFile;
94
+ }
95
+
96
+ function transform(source, filePath, precompileDir = null) {
97
+ const cacheKey = getCacheKey(source) + (precompileDir || '');
98
+ if (transformCache.has(cacheKey)) return transformCache.get(cacheKey);
99
+
100
+ const lines = source.split('\n');
101
+ const out = [];
102
+ let i = 0;
103
+
104
+ while (i < lines.length) {
105
+ let raw = lines[i];
106
+ const line = raw.trim();
107
+ i++;
108
+
109
+ if (!line) { out.push(''); continue; }
110
+ if (line.startsWith('//') || line.startsWith('/*') || line.startsWith('*')) { out.push(raw); continue; }
111
+
112
+ if (line.startsWith('use ') && line.includes(' from ')) {
113
+ const m = line.match(/^use\s+(.*?)\s+from\s+(['"])(.*?)\2\s*;?$/);
114
+ if (m) {
115
+ const [, spec,, mod] = m;
116
+ const isLocal = /^\.\.\//.test(mod) || /^\.\//.test(mod) || mod.startsWith('/');
117
+ if (isLocal) {
118
+ const absPath = path.resolve(path.dirname(filePath), mod);
119
+ if (absPath.endsWith('.fnr') && precompileDir) {
120
+ const compiled = precompileLocal(absPath, precompileDir);
121
+ out.push(`import ${spec} from "file://${compiled}";`);
122
+ } else {
123
+ out.push(`import ${spec} from "file://${absPath}";`);
124
+ }
125
+ } else {
126
+ out.push(`import ${spec} from "${mod}";`);
127
+ }
128
+ } else { out.push(raw); }
129
+ continue;
130
+ }
131
+
132
+ if (line.startsWith('match ')) {
133
+ const result = transformMatch(lines, i - 1);
134
+ if (result) {
135
+ out.push(result.code);
136
+ i = result.nextIdx;
137
+ continue;
138
+ }
139
+ }
140
+
141
+ if (line.startsWith('async fn ') || line.startsWith('fn ')) {
142
+ out.push(sh(raw).replace(/\basync fn\s+/, 'async function ').replace(/\bfn\s+/, 'function '));
143
+ continue;
144
+ }
145
+
146
+ if (line.startsWith('type ') && line.includes('=')) continue;
147
+ if (isJs(line)) { out.push(sh(transformFString(transformPipe(raw)))); continue; }
148
+
149
+ if (!bal(line)) {
150
+ let full = raw;
151
+ while (i < lines.length && !bal(full)) { full += '\n' + lines[i]; i++; }
152
+ const s = sh(transformFString(transformPipe(full)));
153
+ out.push(s + (semi(s.trim()) ? ';' : ''));
154
+ continue;
155
+ }
156
+
157
+ const s = sh(transformFString(transformPipe(raw)));
158
+ out.push(s.trim() + (semi(s.trim()) ? ';' : ''));
159
+ }
160
+
161
+ const result = out.join('\n');
162
+ transformCache.set(cacheKey, result);
163
+ return result;
164
+ }
165
+
166
+ const sh = c => c
167
+ .replace(/\blog\(/g, 'console.log(')
168
+ .replace(/\berr\(/g, 'console.error(')
169
+ .replace(/\bwarn\(/g, 'console.warn(')
170
+ .replace(/\binfo\(/g, 'console.info(')
171
+ .replace(/\basync fn\b/g, 'async function')
172
+ .replace(/\bfn\b/g, 'function');
173
+
174
+ function ch(s, c) { let n=0,inS=false,sC=''; for(let j=0;j<s.length;j++){const x=s[j];if(inS){if(x==='\\'){j++;continue}if(x===sC)inS=false;continue}if(x==='"'||x==="'"){inS=true;sC=x;continue}if(x===c)n++}return n; }
175
+ const bal = s => ch(s,'(')=== ch(s,')')&& ch(s,'[')=== ch(s,']')&& ch(s,'{')=== ch(s,'}');
176
+
177
+ function isJs(l) {
178
+ return l.startsWith('import ')||l.startsWith('export ')||l.startsWith('class ')||
179
+ l.startsWith('function ')||l.startsWith('async function ')||
180
+ l.startsWith('if ')||l.startsWith('if(')||l.startsWith('else')||l.startsWith('} else')||
181
+ l.startsWith('for ')||l.startsWith('for(')||l.startsWith('while ')||l.startsWith('while(')||
182
+ l.startsWith('switch ')||l.startsWith('switch(')||l.startsWith('try')||
183
+ l.startsWith('catch')||l.startsWith('finally')||l.startsWith('return')||
184
+ l.startsWith('throw ')||l.startsWith('case ')||l.startsWith('default:')||
185
+ /^}\s*(else|catch|finally)/.test(l)||l==='break'||l==='continue';
186
+ }
187
+
188
+ function semi(l) {
189
+ if(!l) return false;
190
+ if(l.endsWith(';')||l.endsWith('{')||l.endsWith('}')||l.endsWith(',')||l.endsWith('[')||l.endsWith('(')) return false;
191
+ if(isJs(l)) return false;
192
+ if(l.endsWith(')')&&!(l.includes('=')||l.includes('console.')||/^[a-zA-Z_$][\w$.]*\s*\(/.test(l)||/^(await|return)\s/.test(l))) return false;
193
+ return l.includes('=')||l.includes('console.')||
194
+ l.startsWith('const ')||l.startsWith('let ')||l.startsWith('var ')||
195
+ l.startsWith('throw ')||l.startsWith('return')||l.startsWith('import ')||
196
+ /^[a-zA-Z_$][\w$.]*\s*[\(`[]/.test(l)||/^(await|yield)\s/.test(l)||
197
+ /^\w+\s*(\+\+|--)/.test(l)||/^\w+\s*[+\-*/&|^]=/.test(l);
198
+ }
199
+
200
+ export async function runFile(filePath, debug=false, sandbox=false) {
201
+ if (!fs.existsSync(filePath)) { console.error(`\x1b[31m✘ File not found: ${filePath}\x1b[0m`); process.exit(1); }
202
+
203
+ const source = fs.readFileSync(filePath, 'utf8');
204
+ if (!source.trim()) { console.error('\x1b[31m✘ File is empty.\x1b[0m'); process.exit(1); }
205
+
206
+ const tempDir = path.join(os.tmpdir(), `fenrir_${Date.now()}`);
207
+ fs.mkdirSync(tempDir, { recursive: true });
208
+
209
+ const userCode = transform(source, filePath, tempDir);
210
+ const stdlibPath = path.join(__dirname, '..', 'stdlib', 'index.js');
211
+ const sandboxPath = path.join(__dirname, '..', 'stdlib', 'sandbox.js');
212
+
213
+ let inject = '';
214
+ if (sandbox && fs.existsSync(sandboxPath)) {
215
+ inject = `import { injectGlobals } from "file://${sandboxPath}";\ninjectGlobals();\n`;
216
+ } else if (fs.existsSync(stdlibPath)) {
217
+ inject = `import { injectGlobals } from "file://${stdlibPath}";\ninjectGlobals();\n`;
218
+ }
219
+
220
+ const final = `${inject}\n${userCode}`;
221
+ if (debug) console.log('\x1b[90m[debug]\x1b[0m\n' + final);
222
+
223
+ const tempFile = path.join(tempDir, 'run.mjs');
224
+ fs.writeFileSync(tempFile, final);
225
+
226
+ const root = process.cwd();
227
+ const cwdMods = path.join(root, 'node_modules');
228
+ const tempMods = path.join(tempDir, 'node_modules');
229
+ if (fs.existsSync(cwdMods)) try { cpDir(cwdMods, tempMods); } catch {}
230
+ const pkg = path.join(root, 'package.json');
231
+ if (fs.existsSync(pkg)) try { fs.copyFileSync(pkg, path.join(tempDir,'package.json')); } catch {}
232
+
233
+ const env = { ...process.env,
234
+ NODE_PATH: [tempMods, cwdMods, process.env.NODE_PATH].filter(Boolean).join(path.delimiter),
235
+ ...(sandbox ? { FENRIR_SANDBOX: '1' } : {})
236
+ };
237
+
238
+ const child = spawn('node', [tempFile], { stdio:'inherit', env, cwd:root });
239
+ child.on('close', code => { del(tempDir); process.exit(code??0); });
240
+ child.on('error', e => { console.error(`\x1b[31m✘ ${e.message}\x1b[0m`); del(tempDir); process.exit(1); });
241
+ process.on('SIGINT', () => { del(tempDir); process.exit(130); });
242
+ }
243
+
244
+ export async function watchFile(filePath, debug=false) {
245
+ const { default: chokidar } = await import('chokidar');
246
+ console.log(`\x1b[36m👁 Watching: ${filePath}\x1b[0m`);
247
+ let child = null;
248
+
249
+ const run = () => {
250
+ if (child) { try { child.kill(); } catch {} }
251
+ console.log('\x1b[90m─────────────────────────────\x1b[0m');
252
+ console.log(`\x1b[36m▶ Running ${path.basename(filePath)}\x1b[0m`);
253
+ const source = fs.readFileSync(filePath, 'utf8');
254
+ const tempDir = path.join(os.tmpdir(), `fenrir_watch_${Date.now()}`);
255
+ fs.mkdirSync(tempDir, { recursive: true });
256
+ const userCode = transform(source, filePath, tempDir);
257
+ const stdlibPath = path.join(__dirname, '..', 'stdlib', 'index.js');
258
+ const inject = fs.existsSync(stdlibPath)
259
+ ? `import { injectGlobals } from "file://${stdlibPath}";\ninjectGlobals();\n`
260
+ : '';
261
+ const final = `${inject}\n${userCode}`;
262
+ const tempFile = path.join(tempDir, 'run.mjs');
263
+ fs.writeFileSync(tempFile, final);
264
+ const root = process.cwd();
265
+ const cwdMods = path.join(root, 'node_modules');
266
+ const tempMods = path.join(tempDir, 'node_modules');
267
+ if (fs.existsSync(cwdMods)) try { cpDir(cwdMods, tempMods); } catch {}
268
+ const pkg = path.join(root, 'package.json');
269
+ if (fs.existsSync(pkg)) try { fs.copyFileSync(pkg, path.join(tempDir, 'package.json')); } catch {}
270
+ const env = { ...process.env, NODE_PATH: [tempMods, cwdMods, process.env.NODE_PATH].filter(Boolean).join(path.delimiter) };
271
+ child = spawn('node', [tempFile], { stdio: 'inherit', env, cwd: root });
272
+ child.on('close', code => {
273
+ del(tempDir);
274
+ console.log(`\x1b[90m[exited: ${code}]\x1b[0m`);
275
+ });
276
+ };
277
+
278
+ run();
279
+ chokidar.watch(filePath, { ignoreInitial: true }).on('change', () => {
280
+ console.log(`\x1b[33m⟳ Changed, restarting...\x1b[0m`);
281
+ run();
282
+ });
283
+ }
284
+
285
+ export function formatFile(filePath) {
286
+ const source = fs.readFileSync(filePath, 'utf8');
287
+ const lines = source.split('\n');
288
+ const out = [];
289
+ let indent = 0;
290
+ const TAB = ' ';
291
+
292
+ for (const raw of lines) {
293
+ const line = raw.trim();
294
+ if (!line) { out.push(''); continue; }
295
+
296
+ const closes = (line.match(/^[}\])]/) || []).length;
297
+ if (closes) indent = Math.max(0, indent - closes);
298
+
299
+ out.push(TAB.repeat(indent) + line);
300
+
301
+ const opens = (line.match(/[{[(]$/) || []).length;
302
+ const closeInline = (line.match(/[}\])]$/) && !line.match(/^[}\]]/) || []).length;
303
+ if (opens && !closeInline) indent++;
304
+ }
305
+
306
+ const formatted = out.join('\n');
307
+ fs.writeFileSync(filePath, formatted, 'utf8');
308
+ console.log(`\x1b[32m✓ Formatted: ${filePath}\x1b[0m`);
309
+ }
310
+
311
+ export function lintFile(filePath) {
312
+ const source = fs.readFileSync(filePath, 'utf8');
313
+ const lines = source.split('\n');
314
+ const issues = [];
315
+
316
+ lines.forEach((raw, idx) => {
317
+ const line = raw.trim();
318
+ const ln = idx + 1;
319
+ if (line.length > 120) issues.push({ ln, msg: `Line too long (${line.length} chars)` });
320
+ if (/\bconsole\.log\b/.test(line)) issues.push({ ln, msg: 'Use print() instead of console.log()' });
321
+ if (/var\s+/.test(line) && !line.startsWith('//')) issues.push({ ln, msg: 'Prefer const/let over var' });
322
+ if (/==(?!=)/.test(line) && !line.startsWith('//')) issues.push({ ln, msg: 'Use === instead of ==' });
323
+ if (/!=(?!=)/.test(line) && !line.startsWith('//')) issues.push({ ln, msg: 'Use !== instead of !=' });
324
+ });
325
+
326
+ if (!issues.length) {
327
+ console.log(`\x1b[32m✓ No issues found in ${filePath}\x1b[0m`);
328
+ return;
329
+ }
330
+ console.log(`\x1b[33m⚠ ${issues.length} issue(s) in ${filePath}:\x1b[0m`);
331
+ for (const { ln, msg } of issues) {
332
+ console.log(` \x1b[90mline ${ln}:\x1b[0m ${msg}`);
333
+ }
334
+ }
335
+
336
+ export function bundleFile(entryPath, outPath) {
337
+ const visited = new Set();
338
+ const chunks = [];
339
+
340
+ function collect(fp) {
341
+ const abs = path.resolve(fp);
342
+ if (visited.has(abs)) return;
343
+ visited.add(abs);
344
+ const src = fs.readFileSync(abs, 'utf8');
345
+ const lines = src.split('\n');
346
+ const out = [];
347
+ for (const line of lines) {
348
+ const m = line.trim().match(/^(?:use|import)\s+.*?\s+from\s+['"](\..+?)['"]/);
349
+ if (m) {
350
+ const dep = path.resolve(path.dirname(abs), m[1]);
351
+ const candidates = [dep, dep + '.js', dep + '.fnr', dep + '/index.js'];
352
+ for (const c of candidates) {
353
+ if (fs.existsSync(c)) { collect(c); break; }
354
+ }
355
+ continue;
356
+ }
357
+ out.push(line);
358
+ }
359
+ chunks.push(`\n// === ${path.relative(process.cwd(), abs)} ===\n` + out.join('\n'));
360
+ }
361
+
362
+ collect(entryPath);
363
+ const stdlibPath = path.join(__dirname, '..', 'stdlib', 'index.js');
364
+ const inject = fs.existsSync(stdlibPath)
365
+ ? `import { injectGlobals } from "file://${stdlibPath}";\ninjectGlobals();\n`
366
+ : '';
367
+ const bundle = inject + chunks.join('\n');
368
+ const dest = outPath || entryPath.replace(/\.(fnr|js)$/, '.bundle.mjs');
369
+ fs.writeFileSync(dest, bundle, 'utf8');
370
+ console.log(`\x1b[32m✓ Bundled → ${dest}\x1b[0m`);
371
+ }
372
+
373
+ const del = dir => { try { fs.rmSync(dir,{recursive:true,force:true}); } catch {} };
374
+
375
+ function cpDir(src, dest) {
376
+ fs.mkdirSync(dest, { recursive: true });
377
+ for (const e of fs.readdirSync(src, { withFileTypes: true })) {
378
+ const s = path.join(src, e.name), d = path.join(dest, e.name);
379
+ if (e.isSymbolicLink()) try { cpDir(fs.realpathSync(s),d); } catch {}
380
+ else if (e.isDirectory()) cpDir(s,d);
381
+ else try { fs.copyFileSync(s,d); } catch {}
382
+ }
383
+ }
@@ -0,0 +1,297 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import http from 'http';
4
+ import { execSync, spawn as nodeSpawn } from 'child_process';
5
+ import { createInterface } from 'readline';
6
+ import { fileURLToPath } from 'url';
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+
11
+ const fmt = v => v===null?'null':v===undefined?'undefined':typeof v==='object'?JSON.stringify(v,null,2):String(v);
12
+
13
+ export const print = (...a) => { process.stdout.write(a.map(fmt).join(' ')+'\n'); };
14
+ export const log = print;
15
+ export const err = (...a) => { process.stderr.write(a.map(fmt).join(' ')+'\n'); };
16
+ export const warn = (...a) => { process.stderr.write('\x1b[33m'+a.map(fmt).join(' ')+'\x1b[0m\n'); };
17
+ export const info = (...a) => { process.stdout.write('\x1b[36m'+a.map(fmt).join(' ')+'\x1b[0m\n'); };
18
+
19
+ export const prompt = q => new Promise(r => {
20
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
21
+ rl.question(q, a => { rl.close(); r(a); });
22
+ });
23
+
24
+ export const readFile = p => fs.readFileSync(path.resolve(p), 'utf8');
25
+ export const writeFile = (p,c) => { fs.writeFileSync(path.resolve(p), c, 'utf8'); };
26
+ export const appendFile = (p,c) => { fs.appendFileSync(path.resolve(p), c, 'utf8'); };
27
+ export const fileExists = p => fs.existsSync(path.resolve(p));
28
+ export const readDir = p => fs.readdirSync(path.resolve(p));
29
+ export const readJSON = p => JSON.parse(readFile(p));
30
+ export const writeJSON = (p,d) => writeFile(p, JSON.stringify(d,null,2));
31
+ export const mkdir = p => { fs.mkdirSync(path.resolve(p), { recursive: true }); };
32
+ export const rm = p => { fs.rmSync(path.resolve(p), { recursive: true, force: true }); };
33
+
34
+ export const get = async (url, headers) => { const r=await fetch(url,{headers}); const t=await r.text(); try{return JSON.parse(t)}catch{return t}};
35
+ export const post = async (url, body, headers) => { const r=await fetch(url,{method:'POST',headers:{'Content-Type':'application/json',...headers},body:JSON.stringify(body)}); const t=await r.text(); try{return JSON.parse(t)}catch{return t}};
36
+
37
+ export const exec = cmd => execSync(cmd, { encoding:'utf8', stdio:['pipe','pipe','pipe'] }).trim();
38
+ export const run = cmd => { execSync(cmd, { stdio:'inherit' }); };
39
+ export const spawn = (cmd, args=[]) => new Promise((res,rej) => {
40
+ const c = nodeSpawn(cmd, args, { stdio:'inherit' });
41
+ c.on('close', res); c.on('error', rej);
42
+ });
43
+
44
+ export const env = (k, fb='') => process.env[k] ?? fb;
45
+ export const args = () => process.argv.slice(2);
46
+ export const exit = (c=0) => process.exit(c);
47
+ export const cwd = () => process.cwd();
48
+
49
+ export const now = () => Date.now();
50
+ export const time = () => new Date().toISOString();
51
+ export const sleep = ms => new Promise(r => setTimeout(r, ms));
52
+ export const bench = async (label, fn) => { const s=performance.now(); await fn(); info(`[bench] ${label}: ${(performance.now()-s).toFixed(2)}ms`); };
53
+
54
+ export const range = (start, end, step=1) => { if(end===undefined){end=start;start=0;} const r=[];for(let i=start;i<end;i+=step)r.push(i);return r; };
55
+ export const rand = (min=0,max=1) => Math.random()*(max-min)+min;
56
+ export const randInt = (min,max) => Math.floor(rand(min,max+1));
57
+ export const pick = arr => arr[randInt(0,arr.length-1)];
58
+ export const shuffle = arr => { const a=[...arr]; for(let i=a.length-1;i>0;i--){const j=randInt(0,i);[a[i],a[j]]=[a[j],a[i]];} return a; };
59
+ export const chunk = (arr,n) => { const r=[];for(let i=0;i<arr.length;i+=n)r.push(arr.slice(i,i+n));return r; };
60
+ export const unique = arr => [...new Set(arr)];
61
+ export const flatten = arr => arr.flat(Infinity);
62
+ export const sum = arr => arr.reduce((a,b)=>a+b,0);
63
+ export const avg = arr => sum(arr)/arr.length;
64
+ export const min = (...a) => Math.min(...(Array.isArray(a[0])?a[0]:a));
65
+ export const max = (...a) => Math.max(...(Array.isArray(a[0])?a[0]:a));
66
+ export const clamp = (n,lo,hi) => Math.max(lo,Math.min(hi,n));
67
+
68
+ export const capitalize = s => s.charAt(0).toUpperCase()+s.slice(1);
69
+ export const truncate = (s,n,suf='...') => s.length>n?s.slice(0,n)+suf:s;
70
+ export const pad = (s,n,c=' ') => String(s).padStart(n,c);
71
+ export const repeat = (s,n) => s.repeat(n);
72
+
73
+ export const keys = o => Object.keys(o);
74
+ export const values = o => Object.values(o);
75
+ export const entries = o => Object.entries(o);
76
+ export const merge = (...os) => Object.assign({},...os);
77
+ export const clone = v => JSON.parse(JSON.stringify(v));
78
+
79
+ export const all = ps => Promise.all(ps);
80
+ export const race = ps => Promise.race(ps);
81
+ export const retry = async (fn,times=3,delay=500) => { for(let i=0;i<times;i++){try{return await fn()}catch(e){if(i===times-1)throw e;await sleep(delay);}} };
82
+
83
+ export const isString = v => typeof v==='string';
84
+ export const isNumber = v => typeof v==='number';
85
+ export const isBool = v => typeof v==='boolean';
86
+ export const isArray = v => Array.isArray(v);
87
+ export const isObject = v => v!==null&&typeof v==='object'&&!Array.isArray(v);
88
+ export const isNull = v => v===null;
89
+ export const isDefined= v => v!==undefined&&v!==null;
90
+
91
+ export const { abs,ceil,floor,round,sqrt,pow,PI,E,log2,log10,sin,cos,tan } = Math;
92
+
93
+ export function serve(port, handler) {
94
+ const server = http.createServer(async (req, res) => {
95
+ let body = '';
96
+ req.on('data', d => body += d);
97
+ req.on('end', async () => {
98
+ const request = {
99
+ method: req.method,
100
+ url: req.url,
101
+ headers: req.headers,
102
+ body: body ? ((() => { try { return JSON.parse(body); } catch { return body; } })()) : null,
103
+ params: Object.fromEntries(new URL(req.url, `http://localhost`).searchParams),
104
+ };
105
+ try {
106
+ const result = await handler(request);
107
+ if (typeof result === 'string') {
108
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
109
+ res.end(result);
110
+ } else if (result && typeof result === 'object') {
111
+ if (result.__raw) {
112
+ res.writeHead(result.status || 200, result.headers || {});
113
+ res.end(result.body ?? '');
114
+ } else {
115
+ res.writeHead(result.status || 200, { 'Content-Type': 'application/json', ...(result.headers||{}) });
116
+ res.end(JSON.stringify(result.body ?? result));
117
+ }
118
+ } else {
119
+ res.writeHead(200); res.end(String(result ?? ''));
120
+ }
121
+ } catch(e) {
122
+ res.writeHead(500, { 'Content-Type': 'application/json' });
123
+ res.end(JSON.stringify({ error: e.message }));
124
+ }
125
+ });
126
+ });
127
+ server.listen(port, () => info(`[serve] Listening on http://localhost:${port}`));
128
+ return server;
129
+ }
130
+
131
+ export function response(body, status=200, headers={}) {
132
+ return { __raw: true, body: typeof body === 'object' ? JSON.stringify(body) : body, status, headers: { 'Content-Type': typeof body === 'object' ? 'application/json' : 'text/plain', ...headers } };
133
+ }
134
+
135
+ export async function openDb(dbPath) {
136
+ let initSqlJs;
137
+ try {
138
+ const m = await import('sql.js');
139
+ initSqlJs = m.default;
140
+ } catch {
141
+ throw new Error('sql.js not found. Run: fenrir install sql.js');
142
+ }
143
+
144
+ const SQL = await initSqlJs();
145
+ const absPath = dbPath && dbPath !== ':memory:' ? path.resolve(dbPath) : null;
146
+ const db = absPath && fs.existsSync(absPath)
147
+ ? new SQL.Database(fs.readFileSync(absPath))
148
+ : new SQL.Database();
149
+
150
+ const save = () => {
151
+ if (absPath) fs.writeFileSync(absPath, Buffer.from(db.export()));
152
+ };
153
+
154
+ return {
155
+ query(sql, ...params) {
156
+ if (/^\s*(select|pragma)/i.test(sql)) {
157
+ const stmt = db.prepare(sql);
158
+ stmt.bind(params);
159
+ const rows = [];
160
+ while (stmt.step()) rows.push(stmt.getAsObject());
161
+ stmt.free();
162
+ return rows;
163
+ }
164
+ db.run(sql, params);
165
+ save();
166
+ return { changes: db.getRowsModified() };
167
+ },
168
+ run(sql, ...params) { db.run(sql, params); save(); return { changes: db.getRowsModified() }; },
169
+ get(sql, ...params) {
170
+ const stmt = db.prepare(sql);
171
+ stmt.bind(params);
172
+ const row = stmt.step() ? stmt.getAsObject() : null;
173
+ stmt.free();
174
+ return row;
175
+ },
176
+ all(sql, ...params) {
177
+ const stmt = db.prepare(sql);
178
+ stmt.bind(params);
179
+ const rows = [];
180
+ while (stmt.step()) rows.push(stmt.getAsObject());
181
+ stmt.free();
182
+ return rows;
183
+ },
184
+ exec(sql) { db.run(sql); save(); },
185
+ close() { save(); db.close(); },
186
+ transaction(fn) {
187
+ db.run('BEGIN');
188
+ try { fn(); db.run('COMMIT'); save(); }
189
+ catch(e) { db.run('ROLLBACK'); throw e; }
190
+ },
191
+ };
192
+ }
193
+
194
+ export async function parse(input, typeHint) {
195
+ const str = typeof input === 'string' && fs.existsSync(input)
196
+ ? fs.readFileSync(input, 'utf8')
197
+ : String(input);
198
+
199
+ const ext = typeof input === 'string' ? path.extname(input).toLowerCase() : '';
200
+ const hint = typeHint || ext;
201
+
202
+ if (hint === '.csv' || hint === 'csv') return parseCsv(str);
203
+ if (hint === '.toml' || hint === 'toml') {
204
+ try { const { default: toml } = await import('toml'); return toml.parse(str); } catch { throw new Error('toml not found. Run: fenrir install toml'); }
205
+ }
206
+ if (hint === '.yaml' || hint === '.yml' || hint === 'yaml') {
207
+ try { const { default: yaml } = await import('js-yaml'); return yaml.load(str); } catch { throw new Error('js-yaml not found. Run: fenrir install js-yaml'); }
208
+ }
209
+
210
+ try { return JSON.parse(str); } catch {}
211
+ try {
212
+ const { default: yaml } = await import('js-yaml');
213
+ return yaml.load(str);
214
+ } catch {}
215
+ if (str.includes(',')) return parseCsv(str);
216
+ return str;
217
+ }
218
+
219
+ function parseCsv(str) {
220
+ const lines = str.trim().split('\n');
221
+ if (!lines.length) return [];
222
+ const headers = lines[0].split(',').map(h => h.trim().replace(/^"|"$/g, ''));
223
+ return lines.slice(1).map(line => {
224
+ const vals = line.split(',').map(v => v.trim().replace(/^"|"$/g, ''));
225
+ return Object.fromEntries(headers.map((h, i) => [h, vals[i] ?? '']));
226
+ });
227
+ }
228
+
229
+ export function cache(ttlMs = 60000) {
230
+ const store = new Map();
231
+ return {
232
+ get: key => {
233
+ const entry = store.get(key);
234
+ if (!entry) return undefined;
235
+ if (Date.now() > entry.expires) { store.delete(key); return undefined; }
236
+ return entry.value;
237
+ },
238
+ set: (key, value, customTtl) => {
239
+ store.set(key, { value, expires: Date.now() + (customTtl ?? ttlMs) });
240
+ },
241
+ has: key => {
242
+ const entry = store.get(key);
243
+ if (!entry) return false;
244
+ if (Date.now() > entry.expires) { store.delete(key); return false; }
245
+ return true;
246
+ },
247
+ del: key => store.delete(key),
248
+ clear: () => store.clear(),
249
+ size: () => store.size,
250
+ wrap: async (key, fn, customTtl) => {
251
+ const cached = store.get(key);
252
+ if (cached && Date.now() <= cached.expires) return cached.value;
253
+ const value = await fn();
254
+ store.set(key, { value, expires: Date.now() + (customTtl ?? ttlMs) });
255
+ return value;
256
+ }
257
+ };
258
+ }
259
+
260
+ export function pipe(...fns) {
261
+ return async (input) => {
262
+ let result = input;
263
+ for (const fn of fns) result = await fn(result);
264
+ return result;
265
+ };
266
+ }
267
+
268
+ export function assert(condition, message = 'Assertion failed') {
269
+ if (!condition) throw new Error(`\x1b[31m✘ Assert: ${message}\x1b[0m`);
270
+ }
271
+
272
+ export function assertEqual(a, b, message) {
273
+ const pass = JSON.stringify(a) === JSON.stringify(b);
274
+ if (!pass) throw new Error(`\x1b[31m✘ Assert equal failed${message ? ': ' + message : ''}\n expected: ${JSON.stringify(b)}\n got: ${JSON.stringify(a)}\x1b[0m`);
275
+ }
276
+
277
+ export function assertThrows(fn, message) {
278
+ try { fn(); throw new Error(`\x1b[31m✘ Expected throw${message ? ': ' + message : ''}\x1b[0m`); }
279
+ catch(e) { if (e.message.startsWith('\x1b[31m✘ Expected')) throw e; }
280
+ }
281
+
282
+ export function injectGlobals() {
283
+ Object.assign(globalThis, {
284
+ print,log,err,warn,info,prompt,
285
+ readFile,writeFile,appendFile,fileExists,readDir,readJSON,writeJSON,mkdir,rm,
286
+ get,post,exec,run,spawn,env,args,exit,cwd,
287
+ now,time,sleep,bench,
288
+ range,rand,randInt,pick,shuffle,chunk,unique,flatten,sum,avg,min,max,clamp,
289
+ capitalize,truncate,pad,repeat,
290
+ keys,values,entries,merge,clone,
291
+ all,race,retry,
292
+ isString,isNumber,isBool,isArray,isObject,isNull,isDefined,
293
+ abs,ceil,floor,round,sqrt,pow,PI,E,log2,log10,sin,cos,tan,
294
+ serve,response,openDb,parse,cache,pipe,
295
+ assert,assertEqual,assertThrows,
296
+ });
297
+ }