@kruntime/komputer 0.1.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 (353) hide show
  1. package/README.md +368 -0
  2. package/dist/agent/approvals.d.ts +28 -0
  3. package/dist/agent/approvals.js +109 -0
  4. package/dist/agent/approvals.js.map +1 -0
  5. package/dist/agent/messages.d.ts +67 -0
  6. package/dist/agent/messages.js +213 -0
  7. package/dist/agent/messages.js.map +1 -0
  8. package/dist/agent/recovery.d.ts +13 -0
  9. package/dist/agent/recovery.js +112 -0
  10. package/dist/agent/recovery.js.map +1 -0
  11. package/dist/agent/session-utils.d.ts +17 -0
  12. package/dist/agent/session-utils.js +77 -0
  13. package/dist/agent/session-utils.js.map +1 -0
  14. package/dist/agent-session.d.ts +303 -0
  15. package/dist/agent-session.js +3031 -0
  16. package/dist/agent-session.js.map +1 -0
  17. package/dist/authority.d.ts +34 -0
  18. package/dist/authority.js +105 -0
  19. package/dist/authority.js.map +1 -0
  20. package/dist/content.d.ts +17 -0
  21. package/dist/content.js +69 -0
  22. package/dist/content.js.map +1 -0
  23. package/dist/cron.d.ts +20 -0
  24. package/dist/cron.js +25 -0
  25. package/dist/cron.js.map +1 -0
  26. package/dist/drive.d.ts +198 -0
  27. package/dist/drive.js +656 -0
  28. package/dist/drive.js.map +1 -0
  29. package/dist/events.d.ts +20 -0
  30. package/dist/events.js +149 -0
  31. package/dist/events.js.map +1 -0
  32. package/dist/fs-mode.d.ts +9 -0
  33. package/dist/fs-mode.js +98 -0
  34. package/dist/fs-mode.js.map +1 -0
  35. package/dist/index.d.ts +26 -0
  36. package/dist/index.js +15 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/komputer.d.ts +123 -0
  39. package/dist/komputer.js +733 -0
  40. package/dist/komputer.js.map +1 -0
  41. package/dist/kstate.d.ts +107 -0
  42. package/dist/kstate.js +529 -0
  43. package/dist/kstate.js.map +1 -0
  44. package/dist/model.d.ts +81 -0
  45. package/dist/model.js +824 -0
  46. package/dist/model.js.map +1 -0
  47. package/dist/node.d.ts +2 -0
  48. package/dist/node.js +3 -0
  49. package/dist/node.js.map +1 -0
  50. package/dist/path.d.ts +4 -0
  51. package/dist/path.js +38 -0
  52. package/dist/path.js.map +1 -0
  53. package/dist/pool.d.ts +56 -0
  54. package/dist/pool.js +172 -0
  55. package/dist/pool.js.map +1 -0
  56. package/dist/receipts.d.ts +44 -0
  57. package/dist/receipts.js +35 -0
  58. package/dist/receipts.js.map +1 -0
  59. package/dist/remote-node.d.ts +2 -0
  60. package/dist/remote-node.js +122 -0
  61. package/dist/remote-node.js.map +1 -0
  62. package/dist/remote.d.ts +84 -0
  63. package/dist/remote.js +11 -0
  64. package/dist/remote.js.map +1 -0
  65. package/dist/sandbox.d.ts +4 -0
  66. package/dist/sandbox.js +70 -0
  67. package/dist/sandbox.js.map +1 -0
  68. package/dist/shell/builtins/catalog.d.ts +6 -0
  69. package/dist/shell/builtins/catalog.js +12 -0
  70. package/dist/shell/builtins/catalog.js.map +1 -0
  71. package/dist/shell/builtins/commands/filesystem/basename.d.ts +2 -0
  72. package/dist/shell/builtins/commands/filesystem/basename.js +23 -0
  73. package/dist/shell/builtins/commands/filesystem/basename.js.map +1 -0
  74. package/dist/shell/builtins/commands/filesystem/cat.d.ts +2 -0
  75. package/dist/shell/builtins/commands/filesystem/cat.js +85 -0
  76. package/dist/shell/builtins/commands/filesystem/cat.js.map +1 -0
  77. package/dist/shell/builtins/commands/filesystem/cd.d.ts +2 -0
  78. package/dist/shell/builtins/commands/filesystem/cd.js +14 -0
  79. package/dist/shell/builtins/commands/filesystem/cd.js.map +1 -0
  80. package/dist/shell/builtins/commands/filesystem/chmod.d.ts +2 -0
  81. package/dist/shell/builtins/commands/filesystem/chmod.js +46 -0
  82. package/dist/shell/builtins/commands/filesystem/chmod.js.map +1 -0
  83. package/dist/shell/builtins/commands/filesystem/copy-directory.d.ts +4 -0
  84. package/dist/shell/builtins/commands/filesystem/copy-directory.js +48 -0
  85. package/dist/shell/builtins/commands/filesystem/copy-directory.js.map +1 -0
  86. package/dist/shell/builtins/commands/filesystem/cp.d.ts +2 -0
  87. package/dist/shell/builtins/commands/filesystem/cp.js +92 -0
  88. package/dist/shell/builtins/commands/filesystem/cp.js.map +1 -0
  89. package/dist/shell/builtins/commands/filesystem/dirname.d.ts +2 -0
  90. package/dist/shell/builtins/commands/filesystem/dirname.js +23 -0
  91. package/dist/shell/builtins/commands/filesystem/dirname.js.map +1 -0
  92. package/dist/shell/builtins/commands/filesystem/du.d.ts +2 -0
  93. package/dist/shell/builtins/commands/filesystem/du.js +93 -0
  94. package/dist/shell/builtins/commands/filesystem/du.js.map +1 -0
  95. package/dist/shell/builtins/commands/filesystem/find.d.ts +2 -0
  96. package/dist/shell/builtins/commands/filesystem/find.js +111 -0
  97. package/dist/shell/builtins/commands/filesystem/find.js.map +1 -0
  98. package/dist/shell/builtins/commands/filesystem/install.d.ts +2 -0
  99. package/dist/shell/builtins/commands/filesystem/install.js +89 -0
  100. package/dist/shell/builtins/commands/filesystem/install.js.map +1 -0
  101. package/dist/shell/builtins/commands/filesystem/ln.d.ts +2 -0
  102. package/dist/shell/builtins/commands/filesystem/ln.js +57 -0
  103. package/dist/shell/builtins/commands/filesystem/ln.js.map +1 -0
  104. package/dist/shell/builtins/commands/filesystem/ls.d.ts +2 -0
  105. package/dist/shell/builtins/commands/filesystem/ls.js +153 -0
  106. package/dist/shell/builtins/commands/filesystem/ls.js.map +1 -0
  107. package/dist/shell/builtins/commands/filesystem/mkdir.d.ts +2 -0
  108. package/dist/shell/builtins/commands/filesystem/mkdir.js +41 -0
  109. package/dist/shell/builtins/commands/filesystem/mkdir.js.map +1 -0
  110. package/dist/shell/builtins/commands/filesystem/mktemp.d.ts +2 -0
  111. package/dist/shell/builtins/commands/filesystem/mktemp.js +94 -0
  112. package/dist/shell/builtins/commands/filesystem/mktemp.js.map +1 -0
  113. package/dist/shell/builtins/commands/filesystem/mv.d.ts +2 -0
  114. package/dist/shell/builtins/commands/filesystem/mv.js +41 -0
  115. package/dist/shell/builtins/commands/filesystem/mv.js.map +1 -0
  116. package/dist/shell/builtins/commands/filesystem/pwd.d.ts +2 -0
  117. package/dist/shell/builtins/commands/filesystem/pwd.js +2 -0
  118. package/dist/shell/builtins/commands/filesystem/pwd.js.map +1 -0
  119. package/dist/shell/builtins/commands/filesystem/realpath.d.ts +3 -0
  120. package/dist/shell/builtins/commands/filesystem/realpath.js +61 -0
  121. package/dist/shell/builtins/commands/filesystem/realpath.js.map +1 -0
  122. package/dist/shell/builtins/commands/filesystem/rm.d.ts +2 -0
  123. package/dist/shell/builtins/commands/filesystem/rm.js +38 -0
  124. package/dist/shell/builtins/commands/filesystem/rm.js.map +1 -0
  125. package/dist/shell/builtins/commands/filesystem/stat.d.ts +2 -0
  126. package/dist/shell/builtins/commands/filesystem/stat.js +141 -0
  127. package/dist/shell/builtins/commands/filesystem/stat.js.map +1 -0
  128. package/dist/shell/builtins/commands/filesystem/touch.d.ts +2 -0
  129. package/dist/shell/builtins/commands/filesystem/touch.js +143 -0
  130. package/dist/shell/builtins/commands/filesystem/touch.js.map +1 -0
  131. package/dist/shell/builtins/commands/filesystem.d.ts +2 -0
  132. package/dist/shell/builtins/commands/filesystem.js +44 -0
  133. package/dist/shell/builtins/commands/filesystem.js.map +1 -0
  134. package/dist/shell/builtins/commands/network/curl.d.ts +2 -0
  135. package/dist/shell/builtins/commands/network/curl.js +25 -0
  136. package/dist/shell/builtins/commands/network/curl.js.map +1 -0
  137. package/dist/shell/builtins/commands/network/http.d.ts +27 -0
  138. package/dist/shell/builtins/commands/network/http.js +226 -0
  139. package/dist/shell/builtins/commands/network/http.js.map +1 -0
  140. package/dist/shell/builtins/commands/network/wget.d.ts +2 -0
  141. package/dist/shell/builtins/commands/network/wget.js +32 -0
  142. package/dist/shell/builtins/commands/network/wget.js.map +1 -0
  143. package/dist/shell/builtins/commands/network.d.ts +2 -0
  144. package/dist/shell/builtins/commands/network.js +9 -0
  145. package/dist/shell/builtins/commands/network.js.map +1 -0
  146. package/dist/shell/builtins/commands/process/bg.d.ts +2 -0
  147. package/dist/shell/builtins/commands/process/bg.js +10 -0
  148. package/dist/shell/builtins/commands/process/bg.js.map +1 -0
  149. package/dist/shell/builtins/commands/process/fg.d.ts +2 -0
  150. package/dist/shell/builtins/commands/process/fg.js +14 -0
  151. package/dist/shell/builtins/commands/process/fg.js.map +1 -0
  152. package/dist/shell/builtins/commands/process/jobs.d.ts +2 -0
  153. package/dist/shell/builtins/commands/process/jobs.js +8 -0
  154. package/dist/shell/builtins/commands/process/jobs.js.map +1 -0
  155. package/dist/shell/builtins/commands/process/jobspec.d.ts +4 -0
  156. package/dist/shell/builtins/commands/process/jobspec.js +20 -0
  157. package/dist/shell/builtins/commands/process/jobspec.js.map +1 -0
  158. package/dist/shell/builtins/commands/process/kill.d.ts +2 -0
  159. package/dist/shell/builtins/commands/process/kill.js +35 -0
  160. package/dist/shell/builtins/commands/process/kill.js.map +1 -0
  161. package/dist/shell/builtins/commands/process/ps.d.ts +2 -0
  162. package/dist/shell/builtins/commands/process/ps.js +6 -0
  163. package/dist/shell/builtins/commands/process/ps.js.map +1 -0
  164. package/dist/shell/builtins/commands/process/sleep.d.ts +2 -0
  165. package/dist/shell/builtins/commands/process/sleep.js +6 -0
  166. package/dist/shell/builtins/commands/process/sleep.js.map +1 -0
  167. package/dist/shell/builtins/commands/process/wait.d.ts +2 -0
  168. package/dist/shell/builtins/commands/process/wait.js +21 -0
  169. package/dist/shell/builtins/commands/process/wait.js.map +1 -0
  170. package/dist/shell/builtins/commands/process.d.ts +2 -0
  171. package/dist/shell/builtins/commands/process.js +19 -0
  172. package/dist/shell/builtins/commands/process.js.map +1 -0
  173. package/dist/shell/builtins/commands/system/command.d.ts +2 -0
  174. package/dist/shell/builtins/commands/system/command.js +42 -0
  175. package/dist/shell/builtins/commands/system/command.js.map +1 -0
  176. package/dist/shell/builtins/commands/system/date.d.ts +2 -0
  177. package/dist/shell/builtins/commands/system/date.js +121 -0
  178. package/dist/shell/builtins/commands/system/date.js.map +1 -0
  179. package/dist/shell/builtins/commands/system/env.d.ts +2 -0
  180. package/dist/shell/builtins/commands/system/env.js +84 -0
  181. package/dist/shell/builtins/commands/system/env.js.map +1 -0
  182. package/dist/shell/builtins/commands/system/export.d.ts +2 -0
  183. package/dist/shell/builtins/commands/system/export.js +18 -0
  184. package/dist/shell/builtins/commands/system/export.js.map +1 -0
  185. package/dist/shell/builtins/commands/system/false.d.ts +2 -0
  186. package/dist/shell/builtins/commands/system/false.js +4 -0
  187. package/dist/shell/builtins/commands/system/false.js.map +1 -0
  188. package/dist/shell/builtins/commands/system/help.d.ts +2 -0
  189. package/dist/shell/builtins/commands/system/help.js +38 -0
  190. package/dist/shell/builtins/commands/system/help.js.map +1 -0
  191. package/dist/shell/builtins/commands/system/hostname.d.ts +2 -0
  192. package/dist/shell/builtins/commands/system/hostname.js +6 -0
  193. package/dist/shell/builtins/commands/system/hostname.js.map +1 -0
  194. package/dist/shell/builtins/commands/system/id.d.ts +2 -0
  195. package/dist/shell/builtins/commands/system/id.js +55 -0
  196. package/dist/shell/builtins/commands/system/id.js.map +1 -0
  197. package/dist/shell/builtins/commands/system/printenv.d.ts +2 -0
  198. package/dist/shell/builtins/commands/system/printenv.js +22 -0
  199. package/dist/shell/builtins/commands/system/printenv.js.map +1 -0
  200. package/dist/shell/builtins/commands/system/read.d.ts +2 -0
  201. package/dist/shell/builtins/commands/system/read.js +75 -0
  202. package/dist/shell/builtins/commands/system/read.js.map +1 -0
  203. package/dist/shell/builtins/commands/system/resolve-command.d.ts +3 -0
  204. package/dist/shell/builtins/commands/system/resolve-command.js +34 -0
  205. package/dist/shell/builtins/commands/system/resolve-command.js.map +1 -0
  206. package/dist/shell/builtins/commands/system/set.d.ts +2 -0
  207. package/dist/shell/builtins/commands/system/set.js +49 -0
  208. package/dist/shell/builtins/commands/system/set.js.map +1 -0
  209. package/dist/shell/builtins/commands/system/sh.d.ts +2 -0
  210. package/dist/shell/builtins/commands/system/sh.js +55 -0
  211. package/dist/shell/builtins/commands/system/sh.js.map +1 -0
  212. package/dist/shell/builtins/commands/system/source.d.ts +2 -0
  213. package/dist/shell/builtins/commands/system/source.js +42 -0
  214. package/dist/shell/builtins/commands/system/source.js.map +1 -0
  215. package/dist/shell/builtins/commands/system/test-expression.d.ts +2 -0
  216. package/dist/shell/builtins/commands/system/test-expression.js +93 -0
  217. package/dist/shell/builtins/commands/system/test-expression.js.map +1 -0
  218. package/dist/shell/builtins/commands/system/test.d.ts +4 -0
  219. package/dist/shell/builtins/commands/system/test.js +19 -0
  220. package/dist/shell/builtins/commands/system/test.js.map +1 -0
  221. package/dist/shell/builtins/commands/system/true.d.ts +2 -0
  222. package/dist/shell/builtins/commands/system/true.js +2 -0
  223. package/dist/shell/builtins/commands/system/true.js.map +1 -0
  224. package/dist/shell/builtins/commands/system/type.d.ts +2 -0
  225. package/dist/shell/builtins/commands/system/type.js +77 -0
  226. package/dist/shell/builtins/commands/system/type.js.map +1 -0
  227. package/dist/shell/builtins/commands/system/uname.d.ts +2 -0
  228. package/dist/shell/builtins/commands/system/uname.js +39 -0
  229. package/dist/shell/builtins/commands/system/uname.js.map +1 -0
  230. package/dist/shell/builtins/commands/system/unset.d.ts +2 -0
  231. package/dist/shell/builtins/commands/system/unset.js +9 -0
  232. package/dist/shell/builtins/commands/system/unset.js.map +1 -0
  233. package/dist/shell/builtins/commands/system/which.d.ts +2 -0
  234. package/dist/shell/builtins/commands/system/which.js +38 -0
  235. package/dist/shell/builtins/commands/system/which.js.map +1 -0
  236. package/dist/shell/builtins/commands/system/whoami.d.ts +2 -0
  237. package/dist/shell/builtins/commands/system/whoami.js +6 -0
  238. package/dist/shell/builtins/commands/system/whoami.js.map +1 -0
  239. package/dist/shell/builtins/commands/system.d.ts +2 -0
  240. package/dist/shell/builtins/commands/system.js +49 -0
  241. package/dist/shell/builtins/commands/system.js.map +1 -0
  242. package/dist/shell/builtins/commands/text/awk.d.ts +2 -0
  243. package/dist/shell/builtins/commands/text/awk.js +8 -0
  244. package/dist/shell/builtins/commands/text/awk.js.map +1 -0
  245. package/dist/shell/builtins/commands/text/base64.d.ts +2 -0
  246. package/dist/shell/builtins/commands/text/base64.js +69 -0
  247. package/dist/shell/builtins/commands/text/base64.js.map +1 -0
  248. package/dist/shell/builtins/commands/text/cut.d.ts +2 -0
  249. package/dist/shell/builtins/commands/text/cut.js +35 -0
  250. package/dist/shell/builtins/commands/text/cut.js.map +1 -0
  251. package/dist/shell/builtins/commands/text/diff.d.ts +2 -0
  252. package/dist/shell/builtins/commands/text/diff.js +83 -0
  253. package/dist/shell/builtins/commands/text/diff.js.map +1 -0
  254. package/dist/shell/builtins/commands/text/echo.d.ts +2 -0
  255. package/dist/shell/builtins/commands/text/echo.js +6 -0
  256. package/dist/shell/builtins/commands/text/echo.js.map +1 -0
  257. package/dist/shell/builtins/commands/text/grep.d.ts +2 -0
  258. package/dist/shell/builtins/commands/text/grep.js +123 -0
  259. package/dist/shell/builtins/commands/text/grep.js.map +1 -0
  260. package/dist/shell/builtins/commands/text/head.d.ts +2 -0
  261. package/dist/shell/builtins/commands/text/head.js +8 -0
  262. package/dist/shell/builtins/commands/text/head.js.map +1 -0
  263. package/dist/shell/builtins/commands/text/jq.d.ts +2 -0
  264. package/dist/shell/builtins/commands/text/jq.js +239 -0
  265. package/dist/shell/builtins/commands/text/jq.js.map +1 -0
  266. package/dist/shell/builtins/commands/text/printf.d.ts +2 -0
  267. package/dist/shell/builtins/commands/text/printf.js +3 -0
  268. package/dist/shell/builtins/commands/text/printf.js.map +1 -0
  269. package/dist/shell/builtins/commands/text/sed.d.ts +2 -0
  270. package/dist/shell/builtins/commands/text/sed.js +21 -0
  271. package/dist/shell/builtins/commands/text/sed.js.map +1 -0
  272. package/dist/shell/builtins/commands/text/sha256sum.d.ts +2 -0
  273. package/dist/shell/builtins/commands/text/sha256sum.js +63 -0
  274. package/dist/shell/builtins/commands/text/sha256sum.js.map +1 -0
  275. package/dist/shell/builtins/commands/text/sort.d.ts +2 -0
  276. package/dist/shell/builtins/commands/text/sort.js +134 -0
  277. package/dist/shell/builtins/commands/text/sort.js.map +1 -0
  278. package/dist/shell/builtins/commands/text/tail.d.ts +2 -0
  279. package/dist/shell/builtins/commands/text/tail.js +10 -0
  280. package/dist/shell/builtins/commands/text/tail.js.map +1 -0
  281. package/dist/shell/builtins/commands/text/tee.d.ts +2 -0
  282. package/dist/shell/builtins/commands/text/tee.js +29 -0
  283. package/dist/shell/builtins/commands/text/tee.js.map +1 -0
  284. package/dist/shell/builtins/commands/text/tr.d.ts +2 -0
  285. package/dist/shell/builtins/commands/text/tr.js +3 -0
  286. package/dist/shell/builtins/commands/text/tr.js.map +1 -0
  287. package/dist/shell/builtins/commands/text/uniq.d.ts +2 -0
  288. package/dist/shell/builtins/commands/text/uniq.js +8 -0
  289. package/dist/shell/builtins/commands/text/uniq.js.map +1 -0
  290. package/dist/shell/builtins/commands/text/wc.d.ts +2 -0
  291. package/dist/shell/builtins/commands/text/wc.js +30 -0
  292. package/dist/shell/builtins/commands/text/wc.js.map +1 -0
  293. package/dist/shell/builtins/commands/text/xargs.d.ts +2 -0
  294. package/dist/shell/builtins/commands/text/xargs.js +138 -0
  295. package/dist/shell/builtins/commands/text/xargs.js.map +1 -0
  296. package/dist/shell/builtins/commands/text.d.ts +2 -0
  297. package/dist/shell/builtins/commands/text.js +41 -0
  298. package/dist/shell/builtins/commands/text.js.map +1 -0
  299. package/dist/shell/builtins/help-text.d.ts +69 -0
  300. package/dist/shell/builtins/help-text.js +381 -0
  301. package/dist/shell/builtins/help-text.js.map +1 -0
  302. package/dist/shell/builtins/path.d.ts +28 -0
  303. package/dist/shell/builtins/path.js +184 -0
  304. package/dist/shell/builtins/path.js.map +1 -0
  305. package/dist/shell/builtins/registry.d.ts +3 -0
  306. package/dist/shell/builtins/registry.js +75 -0
  307. package/dist/shell/builtins/registry.js.map +1 -0
  308. package/dist/shell/builtins/run.d.ts +4 -0
  309. package/dist/shell/builtins/run.js +29 -0
  310. package/dist/shell/builtins/run.js.map +1 -0
  311. package/dist/shell/builtins/runtime.d.ts +83 -0
  312. package/dist/shell/builtins/runtime.js +46 -0
  313. package/dist/shell/builtins/runtime.js.map +1 -0
  314. package/dist/shell/builtins/text.d.ts +90 -0
  315. package/dist/shell/builtins/text.js +970 -0
  316. package/dist/shell/builtins/text.js.map +1 -0
  317. package/dist/shell/control.d.ts +31 -0
  318. package/dist/shell/control.js +232 -0
  319. package/dist/shell/control.js.map +1 -0
  320. package/dist/shell/expansion.d.ts +30 -0
  321. package/dist/shell/expansion.js +514 -0
  322. package/dist/shell/expansion.js.map +1 -0
  323. package/dist/shell/functions.d.ts +10 -0
  324. package/dist/shell/functions.js +108 -0
  325. package/dist/shell/functions.js.map +1 -0
  326. package/dist/shell/runtime.d.ts +44 -0
  327. package/dist/shell/runtime.js +276 -0
  328. package/dist/shell/runtime.js.map +1 -0
  329. package/dist/shell/time.d.ts +1 -0
  330. package/dist/shell/time.js +68 -0
  331. package/dist/shell/time.js.map +1 -0
  332. package/dist/state-backend.d.ts +61 -0
  333. package/dist/state-backend.js +275 -0
  334. package/dist/state-backend.js.map +1 -0
  335. package/dist/state-node.d.ts +2 -0
  336. package/dist/state-node.js +266 -0
  337. package/dist/state-node.js.map +1 -0
  338. package/dist/types.d.ts +462 -0
  339. package/dist/types.js +2 -0
  340. package/dist/types.js.map +1 -0
  341. package/dist/utils.d.ts +5 -0
  342. package/dist/utils.js +117 -0
  343. package/dist/utils.js.map +1 -0
  344. package/dist/vbash.d.ts +40 -0
  345. package/dist/vbash.js +389 -0
  346. package/dist/vbash.js.map +1 -0
  347. package/dist/vfs.d.ts +64 -0
  348. package/dist/vfs.js +248 -0
  349. package/dist/vfs.js.map +1 -0
  350. package/dist/vprocess.d.ts +139 -0
  351. package/dist/vprocess.js +756 -0
  352. package/dist/vprocess.js.map +1 -0
  353. package/package.json +28 -0
package/dist/cron.js ADDED
@@ -0,0 +1,25 @@
1
+ export const CRON_RUNS_PATH = '/meta/cron/runs.jsonl';
2
+ export async function appendCronRun(kstate, record) {
3
+ await kstate.appendJsonl(CRON_RUNS_PATH, record);
4
+ }
5
+ export async function readCronRuns(kstate) {
6
+ return kstate.readJsonl(CRON_RUNS_PATH);
7
+ }
8
+ export function summarizeCronResult(value) {
9
+ if (value && typeof value === 'object') {
10
+ const record = value;
11
+ return {
12
+ type: typeof record.type === 'string' ? record.type : undefined,
13
+ status: typeof record.status === 'string' ? record.status : undefined,
14
+ code: typeof record.code === 'number' ? record.code : undefined,
15
+ text: typeof record.text === 'string' ? truncate(record.text) : undefined,
16
+ stdout: typeof record.stdout === 'string' ? truncate(record.stdout) : undefined,
17
+ stderr: typeof record.stderr === 'string' ? truncate(record.stderr) : undefined,
18
+ };
19
+ }
20
+ return { type: typeof value, value: typeof value === 'string' ? truncate(value) : undefined };
21
+ }
22
+ function truncate(value) {
23
+ return value.length > 500 ? `${value.slice(0, 500)}...` : value;
24
+ }
25
+ //# sourceMappingURL=cron.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cron.js","sourceRoot":"","sources":["../../../../packages/komputer/src/cron.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG,uBAAuB,CAAA;AAmBrD,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAc,EAAE,MAAqB;IACvE,MAAM,MAAM,CAAC,WAAW,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AAClD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAAc;IAC/C,OAAO,MAAM,CAAC,SAAS,CAAgB,cAAc,CAAC,CAAA;AACxD,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvC,MAAM,MAAM,GAAG,KAAgC,CAAA;QAC/C,OAAO;YACL,IAAI,EAAE,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;YAC/D,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;YACrE,IAAI,EAAE,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;YAC/D,IAAI,EAAE,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;YACzE,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;YAC/E,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;SAChF,CAAA;IACH,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAA;AAC/F,CAAC;AAED,SAAS,QAAQ,CAAC,KAAa;IAC7B,OAAO,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAA;AACjE,CAAC"}
@@ -0,0 +1,198 @@
1
+ import { KState } from './kstate.js';
2
+ import type { Json } from './types.js';
3
+ export declare const MOUNT_REGISTRY_PATH = "/meta/mounts.jsonl";
4
+ export type MountMode = 'ro' | 'rw';
5
+ export interface MountRegistryRecord extends Record<string, unknown> {
6
+ path: string;
7
+ kind: 'owned' | 'external';
8
+ driveName: string;
9
+ mode: MountMode;
10
+ recoverable: boolean;
11
+ prefix?: string;
12
+ at: string;
13
+ }
14
+ export interface FileEntry {
15
+ name: string;
16
+ type: 'dir' | 'file' | 'symlink';
17
+ }
18
+ export interface FileStat {
19
+ type: 'dir' | 'file' | 'symlink';
20
+ size?: number;
21
+ mtime?: string;
22
+ mode?: number;
23
+ }
24
+ export interface Drive {
25
+ kind: 'drive';
26
+ name?: string;
27
+ mount?(ctx: DriveMountContext): Promise<void> | void;
28
+ unmount?(): Promise<void> | void;
29
+ readText(path: string): Promise<string>;
30
+ writeText?(path: string, text: string): Promise<void>;
31
+ mkdir?(path: string): Promise<void>;
32
+ rm?(path: string, options?: {
33
+ recursive?: boolean;
34
+ force?: boolean;
35
+ }): Promise<void>;
36
+ rename?(from: string, to: string): Promise<void>;
37
+ symlink?(target: string, path: string): Promise<void>;
38
+ readLink?(path: string): Promise<string | undefined>;
39
+ chmod?(path: string, mode: number): Promise<void>;
40
+ utime?(path: string, mtime: string): Promise<void>;
41
+ exists(path: string): Promise<boolean>;
42
+ readdir(path: string): Promise<FileEntry[]>;
43
+ stat?(path: string): Promise<FileStat>;
44
+ realPath?(path: string): string | undefined;
45
+ }
46
+ export interface DriveMountContext {
47
+ path: string;
48
+ mode: MountMode;
49
+ }
50
+ export type FileTreeValue = string | Uint8Array | Json | FileTree;
51
+ export interface FileTree {
52
+ [name: string]: FileTreeValue;
53
+ }
54
+ export type MountSource = Drive | FileTreeValue;
55
+ export interface MountBinding {
56
+ kind: 'mount-binding';
57
+ source: MountSource;
58
+ mode: MountMode;
59
+ }
60
+ export interface MountEntry {
61
+ path: string;
62
+ drive: Drive;
63
+ mode: MountMode;
64
+ }
65
+ export interface MountOptions {
66
+ mode?: MountMode;
67
+ }
68
+ export declare function ro(source: MountSource): MountBinding;
69
+ export declare function rw(source: MountSource): MountBinding;
70
+ export declare class MountTable {
71
+ private readonly entries;
72
+ constructor(rootDrive: Drive);
73
+ mount(path: string, drive: Drive, options?: MountOptions): void;
74
+ has(path: string): boolean;
75
+ unmount(path: string): Promise<void>;
76
+ activate(): Promise<void>;
77
+ unmountAll(): Promise<void>;
78
+ list(): MountEntry[];
79
+ childMounts(path: string): MountEntry[];
80
+ hasDescendant(path: string): boolean;
81
+ resolve(path: string): {
82
+ mountPath: string;
83
+ drivePath: string;
84
+ drive: Drive;
85
+ mode: MountMode;
86
+ };
87
+ realPath(path: string): string | undefined;
88
+ }
89
+ export declare function basenameOf(path: string): string;
90
+ export declare class KStateDrive implements Drive {
91
+ kind: "drive";
92
+ name: string;
93
+ prefix: string;
94
+ kstate: KState;
95
+ constructor(kstate: KState, { name, prefix }?: {
96
+ name?: string;
97
+ prefix?: string;
98
+ });
99
+ readText(path: string): Promise<string>;
100
+ writeText(path: string, text: string): Promise<void>;
101
+ mkdir(path: string): Promise<void>;
102
+ rm(path: string, options?: {
103
+ recursive?: boolean;
104
+ force?: boolean;
105
+ }): Promise<void>;
106
+ rename(from: string, to: string): Promise<void>;
107
+ symlink(target: string, path: string): Promise<void>;
108
+ readLink(path: string): Promise<string | undefined>;
109
+ chmod(path: string, mode: number): Promise<void>;
110
+ utime(path: string, mtime: string): Promise<void>;
111
+ exists(path: string): Promise<boolean>;
112
+ readdir(path: string): Promise<FileEntry[]>;
113
+ stat(path: string): Promise<FileStat>;
114
+ fullPath(path?: string): string;
115
+ realPath(path?: string): string | undefined;
116
+ }
117
+ export declare function recordMount(kstate: KState, record: MountRegistryRecord): Promise<void>;
118
+ export declare function readMountRegistry(kstate: KState): Promise<MountRegistryRecord[]>;
119
+ export declare class OverlayDrive implements Drive {
120
+ kind: "drive";
121
+ name: string;
122
+ lower: Drive;
123
+ upper: KStateDrive;
124
+ constructor({ name, lower, upper }: {
125
+ name?: string;
126
+ lower: Drive;
127
+ upper: KStateDrive;
128
+ });
129
+ readText(path: string): Promise<string>;
130
+ writeText(path: string, text: string): Promise<void>;
131
+ mkdir(path: string): Promise<void>;
132
+ rm(path: string, options?: {
133
+ recursive?: boolean;
134
+ force?: boolean;
135
+ }): Promise<void>;
136
+ rename(from: string, to: string): Promise<void>;
137
+ symlink(target: string, path: string): Promise<void>;
138
+ readLink(path: string): Promise<string | undefined>;
139
+ chmod(path: string, mode: number): Promise<void>;
140
+ utime(path: string, mtime: string): Promise<void>;
141
+ exists(path: string): Promise<boolean>;
142
+ readdir(path: string): Promise<FileEntry[]>;
143
+ stat(path: string): Promise<FileStat>;
144
+ private tombstonePath;
145
+ private clearTombstone;
146
+ private isDeleted;
147
+ }
148
+ export declare class ReadonlyDrive implements Drive {
149
+ kind: "drive";
150
+ name: string;
151
+ inner: Drive;
152
+ constructor(inner: Drive, name?: string);
153
+ mount(ctx: DriveMountContext): Promise<void> | void;
154
+ unmount(): Promise<void> | void;
155
+ readText(path: string): Promise<string>;
156
+ exists(path: string): Promise<boolean>;
157
+ readdir(path: string): Promise<FileEntry[]>;
158
+ stat(path: string): Promise<FileStat>;
159
+ readLink(path: string): Promise<string | undefined>;
160
+ realPath(path: string): string | undefined;
161
+ }
162
+ export declare class MemoryDrive implements Drive {
163
+ kind: "drive";
164
+ name: string;
165
+ private readonly files;
166
+ private readonly symlinks;
167
+ private readonly modes;
168
+ private readonly mtimes;
169
+ constructor(tree?: FileTree, { name }?: {
170
+ name?: string;
171
+ });
172
+ readText(path: string): Promise<string>;
173
+ writeText(path: string, text: string): Promise<void>;
174
+ rm(path: string, options?: {
175
+ recursive?: boolean;
176
+ force?: boolean;
177
+ }): Promise<void>;
178
+ rename(from: string, to: string): Promise<void>;
179
+ exists(path: string): Promise<boolean>;
180
+ readdir(path: string): Promise<FileEntry[]>;
181
+ stat(path: string): Promise<FileStat>;
182
+ chmod(path: string, mode: number): Promise<void>;
183
+ utime(path: string, mtime: string): Promise<void>;
184
+ symlink(target: string, path: string): Promise<void>;
185
+ readLink(path: string): Promise<string | undefined>;
186
+ private loadTree;
187
+ private moveMode;
188
+ private moveMtime;
189
+ private resolveSymlinks;
190
+ }
191
+ export declare function memoryDrive(tree?: FileTree, options?: {
192
+ name?: string;
193
+ readonly?: boolean;
194
+ }): Drive;
195
+ export declare function overlayMountTable(kstate: KState, sessionId: string, base: MountTable): MountTable;
196
+ export declare function isMountBinding(value: unknown): value is MountBinding;
197
+ export declare function isDrive(value: unknown): value is Drive;
198
+ export declare function materializeFileTree(kstate: KState, mountPath: string, source: FileTreeValue): Promise<void>;