@struktoai/mirage-node 0.0.5-alpha.1 → 0.0.6

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 (1787) hide show
  1. package/README.md +137 -79
  2. package/dist/accessor/disk.d.ts +6 -0
  3. package/dist/accessor/disk.d.ts.map +1 -0
  4. package/dist/accessor/disk.js +22 -0
  5. package/dist/accessor/disk.js.map +1 -0
  6. package/dist/accessor/email.d.ts +11 -0
  7. package/dist/accessor/email.d.ts.map +1 -0
  8. package/dist/accessor/email.js +57 -0
  9. package/dist/accessor/email.js.map +1 -0
  10. package/dist/accessor/gridfs.d.ts +13 -0
  11. package/dist/accessor/gridfs.d.ts.map +1 -0
  12. package/dist/accessor/gridfs.js +48 -0
  13. package/dist/accessor/gridfs.js.map +1 -0
  14. package/dist/accessor/hf.d.ts +38 -0
  15. package/dist/accessor/hf.d.ts.map +1 -0
  16. package/dist/accessor/hf.js +101 -0
  17. package/dist/accessor/hf.js.map +1 -0
  18. package/dist/accessor/hf_hub.d.ts +80 -0
  19. package/dist/accessor/hf_hub.d.ts.map +1 -0
  20. package/dist/accessor/hf_hub.js +122 -0
  21. package/dist/accessor/hf_hub.js.map +1 -0
  22. package/dist/accessor/nextcloud.d.ts +12 -0
  23. package/dist/accessor/nextcloud.d.ts.map +1 -0
  24. package/dist/accessor/nextcloud.js +26 -0
  25. package/dist/accessor/nextcloud.js.map +1 -0
  26. package/dist/accessor/ssh.d.ts +14 -0
  27. package/dist/accessor/ssh.d.ts.map +1 -0
  28. package/dist/accessor/ssh.js +105 -0
  29. package/dist/accessor/ssh.js.map +1 -0
  30. package/dist/cache/file/add.lua +16 -0
  31. package/dist/cache/file/redis.d.ts +41 -0
  32. package/dist/cache/file/redis.d.ts.map +1 -0
  33. package/dist/cache/file/redis.js +191 -0
  34. package/dist/cache/file/redis.js.map +1 -0
  35. package/dist/commands/builtin/disk/index.d.ts +3 -0
  36. package/dist/commands/builtin/disk/index.d.ts.map +1 -0
  37. package/dist/commands/builtin/disk/index.js +20 -0
  38. package/dist/commands/builtin/disk/index.js.map +1 -0
  39. package/dist/commands/builtin/disk/io.d.ts +4 -0
  40. package/dist/commands/builtin/disk/io.d.ts.map +1 -0
  41. package/dist/commands/builtin/disk/io.js +57 -0
  42. package/dist/commands/builtin/disk/io.js.map +1 -0
  43. package/dist/commands/builtin/email/_provision.d.ts +7 -0
  44. package/dist/commands/builtin/email/_provision.d.ts.map +1 -0
  45. package/dist/commands/builtin/email/_provision.js +42 -0
  46. package/dist/commands/builtin/email/_provision.js.map +1 -0
  47. package/dist/commands/builtin/email/find.d.ts +2 -0
  48. package/dist/commands/builtin/email/find.d.ts.map +1 -0
  49. package/dist/commands/builtin/email/find.js +51 -0
  50. package/dist/commands/builtin/email/find.js.map +1 -0
  51. package/dist/commands/builtin/email/grep.d.ts +4 -0
  52. package/dist/commands/builtin/email/grep.d.ts.map +1 -0
  53. package/dist/commands/builtin/email/grep.js +108 -0
  54. package/dist/commands/builtin/email/grep.js.map +1 -0
  55. package/dist/commands/builtin/email/index.d.ts +3 -0
  56. package/dist/commands/builtin/email/index.d.ts.map +1 -0
  57. package/dist/commands/builtin/email/index.js +31 -0
  58. package/dist/commands/builtin/email/index.js.map +1 -0
  59. package/dist/commands/builtin/email/io.d.ts +4 -0
  60. package/dist/commands/builtin/email/io.d.ts.map +1 -0
  61. package/dist/commands/builtin/email/io.js +28 -0
  62. package/dist/commands/builtin/email/io.js.map +1 -0
  63. package/dist/commands/builtin/email/rg.d.ts +2 -0
  64. package/dist/commands/builtin/email/rg.d.ts.map +1 -0
  65. package/dist/commands/builtin/email/rg.js +93 -0
  66. package/dist/commands/builtin/email/rg.js.map +1 -0
  67. package/dist/commands/builtin/gridfs/index.d.ts +3 -0
  68. package/dist/commands/builtin/gridfs/index.d.ts.map +1 -0
  69. package/dist/commands/builtin/gridfs/index.js +24 -0
  70. package/dist/commands/builtin/gridfs/index.js.map +1 -0
  71. package/dist/commands/builtin/gridfs/io.d.ts +4 -0
  72. package/dist/commands/builtin/gridfs/io.d.ts.map +1 -0
  73. package/dist/commands/builtin/gridfs/io.js +54 -0
  74. package/dist/commands/builtin/gridfs/io.js.map +1 -0
  75. package/dist/commands/builtin/hf/find.d.ts +2 -0
  76. package/dist/commands/builtin/hf/find.d.ts.map +1 -0
  77. package/dist/commands/builtin/hf/find.js +31 -0
  78. package/dist/commands/builtin/hf/find.js.map +1 -0
  79. package/dist/commands/builtin/hf/index.d.ts +3 -0
  80. package/dist/commands/builtin/hf/index.d.ts.map +1 -0
  81. package/dist/commands/builtin/hf/index.js +25 -0
  82. package/dist/commands/builtin/hf/index.js.map +1 -0
  83. package/dist/commands/builtin/hf/io.d.ts +4 -0
  84. package/dist/commands/builtin/hf/io.d.ts.map +1 -0
  85. package/dist/commands/builtin/hf/io.js +44 -0
  86. package/dist/commands/builtin/hf/io.js.map +1 -0
  87. package/dist/commands/builtin/hf_hub/index.d.ts +4 -0
  88. package/dist/commands/builtin/hf_hub/index.d.ts.map +1 -0
  89. package/dist/commands/builtin/hf_hub/index.js +30 -0
  90. package/dist/commands/builtin/hf_hub/index.js.map +1 -0
  91. package/dist/commands/builtin/hf_hub/io.d.ts +4 -0
  92. package/dist/commands/builtin/hf_hub/io.d.ts.map +1 -0
  93. package/dist/commands/builtin/hf_hub/io.js +54 -0
  94. package/dist/commands/builtin/hf_hub/io.js.map +1 -0
  95. package/dist/commands/builtin/nextcloud/index.d.ts +3 -0
  96. package/dist/commands/builtin/nextcloud/index.d.ts.map +1 -0
  97. package/dist/commands/builtin/nextcloud/index.js +7 -0
  98. package/dist/commands/builtin/nextcloud/index.js.map +1 -0
  99. package/dist/commands/builtin/nextcloud/io.d.ts +4 -0
  100. package/dist/commands/builtin/nextcloud/io.d.ts.map +1 -0
  101. package/dist/commands/builtin/nextcloud/io.js +41 -0
  102. package/dist/commands/builtin/nextcloud/io.js.map +1 -0
  103. package/dist/commands/builtin/ssh/index.d.ts +3 -0
  104. package/dist/commands/builtin/ssh/index.d.ts.map +1 -0
  105. package/dist/commands/builtin/ssh/index.js +20 -0
  106. package/dist/commands/builtin/ssh/index.js.map +1 -0
  107. package/dist/commands/builtin/ssh/io.d.ts +4 -0
  108. package/dist/commands/builtin/ssh/io.d.ts.map +1 -0
  109. package/dist/commands/builtin/ssh/io.js +58 -0
  110. package/dist/commands/builtin/ssh/io.js.map +1 -0
  111. package/dist/commands/cli/builtin/hf/accessor.d.ts +37 -0
  112. package/dist/commands/cli/builtin/hf/accessor.d.ts.map +1 -0
  113. package/dist/commands/cli/builtin/hf/accessor.js +80 -0
  114. package/dist/commands/cli/builtin/hf/accessor.js.map +1 -0
  115. package/dist/commands/cli/builtin/hf/auth.d.ts +14 -0
  116. package/dist/commands/cli/builtin/hf/auth.d.ts.map +1 -0
  117. package/dist/commands/cli/builtin/hf/auth.js +77 -0
  118. package/dist/commands/cli/builtin/hf/auth.js.map +1 -0
  119. package/dist/commands/cli/builtin/hf/download.d.ts +46 -0
  120. package/dist/commands/cli/builtin/hf/download.d.ts.map +1 -0
  121. package/dist/commands/cli/builtin/hf/download.js +296 -0
  122. package/dist/commands/cli/builtin/hf/download.js.map +1 -0
  123. package/dist/commands/cli/builtin/hf/env.d.ts +12 -0
  124. package/dist/commands/cli/builtin/hf/env.d.ts.map +1 -0
  125. package/dist/commands/cli/builtin/hf/env.js +37 -0
  126. package/dist/commands/cli/builtin/hf/env.js.map +1 -0
  127. package/dist/commands/cli/builtin/hf/files.d.ts +11 -0
  128. package/dist/commands/cli/builtin/hf/files.d.ts.map +1 -0
  129. package/dist/commands/cli/builtin/hf/files.js +43 -0
  130. package/dist/commands/cli/builtin/hf/files.js.map +1 -0
  131. package/dist/commands/cli/builtin/hf/index.d.ts +3 -0
  132. package/dist/commands/cli/builtin/hf/index.d.ts.map +1 -0
  133. package/dist/commands/cli/builtin/hf/index.js +286 -0
  134. package/dist/commands/cli/builtin/hf/index.js.map +1 -0
  135. package/dist/commands/cli/builtin/hf/repo.d.ts +16 -0
  136. package/dist/commands/cli/builtin/hf/repo.d.ts.map +1 -0
  137. package/dist/commands/cli/builtin/hf/repo.js +97 -0
  138. package/dist/commands/cli/builtin/hf/repo.js.map +1 -0
  139. package/dist/commands/cli/builtin/hf/upload.d.ts +21 -0
  140. package/dist/commands/cli/builtin/hf/upload.d.ts.map +1 -0
  141. package/dist/commands/cli/builtin/hf/upload.js +178 -0
  142. package/dist/commands/cli/builtin/hf/upload.js.map +1 -0
  143. package/dist/commands/cli/builtin/himalaya/builder.d.ts +65 -0
  144. package/dist/commands/cli/builtin/himalaya/builder.d.ts.map +1 -0
  145. package/dist/commands/cli/builtin/himalaya/builder.js +197 -0
  146. package/dist/commands/cli/builtin/himalaya/builder.js.map +1 -0
  147. package/dist/commands/cli/builtin/himalaya/compose.d.ts +4 -0
  148. package/dist/commands/cli/builtin/himalaya/compose.d.ts.map +1 -0
  149. package/dist/commands/cli/builtin/himalaya/compose.js +19 -0
  150. package/dist/commands/cli/builtin/himalaya/compose.js.map +1 -0
  151. package/dist/commands/cli/builtin/himalaya/deliver.d.ts +49 -0
  152. package/dist/commands/cli/builtin/himalaya/deliver.d.ts.map +1 -0
  153. package/dist/commands/cli/builtin/himalaya/deliver.js +94 -0
  154. package/dist/commands/cli/builtin/himalaya/deliver.js.map +1 -0
  155. package/dist/commands/cli/builtin/himalaya/forward.d.ts +4 -0
  156. package/dist/commands/cli/builtin/himalaya/forward.d.ts.map +1 -0
  157. package/dist/commands/cli/builtin/himalaya/forward.js +37 -0
  158. package/dist/commands/cli/builtin/himalaya/forward.js.map +1 -0
  159. package/dist/commands/cli/builtin/himalaya/index.d.ts +3 -0
  160. package/dist/commands/cli/builtin/himalaya/index.d.ts.map +1 -0
  161. package/dist/commands/cli/builtin/himalaya/index.js +201 -0
  162. package/dist/commands/cli/builtin/himalaya/index.js.map +1 -0
  163. package/dist/commands/cli/builtin/himalaya/list.d.ts +5 -0
  164. package/dist/commands/cli/builtin/himalaya/list.d.ts.map +1 -0
  165. package/dist/commands/cli/builtin/himalaya/list.js +41 -0
  166. package/dist/commands/cli/builtin/himalaya/list.js.map +1 -0
  167. package/dist/commands/cli/builtin/himalaya/query.d.ts +38 -0
  168. package/dist/commands/cli/builtin/himalaya/query.d.ts.map +1 -0
  169. package/dist/commands/cli/builtin/himalaya/query.js +296 -0
  170. package/dist/commands/cli/builtin/himalaya/query.js.map +1 -0
  171. package/dist/commands/cli/builtin/himalaya/read.d.ts +4 -0
  172. package/dist/commands/cli/builtin/himalaya/read.d.ts.map +1 -0
  173. package/dist/commands/cli/builtin/himalaya/read.js +40 -0
  174. package/dist/commands/cli/builtin/himalaya/read.js.map +1 -0
  175. package/dist/commands/cli/builtin/himalaya/reply.d.ts +4 -0
  176. package/dist/commands/cli/builtin/himalaya/reply.d.ts.map +1 -0
  177. package/dist/commands/cli/builtin/himalaya/reply.js +37 -0
  178. package/dist/commands/cli/builtin/himalaya/reply.js.map +1 -0
  179. package/dist/commands/cli/builtin/himalaya/search.d.ts +4 -0
  180. package/dist/commands/cli/builtin/himalaya/search.d.ts.map +1 -0
  181. package/dist/commands/cli/builtin/himalaya/search.js +44 -0
  182. package/dist/commands/cli/builtin/himalaya/search.js.map +1 -0
  183. package/dist/commands/cli/builtin/himalaya/send.d.ts +4 -0
  184. package/dist/commands/cli/builtin/himalaya/send.d.ts.map +1 -0
  185. package/dist/commands/cli/builtin/himalaya/send.js +43 -0
  186. package/dist/commands/cli/builtin/himalaya/send.js.map +1 -0
  187. package/dist/commands/cli/builtin/himalaya/smtp.d.ts +20 -0
  188. package/dist/commands/cli/builtin/himalaya/smtp.d.ts.map +1 -0
  189. package/dist/commands/cli/builtin/himalaya/smtp.js +116 -0
  190. package/dist/commands/cli/builtin/himalaya/smtp.js.map +1 -0
  191. package/dist/commands/cli/builtin/himalaya/util.d.ts +17 -0
  192. package/dist/commands/cli/builtin/himalaya/util.d.ts.map +1 -0
  193. package/dist/commands/cli/builtin/himalaya/util.js +120 -0
  194. package/dist/commands/cli/builtin/himalaya/util.js.map +1 -0
  195. package/dist/commands/native_fixture.d.ts +25 -0
  196. package/dist/commands/native_fixture.d.ts.map +1 -0
  197. package/dist/commands/native_fixture.js +186 -0
  198. package/dist/commands/native_fixture.js.map +1 -0
  199. package/dist/compression_codecs.d.ts +2 -0
  200. package/dist/compression_codecs.d.ts.map +1 -0
  201. package/dist/compression_codecs.js +34 -0
  202. package/dist/compression_codecs.js.map +1 -0
  203. package/dist/config.d.ts +191 -0
  204. package/dist/config.d.ts.map +1 -0
  205. package/dist/config.js +967 -0
  206. package/dist/config.js.map +1 -0
  207. package/dist/core/disk/append.d.ts +4 -0
  208. package/dist/core/disk/append.d.ts.map +1 -0
  209. package/dist/core/disk/append.js +33 -0
  210. package/dist/core/disk/append.js.map +1 -0
  211. package/dist/core/disk/constants.d.ts +3 -0
  212. package/dist/core/disk/constants.d.ts.map +1 -0
  213. package/dist/core/disk/constants.js +16 -0
  214. package/dist/core/disk/constants.js.map +1 -0
  215. package/dist/core/disk/copy.d.ts +4 -0
  216. package/dist/core/disk/copy.d.ts.map +1 -0
  217. package/dist/core/disk/copy.js +38 -0
  218. package/dist/core/disk/copy.js.map +1 -0
  219. package/dist/core/disk/create.d.ts +4 -0
  220. package/dist/core/disk/create.d.ts.map +1 -0
  221. package/dist/core/disk/create.js +18 -0
  222. package/dist/core/disk/create.js.map +1 -0
  223. package/dist/core/disk/dest.d.ts +4 -0
  224. package/dist/core/disk/dest.d.ts.map +1 -0
  225. package/dist/core/disk/dest.js +44 -0
  226. package/dist/core/disk/dest.js.map +1 -0
  227. package/dist/core/disk/du/entries.d.ts +4 -0
  228. package/dist/core/disk/du/entries.d.ts.map +1 -0
  229. package/dist/core/disk/du/entries.js +25 -0
  230. package/dist/core/disk/du/entries.js.map +1 -0
  231. package/dist/core/disk/du/index.d.ts +3 -0
  232. package/dist/core/disk/du/index.d.ts.map +1 -0
  233. package/dist/core/disk/du/index.js +16 -0
  234. package/dist/core/disk/du/index.js.map +1 -0
  235. package/dist/core/disk/du/size.d.ts +4 -0
  236. package/dist/core/disk/du/size.d.ts.map +1 -0
  237. package/dist/core/disk/du/size.js +21 -0
  238. package/dist/core/disk/du/size.js.map +1 -0
  239. package/dist/core/disk/du/walk.d.ts +4 -0
  240. package/dist/core/disk/du/walk.d.ts.map +1 -0
  241. package/dist/core/disk/du/walk.js +82 -0
  242. package/dist/core/disk/du/walk.js.map +1 -0
  243. package/dist/core/disk/entry.d.ts +11 -0
  244. package/dist/core/disk/entry.d.ts.map +1 -0
  245. package/dist/core/disk/entry.js +42 -0
  246. package/dist/core/disk/entry.js.map +1 -0
  247. package/dist/core/disk/errors.d.ts +3 -0
  248. package/dist/core/disk/errors.d.ts.map +1 -0
  249. package/dist/core/disk/errors.js +31 -0
  250. package/dist/core/disk/errors.js.map +1 -0
  251. package/dist/core/disk/exists.d.ts +4 -0
  252. package/dist/core/disk/exists.d.ts.map +1 -0
  253. package/dist/core/disk/exists.js +26 -0
  254. package/dist/core/disk/exists.js.map +1 -0
  255. package/dist/core/disk/find.d.ts +21 -0
  256. package/dist/core/disk/find.d.ts.map +1 -0
  257. package/dist/core/disk/find.js +143 -0
  258. package/dist/core/disk/find.js.map +1 -0
  259. package/dist/core/disk/mkdir.d.ts +4 -0
  260. package/dist/core/disk/mkdir.d.ts.map +1 -0
  261. package/dist/core/disk/mkdir.js +51 -0
  262. package/dist/core/disk/mkdir.js.map +1 -0
  263. package/dist/core/disk/read.d.ts +18 -0
  264. package/dist/core/disk/read.d.ts.map +1 -0
  265. package/dist/core/disk/read.js +92 -0
  266. package/dist/core/disk/read.js.map +1 -0
  267. package/dist/core/disk/readdir.d.ts +5 -0
  268. package/dist/core/disk/readdir.d.ts.map +1 -0
  269. package/dist/core/disk/readdir.js +73 -0
  270. package/dist/core/disk/readdir.js.map +1 -0
  271. package/dist/core/disk/rename.d.ts +4 -0
  272. package/dist/core/disk/rename.d.ts.map +1 -0
  273. package/dist/core/disk/rename.js +36 -0
  274. package/dist/core/disk/rename.js.map +1 -0
  275. package/dist/core/disk/rm.d.ts +4 -0
  276. package/dist/core/disk/rm.d.ts.map +1 -0
  277. package/dist/core/disk/rm.js +22 -0
  278. package/dist/core/disk/rm.js.map +1 -0
  279. package/dist/core/disk/rmdir.d.ts +4 -0
  280. package/dist/core/disk/rmdir.d.ts.map +1 -0
  281. package/dist/core/disk/rmdir.js +29 -0
  282. package/dist/core/disk/rmdir.js.map +1 -0
  283. package/dist/core/disk/set_attrs.d.ts +11 -0
  284. package/dist/core/disk/set_attrs.d.ts.map +1 -0
  285. package/dist/core/disk/set_attrs.js +53 -0
  286. package/dist/core/disk/set_attrs.js.map +1 -0
  287. package/dist/core/disk/stat.d.ts +5 -0
  288. package/dist/core/disk/stat.d.ts.map +1 -0
  289. package/dist/core/disk/stat.js +58 -0
  290. package/dist/core/disk/stat.js.map +1 -0
  291. package/dist/core/disk/stream.d.ts +4 -0
  292. package/dist/core/disk/stream.d.ts.map +1 -0
  293. package/dist/core/disk/stream.js +40 -0
  294. package/dist/core/disk/stream.js.map +1 -0
  295. package/dist/core/disk/truncate.d.ts +4 -0
  296. package/dist/core/disk/truncate.d.ts.map +1 -0
  297. package/dist/core/disk/truncate.js +40 -0
  298. package/dist/core/disk/truncate.js.map +1 -0
  299. package/dist/core/disk/unlink.d.ts +4 -0
  300. package/dist/core/disk/unlink.d.ts.map +1 -0
  301. package/dist/core/disk/unlink.js +29 -0
  302. package/dist/core/disk/unlink.js.map +1 -0
  303. package/dist/core/disk/utils.d.ts +3 -0
  304. package/dist/core/disk/utils.d.ts.map +1 -0
  305. package/dist/core/disk/utils.js +26 -0
  306. package/dist/core/disk/utils.js.map +1 -0
  307. package/dist/core/disk/watch/constants.d.ts +3 -0
  308. package/dist/core/disk/watch/constants.d.ts.map +1 -0
  309. package/dist/core/disk/watch/constants.js +20 -0
  310. package/dist/core/disk/watch/constants.js.map +1 -0
  311. package/dist/core/disk/watch/hook.d.ts +54 -0
  312. package/dist/core/disk/watch/hook.d.ts.map +1 -0
  313. package/dist/core/disk/watch/hook.js +108 -0
  314. package/dist/core/disk/watch/hook.js.map +1 -0
  315. package/dist/core/disk/watch/index.d.ts +2 -0
  316. package/dist/core/disk/watch/index.d.ts.map +1 -0
  317. package/dist/core/disk/watch/index.js +15 -0
  318. package/dist/core/disk/watch/index.js.map +1 -0
  319. package/dist/core/disk/watch/walk.d.ts +22 -0
  320. package/dist/core/disk/watch/walk.d.ts.map +1 -0
  321. package/dist/core/disk/watch/walk.js +100 -0
  322. package/dist/core/disk/watch/walk.js.map +1 -0
  323. package/dist/core/disk/write.d.ts +4 -0
  324. package/dist/core/disk/write.d.ts.map +1 -0
  325. package/dist/core/disk/write.js +36 -0
  326. package/dist/core/disk/write.js.map +1 -0
  327. package/dist/core/email/_parse.d.ts +32 -0
  328. package/dist/core/email/_parse.d.ts.map +1 -0
  329. package/dist/core/email/_parse.js +87 -0
  330. package/dist/core/email/_parse.js.map +1 -0
  331. package/dist/core/email/client.d.ts +58 -0
  332. package/dist/core/email/client.d.ts.map +1 -0
  333. package/dist/core/email/client.js +328 -0
  334. package/dist/core/email/client.js.map +1 -0
  335. package/dist/core/email/config.d.ts +21 -0
  336. package/dist/core/email/config.d.ts.map +1 -0
  337. package/dist/core/email/config.js +55 -0
  338. package/dist/core/email/config.js.map +1 -0
  339. package/dist/core/email/folders.d.ts +3 -0
  340. package/dist/core/email/folders.d.ts.map +1 -0
  341. package/dist/core/email/folders.js +18 -0
  342. package/dist/core/email/folders.js.map +1 -0
  343. package/dist/core/email/read.d.ts +5 -0
  344. package/dist/core/email/read.d.ts.map +1 -0
  345. package/dist/core/email/read.js +41 -0
  346. package/dist/core/email/read.js.map +1 -0
  347. package/dist/core/email/readdir.d.ts +16 -0
  348. package/dist/core/email/readdir.d.ts.map +1 -0
  349. package/dist/core/email/readdir.js +222 -0
  350. package/dist/core/email/readdir.js.map +1 -0
  351. package/dist/core/email/render.d.ts +5 -0
  352. package/dist/core/email/render.d.ts.map +1 -0
  353. package/dist/core/email/render.js +42 -0
  354. package/dist/core/email/render.js.map +1 -0
  355. package/dist/core/email/scope.d.ts +3 -0
  356. package/dist/core/email/scope.d.ts.map +1 -0
  357. package/dist/core/email/scope.js +49 -0
  358. package/dist/core/email/scope.js.map +1 -0
  359. package/dist/core/email/search.d.ts +5 -0
  360. package/dist/core/email/search.d.ts.map +1 -0
  361. package/dist/core/email/search.js +67 -0
  362. package/dist/core/email/search.js.map +1 -0
  363. package/dist/core/email/stat.d.ts +5 -0
  364. package/dist/core/email/stat.d.ts.map +1 -0
  365. package/dist/core/email/stat.js +56 -0
  366. package/dist/core/email/stat.js.map +1 -0
  367. package/dist/core/gridfs/client.d.ts +37 -0
  368. package/dist/core/gridfs/client.d.ts.map +1 -0
  369. package/dist/core/gridfs/client.js +129 -0
  370. package/dist/core/gridfs/client.js.map +1 -0
  371. package/dist/core/gridfs/constants.d.ts +2 -0
  372. package/dist/core/gridfs/constants.d.ts.map +1 -0
  373. package/dist/core/gridfs/constants.js +15 -0
  374. package/dist/core/gridfs/constants.js.map +1 -0
  375. package/dist/core/gridfs/copy.d.ts +2 -0
  376. package/dist/core/gridfs/copy.d.ts.map +1 -0
  377. package/dist/core/gridfs/copy.js +18 -0
  378. package/dist/core/gridfs/copy.js.map +1 -0
  379. package/dist/core/gridfs/create.d.ts +2 -0
  380. package/dist/core/gridfs/create.d.ts.map +1 -0
  381. package/dist/core/gridfs/create.js +17 -0
  382. package/dist/core/gridfs/create.js.map +1 -0
  383. package/dist/core/gridfs/driver.d.ts +20 -0
  384. package/dist/core/gridfs/driver.d.ts.map +1 -0
  385. package/dist/core/gridfs/driver.js +284 -0
  386. package/dist/core/gridfs/driver.js.map +1 -0
  387. package/dist/core/gridfs/du/entries.d.ts +2 -0
  388. package/dist/core/gridfs/du/entries.d.ts.map +1 -0
  389. package/dist/core/gridfs/du/entries.js +17 -0
  390. package/dist/core/gridfs/du/entries.js.map +1 -0
  391. package/dist/core/gridfs/du/index.d.ts +3 -0
  392. package/dist/core/gridfs/du/index.d.ts.map +1 -0
  393. package/dist/core/gridfs/du/index.js +16 -0
  394. package/dist/core/gridfs/du/index.js.map +1 -0
  395. package/dist/core/gridfs/du/size.d.ts +2 -0
  396. package/dist/core/gridfs/du/size.d.ts.map +1 -0
  397. package/dist/core/gridfs/du/size.js +17 -0
  398. package/dist/core/gridfs/du/size.js.map +1 -0
  399. package/dist/core/gridfs/exists.d.ts +2 -0
  400. package/dist/core/gridfs/exists.d.ts.map +1 -0
  401. package/dist/core/gridfs/exists.js +17 -0
  402. package/dist/core/gridfs/exists.js.map +1 -0
  403. package/dist/core/gridfs/find.d.ts +2 -0
  404. package/dist/core/gridfs/find.d.ts.map +1 -0
  405. package/dist/core/gridfs/find.js +17 -0
  406. package/dist/core/gridfs/find.js.map +1 -0
  407. package/dist/core/gridfs/mkdir.d.ts +2 -0
  408. package/dist/core/gridfs/mkdir.d.ts.map +1 -0
  409. package/dist/core/gridfs/mkdir.js +17 -0
  410. package/dist/core/gridfs/mkdir.js.map +1 -0
  411. package/dist/core/gridfs/read.d.ts +12 -0
  412. package/dist/core/gridfs/read.d.ts.map +1 -0
  413. package/dist/core/gridfs/read.js +99 -0
  414. package/dist/core/gridfs/read.js.map +1 -0
  415. package/dist/core/gridfs/readdir.d.ts +2 -0
  416. package/dist/core/gridfs/readdir.d.ts.map +1 -0
  417. package/dist/core/gridfs/readdir.js +17 -0
  418. package/dist/core/gridfs/readdir.js.map +1 -0
  419. package/dist/core/gridfs/rename.d.ts +2 -0
  420. package/dist/core/gridfs/rename.d.ts.map +1 -0
  421. package/dist/core/gridfs/rename.js +18 -0
  422. package/dist/core/gridfs/rename.js.map +1 -0
  423. package/dist/core/gridfs/rm.d.ts +2 -0
  424. package/dist/core/gridfs/rm.d.ts.map +1 -0
  425. package/dist/core/gridfs/rm.js +17 -0
  426. package/dist/core/gridfs/rm.js.map +1 -0
  427. package/dist/core/gridfs/rmdir.d.ts +2 -0
  428. package/dist/core/gridfs/rmdir.d.ts.map +1 -0
  429. package/dist/core/gridfs/rmdir.js +17 -0
  430. package/dist/core/gridfs/rmdir.js.map +1 -0
  431. package/dist/core/gridfs/stat.d.ts +2 -0
  432. package/dist/core/gridfs/stat.d.ts.map +1 -0
  433. package/dist/core/gridfs/stat.js +17 -0
  434. package/dist/core/gridfs/stat.js.map +1 -0
  435. package/dist/core/gridfs/stream.d.ts +17 -0
  436. package/dist/core/gridfs/stream.d.ts.map +1 -0
  437. package/dist/core/gridfs/stream.js +75 -0
  438. package/dist/core/gridfs/stream.js.map +1 -0
  439. package/dist/core/gridfs/truncate.d.ts +2 -0
  440. package/dist/core/gridfs/truncate.d.ts.map +1 -0
  441. package/dist/core/gridfs/truncate.js +17 -0
  442. package/dist/core/gridfs/truncate.js.map +1 -0
  443. package/dist/core/gridfs/unlink.d.ts +2 -0
  444. package/dist/core/gridfs/unlink.d.ts.map +1 -0
  445. package/dist/core/gridfs/unlink.js +17 -0
  446. package/dist/core/gridfs/unlink.js.map +1 -0
  447. package/dist/core/gridfs/watch.d.ts +4 -0
  448. package/dist/core/gridfs/watch.d.ts.map +1 -0
  449. package/dist/core/gridfs/watch.js +68 -0
  450. package/dist/core/gridfs/watch.js.map +1 -0
  451. package/dist/core/gridfs/write.d.ts +2 -0
  452. package/dist/core/gridfs/write.d.ts.map +1 -0
  453. package/dist/core/gridfs/write.js +17 -0
  454. package/dist/core/gridfs/write.js.map +1 -0
  455. package/dist/core/hf/constants.d.ts +3 -0
  456. package/dist/core/hf/constants.d.ts.map +1 -0
  457. package/dist/core/hf/constants.js +16 -0
  458. package/dist/core/hf/constants.js.map +1 -0
  459. package/dist/core/hf/create.d.ts +2 -0
  460. package/dist/core/hf/create.d.ts.map +1 -0
  461. package/dist/core/hf/create.js +17 -0
  462. package/dist/core/hf/create.js.map +1 -0
  463. package/dist/core/hf/driver.d.ts +5 -0
  464. package/dist/core/hf/driver.d.ts.map +1 -0
  465. package/dist/core/hf/driver.js +222 -0
  466. package/dist/core/hf/driver.js.map +1 -0
  467. package/dist/core/hf/du/entries.d.ts +2 -0
  468. package/dist/core/hf/du/entries.d.ts.map +1 -0
  469. package/dist/core/hf/du/entries.js +17 -0
  470. package/dist/core/hf/du/entries.js.map +1 -0
  471. package/dist/core/hf/du/index.d.ts +3 -0
  472. package/dist/core/hf/du/index.d.ts.map +1 -0
  473. package/dist/core/hf/du/index.js +16 -0
  474. package/dist/core/hf/du/index.js.map +1 -0
  475. package/dist/core/hf/du/size.d.ts +2 -0
  476. package/dist/core/hf/du/size.d.ts.map +1 -0
  477. package/dist/core/hf/du/size.js +17 -0
  478. package/dist/core/hf/du/size.js.map +1 -0
  479. package/dist/core/hf/exists.d.ts +2 -0
  480. package/dist/core/hf/exists.d.ts.map +1 -0
  481. package/dist/core/hf/exists.js +17 -0
  482. package/dist/core/hf/exists.js.map +1 -0
  483. package/dist/core/hf/find.d.ts +2 -0
  484. package/dist/core/hf/find.d.ts.map +1 -0
  485. package/dist/core/hf/find.js +17 -0
  486. package/dist/core/hf/find.js.map +1 -0
  487. package/dist/core/hf/mkdir.d.ts +2 -0
  488. package/dist/core/hf/mkdir.d.ts.map +1 -0
  489. package/dist/core/hf/mkdir.js +17 -0
  490. package/dist/core/hf/mkdir.js.map +1 -0
  491. package/dist/core/hf/mock.d.ts +34 -0
  492. package/dist/core/hf/mock.d.ts.map +1 -0
  493. package/dist/core/hf/mock.js +147 -0
  494. package/dist/core/hf/mock.js.map +1 -0
  495. package/dist/core/hf/read.d.ts +9 -0
  496. package/dist/core/hf/read.d.ts.map +1 -0
  497. package/dist/core/hf/read.js +53 -0
  498. package/dist/core/hf/read.js.map +1 -0
  499. package/dist/core/hf/readdir.d.ts +2 -0
  500. package/dist/core/hf/readdir.d.ts.map +1 -0
  501. package/dist/core/hf/readdir.js +17 -0
  502. package/dist/core/hf/readdir.js.map +1 -0
  503. package/dist/core/hf/rm.d.ts +2 -0
  504. package/dist/core/hf/rm.d.ts.map +1 -0
  505. package/dist/core/hf/rm.js +17 -0
  506. package/dist/core/hf/rm.js.map +1 -0
  507. package/dist/core/hf/stat.d.ts +2 -0
  508. package/dist/core/hf/stat.d.ts.map +1 -0
  509. package/dist/core/hf/stat.js +17 -0
  510. package/dist/core/hf/stat.js.map +1 -0
  511. package/dist/core/hf/stream.d.ts +6 -0
  512. package/dist/core/hf/stream.d.ts.map +1 -0
  513. package/dist/core/hf/stream.js +48 -0
  514. package/dist/core/hf/stream.js.map +1 -0
  515. package/dist/core/hf/unlink.d.ts +2 -0
  516. package/dist/core/hf/unlink.d.ts.map +1 -0
  517. package/dist/core/hf/unlink.js +17 -0
  518. package/dist/core/hf/unlink.js.map +1 -0
  519. package/dist/core/hf/util.d.ts +5 -0
  520. package/dist/core/hf/util.d.ts.map +1 -0
  521. package/dist/core/hf/util.js +30 -0
  522. package/dist/core/hf/util.js.map +1 -0
  523. package/dist/core/hf/watch.d.ts +12 -0
  524. package/dist/core/hf/watch.d.ts.map +1 -0
  525. package/dist/core/hf/watch.js +28 -0
  526. package/dist/core/hf/watch.js.map +1 -0
  527. package/dist/core/hf/write.d.ts +2 -0
  528. package/dist/core/hf/write.d.ts.map +1 -0
  529. package/dist/core/hf/write.js +17 -0
  530. package/dist/core/hf/write.js.map +1 -0
  531. package/dist/core/hf_hub/account.d.ts +4 -0
  532. package/dist/core/hf_hub/account.d.ts.map +1 -0
  533. package/dist/core/hf_hub/account.js +22 -0
  534. package/dist/core/hf_hub/account.js.map +1 -0
  535. package/dist/core/hf_hub/admin.d.ts +41 -0
  536. package/dist/core/hf_hub/admin.d.ts.map +1 -0
  537. package/dist/core/hf_hub/admin.js +98 -0
  538. package/dist/core/hf_hub/admin.js.map +1 -0
  539. package/dist/core/hf_hub/cache.d.ts +47 -0
  540. package/dist/core/hf_hub/cache.d.ts.map +1 -0
  541. package/dist/core/hf_hub/cache.js +81 -0
  542. package/dist/core/hf_hub/cache.js.map +1 -0
  543. package/dist/core/hf_hub/client.d.ts +81 -0
  544. package/dist/core/hf_hub/client.d.ts.map +1 -0
  545. package/dist/core/hf_hub/client.js +197 -0
  546. package/dist/core/hf_hub/client.js.map +1 -0
  547. package/dist/core/hf_hub/commit.d.ts +54 -0
  548. package/dist/core/hf_hub/commit.d.ts.map +1 -0
  549. package/dist/core/hf_hub/commit.js +124 -0
  550. package/dist/core/hf_hub/commit.js.map +1 -0
  551. package/dist/core/hf_hub/config.d.ts +18 -0
  552. package/dist/core/hf_hub/config.d.ts.map +1 -0
  553. package/dist/core/hf_hub/config.js +33 -0
  554. package/dist/core/hf_hub/config.js.map +1 -0
  555. package/dist/core/hf_hub/constants.d.ts +18 -0
  556. package/dist/core/hf_hub/constants.d.ts.map +1 -0
  557. package/dist/core/hf_hub/constants.js +80 -0
  558. package/dist/core/hf_hub/constants.js.map +1 -0
  559. package/dist/core/hf_hub/exists.d.ts +6 -0
  560. package/dist/core/hf_hub/exists.d.ts.map +1 -0
  561. package/dist/core/hf_hub/exists.js +25 -0
  562. package/dist/core/hf_hub/exists.js.map +1 -0
  563. package/dist/core/hf_hub/lookup.d.ts +33 -0
  564. package/dist/core/hf_hub/lookup.d.ts.map +1 -0
  565. package/dist/core/hf_hub/lookup.js +80 -0
  566. package/dist/core/hf_hub/lookup.js.map +1 -0
  567. package/dist/core/hf_hub/read.d.ts +18 -0
  568. package/dist/core/hf_hub/read.d.ts.map +1 -0
  569. package/dist/core/hf_hub/read.js +54 -0
  570. package/dist/core/hf_hub/read.js.map +1 -0
  571. package/dist/core/hf_hub/readdir.d.ts +10 -0
  572. package/dist/core/hf_hub/readdir.d.ts.map +1 -0
  573. package/dist/core/hf_hub/readdir.js +35 -0
  574. package/dist/core/hf_hub/readdir.js.map +1 -0
  575. package/dist/core/hf_hub/repo.d.ts +40 -0
  576. package/dist/core/hf_hub/repo.d.ts.map +1 -0
  577. package/dist/core/hf_hub/repo.js +80 -0
  578. package/dist/core/hf_hub/repo.js.map +1 -0
  579. package/dist/core/hf_hub/stat.d.ts +6 -0
  580. package/dist/core/hf_hub/stat.d.ts.map +1 -0
  581. package/dist/core/hf_hub/stat.js +66 -0
  582. package/dist/core/hf_hub/stat.js.map +1 -0
  583. package/dist/core/hf_hub/stream.d.ts +7 -0
  584. package/dist/core/hf_hub/stream.d.ts.map +1 -0
  585. package/dist/core/hf_hub/stream.js +32 -0
  586. package/dist/core/hf_hub/stream.js.map +1 -0
  587. package/dist/core/hf_hub/tree.d.ts +105 -0
  588. package/dist/core/hf_hub/tree.d.ts.map +1 -0
  589. package/dist/core/hf_hub/tree.js +334 -0
  590. package/dist/core/hf_hub/tree.js.map +1 -0
  591. package/dist/core/hf_hub/tree_entry.d.ts +31 -0
  592. package/dist/core/hf_hub/tree_entry.d.ts.map +1 -0
  593. package/dist/core/hf_hub/tree_entry.js +17 -0
  594. package/dist/core/hf_hub/tree_entry.js.map +1 -0
  595. package/dist/core/hf_hub/watch.d.ts +4 -0
  596. package/dist/core/hf_hub/watch.d.ts.map +1 -0
  597. package/dist/core/hf_hub/watch.js +63 -0
  598. package/dist/core/hf_hub/watch.js.map +1 -0
  599. package/dist/core/nextcloud/constants.d.ts +3 -0
  600. package/dist/core/nextcloud/constants.d.ts.map +1 -0
  601. package/dist/core/nextcloud/constants.js +3 -0
  602. package/dist/core/nextcloud/constants.js.map +1 -0
  603. package/dist/core/nextcloud/copy.d.ts +4 -0
  604. package/dist/core/nextcloud/copy.d.ts.map +1 -0
  605. package/dist/core/nextcloud/copy.js +16 -0
  606. package/dist/core/nextcloud/copy.js.map +1 -0
  607. package/dist/core/nextcloud/create.d.ts +5 -0
  608. package/dist/core/nextcloud/create.d.ts.map +1 -0
  609. package/dist/core/nextcloud/create.js +5 -0
  610. package/dist/core/nextcloud/create.js.map +1 -0
  611. package/dist/core/nextcloud/du/entries.d.ts +4 -0
  612. package/dist/core/nextcloud/du/entries.d.ts.map +1 -0
  613. package/dist/core/nextcloud/du/entries.js +36 -0
  614. package/dist/core/nextcloud/du/entries.js.map +1 -0
  615. package/dist/core/nextcloud/du/index.d.ts +3 -0
  616. package/dist/core/nextcloud/du/index.d.ts.map +1 -0
  617. package/dist/core/nextcloud/du/index.js +3 -0
  618. package/dist/core/nextcloud/du/index.js.map +1 -0
  619. package/dist/core/nextcloud/du/size.d.ts +4 -0
  620. package/dist/core/nextcloud/du/size.d.ts.map +1 -0
  621. package/dist/core/nextcloud/du/size.js +28 -0
  622. package/dist/core/nextcloud/du/size.js.map +1 -0
  623. package/dist/core/nextcloud/du/walk.d.ts +4 -0
  624. package/dist/core/nextcloud/du/walk.d.ts.map +1 -0
  625. package/dist/core/nextcloud/du/walk.js +12 -0
  626. package/dist/core/nextcloud/du/walk.js.map +1 -0
  627. package/dist/core/nextcloud/exists.d.ts +4 -0
  628. package/dist/core/nextcloud/exists.d.ts.map +1 -0
  629. package/dist/core/nextcloud/exists.js +13 -0
  630. package/dist/core/nextcloud/exists.js.map +1 -0
  631. package/dist/core/nextcloud/find.d.ts +5 -0
  632. package/dist/core/nextcloud/find.d.ts.map +1 -0
  633. package/dist/core/nextcloud/find.js +230 -0
  634. package/dist/core/nextcloud/find.js.map +1 -0
  635. package/dist/core/nextcloud/mkdir.d.ts +15 -0
  636. package/dist/core/nextcloud/mkdir.d.ts.map +1 -0
  637. package/dist/core/nextcloud/mkdir.js +22 -0
  638. package/dist/core/nextcloud/mkdir.js.map +1 -0
  639. package/dist/core/nextcloud/mock.d.ts +28 -0
  640. package/dist/core/nextcloud/mock.d.ts.map +1 -0
  641. package/dist/core/nextcloud/mock.js +117 -0
  642. package/dist/core/nextcloud/mock.js.map +1 -0
  643. package/dist/core/nextcloud/read.d.ts +9 -0
  644. package/dist/core/nextcloud/read.d.ts.map +1 -0
  645. package/dist/core/nextcloud/read.js +46 -0
  646. package/dist/core/nextcloud/read.js.map +1 -0
  647. package/dist/core/nextcloud/readdir.d.ts +5 -0
  648. package/dist/core/nextcloud/readdir.d.ts.map +1 -0
  649. package/dist/core/nextcloud/readdir.js +120 -0
  650. package/dist/core/nextcloud/readdir.js.map +1 -0
  651. package/dist/core/nextcloud/rename.d.ts +4 -0
  652. package/dist/core/nextcloud/rename.d.ts.map +1 -0
  653. package/dist/core/nextcloud/rename.js +17 -0
  654. package/dist/core/nextcloud/rename.js.map +1 -0
  655. package/dist/core/nextcloud/rm.d.ts +4 -0
  656. package/dist/core/nextcloud/rm.d.ts.map +1 -0
  657. package/dist/core/nextcloud/rm.js +18 -0
  658. package/dist/core/nextcloud/rm.js.map +1 -0
  659. package/dist/core/nextcloud/rmdir.d.ts +18 -0
  660. package/dist/core/nextcloud/rmdir.d.ts.map +1 -0
  661. package/dist/core/nextcloud/rmdir.js +39 -0
  662. package/dist/core/nextcloud/rmdir.js.map +1 -0
  663. package/dist/core/nextcloud/search/client.d.ts +5 -0
  664. package/dist/core/nextcloud/search/client.d.ts.map +1 -0
  665. package/dist/core/nextcloud/search/client.js +51 -0
  666. package/dist/core/nextcloud/search/client.js.map +1 -0
  667. package/dist/core/nextcloud/search/constants.d.ts +18 -0
  668. package/dist/core/nextcloud/search/constants.d.ts.map +1 -0
  669. package/dist/core/nextcloud/search/constants.js +38 -0
  670. package/dist/core/nextcloud/search/constants.js.map +1 -0
  671. package/dist/core/nextcloud/search/index.d.ts +4 -0
  672. package/dist/core/nextcloud/search/index.d.ts.map +1 -0
  673. package/dist/core/nextcloud/search/index.js +3 -0
  674. package/dist/core/nextcloud/search/index.js.map +1 -0
  675. package/dist/core/nextcloud/search/query.d.ts +6 -0
  676. package/dist/core/nextcloud/search/query.d.ts.map +1 -0
  677. package/dist/core/nextcloud/search/query.js +181 -0
  678. package/dist/core/nextcloud/search/query.js.map +1 -0
  679. package/dist/core/nextcloud/search/response.d.ts +3 -0
  680. package/dist/core/nextcloud/search/response.d.ts.map +1 -0
  681. package/dist/core/nextcloud/search/response.js +108 -0
  682. package/dist/core/nextcloud/search/response.js.map +1 -0
  683. package/dist/core/nextcloud/search/target.d.ts +6 -0
  684. package/dist/core/nextcloud/search/target.d.ts.map +1 -0
  685. package/dist/core/nextcloud/search/target.js +54 -0
  686. package/dist/core/nextcloud/search/target.js.map +1 -0
  687. package/dist/core/nextcloud/search/types.d.ts +49 -0
  688. package/dist/core/nextcloud/search/types.d.ts.map +1 -0
  689. package/dist/core/nextcloud/search/types.js +16 -0
  690. package/dist/core/nextcloud/search/types.js.map +1 -0
  691. package/dist/core/nextcloud/stat.d.ts +6 -0
  692. package/dist/core/nextcloud/stat.d.ts.map +1 -0
  693. package/dist/core/nextcloud/stat.js +78 -0
  694. package/dist/core/nextcloud/stat.js.map +1 -0
  695. package/dist/core/nextcloud/stream.d.ts +6 -0
  696. package/dist/core/nextcloud/stream.d.ts.map +1 -0
  697. package/dist/core/nextcloud/stream.js +32 -0
  698. package/dist/core/nextcloud/stream.js.map +1 -0
  699. package/dist/core/nextcloud/truncate.d.ts +4 -0
  700. package/dist/core/nextcloud/truncate.d.ts.map +1 -0
  701. package/dist/core/nextcloud/truncate.js +24 -0
  702. package/dist/core/nextcloud/truncate.js.map +1 -0
  703. package/dist/core/nextcloud/unlink.d.ts +4 -0
  704. package/dist/core/nextcloud/unlink.d.ts.map +1 -0
  705. package/dist/core/nextcloud/unlink.js +20 -0
  706. package/dist/core/nextcloud/unlink.js.map +1 -0
  707. package/dist/core/nextcloud/util.d.ts +5 -0
  708. package/dist/core/nextcloud/util.d.ts.map +1 -0
  709. package/dist/core/nextcloud/util.js +15 -0
  710. package/dist/core/nextcloud/util.js.map +1 -0
  711. package/dist/core/nextcloud/watch.d.ts +6 -0
  712. package/dist/core/nextcloud/watch.d.ts.map +1 -0
  713. package/dist/core/nextcloud/watch.js +22 -0
  714. package/dist/core/nextcloud/watch.js.map +1 -0
  715. package/dist/core/nextcloud/write.d.ts +5 -0
  716. package/dist/core/nextcloud/write.d.ts.map +1 -0
  717. package/dist/core/nextcloud/write.js +20 -0
  718. package/dist/core/nextcloud/write.js.map +1 -0
  719. package/dist/core/opendal/types.d.ts +5 -0
  720. package/dist/core/opendal/types.d.ts.map +1 -0
  721. package/dist/core/opendal/types.js +15 -0
  722. package/dist/core/opendal/types.js.map +1 -0
  723. package/dist/core/opendal/watch.d.ts +23 -0
  724. package/dist/core/opendal/watch.d.ts.map +1 -0
  725. package/dist/core/opendal/watch.js +96 -0
  726. package/dist/core/opendal/watch.js.map +1 -0
  727. package/dist/core/ssh/append.d.ts +4 -0
  728. package/dist/core/ssh/append.d.ts.map +1 -0
  729. package/dist/core/ssh/append.js +30 -0
  730. package/dist/core/ssh/append.js.map +1 -0
  731. package/dist/core/ssh/constants.d.ts +3 -0
  732. package/dist/core/ssh/constants.d.ts.map +1 -0
  733. package/dist/core/ssh/constants.js +16 -0
  734. package/dist/core/ssh/constants.js.map +1 -0
  735. package/dist/core/ssh/copy.d.ts +4 -0
  736. package/dist/core/ssh/copy.d.ts.map +1 -0
  737. package/dist/core/ssh/copy.js +20 -0
  738. package/dist/core/ssh/copy.js.map +1 -0
  739. package/dist/core/ssh/create.d.ts +4 -0
  740. package/dist/core/ssh/create.d.ts.map +1 -0
  741. package/dist/core/ssh/create.js +18 -0
  742. package/dist/core/ssh/create.js.map +1 -0
  743. package/dist/core/ssh/du/entries.d.ts +4 -0
  744. package/dist/core/ssh/du/entries.d.ts.map +1 -0
  745. package/dist/core/ssh/du/entries.js +25 -0
  746. package/dist/core/ssh/du/entries.js.map +1 -0
  747. package/dist/core/ssh/du/index.d.ts +3 -0
  748. package/dist/core/ssh/du/index.d.ts.map +1 -0
  749. package/dist/core/ssh/du/index.js +16 -0
  750. package/dist/core/ssh/du/index.js.map +1 -0
  751. package/dist/core/ssh/du/size.d.ts +4 -0
  752. package/dist/core/ssh/du/size.d.ts.map +1 -0
  753. package/dist/core/ssh/du/size.js +20 -0
  754. package/dist/core/ssh/du/size.js.map +1 -0
  755. package/dist/core/ssh/du/walk.d.ts +4 -0
  756. package/dist/core/ssh/du/walk.d.ts.map +1 -0
  757. package/dist/core/ssh/du/walk.js +105 -0
  758. package/dist/core/ssh/du/walk.js.map +1 -0
  759. package/dist/core/ssh/entry.d.ts +11 -0
  760. package/dist/core/ssh/entry.d.ts.map +1 -0
  761. package/dist/core/ssh/entry.js +61 -0
  762. package/dist/core/ssh/entry.js.map +1 -0
  763. package/dist/core/ssh/exists.d.ts +4 -0
  764. package/dist/core/ssh/exists.d.ts.map +1 -0
  765. package/dist/core/ssh/exists.js +24 -0
  766. package/dist/core/ssh/exists.js.map +1 -0
  767. package/dist/core/ssh/find.d.ts +21 -0
  768. package/dist/core/ssh/find.d.ts.map +1 -0
  769. package/dist/core/ssh/find.js +142 -0
  770. package/dist/core/ssh/find.js.map +1 -0
  771. package/dist/core/ssh/mkdir.d.ts +4 -0
  772. package/dist/core/ssh/mkdir.d.ts.map +1 -0
  773. package/dist/core/ssh/mkdir.js +76 -0
  774. package/dist/core/ssh/mkdir.js.map +1 -0
  775. package/dist/core/ssh/read.d.ts +21 -0
  776. package/dist/core/ssh/read.d.ts.map +1 -0
  777. package/dist/core/ssh/read.js +65 -0
  778. package/dist/core/ssh/read.js.map +1 -0
  779. package/dist/core/ssh/readdir.d.ts +4 -0
  780. package/dist/core/ssh/readdir.d.ts.map +1 -0
  781. package/dist/core/ssh/readdir.js +80 -0
  782. package/dist/core/ssh/readdir.js.map +1 -0
  783. package/dist/core/ssh/rename.d.ts +4 -0
  784. package/dist/core/ssh/rename.d.ts.map +1 -0
  785. package/dist/core/ssh/rename.js +50 -0
  786. package/dist/core/ssh/rename.js.map +1 -0
  787. package/dist/core/ssh/rm.d.ts +4 -0
  788. package/dist/core/ssh/rm.d.ts.map +1 -0
  789. package/dist/core/ssh/rm.js +86 -0
  790. package/dist/core/ssh/rm.js.map +1 -0
  791. package/dist/core/ssh/rmdir.d.ts +4 -0
  792. package/dist/core/ssh/rmdir.d.ts.map +1 -0
  793. package/dist/core/ssh/rmdir.js +69 -0
  794. package/dist/core/ssh/rmdir.js.map +1 -0
  795. package/dist/core/ssh/set_attrs.d.ts +11 -0
  796. package/dist/core/ssh/set_attrs.d.ts.map +1 -0
  797. package/dist/core/ssh/set_attrs.js +81 -0
  798. package/dist/core/ssh/set_attrs.js.map +1 -0
  799. package/dist/core/ssh/stat.d.ts +4 -0
  800. package/dist/core/ssh/stat.d.ts.map +1 -0
  801. package/dist/core/ssh/stat.js +40 -0
  802. package/dist/core/ssh/stat.js.map +1 -0
  803. package/dist/core/ssh/stream.d.ts +7 -0
  804. package/dist/core/ssh/stream.d.ts.map +1 -0
  805. package/dist/core/ssh/stream.js +83 -0
  806. package/dist/core/ssh/stream.js.map +1 -0
  807. package/dist/core/ssh/truncate.d.ts +4 -0
  808. package/dist/core/ssh/truncate.d.ts.map +1 -0
  809. package/dist/core/ssh/truncate.js +33 -0
  810. package/dist/core/ssh/truncate.js.map +1 -0
  811. package/dist/core/ssh/unlink.d.ts +4 -0
  812. package/dist/core/ssh/unlink.d.ts.map +1 -0
  813. package/dist/core/ssh/unlink.js +35 -0
  814. package/dist/core/ssh/unlink.js.map +1 -0
  815. package/dist/core/ssh/utils.d.ts +12 -0
  816. package/dist/core/ssh/utils.d.ts.map +1 -0
  817. package/dist/core/ssh/utils.js +63 -0
  818. package/dist/core/ssh/utils.js.map +1 -0
  819. package/dist/core/ssh/watch.d.ts +4 -0
  820. package/dist/core/ssh/watch.d.ts.map +1 -0
  821. package/dist/core/ssh/watch.js +89 -0
  822. package/dist/core/ssh/watch.js.map +1 -0
  823. package/dist/core/ssh/write.d.ts +4 -0
  824. package/dist/core/ssh/write.d.ts.map +1 -0
  825. package/dist/core/ssh/write.js +34 -0
  826. package/dist/core/ssh/write.js.map +1 -0
  827. package/dist/fs_monkey.d.ts +11 -0
  828. package/dist/fs_monkey.d.ts.map +1 -0
  829. package/dist/fs_monkey.js +187 -0
  830. package/dist/fs_monkey.js.map +1 -0
  831. package/dist/fuse/backend.d.ts +73 -0
  832. package/dist/fuse/backend.d.ts.map +1 -0
  833. package/dist/fuse/backend.js +170 -0
  834. package/dist/fuse/backend.js.map +1 -0
  835. package/dist/fuse/core.d.ts +157 -0
  836. package/dist/fuse/core.d.ts.map +1 -0
  837. package/dist/fuse/core.js +478 -0
  838. package/dist/fuse/core.js.map +1 -0
  839. package/dist/fuse/errors.d.ts +31 -0
  840. package/dist/fuse/errors.d.ts.map +1 -0
  841. package/dist/fuse/errors.js +102 -0
  842. package/dist/fuse/errors.js.map +1 -0
  843. package/dist/fuse/fs.d.ts +58 -0
  844. package/dist/fuse/fs.d.ts.map +1 -0
  845. package/dist/fuse/fs.js +280 -0
  846. package/dist/fuse/fs.js.map +1 -0
  847. package/dist/fuse/mount.d.ts +74 -0
  848. package/dist/fuse/mount.d.ts.map +1 -0
  849. package/dist/fuse/mount.js +180 -0
  850. package/dist/fuse/mount.js.map +1 -0
  851. package/dist/fuse/platform/macos.d.ts +2 -0
  852. package/dist/fuse/platform/macos.d.ts.map +1 -0
  853. package/dist/fuse/platform/macos.js +23 -0
  854. package/dist/fuse/platform/macos.js.map +1 -0
  855. package/dist/index.d.ts +199 -2923
  856. package/dist/index.d.ts.map +1 -0
  857. package/dist/index.js +208 -4624
  858. package/dist/index.js.map +1 -1
  859. package/dist/observe/disk_store.d.ts +17 -0
  860. package/dist/observe/disk_store.d.ts.map +1 -0
  861. package/dist/observe/disk_store.js +98 -0
  862. package/dist/observe/disk_store.js.map +1 -0
  863. package/dist/observe/redis_store.d.ts +28 -0
  864. package/dist/observe/redis_store.d.ts.map +1 -0
  865. package/dist/observe/redis_store.js +100 -0
  866. package/dist/observe/redis_store.js.map +1 -0
  867. package/dist/ops/disk/index.d.ts +3 -0
  868. package/dist/ops/disk/index.d.ts.map +1 -0
  869. package/dist/ops/disk/index.js +20 -0
  870. package/dist/ops/disk/index.js.map +1 -0
  871. package/dist/ops/email/index.d.ts +3 -0
  872. package/dist/ops/email/index.d.ts.map +1 -0
  873. package/dist/ops/email/index.js +18 -0
  874. package/dist/ops/email/index.js.map +1 -0
  875. package/dist/ops/gridfs/index.d.ts +3 -0
  876. package/dist/ops/gridfs/index.d.ts.map +1 -0
  877. package/dist/ops/gridfs/index.js +18 -0
  878. package/dist/ops/gridfs/index.js.map +1 -0
  879. package/dist/ops/hf/index.d.ts +3 -0
  880. package/dist/ops/hf/index.d.ts.map +1 -0
  881. package/dist/ops/hf/index.js +18 -0
  882. package/dist/ops/hf/index.js.map +1 -0
  883. package/dist/ops/hf_hub/index.d.ts +3 -0
  884. package/dist/ops/hf_hub/index.d.ts.map +1 -0
  885. package/dist/ops/hf_hub/index.js +18 -0
  886. package/dist/ops/hf_hub/index.js.map +1 -0
  887. package/dist/ops/nextcloud/index.d.ts +3 -0
  888. package/dist/ops/nextcloud/index.d.ts.map +1 -0
  889. package/dist/ops/nextcloud/index.js +5 -0
  890. package/dist/ops/nextcloud/index.js.map +1 -0
  891. package/dist/ops/ssh/index.d.ts +3 -0
  892. package/dist/ops/ssh/index.d.ts.map +1 -0
  893. package/dist/ops/ssh/index.js +20 -0
  894. package/dist/ops/ssh/index.js.map +1 -0
  895. package/dist/optional_peer.d.ts +2 -0
  896. package/dist/optional_peer.d.ts.map +1 -0
  897. package/dist/optional_peer.js +15 -0
  898. package/dist/optional_peer.js.map +1 -0
  899. package/dist/resource/aliyun/aliyun.d.ts +8 -0
  900. package/dist/resource/aliyun/aliyun.d.ts.map +1 -0
  901. package/dist/resource/aliyun/aliyun.js +24 -0
  902. package/dist/resource/aliyun/aliyun.js.map +1 -0
  903. package/dist/resource/aliyun/config.d.ts +10 -0
  904. package/dist/resource/aliyun/config.d.ts.map +1 -0
  905. package/dist/resource/aliyun/config.js +20 -0
  906. package/dist/resource/aliyun/config.js.map +1 -0
  907. package/dist/resource/aliyun/prompt.d.ts +2 -0
  908. package/dist/resource/aliyun/prompt.d.ts.map +1 -0
  909. package/dist/resource/aliyun/prompt.js +19 -0
  910. package/dist/resource/aliyun/prompt.js.map +1 -0
  911. package/dist/resource/backblaze/backblaze.d.ts +8 -0
  912. package/dist/resource/backblaze/backblaze.d.ts.map +1 -0
  913. package/dist/resource/backblaze/backblaze.js +24 -0
  914. package/dist/resource/backblaze/backblaze.js.map +1 -0
  915. package/dist/resource/backblaze/config.d.ts +10 -0
  916. package/dist/resource/backblaze/config.d.ts.map +1 -0
  917. package/dist/resource/backblaze/config.js +20 -0
  918. package/dist/resource/backblaze/config.js.map +1 -0
  919. package/dist/resource/backblaze/prompt.d.ts +2 -0
  920. package/dist/resource/backblaze/prompt.d.ts.map +1 -0
  921. package/dist/resource/backblaze/prompt.js +19 -0
  922. package/dist/resource/backblaze/prompt.js.map +1 -0
  923. package/dist/resource/box/box.d.ts +34 -0
  924. package/dist/resource/box/box.d.ts.map +1 -0
  925. package/dist/resource/box/box.js +99 -0
  926. package/dist/resource/box/box.js.map +1 -0
  927. package/dist/resource/box/config.d.ts +43 -0
  928. package/dist/resource/box/config.d.ts.map +1 -0
  929. package/dist/resource/box/config.js +39 -0
  930. package/dist/resource/box/config.js.map +1 -0
  931. package/dist/resource/ceph/ceph.d.ts +8 -0
  932. package/dist/resource/ceph/ceph.d.ts.map +1 -0
  933. package/dist/resource/ceph/ceph.js +24 -0
  934. package/dist/resource/ceph/ceph.js.map +1 -0
  935. package/dist/resource/ceph/config.d.ts +9 -0
  936. package/dist/resource/ceph/config.d.ts.map +1 -0
  937. package/dist/resource/ceph/config.js +19 -0
  938. package/dist/resource/ceph/config.js.map +1 -0
  939. package/dist/resource/ceph/prompt.d.ts +2 -0
  940. package/dist/resource/ceph/prompt.d.ts.map +1 -0
  941. package/dist/resource/ceph/prompt.js +19 -0
  942. package/dist/resource/ceph/prompt.js.map +1 -0
  943. package/dist/resource/databricks_volume/config.d.ts +3 -0
  944. package/dist/resource/databricks_volume/config.d.ts.map +1 -0
  945. package/dist/resource/databricks_volume/config.js +15 -0
  946. package/dist/resource/databricks_volume/config.js.map +1 -0
  947. package/dist/resource/databricks_volume/databricks_volume.d.ts +45 -0
  948. package/dist/resource/databricks_volume/databricks_volume.d.ts.map +1 -0
  949. package/dist/resource/databricks_volume/databricks_volume.js +186 -0
  950. package/dist/resource/databricks_volume/databricks_volume.js.map +1 -0
  951. package/dist/resource/databricks_volume/profile.d.ts +7 -0
  952. package/dist/resource/databricks_volume/profile.d.ts.map +1 -0
  953. package/dist/resource/databricks_volume/profile.js +55 -0
  954. package/dist/resource/databricks_volume/profile.js.map +1 -0
  955. package/dist/resource/digitalocean/config.d.ts +10 -0
  956. package/dist/resource/digitalocean/config.d.ts.map +1 -0
  957. package/dist/resource/digitalocean/config.js +20 -0
  958. package/dist/resource/digitalocean/config.js.map +1 -0
  959. package/dist/resource/digitalocean/digitalocean.d.ts +8 -0
  960. package/dist/resource/digitalocean/digitalocean.d.ts.map +1 -0
  961. package/dist/resource/digitalocean/digitalocean.js +24 -0
  962. package/dist/resource/digitalocean/digitalocean.js.map +1 -0
  963. package/dist/resource/digitalocean/prompt.d.ts +2 -0
  964. package/dist/resource/digitalocean/prompt.d.ts.map +1 -0
  965. package/dist/resource/digitalocean/prompt.js +19 -0
  966. package/dist/resource/digitalocean/prompt.js.map +1 -0
  967. package/dist/resource/discord/discord.d.ts +33 -0
  968. package/dist/resource/discord/discord.d.ts.map +1 -0
  969. package/dist/resource/discord/discord.js +87 -0
  970. package/dist/resource/discord/discord.js.map +1 -0
  971. package/dist/resource/disk/disk.d.ts +55 -0
  972. package/dist/resource/disk/disk.d.ts.map +1 -0
  973. package/dist/resource/disk/disk.js +218 -0
  974. package/dist/resource/disk/disk.js.map +1 -0
  975. package/dist/resource/disk/prompt.d.ts +2 -0
  976. package/dist/resource/disk/prompt.d.ts.map +1 -0
  977. package/dist/resource/disk/prompt.js +17 -0
  978. package/dist/resource/disk/prompt.js.map +1 -0
  979. package/dist/resource/dropbox/config.d.ts +34 -0
  980. package/dist/resource/dropbox/config.d.ts.map +1 -0
  981. package/dist/resource/dropbox/config.js +31 -0
  982. package/dist/resource/dropbox/config.js.map +1 -0
  983. package/dist/resource/dropbox/dropbox.d.ts +34 -0
  984. package/dist/resource/dropbox/dropbox.d.ts.map +1 -0
  985. package/dist/resource/dropbox/dropbox.js +95 -0
  986. package/dist/resource/dropbox/dropbox.js.map +1 -0
  987. package/dist/resource/email/email.d.ts +33 -0
  988. package/dist/resource/email/email.d.ts.map +1 -0
  989. package/dist/resource/email/email.js +89 -0
  990. package/dist/resource/email/email.js.map +1 -0
  991. package/dist/resource/email/index.d.ts +3 -0
  992. package/dist/resource/email/index.d.ts.map +1 -0
  993. package/dist/resource/email/index.js +16 -0
  994. package/dist/resource/email/index.js.map +1 -0
  995. package/dist/resource/email/prompt.d.ts +3 -0
  996. package/dist/resource/email/prompt.d.ts.map +1 -0
  997. package/dist/resource/email/prompt.js +26 -0
  998. package/dist/resource/email/prompt.js.map +1 -0
  999. package/dist/resource/gcal/gcal.d.ts +32 -0
  1000. package/dist/resource/gcal/gcal.d.ts.map +1 -0
  1001. package/dist/resource/gcal/gcal.js +87 -0
  1002. package/dist/resource/gcal/gcal.js.map +1 -0
  1003. package/dist/resource/gcs/config.d.ts +36 -0
  1004. package/dist/resource/gcs/config.d.ts.map +1 -0
  1005. package/dist/resource/gcs/config.js +55 -0
  1006. package/dist/resource/gcs/config.js.map +1 -0
  1007. package/dist/resource/gcs/gcs.d.ts +8 -0
  1008. package/dist/resource/gcs/gcs.d.ts.map +1 -0
  1009. package/dist/resource/gcs/gcs.js +24 -0
  1010. package/dist/resource/gcs/gcs.js.map +1 -0
  1011. package/dist/resource/gcs/prompt.d.ts +2 -0
  1012. package/dist/resource/gcs/prompt.d.ts.map +1 -0
  1013. package/dist/resource/gcs/prompt.js +19 -0
  1014. package/dist/resource/gcs/prompt.js.map +1 -0
  1015. package/dist/resource/gdocs/gdocs.d.ts +32 -0
  1016. package/dist/resource/gdocs/gdocs.d.ts.map +1 -0
  1017. package/dist/resource/gdocs/gdocs.js +84 -0
  1018. package/dist/resource/gdocs/gdocs.js.map +1 -0
  1019. package/dist/resource/gdrive/gdrive.d.ts +34 -0
  1020. package/dist/resource/gdrive/gdrive.d.ts.map +1 -0
  1021. package/dist/resource/gdrive/gdrive.js +89 -0
  1022. package/dist/resource/gdrive/gdrive.js.map +1 -0
  1023. package/dist/resource/github/github.d.ts +37 -0
  1024. package/dist/resource/github/github.d.ts.map +1 -0
  1025. package/dist/resource/github/github.js +119 -0
  1026. package/dist/resource/github/github.js.map +1 -0
  1027. package/dist/resource/gmail/gmail.d.ts +33 -0
  1028. package/dist/resource/gmail/gmail.d.ts.map +1 -0
  1029. package/dist/resource/gmail/gmail.js +88 -0
  1030. package/dist/resource/gmail/gmail.js.map +1 -0
  1031. package/dist/resource/gridfs/config.d.ts +20 -0
  1032. package/dist/resource/gridfs/config.d.ts.map +1 -0
  1033. package/dist/resource/gridfs/config.js +42 -0
  1034. package/dist/resource/gridfs/config.js.map +1 -0
  1035. package/dist/resource/gridfs/gridfs.d.ts +50 -0
  1036. package/dist/resource/gridfs/gridfs.d.ts.map +1 -0
  1037. package/dist/resource/gridfs/gridfs.js +190 -0
  1038. package/dist/resource/gridfs/gridfs.js.map +1 -0
  1039. package/dist/resource/gridfs/prompt.d.ts +2 -0
  1040. package/dist/resource/gridfs/prompt.d.ts.map +1 -0
  1041. package/dist/resource/gridfs/prompt.js +19 -0
  1042. package/dist/resource/gridfs/prompt.js.map +1 -0
  1043. package/dist/resource/gsheets/gsheets.d.ts +32 -0
  1044. package/dist/resource/gsheets/gsheets.d.ts.map +1 -0
  1045. package/dist/resource/gsheets/gsheets.js +84 -0
  1046. package/dist/resource/gsheets/gsheets.js.map +1 -0
  1047. package/dist/resource/gslides/gslides.d.ts +32 -0
  1048. package/dist/resource/gslides/gslides.d.ts.map +1 -0
  1049. package/dist/resource/gslides/gslides.js +84 -0
  1050. package/dist/resource/gslides/gslides.js.map +1 -0
  1051. package/dist/resource/hf_buckets/base.d.ts +34 -0
  1052. package/dist/resource/hf_buckets/base.d.ts.map +1 -0
  1053. package/dist/resource/hf_buckets/base.js +117 -0
  1054. package/dist/resource/hf_buckets/base.js.map +1 -0
  1055. package/dist/resource/hf_buckets/config.d.ts +58 -0
  1056. package/dist/resource/hf_buckets/config.d.ts.map +1 -0
  1057. package/dist/resource/hf_buckets/config.js +89 -0
  1058. package/dist/resource/hf_buckets/config.js.map +1 -0
  1059. package/dist/resource/hf_buckets/hf_buckets.d.ts +16 -0
  1060. package/dist/resource/hf_buckets/hf_buckets.d.ts.map +1 -0
  1061. package/dist/resource/hf_buckets/hf_buckets.js +46 -0
  1062. package/dist/resource/hf_buckets/hf_buckets.js.map +1 -0
  1063. package/dist/resource/hf_buckets/prompt.d.ts +2 -0
  1064. package/dist/resource/hf_buckets/prompt.d.ts.map +1 -0
  1065. package/dist/resource/hf_buckets/prompt.js +18 -0
  1066. package/dist/resource/hf_buckets/prompt.js.map +1 -0
  1067. package/dist/resource/hf_datasets/hf_datasets.d.ts +16 -0
  1068. package/dist/resource/hf_datasets/hf_datasets.d.ts.map +1 -0
  1069. package/dist/resource/hf_datasets/hf_datasets.js +46 -0
  1070. package/dist/resource/hf_datasets/hf_datasets.js.map +1 -0
  1071. package/dist/resource/hf_datasets/prompt.d.ts +2 -0
  1072. package/dist/resource/hf_datasets/prompt.d.ts.map +1 -0
  1073. package/dist/resource/hf_datasets/prompt.js +18 -0
  1074. package/dist/resource/hf_datasets/prompt.js.map +1 -0
  1075. package/dist/resource/hf_hub/base.d.ts +43 -0
  1076. package/dist/resource/hf_hub/base.d.ts.map +1 -0
  1077. package/dist/resource/hf_hub/base.js +111 -0
  1078. package/dist/resource/hf_hub/base.js.map +1 -0
  1079. package/dist/resource/hf_models/config.d.ts +6 -0
  1080. package/dist/resource/hf_models/config.d.ts.map +1 -0
  1081. package/dist/resource/hf_models/config.js +17 -0
  1082. package/dist/resource/hf_models/config.js.map +1 -0
  1083. package/dist/resource/hf_models/hf_models.d.ts +16 -0
  1084. package/dist/resource/hf_models/hf_models.d.ts.map +1 -0
  1085. package/dist/resource/hf_models/hf_models.js +46 -0
  1086. package/dist/resource/hf_models/hf_models.js.map +1 -0
  1087. package/dist/resource/hf_models/prompt.d.ts +2 -0
  1088. package/dist/resource/hf_models/prompt.d.ts.map +1 -0
  1089. package/dist/resource/hf_models/prompt.js +18 -0
  1090. package/dist/resource/hf_models/prompt.js.map +1 -0
  1091. package/dist/resource/hf_spaces/hf_spaces.d.ts +16 -0
  1092. package/dist/resource/hf_spaces/hf_spaces.d.ts.map +1 -0
  1093. package/dist/resource/hf_spaces/hf_spaces.js +46 -0
  1094. package/dist/resource/hf_spaces/hf_spaces.js.map +1 -0
  1095. package/dist/resource/hf_spaces/prompt.d.ts +2 -0
  1096. package/dist/resource/hf_spaces/prompt.d.ts.map +1 -0
  1097. package/dist/resource/hf_spaces/prompt.js +18 -0
  1098. package/dist/resource/hf_spaces/prompt.js.map +1 -0
  1099. package/dist/resource/jaeger/config.d.ts +15 -0
  1100. package/dist/resource/jaeger/config.d.ts.map +1 -0
  1101. package/dist/resource/jaeger/config.js +28 -0
  1102. package/dist/resource/jaeger/config.js.map +1 -0
  1103. package/dist/resource/jaeger/jaeger.d.ts +32 -0
  1104. package/dist/resource/jaeger/jaeger.d.ts.map +1 -0
  1105. package/dist/resource/jaeger/jaeger.js +101 -0
  1106. package/dist/resource/jaeger/jaeger.js.map +1 -0
  1107. package/dist/resource/lancedb/lancedb.d.ts +37 -0
  1108. package/dist/resource/lancedb/lancedb.d.ts.map +1 -0
  1109. package/dist/resource/lancedb/lancedb.js +85 -0
  1110. package/dist/resource/lancedb/lancedb.js.map +1 -0
  1111. package/dist/resource/lancedb/store.d.ts +29 -0
  1112. package/dist/resource/lancedb/store.d.ts.map +1 -0
  1113. package/dist/resource/lancedb/store.js +159 -0
  1114. package/dist/resource/lancedb/store.js.map +1 -0
  1115. package/dist/resource/langfuse/config.d.ts +16 -0
  1116. package/dist/resource/langfuse/config.d.ts.map +1 -0
  1117. package/dist/resource/langfuse/config.js +29 -0
  1118. package/dist/resource/langfuse/config.js.map +1 -0
  1119. package/dist/resource/langfuse/langfuse.d.ts +31 -0
  1120. package/dist/resource/langfuse/langfuse.d.ts.map +1 -0
  1121. package/dist/resource/langfuse/langfuse.js +98 -0
  1122. package/dist/resource/langfuse/langfuse.js.map +1 -0
  1123. package/dist/resource/linear/linear.d.ts +33 -0
  1124. package/dist/resource/linear/linear.d.ts.map +1 -0
  1125. package/dist/resource/linear/linear.js +93 -0
  1126. package/dist/resource/linear/linear.js.map +1 -0
  1127. package/dist/resource/loader.d.ts +46 -0
  1128. package/dist/resource/loader.d.ts.map +1 -0
  1129. package/dist/resource/loader.js +127 -0
  1130. package/dist/resource/loader.js.map +1 -0
  1131. package/dist/resource/minio/config.d.ts +9 -0
  1132. package/dist/resource/minio/config.d.ts.map +1 -0
  1133. package/dist/resource/minio/config.js +19 -0
  1134. package/dist/resource/minio/config.js.map +1 -0
  1135. package/dist/resource/minio/minio.d.ts +8 -0
  1136. package/dist/resource/minio/minio.d.ts.map +1 -0
  1137. package/dist/resource/minio/minio.js +24 -0
  1138. package/dist/resource/minio/minio.js.map +1 -0
  1139. package/dist/resource/minio/prompt.d.ts +2 -0
  1140. package/dist/resource/minio/prompt.d.ts.map +1 -0
  1141. package/dist/resource/minio/prompt.js +19 -0
  1142. package/dist/resource/minio/prompt.js.map +1 -0
  1143. package/dist/resource/mongodb/mongodb.d.ts +39 -0
  1144. package/dist/resource/mongodb/mongodb.d.ts.map +1 -0
  1145. package/dist/resource/mongodb/mongodb.js +100 -0
  1146. package/dist/resource/mongodb/mongodb.js.map +1 -0
  1147. package/dist/resource/mongodb/store.d.ts +71 -0
  1148. package/dist/resource/mongodb/store.d.ts.map +1 -0
  1149. package/dist/resource/mongodb/store.js +148 -0
  1150. package/dist/resource/mongodb/store.js.map +1 -0
  1151. package/dist/resource/nextcloud/config.d.ts +14 -0
  1152. package/dist/resource/nextcloud/config.d.ts.map +1 -0
  1153. package/dist/resource/nextcloud/config.js +17 -0
  1154. package/dist/resource/nextcloud/config.js.map +1 -0
  1155. package/dist/resource/nextcloud/nextcloud.d.ts +48 -0
  1156. package/dist/resource/nextcloud/nextcloud.d.ts.map +1 -0
  1157. package/dist/resource/nextcloud/nextcloud.js +157 -0
  1158. package/dist/resource/nextcloud/nextcloud.js.map +1 -0
  1159. package/dist/resource/nextcloud/prompt.d.ts +2 -0
  1160. package/dist/resource/nextcloud/prompt.d.ts.map +1 -0
  1161. package/dist/resource/nextcloud/prompt.js +2 -0
  1162. package/dist/resource/nextcloud/prompt.js.map +1 -0
  1163. package/dist/resource/notion/notion.d.ts +32 -0
  1164. package/dist/resource/notion/notion.d.ts.map +1 -0
  1165. package/dist/resource/notion/notion.js +90 -0
  1166. package/dist/resource/notion/notion.js.map +1 -0
  1167. package/dist/resource/oci/config.d.ts +37 -0
  1168. package/dist/resource/oci/config.d.ts.map +1 -0
  1169. package/dist/resource/oci/config.js +60 -0
  1170. package/dist/resource/oci/config.js.map +1 -0
  1171. package/dist/resource/oci/oci.d.ts +8 -0
  1172. package/dist/resource/oci/oci.d.ts.map +1 -0
  1173. package/dist/resource/oci/oci.js +24 -0
  1174. package/dist/resource/oci/oci.js.map +1 -0
  1175. package/dist/resource/oci/prompt.d.ts +2 -0
  1176. package/dist/resource/oci/prompt.d.ts.map +1 -0
  1177. package/dist/resource/oci/prompt.js +19 -0
  1178. package/dist/resource/oci/prompt.js.map +1 -0
  1179. package/dist/resource/postgres/postgres.d.ts +39 -0
  1180. package/dist/resource/postgres/postgres.d.ts.map +1 -0
  1181. package/dist/resource/postgres/postgres.js +98 -0
  1182. package/dist/resource/postgres/postgres.js.map +1 -0
  1183. package/dist/resource/postgres/store.d.ts +21 -0
  1184. package/dist/resource/postgres/store.d.ts.map +1 -0
  1185. package/dist/resource/postgres/store.js +53 -0
  1186. package/dist/resource/postgres/store.js.map +1 -0
  1187. package/dist/resource/qingstor/config.d.ts +10 -0
  1188. package/dist/resource/qingstor/config.d.ts.map +1 -0
  1189. package/dist/resource/qingstor/config.js +20 -0
  1190. package/dist/resource/qingstor/config.js.map +1 -0
  1191. package/dist/resource/qingstor/prompt.d.ts +2 -0
  1192. package/dist/resource/qingstor/prompt.d.ts.map +1 -0
  1193. package/dist/resource/qingstor/prompt.js +19 -0
  1194. package/dist/resource/qingstor/prompt.js.map +1 -0
  1195. package/dist/resource/qingstor/qingstor.d.ts +8 -0
  1196. package/dist/resource/qingstor/qingstor.d.ts.map +1 -0
  1197. package/dist/resource/qingstor/qingstor.js +24 -0
  1198. package/dist/resource/qingstor/qingstor.js.map +1 -0
  1199. package/dist/resource/r2/config.d.ts +37 -0
  1200. package/dist/resource/r2/config.d.ts.map +1 -0
  1201. package/dist/resource/r2/config.js +63 -0
  1202. package/dist/resource/r2/config.js.map +1 -0
  1203. package/dist/resource/r2/prompt.d.ts +2 -0
  1204. package/dist/resource/r2/prompt.d.ts.map +1 -0
  1205. package/dist/resource/r2/prompt.js +19 -0
  1206. package/dist/resource/r2/prompt.js.map +1 -0
  1207. package/dist/resource/r2/r2.d.ts +8 -0
  1208. package/dist/resource/r2/r2.d.ts.map +1 -0
  1209. package/dist/resource/r2/r2.js +24 -0
  1210. package/dist/resource/r2/r2.js.map +1 -0
  1211. package/dist/resource/redis/redis.d.ts +30 -0
  1212. package/dist/resource/redis/redis.d.ts.map +1 -0
  1213. package/dist/resource/redis/redis.js +37 -0
  1214. package/dist/resource/redis/redis.js.map +1 -0
  1215. package/dist/resource/redis/store.d.ts +63 -0
  1216. package/dist/resource/redis/store.d.ts.map +1 -0
  1217. package/dist/resource/redis/store.js +243 -0
  1218. package/dist/resource/redis/store.js.map +1 -0
  1219. package/dist/resource/registry.d.ts +42 -0
  1220. package/dist/resource/registry.d.ts.map +1 -0
  1221. package/dist/resource/registry.js +405 -0
  1222. package/dist/resource/registry.js.map +1 -0
  1223. package/dist/resource/s3/config.d.ts +36 -0
  1224. package/dist/resource/s3/config.d.ts.map +1 -0
  1225. package/dist/resource/s3/config.js +61 -0
  1226. package/dist/resource/s3/config.js.map +1 -0
  1227. package/dist/resource/s3/mock.d.ts +17 -0
  1228. package/dist/resource/s3/mock.d.ts.map +1 -0
  1229. package/dist/resource/s3/mock.js +214 -0
  1230. package/dist/resource/s3/mock.js.map +1 -0
  1231. package/dist/resource/s3/s3.d.ts +50 -0
  1232. package/dist/resource/s3/s3.d.ts.map +1 -0
  1233. package/dist/resource/s3/s3.js +201 -0
  1234. package/dist/resource/s3/s3.js.map +1 -0
  1235. package/dist/resource/s3_alias.d.ts +112 -0
  1236. package/dist/resource/s3_alias.d.ts.map +1 -0
  1237. package/dist/resource/s3_alias.js +155 -0
  1238. package/dist/resource/s3_alias.js.map +1 -0
  1239. package/dist/resource/scaleway/config.d.ts +10 -0
  1240. package/dist/resource/scaleway/config.d.ts.map +1 -0
  1241. package/dist/resource/scaleway/config.js +20 -0
  1242. package/dist/resource/scaleway/config.js.map +1 -0
  1243. package/dist/resource/scaleway/prompt.d.ts +2 -0
  1244. package/dist/resource/scaleway/prompt.d.ts.map +1 -0
  1245. package/dist/resource/scaleway/prompt.js +19 -0
  1246. package/dist/resource/scaleway/prompt.js.map +1 -0
  1247. package/dist/resource/scaleway/scaleway.d.ts +8 -0
  1248. package/dist/resource/scaleway/scaleway.d.ts.map +1 -0
  1249. package/dist/resource/scaleway/scaleway.js +24 -0
  1250. package/dist/resource/scaleway/scaleway.js.map +1 -0
  1251. package/dist/resource/seaweedfs/config.d.ts +9 -0
  1252. package/dist/resource/seaweedfs/config.d.ts.map +1 -0
  1253. package/dist/resource/seaweedfs/config.js +19 -0
  1254. package/dist/resource/seaweedfs/config.js.map +1 -0
  1255. package/dist/resource/seaweedfs/prompt.d.ts +2 -0
  1256. package/dist/resource/seaweedfs/prompt.d.ts.map +1 -0
  1257. package/dist/resource/seaweedfs/prompt.js +19 -0
  1258. package/dist/resource/seaweedfs/prompt.js.map +1 -0
  1259. package/dist/resource/seaweedfs/seaweedfs.d.ts +8 -0
  1260. package/dist/resource/seaweedfs/seaweedfs.d.ts.map +1 -0
  1261. package/dist/resource/seaweedfs/seaweedfs.js +24 -0
  1262. package/dist/resource/seaweedfs/seaweedfs.js.map +1 -0
  1263. package/dist/resource/slack/slack.d.ts +33 -0
  1264. package/dist/resource/slack/slack.d.ts.map +1 -0
  1265. package/dist/resource/slack/slack.js +88 -0
  1266. package/dist/resource/slack/slack.js.map +1 -0
  1267. package/dist/resource/ssh/config.d.ts +20 -0
  1268. package/dist/resource/ssh/config.d.ts.map +1 -0
  1269. package/dist/resource/ssh/config.js +33 -0
  1270. package/dist/resource/ssh/config.js.map +1 -0
  1271. package/dist/resource/ssh/prompt.d.ts +2 -0
  1272. package/dist/resource/ssh/prompt.d.ts.map +1 -0
  1273. package/dist/resource/ssh/prompt.js +18 -0
  1274. package/dist/resource/ssh/prompt.js.map +1 -0
  1275. package/dist/resource/ssh/ssh.d.ts +51 -0
  1276. package/dist/resource/ssh/ssh.d.ts.map +1 -0
  1277. package/dist/resource/ssh/ssh.js +169 -0
  1278. package/dist/resource/ssh/ssh.js.map +1 -0
  1279. package/dist/resource/supabase/config.d.ts +38 -0
  1280. package/dist/resource/supabase/config.d.ts.map +1 -0
  1281. package/dist/resource/supabase/config.js +63 -0
  1282. package/dist/resource/supabase/config.js.map +1 -0
  1283. package/dist/resource/supabase/prompt.d.ts +2 -0
  1284. package/dist/resource/supabase/prompt.d.ts.map +1 -0
  1285. package/dist/resource/supabase/prompt.js +19 -0
  1286. package/dist/resource/supabase/prompt.js.map +1 -0
  1287. package/dist/resource/supabase/supabase.d.ts +8 -0
  1288. package/dist/resource/supabase/supabase.d.ts.map +1 -0
  1289. package/dist/resource/supabase/supabase.js +24 -0
  1290. package/dist/resource/supabase/supabase.js.map +1 -0
  1291. package/dist/resource/tencent/config.d.ts +10 -0
  1292. package/dist/resource/tencent/config.d.ts.map +1 -0
  1293. package/dist/resource/tencent/config.js +20 -0
  1294. package/dist/resource/tencent/config.js.map +1 -0
  1295. package/dist/resource/tencent/prompt.d.ts +2 -0
  1296. package/dist/resource/tencent/prompt.d.ts.map +1 -0
  1297. package/dist/resource/tencent/prompt.js +19 -0
  1298. package/dist/resource/tencent/prompt.js.map +1 -0
  1299. package/dist/resource/tencent/tencent.d.ts +8 -0
  1300. package/dist/resource/tencent/tencent.d.ts.map +1 -0
  1301. package/dist/resource/tencent/tencent.js +24 -0
  1302. package/dist/resource/tencent/tencent.js.map +1 -0
  1303. package/dist/resource/trello/config.d.ts +15 -0
  1304. package/dist/resource/trello/config.d.ts.map +1 -0
  1305. package/dist/resource/trello/config.js +28 -0
  1306. package/dist/resource/trello/config.js.map +1 -0
  1307. package/dist/resource/trello/trello.d.ts +32 -0
  1308. package/dist/resource/trello/trello.d.ts.map +1 -0
  1309. package/dist/resource/trello/trello.js +94 -0
  1310. package/dist/resource/trello/trello.js.map +1 -0
  1311. package/dist/resource/wasabi/config.d.ts +36 -0
  1312. package/dist/resource/wasabi/config.d.ts.map +1 -0
  1313. package/dist/resource/wasabi/config.js +60 -0
  1314. package/dist/resource/wasabi/config.js.map +1 -0
  1315. package/dist/resource/wasabi/prompt.d.ts +2 -0
  1316. package/dist/resource/wasabi/prompt.d.ts.map +1 -0
  1317. package/dist/resource/wasabi/prompt.js +19 -0
  1318. package/dist/resource/wasabi/prompt.js.map +1 -0
  1319. package/dist/resource/wasabi/wasabi.d.ts +8 -0
  1320. package/dist/resource/wasabi/wasabi.d.ts.map +1 -0
  1321. package/dist/resource/wasabi/wasabi.js +24 -0
  1322. package/dist/resource/wasabi/wasabi.js.map +1 -0
  1323. package/dist/runtime/python/local.d.ts +23 -0
  1324. package/dist/runtime/python/local.d.ts.map +1 -0
  1325. package/dist/runtime/python/local.js +98 -0
  1326. package/dist/runtime/python/local.js.map +1 -0
  1327. package/dist/runtime/sandbox/daytona/config.d.ts +14 -0
  1328. package/dist/runtime/sandbox/daytona/config.d.ts.map +1 -0
  1329. package/dist/runtime/sandbox/daytona/config.js +15 -0
  1330. package/dist/runtime/sandbox/daytona/config.js.map +1 -0
  1331. package/dist/runtime/sandbox/daytona/runtime.d.ts +28 -0
  1332. package/dist/runtime/sandbox/daytona/runtime.d.ts.map +1 -0
  1333. package/dist/runtime/sandbox/daytona/runtime.js +89 -0
  1334. package/dist/runtime/sandbox/daytona/runtime.js.map +1 -0
  1335. package/dist/runtime/sandbox/docker/config.d.ts +13 -0
  1336. package/dist/runtime/sandbox/docker/config.d.ts.map +1 -0
  1337. package/dist/runtime/sandbox/docker/config.js +15 -0
  1338. package/dist/runtime/sandbox/docker/config.js.map +1 -0
  1339. package/dist/runtime/sandbox/docker/constants.d.ts +2 -0
  1340. package/dist/runtime/sandbox/docker/constants.d.ts.map +1 -0
  1341. package/dist/runtime/sandbox/docker/constants.js +15 -0
  1342. package/dist/runtime/sandbox/docker/constants.js.map +1 -0
  1343. package/dist/runtime/sandbox/docker/runtime.d.ts +27 -0
  1344. package/dist/runtime/sandbox/docker/runtime.d.ts.map +1 -0
  1345. package/dist/runtime/sandbox/docker/runtime.js +95 -0
  1346. package/dist/runtime/sandbox/docker/runtime.js.map +1 -0
  1347. package/dist/runtime/sandbox/e2b/config.d.ts +13 -0
  1348. package/dist/runtime/sandbox/e2b/config.d.ts.map +1 -0
  1349. package/dist/runtime/sandbox/e2b/config.js +15 -0
  1350. package/dist/runtime/sandbox/e2b/config.js.map +1 -0
  1351. package/dist/runtime/sandbox/e2b/runtime.d.ts +27 -0
  1352. package/dist/runtime/sandbox/e2b/runtime.d.ts.map +1 -0
  1353. package/dist/runtime/sandbox/e2b/runtime.js +93 -0
  1354. package/dist/runtime/sandbox/e2b/runtime.js.map +1 -0
  1355. package/dist/runtime/sandbox/smolvm/config.d.ts +15 -0
  1356. package/dist/runtime/sandbox/smolvm/config.d.ts.map +1 -0
  1357. package/dist/runtime/sandbox/smolvm/config.js +15 -0
  1358. package/dist/runtime/sandbox/smolvm/config.js.map +1 -0
  1359. package/dist/runtime/sandbox/smolvm/constants.d.ts +11 -0
  1360. package/dist/runtime/sandbox/smolvm/constants.d.ts.map +1 -0
  1361. package/dist/runtime/sandbox/smolvm/constants.js +39 -0
  1362. package/dist/runtime/sandbox/smolvm/constants.js.map +1 -0
  1363. package/dist/runtime/sandbox/smolvm/runtime.d.ts +39 -0
  1364. package/dist/runtime/sandbox/smolvm/runtime.d.ts.map +1 -0
  1365. package/dist/runtime/sandbox/smolvm/runtime.js +111 -0
  1366. package/dist/runtime/sandbox/smolvm/runtime.js.map +1 -0
  1367. package/dist/runtime/sandbox/ssh/config.d.ts +25 -0
  1368. package/dist/runtime/sandbox/ssh/config.d.ts.map +1 -0
  1369. package/dist/runtime/sandbox/ssh/config.js +23 -0
  1370. package/dist/runtime/sandbox/ssh/config.js.map +1 -0
  1371. package/dist/runtime/sandbox/ssh/constants.d.ts +12 -0
  1372. package/dist/runtime/sandbox/ssh/constants.d.ts.map +1 -0
  1373. package/dist/runtime/sandbox/ssh/constants.js +32 -0
  1374. package/dist/runtime/sandbox/ssh/constants.js.map +1 -0
  1375. package/dist/runtime/sandbox/ssh/runtime.d.ts +40 -0
  1376. package/dist/runtime/sandbox/ssh/runtime.d.ts.map +1 -0
  1377. package/dist/runtime/sandbox/ssh/runtime.js +139 -0
  1378. package/dist/runtime/sandbox/ssh/runtime.js.map +1 -0
  1379. package/dist/secrets/aws.d.ts +22 -0
  1380. package/dist/secrets/aws.d.ts.map +1 -0
  1381. package/dist/secrets/aws.js +80 -0
  1382. package/dist/secrets/aws.js.map +1 -0
  1383. package/dist/secrets/config.d.ts +39 -0
  1384. package/dist/secrets/config.d.ts.map +1 -0
  1385. package/dist/secrets/config.js +95 -0
  1386. package/dist/secrets/config.js.map +1 -0
  1387. package/dist/secrets/constants.d.ts +3 -0
  1388. package/dist/secrets/constants.d.ts.map +1 -0
  1389. package/dist/secrets/constants.js +58 -0
  1390. package/dist/secrets/constants.js.map +1 -0
  1391. package/dist/secrets/dotenv.d.ts +13 -0
  1392. package/dist/secrets/dotenv.d.ts.map +1 -0
  1393. package/dist/secrets/dotenv.js +40 -0
  1394. package/dist/secrets/dotenv.js.map +1 -0
  1395. package/dist/secrets/env.d.ts +10 -0
  1396. package/dist/secrets/env.d.ts.map +1 -0
  1397. package/dist/secrets/env.js +32 -0
  1398. package/dist/secrets/env.js.map +1 -0
  1399. package/dist/secrets/onepassword.d.ts +79 -0
  1400. package/dist/secrets/onepassword.d.ts.map +1 -0
  1401. package/dist/secrets/onepassword.js +141 -0
  1402. package/dist/secrets/onepassword.js.map +1 -0
  1403. package/dist/shell/console/redis/constants.d.ts +3 -0
  1404. package/dist/shell/console/redis/constants.d.ts.map +1 -0
  1405. package/dist/shell/console/redis/constants.js +22 -0
  1406. package/dist/shell/console/redis/constants.js.map +1 -0
  1407. package/dist/shell/console/redis/index.d.ts +2 -0
  1408. package/dist/shell/console/redis/index.d.ts.map +1 -0
  1409. package/dist/shell/console/redis/index.js +15 -0
  1410. package/dist/shell/console/redis/index.js.map +1 -0
  1411. package/dist/shell/console/redis/store.d.ts +67 -0
  1412. package/dist/shell/console/redis/store.d.ts.map +1 -0
  1413. package/dist/shell/console/redis/store.js +176 -0
  1414. package/dist/shell/console/redis/store.js.map +1 -0
  1415. package/dist/test-utils.d.ts +11 -0
  1416. package/dist/test-utils.d.ts.map +1 -0
  1417. package/dist/test-utils.js +38 -0
  1418. package/dist/test-utils.js.map +1 -0
  1419. package/dist/version.d.ts +2 -0
  1420. package/dist/version.d.ts.map +1 -0
  1421. package/dist/version.js +21 -0
  1422. package/dist/version.js.map +1 -0
  1423. package/dist/workspace/fuse.d.ts +11 -0
  1424. package/dist/workspace/fuse.d.ts.map +1 -0
  1425. package/dist/workspace/fuse.js +129 -0
  1426. package/dist/workspace/fuse.js.map +1 -0
  1427. package/dist/workspace/namespace/disk.d.ts +28 -0
  1428. package/dist/workspace/namespace/disk.d.ts.map +1 -0
  1429. package/dist/workspace/namespace/disk.js +110 -0
  1430. package/dist/workspace/namespace/disk.js.map +1 -0
  1431. package/dist/workspace/namespace/redis.d.ts +31 -0
  1432. package/dist/workspace/namespace/redis.d.ts.map +1 -0
  1433. package/dist/workspace/namespace/redis.js +99 -0
  1434. package/dist/workspace/namespace/redis.js.map +1 -0
  1435. package/dist/workspace/record/disk.d.ts +47 -0
  1436. package/dist/workspace/record/disk.d.ts.map +1 -0
  1437. package/dist/workspace/record/disk.js +229 -0
  1438. package/dist/workspace/record/disk.js.map +1 -0
  1439. package/dist/workspace/session/disk.d.ts +22 -0
  1440. package/dist/workspace/session/disk.d.ts.map +1 -0
  1441. package/dist/workspace/session/disk.js +54 -0
  1442. package/dist/workspace/session/disk.js.map +1 -0
  1443. package/dist/workspace/session/redis.d.ts +32 -0
  1444. package/dist/workspace/session/redis.d.ts.map +1 -0
  1445. package/dist/workspace/session/redis.js +106 -0
  1446. package/dist/workspace/session/redis.js.map +1 -0
  1447. package/dist/workspace/store/disk.d.ts +46 -0
  1448. package/dist/workspace/store/disk.d.ts.map +1 -0
  1449. package/dist/workspace/store/disk.js +119 -0
  1450. package/dist/workspace/store/disk.js.map +1 -0
  1451. package/dist/workspace/store/redis.d.ts +43 -0
  1452. package/dist/workspace/store/redis.d.ts.map +1 -0
  1453. package/dist/workspace/store/redis.js +126 -0
  1454. package/dist/workspace/store/redis.js.map +1 -0
  1455. package/dist/workspace/workspace/kernel_mounts.d.ts +48 -0
  1456. package/dist/workspace/workspace/kernel_mounts.d.ts.map +1 -0
  1457. package/dist/workspace/workspace/kernel_mounts.js +117 -0
  1458. package/dist/workspace/workspace/kernel_mounts.js.map +1 -0
  1459. package/dist/workspace.d.ts +44 -0
  1460. package/dist/workspace.d.ts.map +1 -0
  1461. package/dist/workspace.js +127 -0
  1462. package/dist/workspace.js.map +1 -0
  1463. package/package.json +24 -9
  1464. package/dist/aliyun-S62BR3TB.js +0 -11
  1465. package/dist/aliyun-S62BR3TB.js.map +0 -1
  1466. package/dist/backblaze-4EKSW63F.js +0 -11
  1467. package/dist/backblaze-4EKSW63F.js.map +0 -1
  1468. package/dist/box-ZPLZAGMK.js +0 -8
  1469. package/dist/box-ZPLZAGMK.js.map +0 -1
  1470. package/dist/ceph-ALKLD3MO.js +0 -11
  1471. package/dist/ceph-ALKLD3MO.js.map +0 -1
  1472. package/dist/chunk-2A4YGVBM.js +0 -81
  1473. package/dist/chunk-2A4YGVBM.js.map +0 -1
  1474. package/dist/chunk-2HCYLVGY.js +0 -28
  1475. package/dist/chunk-2HCYLVGY.js.map +0 -1
  1476. package/dist/chunk-2VPZAH5Q.js +0 -20
  1477. package/dist/chunk-2VPZAH5Q.js.map +0 -1
  1478. package/dist/chunk-3JZQ6VSZ.js +0 -38
  1479. package/dist/chunk-3JZQ6VSZ.js.map +0 -1
  1480. package/dist/chunk-4IF4TGAI.js +0 -11
  1481. package/dist/chunk-4IF4TGAI.js.map +0 -1
  1482. package/dist/chunk-5H6KNEPP.js +0 -56
  1483. package/dist/chunk-5H6KNEPP.js.map +0 -1
  1484. package/dist/chunk-5K2MWDCE.js +0 -56
  1485. package/dist/chunk-5K2MWDCE.js.map +0 -1
  1486. package/dist/chunk-6SVXWRKX.js +0 -56
  1487. package/dist/chunk-6SVXWRKX.js.map +0 -1
  1488. package/dist/chunk-6VOIUGAD.js +0 -68
  1489. package/dist/chunk-6VOIUGAD.js.map +0 -1
  1490. package/dist/chunk-7JYHFXXC.js +0 -82
  1491. package/dist/chunk-7JYHFXXC.js.map +0 -1
  1492. package/dist/chunk-7VQQFWV6.js +0 -20
  1493. package/dist/chunk-7VQQFWV6.js.map +0 -1
  1494. package/dist/chunk-7ZP6TPHX.js +0 -87
  1495. package/dist/chunk-7ZP6TPHX.js.map +0 -1
  1496. package/dist/chunk-ADEXNSYU.js +0 -87
  1497. package/dist/chunk-ADEXNSYU.js.map +0 -1
  1498. package/dist/chunk-AQSYAXL4.js +0 -16
  1499. package/dist/chunk-AQSYAXL4.js.map +0 -1
  1500. package/dist/chunk-ATLXMNKD.js +0 -34
  1501. package/dist/chunk-ATLXMNKD.js.map +0 -1
  1502. package/dist/chunk-BYCUGFRF.js +0 -86
  1503. package/dist/chunk-BYCUGFRF.js.map +0 -1
  1504. package/dist/chunk-BZTVYOES.js +0 -50
  1505. package/dist/chunk-BZTVYOES.js.map +0 -1
  1506. package/dist/chunk-CRC4YWXB.js +0 -79
  1507. package/dist/chunk-CRC4YWXB.js.map +0 -1
  1508. package/dist/chunk-CTGXJHO5.js +0 -39
  1509. package/dist/chunk-CTGXJHO5.js.map +0 -1
  1510. package/dist/chunk-DCDBIXVZ.js +0 -35
  1511. package/dist/chunk-DCDBIXVZ.js.map +0 -1
  1512. package/dist/chunk-DDAFNROK.js +0 -750
  1513. package/dist/chunk-DDAFNROK.js.map +0 -1
  1514. package/dist/chunk-DQIEWEAW.js +0 -85
  1515. package/dist/chunk-DQIEWEAW.js.map +0 -1
  1516. package/dist/chunk-EBI4IHDC.js +0 -73
  1517. package/dist/chunk-EBI4IHDC.js.map +0 -1
  1518. package/dist/chunk-EIUTZ6N7.js +0 -84
  1519. package/dist/chunk-EIUTZ6N7.js.map +0 -1
  1520. package/dist/chunk-EJZG5VUF.js +0 -190
  1521. package/dist/chunk-EJZG5VUF.js.map +0 -1
  1522. package/dist/chunk-ENW5BVYN.js +0 -50
  1523. package/dist/chunk-ENW5BVYN.js.map +0 -1
  1524. package/dist/chunk-ETIAW4YD.js +0 -56
  1525. package/dist/chunk-ETIAW4YD.js.map +0 -1
  1526. package/dist/chunk-EUPXAYPB.js +0 -20
  1527. package/dist/chunk-EUPXAYPB.js.map +0 -1
  1528. package/dist/chunk-FA6YNU75.js +0 -56
  1529. package/dist/chunk-FA6YNU75.js.map +0 -1
  1530. package/dist/chunk-FFH6R5VQ.js +0 -28
  1531. package/dist/chunk-FFH6R5VQ.js.map +0 -1
  1532. package/dist/chunk-GE6H2COM.js +0 -82
  1533. package/dist/chunk-GE6H2COM.js.map +0 -1
  1534. package/dist/chunk-GMMQ3ZK4.js +0 -56
  1535. package/dist/chunk-GMMQ3ZK4.js.map +0 -1
  1536. package/dist/chunk-GSGE3M5P.js +0 -82
  1537. package/dist/chunk-GSGE3M5P.js.map +0 -1
  1538. package/dist/chunk-H64SB6VO.js +0 -335
  1539. package/dist/chunk-H64SB6VO.js.map +0 -1
  1540. package/dist/chunk-HCRYAFBI.js +0 -50
  1541. package/dist/chunk-HCRYAFBI.js.map +0 -1
  1542. package/dist/chunk-HOPUP6LA.js +0 -982
  1543. package/dist/chunk-HOPUP6LA.js.map +0 -1
  1544. package/dist/chunk-HS24BL6W.js +0 -160
  1545. package/dist/chunk-HS24BL6W.js.map +0 -1
  1546. package/dist/chunk-HVYVG5KQ.js +0 -16
  1547. package/dist/chunk-HVYVG5KQ.js.map +0 -1
  1548. package/dist/chunk-I7CPLZNW.js +0 -56
  1549. package/dist/chunk-I7CPLZNW.js.map +0 -1
  1550. package/dist/chunk-IFUCGI4I.js +0 -35
  1551. package/dist/chunk-IFUCGI4I.js.map +0 -1
  1552. package/dist/chunk-IFYXSSKR.js +0 -227
  1553. package/dist/chunk-IFYXSSKR.js.map +0 -1
  1554. package/dist/chunk-IXA4DQE4.js +0 -20
  1555. package/dist/chunk-IXA4DQE4.js.map +0 -1
  1556. package/dist/chunk-IZMKMD3O.js +0 -11
  1557. package/dist/chunk-IZMKMD3O.js.map +0 -1
  1558. package/dist/chunk-JJERW2BI.js +0 -56
  1559. package/dist/chunk-JJERW2BI.js.map +0 -1
  1560. package/dist/chunk-JQR4HVUX.js +0 -94
  1561. package/dist/chunk-JQR4HVUX.js.map +0 -1
  1562. package/dist/chunk-JXOMDLFS.js +0 -87
  1563. package/dist/chunk-JXOMDLFS.js.map +0 -1
  1564. package/dist/chunk-KIX6N7NT.js +0 -1001
  1565. package/dist/chunk-KIX6N7NT.js.map +0 -1
  1566. package/dist/chunk-L42UTDFK.js +0 -40
  1567. package/dist/chunk-L42UTDFK.js.map +0 -1
  1568. package/dist/chunk-LPDLPRPS.js +0 -11
  1569. package/dist/chunk-LPDLPRPS.js.map +0 -1
  1570. package/dist/chunk-M2UF2JHJ.js +0 -11
  1571. package/dist/chunk-M2UF2JHJ.js.map +0 -1
  1572. package/dist/chunk-MONC734W.js +0 -36
  1573. package/dist/chunk-MONC734W.js.map +0 -1
  1574. package/dist/chunk-N72RLCMU.js +0 -56
  1575. package/dist/chunk-N72RLCMU.js.map +0 -1
  1576. package/dist/chunk-ND4IWJ4V.js +0 -29
  1577. package/dist/chunk-ND4IWJ4V.js.map +0 -1
  1578. package/dist/chunk-NZ3EKGW4.js +0 -1312
  1579. package/dist/chunk-NZ3EKGW4.js.map +0 -1
  1580. package/dist/chunk-OAE57MNL.js +0 -68
  1581. package/dist/chunk-OAE57MNL.js.map +0 -1
  1582. package/dist/chunk-OHKGIQB4.js +0 -87
  1583. package/dist/chunk-OHKGIQB4.js.map +0 -1
  1584. package/dist/chunk-OQKNDS66.js +0 -7
  1585. package/dist/chunk-OQKNDS66.js.map +0 -1
  1586. package/dist/chunk-OXEQSPND.js +0 -50
  1587. package/dist/chunk-OXEQSPND.js.map +0 -1
  1588. package/dist/chunk-PKNE5J2B.js +0 -82
  1589. package/dist/chunk-PKNE5J2B.js.map +0 -1
  1590. package/dist/chunk-PSXXEGYQ.js +0 -16
  1591. package/dist/chunk-PSXXEGYQ.js.map +0 -1
  1592. package/dist/chunk-QAOVABCR.js +0 -79
  1593. package/dist/chunk-QAOVABCR.js.map +0 -1
  1594. package/dist/chunk-QQ7FP4GD.js +0 -56
  1595. package/dist/chunk-QQ7FP4GD.js.map +0 -1
  1596. package/dist/chunk-QYLVMC6B.js +0 -94
  1597. package/dist/chunk-QYLVMC6B.js.map +0 -1
  1598. package/dist/chunk-RX3XR65X.js +0 -56
  1599. package/dist/chunk-RX3XR65X.js.map +0 -1
  1600. package/dist/chunk-RYQJJB4C.js +0 -30
  1601. package/dist/chunk-RYQJJB4C.js.map +0 -1
  1602. package/dist/chunk-TUF7TCN7.js +0 -56
  1603. package/dist/chunk-TUF7TCN7.js.map +0 -1
  1604. package/dist/chunk-TUX36JY5.js +0 -56
  1605. package/dist/chunk-TUX36JY5.js.map +0 -1
  1606. package/dist/chunk-TWRQCQWU.js +0 -1153
  1607. package/dist/chunk-TWRQCQWU.js.map +0 -1
  1608. package/dist/chunk-U6DFQRG3.js +0 -20
  1609. package/dist/chunk-U6DFQRG3.js.map +0 -1
  1610. package/dist/chunk-VI5YTKNY.js +0 -20
  1611. package/dist/chunk-VI5YTKNY.js.map +0 -1
  1612. package/dist/chunk-WG5YS6TC.js +0 -872
  1613. package/dist/chunk-WG5YS6TC.js.map +0 -1
  1614. package/dist/chunk-WMJJ4WGF.js +0 -56
  1615. package/dist/chunk-WMJJ4WGF.js.map +0 -1
  1616. package/dist/chunk-WY4FNH42.js +0 -113
  1617. package/dist/chunk-WY4FNH42.js.map +0 -1
  1618. package/dist/chunk-XIG5BWWH.js +0 -75
  1619. package/dist/chunk-XIG5BWWH.js.map +0 -1
  1620. package/dist/chunk-XJBC3OYX.js +0 -11
  1621. package/dist/chunk-XJBC3OYX.js.map +0 -1
  1622. package/dist/chunk-XPRDXWK7.js +0 -93
  1623. package/dist/chunk-XPRDXWK7.js.map +0 -1
  1624. package/dist/chunk-YKRQSZS7.js +0 -96
  1625. package/dist/chunk-YKRQSZS7.js.map +0 -1
  1626. package/dist/chunk-YMBL3VJB.js +0 -87
  1627. package/dist/chunk-YMBL3VJB.js.map +0 -1
  1628. package/dist/chunk-YUJBXFYK.js +0 -1205
  1629. package/dist/chunk-YUJBXFYK.js.map +0 -1
  1630. package/dist/chunk-YZ4ZJNOL.js +0 -72
  1631. package/dist/chunk-YZ4ZJNOL.js.map +0 -1
  1632. package/dist/chunk-ZTHVEXIV.js +0 -11
  1633. package/dist/chunk-ZTHVEXIV.js.map +0 -1
  1634. package/dist/chunk-ZVSYUCYS.js +0 -120
  1635. package/dist/chunk-ZVSYUCYS.js.map +0 -1
  1636. package/dist/config-2YBCHU2W.js +0 -13
  1637. package/dist/config-2YBCHU2W.js.map +0 -1
  1638. package/dist/config-3YRGRW72.js +0 -14
  1639. package/dist/config-3YRGRW72.js.map +0 -1
  1640. package/dist/config-4GSOMUMF.js +0 -9
  1641. package/dist/config-4GSOMUMF.js.map +0 -1
  1642. package/dist/config-5YBUWFUP.js +0 -9
  1643. package/dist/config-5YBUWFUP.js.map +0 -1
  1644. package/dist/config-5ZRKJTKG.js +0 -12
  1645. package/dist/config-5ZRKJTKG.js.map +0 -1
  1646. package/dist/config-A25LTL5W.js +0 -11
  1647. package/dist/config-A25LTL5W.js.map +0 -1
  1648. package/dist/config-CLU7JABG.js +0 -9
  1649. package/dist/config-CLU7JABG.js.map +0 -1
  1650. package/dist/config-D2RF7L3N.js +0 -9
  1651. package/dist/config-D2RF7L3N.js.map +0 -1
  1652. package/dist/config-E55TKM6K.js +0 -9
  1653. package/dist/config-E55TKM6K.js.map +0 -1
  1654. package/dist/config-ELDOFRJW.js +0 -9
  1655. package/dist/config-ELDOFRJW.js.map +0 -1
  1656. package/dist/config-FPC3RBFD.js +0 -13
  1657. package/dist/config-FPC3RBFD.js.map +0 -1
  1658. package/dist/config-FPM3LAW7.js +0 -9
  1659. package/dist/config-FPM3LAW7.js.map +0 -1
  1660. package/dist/config-G3F54CS4.js +0 -14
  1661. package/dist/config-G3F54CS4.js.map +0 -1
  1662. package/dist/config-G43HRUI3.js +0 -9
  1663. package/dist/config-G43HRUI3.js.map +0 -1
  1664. package/dist/config-GG3WO5PB.js +0 -14
  1665. package/dist/config-GG3WO5PB.js.map +0 -1
  1666. package/dist/config-JUYBWAZE.js +0 -9
  1667. package/dist/config-JUYBWAZE.js.map +0 -1
  1668. package/dist/config-LJ5T6TVA.js +0 -17
  1669. package/dist/config-LJ5T6TVA.js.map +0 -1
  1670. package/dist/config-MDSAE4O3.js +0 -11
  1671. package/dist/config-MDSAE4O3.js.map +0 -1
  1672. package/dist/config-NRIOKK5T.js +0 -9
  1673. package/dist/config-NRIOKK5T.js.map +0 -1
  1674. package/dist/config-OYK2BSJK.js +0 -9
  1675. package/dist/config-OYK2BSJK.js.map +0 -1
  1676. package/dist/config-PB3KA2CE.js +0 -9
  1677. package/dist/config-PB3KA2CE.js.map +0 -1
  1678. package/dist/config-QY4IL3PH.js +0 -12
  1679. package/dist/config-QY4IL3PH.js.map +0 -1
  1680. package/dist/config-R4LAOEDS.js +0 -9
  1681. package/dist/config-R4LAOEDS.js.map +0 -1
  1682. package/dist/config-RIAAD6RW.js +0 -14
  1683. package/dist/config-RIAAD6RW.js.map +0 -1
  1684. package/dist/config-SYNEQAUB.js +0 -9
  1685. package/dist/config-SYNEQAUB.js.map +0 -1
  1686. package/dist/config-TJKGYA2B.js +0 -14
  1687. package/dist/config-TJKGYA2B.js.map +0 -1
  1688. package/dist/config-UU27ALAA.js +0 -9
  1689. package/dist/config-UU27ALAA.js.map +0 -1
  1690. package/dist/config-UURRGA7U.js +0 -13
  1691. package/dist/config-UURRGA7U.js.map +0 -1
  1692. package/dist/config-VPLHQXVE.js +0 -13
  1693. package/dist/config-VPLHQXVE.js.map +0 -1
  1694. package/dist/config-WRACCRPN.js +0 -9
  1695. package/dist/config-WRACCRPN.js.map +0 -1
  1696. package/dist/config-WVHKXEVE.js +0 -12
  1697. package/dist/config-WVHKXEVE.js.map +0 -1
  1698. package/dist/config-XU7R36IE.js +0 -14
  1699. package/dist/config-XU7R36IE.js.map +0 -1
  1700. package/dist/config-Y2KOUYSS.js +0 -9
  1701. package/dist/config-Y2KOUYSS.js.map +0 -1
  1702. package/dist/databricks_volume-CNCPTZHS.js +0 -7
  1703. package/dist/databricks_volume-CNCPTZHS.js.map +0 -1
  1704. package/dist/digitalocean-DJZOUB6Q.js +0 -11
  1705. package/dist/digitalocean-DJZOUB6Q.js.map +0 -1
  1706. package/dist/discord-ETB2CADR.js +0 -7
  1707. package/dist/discord-ETB2CADR.js.map +0 -1
  1708. package/dist/disk-WEHSTK3F.js +0 -7
  1709. package/dist/disk-WEHSTK3F.js.map +0 -1
  1710. package/dist/dropbox-XN6PGLNE.js +0 -8
  1711. package/dist/dropbox-XN6PGLNE.js.map +0 -1
  1712. package/dist/email-OV7XCP3T.js +0 -8
  1713. package/dist/email-OV7XCP3T.js.map +0 -1
  1714. package/dist/gcal-P56MRCGU.js +0 -8
  1715. package/dist/gcal-P56MRCGU.js.map +0 -1
  1716. package/dist/gcs-HFBIAE2C.js +0 -10
  1717. package/dist/gcs-HFBIAE2C.js.map +0 -1
  1718. package/dist/gdocs-LQ3UXP3J.js +0 -8
  1719. package/dist/gdocs-LQ3UXP3J.js.map +0 -1
  1720. package/dist/gdrive-N6UBYLON.js +0 -8
  1721. package/dist/gdrive-N6UBYLON.js.map +0 -1
  1722. package/dist/github-BPZREGPI.js +0 -8
  1723. package/dist/github-BPZREGPI.js.map +0 -1
  1724. package/dist/github_ci-7A4LUIZ7.js +0 -8
  1725. package/dist/github_ci-7A4LUIZ7.js.map +0 -1
  1726. package/dist/gmail-YED2MF6H.js +0 -8
  1727. package/dist/gmail-YED2MF6H.js.map +0 -1
  1728. package/dist/gridfs-CPLQ4G62.js +0 -9
  1729. package/dist/gridfs-CPLQ4G62.js.map +0 -1
  1730. package/dist/gsheets-4BNIJPQ6.js +0 -8
  1731. package/dist/gsheets-4BNIJPQ6.js.map +0 -1
  1732. package/dist/gslides-GDBYLO5A.js +0 -8
  1733. package/dist/gslides-GDBYLO5A.js.map +0 -1
  1734. package/dist/hf_buckets-FTJITQ3P.js +0 -10
  1735. package/dist/hf_buckets-FTJITQ3P.js.map +0 -1
  1736. package/dist/hf_datasets-6GXVKQD7.js +0 -10
  1737. package/dist/hf_datasets-6GXVKQD7.js.map +0 -1
  1738. package/dist/hf_models-PJPGZAC5.js +0 -10
  1739. package/dist/hf_models-PJPGZAC5.js.map +0 -1
  1740. package/dist/hf_spaces-LFNFOLBF.js +0 -10
  1741. package/dist/hf_spaces-LFNFOLBF.js.map +0 -1
  1742. package/dist/jaeger-GCA6MJ6E.js +0 -8
  1743. package/dist/jaeger-GCA6MJ6E.js.map +0 -1
  1744. package/dist/lancedb-TJ5YSJY5.js +0 -7
  1745. package/dist/lancedb-TJ5YSJY5.js.map +0 -1
  1746. package/dist/langfuse-RUMTUMXS.js +0 -8
  1747. package/dist/langfuse-RUMTUMXS.js.map +0 -1
  1748. package/dist/linear-BCE4KEAC.js +0 -7
  1749. package/dist/linear-BCE4KEAC.js.map +0 -1
  1750. package/dist/minio-5SO6KBTK.js +0 -11
  1751. package/dist/minio-5SO6KBTK.js.map +0 -1
  1752. package/dist/mongodb-L5CMN2EE.js +0 -7
  1753. package/dist/mongodb-L5CMN2EE.js.map +0 -1
  1754. package/dist/nextcloud-4O2LZVW2.js +0 -9
  1755. package/dist/nextcloud-4O2LZVW2.js.map +0 -1
  1756. package/dist/notion-RVKEAQ2M.js +0 -7
  1757. package/dist/notion-RVKEAQ2M.js.map +0 -1
  1758. package/dist/oci-OQXOIC62.js +0 -10
  1759. package/dist/oci-OQXOIC62.js.map +0 -1
  1760. package/dist/postgres-AV45GNRS.js +0 -7
  1761. package/dist/postgres-AV45GNRS.js.map +0 -1
  1762. package/dist/qingstor-W277YA4K.js +0 -11
  1763. package/dist/qingstor-W277YA4K.js.map +0 -1
  1764. package/dist/r2-FUA4IORE.js +0 -10
  1765. package/dist/r2-FUA4IORE.js.map +0 -1
  1766. package/dist/redis-LPS357NF.js +0 -8
  1767. package/dist/redis-LPS357NF.js.map +0 -1
  1768. package/dist/s3-FPNWWIVM.js +0 -8
  1769. package/dist/s3-FPNWWIVM.js.map +0 -1
  1770. package/dist/scaleway-BP3732U7.js +0 -11
  1771. package/dist/scaleway-BP3732U7.js.map +0 -1
  1772. package/dist/seaweedfs-MC6HIEP4.js +0 -11
  1773. package/dist/seaweedfs-MC6HIEP4.js.map +0 -1
  1774. package/dist/slack-JFGW7VLN.js +0 -7
  1775. package/dist/slack-JFGW7VLN.js.map +0 -1
  1776. package/dist/ssh-UYPG42LM.js +0 -8
  1777. package/dist/ssh-UYPG42LM.js.map +0 -1
  1778. package/dist/supabase-A3KUFMDC.js +0 -10
  1779. package/dist/supabase-A3KUFMDC.js.map +0 -1
  1780. package/dist/tencent-5464UQ2X.js +0 -11
  1781. package/dist/tencent-5464UQ2X.js.map +0 -1
  1782. package/dist/trello-O2KB3FUO.js +0 -8
  1783. package/dist/trello-O2KB3FUO.js.map +0 -1
  1784. package/dist/wasabi-2IKBIWNO.js +0 -10
  1785. package/dist/wasabi-2IKBIWNO.js.map +0 -1
  1786. /package/dist/{append.lua → shell/console/redis/append.lua} +0 -0
  1787. /package/dist/{cas.lua → workspace/session/cas.lua} +0 -0
package/dist/index.js CHANGED
@@ -1,4625 +1,209 @@
1
- import {
2
- BoxResource
3
- } from "./chunk-JXOMDLFS.js";
4
- import {
5
- normalizeBoxConfig,
6
- redactBoxConfig
7
- } from "./chunk-L42UTDFK.js";
8
- import {
9
- GmailResource
10
- } from "./chunk-BYCUGFRF.js";
11
- import {
12
- normalizeGoogleConfig as normalizeGoogleConfig5,
13
- redactGoogleConfig as redactGoogleConfig5
14
- } from "./chunk-LPDLPRPS.js";
15
- import {
16
- GCalResource
17
- } from "./chunk-DQIEWEAW.js";
18
- import {
19
- normalizeGoogleConfig as normalizeGoogleConfig6,
20
- redactGoogleConfig as redactGoogleConfig6
21
- } from "./chunk-ZTHVEXIV.js";
22
- import {
23
- EMAIL_COMMANDS,
24
- EMAIL_OPS,
25
- EMAIL_PROMPT,
26
- EMAIL_WRITE_PROMPT,
27
- EmailAccessor,
28
- EmailResource,
29
- fetchHeaders,
30
- fetchMessage,
31
- fetchRawMessage,
32
- listFolderEntries,
33
- listMessageUids,
34
- messageJsonBytes,
35
- messagesJsonBytes,
36
- parseRfc822
37
- } from "./chunk-TWRQCQWU.js";
38
- import {
39
- EmailConfigSchema,
40
- buildEmailConfig,
41
- normalizeEmailConfig,
42
- redactEmailConfig
43
- } from "./chunk-CRC4YWXB.js";
44
- import {
45
- GSheetsResource
46
- } from "./chunk-GSGE3M5P.js";
47
- import {
48
- normalizeGoogleConfig as normalizeGoogleConfig2,
49
- redactGoogleConfig as redactGoogleConfig2
50
- } from "./chunk-M2UF2JHJ.js";
51
- import {
52
- GSlidesResource
53
- } from "./chunk-PKNE5J2B.js";
54
- import {
55
- normalizeGoogleConfig as normalizeGoogleConfig3,
56
- redactGoogleConfig as redactGoogleConfig3
57
- } from "./chunk-4IF4TGAI.js";
58
- import {
59
- GDriveResource
60
- } from "./chunk-2A4YGVBM.js";
61
- import {
62
- normalizeGoogleConfig as normalizeGoogleConfig4,
63
- redactGoogleConfig as redactGoogleConfig4
64
- } from "./chunk-IZMKMD3O.js";
65
- import {
66
- DropboxResource
67
- } from "./chunk-ADEXNSYU.js";
68
- import {
69
- normalizeDropboxConfig,
70
- redactDropboxConfig
71
- } from "./chunk-DCDBIXVZ.js";
72
- import {
73
- JaegerResource
74
- } from "./chunk-YKRQSZS7.js";
75
- import "./chunk-2HCYLVGY.js";
76
- import {
77
- GitHubResource
78
- } from "./chunk-WY4FNH42.js";
79
- import {
80
- normalizeGitHubConfig,
81
- redactGitHubConfig
82
- } from "./chunk-FFH6R5VQ.js";
83
- import {
84
- GitHubCIResource
85
- } from "./chunk-OHKGIQB4.js";
86
- import {
87
- normalizeGitHubCIConfig,
88
- redactGitHubCIConfig
89
- } from "./chunk-ND4IWJ4V.js";
90
- import {
91
- GDocsResource
92
- } from "./chunk-GE6H2COM.js";
93
- import {
94
- normalizeGoogleConfig,
95
- redactGoogleConfig
96
- } from "./chunk-XJBC3OYX.js";
97
- import {
98
- NEXTCLOUD_COMMANDS,
99
- NEXTCLOUD_OPS,
100
- NEXTCLOUD_PROMPT,
101
- NextcloudAccessor,
102
- NextcloudResource,
103
- NextcloudWalk,
104
- buildDeltaHook
105
- } from "./chunk-NZ3EKGW4.js";
106
- import {
107
- DiscordResource
108
- } from "./chunk-EIUTZ6N7.js";
109
- import {
110
- TrelloResource
111
- } from "./chunk-QYLVMC6B.js";
112
- import {
113
- normalizeTrelloConfig,
114
- redactTrelloConfig
115
- } from "./chunk-ATLXMNKD.js";
116
- import {
117
- LinearResource
118
- } from "./chunk-XPRDXWK7.js";
119
- import {
120
- NotionResource
121
- } from "./chunk-7JYHFXXC.js";
122
- import {
123
- LangfuseResource
124
- } from "./chunk-JQR4HVUX.js";
125
- import {
126
- normalizeLangfuseConfig,
127
- redactLangfuseConfig
128
- } from "./chunk-IFUCGI4I.js";
129
- import {
130
- QINGSTOR_PROMPT,
131
- QingStorResource
132
- } from "./chunk-TUF7TCN7.js";
133
- import {
134
- PostgresResource,
135
- PostgresStore
136
- } from "./chunk-ZVSYUCYS.js";
137
- import {
138
- MongoDBResource,
139
- MongoDBStore
140
- } from "./chunk-H64SB6VO.js";
141
- import {
142
- LanceDBResource,
143
- LanceDBStore
144
- } from "./chunk-HS24BL6W.js";
145
- import {
146
- SlackResource
147
- } from "./chunk-YMBL3VJB.js";
148
- import {
149
- SSHAccessor,
150
- SSHResource,
151
- SSH_COMMANDS,
152
- SSH_OPS,
153
- SSH_PROMPT
154
- } from "./chunk-KIX6N7NT.js";
155
- import {
156
- normalizeSshConfig,
157
- redactSshConfig
158
- } from "./chunk-MONC734W.js";
159
- import {
160
- normalizeNextcloudConfig,
161
- redactNextcloudConfig
162
- } from "./chunk-RYQJJB4C.js";
163
- import {
164
- DIGITALOCEAN_PROMPT,
165
- DigitalOceanResource
166
- } from "./chunk-RX3XR65X.js";
167
- import {
168
- TENCENT_PROMPT,
169
- TencentResource
170
- } from "./chunk-FA6YNU75.js";
171
- import {
172
- redactTencentConfig,
173
- resolvedTencentEndpoint
174
- } from "./chunk-2VPZAH5Q.js";
175
- import {
176
- ALIYUN_PROMPT,
177
- AliyunResource
178
- } from "./chunk-I7CPLZNW.js";
179
- import {
180
- redactAliyunConfig,
181
- resolvedAliyunEndpoint
182
- } from "./chunk-U6DFQRG3.js";
183
- import {
184
- SCALEWAY_PROMPT,
185
- ScalewayResource
186
- } from "./chunk-6SVXWRKX.js";
187
- import {
188
- redactScalewayConfig,
189
- resolvedScalewayEndpoint
190
- } from "./chunk-7VQQFWV6.js";
191
- import {
192
- redactQingStorConfig,
193
- resolvedQingStorEndpoint
194
- } from "./chunk-IXA4DQE4.js";
195
- import {
196
- SEAWEEDFS_PROMPT,
197
- SeaweedFSResource
198
- } from "./chunk-TUX36JY5.js";
199
- import {
200
- CEPH_PROMPT,
201
- CephResource
202
- } from "./chunk-N72RLCMU.js";
203
- import {
204
- redactCephConfig
205
- } from "./chunk-PSXXEGYQ.js";
206
- import {
207
- WASABI_PROMPT,
208
- WasabiResource
209
- } from "./chunk-5H6KNEPP.js";
210
- import {
211
- redactWasabiConfig,
212
- resolvedWasabiEndpoint
213
- } from "./chunk-YZ4ZJNOL.js";
214
- import {
215
- BACKBLAZE_PROMPT,
216
- BackblazeResource
217
- } from "./chunk-QQ7FP4GD.js";
218
- import {
219
- redactBackblazeConfig,
220
- resolvedBackblazeEndpoint
221
- } from "./chunk-EUPXAYPB.js";
222
- import {
223
- redactDigitalOceanConfig,
224
- resolvedDigitalOceanEndpoint
225
- } from "./chunk-VI5YTKNY.js";
226
- import {
227
- HF_BUCKETS_PROMPT,
228
- HfBucketsResource
229
- } from "./chunk-BZTVYOES.js";
230
- import {
231
- HF_DATASETS_PROMPT,
232
- HfDatasetsResource
233
- } from "./chunk-HCRYAFBI.js";
234
- import {
235
- HF_MODELS_PROMPT,
236
- HfModelsResource
237
- } from "./chunk-OXEQSPND.js";
238
- import {
239
- HF_SPACES_PROMPT,
240
- HfSpacesResource
241
- } from "./chunk-ENW5BVYN.js";
242
- import {
243
- HF_COMMANDS,
244
- HF_OPS,
245
- HF_RESOURCES,
246
- HfAccessor,
247
- HfBucketsAccessor,
248
- HfDatasetsAccessor,
249
- HfModelsAccessor,
250
- HfSpacesAccessor
251
- } from "./chunk-DDAFNROK.js";
252
- import {
253
- HF_ENDPOINT,
254
- assertHfRepoId,
255
- normalizeHfBucketsConfig,
256
- normalizeHfRepoConfig,
257
- redactHfBucketsConfig,
258
- redactHfRepoConfig
259
- } from "./chunk-QAOVABCR.js";
260
- import {
261
- MINIO_PROMPT,
262
- MinIOResource
263
- } from "./chunk-JJERW2BI.js";
264
- import {
265
- redactMinIOConfig
266
- } from "./chunk-HVYVG5KQ.js";
267
- import {
268
- redactSeaweedFSConfig
269
- } from "./chunk-AQSYAXL4.js";
270
- import "./chunk-7ZP6TPHX.js";
271
- import {
272
- GCSResource,
273
- GCS_PROMPT
274
- } from "./chunk-5K2MWDCE.js";
275
- import {
276
- GCS_ENDPOINT,
277
- redactGcsConfig
278
- } from "./chunk-OAE57MNL.js";
279
- import {
280
- OCIResource,
281
- OCI_PROMPT
282
- } from "./chunk-GMMQ3ZK4.js";
283
- import {
284
- redactOciConfig
285
- } from "./chunk-6VOIUGAD.js";
286
- import {
287
- R2Resource,
288
- R2_PROMPT
289
- } from "./chunk-WMJJ4WGF.js";
290
- import {
291
- redactR2Config
292
- } from "./chunk-XIG5BWWH.js";
293
- import {
294
- SUPABASE_PROMPT,
295
- SupabaseResource
296
- } from "./chunk-ETIAW4YD.js";
297
- import {
298
- redactSupabaseConfig,
299
- resolvedSupabaseEndpoint
300
- } from "./chunk-EBI4IHDC.js";
301
- import {
302
- DISK_COMMANDS,
303
- DISK_OPS,
304
- DISK_PROMPT,
305
- DiskResource
306
- } from "./chunk-WG5YS6TC.js";
307
- import {
308
- REDIS_COMMANDS,
309
- REDIS_OPS,
310
- REDIS_PROMPT,
311
- RedisAccessor,
312
- RedisResource,
313
- RedisStore,
314
- stat
315
- } from "./chunk-HOPUP6LA.js";
316
- import {
317
- S3Resource
318
- } from "./chunk-EJZG5VUF.js";
319
- import {
320
- normalizeS3Config,
321
- redactConfig
322
- } from "./chunk-3JZQ6VSZ.js";
323
- import {
324
- GRIDFS_COMMANDS,
325
- GridFSAccessor,
326
- GridFSResource
327
- } from "./chunk-YUJBXFYK.js";
328
- import {
329
- loadOptionalPeer
330
- } from "./chunk-OQKNDS66.js";
331
- import {
332
- normalizeGridFSConfig
333
- } from "./chunk-CTGXJHO5.js";
334
- import {
335
- DatabricksVolumeResource,
336
- loadDatabricksProfile,
337
- parseDatabricksCfg
338
- } from "./chunk-IFYXSSKR.js";
339
-
340
- // src/index.ts
341
- export * from "@struktoai/mirage-core";
342
-
343
- // src/workspace.ts
344
- import { readFileSync } from "fs";
345
- import { createRequire as createRequire2 } from "module";
346
- import {
347
- createShellParser,
348
- KERNEL_BACKENDS as KERNEL_BACKENDS2,
349
- MountBackend as MountBackend3,
350
- Workspace as CoreWorkspace
351
- } from "@struktoai/mirage-core";
352
-
353
- // src/workspace/fuse.ts
354
- import { rmdirSync } from "fs";
355
-
356
- // src/fuse/mount.ts
357
- import { execSync } from "child_process";
358
- import { randomBytes } from "crypto";
359
- import { mkdirSync, mkdtempSync } from "fs";
360
- import { tmpdir } from "os";
361
- import { basename, join } from "path";
362
- import { MountBackend as MountBackend2 } from "@struktoai/mirage-core";
363
-
364
- // src/fuse/backend.ts
365
- import { posix } from "path";
366
- import {
367
- KERNEL_BACKENDS,
368
- MountBackend,
369
- MountMode,
370
- rstripSlash,
371
- sizesAlwaysKnown
372
- } from "@struktoai/mirage-core";
373
- var FSKIT_MOUNT_ROOT = "/Volumes";
374
- function resolveBackend(value) {
375
- if (value === void 0 || value === null || value === "") return MountBackend.VFS;
376
- const lowered = value.toLowerCase();
377
- if (!Object.values(MountBackend).includes(lowered)) {
378
- throw new Error(
379
- `unknown mount backend ${JSON.stringify(value)}; expected one of: ${Object.values(
380
- MountBackend
381
- ).join(", ")}`
382
- );
383
- }
384
- return lowered;
385
- }
386
- function requireKernelBackend(backend) {
387
- if (!KERNEL_BACKENDS.includes(backend)) {
388
- throw new Error(
389
- `backend ${JSON.stringify(backend)} does not register a mountpoint; it is served inside mirage's own filesystem, so there is nothing to mount`
390
- );
391
- }
392
- }
393
- function checkPlatform(backend) {
394
- if (backend !== MountBackend.FSKIT) return;
395
- if (process.platform !== "darwin") {
396
- throw new Error(
397
- `the fskit mount backend is macOS-only (running on ${process.platform}); use backend 'fuse'`
398
- );
399
- }
400
- }
401
- function checkMountpoint(backend, mountpoint) {
402
- if (backend !== MountBackend.FSKIT) return;
403
- const resolved = posix.normalize(mountpoint);
404
- if (resolved !== FSKIT_MOUNT_ROOT && !resolved.startsWith(FSKIT_MOUNT_ROOT + "/")) {
405
- throw new Error(
406
- `the fskit mount backend only mounts under ${FSKIT_MOUNT_ROOT}; got ${JSON.stringify(mountpoint)}`
407
- );
408
- }
409
- }
410
- function unsizedMounts(ws, rootPrefix = "") {
411
- const root = rstripSlash(rootPrefix);
412
- const found = [];
413
- for (const m of ws.mounts()) {
414
- const bare = rstripSlash(m.prefix);
415
- if (root !== "" && bare !== root && !m.prefix.startsWith(root + "/")) continue;
416
- if (!sizesAlwaysKnown(m.resource)) found.push([m.prefix, m.resource.kind]);
417
- }
418
- return found;
419
- }
420
- function checkSizes(backend, ws, rootPrefix = "") {
421
- if (backend !== MountBackend.FSKIT) return;
422
- const offenders = unsizedMounts(ws, rootPrefix);
423
- if (offenders.length === 0) return;
424
- const listed = offenders.map(([prefix, kind]) => `${prefix} (${kind})`).join(", ");
425
- console.warn(
426
- `mirage: the fskit mount backend cannot serve resources whose file sizes are only known after a read; size-unknown files under these mounts will read as empty: ${listed}. Mount them with backend 'fuse', or scope the fskit mount to a byte-store resource (ram, disk, redis, s3, gridfs).`
427
- );
428
- }
429
- function writableMounts(ws, rootPrefix = "") {
430
- const root = rstripSlash(rootPrefix);
431
- const found = [];
432
- for (const m of ws.mounts()) {
433
- const bare = rstripSlash(m.prefix);
434
- if (root !== "" && bare !== root && !m.prefix.startsWith(root + "/")) continue;
435
- if (m.mode !== MountMode.READ) found.push([m.prefix, m.resource.kind]);
436
- }
437
- return found;
438
- }
439
- function checkWrites(backend, ws, rootPrefix = "") {
440
- if (backend !== MountBackend.FSKIT) return;
441
- const offenders = writableMounts(ws, rootPrefix).filter(
442
- ([prefix]) => rstripSlash(prefix) !== "/dev"
443
- );
444
- if (offenders.length === 0) return;
445
- const listed = offenders.map(([prefix, kind]) => `${prefix} (${kind})`).join(", ");
446
- console.warn(
447
- `mirage: file data written through an fskit mount may be flushed by the macFUSE FSKit shim as zeroed pages (metadata ops are reliable; the writer sees no error): ${listed}. Mount them read-only, or use backend 'fuse' for writes.`
448
- );
449
- }
450
- function prepareBackend(value, ws, mountpoint, rootPrefix = "") {
451
- const backend = resolveBackend(value);
452
- requireKernelBackend(backend);
453
- checkPlatform(backend);
454
- if (mountpoint !== void 0) checkMountpoint(backend, mountpoint);
455
- if (ws !== void 0) {
456
- checkSizes(backend, ws, rootPrefix);
457
- checkWrites(backend, ws, rootPrefix);
458
- }
459
- return backend;
460
- }
461
-
462
- // src/fuse/fs.ts
463
- import { runWithSession } from "@struktoai/mirage-core";
464
-
465
- // src/fuse/core.ts
466
- import { posix as posix2 } from "path";
467
- import {
468
- DIR_MODE,
469
- FILE_MODE,
470
- FileTable,
471
- FileType,
472
- isMissingOp,
473
- mergeWrites,
474
- mtimeMs,
475
- rstripSlash as rstripSlash2,
476
- compareCodePoints
477
- } from "@struktoai/mirage-core";
478
-
479
- // src/fuse/errors.ts
480
- import { constants as osConstants } from "os";
481
- import { classify } from "@struktoai/mirage-core";
482
- var ENOENT = 2;
483
- var EIO = 5;
484
- var EACCES = 13;
485
- var EEXIST = 17;
486
- var EINVAL = 22;
487
- var ENOTDIR = 20;
488
- var EISDIR = 21;
489
- var EROFS = 30;
490
- var ENOTEMPTY = 66;
491
- var EXDEV = 18;
492
- var CONDITION_ERRNO = {
493
- ENOENT,
494
- ENOTDIR,
495
- EISDIR,
496
- EEXIST,
497
- EACCES,
498
- EPERM: osConstants.errno.EPERM,
499
- ENOTEMPTY,
500
- EXDEV,
501
- CROSS_MOUNT: EXDEV,
502
- ENOTSUP: osConstants.errno.ENOTSUP,
503
- ELOOP: osConstants.errno.ELOOP,
504
- EINVAL,
505
- EIO,
506
- EBUSY: osConstants.errno.EBUSY,
507
- EROFS,
508
- NO_XATTR: osConstants.errno.ENODATA
509
- };
510
- var MESSAGE_ERRNO = [
511
- [["not empty", "enotempty"], ENOTEMPTY],
512
- [["not a directory", "enotdir"], ENOTDIR],
513
- [["is a directory", "eisdir"], EISDIR],
514
- // A session capability rejection (MountNotAllowedError) is a permission
515
- // failure, mirroring Python's PermissionError -> EACCES.
516
- [["not allowed to access mount"], EACCES],
517
- [["permission", "eacces", "read-only"], EACCES],
518
- [["file exists", "eexist"], EEXIST],
519
- [["not found", "no such", "enoent", "no mount"], ENOENT]
520
- ];
521
- function classifyErrno(err) {
522
- const condition = classify(err);
523
- if (condition !== null) return CONDITION_ERRNO[condition];
524
- const code = err.code;
525
- if (code !== void 0) {
526
- const errnos = osConstants.errno;
527
- const passthrough = errnos[code];
528
- if (passthrough !== void 0) return passthrough;
529
- }
530
- const msg = (err instanceof Error ? err.message : String(err)).toLowerCase();
531
- for (const [needles, errno] of MESSAGE_ERRNO) {
532
- if (needles.some((n) => msg.includes(n))) return errno;
533
- }
534
- return EIO;
535
- }
536
- function classifyError(err) {
537
- return -classifyErrno(err);
538
- }
539
- function errnoError(code, message) {
540
- return Object.assign(new Error(message), { code });
541
- }
542
-
543
- // src/fuse/platform/macos.ts
544
- var MACOS_METADATA = /* @__PURE__ */ new Set([
545
- ".DS_Store",
546
- ".Spotlight-V100",
547
- ".fseventsd",
548
- ".Trashes"
549
- ]);
550
- function isMacosMetadata(name) {
551
- return MACOS_METADATA.has(name) || name.startsWith("._");
552
- }
553
-
554
- // src/fuse/core.ts
555
- var PREFETCH_TTL_MS = 3e4;
556
- var MountCore = class {
557
- ops;
558
- session;
559
- now;
560
- root;
561
- handles = new FileTable();
562
- // In-memory extended attributes, keyed by path. Backends have no POSIX
563
- // xattrs, so these are advisory and never persisted; see setxattr.
564
- xattrs = /* @__PURE__ */ new Map();
565
- prefetchCache = /* @__PURE__ */ new Map();
566
- prefetchInflight = /* @__PURE__ */ new Map();
567
- uid;
568
- gid;
569
- constructor(ops, options = {}) {
570
- this.ops = ops;
571
- this.now = /* @__PURE__ */ new Date();
572
- this.root = options.rootPrefix !== void 0 ? rstripSlash2(options.rootPrefix) : "";
573
- this.uid = typeof process.getuid === "function" ? process.getuid() : 0;
574
- this.gid = typeof process.getgid === "function" ? process.getgid() : 0;
575
- this.session = options.session ?? null;
576
- }
577
- // ── helpers ──────────────────────────────────────────────────────
578
- resolve(path4) {
579
- if (this.root === "") return path4;
580
- return path4 === "/" ? this.root : this.root + path4;
581
- }
582
- dirStat() {
583
- return {
584
- mtime: this.now,
585
- atime: this.now,
586
- ctime: this.now,
587
- nlink: 2,
588
- size: 0,
589
- mode: DIR_MODE,
590
- uid: this.uid,
591
- gid: this.gid
592
- };
593
- }
594
- fileStat(size) {
595
- return {
596
- mtime: this.now,
597
- atime: this.now,
598
- ctime: this.now,
599
- nlink: 1,
600
- size,
601
- mode: FILE_MODE,
602
- uid: this.uid,
603
- gid: this.gid
604
- };
605
- }
606
- /**
607
- * Fold merged stat attributes into an attr record. The workspace stat
608
- * already carries the namespace overlay (chmod bits, chown ids, touched
609
- * mtime), so honoring these fields here is what makes metadata ops
610
- * visible through a mount. String uid/gid (names) are skipped: the kernel
611
- * wants numeric ids and there is no user db to map against.
612
- */
613
- applyStatAttrs(entry, s) {
614
- if (s.mode !== null) {
615
- entry.mode = entry.mode & ~4095 | s.mode & 4095;
616
- }
617
- if (typeof s.uid === "number") entry.uid = s.uid;
618
- if (typeof s.gid === "number") entry.gid = s.gid;
619
- if (s.modified !== null) {
620
- const ms = mtimeMs(s);
621
- if (ms !== null) {
622
- entry.mtime = new Date(ms);
623
- entry.ctime = new Date(ms);
624
- }
625
- }
626
- return entry;
627
- }
628
- /**
629
- * The target to present for a namespace link at a mount path, or null
630
- * when not a link. Relative targets are stored verbatim and returned
631
- * as-is. Absolute targets name virtual paths, so they are rewritten
632
- * relative to the link's directory: returned raw, the kernel would
633
- * resolve them against the host root and escape the mountpoint.
634
- */
635
- linkTarget(path4) {
636
- const links = this.ops.links;
637
- if (links === null) return null;
638
- const target = links.readlink(this.resolve(path4));
639
- if (target === null) return null;
640
- if (!target.startsWith("/")) return target;
641
- let virtualTarget = target;
642
- if (this.root !== "") {
643
- if (target === this.root) {
644
- virtualTarget = "/";
645
- } else if (target.startsWith(this.root + "/")) {
646
- virtualTarget = target.slice(this.root.length);
647
- } else {
648
- return target;
649
- }
650
- }
651
- const slash = path4.lastIndexOf("/");
652
- const parent = slash <= 0 ? "/" : path4.slice(0, slash);
653
- return posix2.relative(parent, virtualTarget);
654
- }
655
- linkStat(target) {
656
- const entry = this.fileStat(new TextEncoder().encode(target).byteLength);
657
- entry.mode = 41471;
658
- return entry;
659
- }
660
- cachedSize(path4) {
661
- for (const ctx of this.handles.values()) {
662
- if (ctx.path === path4 && ctx.data !== void 0) return ctx.data.byteLength;
663
- }
664
- const entry = this.prefetchCache.get(path4);
665
- if (entry !== void 0 && entry.expires > Date.now()) return entry.data.byteLength;
666
- return null;
667
- }
668
- cachedData(path4) {
669
- for (const ctx of this.handles.values()) {
670
- if (ctx.path === path4 && ctx.data !== void 0) return ctx.data;
671
- }
672
- const entry = this.prefetchCache.get(path4);
673
- if (entry !== void 0 && entry.expires > Date.now()) return entry.data;
674
- if (entry !== void 0) this.prefetchCache.delete(path4);
675
- return null;
676
- }
677
- /**
678
- * Fetch bytes for a size-unknown file and cache them so the open → read →
679
- * fstat burst (and subsequent stats within the TTL) reuse the same fetch.
680
- * With getattr reporting 0 pre-open, this hydration is what lets fgetattr
681
- * answer with the real byte length after open (mirrors Python's
682
- * `prefetch_read`).
683
- */
684
- async prefetch(path4) {
685
- const cached = this.cachedData(path4);
686
- if (cached !== null) return cached;
687
- const inflight = this.prefetchInflight.get(path4);
688
- if (inflight !== void 0) return inflight;
689
- const promise = (async () => {
690
- try {
691
- const data = await this.ops.readFile(this.resolve(path4));
692
- this.prefetchCache.set(path4, { data, expires: Date.now() + PREFETCH_TTL_MS });
693
- return data;
694
- } catch {
695
- return null;
696
- } finally {
697
- this.prefetchInflight.delete(path4);
698
- }
699
- })();
700
- this.prefetchInflight.set(path4, promise);
701
- return promise;
702
- }
703
- /** Drain and return accumulated op records (mirrors Python's drainOps). */
704
- drainOps() {
705
- const records = [...this.ops.records];
706
- this.ops.records.length = 0;
707
- return records;
708
- }
709
- async writeFile(path4, data) {
710
- await this.ops.writeFile(this.resolve(path4), data);
711
- }
712
- /**
713
- * Merge buffered writes over the raw base and persist the result.
714
- * The base is read raw so a flush never stores a rendered view back
715
- * into the mount.
716
- */
717
- async applyWrites(path4, writes) {
718
- let existing = new Uint8Array(0);
719
- try {
720
- existing = await this.ops.readFile(this.resolve(path4), { raw: true });
721
- } catch {
722
- }
723
- await this.writeFile(path4, mergeWrites(existing, writes));
724
- }
725
- // ── POSIX surface (throws; adapters classify) ────────────────────
726
- async getattr(path4) {
727
- if (path4 === "/") return this.dirStat();
728
- const name = path4.slice(path4.lastIndexOf("/") + 1);
729
- if (isMacosMetadata(name)) {
730
- throw errnoError("ENOENT", `no such file or directory: ${path4}`);
731
- }
732
- const target = this.linkTarget(path4);
733
- if (target !== null) return this.linkStat(target);
734
- const s = await this.ops.stat(this.resolve(path4));
735
- if (s.type === FileType.DIRECTORY) {
736
- return this.applyStatAttrs(this.dirStat(), s);
737
- }
738
- let size = s.size;
739
- size ??= this.cachedSize(path4) ?? 0;
740
- return this.applyStatAttrs(this.fileStat(size), s);
741
- }
742
- /** Attributes through an open handle, or path-based when not hydrated. */
743
- async fgetattr(path4, fd) {
744
- const ctx = this.handles.get(fd);
745
- if (ctx?.data !== void 0) return this.fileStat(ctx.data.byteLength);
746
- return this.getattr(path4);
747
- }
748
- async readdir(path4) {
749
- const names = /* @__PURE__ */ new Set();
750
- const entries = await this.ops.readdir(this.resolve(path4));
751
- for (const e of entries) {
752
- const part = rstripSlash2(e).split("/").pop() ?? "";
753
- if (part !== "" && !isMacosMetadata(part)) names.add(part);
754
- }
755
- return [".", "..", ...[...names].sort(compareCodePoints)];
756
- }
757
- async read(path4, fd, pos, len) {
758
- const ctx = this.handles.get(fd);
759
- if (ctx !== void 0 && ctx.data === void 0) {
760
- const cached = this.cachedData(path4);
761
- ctx.data = cached ?? await this.ops.readFile(this.resolve(path4));
762
- }
763
- const data = ctx?.data ?? this.cachedData(path4) ?? await this.ops.readFile(this.resolve(path4));
764
- return data.subarray(pos, pos + len);
765
- }
766
- /** Buffer a write on its handle, or apply it directly when there is none. */
767
- async write(path4, fd, data, pos) {
768
- const ctx = this.handles.get(fd);
769
- if (ctx !== void 0) {
770
- ctx.writeBuf ??= [];
771
- ctx.writeBuf.push([pos, data]);
772
- return;
773
- }
774
- await this.applyWrites(path4, [[pos, data]]);
775
- }
776
- async create(path4) {
777
- try {
778
- await this.ops.create(this.resolve(path4));
779
- } catch (dispatchErr) {
780
- if (!isMissingOp(dispatchErr, "create")) throw dispatchErr;
781
- await this.writeFile(path4, new Uint8Array(0));
782
- }
783
- return this.handles.add({ path: path4 });
784
- }
785
- async mkdir(path4) {
786
- await this.ops.mkdir(this.resolve(path4));
787
- }
788
- readlink(path4) {
789
- const target = this.linkTarget(path4);
790
- if (target === null) throw errnoError("EINVAL", `not a symbolic link: ${path4}`);
791
- return target;
792
- }
793
- /**
794
- * Create namespace link `dest -> src` (ln -s src dest; libfuse passes
795
- * the pointee first). Relative sources are stored verbatim (resolved
796
- * at follow time, exactly like the shell `ln -s`); absolute sources
797
- * are mapped into virtual space so a scoped mount stores the path it
798
- * will later follow.
799
- */
800
- async symlink(src, dest) {
801
- if (this.ops.links === null) throw errnoError("EROFS", "workspace has no namespace links");
802
- const stored = src.startsWith("/") ? this.resolve(src) : src;
803
- await this.ops.symlink(this.resolve(dest), stored);
804
- }
805
- async unlink(path4) {
806
- const links = this.ops.links;
807
- if (links?.isLink(this.resolve(path4)) === true) {
808
- await links.unlink(this.resolve(path4));
809
- this.xattrs.delete(path4);
810
- this.prefetchCache.delete(path4);
811
- return;
812
- }
813
- await this.ops.unlink(this.resolve(path4));
814
- this.xattrs.delete(path4);
815
- }
816
- async rename(src, dst) {
817
- await this.ops.rename(this.resolve(src), this.resolve(dst));
818
- const moved = this.xattrs.get(src);
819
- if (moved !== void 0) {
820
- this.xattrs.delete(src);
821
- this.xattrs.set(dst, moved);
822
- }
823
- }
824
- async rmdir(path4) {
825
- try {
826
- const entries = await this.ops.readdir(this.resolve(path4));
827
- if (entries.length > 0) {
828
- throw errnoError("ENOTEMPTY", `directory not empty: ${path4}`);
829
- }
830
- } catch (err) {
831
- if (err.code === "ENOTEMPTY") throw err;
832
- }
833
- await this.ops.rmdir(this.resolve(path4));
834
- this.xattrs.delete(path4);
835
- }
836
- async truncate(path4, size) {
837
- try {
838
- await this.ops.truncate(this.resolve(path4), size);
839
- } catch (dispatchErr) {
840
- if (!isMissingOp(dispatchErr, "truncate")) throw dispatchErr;
841
- const data = await this.ops.readFile(this.resolve(path4), { raw: true }).catch(() => new Uint8Array(0));
842
- const out = new Uint8Array(size);
843
- out.set(data.subarray(0, Math.min(data.byteLength, size)), 0);
844
- await this.writeFile(path4, out);
845
- }
846
- }
847
- statfs() {
848
- return {
849
- bsize: 4096,
850
- frsize: 4096,
851
- blocks: 1024 * 1024,
852
- bfree: 1024 * 1024,
853
- bavail: 1024 * 1024,
854
- files: 1e6,
855
- ffree: 1e6,
856
- favail: 1e6,
857
- namemax: 255
858
- };
859
- }
860
- setxattr(path4, name, value) {
861
- let attrs = this.xattrs.get(path4);
862
- if (attrs === void 0) {
863
- attrs = /* @__PURE__ */ new Map();
864
- this.xattrs.set(path4, attrs);
865
- }
866
- attrs.set(name, Buffer.from(value));
867
- }
868
- getxattr(path4, name) {
869
- return this.xattrs.get(path4)?.get(name);
870
- }
871
- listxattr(path4) {
872
- const attrs = this.xattrs.get(path4);
873
- return attrs ? [...attrs.keys()] : [];
874
- }
875
- removexattr(path4, name) {
876
- this.xattrs.get(path4)?.delete(name);
877
- }
878
- async open(path4) {
879
- const s = await this.ops.stat(this.resolve(path4));
880
- const ctx = { path: path4 };
881
- if (s.size === null && s.type !== FileType.DIRECTORY) {
882
- const data = await this.prefetch(path4);
883
- if (data !== null) ctx.data = data;
884
- }
885
- return this.handles.add(ctx);
886
- }
887
- async release(fd) {
888
- const ctx = this.handles.get(fd);
889
- if (ctx?.writeBuf !== void 0 && ctx.writeBuf.length > 0) {
890
- await this.flush(ctx.path, fd);
891
- }
892
- this.handles.pop(fd);
893
- }
894
- async flush(path4, fd) {
895
- const ctx = this.handles.get(fd);
896
- if (ctx?.writeBuf === void 0 || ctx.writeBuf.length === 0) return;
897
- const writes = ctx.writeBuf;
898
- ctx.writeBuf = [];
899
- await this.applyWrites(path4, writes);
900
- }
901
- };
902
-
903
- // src/fuse/fs.ts
904
- var MirageFS = class {
905
- core;
906
- constructor(ops, options = {}) {
907
- this.core = new MountCore(ops, options);
908
- }
909
- /** Drain and return accumulated op records (mirrors Python's drainOps). */
910
- drainOps() {
911
- return this.core.drainOps();
912
- }
913
- // ── FUSE op surface (mirrors mfusepy Operations) ─────────────────
914
- ops() {
915
- const table = {
916
- readdir: this.readdir.bind(this),
917
- getattr: this.getattr.bind(this),
918
- fgetattr: this.fgetattr.bind(this),
919
- open: this.open.bind(this),
920
- read: this.read.bind(this),
921
- write: this.write.bind(this),
922
- create: this.create.bind(this),
923
- readlink: this.readlink.bind(this),
924
- symlink: this.symlink.bind(this),
925
- unlink: this.unlink.bind(this),
926
- mkdir: this.mkdir.bind(this),
927
- rmdir: this.rmdir.bind(this),
928
- rename: this.rename.bind(this),
929
- release: this.release.bind(this),
930
- truncate: this.truncate.bind(this),
931
- flush: this.flush.bind(this),
932
- fsync: this.fsync.bind(this),
933
- utimens: this.utimens.bind(this),
934
- chmod: this.chmod.bind(this),
935
- chown: this.chown.bind(this),
936
- access: this.access.bind(this),
937
- setxattr: this.setxattr.bind(this),
938
- getxattr: this.getxattr.bind(this),
939
- listxattr: this.listxattr.bind(this),
940
- removexattr: this.removexattr.bind(this),
941
- statfs: this.statfs.bind(this)
942
- };
943
- const session = this.core.session;
944
- if (session === null) return table;
945
- const bound = {};
946
- for (const [name, fn] of Object.entries(table)) {
947
- bound[name] = (...args) => {
948
- void runWithSession(session, () => {
949
- fn(...args);
950
- return Promise.resolve();
951
- });
952
- };
953
- }
954
- return bound;
955
- }
956
- getattr(path4, cb) {
957
- void this.core.getattr(path4).then(
958
- (attr) => {
959
- cb(0, attr);
960
- },
961
- (err) => {
962
- cb(classifyError(err));
963
- }
964
- );
965
- }
966
- fgetattr(path4, fd, cb) {
967
- void this.core.fgetattr(path4, fd).then(
968
- (attr) => {
969
- cb(0, attr);
970
- },
971
- (err) => {
972
- cb(classifyError(err));
973
- }
974
- );
975
- }
976
- readdir(path4, cb) {
977
- void this.core.readdir(path4).then(
978
- (names) => {
979
- cb(0, names);
980
- },
981
- (err) => {
982
- cb(classifyError(err));
983
- }
984
- );
985
- }
986
- read(path4, fd, buf, len, pos, cb) {
987
- void this.core.read(path4, fd, pos, len).then(
988
- (slice) => {
989
- buf.set(slice, 0);
990
- cb(slice.byteLength);
991
- },
992
- (err) => {
993
- if (err.code === "EACCES") {
994
- cb(classifyError(err));
995
- return;
996
- }
997
- cb(0);
998
- }
999
- );
1000
- }
1001
- write(path4, fd, buf, len, pos, cb) {
1002
- const data = new Uint8Array(buf.subarray(0, len));
1003
- void this.core.write(path4, fd, data, pos).then(
1004
- () => {
1005
- cb(len);
1006
- },
1007
- (err) => {
1008
- if (err.code === "EACCES") {
1009
- cb(classifyError(err));
1010
- return;
1011
- }
1012
- cb(0);
1013
- }
1014
- );
1015
- }
1016
- create(path4, _mode, cb) {
1017
- void this.core.create(path4).then(
1018
- (fh) => {
1019
- cb(0, fh);
1020
- },
1021
- (err) => {
1022
- cb(classifyError(err));
1023
- }
1024
- );
1025
- }
1026
- mkdir(path4, _mode, cb) {
1027
- void this.core.mkdir(path4).then(
1028
- () => {
1029
- cb(0);
1030
- },
1031
- (err) => {
1032
- cb(classifyError(err));
1033
- }
1034
- );
1035
- }
1036
- readlink(path4, cb) {
1037
- try {
1038
- cb(0, this.core.readlink(path4));
1039
- } catch (err) {
1040
- cb(classifyError(err));
1041
- }
1042
- }
1043
- symlink(src, dest, cb) {
1044
- void this.core.symlink(src, dest).then(
1045
- () => {
1046
- cb(0);
1047
- },
1048
- (err) => {
1049
- cb(classifyError(err));
1050
- }
1051
- );
1052
- }
1053
- unlink(path4, cb) {
1054
- void this.core.unlink(path4).then(
1055
- () => {
1056
- cb(0);
1057
- },
1058
- (err) => {
1059
- cb(classifyError(err));
1060
- }
1061
- );
1062
- }
1063
- rename(src, dst, cb) {
1064
- void this.core.rename(src, dst).then(
1065
- () => {
1066
- cb(0);
1067
- },
1068
- (err) => {
1069
- cb(classifyError(err));
1070
- }
1071
- );
1072
- }
1073
- rmdir(path4, cb) {
1074
- void this.core.rmdir(path4).then(
1075
- () => {
1076
- cb(0);
1077
- },
1078
- (err) => {
1079
- cb(classifyError(err));
1080
- }
1081
- );
1082
- }
1083
- truncate(path4, size, cb) {
1084
- void this.core.truncate(path4, size).then(
1085
- () => {
1086
- cb(0);
1087
- },
1088
- (err) => {
1089
- cb(classifyError(err));
1090
- }
1091
- );
1092
- }
1093
- statfs(_path, cb) {
1094
- cb(0, this.core.statfs());
1095
- }
1096
- // chmod / chown / utimens / access are no-ops for the filesystem but must
1097
- // validate path existence — callers like `touch`/`chmod` on a missing file
1098
- // should fail with ENOENT, not silently succeed.
1099
- chmod(path4, _mode, cb) {
1100
- this.validate(path4, cb);
1101
- }
1102
- chown(path4, _uid, _gid, cb) {
1103
- this.validate(path4, cb);
1104
- }
1105
- utimens(path4, _atime, _mtime, cb) {
1106
- this.validate(path4, cb);
1107
- }
1108
- access(path4, _amode, cb) {
1109
- this.validate(path4, cb);
1110
- }
1111
- setxattr(path4, name, value, _position, _flags, cb) {
1112
- this.validate(path4, (code) => {
1113
- if (code !== 0) {
1114
- cb(code);
1115
- return;
1116
- }
1117
- this.core.setxattr(path4, name, value);
1118
- cb(0);
1119
- });
1120
- }
1121
- getxattr(path4, name, _position, cb) {
1122
- this.validate(path4, (code) => {
1123
- if (code !== 0) {
1124
- cb(code);
1125
- return;
1126
- }
1127
- cb(0, this.core.getxattr(path4, name));
1128
- });
1129
- }
1130
- listxattr(path4, cb) {
1131
- this.validate(path4, (code) => {
1132
- if (code !== 0) {
1133
- cb(code);
1134
- return;
1135
- }
1136
- cb(0, this.core.listxattr(path4));
1137
- });
1138
- }
1139
- removexattr(path4, name, cb) {
1140
- this.validate(path4, (code) => {
1141
- if (code !== 0) {
1142
- cb(code);
1143
- return;
1144
- }
1145
- this.core.removexattr(path4, name);
1146
- cb(0);
1147
- });
1148
- }
1149
- validate(path4, cb) {
1150
- this.getattr(path4, (code) => {
1151
- cb(code);
1152
- });
1153
- }
1154
- open(path4, _flags, cb) {
1155
- void this.core.open(path4).then(
1156
- (fh) => {
1157
- cb(0, fh);
1158
- },
1159
- (err) => {
1160
- cb(classifyError(err));
1161
- }
1162
- );
1163
- }
1164
- release(_path, fd, cb) {
1165
- void this.core.release(fd).then(
1166
- () => {
1167
- cb(0);
1168
- },
1169
- (err) => {
1170
- cb(classifyError(err));
1171
- }
1172
- );
1173
- }
1174
- flush(path4, fd, cb) {
1175
- void this.core.flush(path4, fd).then(
1176
- () => {
1177
- cb(0);
1178
- },
1179
- (err) => {
1180
- cb(classifyError(err));
1181
- }
1182
- );
1183
- }
1184
- fsync(path4, _datasync, fd, cb) {
1185
- this.flush(path4, fd, cb);
1186
- }
1187
- };
1188
-
1189
- // src/fuse/mount.ts
1190
- function appendMountOptions(fuse, extras) {
1191
- const orig = fuse._fuseOptions?.bind(fuse);
1192
- if (orig === void 0) {
1193
- throw new Error(
1194
- "@zkochan/fuse-native no longer exposes _fuseOptions(); extra mount options cannot be applied. Update appendMountOptions in mount.ts for the new fuse-native version."
1195
- );
1196
- }
1197
- fuse._fuseOptions = () => {
1198
- const serialized = orig();
1199
- const missing = extras.filter((opt) => !serialized.includes(opt));
1200
- if (missing.length === 0) return serialized;
1201
- if (serialized === "") return `-o${missing.join(",")}`;
1202
- return `${serialized},${missing.join(",")}`;
1203
- };
1204
- }
1205
- function appendDirectIO(fuse) {
1206
- appendMountOptions(fuse, ["direct_io"]);
1207
- }
1208
- async function loadFuse() {
1209
- const mod = await loadOptionalPeer(
1210
- () => import("@zkochan/fuse-native"),
1211
- {
1212
- feature: "FUSE support",
1213
- packageName: "@zkochan/fuse-native",
1214
- docsUrl: "https://mirage.dev/typescript/setup/fuse"
1215
- }
1216
- );
1217
- const Fuse = mod.default ?? mod;
1218
- if (typeof Fuse !== "function") {
1219
- throw new Error("@zkochan/fuse-native did not export a constructor");
1220
- }
1221
- return Fuse;
1222
- }
1223
- function forceUnmount(mountpoint) {
1224
- try {
1225
- if (process.platform === "darwin") {
1226
- execSync(`diskutil unmount force ${JSON.stringify(mountpoint)}`, { stdio: "ignore" });
1227
- } else {
1228
- execSync(`fusermount -u ${JSON.stringify(mountpoint)}`, { stdio: "ignore" });
1229
- }
1230
- } catch {
1231
- }
1232
- }
1233
- async function mount(ws, options = {}) {
1234
- const backend = prepareBackend(
1235
- options.backend ?? MountBackend2.FUSE,
1236
- ws,
1237
- void 0,
1238
- options.rootPrefix ?? ""
1239
- );
1240
- const Fuse = await loadFuse();
1241
- const isFskit = backend === MountBackend2.FSKIT;
1242
- let mountpoint;
1243
- let ownsMountpoint = false;
1244
- if (options.mountpoint !== void 0) {
1245
- checkMountpoint(backend, options.mountpoint);
1246
- if (!isFskit) mkdirSync(options.mountpoint, { recursive: true });
1247
- mountpoint = options.mountpoint;
1248
- } else if (isFskit) {
1249
- mountpoint = `${FSKIT_MOUNT_ROOT}/mirage-${randomBytes(4).toString("hex")}`;
1250
- } else {
1251
- mountpoint = mkdtempSync(join(tmpdir(), "mirage-fuse-"));
1252
- ownsMountpoint = true;
1253
- }
1254
- const mfs = new MirageFS(ws.fs, {
1255
- ...options.rootPrefix !== void 0 ? { rootPrefix: options.rootPrefix } : {},
1256
- ...options.session !== void 0 ? { session: options.session } : {}
1257
- });
1258
- const autoUnmount = options.autoUnmount ?? process.platform === "linux";
1259
- const fuseOpts = {
1260
- force: true,
1261
- mkdir: true,
1262
- attrTimeout: "0",
1263
- ...autoUnmount ? { autoUnmount: true } : {},
1264
- ...options.fuseOptions ?? {}
1265
- };
1266
- const fuse = new Fuse(mountpoint, mfs.ops(), fuseOpts);
1267
- if (isFskit) {
1268
- appendMountOptions(fuse, ["backend=fskit", `volname=${basename(mountpoint)}`]);
1269
- } else if (fuseOpts.directIO !== false) {
1270
- appendDirectIO(fuse);
1271
- }
1272
- await new Promise((resolve2, reject) => {
1273
- fuse.mount((err) => {
1274
- if (err === null) resolve2();
1275
- else reject(err);
1276
- });
1277
- });
1278
- return {
1279
- mountpoint,
1280
- ownsMountpoint,
1281
- unmount: () => new Promise((resolve2, reject) => {
1282
- fuse.unmount((err) => {
1283
- if (err === null) resolve2();
1284
- else reject(err);
1285
- });
1286
- })
1287
- };
1288
- }
1289
- function mountBackground(ws, options = {}) {
1290
- return mount(ws, options);
1291
- }
1292
-
1293
- // src/workspace/fuse.ts
1294
- var SIGNALS = ["SIGINT", "SIGTERM", "SIGHUP"];
1295
- function removeMountpointIfOwned(entry) {
1296
- if (!entry.ownsMountpoint) return;
1297
- try {
1298
- rmdirSync(entry.mountpoint);
1299
- } catch {
1300
- }
1301
- }
1302
- var FuseCleanupRegistry = class {
1303
- mounts = /* @__PURE__ */ new Set();
1304
- installed = false;
1305
- exiting = false;
1306
- register(entry) {
1307
- this.mounts.add(entry);
1308
- this.install();
1309
- }
1310
- unregister(entry) {
1311
- this.mounts.delete(entry);
1312
- }
1313
- install() {
1314
- if (this.installed) return;
1315
- this.installed = true;
1316
- for (const sig of SIGNALS) {
1317
- process.on(sig, this.onSignal);
1318
- }
1319
- process.on("beforeExit", this.onExit);
1320
- process.on("exit", this.onExit);
1321
- }
1322
- onSignal = (sig) => {
1323
- if (this.exiting) return;
1324
- this.exiting = true;
1325
- this.drainSync();
1326
- process.kill(process.pid, sig);
1327
- };
1328
- onExit = () => {
1329
- if (this.exiting) return;
1330
- this.exiting = true;
1331
- this.drainSync();
1332
- };
1333
- drainSync() {
1334
- for (const entry of this.mounts) {
1335
- forceUnmount(entry.mountpoint);
1336
- removeMountpointIfOwned(entry);
1337
- }
1338
- this.mounts.clear();
1339
- }
1340
- };
1341
- var CLEANUP = new FuseCleanupRegistry();
1342
- var FuseManager = class {
1343
- handle = null;
1344
- cleanupEntry = null;
1345
- get mountpoint() {
1346
- return this.handle?.mountpoint ?? null;
1347
- }
1348
- async setup(ws, options = {}) {
1349
- if (this.handle !== null) return this.handle.mountpoint;
1350
- const handle = await mount(ws, options);
1351
- this.handle = handle;
1352
- this.cleanupEntry = {
1353
- mountpoint: handle.mountpoint,
1354
- handle,
1355
- // Preserve the ownership decision made by mount(); unmount cleanup must
1356
- // not infer ownership from path shape or whether the directory exists.
1357
- ownsMountpoint: handle.ownsMountpoint
1358
- };
1359
- CLEANUP.register(this.cleanupEntry);
1360
- return handle.mountpoint;
1361
- }
1362
- async unmount() {
1363
- if (this.handle === null) {
1364
- return;
1365
- }
1366
- const mp = this.handle.mountpoint;
1367
- try {
1368
- await this.handle.unmount();
1369
- } finally {
1370
- const cleanupEntry = this.cleanupEntry;
1371
- if (cleanupEntry !== null) {
1372
- CLEANUP.unregister(cleanupEntry);
1373
- this.cleanupEntry = null;
1374
- }
1375
- this.handle = null;
1376
- removeMountpointIfOwned({
1377
- mountpoint: mp,
1378
- ownsMountpoint: cleanupEntry?.ownsMountpoint ?? false
1379
- });
1380
- }
1381
- }
1382
- async close() {
1383
- await this.unmount();
1384
- }
1385
- };
1386
-
1387
- // src/workspace/mount_spec.ts
1388
- var Mount = class {
1389
- constructor(resource, options = {}) {
1390
- this.resource = resource;
1391
- this.options = options;
1392
- }
1393
- resource;
1394
- options;
1395
- };
1396
-
1397
- // src/compression_codecs.ts
1398
- import { createRequire } from "module";
1399
- import { registerCompressionCodec } from "@struktoai/mirage-core";
1400
- var requireCjs = createRequire(import.meta.url);
1401
- var bunzip = requireCjs("seek-bzip");
1402
- var { xz } = requireCjs("@napi-rs/lzma");
1403
- registerCompressionCodec("bzip2", {
1404
- decompress: (bytes) => Promise.resolve(Uint8Array.from(bunzip.decode(bytes)))
1405
- });
1406
- registerCompressionCodec("xz", {
1407
- compress: async (bytes) => new Uint8Array(await xz.compress(Buffer.from(bytes))),
1408
- decompress: async (bytes) => new Uint8Array(await xz.decompress(Buffer.from(bytes)))
1409
- });
1410
-
1411
- // src/runtime/sandbox/daytona/runtime.ts
1412
- import {
1413
- loadOptionalPeer as loadOptionalPeer2,
1414
- registerRuntime,
1415
- RemoteSandbox,
1416
- stdinPath,
1417
- stdinRedirect
1418
- } from "@struktoai/mirage-core";
1419
-
1420
- // src/runtime/sandbox/daytona/config.ts
1421
- var DAYTONA_CONFIG_KEYS = ["env", "sandboxId", "apiKey"];
1422
-
1423
- // src/runtime/sandbox/daytona/runtime.ts
1424
- var ENC = new TextEncoder();
1425
- var DaytonaRuntime = class extends RemoteSandbox {
1426
- name = "daytona";
1427
- client = null;
1428
- sandbox = null;
1429
- constructor(options = {}) {
1430
- super(options, DAYTONA_CONFIG_KEYS);
1431
- if (!this.config.sandboxId) {
1432
- throw new Error("daytona config needs sandboxId: the id of a live sandbox you created");
1433
- }
1434
- }
1435
- // The SDK loader as a seam: tests substitute a fake module here.
1436
- loadSdk() {
1437
- return loadOptionalPeer2(() => import("@daytonaio/sdk"), {
1438
- feature: "the 'daytona' runtime",
1439
- packageName: "@daytonaio/sdk"
1440
- });
1441
- }
1442
- async connect() {
1443
- if (this.client === null) {
1444
- const sdk = await this.loadSdk();
1445
- this.client = new sdk.Daytona(
1446
- this.config.apiKey !== void 0 ? { apiKey: this.config.apiKey } : void 0
1447
- );
1448
- }
1449
- this.sandbox = await this.client.get(this.config.sandboxId);
1450
- }
1451
- async execLine(line, stdin, env, cwd) {
1452
- if (this.sandbox === null) throw new Error("daytona sandbox not connected");
1453
- let command = line;
1454
- if (stdin !== null) {
1455
- const path4 = stdinPath();
1456
- await this.upload(path4, stdin);
1457
- command = stdinRedirect(line, path4);
1458
- }
1459
- const response = await this.sandbox.process.executeCommand(command, cwd, env);
1460
- return {
1461
- stdout: ENC.encode(response.result),
1462
- stderr: null,
1463
- exitCode: response.exitCode
1464
- };
1465
- }
1466
- async upload(path4, data) {
1467
- if (this.sandbox === null) throw new Error("daytona sandbox not connected");
1468
- const slash = path4.lastIndexOf("/");
1469
- const parent = slash > 0 ? path4.slice(0, slash) : "";
1470
- if (parent !== "") await this.sandbox.fs.createFolder(parent, "755");
1471
- await this.sandbox.fs.uploadFile(Buffer.from(data), path4);
1472
- }
1473
- /** Release the SDK client; the sandbox itself is the user's. */
1474
- async close() {
1475
- this.sandbox = null;
1476
- if (this.client !== null) {
1477
- await this.client[Symbol.asyncDispose]();
1478
- this.client = null;
1479
- }
1480
- }
1481
- };
1482
- registerRuntime("daytona", DaytonaRuntime);
1483
-
1484
- // src/workspace.ts
1485
- var requireCjs2 = createRequire2(import.meta.url);
1486
- var cachedParser = null;
1487
- function loadShellParser() {
1488
- if (cachedParser !== null) return cachedParser;
1489
- const enginePath = requireCjs2.resolve("web-tree-sitter/web-tree-sitter.wasm");
1490
- const grammarPath = requireCjs2.resolve("tree-sitter-bash/tree-sitter-bash.wasm");
1491
- cachedParser = createShellParser({
1492
- engineWasm: readFileSync(enginePath),
1493
- grammarWasm: readFileSync(grammarPath)
1494
- });
1495
- return cachedParser;
1496
- }
1497
- var Workspace = class extends CoreWorkspace {
1498
- fuseSetupPromise = null;
1499
- fuseMountpointsMap = /* @__PURE__ */ new Map();
1500
- fuseManagers = /* @__PURE__ */ new Map();
1501
- constructor(resources, options = {}) {
1502
- const specs = {};
1503
- const commandLimits = {
1504
- ...options.commandLimits ?? {}
1505
- };
1506
- const mountTargets = [];
1507
- for (const [prefix, value] of Object.entries(resources)) {
1508
- if (value instanceof Mount) {
1509
- specs[prefix] = value.options.mode !== void 0 ? [value.resource, value.options.mode] : value.resource;
1510
- if (value.options.commandLimits !== void 0)
1511
- commandLimits[prefix] = value.options.commandLimits;
1512
- const backend = value.options.backend ?? MountBackend3.VFS;
1513
- if (KERNEL_BACKENDS2.includes(backend))
1514
- mountTargets.push([prefix, backend, value.options.mountpoint]);
1515
- } else {
1516
- specs[prefix] = value;
1517
- }
1518
- }
1519
- super(specs, {
1520
- ...options,
1521
- ...Object.keys(commandLimits).length > 0 ? { commandLimits } : {},
1522
- shellParserFactory: options.shellParserFactory ?? loadShellParser
1523
- });
1524
- if (mountTargets.length > 0) {
1525
- const setups = mountTargets.map(
1526
- ([prefix, backend, mountpoint]) => this.addFuseMount(prefix, mountpoint, void 0, backend).then(
1527
- () => void 0,
1528
- (err) => {
1529
- process.stderr.write(
1530
- `mirage: FUSE auto-mount failed for ${prefix}, continuing without it: ${err instanceof Error ? err.message : String(err)}
1531
- `
1532
- );
1533
- }
1534
- )
1535
- );
1536
- this.fuseSetupPromise = Promise.all(setups).then(() => void 0);
1537
- }
1538
- }
1539
- registerFuseMount(prefix, mountpoint) {
1540
- for (const [otherPrefix, otherMp] of this.fuseMountpointsMap) {
1541
- if (otherMp === mountpoint && otherPrefix !== prefix) {
1542
- throw new Error(
1543
- `FUSE mountpoint ${mountpoint} already used by prefix ${otherPrefix}; mounts need distinct paths`
1544
- );
1545
- }
1546
- }
1547
- this.fuseMountpointsMap.set(prefix, mountpoint);
1548
- }
1549
- /**
1550
- * Mount a workspace subtree under FUSE and own its lifecycle. Each mount gets
1551
- * its own {@link FuseManager}, so a workspace can expose any number of FUSE
1552
- * subtrees at once. A pinned mountpoint is collision-checked BEFORE mounting,
1553
- * so a clash never leaves a partial kernel mount.
1554
- *
1555
- * A session-bound mount (`sessionId` given) runs every op under that
1556
- * session's mount grants (the kernel-tier primitive: bind-mount the tree
1557
- * into a container and the narrowing travels with it); it is keyed
1558
- * separately so the same prefix can also be exposed unbound.
1559
- */
1560
- async addFuseMount(prefix, mountpoint, sessionId, backend) {
1561
- const session = sessionId !== void 0 ? this.getSession(sessionId) : void 0;
1562
- const key = sessionId === void 0 ? prefix : `${prefix}@${sessionId}`;
1563
- if (mountpoint !== void 0) this.registerFuseMount(key, mountpoint);
1564
- const fm = new FuseManager();
1565
- this.fuseManagers.set(key, fm);
1566
- try {
1567
- const mp = await fm.setup(this, {
1568
- rootPrefix: prefix,
1569
- ...mountpoint !== void 0 ? { mountpoint } : {},
1570
- ...session !== void 0 ? { session } : {},
1571
- ...backend !== void 0 ? { backend } : {}
1572
- });
1573
- if (mountpoint === void 0) this.registerFuseMount(key, mp);
1574
- return mp;
1575
- } catch (err) {
1576
- this.fuseManagers.delete(key);
1577
- this.fuseMountpointsMap.delete(key);
1578
- throw err;
1579
- }
1580
- }
1581
- async removeFuseMount(prefix, sessionId) {
1582
- const key = sessionId === void 0 ? prefix : `${prefix}@${sessionId}`;
1583
- const fm = this.fuseManagers.get(key);
1584
- this.fuseManagers.delete(key);
1585
- if (fm !== void 0) await fm.unmount();
1586
- this.fuseMountpointsMap.delete(key);
1587
- }
1588
- get fuseMountpoints() {
1589
- return Object.fromEntries(this.fuseMountpointsMap);
1590
- }
1591
- get fuseMountpoint() {
1592
- if (this.fuseMountpointsMap.size === 0) return null;
1593
- if (this.fuseMountpointsMap.size > 1) {
1594
- throw new Error("multiple FUSE mounts active; use fuseMountpoints to select one by prefix");
1595
- }
1596
- return this.fuseMountpointsMap.values().next().value ?? null;
1597
- }
1598
- /** Await the eager per-mount fuse mounts started in the constructor. */
1599
- async fuseReady() {
1600
- if (this.fuseSetupPromise !== null) {
1601
- await this.fuseSetupPromise;
1602
- this.fuseSetupPromise = null;
1603
- }
1604
- }
1605
- async execute(command, options = {}) {
1606
- await this.fuseReady();
1607
- return super.execute(command, options);
1608
- }
1609
- async close() {
1610
- await this.fuseReady().catch(() => void 0);
1611
- for (const fm of this.fuseManagers.values()) await fm.unmount();
1612
- this.fuseManagers.clear();
1613
- this.fuseMountpointsMap.clear();
1614
- await super.close();
1615
- }
1616
- };
1617
-
1618
- // src/observe/disk_store.ts
1619
- import {
1620
- appendFile,
1621
- mkdir,
1622
- readdir,
1623
- readFile,
1624
- rmdir,
1625
- stat as stat2,
1626
- unlink,
1627
- writeFile
1628
- } from "fs/promises";
1629
- import path from "path";
1630
- import { ObserverStoreBase } from "@struktoai/mirage-core";
1631
- var DiskObserverStore = class extends ObserverStoreBase {
1632
- root;
1633
- constructor(root) {
1634
- super();
1635
- this.root = root;
1636
- }
1637
- abs(key) {
1638
- return path.join(this.root, key.replace(/^\/+/, ""));
1639
- }
1640
- async append(key, data) {
1641
- const absPath = this.abs(key);
1642
- await mkdir(path.dirname(absPath), { recursive: true });
1643
- await appendFile(absPath, data);
1644
- }
1645
- async write(key, data) {
1646
- const absPath = this.abs(key);
1647
- await mkdir(path.dirname(absPath), { recursive: true });
1648
- await writeFile(absPath, data);
1649
- }
1650
- async readMatching(suffix) {
1651
- const out = /* @__PURE__ */ new Map();
1652
- const { files } = await this.walk();
1653
- for (const absPath of files) {
1654
- const rel = "/" + path.relative(this.root, absPath);
1655
- if (!rel.endsWith(suffix)) continue;
1656
- out.set(rel, new Uint8Array(await readFile(absPath)));
1657
- }
1658
- return out;
1659
- }
1660
- async clear() {
1661
- const { files, dirs } = await this.walk();
1662
- for (const absPath of files) await unlink(absPath);
1663
- for (const d of [...dirs].reverse()) await rmdir(d);
1664
- }
1665
- async rootIsDir() {
1666
- try {
1667
- return (await stat2(this.root)).isDirectory();
1668
- } catch (err) {
1669
- if (err.code === "ENOENT") return false;
1670
- throw err;
1671
- }
1672
- }
1673
- async walk() {
1674
- const files = [];
1675
- const dirs = [];
1676
- if (!await this.rootIsDir()) return { files, dirs };
1677
- const stack = [this.root];
1678
- while (stack.length > 0) {
1679
- const d = stack.pop();
1680
- if (d === void 0) break;
1681
- const entries = await readdir(d, { withFileTypes: true });
1682
- dirs.push(d);
1683
- for (const entry of entries) {
1684
- const full = path.join(d, entry.name);
1685
- if (entry.isDirectory()) stack.push(full);
1686
- else files.push(full);
1687
- }
1688
- }
1689
- return { files, dirs };
1690
- }
1691
- };
1692
-
1693
- // src/observe/redis_store.ts
1694
- import { compareCodePoints as compareCodePoints2, ObserverStoreBase as ObserverStoreBase2 } from "@struktoai/mirage-core";
1695
- var RedisObserverStore = class extends ObserverStoreBase2 {
1696
- url;
1697
- prefix;
1698
- indexKey;
1699
- clientPromise = null;
1700
- constructor(options = {}) {
1701
- super();
1702
- this.url = options.url ?? "redis://localhost:6379/0";
1703
- this.prefix = options.keyPrefix ?? "mirage:observer:";
1704
- this.indexKey = `${this.prefix}keys`;
1705
- }
1706
- async client() {
1707
- this.clientPromise ??= (async () => {
1708
- const mod = await loadOptionalPeer(
1709
- () => import("redis"),
1710
- { feature: "RedisObserverStore", packageName: "redis" }
1711
- );
1712
- const c = mod.createClient({
1713
- url: this.url,
1714
- socket: { reconnectStrategy: false }
1715
- });
1716
- await c.connect();
1717
- return c;
1718
- })();
1719
- return this.clientPromise;
1720
- }
1721
- async append(key, data) {
1722
- const c = await this.client();
1723
- const buf = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
1724
- await c.multi().append(`${this.prefix}${key}`, buf).sAdd(this.indexKey, key).exec();
1725
- }
1726
- async write(key, data) {
1727
- const c = await this.client();
1728
- const buf = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
1729
- await c.multi().set(`${this.prefix}${key}`, buf).sAdd(this.indexKey, key).exec();
1730
- }
1731
- async readMatching(suffix) {
1732
- const paths = (await this.indexedPaths()).filter((p) => p.endsWith(suffix));
1733
- return this.readPaths(paths);
1734
- }
1735
- async indexedPaths() {
1736
- const c = await this.client();
1737
- const members = await c.sMembers(this.indexKey);
1738
- return [...members].sort(compareCodePoints2);
1739
- }
1740
- async readPaths(paths) {
1741
- const out = /* @__PURE__ */ new Map();
1742
- if (paths.length === 0) return out;
1743
- const c = await this.client();
1744
- const mod = await import("redis");
1745
- const mapping = { [mod.RESP_TYPES.BLOB_STRING]: Buffer };
1746
- const typed = c;
1747
- const values = await typed.withTypeMapping(mapping).mGet(paths.map((p) => `${this.prefix}${p}`));
1748
- paths.forEach((p, i) => {
1749
- const raw = values[i];
1750
- out.set(p, raw === null || raw === void 0 ? new Uint8Array() : new Uint8Array(raw));
1751
- });
1752
- return out;
1753
- }
1754
- async clear() {
1755
- const c = await this.client();
1756
- const paths = await this.indexedPaths();
1757
- const keys = [...paths.map((p) => `${this.prefix}${p}`), this.indexKey];
1758
- if (keys.length > 0) await c.del(keys);
1759
- }
1760
- async close() {
1761
- if (this.clientPromise === null) return;
1762
- const pending = this.clientPromise;
1763
- this.clientPromise = null;
1764
- const c = await pending;
1765
- await c.quit();
1766
- }
1767
- };
1768
-
1769
- // src/shell/console/redis/store.ts
1770
- import {
1771
- Channel
1772
- } from "@struktoai/mirage-core";
1773
-
1774
- // src/shell/console/redis/constants.ts
1775
- import { readFileSync as readFileSync2 } from "fs";
1776
- var APPEND_LUA = readFileSync2(new URL("./append.lua", import.meta.url), "utf8");
1777
- var POLL_MS = 100;
1778
-
1779
- // src/shell/console/redis/store.ts
1780
- function sleep(ms) {
1781
- return new Promise((resolve2) => setTimeout(resolve2, ms));
1782
- }
1783
- var RedisConsoleStore = class {
1784
- url;
1785
- keyPrefix;
1786
- streamKey;
1787
- counterKey;
1788
- endedKey;
1789
- ttlSeconds;
1790
- clientPromise = null;
1791
- isClosed = false;
1792
- constructor(options = {}) {
1793
- this.url = options.url ?? "redis://localhost:6379/0";
1794
- this.keyPrefix = options.keyPrefix ?? "mirage:console:";
1795
- this.streamKey = `${this.keyPrefix}stream`;
1796
- this.counterKey = `${this.keyPrefix}seq`;
1797
- this.endedKey = `${this.keyPrefix}ended`;
1798
- this.ttlSeconds = options.ttlSeconds ?? 0;
1799
- }
1800
- get closed() {
1801
- return this.isClosed;
1802
- }
1803
- async client() {
1804
- this.clientPromise ??= (async () => {
1805
- const mod = await loadOptionalPeer(
1806
- () => import("redis"),
1807
- { feature: "RedisConsoleStore", packageName: "redis" }
1808
- );
1809
- const c = mod.createClient({
1810
- url: this.url,
1811
- socket: { reconnectStrategy: false }
1812
- });
1813
- await c.connect();
1814
- return c;
1815
- })();
1816
- return this.clientPromise;
1817
- }
1818
- /**
1819
- * Append one chunk, atomically against the console's ending.
1820
- *
1821
- * A dropped append (the console already ended) reports the last real
1822
- * chunk's seq; `JobConsole.emit` ignores the return and the drop is
1823
- * exactly its documented after-the-ending semantics.
1824
- */
1825
- async append(channel, data) {
1826
- const c = await this.client();
1827
- const ts = Date.now() / 1e3;
1828
- const buf = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
1829
- const count = await c.eval(APPEND_LUA, {
1830
- keys: [this.streamKey, this.counterKey, this.endedKey],
1831
- arguments: [
1832
- channel,
1833
- buf,
1834
- String(ts),
1835
- channel === Channel.CONTROL ? "1" : "0",
1836
- String(this.ttlSeconds)
1837
- ]
1838
- });
1839
- return { seq: count - 1, ts, channel, data };
1840
- }
1841
- async readFrom(seq, limit) {
1842
- const c = await this.client();
1843
- const mod = await import("redis");
1844
- const mapping = { [mod.RESP_TYPES.BLOB_STRING]: Buffer };
1845
- const typed = c;
1846
- const entries = await typed.withTypeMapping(mapping).xRange(
1847
- this.streamKey,
1848
- `${(seq + 1).toString()}-0`,
1849
- "+",
1850
- limit === void 0 ? void 0 : { COUNT: limit }
1851
- );
1852
- const chunks = entries.map((entry) => this.chunk(entry));
1853
- const first = chunks[0];
1854
- const last = chunks[chunks.length - 1];
1855
- if (first !== void 0 && last !== void 0) {
1856
- return [chunks, last.seq + 1, first.seq > seq];
1857
- }
1858
- const raw = await c.get(this.counterKey);
1859
- const total = raw === null ? 0 : Number(raw);
1860
- return [[], Math.min(seq, total), false];
1861
- }
1862
- async wait(seq) {
1863
- if (this.isClosed) return;
1864
- const c = await this.client();
1865
- while (!this.isClosed) {
1866
- let raw;
1867
- try {
1868
- raw = await c.get(this.counterKey);
1869
- } catch (err) {
1870
- if (this.isClosed) return;
1871
- throw err;
1872
- }
1873
- if (raw !== null && Number(raw) > seq) return;
1874
- await sleep(POLL_MS);
1875
- }
1876
- }
1877
- async close() {
1878
- this.isClosed = true;
1879
- if (this.clientPromise === null) return;
1880
- const pending = this.clientPromise;
1881
- this.clientPromise = null;
1882
- const c = await pending;
1883
- await c.quit();
1884
- }
1885
- /** Delete the console's keys (test and integ teardown only). */
1886
- async clear() {
1887
- const c = await this.client();
1888
- await c.del([this.streamKey, this.counterKey, this.endedKey]);
1889
- }
1890
- chunk(entry) {
1891
- return {
1892
- seq: Number(entry.id.toString().split("-")[0]) - 1,
1893
- ts: Number(entry.message.t?.toString() ?? "0"),
1894
- channel: entry.message.c?.toString() ?? "stdout",
1895
- data: new Uint8Array(entry.message.d ?? Buffer.alloc(0))
1896
- };
1897
- }
1898
- };
1899
-
1900
- // src/workspace/namespace/disk.ts
1901
- import { NamespaceStore } from "@struktoai/mirage-core";
1902
-
1903
- // src/workspace/record/disk.ts
1904
- import { mkdir as mkdir2, open, readFile as readFile2, readdir as readdir2, rename, stat as stat3, unlink as unlink2, writeFile as writeFile2 } from "fs/promises";
1905
- import path2 from "path";
1906
- import { generationOf } from "@struktoai/mirage-core";
1907
- var LOCK_STALE_SECONDS = 10;
1908
- var LOCK_RETRY_SLEEP_MS = 5;
1909
- var LOCK_RETRY_LIMIT = 2e3;
1910
- var tmpCounter = 0;
1911
- function quoteName(name) {
1912
- return encodeURIComponent(name).replace(
1913
- /[!'()*]/g,
1914
- (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`
1915
- );
1916
- }
1917
- function isMissing(e) {
1918
- return e.code === "ENOENT";
1919
- }
1920
- var DiskRecordClient = class {
1921
- dir;
1922
- constructor(root, prefix) {
1923
- this.dir = path2.join(root, prefix);
1924
- }
1925
- recordPath(name) {
1926
- return path2.join(this.dir, `${quoteName(name)}.json`);
1927
- }
1928
- // The token slot mirrors the S3 client's ETag but stays empty: disk
1929
- // CAS anchors on the lockfile, not on a version token.
1930
- async get(name) {
1931
- let body;
1932
- try {
1933
- body = await readFile2(this.recordPath(name));
1934
- } catch (e) {
1935
- if (isMissing(e)) return [null, ""];
1936
- throw e;
1937
- }
1938
- return [JSON.parse(body.toString()), ""];
1939
- }
1940
- async put(name, fields) {
1941
- await mkdir2(this.dir, { recursive: true });
1942
- await this.writeRecord(this.recordPath(name), fields);
1943
- }
1944
- /**
1945
- * Write one record iff its stored generation matches.
1946
- *
1947
- * Take the record's lockfile, re-read under the lock, check the
1948
- * generation, then tmp-write + rename. Losing the lock race or the
1949
- * generation check resolves false; the caller adopts and retries.
1950
- */
1951
- async casPut(name, fields, expectedGeneration) {
1952
- await mkdir2(this.dir, { recursive: true });
1953
- const target = this.recordPath(name);
1954
- const lockPath = `${target}.lock`;
1955
- let fh = await this.acquireLock(lockPath);
1956
- if (fh === null) {
1957
- if (!await this.reclaimStaleLock(lockPath)) return false;
1958
- fh = await this.acquireLock(lockPath);
1959
- if (fh === null) return false;
1960
- }
1961
- try {
1962
- const [stored] = await this.get(name);
1963
- if (generationOf(stored) !== expectedGeneration) return false;
1964
- await this.writeRecord(target, fields);
1965
- return true;
1966
- } finally {
1967
- await this.releaseLock(fh, lockPath);
1968
- }
1969
- }
1970
- async listNames() {
1971
- let entries;
1972
- try {
1973
- entries = await readdir2(this.dir);
1974
- } catch (e) {
1975
- if (isMissing(e)) return [];
1976
- throw e;
1977
- }
1978
- return entries.filter((n) => n.endsWith(".json")).map((n) => decodeURIComponent(n.slice(0, -".json".length)));
1979
- }
1980
- async loadAll() {
1981
- const names = await this.listNames();
1982
- const records = await Promise.all(names.map((name) => this.get(name)));
1983
- const out = /* @__PURE__ */ new Map();
1984
- for (let i = 0; i < names.length; i++) {
1985
- const name = names[i];
1986
- const fields = records[i]?.[0];
1987
- if (name !== void 0 && fields != null) out.set(name, fields);
1988
- }
1989
- return out;
1990
- }
1991
- async delete(names) {
1992
- for (const name of names) {
1993
- try {
1994
- await unlink2(this.recordPath(name));
1995
- } catch (e) {
1996
- if (!isMissing(e)) throw e;
1997
- }
1998
- }
1999
- }
2000
- async clear() {
2001
- await this.delete(await this.listNames());
2002
- }
2003
- async close() {
2004
- }
2005
- /**
2006
- * Block until this record's lockfile is held; handle to release.
2007
- *
2008
- * For callers doing a read-modify-write that is not generation-CAS
2009
- * (e.g. the single-file namespace plane); spins past contention and
2010
- * reclaims stale locks, throwing only if a live writer holds the
2011
- * lock for the whole retry budget (~10s).
2012
- */
2013
- async lock(name) {
2014
- await mkdir2(this.dir, { recursive: true });
2015
- const lockPath = `${this.recordPath(name)}.lock`;
2016
- for (let i = 0; i < LOCK_RETRY_LIMIT; i++) {
2017
- const fh = await this.acquireLock(lockPath);
2018
- if (fh !== null) return fh;
2019
- if (await this.reclaimStaleLock(lockPath)) continue;
2020
- await new Promise((r) => setTimeout(r, LOCK_RETRY_SLEEP_MS));
2021
- }
2022
- throw new Error(`could not acquire lock ${lockPath}`);
2023
- }
2024
- async unlock(name, fh) {
2025
- await this.releaseLock(fh, `${this.recordPath(name)}.lock`);
2026
- }
2027
- // O_CREAT|O_EXCL ('wx'): filesystem-atomic mutex, the git protocol.
2028
- // Local filesystems only (O_EXCL is unreliable on ancient NFS, the
2029
- // same caveat git ships with).
2030
- async acquireLock(lockPath) {
2031
- let fh;
2032
- try {
2033
- fh = await open(lockPath, "wx");
2034
- } catch (e) {
2035
- if (e.code === "EEXIST") return null;
2036
- throw e;
2037
- }
2038
- await fh.write(String(process.pid));
2039
- return fh;
2040
- }
2041
- // True when the lock is gone or was stale and removed; false when a
2042
- // live writer still holds it.
2043
- async reclaimStaleLock(lockPath) {
2044
- let mtimeMs2;
2045
- try {
2046
- mtimeMs2 = (await stat3(lockPath)).mtimeMs;
2047
- } catch (e) {
2048
- if (isMissing(e)) return true;
2049
- throw e;
2050
- }
2051
- const age = (Date.now() - mtimeMs2) / 1e3;
2052
- if (age <= LOCK_STALE_SECONDS) return false;
2053
- console.warn(`mirage: reclaiming stale lock ${lockPath} (age ${age.toFixed(1)}s)`);
2054
- try {
2055
- await unlink2(lockPath);
2056
- } catch (e) {
2057
- if (!isMissing(e)) throw e;
2058
- }
2059
- return true;
2060
- }
2061
- async releaseLock(fh, lockPath) {
2062
- await fh.close();
2063
- try {
2064
- await unlink2(lockPath);
2065
- } catch (e) {
2066
- if (!isMissing(e)) throw e;
2067
- console.warn(`mirage: lock ${lockPath} vanished before release (reclaimed?)`);
2068
- }
2069
- }
2070
- async writeRecord(target, fields) {
2071
- const tmp = `${target}.${String(process.pid)}.${String(tmpCounter++)}.tmp`;
2072
- await writeFile2(tmp, JSON.stringify(fields));
2073
- await rename(tmp, target);
2074
- }
2075
- };
2076
-
2077
- // src/workspace/namespace/disk.ts
2078
- var NAMESPACE_RECORD = "namespace";
2079
- var DiskNamespaceStore = class extends NamespaceStore {
2080
- records;
2081
- constructor(root) {
2082
- super();
2083
- this.records = new DiskRecordClient(root, "");
2084
- }
2085
- async state() {
2086
- const [fields] = await this.records.get(NAMESPACE_RECORD);
2087
- if (fields === null) return { nodes: {}, user: null };
2088
- return {
2089
- nodes: fields.nodes ?? {},
2090
- user: typeof fields.user === "string" ? fields.user : null
2091
- };
2092
- }
2093
- async write(state) {
2094
- await this.records.put(NAMESPACE_RECORD, { nodes: state.nodes, user: state.user });
2095
- }
2096
- async load() {
2097
- return new Map(Object.entries((await this.state()).nodes));
2098
- }
2099
- async set(path4, fields) {
2100
- const fh = await this.records.lock(NAMESPACE_RECORD);
2101
- try {
2102
- const state = await this.state();
2103
- state.nodes[path4] = fields;
2104
- await this.write(state);
2105
- } finally {
2106
- await this.records.unlock(NAMESPACE_RECORD, fh);
2107
- }
2108
- }
2109
- async delete(paths) {
2110
- const fh = await this.records.lock(NAMESPACE_RECORD);
2111
- try {
2112
- const state = await this.state();
2113
- const drop = new Set(paths);
2114
- state.nodes = Object.fromEntries(
2115
- Object.entries(state.nodes).filter(([path4]) => !drop.has(path4))
2116
- );
2117
- await this.write(state);
2118
- } finally {
2119
- await this.records.unlock(NAMESPACE_RECORD, fh);
2120
- }
2121
- }
2122
- async replaceAll(entries) {
2123
- const fh = await this.records.lock(NAMESPACE_RECORD);
2124
- try {
2125
- const state = await this.state();
2126
- state.nodes = Object.fromEntries(entries);
2127
- await this.write(state);
2128
- } finally {
2129
- await this.records.unlock(NAMESPACE_RECORD, fh);
2130
- }
2131
- }
2132
- async loadUser() {
2133
- return (await this.state()).user;
2134
- }
2135
- async setUser(user) {
2136
- const fh = await this.records.lock(NAMESPACE_RECORD);
2137
- try {
2138
- const state = await this.state();
2139
- state.user = user;
2140
- await this.write(state);
2141
- } finally {
2142
- await this.records.unlock(NAMESPACE_RECORD, fh);
2143
- }
2144
- }
2145
- async clear() {
2146
- const fh = await this.records.lock(NAMESPACE_RECORD);
2147
- try {
2148
- await this.write({ nodes: {}, user: null });
2149
- } finally {
2150
- await this.records.unlock(NAMESPACE_RECORD, fh);
2151
- }
2152
- }
2153
- async close() {
2154
- await this.records.close();
2155
- }
2156
- };
2157
-
2158
- // src/workspace/namespace/redis.ts
2159
- import { NamespaceStore as NamespaceStore2 } from "@struktoai/mirage-core";
2160
- var RedisNamespaceStore = class extends NamespaceStore2 {
2161
- url;
2162
- key;
2163
- userKey;
2164
- clientPromise = null;
2165
- constructor(options = {}) {
2166
- super();
2167
- this.url = options.url ?? "redis://localhost:6379/0";
2168
- const prefix = options.keyPrefix ?? "mirage:namespace:";
2169
- this.key = `${prefix}nodes`;
2170
- this.userKey = `${prefix}user`;
2171
- }
2172
- async client() {
2173
- this.clientPromise ??= (async () => {
2174
- const mod = await loadOptionalPeer(
2175
- () => import("redis"),
2176
- { feature: "RedisNamespaceStore", packageName: "redis" }
2177
- );
2178
- const c = mod.createClient({
2179
- url: this.url,
2180
- socket: { reconnectStrategy: false }
2181
- });
2182
- await c.connect();
2183
- return c;
2184
- })();
2185
- return this.clientPromise;
2186
- }
2187
- async load() {
2188
- const c = await this.client();
2189
- const raw = await c.hGetAll(this.key);
2190
- const out = /* @__PURE__ */ new Map();
2191
- for (const [path4, value] of Object.entries(raw)) {
2192
- out.set(path4, JSON.parse(value));
2193
- }
2194
- return out;
2195
- }
2196
- async set(path4, fields) {
2197
- const c = await this.client();
2198
- await c.hSet(this.key, path4, JSON.stringify(fields));
2199
- }
2200
- async delete(paths) {
2201
- if (paths.length === 0) return;
2202
- const c = await this.client();
2203
- await c.hDel(this.key, [...paths]);
2204
- }
2205
- async replaceAll(entries) {
2206
- const c = await this.client();
2207
- const multi = c.multi().del(this.key);
2208
- for (const [path4, fields] of entries) {
2209
- multi.hSet(this.key, path4, JSON.stringify(fields));
2210
- }
2211
- await multi.exec();
2212
- }
2213
- async loadUser() {
2214
- const c = await this.client();
2215
- return c.get(this.userKey);
2216
- }
2217
- async setUser(user) {
2218
- const c = await this.client();
2219
- await c.set(this.userKey, user);
2220
- }
2221
- async clear() {
2222
- const c = await this.client();
2223
- await c.del([this.key, this.userKey]);
2224
- }
2225
- async close() {
2226
- if (this.clientPromise === null) return;
2227
- const pending = this.clientPromise;
2228
- this.clientPromise = null;
2229
- const c = await pending;
2230
- await c.quit();
2231
- }
2232
- };
2233
-
2234
- // src/workspace/session/disk.ts
2235
- import { SessionStore } from "@struktoai/mirage-core";
2236
- var DiskSessionStore = class extends SessionStore {
2237
- records;
2238
- constructor(root) {
2239
- super();
2240
- this.records = new DiskRecordClient(root, "sessions/");
2241
- }
2242
- async load() {
2243
- return await this.records.loadAll();
2244
- }
2245
- async set(sessionId, fields) {
2246
- await this.records.put(sessionId, fields);
2247
- }
2248
- async casSet(sessionId, fields, expectedGeneration) {
2249
- return await this.records.casPut(sessionId, fields, expectedGeneration);
2250
- }
2251
- async delete(sessionIds) {
2252
- await this.records.delete(sessionIds);
2253
- }
2254
- async replaceAll(entries) {
2255
- const stale = (await this.records.listNames()).filter((n) => !entries.has(n));
2256
- await this.records.delete(stale);
2257
- await Promise.all([...entries].map(([sid, fields]) => this.records.put(sid, fields)));
2258
- }
2259
- async clear() {
2260
- await this.records.clear();
2261
- }
2262
- async close() {
2263
- await this.records.close();
2264
- }
2265
- };
2266
-
2267
- // src/workspace/session/redis.ts
2268
- import { readFileSync as readFileSync3 } from "fs";
2269
- import { SessionStore as SessionStore2 } from "@struktoai/mirage-core";
2270
- var CAS_SCRIPT = readFileSync3(new URL("./cas.lua", import.meta.url), "utf8");
2271
- var RedisSessionStore = class extends SessionStore2 {
2272
- url;
2273
- key;
2274
- clientPromise = null;
2275
- constructor(options = {}) {
2276
- super();
2277
- this.url = options.url ?? "redis://localhost:6379/0";
2278
- const prefix = options.keyPrefix ?? "mirage:session:";
2279
- this.key = `${prefix}sessions`;
2280
- }
2281
- async client() {
2282
- this.clientPromise ??= (async () => {
2283
- const mod = await loadOptionalPeer(
2284
- () => import("redis"),
2285
- { feature: "RedisSessionStore", packageName: "redis" }
2286
- );
2287
- const c = mod.createClient({
2288
- url: this.url,
2289
- socket: { reconnectStrategy: false }
2290
- });
2291
- await c.connect();
2292
- return c;
2293
- })();
2294
- return this.clientPromise;
2295
- }
2296
- // One atomic server-side compare-and-set: Lua reads the stored
2297
- // record's generation and writes only on a match.
2298
- async casSet(sessionId, fields, expectedGeneration) {
2299
- const c = await this.client();
2300
- const result = await c.eval(CAS_SCRIPT, {
2301
- keys: [this.key],
2302
- arguments: [sessionId, JSON.stringify(fields), String(expectedGeneration)]
2303
- });
2304
- return result === 1;
2305
- }
2306
- async load() {
2307
- const c = await this.client();
2308
- const raw = await c.hGetAll(this.key);
2309
- const out = /* @__PURE__ */ new Map();
2310
- for (const [sid, value] of Object.entries(raw)) {
2311
- out.set(sid, JSON.parse(value));
2312
- }
2313
- return out;
2314
- }
2315
- async set(sessionId, fields) {
2316
- const c = await this.client();
2317
- await c.hSet(this.key, sessionId, JSON.stringify(fields));
2318
- }
2319
- async delete(sessionIds) {
2320
- if (sessionIds.length === 0) return;
2321
- const c = await this.client();
2322
- await c.hDel(this.key, [...sessionIds]);
2323
- }
2324
- async replaceAll(entries) {
2325
- const c = await this.client();
2326
- const multi = c.multi().del(this.key);
2327
- for (const [sid, fields] of entries) {
2328
- multi.hSet(this.key, sid, JSON.stringify(fields));
2329
- }
2330
- await multi.exec();
2331
- }
2332
- async clear() {
2333
- const c = await this.client();
2334
- await c.del(this.key);
2335
- }
2336
- async close() {
2337
- if (this.clientPromise === null) return;
2338
- const pending = this.clientPromise;
2339
- this.clientPromise = null;
2340
- const c = await pending;
2341
- await c.quit();
2342
- }
2343
- };
2344
-
2345
- // src/workspace/store/disk.ts
2346
- import { homedir } from "os";
2347
- import path3 from "path";
2348
- import {
2349
- WorkspaceStateStore
2350
- } from "@struktoai/mirage-core";
2351
- var DEFAULT_STATE_ROOT = "~/.mirage/state";
2352
- function expandHome(p) {
2353
- if (p === "~") return homedir();
2354
- if (p.startsWith("~/")) return path3.join(homedir(), p.slice(2));
2355
- return p;
2356
- }
2357
- function quoteSegment(name) {
2358
- return encodeURIComponent(name).replace(
2359
- /[!'()*]/g,
2360
- (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`
2361
- );
2362
- }
2363
- var DiskWorkspaceStateStore = class extends WorkspaceStateStore {
2364
- root;
2365
- meta = /* @__PURE__ */ new Map();
2366
- namespaces = /* @__PURE__ */ new Map();
2367
- observers = /* @__PURE__ */ new Map();
2368
- sessionTables = /* @__PURE__ */ new Map();
2369
- constructor(options = {}) {
2370
- const { root, ...overrides } = options;
2371
- super(overrides);
2372
- this.root = expandHome(root ?? DEFAULT_STATE_ROOT);
2373
- }
2374
- wsRoot(workspaceId) {
2375
- return path3.join(this.root, "workspaces", quoteSegment(workspaceId));
2376
- }
2377
- metaClient(workspaceId) {
2378
- let client = this.meta.get(workspaceId);
2379
- if (client === void 0) {
2380
- client = new DiskRecordClient(this.wsRoot(workspaceId), "");
2381
- this.meta.set(workspaceId, client);
2382
- }
2383
- return client;
2384
- }
2385
- makeNamespace(workspaceId) {
2386
- let ns = this.namespaces.get(workspaceId);
2387
- if (ns === void 0) {
2388
- ns = new DiskNamespaceStore(this.wsRoot(workspaceId));
2389
- this.namespaces.set(workspaceId, ns);
2390
- }
2391
- return ns;
2392
- }
2393
- makeObserver(workspaceId) {
2394
- let ob = this.observers.get(workspaceId);
2395
- if (ob === void 0) {
2396
- ob = new DiskObserverStore(path3.join(this.wsRoot(workspaceId), "history"));
2397
- this.observers.set(workspaceId, ob);
2398
- }
2399
- return ob;
2400
- }
2401
- makeSessions(workspaceId) {
2402
- let table = this.sessionTables.get(workspaceId);
2403
- if (table === void 0) {
2404
- table = new DiskSessionStore(this.wsRoot(workspaceId));
2405
- this.sessionTables.set(workspaceId, table);
2406
- }
2407
- return table;
2408
- }
2409
- async readMeta(workspaceId) {
2410
- const [fields] = await this.metaClient(workspaceId).get("workspace");
2411
- return fields;
2412
- }
2413
- async writeMeta(workspaceId, fields) {
2414
- await this.metaClient(workspaceId).put("workspace", fields);
2415
- }
2416
- async casWriteMeta(workspaceId, fields, expectedGeneration) {
2417
- return await this.metaClient(workspaceId).casPut("workspace", fields, expectedGeneration);
2418
- }
2419
- async closeSelf() {
2420
- for (const ns of this.namespaces.values()) await ns.close();
2421
- for (const ob of this.observers.values()) await ob.close();
2422
- for (const table of this.sessionTables.values()) await table.close();
2423
- for (const client of this.meta.values()) await client.close();
2424
- }
2425
- };
2426
-
2427
- // src/workspace/store/redis.ts
2428
- import {
2429
- WorkspaceStateStore as WorkspaceStateStore2
2430
- } from "@struktoai/mirage-core";
2431
- var RedisWorkspaceStateStore = class extends WorkspaceStateStore2 {
2432
- url;
2433
- prefix;
2434
- metaKey;
2435
- clientPromise = null;
2436
- namespaces = /* @__PURE__ */ new Map();
2437
- observers = /* @__PURE__ */ new Map();
2438
- sessionTables = /* @__PURE__ */ new Map();
2439
- constructor(options = {}) {
2440
- const { url, keyPrefix, ...overrides } = options;
2441
- super(overrides);
2442
- this.url = url ?? "redis://localhost:6379/0";
2443
- this.prefix = keyPrefix ?? "mirage:";
2444
- this.metaKey = `${this.prefix}workspaces`;
2445
- }
2446
- async client() {
2447
- this.clientPromise ??= (async () => {
2448
- const mod = await loadOptionalPeer(
2449
- () => import("redis"),
2450
- { feature: "RedisWorkspaceStateStore", packageName: "redis" }
2451
- );
2452
- const c = mod.createClient({
2453
- url: this.url,
2454
- socket: { reconnectStrategy: false }
2455
- });
2456
- await c.connect();
2457
- return c;
2458
- })();
2459
- return this.clientPromise;
2460
- }
2461
- makeNamespace(workspaceId) {
2462
- let ns = this.namespaces.get(workspaceId);
2463
- if (ns === void 0) {
2464
- ns = new RedisNamespaceStore({
2465
- url: this.url,
2466
- keyPrefix: `${this.prefix}${workspaceId}:namespace:`
2467
- });
2468
- this.namespaces.set(workspaceId, ns);
2469
- }
2470
- return ns;
2471
- }
2472
- makeObserver(workspaceId) {
2473
- let ob = this.observers.get(workspaceId);
2474
- if (ob === void 0) {
2475
- ob = new RedisObserverStore({
2476
- url: this.url,
2477
- keyPrefix: `${this.prefix}${workspaceId}:observer:`
2478
- });
2479
- this.observers.set(workspaceId, ob);
2480
- }
2481
- return ob;
2482
- }
2483
- makeSessions(workspaceId) {
2484
- let table = this.sessionTables.get(workspaceId);
2485
- if (table === void 0) {
2486
- table = new RedisSessionStore({
2487
- url: this.url,
2488
- keyPrefix: `${this.prefix}${workspaceId}:`
2489
- });
2490
- this.sessionTables.set(workspaceId, table);
2491
- }
2492
- return table;
2493
- }
2494
- async readMeta(workspaceId) {
2495
- const c = await this.client();
2496
- const raw = await c.hGet(this.metaKey, workspaceId);
2497
- return raw != null ? JSON.parse(raw) : null;
2498
- }
2499
- async writeMeta(workspaceId, fields) {
2500
- const c = await this.client();
2501
- await c.hSet(this.metaKey, workspaceId, JSON.stringify(fields));
2502
- }
2503
- // Same generic hash-field CAS the session store uses: the meta hash
2504
- // is keyed by workspace id instead of session id.
2505
- async casWriteMeta(workspaceId, fields, expectedGeneration) {
2506
- const c = await this.client();
2507
- const result = await c.eval(CAS_SCRIPT, {
2508
- keys: [this.metaKey],
2509
- arguments: [workspaceId, JSON.stringify(fields), String(expectedGeneration)]
2510
- });
2511
- return result === 1;
2512
- }
2513
- async closeSelf() {
2514
- for (const ns of this.namespaces.values()) await ns.close();
2515
- for (const ob of this.observers.values()) await ob.close();
2516
- for (const table of this.sessionTables.values()) await table.close();
2517
- if (this.clientPromise !== null) {
2518
- const c = await this.clientPromise;
2519
- await c.quit();
2520
- }
2521
- }
2522
- };
2523
-
2524
- // src/fs_monkey.ts
2525
- import { Buffer as Buffer2 } from "buffer";
2526
- import { createRequire as createRequire3 } from "module";
2527
- import { FileType as FileType2 } from "@struktoai/mirage-core";
2528
- var requireCjs3 = createRequire3(import.meta.url);
2529
- var fs = requireCjs3("node:fs");
2530
- var fsMonkey = requireCjs3("fs-monkey");
2531
- var { patchFs } = fsMonkey;
2532
- function mountedPath(ws, p) {
2533
- const m = ws.registry.tryMountFor(p);
2534
- if (m === null) return false;
2535
- if (ws.syntheticRoot && m === ws.registry.rootMount) return false;
2536
- return true;
2537
- }
2538
- async function mirageStat(ws, p) {
2539
- const s = await ws.fs.stat(p);
2540
- const isDir = s.type === FileType2.DIRECTORY;
2541
- const mtime = s.modified !== null ? new Date(s.modified) : /* @__PURE__ */ new Date(0);
2542
- return {
2543
- isFile: () => !isDir,
2544
- isDirectory: () => isDir,
2545
- isBlockDevice: () => false,
2546
- isCharacterDevice: () => false,
2547
- isSymbolicLink: () => false,
2548
- isFIFO: () => false,
2549
- isSocket: () => false,
2550
- size: s.size ?? 0,
2551
- mtime,
2552
- mtimeMs: mtime.getTime(),
2553
- atime: mtime,
2554
- atimeMs: mtime.getTime(),
2555
- ctime: mtime,
2556
- ctimeMs: mtime.getTime(),
2557
- birthtime: mtime,
2558
- birthtimeMs: mtime.getTime(),
2559
- mode: 0,
2560
- nlink: 1,
2561
- uid: 0,
2562
- gid: 0,
2563
- rdev: 0,
2564
- blksize: 0,
2565
- blocks: 0,
2566
- dev: 0,
2567
- ino: 0
2568
- };
2569
- }
2570
- function patchNodeFs(ws) {
2571
- const originalFs = { ...fs };
2572
- const vol = {
2573
- promises: {
2574
- readFile: async (p, opts) => {
2575
- if (mountedPath(ws, p)) {
2576
- const bytes = await ws.fs.readFile(p);
2577
- const encoding = typeof opts === "string" ? opts : opts?.encoding;
2578
- if (encoding !== void 0) return Buffer2.from(bytes).toString(encoding);
2579
- return Buffer2.from(bytes);
2580
- }
2581
- const native = originalFs.promises.readFile;
2582
- return native(p, opts);
2583
- },
2584
- writeFile: async (p, data) => {
2585
- if (mountedPath(ws, p)) {
2586
- await ws.fs.writeFile(p, typeof data === "string" ? data : data);
2587
- return;
2588
- }
2589
- const native = originalFs.promises.writeFile;
2590
- await native(p, data);
2591
- },
2592
- readdir: async (p) => {
2593
- if (mountedPath(ws, p)) {
2594
- const entries = await ws.fs.readdir(p);
2595
- return entries.map((e) => {
2596
- const trimmed = e.endsWith("/") ? e.slice(0, -1) : e;
2597
- return trimmed.slice(trimmed.lastIndexOf("/") + 1);
2598
- });
2599
- }
2600
- const native = originalFs.promises.readdir;
2601
- return native(p);
2602
- },
2603
- stat: async (p) => {
2604
- if (mountedPath(ws, p)) return mirageStat(ws, p);
2605
- const native = originalFs.promises.stat;
2606
- return native(p);
2607
- },
2608
- unlink: async (p) => {
2609
- if (mountedPath(ws, p)) return ws.fs.unlink(p);
2610
- const native = originalFs.promises.unlink;
2611
- await native(p);
2612
- },
2613
- mkdir: async (p) => {
2614
- if (mountedPath(ws, p)) return ws.fs.mkdir(p);
2615
- const native = originalFs.promises.mkdir;
2616
- await native(p);
2617
- },
2618
- rmdir: async (p) => {
2619
- if (mountedPath(ws, p)) return ws.fs.rmdir(p);
2620
- const native = originalFs.promises.rmdir;
2621
- await native(p);
2622
- }
2623
- },
2624
- readFileSync: () => {
2625
- throw new Error("mirage.patchNodeFs: sync fs methods not supported \u2014 use fs.promises.*");
2626
- },
2627
- readFile: (p, cb) => {
2628
- if (mountedPath(ws, p)) {
2629
- ws.fs.readFile(p).then((data) => {
2630
- cb(null, Buffer2.from(data));
2631
- }).catch((err) => {
2632
- cb(err);
2633
- });
2634
- return;
2635
- }
2636
- const native = originalFs.readFile;
2637
- native(p, cb);
2638
- },
2639
- readdir: (p, cb) => {
2640
- if (mountedPath(ws, p)) {
2641
- ws.fs.readdir(p).then((entries) => {
2642
- cb(
2643
- null,
2644
- entries.map((e) => {
2645
- const trimmed = e.endsWith("/") ? e.slice(0, -1) : e;
2646
- return trimmed.slice(trimmed.lastIndexOf("/") + 1);
2647
- })
2648
- );
2649
- }).catch((err) => {
2650
- cb(err);
2651
- });
2652
- return;
2653
- }
2654
- const native = originalFs.readdir;
2655
- native(p, cb);
2656
- }
2657
- };
2658
- patchFs(vol, fs);
2659
- return function restore() {
2660
- for (const [k, v] of Object.entries(originalFs)) {
2661
- const desc = Object.getOwnPropertyDescriptor(fs, k);
2662
- if (desc?.writable === false && desc.set === void 0) continue;
2663
- try {
2664
- fs[k] = v;
2665
- } catch {
2666
- }
2667
- }
2668
- };
2669
- }
2670
-
2671
- // src/commands/builtin/redis/provision.ts
2672
- import {
2673
- Precision,
2674
- ProvisionResult
2675
- } from "@struktoai/mirage-core";
2676
- async function resolveSizes(accessor, paths, index) {
2677
- const resolved = [];
2678
- let missing = 0;
2679
- for (const p of paths) {
2680
- const pathStr = p.virtual;
2681
- let size = null;
2682
- if (index !== void 0) {
2683
- const lookup = await index.get(pathStr);
2684
- if (lookup.entry !== void 0 && lookup.entry !== null) {
2685
- size = lookup.entry.size;
2686
- }
2687
- }
2688
- if (size === null) {
2689
- try {
2690
- const fileStat = await stat(accessor, p);
2691
- size = fileStat.size;
2692
- } catch {
2693
- }
2694
- }
2695
- if (size !== null) {
2696
- resolved.push([pathStr, size]);
2697
- } else {
2698
- missing += 1;
2699
- }
2700
- }
2701
- return { resolved, missing };
2702
- }
2703
- async function fileReadProvision(accessor, paths, _texts, _opts) {
2704
- if (paths.length === 0) {
2705
- return new ProvisionResult({ precision: Precision.UNKNOWN });
2706
- }
2707
- const { resolved, missing } = await resolveSizes(accessor, paths, void 0);
2708
- if (missing > 0 || resolved.length === 0) {
2709
- return new ProvisionResult({ precision: Precision.UNKNOWN });
2710
- }
2711
- const total = resolved.reduce((sum, [, size]) => sum + size, 0);
2712
- return new ProvisionResult({
2713
- networkReadLow: total,
2714
- networkReadHigh: total,
2715
- readOps: resolved.length,
2716
- precision: Precision.EXACT
2717
- });
2718
- }
2719
- async function headTailProvision(accessor, paths, _texts, _opts) {
2720
- if (paths.length === 0) {
2721
- return new ProvisionResult({ precision: Precision.UNKNOWN });
2722
- }
2723
- const { resolved, missing } = await resolveSizes(accessor, paths, void 0);
2724
- if (missing > 0 || resolved.length === 0) {
2725
- return new ProvisionResult({ precision: Precision.UNKNOWN });
2726
- }
2727
- const total = resolved.reduce((sum, [, size]) => sum + size, 0);
2728
- return new ProvisionResult({
2729
- networkReadLow: total,
2730
- networkReadHigh: total,
2731
- readOps: resolved.length,
2732
- precision: Precision.EXACT
2733
- });
2734
- }
2735
- function metadataProvision(_accessor, paths, _texts, _opts) {
2736
- const n = Math.max(1, paths.length > 0 ? paths.length : 1);
2737
- return new ProvisionResult({
2738
- networkReadLow: 0,
2739
- networkReadHigh: 0,
2740
- readOps: n,
2741
- precision: Precision.EXACT
2742
- });
2743
- }
2744
-
2745
- // src/cache/redis/file.ts
2746
- import {
2747
- CacheType,
2748
- defaultFingerprint,
2749
- globEscape,
2750
- parseLimit,
2751
- registerFileCacheStore,
2752
- validateMaxDrainBytes
2753
- } from "@struktoai/mirage-core";
2754
- var RedisFileCacheStore = class extends RedisResource {
2755
- // Advisory only: unlike the RAM store there is no client-side LRU, so
2756
- // nothing evicts on overflow. Cap memory on the Redis server instead
2757
- // (maxmemory + maxmemory-policy allkeys-lru) to approximate the RAM
2758
- // store's eviction behavior.
2759
- limit;
2760
- dataPrefix;
2761
- metaPrefix;
2762
- maxDrainBytesValue = null;
2763
- drainTasks = /* @__PURE__ */ new Map();
2764
- constructor(options = {}) {
2765
- super({
2766
- url: options.url ?? "redis://localhost:6379/0",
2767
- keyPrefix: options.keyPrefix ?? "mirage:cache:"
2768
- });
2769
- this.limit = parseLimit(options.cacheLimit ?? "512MB");
2770
- this.dataPrefix = `${this.keyPrefix}data:`;
2771
- this.metaPrefix = `${this.keyPrefix}meta:`;
2772
- this.maxDrainBytes = options.maxDrainBytes ?? null;
2773
- }
2774
- get maxDrainBytes() {
2775
- return this.maxDrainBytesValue;
2776
- }
2777
- set maxDrainBytes(value) {
2778
- validateMaxDrainBytes(this.limit, value);
2779
- this.maxDrainBytesValue = value;
2780
- }
2781
- // Size lives in the redis server and is not tracked client-side.
2782
- cacheSize = null;
2783
- cacheEntries = null;
2784
- get cacheLimit() {
2785
- return this.limit;
2786
- }
2787
- cacheClient() {
2788
- return this.store.client();
2789
- }
2790
- async get(key) {
2791
- const c = await this.cacheClient();
2792
- const mod = await this.module();
2793
- const blob = mod.RESP_TYPES.BLOB_STRING;
2794
- const mapping = { [blob]: Buffer };
2795
- const typed = c;
2796
- const raw = await typed.withTypeMapping(mapping).get(`${this.dataPrefix}${key}`);
2797
- if (raw === null) return null;
2798
- return new Uint8Array(raw.buffer, raw.byteOffset, raw.byteLength);
2799
- }
2800
- async set(key, data, options = {}) {
2801
- const fp = options.fingerprint ?? defaultFingerprint(data);
2802
- const c = await this.cacheClient();
2803
- const dk = `${this.dataPrefix}${key}`;
2804
- const mk = `${this.metaPrefix}${key}`;
2805
- const pipe = c.multi();
2806
- pipe.set(dk, Buffer.from(data.buffer, data.byteOffset, data.byteLength));
2807
- pipe.set(mk, fp);
2808
- if (options.ttl !== null && options.ttl !== void 0) {
2809
- pipe.expire(dk, options.ttl);
2810
- pipe.expire(mk, options.ttl);
2811
- }
2812
- await pipe.exec();
2813
- }
2814
- async add(key, data, options = {}) {
2815
- const c = await this.cacheClient();
2816
- const exists = await c.exists(`${this.dataPrefix}${key}`);
2817
- if (exists) return false;
2818
- await this.set(key, data, options);
2819
- return true;
2820
- }
2821
- async remove(key) {
2822
- this.drainTasks.delete(key);
2823
- const c = await this.cacheClient();
2824
- const pipe = c.multi();
2825
- pipe.del(`${this.dataPrefix}${key}`);
2826
- pipe.del(`${this.metaPrefix}${key}`);
2827
- await pipe.exec();
2828
- }
2829
- async exists(key) {
2830
- const k = typeof key === "string" ? key : key.mountPath;
2831
- const c = await this.cacheClient();
2832
- return await c.exists(`${this.dataPrefix}${k}`) > 0;
2833
- }
2834
- async isFresh(key, remoteFingerprint) {
2835
- const c = await this.cacheClient();
2836
- const fp = await c.get(`${this.metaPrefix}${key}`);
2837
- if (fp === null) return false;
2838
- return fp === remoteFingerprint;
2839
- }
2840
- async evictPrefix(prefix) {
2841
- for (const key of [...this.drainTasks.keys()]) {
2842
- if (key.startsWith(prefix)) this.drainTasks.delete(key);
2843
- }
2844
- const escaped = globEscape(prefix);
2845
- const c = await this.cacheClient();
2846
- for (const base of [this.dataPrefix, this.metaPrefix]) {
2847
- const batch = [];
2848
- for await (const k of c.scanIterator({ MATCH: `${base}${escaped}*` })) {
2849
- if (Array.isArray(k)) batch.push(...k);
2850
- else batch.push(k);
2851
- }
2852
- if (batch.length > 0) await c.del(batch);
2853
- }
2854
- }
2855
- evictPaths(_paths) {
2856
- }
2857
- async clear() {
2858
- this.drainTasks.clear();
2859
- const c = await this.cacheClient();
2860
- for (const pattern of [`${this.dataPrefix}*`, `${this.metaPrefix}*`]) {
2861
- const batch = [];
2862
- for await (const k of c.scanIterator({ MATCH: pattern })) {
2863
- if (Array.isArray(k)) batch.push(...k);
2864
- else batch.push(k);
2865
- }
2866
- if (batch.length > 0) await c.del(batch);
2867
- }
2868
- }
2869
- async allCached(keys) {
2870
- for (const k of keys) {
2871
- if (!await this.exists(k)) return false;
2872
- }
2873
- return true;
2874
- }
2875
- async multiGet(keys) {
2876
- const out = [];
2877
- for (const k of keys) out.push(await this.get(k));
2878
- return out;
2879
- }
2880
- };
2881
- registerFileCacheStore(CacheType.REDIS, (config) => {
2882
- return new RedisFileCacheStore({
2883
- ...config.limit !== void 0 ? { cacheLimit: config.limit } : {},
2884
- ...config.maxDrainBytes !== void 0 ? { maxDrainBytes: config.maxDrainBytes } : {},
2885
- ...config.url !== void 0 ? { url: config.url } : {},
2886
- ...config.keyPrefix !== void 0 ? { keyPrefix: config.keyPrefix } : {}
2887
- });
2888
- });
2889
-
2890
- // src/resource/hf_models/config.ts
2891
- var normalizeHfModelsConfig = normalizeHfRepoConfig;
2892
- var redactHfModelsConfig = redactHfRepoConfig;
2893
-
2894
- // src/index.ts
2895
- import {
2896
- normalizeSlackConfig,
2897
- redactSlackConfig
2898
- } from "@struktoai/mirage-core";
2899
- import {
2900
- normalizeDiscordConfig,
2901
- redactDiscordConfig
2902
- } from "@struktoai/mirage-core";
2903
- import {
2904
- normalizeLinearConfig,
2905
- redactLinearConfig
2906
- } from "@struktoai/mirage-core";
2907
- import {
2908
- normalizeNotionConfig,
2909
- redactNotionConfig
2910
- } from "@struktoai/mirage-core";
2911
- import {
2912
- Mem0Resource,
2913
- OneDriveResource,
2914
- SharePointResource
2915
- } from "@struktoai/mirage-core";
2916
-
2917
- // src/commands/cli/builtin/himalaya/index.ts
2918
- import { CLISpec, Operand, Option, registerCliSpec } from "@struktoai/mirage-core";
2919
-
2920
- // src/commands/cli/builtin/himalaya/compose.ts
2921
- import { FlagView } from "@struktoai/mirage-core";
2922
-
2923
- // src/commands/cli/builtin/himalaya/util.ts
2924
- import {
2925
- mimeTypeFor,
2926
- IOResult,
2927
- PathSpec,
2928
- isMissingPath
2929
- } from "@struktoai/mirage-core";
2930
-
2931
- // src/commands/cli/builtin/himalaya/builder.ts
2932
- import { createHash } from "crypto";
2933
- import {
2934
- assertHeaderValue,
2935
- encodeBase64Lines,
2936
- encodeMimeText as encodeText,
2937
- foldAddressList,
2938
- foldContentDisposition,
2939
- foldUnstructured,
2940
- materialize
2941
- } from "@struktoai/mirage-core";
2942
- var PREFIXES = { reply: "Re: ", forward: "Fwd: " };
2943
- var ENC2 = new TextEncoder();
2944
- function mixedBoundary(body, attachments) {
2945
- const digest = createHash("sha256").update(Buffer.from(body, "utf8"));
2946
- for (const attachment of attachments) {
2947
- digest.update(Buffer.from(attachment.filename, "utf8"));
2948
- digest.update(Buffer.from(attachment.contentType, "utf8"));
2949
- digest.update(attachment.data);
2950
- }
2951
- return digest.digest("hex").slice(0, 32);
2952
- }
2953
- function splitAddresses(values) {
2954
- return values.flatMap(
2955
- (value) => value.split(",").map((part) => part.trim()).filter((part) => part !== "")
2956
- );
2957
- }
2958
- function formatAddress(entry) {
2959
- const email = entry.email.trim();
2960
- const name = entry.name.trim();
2961
- return name !== "" && email !== "" ? `${name} <${email}>` : email;
2962
- }
2963
- function hasPrefix(subject, prefix) {
2964
- const head = subject.trimStart();
2965
- const marker = prefix.trim();
2966
- return head.slice(0, marker.length).toLowerCase() === marker.toLowerCase();
2967
- }
2968
- function replyRecipients(message) {
2969
- if (message.reply_to.length > 0) return message.reply_to.map((entry) => formatAddress(entry));
2970
- const rendered = formatAddress(message.from);
2971
- return rendered === "" ? [] : [rendered];
2972
- }
2973
- function quoteText(sourceText, headline) {
2974
- const trimmed = sourceText.trim();
2975
- if (trimmed === "") return "";
2976
- const lines = [];
2977
- if (headline.trim() !== "") lines.push(headline.replace(/\n+$/, ""));
2978
- for (const line of trimmed.split("\n")) {
2979
- lines.push(line.startsWith(">") ? `>${line}` : `> ${line}`);
2980
- }
2981
- return lines.join("\n");
2982
- }
2983
- function composeBody(userBody, quote2, signature, style) {
2984
- let body = userBody.replace(/\n+$/, "");
2985
- if (quote2 !== "") {
2986
- if (body === "") body = quote2;
2987
- else if (style === "bottom") body = `${quote2}
2988
-
2989
- ${body}`;
2990
- else body = `${body}
2991
-
2992
- ${quote2}`;
2993
- }
2994
- if (signature.trim() !== "") body = `${body}
2995
-
2996
- --
2997
- ${signature.replace(/\n+$/, "")}`;
2998
- return body;
2999
- }
3000
- function build(compose2, source = null) {
3001
- let recipients = [...compose2.to];
3002
- let subject = compose2.subject;
3003
- let sourceText = "";
3004
- const headLines = [foldAddressList("From", [compose2.sender])];
3005
- if (source !== null) {
3006
- const original = source.message;
3007
- const prefix = PREFIXES[source.mode];
3008
- subject ??= hasPrefix(original.subject, prefix) ? original.subject : `${prefix}${original.subject}`;
3009
- if (source.mode === "reply" && recipients.length === 0) {
3010
- recipients = replyRecipients(original);
3011
- }
3012
- if (original.message_id !== "") {
3013
- if (source.mode === "reply") {
3014
- headLines.push(foldUnstructured("In-Reply-To", original.message_id));
3015
- }
3016
- headLines.push(
3017
- foldUnstructured("References", [...original.references, original.message_id].join(" "))
3018
- );
3019
- }
3020
- sourceText = original.body_text;
3021
- }
3022
- if (recipients.length === 0) throw new Error("no recipient: pass --to");
3023
- for (const value of [
3024
- compose2.sender,
3025
- ...recipients,
3026
- ...compose2.cc,
3027
- ...compose2.bcc,
3028
- subject ?? ""
3029
- ]) {
3030
- assertHeaderValue(value);
3031
- }
3032
- headLines.push(foldAddressList("To", recipients));
3033
- if (compose2.cc.length > 0) headLines.push(foldAddressList("Cc", compose2.cc));
3034
- if (compose2.bcc.length > 0) headLines.push(foldAddressList("Bcc", compose2.bcc));
3035
- headLines.push(foldUnstructured("Subject", subject ?? ""));
3036
- const style = source !== null ? source.postingStyle : "top";
3037
- const headline = source !== null ? source.quoteHeadline : "";
3038
- const body = composeBody(
3039
- compose2.body,
3040
- quoteText(sourceText, headline),
3041
- compose2.signature ?? "",
3042
- style
3043
- );
3044
- const { cte, payload } = encodeText(body);
3045
- const rendered = payload.replaceAll("\n", "\r\n");
3046
- const attachments = compose2.attachments ?? [];
3047
- if (attachments.length === 0) {
3048
- headLines.push('Content-Type: text/plain; charset="utf-8"');
3049
- headLines.push(`Content-Transfer-Encoding: ${cte}`);
3050
- headLines.push("MIME-Version: 1.0");
3051
- return ENC2.encode(`${headLines.join("\r\n")}\r
3052
- \r
3053
- ${rendered}`);
3054
- }
3055
- const boundary = mixedBoundary(body, attachments);
3056
- headLines.push("MIME-Version: 1.0");
3057
- headLines.push(`Content-Type: multipart/mixed; boundary="${boundary}"`);
3058
- const parts = [
3059
- `Content-Type: text/plain; charset="utf-8"\r
3060
- Content-Transfer-Encoding: ${cte}\r
3061
- \r
3062
- ${rendered}`
3063
- ];
3064
- for (const attachment of attachments) {
3065
- const attachmentHead = `Content-Type: ${attachment.contentType}\r
3066
- Content-Transfer-Encoding: base64\r
3067
- ${foldContentDisposition(attachment.filename)}\r
3068
- MIME-Version: 1.0`;
3069
- const encoded = encodeBase64Lines(attachment.data).replaceAll("\n", "\r\n");
3070
- parts.push(`${attachmentHead}\r
3071
- \r
3072
- ${encoded}`);
3073
- }
3074
- const head = headLines.join("\r\n");
3075
- const joined = parts.join(`\r
3076
- --${boundary}\r
3077
- `);
3078
- return ENC2.encode(`${head}\r
3079
- \r
3080
- --${boundary}\r
3081
- ${joined}\r
3082
- --${boundary}--\r
3083
- `);
3084
- }
3085
- async function readBody(fl, stdin) {
3086
- const inline = fl.asStr("body");
3087
- if (inline !== void 0) return inline;
3088
- if (stdin === null) return "";
3089
- return new TextDecoder().decode(await materialize(stdin));
3090
- }
3091
-
3092
- // src/commands/cli/builtin/himalaya/smtp.ts
3093
- import { loadOptionalPeer as loadOptionalPeer3 } from "@struktoai/mirage-core";
3094
- var transporterCache = /* @__PURE__ */ new WeakMap();
3095
- async function getTransporter(config) {
3096
- const existing = transporterCache.get(config);
3097
- if (existing !== void 0) return existing;
3098
- const mod = await loadOptionalPeer3(
3099
- () => import("nodemailer"),
3100
- { feature: "himalaya message send", packageName: "nodemailer" }
3101
- );
3102
- const transporter = mod.createTransport({
3103
- host: config.smtpHost,
3104
- port: config.smtpPort,
3105
- secure: config.smtpPort === 465,
3106
- auth: { user: config.username, pass: config.password }
3107
- });
3108
- transporterCache.set(config, transporter);
3109
- return transporter;
3110
- }
3111
- async function sendRaw(config, raw) {
3112
- const transporter = await getTransporter(config);
3113
- const parsed = await parseRfc822(raw);
3114
- const recipients = [
3115
- ...parsed.to.map((entry) => entry.email),
3116
- ...parsed.cc.map((entry) => entry.email),
3117
- ...bccAddresses(raw)
3118
- ].filter((email) => email !== "");
3119
- await transporter.sendMail({
3120
- raw: Buffer.from(stripBcc(raw)),
3121
- envelope: { from: parsed.from.email || config.username, to: recipients }
3122
- });
3123
- return parsed;
3124
- }
3125
- function bccAddresses(raw) {
3126
- const addresses = [];
3127
- for (const line of bccLines(raw)) {
3128
- const value = line.replace(/^bcc:/i, "");
3129
- for (const part of value.split(",")) {
3130
- const angled = /<([^>]+)>/.exec(part);
3131
- const email = (angled === null ? part : angled[1] ?? "").trim();
3132
- if (email !== "") addresses.push(email);
3133
- }
3134
- }
3135
- return addresses;
3136
- }
3137
- function bccLines(raw) {
3138
- const text = new TextDecoder().decode(raw);
3139
- const split = text.search(/\r?\n\r?\n/);
3140
- const head = split === -1 ? text : text.slice(0, split);
3141
- const found = [];
3142
- let collecting = false;
3143
- for (const line of head.split(/\r?\n/)) {
3144
- if (/^[ \t]/.test(line)) {
3145
- if (collecting) {
3146
- const last = found.pop() ?? "";
3147
- found.push(`${last} ${line.trim()}`);
3148
- }
3149
- continue;
3150
- }
3151
- collecting = /^bcc:/i.test(line);
3152
- if (collecting) found.push(line);
3153
- }
3154
- return found;
3155
- }
3156
- function stripBcc(raw) {
3157
- const text = new TextDecoder().decode(raw);
3158
- const split = text.search(/\r?\n\r?\n/);
3159
- if (split === -1) return raw;
3160
- const head = text.slice(0, split);
3161
- const rest = text.slice(split);
3162
- const kept = [];
3163
- let dropping = false;
3164
- for (const line of head.split(/\r?\n/)) {
3165
- if (/^[ \t]/.test(line)) {
3166
- if (!dropping) kept.push(line);
3167
- continue;
3168
- }
3169
- dropping = /^bcc:/i.test(line);
3170
- if (!dropping) kept.push(line);
3171
- }
3172
- return new TextEncoder().encode(kept.join("\r\n") + rest);
3173
- }
3174
-
3175
- // src/commands/cli/builtin/himalaya/deliver.ts
3176
- var SENT_ATTRIBUTE = "\\sent";
3177
- var DEFAULT_SENT_FOLDER = "Sent";
3178
- var SEEN_FLAG = "\\Seen";
3179
- async function resolveSentFolder(accessor, configured) {
3180
- if (configured !== null && configured !== "") return configured;
3181
- const entries = await listFolderEntries(accessor);
3182
- const tagged = entries.find((entry) => entry.specialUse?.toLowerCase() === SENT_ATTRIBUTE);
3183
- return tagged?.name ?? DEFAULT_SENT_FOLDER;
3184
- }
3185
- async function saveSentCopy(config, raw, named = null) {
3186
- const accessor = new EmailAccessor(config);
3187
- try {
3188
- const folder = named ?? await resolveSentFolder(accessor, config.sentFolder);
3189
- const imap = await accessor.getImap();
3190
- const result = await imap.append(folder, Buffer.from(raw), [SEEN_FLAG]);
3191
- if (result === false) throw new Error(`${folder}: the server refused the message`);
3192
- return folder;
3193
- } finally {
3194
- await accessor.close();
3195
- }
3196
- }
3197
- async function deliver(config, raw, save = null) {
3198
- const parsed = await sendRaw(config, raw);
3199
- if (save === null && !config.saveCopy) return { parsed, warning: "" };
3200
- try {
3201
- await saveSentCopy(config, raw, save);
3202
- } catch (error) {
3203
- const reason = error instanceof Error ? error.message : String(error);
3204
- return { parsed, warning: `himalaya: sent copy not saved: ${reason}
3205
- ` };
3206
- }
3207
- return { parsed, warning: "" };
3208
- }
3209
-
3210
- // src/commands/cli/builtin/himalaya/util.ts
3211
- var ENC3 = new TextEncoder();
3212
- function addressList(addresses) {
3213
- return addresses.map((entry) => entry.name === "" ? entry.email : `${entry.name} <${entry.email}>`).join(", ");
3214
- }
3215
- function firstText(texts, label) {
3216
- const value = texts[0];
3217
- if (value === void 0) throw new Error(`${label} is required`);
3218
- return value;
3219
- }
3220
- async function loadAttachments(doors, paths) {
3221
- if (paths.length === 0) return [];
3222
- const dispatch = doors?.dispatch;
3223
- if (dispatch === void 0) {
3224
- throw new Error("--attach needs a workspace to read files from");
3225
- }
3226
- const attachments = [];
3227
- for (const path4 of paths) {
3228
- let data;
3229
- try {
3230
- ;
3231
- [data] = await dispatch("read", PathSpec.fromStrPath(path4));
3232
- } catch (err) {
3233
- if (isMissingPath(err)) {
3234
- throw new Error(`read attachment ${path4}: No such file or directory`);
3235
- }
3236
- throw err;
3237
- }
3238
- const trimmed = path4.replace(/\/+$/, "");
3239
- const filename = trimmed.slice(trimmed.lastIndexOf("/") + 1) || "attachment";
3240
- attachments.push({
3241
- filename,
3242
- contentType: mimeTypeFor(filename),
3243
- data: data instanceof Uint8Array ? data : new Uint8Array(data)
3244
- });
3245
- }
3246
- return attachments;
3247
- }
3248
- async function route(config, fl, stdin, source, doors) {
3249
- const raw = build(
3250
- {
3251
- sender: fl.asStr("from") ?? config.username,
3252
- to: splitAddresses(fl.asList("to")),
3253
- cc: splitAddresses(fl.asList("cc")),
3254
- bcc: splitAddresses(fl.asList("bcc")),
3255
- subject: fl.asStr("subject") ?? null,
3256
- body: await readBody(fl, stdin),
3257
- signature: fl.asStr("signature") ?? null,
3258
- attachments: await loadAttachments(doors, fl.asList("attach"))
3259
- },
3260
- source
3261
- );
3262
- const save = fl.asStr("save") ?? null;
3263
- if (!fl.asBool("send")) {
3264
- if (save === null) return [raw, new IOResult()];
3265
- const folder = await saveSentCopy(config, raw, save);
3266
- const filed = await parseRfc822(raw);
3267
- const saved = {
3268
- status: "saved",
3269
- mailbox: folder,
3270
- to: addressList(filed.to),
3271
- subject: filed.subject
3272
- };
3273
- return [ENC3.encode(JSON.stringify(saved)), new IOResult()];
3274
- }
3275
- const { parsed, warning } = await deliver(config, raw, save);
3276
- const result = {
3277
- status: "sent",
3278
- to: addressList(parsed.to),
3279
- subject: parsed.subject
3280
- };
3281
- return [
3282
- ENC3.encode(JSON.stringify(result)),
3283
- new IOResult({ stderr: warning === "" ? null : ENC3.encode(warning) })
3284
- ];
3285
- }
3286
-
3287
- // src/commands/cli/builtin/himalaya/compose.ts
3288
- async function compose(inv) {
3289
- return route(inv.config, new FlagView(inv.flags), inv.stdin, null, inv.doors);
3290
- }
3291
-
3292
- // src/commands/cli/builtin/himalaya/forward.ts
3293
- import { FlagView as FlagView2 } from "@struktoai/mirage-core";
3294
- async function forward(inv) {
3295
- const fl = new FlagView2(inv.flags);
3296
- const uid = firstText(inv.texts, "message id");
3297
- const mailbox = fl.asStr("mailbox") ?? "INBOX";
3298
- const accessor = new EmailAccessor(inv.config);
3299
- let original;
3300
- try {
3301
- original = await fetchMessage(accessor, mailbox, uid);
3302
- } finally {
3303
- await accessor.close();
3304
- }
3305
- return route(
3306
- inv.config,
3307
- fl,
3308
- inv.stdin,
3309
- {
3310
- message: original,
3311
- mode: "forward",
3312
- postingStyle: fl.asStr("posting_style") === "bottom" ? "bottom" : "top",
3313
- quoteHeadline: fl.asStr("quote_headline") ?? ""
3314
- },
3315
- inv.doors
3316
- );
3317
- }
3318
-
3319
- // src/commands/cli/builtin/himalaya/list.ts
3320
- import {
3321
- FlagView as FlagView3,
3322
- IOResult as IOResult2
3323
- } from "@struktoai/mirage-core";
3324
-
3325
- // src/commands/cli/builtin/himalaya/query.ts
3326
- import { compareCodePoints as compareCodePoints3 } from "@struktoai/mirage-core";
3327
- var CONDITIONS = ["date", "before", "after", "from", "to", "subject", "body", "flag"];
3328
- var SORT_KINDS = ["date", "from", "to", "subject"];
3329
- var FLAGS = {
3330
- seen: "SEEN",
3331
- answered: "ANSWERED",
3332
- flagged: "FLAGGED",
3333
- draft: "DRAFT",
3334
- deleted: "DELETED"
3335
- };
3336
- var IMAP_MONTHS = [
3337
- "Jan",
3338
- "Feb",
3339
- "Mar",
3340
- "Apr",
3341
- "May",
3342
- "Jun",
3343
- "Jul",
3344
- "Aug",
3345
- "Sep",
3346
- "Oct",
3347
- "Nov",
3348
- "Dec"
3349
- ];
3350
- var QueryError = class extends Error {
3351
- };
3352
- function tokenize(source) {
3353
- const tokens = [];
3354
- let index = 0;
3355
- while (index < source.length) {
3356
- const char = source.charAt(index);
3357
- if (/\s/.test(char)) {
3358
- index += 1;
3359
- continue;
3360
- }
3361
- if (char === "(" || char === ")") {
3362
- tokens.push({ text: char, quoted: false });
3363
- index += 1;
3364
- continue;
3365
- }
3366
- if (char === '"') {
3367
- index += 1;
3368
- const chars = [];
3369
- while (index < source.length && source.charAt(index) !== '"') {
3370
- if (source.charAt(index) === "\\" && index + 1 < source.length) index += 1;
3371
- chars.push(source.charAt(index));
3372
- index += 1;
3373
- }
3374
- if (index >= source.length) throw new QueryError("unterminated quoted pattern");
3375
- index += 1;
3376
- tokens.push({ text: chars.join(""), quoted: true });
3377
- continue;
3378
- }
3379
- const start = index;
3380
- while (index < source.length && !/[\s()]/.test(source.charAt(index))) index += 1;
3381
- tokens.push({ text: source.slice(start, index), quoted: false });
3382
- }
3383
- return tokens;
3384
- }
3385
- function keyword(token) {
3386
- if (token === void 0 || token.quoted) return null;
3387
- return token.text.toLowerCase();
3388
- }
3389
- function quote(value) {
3390
- return `"${value.replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`;
3391
- }
3392
- function imapDate(text) {
3393
- const parts = text.split("-");
3394
- if (parts.length !== 3) {
3395
- throw new QueryError(`invalid date '${text}', expected yyyy-mm-dd`);
3396
- }
3397
- const year = Number(parts[0]);
3398
- const month = Number(parts[1]);
3399
- const day = Number(parts[2]);
3400
- const value = new Date(Date.UTC(year, month - 1, day));
3401
- if (!Number.isInteger(year) || !Number.isInteger(month) || !Number.isInteger(day) || Number.isNaN(value.getTime()) || value.getUTCMonth() !== month - 1 || value.getUTCDate() !== day) {
3402
- throw new QueryError(`invalid date '${text}'`);
3403
- }
3404
- return value;
3405
- }
3406
- function formatDate(value) {
3407
- const day = String(value.getUTCDate()).padStart(2, "0");
3408
- const month = IMAP_MONTHS[value.getUTCMonth()] ?? "Jan";
3409
- return `${day}-${month}-${String(value.getUTCFullYear())}`;
3410
- }
3411
- var Parser = class {
3412
- constructor(tokens) {
3413
- this.tokens = tokens;
3414
- }
3415
- tokens;
3416
- index = 0;
3417
- peek() {
3418
- return this.tokens[this.index];
3419
- }
3420
- take() {
3421
- const token = this.peek();
3422
- if (token === void 0) throw new QueryError("unexpected end of query");
3423
- this.index += 1;
3424
- return token;
3425
- }
3426
- parseOr() {
3427
- let left = this.parseAnd();
3428
- while (keyword(this.peek()) === "or") {
3429
- this.take();
3430
- left = `OR ${left} ${this.parseAnd()}`;
3431
- }
3432
- return left;
3433
- }
3434
- parseAnd() {
3435
- let left = this.parseUnary();
3436
- while (keyword(this.peek()) === "and") {
3437
- this.take();
3438
- left = `(${left} ${this.parseUnary()})`;
3439
- }
3440
- return left;
3441
- }
3442
- parseUnary() {
3443
- const word = keyword(this.peek());
3444
- if (word === "not") {
3445
- this.take();
3446
- return `NOT ${this.parseUnary()}`;
3447
- }
3448
- if (word === "(") {
3449
- this.take();
3450
- const inner = this.parseOr();
3451
- if (keyword(this.peek()) !== ")") throw new QueryError("missing closing ')'");
3452
- this.take();
3453
- return inner;
3454
- }
3455
- return this.parseCondition();
3456
- }
3457
- parseCondition() {
3458
- const token = this.take();
3459
- const word = keyword(token);
3460
- if (word === null || !CONDITIONS.includes(word)) {
3461
- throw new QueryError(
3462
- `expected a condition (${CONDITIONS.join(", ")}) but found '${token.text}'`
3463
- );
3464
- }
3465
- const value = this.take().text;
3466
- if (word === "date") return `SENTON ${formatDate(imapDate(value))}`;
3467
- if (word === "before") return `SENTBEFORE ${formatDate(imapDate(value))}`;
3468
- if (word === "after") {
3469
- const next = new Date(imapDate(value).getTime() + 864e5);
3470
- return `SENTSINCE ${formatDate(next)}`;
3471
- }
3472
- if (word === "flag") {
3473
- const key = FLAGS[value.toLowerCase()];
3474
- if (key === void 0) {
3475
- throw new QueryError(
3476
- `unknown flag '${value}', expected one of ${Object.keys(FLAGS).sort(compareCodePoints3).join(", ")}`
3477
- );
3478
- }
3479
- return key;
3480
- }
3481
- return `${word.toUpperCase()} ${quote(value)}`;
3482
- }
3483
- parseSorters() {
3484
- this.take();
3485
- if (keyword(this.peek()) !== "by") throw new QueryError("expected 'by' after 'order'");
3486
- this.take();
3487
- const sorters = [];
3488
- for (; ; ) {
3489
- const kind = keyword(this.peek());
3490
- if (kind === null || !SORT_KINDS.includes(kind)) break;
3491
- this.take();
3492
- let descending = false;
3493
- const order = keyword(this.peek());
3494
- if (order === "asc" || order === "desc") {
3495
- this.take();
3496
- descending = order === "desc";
3497
- }
3498
- sorters.push({ kind, descending });
3499
- }
3500
- if (sorters.length === 0) {
3501
- throw new QueryError(`expected a sort key (${SORT_KINDS.join(", ")}) after 'order by'`);
3502
- }
3503
- return sorters;
3504
- }
3505
- };
3506
- function parseQuery(source) {
3507
- const parser = new Parser(tokenize(source));
3508
- let criteria = "ALL";
3509
- const head = keyword(parser.peek());
3510
- if (head !== null && head !== "order") criteria = parser.parseOr();
3511
- let sorters = [];
3512
- if (keyword(parser.peek()) === "order") sorters = parser.parseSorters();
3513
- const leftover = parser.peek();
3514
- if (leftover !== void 0) {
3515
- throw new QueryError(`unexpected '${leftover.text}' at end of query`);
3516
- }
3517
- return { criteria, sorters };
3518
- }
3519
- function sentAt(header) {
3520
- const value = Date.parse(header.date);
3521
- return Number.isNaN(value) ? 0 : value;
3522
- }
3523
- var SORT_KEYS = {
3524
- date: sentAt,
3525
- from: (header) => header.from.email,
3526
- to: (header) => header.to[0]?.email ?? "",
3527
- subject: (header) => header.subject
3528
- };
3529
- function compare(a, b) {
3530
- if (typeof a === "number" && typeof b === "number") return a - b;
3531
- return String(a) < String(b) ? -1 : String(a) > String(b) ? 1 : 0;
3532
- }
3533
- function sortHeaders(headers, sorters) {
3534
- const ordered = [...headers];
3535
- if (sorters.length === 0) {
3536
- ordered.sort((a, b) => sentAt(b) - sentAt(a));
3537
- return ordered;
3538
- }
3539
- for (const sorter of [...sorters].reverse()) {
3540
- const key = SORT_KEYS[sorter.kind];
3541
- ordered.sort((a, b) => sorter.descending ? compare(key(b), key(a)) : compare(key(a), key(b)));
3542
- }
3543
- return ordered;
3544
- }
3545
- function uidBudget(page, pageSize, sorters, maxMessages) {
3546
- if (sorters.length > 0) return maxMessages;
3547
- return Math.min(Math.max(page, 1) * pageSize, maxMessages);
3548
- }
3549
- function pageSlice(items, page, pageSize) {
3550
- const start = Math.max(page - 1, 0) * pageSize;
3551
- return items.slice(start, start + pageSize);
3552
- }
3553
-
3554
- // src/commands/cli/builtin/himalaya/list.ts
3555
- var DEFAULT_PAGE_SIZE = 25;
3556
- async function listEnvelopes(inv) {
3557
- const fl = new FlagView3(inv.flags);
3558
- const mailbox = fl.asStr("mailbox") ?? "INBOX";
3559
- const page = fl.asInt("page") ?? 1;
3560
- const pageSize = fl.asInt("page_size") ?? DEFAULT_PAGE_SIZE;
3561
- const account = inv.config;
3562
- const budget = uidBudget(page, pageSize, [], account.maxMessages);
3563
- const accessor = new EmailAccessor(account);
3564
- let headers;
3565
- try {
3566
- const uids = await listMessageUids(accessor, mailbox, "ALL", budget);
3567
- headers = uids.length > 0 ? await fetchHeaders(accessor, mailbox, uids) : [];
3568
- } finally {
3569
- await accessor.close();
3570
- }
3571
- const pageOf = pageSlice(sortHeaders(headers, []), page, pageSize);
3572
- const out = messagesJsonBytes(pageOf);
3573
- return [out, new IOResult2()];
3574
- }
3575
-
3576
- // src/commands/cli/builtin/himalaya/read.ts
3577
- import {
3578
- FlagView as FlagView4,
3579
- IOResult as IOResult3
3580
- } from "@struktoai/mirage-core";
3581
- async function read(inv) {
3582
- const fl = new FlagView4(inv.flags);
3583
- const uid = firstText(inv.texts, "message id");
3584
- const mailbox = fl.asStr("mailbox") ?? "INBOX";
3585
- const accessor = new EmailAccessor(inv.config);
3586
- try {
3587
- if (fl.asBool("raw")) {
3588
- const raw = await fetchRawMessage(accessor, mailbox, uid);
3589
- return [raw, new IOResult3()];
3590
- }
3591
- const processed = await fetchMessage(accessor, mailbox, uid);
3592
- const out = messageJsonBytes(processed);
3593
- return [out, new IOResult3()];
3594
- } finally {
3595
- await accessor.close();
3596
- }
3597
- }
3598
-
3599
- // src/commands/cli/builtin/himalaya/reply.ts
3600
- import { FlagView as FlagView5 } from "@struktoai/mirage-core";
3601
- async function reply(inv) {
3602
- const fl = new FlagView5(inv.flags);
3603
- const uid = firstText(inv.texts, "message id");
3604
- const mailbox = fl.asStr("mailbox") ?? "INBOX";
3605
- const accessor = new EmailAccessor(inv.config);
3606
- let original;
3607
- try {
3608
- original = await fetchMessage(accessor, mailbox, uid);
3609
- } finally {
3610
- await accessor.close();
3611
- }
3612
- return route(
3613
- inv.config,
3614
- fl,
3615
- inv.stdin,
3616
- {
3617
- message: original,
3618
- mode: "reply",
3619
- postingStyle: fl.asStr("posting_style") === "bottom" ? "bottom" : "top",
3620
- quoteHeadline: fl.asStr("quote_headline") ?? ""
3621
- },
3622
- inv.doors
3623
- );
3624
- }
3625
-
3626
- // src/commands/cli/builtin/himalaya/search.ts
3627
- import {
3628
- FlagView as FlagView6,
3629
- IOResult as IOResult4
3630
- } from "@struktoai/mirage-core";
3631
- async function searchEnvelopes(inv) {
3632
- const fl = new FlagView6(inv.flags);
3633
- const mailbox = fl.asStr("mailbox") ?? "INBOX";
3634
- const page = fl.asInt("page") ?? 1;
3635
- const pageSize = fl.asInt("page_size") ?? DEFAULT_PAGE_SIZE;
3636
- const query = parseQuery(inv.texts.join(" "));
3637
- const account = inv.config;
3638
- const budget = uidBudget(page, pageSize, query.sorters, account.maxMessages);
3639
- const accessor = new EmailAccessor(account);
3640
- let headers;
3641
- try {
3642
- const uids = await listMessageUids(accessor, mailbox, query.criteria, budget);
3643
- headers = uids.length > 0 ? await fetchHeaders(accessor, mailbox, uids) : [];
3644
- } finally {
3645
- await accessor.close();
3646
- }
3647
- const pageOf = pageSlice(sortHeaders(headers, query.sorters), page, pageSize);
3648
- const out = messagesJsonBytes(pageOf);
3649
- return [out, new IOResult4()];
3650
- }
3651
-
3652
- // src/commands/cli/builtin/himalaya/send.ts
3653
- import {
3654
- FlagView as FlagView7,
3655
- IOResult as IOResult5,
3656
- materialize as materialize2
3657
- } from "@struktoai/mirage-core";
3658
- var ENC4 = new TextEncoder();
3659
- async function send(inv) {
3660
- const inline = inv.texts.join(" ").replaceAll("\\r", "").replaceAll("\\n", "\n");
3661
- const raw = inline !== "" ? ENC4.encode(inline) : inv.stdin !== null ? await materialize2(inv.stdin) : new Uint8Array();
3662
- if (new TextDecoder().decode(raw).trim() === "") {
3663
- throw new Error("no message provided: pass it as an argument or pipe it via standard input");
3664
- }
3665
- const fl = new FlagView7(inv.flags);
3666
- const { parsed, warning } = await deliver(
3667
- inv.config,
3668
- raw,
3669
- fl.asStr("save") ?? null
3670
- );
3671
- const result = {
3672
- status: "sent",
3673
- to: parsed.to.map((entry) => entry.name === "" ? entry.email : `${entry.name} <${entry.email}>`).join(", "),
3674
- subject: parsed.subject
3675
- };
3676
- const out = ENC4.encode(JSON.stringify(result));
3677
- return [out, new IOResult5({ stderr: warning === "" ? null : ENC4.encode(warning) })];
3678
- }
3679
-
3680
- // src/commands/cli/builtin/himalaya/index.ts
3681
- var ID = new Operand({ type: "str" });
3682
- var MAILBOX = new Option({
3683
- short: "-m",
3684
- long: "--mailbox",
3685
- type: "str",
3686
- description: "Mailbox name (default: INBOX)"
3687
- });
3688
- var PAGE = new Option({
3689
- short: "-p",
3690
- long: "--page",
3691
- type: "int",
3692
- description: "Page number, starting from 1"
3693
- });
3694
- var PAGE_SIZE = new Option({
3695
- short: "-s",
3696
- long: "--page-size",
3697
- type: "int",
3698
- description: "Maximum envelopes per page"
3699
- });
3700
- var SAVE = new Option({
3701
- long: "--save",
3702
- type: "str",
3703
- metavar: "MAILBOX",
3704
- description: "Append a copy of the message to this mailbox"
3705
- });
3706
- var COMPOSER = [
3707
- new Option({ long: "--from", type: "str", description: "Sender address" }),
3708
- new Option({
3709
- short: "-t",
3710
- long: "--to",
3711
- type: "str",
3712
- multiple: true,
3713
- description: "Recipient address(es), repeatable or comma-separated"
3714
- }),
3715
- new Option({
3716
- long: "--cc",
3717
- type: "str",
3718
- multiple: true,
3719
- description: "Carbon-copy recipient(s)"
3720
- }),
3721
- new Option({
3722
- long: "--bcc",
3723
- type: "str",
3724
- multiple: true,
3725
- description: "Blind carbon-copy recipient(s)"
3726
- }),
3727
- new Option({ short: "-s", long: "--subject", type: "str", description: "Subject line" }),
3728
- new Option({ long: "--body", type: "str", description: "Inline body (or pipe via stdin)" }),
3729
- new Option({
3730
- long: "--attach",
3731
- type: "path",
3732
- multiple: true,
3733
- description: "Attachment file(s), repeatable"
3734
- }),
3735
- new Option({
3736
- long: "--signature",
3737
- type: "str",
3738
- description: "Signature appended after a '-- ' line"
3739
- }),
3740
- new Option({
3741
- long: "--send",
3742
- description: "Send through SMTP instead of writing MIME to stdout"
3743
- }),
3744
- SAVE
3745
- ];
3746
- var QUOTING = [
3747
- new Option({
3748
- short: "-P",
3749
- long: "--posting-style",
3750
- type: "str",
3751
- choices: ["top", "bottom"],
3752
- default: "top",
3753
- description: "Quoted source above or below your body"
3754
- }),
3755
- new Option({
3756
- short: "-Q",
3757
- long: "--quote-headline",
3758
- type: "str",
3759
- description: "Literal line placed before the quoted body"
3760
- })
3761
- ];
3762
- var HIMALAYA = new CLISpec({
3763
- name: "himalaya",
3764
- description: "IMAP/SMTP mail client",
3765
- configModel: EmailConfigSchema,
3766
- subcommands: [
3767
- new CLISpec({
3768
- name: "envelope",
3769
- description: "Manage envelopes",
3770
- subcommands: [
3771
- new CLISpec({
3772
- name: "list",
3773
- aliases: ["ls"],
3774
- description: "List envelopes as JSON headers",
3775
- fn: listEnvelopes,
3776
- options: [MAILBOX, PAGE, PAGE_SIZE]
3777
- }),
3778
- new CLISpec({
3779
- name: "search",
3780
- aliases: ["sr"],
3781
- description: "Search envelopes with the query DSL",
3782
- fn: searchEnvelopes,
3783
- options: [MAILBOX, PAGE, PAGE_SIZE],
3784
- rest: ID,
3785
- epilog: "Conditions: date <yyyy-mm-dd>, before <yyyy-mm-dd>, after <yyyy-mm-dd>, from <pattern>, to <pattern>, subject <pattern>, body <pattern>, flag <seen|answered|flagged|draft|deleted>. Combine with and, or, not; group with parentheses. Sort with order by <date|from|to|subject> [asc|desc]."
3786
- })
3787
- ]
3788
- }),
3789
- new CLISpec({
3790
- name: "message",
3791
- description: "Manage messages",
3792
- subcommands: [
3793
- new CLISpec({
3794
- name: "read",
3795
- description: "Read one message as JSON",
3796
- fn: read,
3797
- options: [
3798
- MAILBOX,
3799
- new Option({ long: "--raw", description: "Write the RFC 5322 bytes instead" })
3800
- ],
3801
- rest: ID
3802
- }),
3803
- new CLISpec({
3804
- name: "compose",
3805
- aliases: ["write", "new"],
3806
- description: "Compose a new message from flags",
3807
- fn: compose,
3808
- write: true,
3809
- options: COMPOSER
3810
- }),
3811
- new CLISpec({
3812
- name: "send",
3813
- description: "Send a raw RFC 5322 message",
3814
- fn: send,
3815
- write: true,
3816
- options: [SAVE],
3817
- rest: ID
3818
- }),
3819
- new CLISpec({
3820
- name: "reply",
3821
- description: "Reply to a message",
3822
- fn: reply,
3823
- write: true,
3824
- options: [MAILBOX, ...COMPOSER, ...QUOTING],
3825
- rest: ID
3826
- }),
3827
- new CLISpec({
3828
- name: "forward",
3829
- aliases: ["fwd"],
3830
- description: "Forward a message",
3831
- fn: forward,
3832
- write: true,
3833
- options: [MAILBOX, ...COMPOSER, ...QUOTING],
3834
- rest: ID
3835
- })
3836
- ]
3837
- })
3838
- ]
3839
- });
3840
- registerCliSpec(HIMALAYA);
3841
-
3842
- // src/runtime/python/local.ts
3843
- import { spawn } from "child_process";
3844
- import {
3845
- HOME_CONFIG_KEYS,
3846
- PythonRuntime,
3847
- registerRuntime as registerRuntime2
3848
- } from "@struktoai/mirage-core";
3849
- var LOCAL_HOME_ENV = "MIRAGE_LOCAL_HOME";
3850
- var LocalRuntime = class extends PythonRuntime {
3851
- name = "local";
3852
- // Spawns the host interpreter: a real process with the user's own
3853
- // filesystem and network, doors the workspace gate never sees. This
3854
- // is the base default; declared here so the claim is explicit at the
3855
- // one builtin runtime that voids a world's sandbox claim.
3856
- reach = "process";
3857
- python;
3858
- children = /* @__PURE__ */ new Set();
3859
- constructor(options = {}) {
3860
- super(options, HOME_CONFIG_KEYS);
3861
- const home = this.config.home;
3862
- const chosen = home !== void 0 && home !== "" ? home : process.env[LOCAL_HOME_ENV];
3863
- this.python = chosen !== void 0 && chosen !== "" ? chosen : "python3";
3864
- }
3865
- run(args) {
3866
- return new Promise((resolve2, reject) => {
3867
- const child = spawn(this.python, ["-c", args.code, ...args.args], {
3868
- stdio: ["pipe", "pipe", "pipe"],
3869
- env: { ...process.env, ...args.env },
3870
- ...args.signal !== void 0 ? { signal: args.signal, killSignal: "SIGKILL" } : {}
3871
- });
3872
- this.children.add(child);
3873
- const out = [];
3874
- const err = [];
3875
- child.stdout.on("data", (chunk) => out.push(chunk));
3876
- child.stderr.on("data", (chunk) => err.push(chunk));
3877
- child.on("error", (error) => {
3878
- if (error.name === "AbortError") return;
3879
- this.children.delete(child);
3880
- reject(
3881
- error.code === "ENOENT" ? new Error(
3882
- `local python interpreter not found: '${this.python}' (set the runtime entry's config home or ${LOCAL_HOME_ENV})`
3883
- ) : error
3884
- );
3885
- });
3886
- child.on("close", (code) => {
3887
- this.children.delete(child);
3888
- const stderr = Buffer.concat(err);
3889
- resolve2({
3890
- stdout: new Uint8Array(Buffer.concat(out)),
3891
- stderr: stderr.length > 0 ? new Uint8Array(stderr) : null,
3892
- exitCode: code ?? 1
3893
- });
3894
- });
3895
- child.stdin.on("error", (error) => {
3896
- if (error.code !== "EPIPE") reject(error);
3897
- });
3898
- if (args.stdin !== null) child.stdin.write(args.stdin);
3899
- child.stdin.end();
3900
- });
3901
- }
3902
- close() {
3903
- for (const child of this.children) child.kill("SIGKILL");
3904
- this.children.clear();
3905
- return Promise.resolve();
3906
- }
3907
- };
3908
- registerRuntime2("local", LocalRuntime);
3909
-
3910
- // src/runtime/sandbox/e2b/runtime.ts
3911
- import {
3912
- loadOptionalPeer as loadOptionalPeer4,
3913
- registerRuntime as registerRuntime3,
3914
- RemoteSandbox as RemoteSandbox2,
3915
- stdinPath as stdinPath2,
3916
- stdinRedirect as stdinRedirect2
3917
- } from "@struktoai/mirage-core";
3918
-
3919
- // src/runtime/sandbox/e2b/config.ts
3920
- var E2B_CONFIG_KEYS = ["env", "sandboxId", "apiKey"];
3921
-
3922
- // src/runtime/sandbox/e2b/runtime.ts
3923
- var ENC5 = new TextEncoder();
3924
- var E2BRuntime = class extends RemoteSandbox2 {
3925
- name = "e2b";
3926
- sdk = null;
3927
- sandbox = null;
3928
- constructor(options = {}) {
3929
- super(options, E2B_CONFIG_KEYS);
3930
- if (!this.config.sandboxId) {
3931
- throw new Error("e2b config needs sandboxId: the id of a live sandbox you created");
3932
- }
3933
- }
3934
- // The SDK loader as a seam: tests substitute a fake module here.
3935
- loadSdk() {
3936
- return loadOptionalPeer4(() => import("e2b"), {
3937
- feature: "the 'e2b' runtime",
3938
- packageName: "e2b"
3939
- });
3940
- }
3941
- async ensureSdk() {
3942
- this.sdk ??= await this.loadSdk();
3943
- return this.sdk;
3944
- }
3945
- apiParams() {
3946
- return this.config.apiKey !== void 0 ? { apiKey: this.config.apiKey } : {};
3947
- }
3948
- async connect() {
3949
- const sdk = await this.ensureSdk();
3950
- this.sandbox = await sdk.Sandbox.connect(this.config.sandboxId, this.apiParams());
3951
- }
3952
- async execLine(line, stdin, env, cwd) {
3953
- if (this.sandbox === null) throw new Error("e2b sandbox not connected");
3954
- const sdk = await this.ensureSdk();
3955
- let command = line;
3956
- if (stdin !== null) {
3957
- const path4 = stdinPath2();
3958
- await this.upload(path4, stdin);
3959
- command = stdinRedirect2(line, path4);
3960
- }
3961
- let result;
3962
- try {
3963
- result = await this.sandbox.commands.run(command, { envs: env, cwd });
3964
- } catch (error) {
3965
- if (!(error instanceof sdk.CommandExitError)) throw error;
3966
- result = error;
3967
- }
3968
- return {
3969
- stdout: ENC5.encode(result.stdout),
3970
- stderr: ENC5.encode(result.stderr),
3971
- exitCode: result.exitCode
3972
- };
3973
- }
3974
- async upload(path4, data) {
3975
- if (this.sandbox === null) throw new Error("e2b sandbox not connected");
3976
- const slash = path4.lastIndexOf("/");
3977
- const parent = slash > 0 ? path4.slice(0, slash) : "";
3978
- if (parent !== "") await this.sandbox.files.makeDir(parent);
3979
- await this.sandbox.files.write(path4, new Blob([data]));
3980
- }
3981
- };
3982
- registerRuntime3("e2b", E2BRuntime);
3983
-
3984
- // src/runtime/sandbox/docker/runtime.ts
3985
- import { spawn as spawn2 } from "child_process";
3986
- import {
3987
- registerRuntime as registerRuntime4,
3988
- RemoteSandbox as RemoteSandbox3
3989
- } from "@struktoai/mirage-core";
3990
-
3991
- // src/runtime/sandbox/docker/config.ts
3992
- var DOCKER_CONFIG_KEYS = ["env", "container"];
3993
-
3994
- // src/runtime/sandbox/docker/constants.ts
3995
- var DOCKER_CLI_HINT = "the docker runtime needs the docker CLI on PATH (Docker Desktop, colima, or a podman alias)";
3996
-
3997
- // src/runtime/sandbox/docker/runtime.ts
3998
- var DockerRuntime = class extends RemoteSandbox3 {
3999
- name = "docker";
4000
- constructor(options = {}) {
4001
- super(options, DOCKER_CONFIG_KEYS);
4002
- if (!this.config.container) {
4003
- throw new Error("docker config needs container: the id or name of a running container");
4004
- }
4005
- }
4006
- // One docker CLI invocation; the seam tests override.
4007
- docker(args, stdin = null) {
4008
- return new Promise((resolve2, reject) => {
4009
- const child = spawn2("docker", args, { stdio: ["pipe", "pipe", "pipe"] });
4010
- const out = [];
4011
- const err = [];
4012
- child.stdout.on("data", (chunk) => out.push(chunk));
4013
- child.stderr.on("data", (chunk) => err.push(chunk));
4014
- child.on("error", (error) => {
4015
- reject(error.code === "ENOENT" ? new Error(DOCKER_CLI_HINT) : error);
4016
- });
4017
- child.on("close", (code) => {
4018
- resolve2({
4019
- stdout: new Uint8Array(Buffer.concat(out)),
4020
- stderr: new Uint8Array(Buffer.concat(err)),
4021
- code: code ?? 1
4022
- });
4023
- });
4024
- child.stdin.on("error", (error) => {
4025
- if (error.code !== "EPIPE") reject(error);
4026
- });
4027
- if (stdin !== null) child.stdin.write(stdin);
4028
- child.stdin.end();
4029
- });
4030
- }
4031
- async connect() {
4032
- const result = await this.docker([
4033
- "inspect",
4034
- "--format",
4035
- "{{.State.Running}}",
4036
- this.config.container
4037
- ]);
4038
- if (result.code !== 0) {
4039
- throw new Error(`docker inspect failed: ${decode(result.stderr).trim()}`);
4040
- }
4041
- if (decode(result.stdout).trim() !== "true") {
4042
- throw new Error(`container ${this.config.container} is not running`);
4043
- }
4044
- }
4045
- async execLine(line, stdin, env, cwd) {
4046
- const args = ["exec", "-i", "-w", cwd];
4047
- for (const [key, value] of Object.entries(env)) args.push("-e", `${key}=${value}`);
4048
- args.push(this.config.container, "sh", "-c", line);
4049
- const result = await this.docker(args, stdin);
4050
- return { stdout: result.stdout, stderr: result.stderr, exitCode: result.code };
4051
- }
4052
- };
4053
- var DECODER = new TextDecoder();
4054
- function decode(bytes) {
4055
- return DECODER.decode(bytes);
4056
- }
4057
- registerRuntime4("docker", DockerRuntime);
4058
-
4059
- // src/resource/registry.ts
4060
- import {
4061
- normalizeFields,
4062
- compareCodePoints as compareCodePoints4
4063
- } from "@struktoai/mirage-core";
4064
- var REGISTRY = {
4065
- ram: async (_config) => {
4066
- const { RAMResource } = await import("@struktoai/mirage-core");
4067
- return new RAMResource();
4068
- },
4069
- disk: async (config) => {
4070
- const { DiskResource: DiskResource2 } = await import("./disk-WEHSTK3F.js");
4071
- const norm = normalizeFields(config);
4072
- return new DiskResource2(norm);
4073
- },
4074
- redis: async (config) => {
4075
- const { RedisResource: RedisResource2 } = await import("./redis-LPS357NF.js");
4076
- const norm = normalizeFields(config);
4077
- return new RedisResource2(norm);
4078
- },
4079
- s3: async (config) => {
4080
- const { S3Resource: S3Resource2 } = await import("./s3-FPNWWIVM.js");
4081
- const { normalizeS3Config: normalizeS3Config2 } = await import("./config-G43HRUI3.js");
4082
- return new S3Resource2(normalizeS3Config2(config));
4083
- },
4084
- gridfs: async (config) => {
4085
- const { GridFSResource: GridFSResource2 } = await import("./gridfs-CPLQ4G62.js");
4086
- const { normalizeGridFSConfig: normalizeGridFSConfig2 } = await import("./config-SYNEQAUB.js");
4087
- return new GridFSResource2(normalizeGridFSConfig2(config));
4088
- },
4089
- gcs: async (config) => {
4090
- const { GCSResource: GCSResource2 } = await import("./gcs-HFBIAE2C.js");
4091
- const { normalizeGcsConfig } = await import("./config-VPLHQXVE.js");
4092
- return new GCSResource2(normalizeGcsConfig(config));
4093
- },
4094
- oci: async (config) => {
4095
- const { OCIResource: OCIResource2 } = await import("./oci-OQXOIC62.js");
4096
- const { normalizeOciConfig } = await import("./config-A25LTL5W.js");
4097
- return new OCIResource2(normalizeOciConfig(config));
4098
- },
4099
- r2: async (config) => {
4100
- const { R2Resource: R2Resource2 } = await import("./r2-FUA4IORE.js");
4101
- const { normalizeR2Config } = await import("./config-MDSAE4O3.js");
4102
- return new R2Resource2(normalizeR2Config(config));
4103
- },
4104
- hf_buckets: async (config) => {
4105
- const { HfBucketsResource: HfBucketsResource2 } = await import("./hf_buckets-FTJITQ3P.js");
4106
- const { normalizeHfBucketsConfig: normalizeHfBucketsConfig2 } = await import("./config-LJ5T6TVA.js");
4107
- return new HfBucketsResource2(normalizeHfBucketsConfig2(config));
4108
- },
4109
- hf_datasets: async (config) => {
4110
- const { HfDatasetsResource: HfDatasetsResource2 } = await import("./hf_datasets-6GXVKQD7.js");
4111
- const { normalizeHfRepoConfig: normalizeHfRepoConfig2 } = await import("./config-LJ5T6TVA.js");
4112
- return new HfDatasetsResource2(normalizeHfRepoConfig2(config));
4113
- },
4114
- hf_models: async (config) => {
4115
- const { HfModelsResource: HfModelsResource2 } = await import("./hf_models-PJPGZAC5.js");
4116
- const { normalizeHfRepoConfig: normalizeHfRepoConfig2 } = await import("./config-LJ5T6TVA.js");
4117
- return new HfModelsResource2(normalizeHfRepoConfig2(config));
4118
- },
4119
- hf_spaces: async (config) => {
4120
- const { HfSpacesResource: HfSpacesResource2 } = await import("./hf_spaces-LFNFOLBF.js");
4121
- const { normalizeHfRepoConfig: normalizeHfRepoConfig2 } = await import("./config-LJ5T6TVA.js");
4122
- return new HfSpacesResource2(normalizeHfRepoConfig2(config));
4123
- },
4124
- supabase: async (config) => {
4125
- const { SupabaseResource: SupabaseResource2 } = await import("./supabase-A3KUFMDC.js");
4126
- const { normalizeSupabaseConfig } = await import("./config-FPC3RBFD.js");
4127
- return new SupabaseResource2(normalizeSupabaseConfig(config));
4128
- },
4129
- databricks_volume: async (config) => {
4130
- const { DatabricksVolumeResource: DatabricksVolumeResource2 } = await import("./databricks_volume-CNCPTZHS.js");
4131
- const { normalizeDatabricksVolumeConfig } = await import("@struktoai/mirage-core");
4132
- return DatabricksVolumeResource2.create(normalizeDatabricksVolumeConfig(config));
4133
- },
4134
- minio: async (config) => {
4135
- const { MinIOResource: MinIOResource2 } = await import("./minio-5SO6KBTK.js");
4136
- const { normalizeMinIOConfig } = await import("./config-5ZRKJTKG.js");
4137
- return new MinIOResource2(normalizeMinIOConfig(config));
4138
- },
4139
- ceph: async (config) => {
4140
- const { CephResource: CephResource2 } = await import("./ceph-ALKLD3MO.js");
4141
- const { normalizeCephConfig } = await import("./config-QY4IL3PH.js");
4142
- return new CephResource2(normalizeCephConfig(config));
4143
- },
4144
- seaweedfs: async (config) => {
4145
- const { SeaweedFSResource: SeaweedFSResource2 } = await import("./seaweedfs-MC6HIEP4.js");
4146
- const { normalizeSeaweedFSConfig } = await import("./config-WVHKXEVE.js");
4147
- return new SeaweedFSResource2(normalizeSeaweedFSConfig(config));
4148
- },
4149
- wasabi: async (config) => {
4150
- const { WasabiResource: WasabiResource2 } = await import("./wasabi-2IKBIWNO.js");
4151
- const { normalizeWasabiConfig } = await import("./config-2YBCHU2W.js");
4152
- return new WasabiResource2(normalizeWasabiConfig(config));
4153
- },
4154
- backblaze: async (config) => {
4155
- const { BackblazeResource: BackblazeResource2 } = await import("./backblaze-4EKSW63F.js");
4156
- const { normalizeBackblazeConfig } = await import("./config-GG3WO5PB.js");
4157
- return new BackblazeResource2(normalizeBackblazeConfig(config));
4158
- },
4159
- digitalocean: async (config) => {
4160
- const { DigitalOceanResource: DigitalOceanResource2 } = await import("./digitalocean-DJZOUB6Q.js");
4161
- const { normalizeDigitalOceanConfig } = await import("./config-TJKGYA2B.js");
4162
- return new DigitalOceanResource2(normalizeDigitalOceanConfig(config));
4163
- },
4164
- tencent: async (config) => {
4165
- const { TencentResource: TencentResource2 } = await import("./tencent-5464UQ2X.js");
4166
- const { normalizeTencentConfig } = await import("./config-RIAAD6RW.js");
4167
- return new TencentResource2(normalizeTencentConfig(config));
4168
- },
4169
- aliyun: async (config) => {
4170
- const { AliyunResource: AliyunResource2 } = await import("./aliyun-S62BR3TB.js");
4171
- const { normalizeAliyunConfig } = await import("./config-G3F54CS4.js");
4172
- return new AliyunResource2(normalizeAliyunConfig(config));
4173
- },
4174
- scaleway: async (config) => {
4175
- const { ScalewayResource: ScalewayResource2 } = await import("./scaleway-BP3732U7.js");
4176
- const { normalizeScalewayConfig } = await import("./config-XU7R36IE.js");
4177
- return new ScalewayResource2(normalizeScalewayConfig(config));
4178
- },
4179
- qingstor: async (config) => {
4180
- const { QingStorResource: QingStorResource2 } = await import("./qingstor-W277YA4K.js");
4181
- const { normalizeQingStorConfig } = await import("./config-3YRGRW72.js");
4182
- return new QingStorResource2(normalizeQingStorConfig(config));
4183
- },
4184
- postgres: async (config) => {
4185
- const { PostgresResource: PostgresResource2 } = await import("./postgres-AV45GNRS.js");
4186
- const { normalizePostgresConfig } = await import("@struktoai/mirage-core");
4187
- return new PostgresResource2(normalizePostgresConfig(config));
4188
- },
4189
- mongodb: async (config) => {
4190
- const { MongoDBResource: MongoDBResource2 } = await import("./mongodb-L5CMN2EE.js");
4191
- const { normalizeMongoDBConfig } = await import("@struktoai/mirage-core");
4192
- return new MongoDBResource2(normalizeMongoDBConfig(config));
4193
- },
4194
- chroma: async (config) => {
4195
- const { ChromaResource } = await import("@struktoai/mirage-core");
4196
- return new ChromaResource(normalizeFields(config));
4197
- },
4198
- dify: async (config) => {
4199
- const { DifyResource } = await import("@struktoai/mirage-core");
4200
- return new DifyResource(normalizeFields(config));
4201
- },
4202
- qdrant: async (config) => {
4203
- const { QdrantResource } = await import("@struktoai/mirage-core");
4204
- return new QdrantResource(normalizeFields(config));
4205
- },
4206
- lancedb: async (config) => {
4207
- const { LanceDBResource: LanceDBResource2 } = await import("./lancedb-TJ5YSJY5.js");
4208
- return new LanceDBResource2(normalizeFields(config));
4209
- },
4210
- slack: async (config) => {
4211
- const { SlackResource: SlackResource2 } = await import("./slack-JFGW7VLN.js");
4212
- const { normalizeSlackConfig: normalizeSlackConfig2 } = await import("@struktoai/mirage-core");
4213
- return new SlackResource2(normalizeSlackConfig2(config));
4214
- },
4215
- ssh: async (config) => {
4216
- const { SSHResource: SSHResource2 } = await import("./ssh-UYPG42LM.js");
4217
- const { normalizeSshConfig: normalizeSshConfig2 } = await import("./config-R4LAOEDS.js");
4218
- return new SSHResource2(normalizeSshConfig2(config));
4219
- },
4220
- nextcloud: async (config) => {
4221
- const { NextcloudResource: NextcloudResource2 } = await import("./nextcloud-4O2LZVW2.js");
4222
- const { normalizeNextcloudConfig: normalizeNextcloudConfig2 } = await import("./config-D2RF7L3N.js");
4223
- return new NextcloudResource2(normalizeNextcloudConfig2(config));
4224
- },
4225
- discord: async (config) => {
4226
- const { DiscordResource: DiscordResource2 } = await import("./discord-ETB2CADR.js");
4227
- const { normalizeDiscordConfig: normalizeDiscordConfig2 } = await import("@struktoai/mirage-core");
4228
- return new DiscordResource2(normalizeDiscordConfig2(config));
4229
- },
4230
- trello: async (config) => {
4231
- const { TrelloResource: TrelloResource2 } = await import("./trello-O2KB3FUO.js");
4232
- const { normalizeTrelloConfig: normalizeTrelloConfig2 } = await import("./config-JUYBWAZE.js");
4233
- return new TrelloResource2(normalizeTrelloConfig2(config));
4234
- },
4235
- linear: async (config) => {
4236
- const { LinearResource: LinearResource2 } = await import("./linear-BCE4KEAC.js");
4237
- const { normalizeLinearConfig: normalizeLinearConfig2 } = await import("@struktoai/mirage-core");
4238
- return new LinearResource2(normalizeLinearConfig2(config));
4239
- },
4240
- notion: async (config) => {
4241
- const { NotionResource: NotionResource2 } = await import("./notion-RVKEAQ2M.js");
4242
- const { normalizeNotionConfig: normalizeNotionConfig2 } = await import("@struktoai/mirage-core");
4243
- return new NotionResource2(normalizeNotionConfig2(config));
4244
- },
4245
- langfuse: async (config) => {
4246
- const { LangfuseResource: LangfuseResource2 } = await import("./langfuse-RUMTUMXS.js");
4247
- const { normalizeLangfuseConfig: normalizeLangfuseConfig2 } = await import("./config-E55TKM6K.js");
4248
- return new LangfuseResource2(normalizeLangfuseConfig2(config));
4249
- },
4250
- jaeger: async (config) => {
4251
- const { JaegerResource: JaegerResource2 } = await import("./jaeger-GCA6MJ6E.js");
4252
- const { normalizeJaegerConfig } = await import("./config-PB3KA2CE.js");
4253
- return new JaegerResource2(normalizeJaegerConfig(config));
4254
- },
4255
- github: async (config) => {
4256
- const { GitHubResource: GitHubResource2 } = await import("./github-BPZREGPI.js");
4257
- const { normalizeGitHubConfig: normalizeGitHubConfig2 } = await import("./config-CLU7JABG.js");
4258
- return GitHubResource2.create(normalizeGitHubConfig2(config));
4259
- },
4260
- github_ci: async (config) => {
4261
- const { GitHubCIResource: GitHubCIResource2 } = await import("./github_ci-7A4LUIZ7.js");
4262
- const { normalizeGitHubCIConfig: normalizeGitHubCIConfig2 } = await import("./config-NRIOKK5T.js");
4263
- return new GitHubCIResource2(normalizeGitHubCIConfig2(config));
4264
- },
4265
- gcal: async (config) => {
4266
- const { GCalResource: GCalResource2 } = await import("./gcal-P56MRCGU.js");
4267
- const { normalizeGCalConfig } = await import("./config-4GSOMUMF.js");
4268
- return new GCalResource2(normalizeGCalConfig(config));
4269
- },
4270
- gdocs: async (config) => {
4271
- const { GDocsResource: GDocsResource2 } = await import("./gdocs-LQ3UXP3J.js");
4272
- const { normalizeGDocsConfig } = await import("./config-WRACCRPN.js");
4273
- return new GDocsResource2(normalizeGDocsConfig(config));
4274
- },
4275
- gsheets: async (config) => {
4276
- const { GSheetsResource: GSheetsResource2 } = await import("./gsheets-4BNIJPQ6.js");
4277
- const { normalizeGSheetsConfig } = await import("./config-5YBUWFUP.js");
4278
- return new GSheetsResource2(normalizeGSheetsConfig(config));
4279
- },
4280
- gslides: async (config) => {
4281
- const { GSlidesResource: GSlidesResource2 } = await import("./gslides-GDBYLO5A.js");
4282
- const { normalizeGSlidesConfig } = await import("./config-ELDOFRJW.js");
4283
- return new GSlidesResource2(normalizeGSlidesConfig(config));
4284
- },
4285
- gdrive: async (config) => {
4286
- const { GDriveResource: GDriveResource2 } = await import("./gdrive-N6UBYLON.js");
4287
- const { normalizeGDriveConfig } = await import("./config-FPM3LAW7.js");
4288
- return new GDriveResource2(normalizeGDriveConfig(config));
4289
- },
4290
- onedrive: async (config) => {
4291
- const { OneDriveResource: OneDriveResource2, normalizeOneDriveConfig } = await import("@struktoai/mirage-core");
4292
- return new OneDriveResource2(normalizeOneDriveConfig(config));
4293
- },
4294
- sharepoint: async (config) => {
4295
- const { SharePointResource: SharePointResource2, normalizeSharePointConfig } = await import("@struktoai/mirage-core");
4296
- return new SharePointResource2(normalizeSharePointConfig(config));
4297
- },
4298
- mem0: async (config) => {
4299
- const { Mem0Resource: Mem0Resource2, normalizeMem0Config } = await import("@struktoai/mirage-core");
4300
- return new Mem0Resource2(normalizeMem0Config(config));
4301
- },
4302
- dropbox: async (config) => {
4303
- const { DropboxResource: DropboxResource2 } = await import("./dropbox-XN6PGLNE.js");
4304
- const { normalizeDropboxConfig: normalizeDropboxConfig2 } = await import("./config-OYK2BSJK.js");
4305
- return new DropboxResource2(normalizeDropboxConfig2(config));
4306
- },
4307
- box: async (config) => {
4308
- const { BoxResource: BoxResource2 } = await import("./box-ZPLZAGMK.js");
4309
- const { normalizeBoxConfig: normalizeBoxConfig2 } = await import("./config-Y2KOUYSS.js");
4310
- return new BoxResource2(normalizeBoxConfig2(config));
4311
- },
4312
- gmail: async (config) => {
4313
- const { GmailResource: GmailResource2 } = await import("./gmail-YED2MF6H.js");
4314
- const { normalizeGmailConfig } = await import("./config-UU27ALAA.js");
4315
- return new GmailResource2(normalizeGmailConfig(config));
4316
- },
4317
- email: async (config) => {
4318
- const { EmailResource: EmailResource2 } = await import("./email-OV7XCP3T.js");
4319
- const { normalizeEmailConfig: normalizeEmailConfig2 } = await import("./config-UURRGA7U.js");
4320
- return new EmailResource2(normalizeEmailConfig2(config));
4321
- }
4322
- };
4323
- var CUSTOM = {};
4324
- function knownResources() {
4325
- return [.../* @__PURE__ */ new Set([...Object.keys(REGISTRY), ...Object.keys(CUSTOM)])].sort(compareCodePoints4);
4326
- }
4327
- function register(name, factory) {
4328
- if (name in REGISTRY) throw new Error(`cannot register '${name}': shadows a builtin`);
4329
- CUSTOM[name] = factory;
4330
- }
4331
- async function buildResource(name, config = {}) {
4332
- const factory = REGISTRY[name] ?? CUSTOM[name];
4333
- if (factory === void 0) {
4334
- throw new Error(
4335
- `unknown resource ${JSON.stringify(name)}; known: ${knownResources().join(", ")}`
4336
- );
4337
- }
4338
- return factory(config);
4339
- }
4340
-
4341
- // src/resource/loader.ts
4342
- import { existsSync } from "fs";
4343
- import { isAbsolute, resolve } from "path";
4344
- import { pathToFileURL } from "url";
4345
- var MODULE_SUFFIXES = [".mjs", ".cjs", ".mts", ".cts", ".js", ".ts"];
4346
- function isModulePath(source) {
4347
- if (source.startsWith("./") || source.startsWith("../")) return true;
4348
- if (source.startsWith("/") || isAbsolute(source)) return true;
4349
- if (source.includes("/")) return false;
4350
- return MODULE_SUFFIXES.some((suffix) => source.endsWith(suffix));
4351
- }
4352
- function splitRef(spec) {
4353
- const cut = spec.lastIndexOf(":");
4354
- if (cut < 0) {
4355
- throw new Error(`invalid ref ${JSON.stringify(spec)}, expected 'source:ExportName'`);
4356
- }
4357
- return [spec.slice(0, cut), spec.slice(cut + 1)];
4358
- }
4359
- function isRecord(value) {
4360
- return typeof value === "object" && value !== null;
4361
- }
4362
- function isNotFound(error) {
4363
- if (!isRecord(error)) return false;
4364
- return error.code === "ERR_MODULE_NOT_FOUND" || error.code === "ENOENT";
4365
- }
4366
- function isUnsupportedTypeScript(error) {
4367
- return isRecord(error) && error.code === "ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX";
4368
- }
4369
- async function loadAttr(spec) {
4370
- const [source, attr] = splitRef(spec);
4371
- const path4 = isModulePath(source) ? isAbsolute(source) ? source : resolve(source) : null;
4372
- if (path4 !== null && !existsSync(path4)) {
4373
- throw new Error(`cannot load script ${JSON.stringify(source)}`);
4374
- }
4375
- const target = path4 !== null ? pathToFileURL(path4).href : source;
4376
- let mod;
4377
- try {
4378
- mod = await import(target);
4379
- } catch (error) {
4380
- if (path4 === null && isNotFound(error)) {
4381
- throw new Error(`cannot load script ${JSON.stringify(source)}`);
4382
- }
4383
- if (isUnsupportedTypeScript(error)) {
4384
- const detail = error instanceof Error ? error.message : String(error);
4385
- throw new Error(
4386
- `cannot load script ${JSON.stringify(source)}: ${detail}. Node strips types without compiling them; precompile the file or ship it as .mjs.`
4387
- );
4388
- }
4389
- throw error;
4390
- }
4391
- if (attr in mod) return mod[attr];
4392
- const fallback = mod.default;
4393
- if (isRecord(fallback) && attr in fallback) return fallback[attr];
4394
- throw new Error(`${JSON.stringify(attr)} not found in ${JSON.stringify(source)}`);
4395
- }
4396
- export {
4397
- ALIYUN_PROMPT,
4398
- AliyunResource,
4399
- BACKBLAZE_PROMPT,
4400
- BackblazeResource,
4401
- BoxResource,
4402
- CEPH_PROMPT,
4403
- CephResource,
4404
- DAYTONA_CONFIG_KEYS,
4405
- DEFAULT_STATE_ROOT,
4406
- DIGITALOCEAN_PROMPT,
4407
- DISK_COMMANDS,
4408
- DISK_OPS,
4409
- DISK_PROMPT,
4410
- DOCKER_CONFIG_KEYS,
4411
- DatabricksVolumeResource,
4412
- DaytonaRuntime,
4413
- DigitalOceanResource,
4414
- DiscordResource,
4415
- DiskNamespaceStore,
4416
- DiskObserverStore,
4417
- DiskRecordClient,
4418
- DiskResource,
4419
- DiskSessionStore,
4420
- DiskWorkspaceStateStore,
4421
- DockerRuntime,
4422
- DropboxResource,
4423
- E2BRuntime,
4424
- E2B_CONFIG_KEYS,
4425
- EMAIL_COMMANDS,
4426
- EMAIL_OPS,
4427
- EMAIL_PROMPT,
4428
- EMAIL_WRITE_PROMPT,
4429
- EmailAccessor,
4430
- EmailResource,
4431
- FSKIT_MOUNT_ROOT,
4432
- FuseManager,
4433
- GCSResource,
4434
- GCS_ENDPOINT,
4435
- GCS_PROMPT,
4436
- GCalResource,
4437
- GDocsResource,
4438
- GDriveResource,
4439
- GRIDFS_COMMANDS,
4440
- GSheetsResource,
4441
- GSlidesResource,
4442
- GitHubCIResource,
4443
- GitHubResource,
4444
- GmailResource,
4445
- GridFSAccessor,
4446
- GridFSResource,
4447
- HF_BUCKETS_PROMPT,
4448
- HF_COMMANDS,
4449
- HF_DATASETS_PROMPT,
4450
- HF_ENDPOINT,
4451
- HF_MODELS_PROMPT,
4452
- HF_OPS,
4453
- HF_RESOURCES,
4454
- HF_SPACES_PROMPT,
4455
- HIMALAYA,
4456
- HfAccessor,
4457
- HfBucketsAccessor,
4458
- HfBucketsResource,
4459
- HfDatasetsAccessor,
4460
- HfDatasetsResource,
4461
- HfModelsAccessor,
4462
- HfModelsResource,
4463
- HfSpacesAccessor,
4464
- HfSpacesResource,
4465
- JaegerResource,
4466
- LanceDBResource,
4467
- LanceDBStore,
4468
- LangfuseResource,
4469
- LinearResource,
4470
- LocalRuntime,
4471
- MINIO_PROMPT,
4472
- MODULE_SUFFIXES,
4473
- Mem0Resource,
4474
- MinIOResource,
4475
- MirageFS,
4476
- MongoDBResource,
4477
- MongoDBStore,
4478
- Mount,
4479
- MountCore,
4480
- NEXTCLOUD_COMMANDS,
4481
- NEXTCLOUD_OPS,
4482
- NEXTCLOUD_PROMPT,
4483
- NextcloudAccessor,
4484
- NextcloudResource,
4485
- NextcloudWalk,
4486
- NotionResource,
4487
- OCIResource,
4488
- OCI_PROMPT,
4489
- OneDriveResource,
4490
- PostgresResource,
4491
- PostgresStore,
4492
- QINGSTOR_PROMPT,
4493
- QingStorResource,
4494
- R2Resource,
4495
- R2_PROMPT,
4496
- REDIS_COMMANDS,
4497
- REDIS_OPS,
4498
- REDIS_PROMPT,
4499
- RedisAccessor,
4500
- RedisConsoleStore,
4501
- RedisFileCacheStore,
4502
- RedisNamespaceStore,
4503
- RedisObserverStore,
4504
- RedisResource,
4505
- RedisSessionStore,
4506
- RedisStore,
4507
- RedisWorkspaceStateStore,
4508
- S3Resource,
4509
- SCALEWAY_PROMPT,
4510
- SEAWEEDFS_PROMPT,
4511
- SSHAccessor,
4512
- SSHResource,
4513
- SSH_COMMANDS,
4514
- SSH_OPS,
4515
- SSH_PROMPT,
4516
- SUPABASE_PROMPT,
4517
- ScalewayResource,
4518
- SeaweedFSResource,
4519
- SharePointResource,
4520
- SlackResource,
4521
- SupabaseResource,
4522
- TENCENT_PROMPT,
4523
- TencentResource,
4524
- TrelloResource,
4525
- WASABI_PROMPT,
4526
- WasabiResource,
4527
- Workspace,
4528
- assertHfRepoId,
4529
- buildEmailConfig,
4530
- buildDeltaHook as buildNextcloudDeltaHook,
4531
- buildResource,
4532
- checkMountpoint,
4533
- checkPlatform,
4534
- checkSizes,
4535
- classifyErrno,
4536
- classifyError,
4537
- fileReadProvision,
4538
- mount as fuseMount,
4539
- mountBackground as fuseMountBackground,
4540
- headTailProvision,
4541
- isMacosMetadata,
4542
- isModulePath,
4543
- knownResources,
4544
- loadAttr,
4545
- loadDatabricksProfile,
4546
- metadataProvision,
4547
- normalizeBoxConfig,
4548
- normalizeDiscordConfig,
4549
- normalizeDropboxConfig,
4550
- normalizeEmailConfig,
4551
- normalizeGoogleConfig6 as normalizeGCalConfig,
4552
- normalizeGoogleConfig as normalizeGDocsConfig,
4553
- normalizeGoogleConfig4 as normalizeGDriveConfig,
4554
- normalizeGoogleConfig2 as normalizeGSheetsConfig,
4555
- normalizeGoogleConfig3 as normalizeGSlidesConfig,
4556
- normalizeGitHubCIConfig,
4557
- normalizeGitHubConfig,
4558
- normalizeGoogleConfig5 as normalizeGmailConfig,
4559
- normalizeGridFSConfig,
4560
- normalizeHfBucketsConfig,
4561
- normalizeHfModelsConfig,
4562
- normalizeHfRepoConfig,
4563
- normalizeLangfuseConfig,
4564
- normalizeLinearConfig,
4565
- normalizeNextcloudConfig,
4566
- normalizeNotionConfig,
4567
- normalizeS3Config,
4568
- normalizeSlackConfig,
4569
- normalizeSshConfig,
4570
- normalizeTrelloConfig,
4571
- parseDatabricksCfg,
4572
- patchNodeFs,
4573
- prepareBackend,
4574
- redactAliyunConfig,
4575
- redactBackblazeConfig,
4576
- redactBoxConfig,
4577
- redactCephConfig,
4578
- redactDigitalOceanConfig,
4579
- redactDiscordConfig,
4580
- redactDropboxConfig,
4581
- redactEmailConfig,
4582
- redactGoogleConfig6 as redactGCalConfig,
4583
- redactGoogleConfig as redactGDocsConfig,
4584
- redactGoogleConfig4 as redactGDriveConfig,
4585
- redactGoogleConfig2 as redactGSheetsConfig,
4586
- redactGoogleConfig3 as redactGSlidesConfig,
4587
- redactGcsConfig,
4588
- redactGitHubCIConfig,
4589
- redactGitHubConfig,
4590
- redactGoogleConfig5 as redactGmailConfig,
4591
- redactHfBucketsConfig,
4592
- redactHfModelsConfig,
4593
- redactHfRepoConfig,
4594
- redactLangfuseConfig,
4595
- redactLinearConfig,
4596
- redactMinIOConfig,
4597
- redactNextcloudConfig,
4598
- redactNotionConfig,
4599
- redactOciConfig,
4600
- redactQingStorConfig,
4601
- redactR2Config,
4602
- redactConfig as redactS3Config,
4603
- redactScalewayConfig,
4604
- redactSeaweedFSConfig,
4605
- redactSlackConfig,
4606
- redactSshConfig,
4607
- redactSupabaseConfig,
4608
- redactTencentConfig,
4609
- redactTrelloConfig,
4610
- redactWasabiConfig,
4611
- register as registerResourceFactory,
4612
- requireKernelBackend,
4613
- resolveBackend,
4614
- resolvedAliyunEndpoint,
4615
- resolvedBackblazeEndpoint,
4616
- resolvedDigitalOceanEndpoint,
4617
- resolvedQingStorEndpoint,
4618
- resolvedScalewayEndpoint,
4619
- resolvedSupabaseEndpoint,
4620
- resolvedTencentEndpoint,
4621
- resolvedWasabiEndpoint,
4622
- splitRef,
4623
- unsizedMounts
4624
- };
1
+ // ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ // ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========
14
+ export * from '@struktoai/mirage-core';
15
+ export { Workspace } from "./workspace.js";
16
+ export { Mount } from '@struktoai/mirage-core/workspace/mount/spec';
17
+ export { DiskResource, } from "./resource/disk/disk.js";
18
+ export { DISK_PROMPT } from "./resource/disk/prompt.js";
19
+ export { DISK_OPS } from "./ops/disk/index.js";
20
+ export { DiskObserverStore } from "./observe/disk_store.js";
21
+ export { RedisObserverStore } from "./observe/redis_store.js";
22
+ export { RedisConsoleStore } from "./shell/console/redis/index.js";
23
+ export { DiskNamespaceStore } from "./workspace/namespace/disk.js";
24
+ export { RedisNamespaceStore, } from "./workspace/namespace/redis.js";
25
+ export { DiskRecordClient } from "./workspace/record/disk.js";
26
+ export { parseSessionProfile } from '@struktoai/mirage-core/policy/profile';
27
+ export { DiskSessionStore } from "./workspace/session/disk.js";
28
+ export { RedisSessionStore } from "./workspace/session/redis.js";
29
+ export { DEFAULT_STATE_ROOT, DiskWorkspaceStateStore, } from "./workspace/store/disk.js";
30
+ export { RedisWorkspaceStateStore, } from "./workspace/store/redis.js";
31
+ export { patchNodeFs } from "./fs_monkey.js";
32
+ export { RedisResource, } from "./resource/redis/redis.js";
33
+ export { REDIS_PROMPT } from '@struktoai/mirage-core/resource/redis/prompt';
34
+ export { RedisStore } from "./resource/redis/store.js";
35
+ export { RedisAccessor } from '@struktoai/mirage-core/accessor/redis';
36
+ export { REDIS_OPS } from '@struktoai/mirage-core/ops/redis/index';
37
+ export { fileReadProvision, headTailProvision, metadataProvision, } from '@struktoai/mirage-core/commands/builtin/redis/_provision';
38
+ export { RedisFileCacheStore } from "./cache/file/redis.js";
39
+ export { FuseManager } from "./workspace/fuse.js";
40
+ export { MirageFS } from "./fuse/fs.js";
41
+ export { MountCore } from "./fuse/core.js";
42
+ export { classifyErrno, classifyError } from "./fuse/errors.js";
43
+ export { checkMountpoint, checkPlatform, checkSizes, FSKIT_MOUNT_ROOT, prepareBackend, requireKernelBackend, resolveBackend, unsizedMounts, } from "./fuse/backend.js";
44
+ export { mount as fuseMount, mountBackground as fuseMountBackground, } from "./fuse/mount.js";
45
+ export { isMacosMetadata } from "./fuse/platform/macos.js";
46
+ export { S3Resource } from "./resource/s3/s3.js";
47
+ export { S3_COMMANDS } from '@struktoai/mirage-core/commands/builtin/s3/index';
48
+ export { GridFSResource } from "./resource/gridfs/gridfs.js";
49
+ export { normalizeGridFSConfig, } from "./resource/gridfs/config.js";
50
+ export { GridFSAccessor } from "./accessor/gridfs.js";
51
+ export { DatabricksVolumeResource, } from "./resource/databricks_volume/databricks_volume.js";
52
+ export { loadDatabricksProfile, parseDatabricksCfg, } from "./resource/databricks_volume/profile.js";
53
+ export { normalizeS3Config, redactConfig as redactS3Config, } from "./resource/s3/config.js";
54
+ export { GCSResource } from "./resource/gcs/gcs.js";
55
+ export { GCS_ENDPOINT, redactGcsConfig, } from "./resource/gcs/config.js";
56
+ export { GCS_PROMPT } from "./resource/gcs/prompt.js";
57
+ export { OCIResource } from "./resource/oci/oci.js";
58
+ export { redactOciConfig } from "./resource/oci/config.js";
59
+ export { OCI_PROMPT } from "./resource/oci/prompt.js";
60
+ export { R2Resource } from "./resource/r2/r2.js";
61
+ export { redactR2Config } from "./resource/r2/config.js";
62
+ export { R2_PROMPT } from "./resource/r2/prompt.js";
63
+ export { SupabaseResource } from "./resource/supabase/supabase.js";
64
+ export { redactSupabaseConfig, resolvedSupabaseEndpoint, } from "./resource/supabase/config.js";
65
+ export { SUPABASE_PROMPT } from "./resource/supabase/prompt.js";
66
+ export { HF_RESOURCES, HfAccessor, HfBucketsAccessor, HfDatasetsAccessor, HfModelsAccessor, HfSpacesAccessor, } from "./accessor/hf.js";
67
+ export { HfBucketsResource } from "./resource/hf_buckets/hf_buckets.js";
68
+ export { assertHfRepoId, HF_ENDPOINT, normalizeHfBucketsConfig, normalizeHfRepoConfig, redactHfBucketsConfig, redactHfRepoConfig, } from "./resource/hf_buckets/config.js";
69
+ export { HF_BUCKETS_PROMPT } from "./resource/hf_buckets/prompt.js";
70
+ export { HfDatasetsResource, } from "./resource/hf_datasets/hf_datasets.js";
71
+ export { HF_DATASETS_PROMPT } from "./resource/hf_datasets/prompt.js";
72
+ export { HfModelsResource } from "./resource/hf_models/hf_models.js";
73
+ export { normalizeHfModelsConfig, redactHfModelsConfig, } from "./resource/hf_models/config.js";
74
+ export { HF_MODELS_PROMPT } from "./resource/hf_models/prompt.js";
75
+ export { HfSpacesResource } from "./resource/hf_spaces/hf_spaces.js";
76
+ export { HF_SPACES_PROMPT } from "./resource/hf_spaces/prompt.js";
77
+ export { HF_COMMANDS } from "./commands/builtin/hf/index.js";
78
+ export { HF_OPS } from "./ops/hf/index.js";
79
+ export { HF_HUB_COMMANDS } from "./commands/builtin/hf_hub/index.js";
80
+ export { HF_HUB_OPS } from "./ops/hf_hub/index.js";
81
+ export { MinIOResource } from "./resource/minio/minio.js";
82
+ export { redactMinIOConfig, } from "./resource/minio/config.js";
83
+ export { MINIO_PROMPT } from "./resource/minio/prompt.js";
84
+ export { SeaweedFSResource } from "./resource/seaweedfs/seaweedfs.js";
85
+ export { redactSeaweedFSConfig, } from "./resource/seaweedfs/config.js";
86
+ export { SEAWEEDFS_PROMPT } from "./resource/seaweedfs/prompt.js";
87
+ export { CephResource } from "./resource/ceph/ceph.js";
88
+ export { redactCephConfig, } from "./resource/ceph/config.js";
89
+ export { CEPH_PROMPT } from "./resource/ceph/prompt.js";
90
+ export { WasabiResource } from "./resource/wasabi/wasabi.js";
91
+ export { redactWasabiConfig, resolvedWasabiEndpoint, } from "./resource/wasabi/config.js";
92
+ export { WASABI_PROMPT } from "./resource/wasabi/prompt.js";
93
+ export { BackblazeResource } from "./resource/backblaze/backblaze.js";
94
+ export { redactBackblazeConfig, resolvedBackblazeEndpoint, } from "./resource/backblaze/config.js";
95
+ export { BACKBLAZE_PROMPT } from "./resource/backblaze/prompt.js";
96
+ export { DigitalOceanResource, } from "./resource/digitalocean/digitalocean.js";
97
+ export { redactDigitalOceanConfig, resolvedDigitalOceanEndpoint, } from "./resource/digitalocean/config.js";
98
+ export { DIGITALOCEAN_PROMPT } from "./resource/digitalocean/prompt.js";
99
+ export { TencentResource } from "./resource/tencent/tencent.js";
100
+ export { redactTencentConfig, resolvedTencentEndpoint, } from "./resource/tencent/config.js";
101
+ export { TENCENT_PROMPT } from "./resource/tencent/prompt.js";
102
+ export { AliyunResource } from "./resource/aliyun/aliyun.js";
103
+ export { redactAliyunConfig, resolvedAliyunEndpoint, } from "./resource/aliyun/config.js";
104
+ export { ALIYUN_PROMPT } from "./resource/aliyun/prompt.js";
105
+ export { ScalewayResource } from "./resource/scaleway/scaleway.js";
106
+ export { redactScalewayConfig, resolvedScalewayEndpoint, } from "./resource/scaleway/config.js";
107
+ export { SCALEWAY_PROMPT } from "./resource/scaleway/prompt.js";
108
+ export { QingStorResource } from "./resource/qingstor/qingstor.js";
109
+ export { redactQingStorConfig, resolvedQingStorEndpoint, } from "./resource/qingstor/config.js";
110
+ export { QINGSTOR_PROMPT } from "./resource/qingstor/prompt.js";
111
+ export { PostgresResource } from "./resource/postgres/postgres.js";
112
+ export { PostgresStore } from "./resource/postgres/store.js";
113
+ export { MongoDBResource } from "./resource/mongodb/mongodb.js";
114
+ export { MongoDBStore } from "./resource/mongodb/store.js";
115
+ export { LanceDBResource } from "./resource/lancedb/lancedb.js";
116
+ export { LanceDBStore } from "./resource/lancedb/store.js";
117
+ export { SlackResource } from "./resource/slack/slack.js";
118
+ export { normalizeSlackConfig, redactSlackConfig } from '@struktoai/mirage-core/core/slack/config';
119
+ export { SSHResource } from "./resource/ssh/ssh.js";
120
+ export { normalizeSshConfig, redactSshConfig, } from "./resource/ssh/config.js";
121
+ export { SSHAccessor } from "./accessor/ssh.js";
122
+ export { SSH_PROMPT } from "./resource/ssh/prompt.js";
123
+ export { SSH_COMMANDS } from "./commands/builtin/ssh/index.js";
124
+ export { SSH_OPS } from "./ops/ssh/index.js";
125
+ export { NextcloudAccessor } from "./accessor/nextcloud.js";
126
+ export { NextcloudResource } from "./resource/nextcloud/nextcloud.js";
127
+ export { normalizeNextcloudConfig, redactNextcloudConfig, } from "./resource/nextcloud/config.js";
128
+ export { NEXTCLOUD_PROMPT } from "./resource/nextcloud/prompt.js";
129
+ export { NEXTCLOUD_COMMANDS } from "./commands/builtin/nextcloud/index.js";
130
+ export { NEXTCLOUD_OPS } from "./ops/nextcloud/index.js";
131
+ export { buildDeltaHook as buildNextcloudDeltaHook, NextcloudWalk } from "./core/nextcloud/watch.js";
132
+ export { DiscordResource } from "./resource/discord/discord.js";
133
+ export { normalizeDiscordConfig, redactDiscordConfig, } from '@struktoai/mirage-core/core/discord/config';
134
+ export { TrelloResource } from "./resource/trello/trello.js";
135
+ export { normalizeTrelloConfig, redactTrelloConfig, } from "./resource/trello/config.js";
136
+ export { LinearResource } from "./resource/linear/linear.js";
137
+ export { normalizeLinearConfig, redactLinearConfig, } from '@struktoai/mirage-core/core/linear/config';
138
+ export { NotionResource } from "./resource/notion/notion.js";
139
+ export { normalizeNotionConfig, redactNotionConfig, } from '@struktoai/mirage-core/core/notion/config';
140
+ export { LangfuseResource } from "./resource/langfuse/langfuse.js";
141
+ export { JaegerResource } from "./resource/jaeger/jaeger.js";
142
+ export { normalizeLangfuseConfig, redactLangfuseConfig, } from "./resource/langfuse/config.js";
143
+ export { GitHubResource } from "./resource/github/github.js";
144
+ export { normalizeGitHubConfig, redactGitHubConfig, } from '@struktoai/mirage-core/core/github/config';
145
+ export { GDocsResource } from "./resource/gdocs/gdocs.js";
146
+ export { normalizeGDocsConfig, redactGDocsConfig, } from '@struktoai/mirage-core/resource/gdocs/config';
147
+ export { GSheetsResource } from "./resource/gsheets/gsheets.js";
148
+ export { normalizeGSheetsConfig, redactGSheetsConfig, } from '@struktoai/mirage-core/resource/gsheets/config';
149
+ export { GSlidesResource } from "./resource/gslides/gslides.js";
150
+ export { normalizeGSlidesConfig, redactGSlidesConfig, } from '@struktoai/mirage-core/resource/gslides/config';
151
+ export { GDriveResource } from "./resource/gdrive/gdrive.js";
152
+ export { normalizeGDriveConfig, redactGDriveConfig, } from '@struktoai/mirage-core/resource/gdrive/config';
153
+ export { DropboxResource } from "./resource/dropbox/dropbox.js";
154
+ export { normalizeDropboxConfig, redactDropboxConfig, } from "./resource/dropbox/config.js";
155
+ export { BoxResource } from "./resource/box/box.js";
156
+ export { normalizeBoxConfig, redactBoxConfig, } from "./resource/box/config.js";
157
+ export { GmailResource } from "./resource/gmail/gmail.js";
158
+ export { normalizeGmailConfig, redactGmailConfig, } from '@struktoai/mirage-core/resource/gmail/config';
159
+ export { GCalResource } from "./resource/gcal/gcal.js";
160
+ export { normalizeGCalConfig, redactGCalConfig, } from '@struktoai/mirage-core/resource/gcal/config';
161
+ export { EmailResource } from "./resource/email/email.js";
162
+ export { buildEmailConfig, normalizeEmailConfig, redactEmailConfig, EMAIL_PROMPT, EMAIL_WRITE_PROMPT, } from "./resource/email/index.js";
163
+ export { EmailAccessor } from "./accessor/email.js";
164
+ export { EMAIL_COMMANDS } from "./commands/builtin/email/index.js";
165
+ export { HF } from "./commands/cli/builtin/hf/index.js";
166
+ export { HIMALAYA } from "./commands/cli/builtin/himalaya/index.js";
167
+ export { EMAIL_OPS } from "./ops/email/index.js";
168
+ export { DaytonaRuntime } from "./runtime/sandbox/daytona/runtime.js";
169
+ export { LocalRuntime } from "./runtime/python/local.js";
170
+ export { DAYTONA_CONFIG_KEYS } from "./runtime/sandbox/daytona/config.js";
171
+ export { E2BRuntime } from "./runtime/sandbox/e2b/runtime.js";
172
+ export { E2B_CONFIG_KEYS } from "./runtime/sandbox/e2b/config.js";
173
+ export { DockerRuntime } from "./runtime/sandbox/docker/runtime.js";
174
+ export { DOCKER_CONFIG_KEYS } from "./runtime/sandbox/docker/config.js";
175
+ export { SmolvmRuntime } from "./runtime/sandbox/smolvm/runtime.js";
176
+ export { SMOLVM_CONFIG_KEYS } from "./runtime/sandbox/smolvm/config.js";
177
+ export { SSHRuntime } from "./runtime/sandbox/ssh/runtime.js";
178
+ export { SSH_RUNTIME_CONFIG_KEYS } from "./runtime/sandbox/ssh/config.js";
179
+ export { buildResource, knownResources, register as registerResourceFactory, } from "./resource/registry.js";
180
+ export { MODULE_SUFFIXES, isModulePath, loadAttr, splitRef } from "./resource/loader.js";
181
+ export { DISK_COMMANDS } from "./commands/builtin/disk/index.js";
182
+ export { REDIS_COMMANDS } from '@struktoai/mirage-core/commands/builtin/redis/index';
183
+ export { GRIDFS_COMMANDS } from "./commands/builtin/gridfs/index.js";
184
+ export { absolutizeScripts, checkWorkspaceConfig, checkWorkspaceConfigFile, configToWorkspaceArgs, interpolateEnv, loadWorkspaceConfig, loadWorkspaceConfigFile, } from "./config.js";
185
+ // The authoring surface: what a host reaches for to bring its own
186
+ // resource, CLI, policy or runtime, and the types the Workspace's own
187
+ // signatures hand back. Core's barrel is the front door for a program
188
+ // that mounts and runs; these are the doors behind it, re-exported by
189
+ // module so a consumer of this package needs no second dependency on
190
+ // core to reach them (`@struktoai/mirage-core/<path>` works too).
191
+ export { BaseResource, recordResourceRef, resourceRefOf, } from '@struktoai/mirage-core/resource/base';
192
+ export { op } from '@struktoai/mirage-core/ops/registry';
193
+ export { makeGenericOps } from '@struktoai/mirage-core/ops/generic/factory';
194
+ export { makeGenericCommands } from '@struktoai/mirage-core/commands/builtin/generic_bind/index';
195
+ export { FlagView, UsageStyle } from '@struktoai/mirage-core/commands/spec/types';
196
+ export { UsageError } from '@struktoai/mirage-core/commands/errors';
197
+ export { PolicyDenied, PolicyError } from '@struktoai/mirage-core/policy/errors';
198
+ export { Decisions, Outcome, Scope, } from '@struktoai/mirage-core/policy/index';
199
+ export { LanguageRuntime } from '@struktoai/mirage-core/runtime/language';
200
+ export { RemoteSandbox } from '@struktoai/mirage-core/runtime/sandbox/base';
201
+ export { knownRuntimes, registerRuntime } from '@struktoai/mirage-core/runtime/table';
202
+ export { PrefixResolver } from '@struktoai/mirage-core/runtime/resolver';
203
+ export { RuntimeVFS } from '@struktoai/mirage-core/runtime/vfs';
204
+ export { CrossMountError } from '@struktoai/mirage-core/runtime/errors';
205
+ export { DenyResult, RouteResult, } from '@struktoai/mirage-core/runtime/routing/types';
206
+ export { ExecuteResult, } from '@struktoai/mirage-core/workspace/workspace/types';
207
+ export { Ops } from '@struktoai/mirage-core/ops/ops';
208
+ export { Namespace } from '@struktoai/mirage-core/workspace/mount/namespace/namespace';
4625
209
  //# sourceMappingURL=index.js.map