mikrojs 0.0.0 → 0.0.7

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 (497) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +76 -0
  3. package/bin/mikrojs.js +3 -0
  4. package/dist/_exports/ble.d.ts +3 -0
  5. package/dist/_exports/ble.d.ts.map +1 -0
  6. package/dist/_exports/ble.js +2 -0
  7. package/dist/_exports/ble.js.map +1 -0
  8. package/dist/_exports/cbor.d.ts +3 -0
  9. package/dist/_exports/cbor.d.ts.map +1 -0
  10. package/dist/_exports/cbor.js +2 -0
  11. package/dist/_exports/cbor.js.map +1 -0
  12. package/dist/_exports/console.d.ts +2 -0
  13. package/dist/_exports/console.d.ts.map +1 -0
  14. package/dist/_exports/console.js +2 -0
  15. package/dist/_exports/console.js.map +1 -0
  16. package/dist/_exports/env.d.ts +2 -0
  17. package/dist/_exports/env.d.ts.map +1 -0
  18. package/dist/_exports/env.js +2 -0
  19. package/dist/_exports/env.js.map +1 -0
  20. package/dist/_exports/format.d.ts +2 -0
  21. package/dist/_exports/format.d.ts.map +1 -0
  22. package/dist/_exports/format.js +2 -0
  23. package/dist/_exports/format.js.map +1 -0
  24. package/dist/_exports/fs.d.ts +2 -0
  25. package/dist/_exports/fs.d.ts.map +1 -0
  26. package/dist/_exports/fs.js +2 -0
  27. package/dist/_exports/fs.js.map +1 -0
  28. package/dist/_exports/http/helpers.d.ts +3 -0
  29. package/dist/_exports/http/helpers.d.ts.map +1 -0
  30. package/dist/_exports/http/helpers.js +5 -0
  31. package/dist/_exports/http/helpers.js.map +1 -0
  32. package/dist/_exports/http/request.d.ts +4 -0
  33. package/dist/_exports/http/request.d.ts.map +1 -0
  34. package/dist/_exports/http/request.js +10 -0
  35. package/dist/_exports/http/request.js.map +1 -0
  36. package/dist/_exports/i2c.d.ts +2 -0
  37. package/dist/_exports/i2c.d.ts.map +1 -0
  38. package/dist/_exports/i2c.js +2 -0
  39. package/dist/_exports/i2c.js.map +1 -0
  40. package/dist/_exports/index.d.ts +61 -0
  41. package/dist/_exports/index.d.ts.map +1 -0
  42. package/dist/_exports/index.js +4 -0
  43. package/dist/_exports/index.js.map +1 -0
  44. package/dist/_exports/inspect.d.ts +2 -0
  45. package/dist/_exports/inspect.d.ts.map +1 -0
  46. package/dist/_exports/inspect.js +2 -0
  47. package/dist/_exports/inspect.js.map +1 -0
  48. package/dist/_exports/kv/nvs.d.ts +3 -0
  49. package/dist/_exports/kv/nvs.d.ts.map +1 -0
  50. package/dist/_exports/kv/nvs.js +2 -0
  51. package/dist/_exports/kv/nvs.js.map +1 -0
  52. package/dist/_exports/kv/rtc.d.ts +3 -0
  53. package/dist/_exports/kv/rtc.d.ts.map +1 -0
  54. package/dist/_exports/kv/rtc.js +2 -0
  55. package/dist/_exports/kv/rtc.js.map +1 -0
  56. package/dist/_exports/neopixel.d.ts +2 -0
  57. package/dist/_exports/neopixel.d.ts.map +1 -0
  58. package/dist/_exports/neopixel.js +2 -0
  59. package/dist/_exports/neopixel.js.map +1 -0
  60. package/dist/_exports/pin.d.ts +2 -0
  61. package/dist/_exports/pin.d.ts.map +1 -0
  62. package/dist/_exports/pin.js +2 -0
  63. package/dist/_exports/pin.js.map +1 -0
  64. package/dist/_exports/pwm.d.ts +2 -0
  65. package/dist/_exports/pwm.d.ts.map +1 -0
  66. package/dist/_exports/pwm.js +2 -0
  67. package/dist/_exports/pwm.js.map +1 -0
  68. package/dist/_exports/reader.d.ts +2 -0
  69. package/dist/_exports/reader.d.ts.map +1 -0
  70. package/dist/_exports/reader.js +2 -0
  71. package/dist/_exports/reader.js.map +1 -0
  72. package/dist/_exports/result.d.ts +2 -0
  73. package/dist/_exports/result.d.ts.map +1 -0
  74. package/dist/_exports/result.js +2 -0
  75. package/dist/_exports/result.js.map +1 -0
  76. package/dist/_exports/schema.d.ts +2 -0
  77. package/dist/_exports/schema.d.ts.map +1 -0
  78. package/dist/_exports/schema.js +2 -0
  79. package/dist/_exports/schema.js.map +1 -0
  80. package/dist/_exports/sim.d.ts +199 -0
  81. package/dist/_exports/sim.d.ts.map +1 -0
  82. package/dist/_exports/sim.js +8 -0
  83. package/dist/_exports/sim.js.map +1 -0
  84. package/dist/_exports/sleep.d.ts +2 -0
  85. package/dist/_exports/sleep.d.ts.map +1 -0
  86. package/dist/_exports/sleep.js +2 -0
  87. package/dist/_exports/sleep.js.map +1 -0
  88. package/dist/_exports/sntp.d.ts +3 -0
  89. package/dist/_exports/sntp.d.ts.map +1 -0
  90. package/dist/_exports/sntp.js +2 -0
  91. package/dist/_exports/sntp.js.map +1 -0
  92. package/dist/_exports/spi.d.ts +2 -0
  93. package/dist/_exports/spi.d.ts.map +1 -0
  94. package/dist/_exports/spi.js +2 -0
  95. package/dist/_exports/spi.js.map +1 -0
  96. package/dist/_exports/stdio.d.ts +2 -0
  97. package/dist/_exports/stdio.d.ts.map +1 -0
  98. package/dist/_exports/stdio.js +2 -0
  99. package/dist/_exports/stdio.js.map +1 -0
  100. package/dist/_exports/stream.d.ts +2 -0
  101. package/dist/_exports/stream.d.ts.map +1 -0
  102. package/dist/_exports/stream.js +2 -0
  103. package/dist/_exports/stream.js.map +1 -0
  104. package/dist/_exports/sys.d.ts +2 -0
  105. package/dist/_exports/sys.d.ts.map +1 -0
  106. package/dist/_exports/sys.js +2 -0
  107. package/dist/_exports/sys.js.map +1 -0
  108. package/dist/_exports/test.d.ts +2 -0
  109. package/dist/_exports/test.d.ts.map +1 -0
  110. package/dist/_exports/test.js +2 -0
  111. package/dist/_exports/test.js.map +1 -0
  112. package/dist/_exports/uart.d.ts +2 -0
  113. package/dist/_exports/uart.d.ts.map +1 -0
  114. package/dist/_exports/uart.js +2 -0
  115. package/dist/_exports/uart.js.map +1 -0
  116. package/dist/_exports/wifi.d.ts +3 -0
  117. package/dist/_exports/wifi.d.ts.map +1 -0
  118. package/dist/_exports/wifi.js +2 -0
  119. package/dist/_exports/wifi.js.map +1 -0
  120. package/dist/cli/cli.d.ts +3 -0
  121. package/dist/cli/cli.d.ts.map +1 -0
  122. package/dist/cli/cli.js +215 -0
  123. package/dist/cli/cli.js.map +1 -0
  124. package/dist/cli/cliWrapper.d.ts +3 -0
  125. package/dist/cli/cliWrapper.d.ts.map +1 -0
  126. package/dist/cli/cliWrapper.js +27 -0
  127. package/dist/cli/cliWrapper.js.map +1 -0
  128. package/dist/cli/commands/build-runtime.d.ts +14 -0
  129. package/dist/cli/commands/build-runtime.d.ts.map +1 -0
  130. package/dist/cli/commands/build-runtime.js +122 -0
  131. package/dist/cli/commands/build-runtime.js.map +1 -0
  132. package/dist/cli/commands/build.d.ts +31 -0
  133. package/dist/cli/commands/build.d.ts.map +1 -0
  134. package/dist/cli/commands/build.js +145 -0
  135. package/dist/cli/commands/build.js.map +1 -0
  136. package/dist/cli/commands/clean.d.ts +16 -0
  137. package/dist/cli/commands/clean.d.ts.map +1 -0
  138. package/dist/cli/commands/clean.js +148 -0
  139. package/dist/cli/commands/clean.js.map +1 -0
  140. package/dist/cli/commands/console.d.ts +19 -0
  141. package/dist/cli/commands/console.d.ts.map +1 -0
  142. package/dist/cli/commands/console.js +32 -0
  143. package/dist/cli/commands/console.js.map +1 -0
  144. package/dist/cli/commands/deploy.d.ts +63 -0
  145. package/dist/cli/commands/deploy.d.ts.map +1 -0
  146. package/dist/cli/commands/deploy.js +242 -0
  147. package/dist/cli/commands/deploy.js.map +1 -0
  148. package/dist/cli/commands/dev.d.ts +41 -0
  149. package/dist/cli/commands/dev.d.ts.map +1 -0
  150. package/dist/cli/commands/dev.js +170 -0
  151. package/dist/cli/commands/dev.js.map +1 -0
  152. package/dist/cli/commands/docs.d.ts +7 -0
  153. package/dist/cli/commands/docs.d.ts.map +1 -0
  154. package/dist/cli/commands/docs.js +20 -0
  155. package/dist/cli/commands/docs.js.map +1 -0
  156. package/dist/cli/commands/env.d.ts +59 -0
  157. package/dist/cli/commands/env.d.ts.map +1 -0
  158. package/dist/cli/commands/env.js +257 -0
  159. package/dist/cli/commands/env.js.map +1 -0
  160. package/dist/cli/commands/erase.d.ts +18 -0
  161. package/dist/cli/commands/erase.d.ts.map +1 -0
  162. package/dist/cli/commands/erase.js +90 -0
  163. package/dist/cli/commands/erase.js.map +1 -0
  164. package/dist/cli/commands/flash.d.ts +30 -0
  165. package/dist/cli/commands/flash.d.ts.map +1 -0
  166. package/dist/cli/commands/flash.js +243 -0
  167. package/dist/cli/commands/flash.js.map +1 -0
  168. package/dist/cli/commands/home.d.ts +7 -0
  169. package/dist/cli/commands/home.d.ts.map +1 -0
  170. package/dist/cli/commands/home.js +20 -0
  171. package/dist/cli/commands/home.js.map +1 -0
  172. package/dist/cli/commands/ls.d.ts +17 -0
  173. package/dist/cli/commands/ls.d.ts.map +1 -0
  174. package/dist/cli/commands/ls.js +62 -0
  175. package/dist/cli/commands/ls.js.map +1 -0
  176. package/dist/cli/commands/sim/clean.d.ts +7 -0
  177. package/dist/cli/commands/sim/clean.d.ts.map +1 -0
  178. package/dist/cli/commands/sim/clean.js +34 -0
  179. package/dist/cli/commands/sim/clean.js.map +1 -0
  180. package/dist/cli/commands/sim/deploy.d.ts +46 -0
  181. package/dist/cli/commands/sim/deploy.d.ts.map +1 -0
  182. package/dist/cli/commands/sim/deploy.js +127 -0
  183. package/dist/cli/commands/sim/deploy.js.map +1 -0
  184. package/dist/cli/commands/sim/dev.d.ts +40 -0
  185. package/dist/cli/commands/sim/dev.d.ts.map +1 -0
  186. package/dist/cli/commands/sim/dev.js +254 -0
  187. package/dist/cli/commands/sim/dev.js.map +1 -0
  188. package/dist/cli/commands/sim/env.d.ts +56 -0
  189. package/dist/cli/commands/sim/env.d.ts.map +1 -0
  190. package/dist/cli/commands/sim/env.js +204 -0
  191. package/dist/cli/commands/sim/env.js.map +1 -0
  192. package/dist/cli/commands/sim/profile.d.ts +67 -0
  193. package/dist/cli/commands/sim/profile.d.ts.map +1 -0
  194. package/dist/cli/commands/sim/profile.js +354 -0
  195. package/dist/cli/commands/sim/profile.js.map +1 -0
  196. package/dist/cli/commands/sim/repl.d.ts +16 -0
  197. package/dist/cli/commands/sim/repl.d.ts.map +1 -0
  198. package/dist/cli/commands/sim/repl.js +119 -0
  199. package/dist/cli/commands/sim/repl.js.map +1 -0
  200. package/dist/cli/commands/sim/reset.d.ts +11 -0
  201. package/dist/cli/commands/sim/reset.d.ts.map +1 -0
  202. package/dist/cli/commands/sim/reset.js +59 -0
  203. package/dist/cli/commands/sim/reset.js.map +1 -0
  204. package/dist/cli/commands/sim/scaffold.d.ts +11 -0
  205. package/dist/cli/commands/sim/scaffold.d.ts.map +1 -0
  206. package/dist/cli/commands/sim/scaffold.js +41 -0
  207. package/dist/cli/commands/sim/scaffold.js.map +1 -0
  208. package/dist/cli/commands/sim/test.d.ts +49 -0
  209. package/dist/cli/commands/sim/test.d.ts.map +1 -0
  210. package/dist/cli/commands/sim/test.js +364 -0
  211. package/dist/cli/commands/sim/test.js.map +1 -0
  212. package/dist/cli/commands/sim.d.ts +220 -0
  213. package/dist/cli/commands/sim.d.ts.map +1 -0
  214. package/dist/cli/commands/sim.js +69 -0
  215. package/dist/cli/commands/sim.js.map +1 -0
  216. package/dist/cli/commands/tail.d.ts +14 -0
  217. package/dist/cli/commands/tail.d.ts.map +1 -0
  218. package/dist/cli/commands/tail.js +50 -0
  219. package/dist/cli/commands/tail.js.map +1 -0
  220. package/dist/cli/commands/test.d.ts +39 -0
  221. package/dist/cli/commands/test.d.ts.map +1 -0
  222. package/dist/cli/commands/test.js +432 -0
  223. package/dist/cli/commands/test.js.map +1 -0
  224. package/dist/cli/components/DevicePicker.d.ts +9 -0
  225. package/dist/cli/components/DevicePicker.d.ts.map +1 -0
  226. package/dist/cli/components/DevicePicker.js +71 -0
  227. package/dist/cli/components/DevicePicker.js.map +1 -0
  228. package/dist/cli/components/EnvEditor.d.ts +12 -0
  229. package/dist/cli/components/EnvEditor.d.ts.map +1 -0
  230. package/dist/cli/components/EnvEditor.js +201 -0
  231. package/dist/cli/components/EnvEditor.js.map +1 -0
  232. package/dist/cli/components/TextInput.d.ts +28 -0
  233. package/dist/cli/components/TextInput.d.ts.map +1 -0
  234. package/dist/cli/components/TextInput.js +73 -0
  235. package/dist/cli/components/TextInput.js.map +1 -0
  236. package/dist/cli/components/TitledBox.d.ts +27 -0
  237. package/dist/cli/components/TitledBox.d.ts.map +1 -0
  238. package/dist/cli/components/TitledBox.js +111 -0
  239. package/dist/cli/components/TitledBox.js.map +1 -0
  240. package/dist/cli/hooks/useDevices.d.ts +23 -0
  241. package/dist/cli/hooks/useDevices.d.ts.map +1 -0
  242. package/dist/cli/hooks/useDevices.js +19 -0
  243. package/dist/cli/hooks/useDevices.js.map +1 -0
  244. package/dist/cli/lib/RenderAndExit.d.ts +6 -0
  245. package/dist/cli/lib/RenderAndExit.d.ts.map +1 -0
  246. package/dist/cli/lib/RenderAndExit.js +8 -0
  247. package/dist/cli/lib/RenderAndExit.js.map +1 -0
  248. package/dist/cli/lib/Spinner.d.ts +11 -0
  249. package/dist/cli/lib/Spinner.d.ts.map +1 -0
  250. package/dist/cli/lib/Spinner.js +22 -0
  251. package/dist/cli/lib/Spinner.js.map +1 -0
  252. package/dist/cli/lib/agent.d.ts +38 -0
  253. package/dist/cli/lib/agent.d.ts.map +1 -0
  254. package/dist/cli/lib/agent.js +87 -0
  255. package/dist/cli/lib/agent.js.map +1 -0
  256. package/dist/cli/lib/boards.d.ts +23 -0
  257. package/dist/cli/lib/boards.d.ts.map +1 -0
  258. package/dist/cli/lib/boards.js +67 -0
  259. package/dist/cli/lib/boards.js.map +1 -0
  260. package/dist/cli/lib/build.d.ts +47 -0
  261. package/dist/cli/lib/build.d.ts.map +1 -0
  262. package/dist/cli/lib/build.js +533 -0
  263. package/dist/cli/lib/build.js.map +1 -0
  264. package/dist/cli/lib/connectSim.d.ts +21 -0
  265. package/dist/cli/lib/connectSim.d.ts.map +1 -0
  266. package/dist/cli/lib/connectSim.js +20 -0
  267. package/dist/cli/lib/connectSim.js.map +1 -0
  268. package/dist/cli/lib/deploy.d.ts +42 -0
  269. package/dist/cli/lib/deploy.d.ts.map +1 -0
  270. package/dist/cli/lib/deploy.js +121 -0
  271. package/dist/cli/lib/deploy.js.map +1 -0
  272. package/dist/cli/lib/deployProgress.d.ts +8 -0
  273. package/dist/cli/lib/deployProgress.d.ts.map +1 -0
  274. package/dist/cli/lib/deployProgress.js +32 -0
  275. package/dist/cli/lib/deployProgress.js.map +1 -0
  276. package/dist/cli/lib/dotenv.d.ts +16 -0
  277. package/dist/cli/lib/dotenv.d.ts.map +1 -0
  278. package/dist/cli/lib/dotenv.js +33 -0
  279. package/dist/cli/lib/dotenv.js.map +1 -0
  280. package/dist/cli/lib/esbuild.d.ts +7 -0
  281. package/dist/cli/lib/esbuild.d.ts.map +1 -0
  282. package/dist/cli/lib/esbuild.js +15 -0
  283. package/dist/cli/lib/esbuild.js.map +1 -0
  284. package/dist/cli/lib/esptool.d.ts +41 -0
  285. package/dist/cli/lib/esptool.d.ts.map +1 -0
  286. package/dist/cli/lib/esptool.js +43 -0
  287. package/dist/cli/lib/esptool.js.map +1 -0
  288. package/dist/cli/lib/firmware.d.ts +24 -0
  289. package/dist/cli/lib/firmware.d.ts.map +1 -0
  290. package/dist/cli/lib/firmware.js +379 -0
  291. package/dist/cli/lib/firmware.js.map +1 -0
  292. package/dist/cli/lib/firmwareCompat.d.ts +19 -0
  293. package/dist/cli/lib/firmwareCompat.d.ts.map +1 -0
  294. package/dist/cli/lib/firmwareCompat.js +31 -0
  295. package/dist/cli/lib/firmwareCompat.js.map +1 -0
  296. package/dist/cli/lib/heapBaseline.d.ts +15 -0
  297. package/dist/cli/lib/heapBaseline.d.ts.map +1 -0
  298. package/dist/cli/lib/heapBaseline.js +39 -0
  299. package/dist/cli/lib/heapBaseline.js.map +1 -0
  300. package/dist/cli/lib/ink-table/index.d.ts +88 -0
  301. package/dist/cli/lib/ink-table/index.d.ts.map +1 -0
  302. package/dist/cli/lib/ink-table/index.js +217 -0
  303. package/dist/cli/lib/ink-table/index.js.map +1 -0
  304. package/dist/cli/lib/loadMikroConfig.d.ts +7 -0
  305. package/dist/cli/lib/loadMikroConfig.d.ts.map +1 -0
  306. package/dist/cli/lib/loadMikroConfig.js +26 -0
  307. package/dist/cli/lib/loadMikroConfig.js.map +1 -0
  308. package/dist/cli/lib/minify.d.ts +3 -0
  309. package/dist/cli/lib/minify.d.ts.map +1 -0
  310. package/dist/cli/lib/minify.js +89 -0
  311. package/dist/cli/lib/minify.js.map +1 -0
  312. package/dist/cli/lib/openSim.d.ts +29 -0
  313. package/dist/cli/lib/openSim.d.ts.map +1 -0
  314. package/dist/cli/lib/openSim.js +32 -0
  315. package/dist/cli/lib/openSim.js.map +1 -0
  316. package/dist/cli/lib/ospawn.d.ts +34 -0
  317. package/dist/cli/lib/ospawn.d.ts.map +1 -0
  318. package/dist/cli/lib/ospawn.js +90 -0
  319. package/dist/cli/lib/ospawn.js.map +1 -0
  320. package/dist/cli/lib/parseMinifier.d.ts +10 -0
  321. package/dist/cli/lib/parseMinifier.d.ts.map +1 -0
  322. package/dist/cli/lib/parseMinifier.js +49 -0
  323. package/dist/cli/lib/parseMinifier.js.map +1 -0
  324. package/dist/cli/lib/parseSize.d.ts +6 -0
  325. package/dist/cli/lib/parseSize.d.ts.map +1 -0
  326. package/dist/cli/lib/parseSize.js +25 -0
  327. package/dist/cli/lib/parseSize.js.map +1 -0
  328. package/dist/cli/lib/projectRoot.d.ts +11 -0
  329. package/dist/cli/lib/projectRoot.d.ts.map +1 -0
  330. package/dist/cli/lib/projectRoot.js +28 -0
  331. package/dist/cli/lib/projectRoot.js.map +1 -0
  332. package/dist/cli/lib/protocol.d.ts +144 -0
  333. package/dist/cli/lib/protocol.d.ts.map +1 -0
  334. package/dist/cli/lib/protocol.js +385 -0
  335. package/dist/cli/lib/protocol.js.map +1 -0
  336. package/dist/cli/lib/recover.d.ts +25 -0
  337. package/dist/cli/lib/recover.d.ts.map +1 -0
  338. package/dist/cli/lib/recover.js +144 -0
  339. package/dist/cli/lib/recover.js.map +1 -0
  340. package/dist/cli/lib/resolveEntry.d.ts +7 -0
  341. package/dist/cli/lib/resolveEntry.d.ts.map +1 -0
  342. package/dist/cli/lib/resolveEntry.js +30 -0
  343. package/dist/cli/lib/resolveEntry.js.map +1 -0
  344. package/dist/cli/lib/runHooks.d.ts +34 -0
  345. package/dist/cli/lib/runHooks.d.ts.map +1 -0
  346. package/dist/cli/lib/runHooks.js +90 -0
  347. package/dist/cli/lib/runHooks.js.map +1 -0
  348. package/dist/cli/lib/serial/InkReplConsole.d.ts +27 -0
  349. package/dist/cli/lib/serial/InkReplConsole.d.ts.map +1 -0
  350. package/dist/cli/lib/serial/InkReplConsole.js +24 -0
  351. package/dist/cli/lib/serial/InkReplConsole.js.map +1 -0
  352. package/dist/cli/lib/serial/InkReplMode.d.ts +38 -0
  353. package/dist/cli/lib/serial/InkReplMode.d.ts.map +1 -0
  354. package/dist/cli/lib/serial/InkReplMode.js +90 -0
  355. package/dist/cli/lib/serial/InkReplMode.js.map +1 -0
  356. package/dist/cli/lib/serial/ReplConsole.d.ts +21 -0
  357. package/dist/cli/lib/serial/ReplConsole.d.ts.map +1 -0
  358. package/dist/cli/lib/serial/ReplConsole.js +249 -0
  359. package/dist/cli/lib/serial/ReplConsole.js.map +1 -0
  360. package/dist/cli/lib/serial/devSession.d.ts +53 -0
  361. package/dist/cli/lib/serial/devSession.d.ts.map +1 -0
  362. package/dist/cli/lib/serial/devSession.js +160 -0
  363. package/dist/cli/lib/serial/devSession.js.map +1 -0
  364. package/dist/cli/lib/serial/dispatchReplCommand.d.ts +25 -0
  365. package/dist/cli/lib/serial/dispatchReplCommand.d.ts.map +1 -0
  366. package/dist/cli/lib/serial/dispatchReplCommand.js +27 -0
  367. package/dist/cli/lib/serial/dispatchReplCommand.js.map +1 -0
  368. package/dist/cli/lib/serial/openSession.d.ts +28 -0
  369. package/dist/cli/lib/serial/openSession.d.ts.map +1 -0
  370. package/dist/cli/lib/serial/openSession.js +48 -0
  371. package/dist/cli/lib/serial/openSession.js.map +1 -0
  372. package/dist/cli/lib/serial/replStateMachine.d.ts +169 -0
  373. package/dist/cli/lib/serial/replStateMachine.d.ts.map +1 -0
  374. package/dist/cli/lib/serial/replStateMachine.js +650 -0
  375. package/dist/cli/lib/serial/replStateMachine.js.map +1 -0
  376. package/dist/cli/lib/serial/runAgentRepl.d.ts +33 -0
  377. package/dist/cli/lib/serial/runAgentRepl.d.ts.map +1 -0
  378. package/dist/cli/lib/serial/runAgentRepl.js +80 -0
  379. package/dist/cli/lib/serial/runAgentRepl.js.map +1 -0
  380. package/dist/cli/lib/session.d.ts +163 -0
  381. package/dist/cli/lib/session.d.ts.map +1 -0
  382. package/dist/cli/lib/session.js +490 -0
  383. package/dist/cli/lib/session.js.map +1 -0
  384. package/dist/cli/lib/simConfig.d.ts +15 -0
  385. package/dist/cli/lib/simConfig.d.ts.map +1 -0
  386. package/dist/cli/lib/simConfig.js +25 -0
  387. package/dist/cli/lib/simConfig.js.map +1 -0
  388. package/dist/cli/lib/simPid.d.ts +30 -0
  389. package/dist/cli/lib/simPid.d.ts.map +1 -0
  390. package/dist/cli/lib/simPid.js +112 -0
  391. package/dist/cli/lib/simPid.js.map +1 -0
  392. package/dist/cli/lib/simTransport.d.ts +17 -0
  393. package/dist/cli/lib/simTransport.d.ts.map +1 -0
  394. package/dist/cli/lib/simTransport.js +80 -0
  395. package/dist/cli/lib/simTransport.js.map +1 -0
  396. package/dist/cli/lib/testRunner.d.ts +86 -0
  397. package/dist/cli/lib/testRunner.d.ts.map +1 -0
  398. package/dist/cli/lib/testRunner.js +469 -0
  399. package/dist/cli/lib/testRunner.js.map +1 -0
  400. package/dist/cli/lib/transport.d.ts +34 -0
  401. package/dist/cli/lib/transport.d.ts.map +1 -0
  402. package/dist/cli/lib/transport.js +117 -0
  403. package/dist/cli/lib/transport.js.map +1 -0
  404. package/dist/cli/lib/useObservable.d.ts +4 -0
  405. package/dist/cli/lib/useObservable.d.ts.map +1 -0
  406. package/dist/cli/lib/useObservable.js +22 -0
  407. package/dist/cli/lib/useObservable.js.map +1 -0
  408. package/dist/cli/lib/watcher.d.ts +10 -0
  409. package/dist/cli/lib/watcher.d.ts.map +1 -0
  410. package/dist/cli/lib/watcher.js +34 -0
  411. package/dist/cli/lib/watcher.js.map +1 -0
  412. package/dist/constants.d.ts +13 -0
  413. package/dist/constants.d.ts.map +1 -0
  414. package/dist/constants.js +27 -0
  415. package/dist/constants.js.map +1 -0
  416. package/dist/simulator/builtins/ble.d.ts +3 -0
  417. package/dist/simulator/builtins/ble.d.ts.map +1 -0
  418. package/dist/simulator/builtins/ble.js +45 -0
  419. package/dist/simulator/builtins/ble.js.map +1 -0
  420. package/dist/simulator/builtins/console.d.ts +8 -0
  421. package/dist/simulator/builtins/console.d.ts.map +1 -0
  422. package/dist/simulator/builtins/console.js +24 -0
  423. package/dist/simulator/builtins/console.js.map +1 -0
  424. package/dist/simulator/builtins/http.d.ts +3 -0
  425. package/dist/simulator/builtins/http.d.ts.map +1 -0
  426. package/dist/simulator/builtins/http.js +32 -0
  427. package/dist/simulator/builtins/http.js.map +1 -0
  428. package/dist/simulator/builtins/i2c.d.ts +3 -0
  429. package/dist/simulator/builtins/i2c.d.ts.map +1 -0
  430. package/dist/simulator/builtins/i2c.js +16 -0
  431. package/dist/simulator/builtins/i2c.js.map +1 -0
  432. package/dist/simulator/builtins/index.d.ts +7 -0
  433. package/dist/simulator/builtins/index.d.ts.map +1 -0
  434. package/dist/simulator/builtins/index.js +49 -0
  435. package/dist/simulator/builtins/index.js.map +1 -0
  436. package/dist/simulator/builtins/kv.d.ts +3 -0
  437. package/dist/simulator/builtins/kv.d.ts.map +1 -0
  438. package/dist/simulator/builtins/kv.js +38 -0
  439. package/dist/simulator/builtins/kv.js.map +1 -0
  440. package/dist/simulator/builtins/neopixel.d.ts +3 -0
  441. package/dist/simulator/builtins/neopixel.d.ts.map +1 -0
  442. package/dist/simulator/builtins/neopixel.js +13 -0
  443. package/dist/simulator/builtins/neopixel.js.map +1 -0
  444. package/dist/simulator/builtins/nvs-kv.d.ts +3 -0
  445. package/dist/simulator/builtins/nvs-kv.d.ts.map +1 -0
  446. package/dist/simulator/builtins/nvs-kv.js +34 -0
  447. package/dist/simulator/builtins/nvs-kv.js.map +1 -0
  448. package/dist/simulator/builtins/pin.d.ts +3 -0
  449. package/dist/simulator/builtins/pin.d.ts.map +1 -0
  450. package/dist/simulator/builtins/pin.js +31 -0
  451. package/dist/simulator/builtins/pin.js.map +1 -0
  452. package/dist/simulator/builtins/pwm.d.ts +3 -0
  453. package/dist/simulator/builtins/pwm.d.ts.map +1 -0
  454. package/dist/simulator/builtins/pwm.js +29 -0
  455. package/dist/simulator/builtins/pwm.js.map +1 -0
  456. package/dist/simulator/builtins/sleep.d.ts +3 -0
  457. package/dist/simulator/builtins/sleep.d.ts.map +1 -0
  458. package/dist/simulator/builtins/sleep.js +32 -0
  459. package/dist/simulator/builtins/sleep.js.map +1 -0
  460. package/dist/simulator/builtins/sntp.d.ts +3 -0
  461. package/dist/simulator/builtins/sntp.d.ts.map +1 -0
  462. package/dist/simulator/builtins/sntp.js +12 -0
  463. package/dist/simulator/builtins/sntp.js.map +1 -0
  464. package/dist/simulator/builtins/spi.d.ts +3 -0
  465. package/dist/simulator/builtins/spi.d.ts.map +1 -0
  466. package/dist/simulator/builtins/spi.js +15 -0
  467. package/dist/simulator/builtins/spi.js.map +1 -0
  468. package/dist/simulator/builtins/types.d.ts +24 -0
  469. package/dist/simulator/builtins/types.d.ts.map +1 -0
  470. package/dist/simulator/builtins/types.js +2 -0
  471. package/dist/simulator/builtins/types.js.map +1 -0
  472. package/dist/simulator/builtins/uart.d.ts +3 -0
  473. package/dist/simulator/builtins/uart.d.ts.map +1 -0
  474. package/dist/simulator/builtins/uart.js +20 -0
  475. package/dist/simulator/builtins/uart.js.map +1 -0
  476. package/dist/simulator/builtins/wifi.d.ts +3 -0
  477. package/dist/simulator/builtins/wifi.d.ts.map +1 -0
  478. package/dist/simulator/builtins/wifi.js +54 -0
  479. package/dist/simulator/builtins/wifi.js.map +1 -0
  480. package/dist/simulator/devRunner.d.ts +41 -0
  481. package/dist/simulator/devRunner.d.ts.map +1 -0
  482. package/dist/simulator/devRunner.js +140 -0
  483. package/dist/simulator/devRunner.js.map +1 -0
  484. package/dist/simulator/loadSimStubs.d.ts +15 -0
  485. package/dist/simulator/loadSimStubs.d.ts.map +1 -0
  486. package/dist/simulator/loadSimStubs.js +54 -0
  487. package/dist/simulator/loadSimStubs.js.map +1 -0
  488. package/dist/simulator/simProcess.d.ts +11 -0
  489. package/dist/simulator/simProcess.d.ts.map +1 -0
  490. package/dist/simulator/simProcess.js +963 -0
  491. package/dist/simulator/simProcess.js.map +1 -0
  492. package/dist/simulator/simTemplates.d.ts +6 -0
  493. package/dist/simulator/simTemplates.d.ts.map +1 -0
  494. package/dist/simulator/simTemplates.js +21 -0
  495. package/dist/simulator/simTemplates.js.map +1 -0
  496. package/package.json +123 -2
  497. package/runtime.d.ts +95 -0
@@ -0,0 +1,32 @@
1
+ // sleep uses a raw source module so deepSleep can use setTimeout + restart,
2
+ // and lightSleep can return a delayed Promise.
3
+ export const sleepBuiltin = {
4
+ source: `
5
+ import {restart} from 'native:sys'
6
+
7
+ const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms))
8
+
9
+ let wakeupCause = 'undefined'
10
+
11
+ export function deepSleep(ms) {
12
+ // On device, deepSleep is \`never\` (chip resets after sleep).
13
+ // In the sim, wait the duration then restart the runtime.
14
+ console.warn('[sim] deepSleep(' + ms + 'ms)')
15
+ sleep(ms).then(() => restart())
16
+ }
17
+
18
+ export function lightSleep(ms) {
19
+ console.warn('[sim] lightSleep(' + ms + 'ms)')
20
+ // Block-ish: return a result after the delay
21
+ return {ok: true}
22
+ }
23
+
24
+ export function getWakeupCause() { return wakeupCause }
25
+ export function enableTimerWakeup() { return {ok: true} }
26
+ export function enableGpioWakeup() { return {ok: true} }
27
+ export function enableExt0Wakeup() { return {ok: true} }
28
+ export function enableExt1Wakeup() { return {ok: true} }
29
+ export function disableWakeupSource() { return {ok: true} }
30
+ `,
31
+ };
32
+ //# sourceMappingURL=sleep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sleep.js","sourceRoot":"","sources":["../../../src/simulator/builtins/sleep.ts"],"names":[],"mappings":"AAEA,4EAA4E;AAC5E,+CAA+C;AAC/C,MAAM,CAAC,MAAM,YAAY,GAAsB;IAC7C,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BT;CACA,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { BuiltinDefinition } from './types.js';
2
+ export declare const sntpBuiltin: BuiltinDefinition;
3
+ //# sourceMappingURL=sntp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sntp.d.ts","sourceRoot":"","sources":["../../../src/simulator/builtins/sntp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,YAAY,CAAA;AAIjD,eAAO,MAAM,WAAW,EAAE,iBAQzB,CAAA"}
@@ -0,0 +1,12 @@
1
+ // sntp uses a raw source module instead of RPC because the native sync()
2
+ // returns {ok, value: Promise<...>} which can't survive JSON serialization.
3
+ export const sntpBuiltin = {
4
+ source: `
5
+ export function sync(_servers, _timezone, _background) {
6
+ return {ok: true, value: Promise.resolve({ok: true, value: {time: Date.now()}})}
7
+ }
8
+ export function stop() {}
9
+ export function setTimezone(_tz) {}
10
+ `,
11
+ };
12
+ //# sourceMappingURL=sntp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sntp.js","sourceRoot":"","sources":["../../../src/simulator/builtins/sntp.ts"],"names":[],"mappings":"AAEA,yEAAyE;AACzE,4EAA4E;AAC5E,MAAM,CAAC,MAAM,WAAW,GAAsB;IAC5C,MAAM,EAAE;;;;;;CAMT;CACA,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { BuiltinDefinition } from './types.js';
2
+ export declare const spiBuiltin: BuiltinDefinition;
3
+ //# sourceMappingURL=spi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spi.d.ts","sourceRoot":"","sources":["../../../src/simulator/builtins/spi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,UAAU,EAAE,iBAaxB,CAAA"}
@@ -0,0 +1,15 @@
1
+ export const spiBuiltin = {
2
+ source: `// Simulator stub for spi
3
+ // Runs inside the mikrojs runtime (QuickJS), not Node.js. Node built-ins are not available.
4
+ import type {SimSpi} from 'mikrojs/sim'
5
+
6
+ export class Spi implements SimSpi {
7
+ constructor(_hostNo: number, _options: Record<string, unknown>) {}
8
+ begin() { return {ok: true as const} }
9
+ end() { return {ok: true as const} }
10
+ transfer(data: Uint8Array) { return {ok: true as const, value: new Uint8Array(data.length)} }
11
+ write(_data: Uint8Array) { return {ok: true as const} }
12
+ }
13
+ `,
14
+ };
15
+ //# sourceMappingURL=spi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spi.js","sourceRoot":"","sources":["../../../src/simulator/builtins/spi.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAsB;IAC3C,MAAM,EAAE;;;;;;;;;;;CAWT;CACA,CAAA"}
@@ -0,0 +1,24 @@
1
+ /** Map of builtin name to its native:* module name */
2
+ export type BuiltinModuleMap = {
3
+ ble: 'native:ble';
4
+ pin: 'native:pin';
5
+ pwm: 'native:pwm';
6
+ neopixel: 'native:neopixel';
7
+ wifi: 'native:wifi';
8
+ i2c: 'native:i2c';
9
+ spi: 'native:spi';
10
+ uart: 'native:uart';
11
+ kv: 'native:rtc';
12
+ nvs_kv: 'native:nvs_kv';
13
+ sleep: 'native:sleep';
14
+ http: 'native:http';
15
+ sntp: 'native:sntp';
16
+ console: 'native:console';
17
+ };
18
+ export type BuiltinName = keyof BuiltinModuleMap;
19
+ /** A builtin definition: JS source that replaces the native C module in the simulator */
20
+ export interface BuiltinDefinition {
21
+ /** Raw module source string that runs inside QuickJS */
22
+ source: string;
23
+ }
24
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/simulator/builtins/types.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,YAAY,CAAA;IACjB,GAAG,EAAE,YAAY,CAAA;IACjB,GAAG,EAAE,YAAY,CAAA;IACjB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,IAAI,EAAE,aAAa,CAAA;IACnB,GAAG,EAAE,YAAY,CAAA;IACjB,GAAG,EAAE,YAAY,CAAA;IACjB,IAAI,EAAE,aAAa,CAAA;IACnB,EAAE,EAAE,YAAY,CAAA;IAChB,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,cAAc,CAAA;IACrB,IAAI,EAAE,aAAa,CAAA;IACnB,IAAI,EAAE,aAAa,CAAA;IACnB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,gBAAgB,CAAA;AAEhD,yFAAyF;AACzF,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAA;CACf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/simulator/builtins/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import type { BuiltinDefinition } from './types.js';
2
+ export declare const uartBuiltin: BuiltinDefinition;
3
+ //# sourceMappingURL=uart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uart.d.ts","sourceRoot":"","sources":["../../../src/simulator/builtins/uart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,WAAW,EAAE,iBAkBzB,CAAA"}
@@ -0,0 +1,20 @@
1
+ export const uartBuiltin = {
2
+ source: `
3
+ export class Uart {
4
+ constructor(_port, _options) {}
5
+ begin() { return {ok: true} }
6
+ end() { return {ok: true} }
7
+ write(_data) { return {ok: true} }
8
+ read() {
9
+ // Return an async iterable that never yields (no real UART in sim)
10
+ const iter = {
11
+ next() { return new Promise(() => {}) },
12
+ return() { return Promise.resolve({done: true, value: undefined}) },
13
+ [Symbol.asyncIterator]() { return iter },
14
+ }
15
+ return {ok: true, value: iter}
16
+ }
17
+ }
18
+ `,
19
+ };
20
+ //# sourceMappingURL=uart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uart.js","sourceRoot":"","sources":["../../../src/simulator/builtins/uart.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAsB;IAC5C,MAAM,EAAE;;;;;;;;;;;;;;;;CAgBT;CACA,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { BuiltinDefinition } from './types.js';
2
+ export declare const wifiBuiltin: BuiltinDefinition;
3
+ //# sourceMappingURL=wifi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wifi.d.ts","sourceRoot":"","sources":["../../../src/simulator/builtins/wifi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,YAAY,CAAA;AAIjD,eAAO,MAAM,WAAW,EAAE,iBAkDzB,CAAA"}
@@ -0,0 +1,54 @@
1
+ // wifi uses a raw source module instead of RPC because connect() and scan()
2
+ // return {ok, value: Promise<...>} which can't survive JSON serialization.
3
+ export const wifiBuiltin = {
4
+ source: `/* eslint-disable no-console */
5
+ // Simulator stub for wifi
6
+ // Runs inside the mikrojs runtime (QuickJS), not Node.js. Node built-ins are not available.
7
+ import type {SimWifi} from 'mikrojs/sim'
8
+
9
+ let connected = false
10
+ let currentIp = '0.0.0.0'
11
+
12
+ export class Wifi implements SimWifi {
13
+ connect(ssid: string, _passphrase: string) {
14
+ console.log('[sim] wifi.connect:', ssid)
15
+ connected = true
16
+ currentIp = '192.168.1.100'
17
+ const info = {ip: currentIp, netmask: '255.255.255.0', gateway: '192.168.1.1'}
18
+ return {ok: true as const, value: Promise.resolve({ok: true as const, value: info})}
19
+ }
20
+ disconnect() { return {ok: true as const} }
21
+ rssi() { return {ok: true as const, value: -50} }
22
+ ip() { return currentIp }
23
+ status() { return connected ? 3 : 6 }
24
+ scan() { return {ok: true as const, value: Promise.resolve({ok: true as const, value: [] as never[]})} }
25
+ on() {}
26
+ off() {}
27
+ mac() { return {ok: true as const, value: '00:00:00:00:00:00'} }
28
+ getHostname() { return 'mikrojs-sim' as string | undefined }
29
+ setHostname() { return {ok: true as const} }
30
+ getIpConfig() {
31
+ if (!connected) return {ok: true as const, value: undefined}
32
+ return {ok: true as const, value: {ip: currentIp, netmask: '255.255.255.0', gateway: '192.168.1.1', dns: '8.8.8.8'}}
33
+ }
34
+ setIpConfig() { return {ok: true as const} }
35
+ apStart() { return {ok: true as const} }
36
+ apStop() { return {ok: true as const} }
37
+ apIsActive() { return false }
38
+ apIp() { return undefined }
39
+ apStations() { return [] as {mac: string; rssi: number}[] }
40
+ apDeauthStation() { return {ok: true as const} }
41
+ apGetInactiveTimeout() { return {ok: true as const, value: 300} }
42
+ apSetInactiveTimeout() { return {ok: true as const} }
43
+ getTxPower() { return {ok: true as const, value: 20} }
44
+ setTxPower() { return {ok: true as const} }
45
+ getRssiThreshold() { return -127 }
46
+ setRssiThreshold() { return {ok: true as const} }
47
+ getPowerSave() { return 'NONE' }
48
+ setPowerSave() { return {ok: true as const} }
49
+ getCountry() { return undefined }
50
+ setCountry() { return {ok: true as const} }
51
+ }
52
+ `,
53
+ };
54
+ //# sourceMappingURL=wifi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wifi.js","sourceRoot":"","sources":["../../../src/simulator/builtins/wifi.ts"],"names":[],"mappings":"AAEA,4EAA4E;AAC5E,2EAA2E;AAC3E,MAAM,CAAC,MAAM,WAAW,GAAsB;IAC5C,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDT;CACA,CAAA"}
@@ -0,0 +1,41 @@
1
+ import { type HostMessage, MikroRuntime } from '@mikrojs/native';
2
+ import { Subject } from 'rxjs';
3
+ export interface DevRunnerOptions {
4
+ script: string;
5
+ memLimit?: number;
6
+ fsRoot?: string;
7
+ fsLimit?: number;
8
+ fsReadMax?: number;
9
+ env?: Record<string, string>;
10
+ /**
11
+ * User-provided stub sources keyed by module name (e.g. 'native:wifi').
12
+ * These override the default stubs. TypeScript is stripped before registration.
13
+ */
14
+ stubSources?: Record<string, string>;
15
+ /**
16
+ * Enable per-module memory profiling. Profile data is collected as modules
17
+ * are loaded and can be read via runtime.getProfile() after execution.
18
+ */
19
+ profile?: boolean;
20
+ }
21
+ export interface DevRunner {
22
+ /** Observable stream of host messages from the QuickJS runtime. */
23
+ messages$: Subject<HostMessage>;
24
+ /** Post a message into the QuickJS runtime (delivered on next loop tick). */
25
+ postMessage(type: string, data: string): void;
26
+ /** Start the event loop. Returns a cleanup function. */
27
+ start(): () => void;
28
+ /** Register a callback that runs on each tick, after loopOnce + drainMessages. */
29
+ onTick(callback: () => void): void;
30
+ /** When true, skips loopOnce (timers/promises freeze) but tick callbacks still run. */
31
+ paused: boolean;
32
+ /** The underlying MikroRuntime instance. */
33
+ runtime: MikroRuntime;
34
+ }
35
+ /**
36
+ * Create a QuickJS dev runner for the simulator.
37
+ * Default stubs provide mock implementations for all native modules.
38
+ * User stubs (from sim/*.stub.ts) override defaults.
39
+ */
40
+ export declare function createDevRunner(options: DevRunnerOptions): DevRunner;
41
+ //# sourceMappingURL=devRunner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devRunner.d.ts","sourceRoot":"","sources":["../../src/simulator/devRunner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,WAAW,EAAE,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAC9D,OAAO,EAAC,OAAO,EAAC,MAAM,MAAM,CAAA;AAS5B,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,mEAAmE;IACnE,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;IAC/B,6EAA6E;IAC7E,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7C,wDAAwD;IACxD,KAAK,IAAI,MAAM,IAAI,CAAA;IACnB,kFAAkF;IAClF,MAAM,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAA;IAClC,uFAAuF;IACvF,MAAM,EAAE,OAAO,CAAA;IACf,4CAA4C;IAC5C,OAAO,EAAE,YAAY,CAAA;CACtB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,CA4IpE"}
@@ -0,0 +1,140 @@
1
+ import nodeFs from 'node:fs';
2
+ import { stripTypeScriptTypes } from 'node:module';
3
+ import * as pathlib from 'node:path';
4
+ import { MikroRuntime } from '@mikrojs/native';
5
+ import { Subject } from 'rxjs';
6
+ import { builtinModuleNames, defaultBuiltins } from './builtins/index.js';
7
+ const DEFAULT_MEM_LIMIT = 300 * 1024; // 300 KB
8
+ const DEFAULT_FS_ROOT = '.mikro/sim-fs';
9
+ const DEFAULT_FS_LIMIT = 1024 * 1024; // 1 MB
10
+ /**
11
+ * Create a QuickJS dev runner for the simulator.
12
+ * Default stubs provide mock implementations for all native modules.
13
+ * User stubs (from sim/*.stub.ts) override defaults.
14
+ */
15
+ export function createDevRunner(options) {
16
+ const { script, env, memLimit = DEFAULT_MEM_LIMIT, fsLimit = DEFAULT_FS_LIMIT, fsReadMax } = options;
17
+ const fsRoot = pathlib.resolve(options.fsRoot ?? DEFAULT_FS_ROOT);
18
+ nodeFs.mkdirSync(fsRoot, { recursive: true });
19
+ // Resolve the entry script to a logical path rooted at fsRoot (e.g.
20
+ // /app/http/foo.test.bjs). Passing a logical path — rather than an
21
+ // absolute host path — lets bytecode's baked module names (also logical,
22
+ // e.g. /app/http/foo.test.js) line up with the runtime module resolver, so
23
+ // cross-file imports inside bytecode modules resolve against fsRoot via
24
+ // fs_base_path (set below).
25
+ let logicalScript;
26
+ if (pathlib.isAbsolute(script)) {
27
+ // Subprocess mode: script is already inside fsRoot.
28
+ const rel = pathlib.relative(fsRoot, script);
29
+ if (rel.startsWith('..') || pathlib.isAbsolute(rel)) {
30
+ throw new Error(`Script ${script} is not inside fsRoot ${fsRoot}; cannot compute logical path.`);
31
+ }
32
+ logicalScript = '/' + rel.split(pathlib.sep).join('/');
33
+ }
34
+ else {
35
+ // In-process dev mode: symlink the script's top-level directory into
36
+ // fsRoot so the runtime can read it via the fs_base_path prefix.
37
+ const topDir = script.split(pathlib.sep)[0];
38
+ if (topDir) {
39
+ const appDir = pathlib.resolve(topDir);
40
+ const appLink = pathlib.join(fsRoot, topDir);
41
+ try {
42
+ const existing = nodeFs.readlinkSync(appLink);
43
+ if (existing !== appDir) {
44
+ nodeFs.unlinkSync(appLink);
45
+ nodeFs.symlinkSync(appDir, appLink);
46
+ }
47
+ }
48
+ catch {
49
+ nodeFs.rmSync(appLink, { force: true, recursive: true });
50
+ nodeFs.symlinkSync(appDir, appLink);
51
+ }
52
+ }
53
+ logicalScript = '/' + script.split(pathlib.sep).join('/');
54
+ }
55
+ // Register virtual modules: default stubs, then user overrides
56
+ const modules = {};
57
+ for (const [name, builtin] of Object.entries(defaultBuiltins)) {
58
+ const moduleName = builtinModuleNames[name];
59
+ if (!moduleName)
60
+ continue;
61
+ modules[moduleName] = stripTypeScriptTypes(builtin.source, { mode: 'strip' });
62
+ }
63
+ // User stub sources override defaults (already stripped by loadSimStubs)
64
+ if (options.stubSources) {
65
+ for (const [moduleName, source] of Object.entries(options.stubSources)) {
66
+ modules[moduleName] = source;
67
+ }
68
+ }
69
+ // fsBasePath enables logical module resolution: the runtime prepends it to
70
+ // /-prefixed module names so bytecode's baked names can resolve to sim-fs.
71
+ const runtime = new MikroRuntime({
72
+ memLimit,
73
+ env,
74
+ fsRoot,
75
+ fsBasePath: fsRoot,
76
+ fsLimit,
77
+ fsReadMax,
78
+ modules,
79
+ });
80
+ // Profiling must be enabled before any module loads to capture the full
81
+ // import graph. Do it immediately after runtime construction, before the
82
+ // stub/console bootstrap registers or evaluates anything.
83
+ if (options.profile) {
84
+ runtime.enableProfiling();
85
+ }
86
+ // Strip TypeScript types from .ts files before QuickJS compiles them
87
+ runtime.setPreprocessor((filename, source) => {
88
+ if (filename.endsWith('.ts')) {
89
+ return stripTypeScriptTypes(source, { mode: 'strip' });
90
+ }
91
+ return undefined;
92
+ });
93
+ const messages$ = new Subject();
94
+ const tickCallbacks = [];
95
+ function start() {
96
+ // Bootstrap console and evaluate user script inside start() so that
97
+ // messages$ subscriptions are active before any messages are emitted.
98
+ if (modules['native:console']) {
99
+ runtime.evalModuleContent('native:dev_bootstrap', "import 'native:console'");
100
+ }
101
+ runtime.evalModule(logicalScript);
102
+ // Drain any messages produced during evalModule
103
+ for (const msg of runtime.drainMessages()) {
104
+ messages$.next(msg);
105
+ }
106
+ let stopped = false;
107
+ function tick() {
108
+ if (stopped)
109
+ return;
110
+ if (!handle.paused)
111
+ runtime.loopOnce();
112
+ for (const msg of runtime.drainMessages()) {
113
+ messages$.next(msg);
114
+ }
115
+ for (const cb of tickCallbacks) {
116
+ cb();
117
+ }
118
+ setImmediate(tick);
119
+ }
120
+ setImmediate(tick);
121
+ return () => {
122
+ stopped = true;
123
+ messages$.complete();
124
+ };
125
+ }
126
+ const handle = {
127
+ messages$,
128
+ postMessage(type, data) {
129
+ runtime.postMessage(type, data);
130
+ },
131
+ start,
132
+ onTick(callback) {
133
+ tickCallbacks.push(callback);
134
+ },
135
+ paused: false,
136
+ runtime,
137
+ };
138
+ return handle;
139
+ }
140
+ //# sourceMappingURL=devRunner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devRunner.js","sourceRoot":"","sources":["../../src/simulator/devRunner.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,OAAO,MAAM,WAAW,CAAA;AAEpC,OAAO,EAAmB,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAC9D,OAAO,EAAC,OAAO,EAAC,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAC,kBAAkB,EAAE,eAAe,EAAC,MAAM,qBAAqB,CAAA;AAGvE,MAAM,iBAAiB,GAAG,GAAG,GAAG,IAAI,CAAA,CAAC,SAAS;AAC9C,MAAM,eAAe,GAAG,eAAe,CAAA;AACvC,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAAA,CAAC,OAAO;AAoC5C;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,OAAyB;IACvD,MAAM,EAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,iBAAiB,EAAE,OAAO,GAAG,gBAAgB,EAAE,SAAS,EAAC,GAAG,OAAO,CAAA;IAClG,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,eAAe,CAAC,CAAA;IACjE,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,EAAC,SAAS,E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OAAO,GAAG,IAAI,CAAA;YACd,SAAS,CAAC,QAAQ,EAAE,CAAA;QACtB,CAAC,CAAA;IACH,CAAC;IAED,MAAM,MAAM,GAAc;QACxB,SAAS;QACT,WAAW,CAAC,IAAY,EAAE,IAAY;YACpC,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QACjC,CAAC;QACD,KAAK;QACL,MAAM,CAAC,QAAoB;YACzB,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC9B,CAAC;QACD,MAAM,EAAE,KAAK;QACb,OAAO;KACR,CAAA;IACD,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Load user-provided sim stubs from the `sim/` directory.
3
+ *
4
+ * Each `sim/<name>.stub.ts` file is a JS/TS module that directly implements
5
+ * the corresponding `native:*` native module. The source is read as text,
6
+ * TypeScript types are stripped, and the result is registered as a virtual
7
+ * module in the QuickJS runtime (replacing the native C module).
8
+ *
9
+ * Stubs run inside QuickJS, not in Node.js. They should export the same
10
+ * interface as the native module they replace.
11
+ *
12
+ * Returns a map of native:* module name → source string.
13
+ */
14
+ export declare function loadSimStubs(projectDir: string): Record<string, string>;
15
+ //# sourceMappingURL=loadSimStubs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadSimStubs.d.ts","sourceRoot":"","sources":["../../src/simulator/loadSimStubs.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgCvE"}
@@ -0,0 +1,54 @@
1
+ import { existsSync, readdirSync, readFileSync } from 'node:fs';
2
+ import { stripTypeScriptTypes } from 'node:module';
3
+ import * as pathlib from 'node:path';
4
+ import { builtinModuleNames } from './builtins/index.js';
5
+ /**
6
+ * Load user-provided sim stubs from the `sim/` directory.
7
+ *
8
+ * Each `sim/<name>.stub.ts` file is a JS/TS module that directly implements
9
+ * the corresponding `native:*` native module. The source is read as text,
10
+ * TypeScript types are stripped, and the result is registered as a virtual
11
+ * module in the QuickJS runtime (replacing the native C module).
12
+ *
13
+ * Stubs run inside QuickJS, not in Node.js. They should export the same
14
+ * interface as the native module they replace.
15
+ *
16
+ * Returns a map of native:* module name → source string.
17
+ */
18
+ export function loadSimStubs(projectDir) {
19
+ const simDir = pathlib.join(projectDir, 'sim');
20
+ if (!existsSync(simDir))
21
+ return {};
22
+ const validNames = new Set(Object.keys(builtinModuleNames));
23
+ const sources = {};
24
+ for (const file of readdirSync(simDir)) {
25
+ if (!file.endsWith('.stub.ts') && !file.endsWith('.stub.js'))
26
+ continue;
27
+ const name = file.replace(/\.stub\.[tj]s$/, '');
28
+ if (!validNames.has(name))
29
+ continue;
30
+ const moduleName = builtinModuleNames[name];
31
+ if (!moduleName)
32
+ continue;
33
+ const filePath = pathlib.join(simDir, file);
34
+ const source = readStubSource(filePath);
35
+ // Detect old-format stubs (export default { methods: { ... } })
36
+ if (source.includes('export default') && source.includes('methods')) {
37
+ process.stderr.write(`Warning: sim/${file} uses the old stub format (export default { methods }).\n` +
38
+ `Run \`mikro sim scaffold --overwrite\` to update it.\n`);
39
+ continue;
40
+ }
41
+ sources[moduleName] = source;
42
+ }
43
+ return sources;
44
+ }
45
+ function readStubSource(filePath) {
46
+ let code = readFileSync(filePath, 'utf-8');
47
+ if (filePath.endsWith('.ts')) {
48
+ code = stripTypeScriptTypes(code, { mode: 'strip' });
49
+ }
50
+ // Strip type-only imports (they erase to empty import statements)
51
+ code = code.replace(/import\s+type\s+\{[^}]*\}\s*from\s*['"][^'"]*['"]\s*;?/g, '');
52
+ return code;
53
+ }
54
+ //# sourceMappingURL=loadSimStubs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadSimStubs.js","sourceRoot":"","sources":["../../src/simulator/loadSimStubs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,WAAW,EAAE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AAM,CAAC,KAAK,CAClB,gBAAgB,IAAI,2DAA2D;gBAC7E,wDAAwD,CAC3D,CAAA;YACD,SAAQ;QACV,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,GAAG,MAAM,CAAA;IAC9B,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,SAAS,cAAc,CAAC,QAAgB;IACtC,IAAI,IAAI,GAAG,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAE1C,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,IAAI,GAAG,oBAAoB,CAAC,IAAI,EAAE,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC,CAAA;IACpD,CAAC;IAED,kEAAkE;IAClE,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,yDAAyD,EAAE,EAAE,CAAC,CAAA;IAElF,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Simulator subprocess entry point.
3
+ *
4
+ * Speaks the same TLV protocol as the ESP32 firmware over stdin/stdout.
5
+ * Spawned by the CLI via createSimTransport(). Acts as a virtual device:
6
+ * boots QuickJS runtime, handles deploy/config/eval/restart commands.
7
+ *
8
+ * Usage: node simProcess.js --fs-root <path> [--mem-limit <bytes>] [--fs-limit <bytes>] [--sim-dir <path>]
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=simProcess.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simProcess.d.ts","sourceRoot":"","sources":["../../src/simulator/simProcess.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}