@struktoai/mirage-node 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/README.md +1 -1
  2. package/dist/{aliyun-TMZRUYCG.js → aliyun-JMJ3PFYY.js} +3 -3
  3. package/dist/{backblaze-OHW57DLK.js → backblaze-TDFD23QO.js} +3 -3
  4. package/dist/{box-UXTCAFOZ.js → box-GQ2U2R6R.js} +2 -2
  5. package/dist/{ceph-TNN4I2FT.js → ceph-S2VOYO6G.js} +3 -3
  6. package/dist/{chunk-FXFDBF3P.js → chunk-3WIO7NBR.js} +2 -2
  7. package/dist/{chunk-O7ODGJYL.js → chunk-47AVIIOT.js} +2 -2
  8. package/dist/{chunk-Q6CDMOM6.js → chunk-7CW3BMPH.js} +2 -2
  9. package/dist/{chunk-E7RW3SBV.js → chunk-A7IVFIOP.js} +2 -2
  10. package/dist/chunk-A7IVFIOP.js.map +1 -0
  11. package/dist/{chunk-3T3RMDNX.js → chunk-AUHSTJJ3.js} +2 -2
  12. package/dist/{chunk-PJBQKMCD.js → chunk-DM4GSE26.js} +2 -2
  13. package/dist/{chunk-5DLOHQJ2.js → chunk-EM4J5EQS.js} +2 -2
  14. package/dist/chunk-EM4J5EQS.js.map +1 -0
  15. package/dist/{chunk-ABTEGAFB.js → chunk-EZQ5HBAC.js} +2 -2
  16. package/dist/chunk-EZQ5HBAC.js.map +1 -0
  17. package/dist/{chunk-KTNDT45N.js → chunk-FQ33BYFR.js} +2 -2
  18. package/dist/{chunk-YAVGCQUP.js → chunk-G2WCEUQL.js} +2 -2
  19. package/dist/chunk-G2WCEUQL.js.map +1 -0
  20. package/dist/{chunk-RLGWMJD3.js → chunk-GCFYZSVR.js} +133 -3
  21. package/dist/chunk-GCFYZSVR.js.map +1 -0
  22. package/dist/{chunk-NHS7WLEQ.js → chunk-GS5AUKUO.js} +2 -2
  23. package/dist/chunk-GS5AUKUO.js.map +1 -0
  24. package/dist/{chunk-BYTU2YC3.js → chunk-HGCRXJGP.js} +2 -2
  25. package/dist/{chunk-G5BZE7UA.js → chunk-HJJMP6IX.js} +2 -2
  26. package/dist/{chunk-IQVNVTOP.js → chunk-I5THIMPP.js} +2 -2
  27. package/dist/chunk-IDYHQQOH.js +1095 -0
  28. package/dist/chunk-IDYHQQOH.js.map +1 -0
  29. package/dist/{chunk-C6NHFMIP.js → chunk-IK2L4EN3.js} +2 -2
  30. package/dist/{chunk-LYDMMNL2.js → chunk-JAGJTM3Q.js} +2 -2
  31. package/dist/chunk-JAGJTM3Q.js.map +1 -0
  32. package/dist/{chunk-A7X4L4JM.js → chunk-JCC4CU2I.js} +2 -2
  33. package/dist/chunk-JCC4CU2I.js.map +1 -0
  34. package/dist/{chunk-AJICZLHT.js → chunk-KPULTUOK.js} +2 -2
  35. package/dist/{chunk-YPT4JBUY.js → chunk-LV2G7VHL.js} +2 -2
  36. package/dist/chunk-LV2G7VHL.js.map +1 -0
  37. package/dist/{chunk-C6NHEDHY.js → chunk-M5FVUIYP.js} +2 -2
  38. package/dist/chunk-M5FVUIYP.js.map +1 -0
  39. package/dist/{chunk-HEHERHQ5.js → chunk-MPCCRRE6.js} +2 -2
  40. package/dist/chunk-MPCCRRE6.js.map +1 -0
  41. package/dist/{chunk-RQYEEA2O.js → chunk-N5FSLVKO.js} +2 -2
  42. package/dist/{chunk-CASCUFK2.js → chunk-NOHWIBRX.js} +2 -2
  43. package/dist/chunk-NOHWIBRX.js.map +1 -0
  44. package/dist/{chunk-TRTUHCS4.js → chunk-QCZ2XUKH.js} +2 -2
  45. package/dist/chunk-QCZ2XUKH.js.map +1 -0
  46. package/dist/{chunk-3IJSIVKT.js → chunk-QQBJC2FQ.js} +2 -2
  47. package/dist/{chunk-JZQHKDSY.js → chunk-RNQN2FOU.js} +2 -2
  48. package/dist/chunk-RNQN2FOU.js.map +1 -0
  49. package/dist/{chunk-DTAY7LPC.js → chunk-S5OVP467.js} +2 -2
  50. package/dist/chunk-S5OVP467.js.map +1 -0
  51. package/dist/{chunk-5YOCVEUB.js → chunk-SWCDFEUK.js} +2 -2
  52. package/dist/chunk-SWCDFEUK.js.map +1 -0
  53. package/dist/{chunk-MHCMHKM6.js → chunk-TA3WMOMU.js} +2 -2
  54. package/dist/chunk-TA3WMOMU.js.map +1 -0
  55. package/dist/{chunk-WSGEIVY3.js → chunk-TURD42QO.js} +101 -85
  56. package/dist/chunk-TURD42QO.js.map +1 -0
  57. package/dist/{chunk-WL7HS7EM.js → chunk-UINQOUZR.js} +2 -2
  58. package/dist/{chunk-A4Z6DZ22.js → chunk-VWKUT4CW.js} +2 -2
  59. package/dist/chunk-VWKUT4CW.js.map +1 -0
  60. package/dist/{chunk-ERELJ7BS.js → chunk-WAR4Q2NM.js} +2 -2
  61. package/dist/chunk-WAR4Q2NM.js.map +1 -0
  62. package/dist/{chunk-5HCVKTP3.js → chunk-WHFUWWI6.js} +92 -81
  63. package/dist/chunk-WHFUWWI6.js.map +1 -0
  64. package/dist/{chunk-HQ4KWN76.js → chunk-X3G37FXT.js} +2 -2
  65. package/dist/{chunk-OYV2DN66.js → chunk-X5HF2OFP.js} +2 -2
  66. package/dist/chunk-XWVDS66D.js +963 -0
  67. package/dist/chunk-XWVDS66D.js.map +1 -0
  68. package/dist/{chunk-L6JPBJAS.js → chunk-YAHRT6MB.js} +2 -2
  69. package/dist/{chunk-XRU5WXZX.js → chunk-ZEGAMJO2.js} +2 -2
  70. package/dist/chunk-ZEGAMJO2.js.map +1 -0
  71. package/dist/{chunk-B6SXRCBO.js → chunk-ZGSER5TG.js} +2 -2
  72. package/dist/databricks_volume-7XOUYSTY.js +7 -0
  73. package/dist/{digitalocean-6SPR4S7V.js → digitalocean-3CQ4CPPZ.js} +3 -3
  74. package/dist/{discord-SAV2RBJV.js → discord-BG7OSRJG.js} +2 -2
  75. package/dist/{disk-POACMF4G.js → disk-XVLBCVKE.js} +2 -2
  76. package/dist/{dropbox-CQ7MTYX2.js → dropbox-74GYLV3R.js} +2 -2
  77. package/dist/{email-KBQ7CXS7.js → email-5IZ7OBQ4.js} +2 -2
  78. package/dist/{gcs-SMIE4VMT.js → gcs-EMEYU2XT.js} +3 -3
  79. package/dist/{gdocs-X5Y2SIQX.js → gdocs-R67TDPON.js} +2 -2
  80. package/dist/{gdrive-SIQPRIGI.js → gdrive-PRN2ALRK.js} +2 -2
  81. package/dist/{github-KBHWANKQ.js → github-DV7E6OFV.js} +2 -2
  82. package/dist/{github_ci-HPITNK37.js → github_ci-Q554V5PA.js} +2 -2
  83. package/dist/{gmail-DKHAGJNX.js → gmail-OLN2LT4O.js} +2 -2
  84. package/dist/{gsheets-ZSUDIWGK.js → gsheets-H4RYMQJ5.js} +2 -2
  85. package/dist/{gslides-GYXM7IMJ.js → gslides-YLCHKJOM.js} +2 -2
  86. package/dist/{hf_buckets-RIOMV7WG.js → hf_buckets-DTKXKKFF.js} +3 -3
  87. package/dist/{hf_datasets-QF4BQ3OK.js → hf_datasets-55C4APKR.js} +3 -3
  88. package/dist/{hf_models-62GC2HPZ.js → hf_models-RO5JR36V.js} +3 -3
  89. package/dist/{hf_spaces-NVSMUNRM.js → hf_spaces-ZVZ3EDRX.js} +3 -3
  90. package/dist/index.d.ts +110 -44
  91. package/dist/index.js +520 -232
  92. package/dist/index.js.map +1 -1
  93. package/dist/{langfuse-HUAYVPHF.js → langfuse-ACASJZ7O.js} +2 -2
  94. package/dist/{linear-2MM55KBC.js → linear-IC37LZV7.js} +2 -2
  95. package/dist/{minio-L3XE6PQS.js → minio-HZ576XFQ.js} +3 -3
  96. package/dist/mongodb-JVR62OIO.js +7 -0
  97. package/dist/{notion-UK4GTMT4.js → notion-HKRPQMJS.js} +2 -2
  98. package/dist/{oci-NURLWPL2.js → oci-ZLVECXTW.js} +3 -3
  99. package/dist/postgres-P36Z2YN4.js +7 -0
  100. package/dist/{qingstor-W55D5YFO.js → qingstor-YLP6K3L4.js} +3 -3
  101. package/dist/{r2-FSZK7IFI.js → r2-RPK25ANI.js} +3 -3
  102. package/dist/{redis-S6GIPA4Z.js → redis-V5ULXULL.js} +2 -2
  103. package/dist/{s3-GMPUJ65D.js → s3-4OIOCAAT.js} +2 -2
  104. package/dist/{scaleway-5VM55Y6D.js → scaleway-CCWCLUHB.js} +3 -3
  105. package/dist/{seaweedfs-J3EPUEPE.js → seaweedfs-QSWKF2FN.js} +3 -3
  106. package/dist/{slack-FVBXY7KD.js → slack-YPS7PII3.js} +2 -2
  107. package/dist/{ssh-GCXETJ3Z.js → ssh-YFP3SMTJ.js} +2 -2
  108. package/dist/{supabase-HLWNHBBE.js → supabase-6CFTOKGZ.js} +3 -3
  109. package/dist/{tencent-YDO73XBD.js → tencent-IWZZOSQ4.js} +3 -3
  110. package/dist/{trello-CQ53BQUL.js → trello-XYKWZD6P.js} +2 -2
  111. package/dist/{wasabi-SOZKPMRQ.js → wasabi-6Z4DC5S5.js} +3 -3
  112. package/package.json +7 -5
  113. package/dist/chunk-5DLOHQJ2.js.map +0 -1
  114. package/dist/chunk-5HCVKTP3.js.map +0 -1
  115. package/dist/chunk-5YOCVEUB.js.map +0 -1
  116. package/dist/chunk-A4Z6DZ22.js.map +0 -1
  117. package/dist/chunk-A7X4L4JM.js.map +0 -1
  118. package/dist/chunk-ABTEGAFB.js.map +0 -1
  119. package/dist/chunk-C6NHEDHY.js.map +0 -1
  120. package/dist/chunk-CASCUFK2.js.map +0 -1
  121. package/dist/chunk-DTAY7LPC.js.map +0 -1
  122. package/dist/chunk-E7RW3SBV.js.map +0 -1
  123. package/dist/chunk-ERELJ7BS.js.map +0 -1
  124. package/dist/chunk-HEHERHQ5.js.map +0 -1
  125. package/dist/chunk-JZQHKDSY.js.map +0 -1
  126. package/dist/chunk-LYDMMNL2.js.map +0 -1
  127. package/dist/chunk-MHCMHKM6.js.map +0 -1
  128. package/dist/chunk-N72CAZEH.js +0 -1990
  129. package/dist/chunk-N72CAZEH.js.map +0 -1
  130. package/dist/chunk-NHS7WLEQ.js.map +0 -1
  131. package/dist/chunk-PBBG7VFT.js +0 -1896
  132. package/dist/chunk-PBBG7VFT.js.map +0 -1
  133. package/dist/chunk-RLGWMJD3.js.map +0 -1
  134. package/dist/chunk-TRTUHCS4.js.map +0 -1
  135. package/dist/chunk-WSGEIVY3.js.map +0 -1
  136. package/dist/chunk-XRU5WXZX.js.map +0 -1
  137. package/dist/chunk-YAVGCQUP.js.map +0 -1
  138. package/dist/chunk-YPT4JBUY.js.map +0 -1
  139. package/dist/databricks_volume-HNQ4DJVJ.js +0 -7
  140. package/dist/mongodb-ZOX4FRHJ.js +0 -7
  141. package/dist/postgres-JNFMPAO2.js +0 -7
  142. /package/dist/{aliyun-TMZRUYCG.js.map → aliyun-JMJ3PFYY.js.map} +0 -0
  143. /package/dist/{backblaze-OHW57DLK.js.map → backblaze-TDFD23QO.js.map} +0 -0
  144. /package/dist/{box-UXTCAFOZ.js.map → box-GQ2U2R6R.js.map} +0 -0
  145. /package/dist/{ceph-TNN4I2FT.js.map → ceph-S2VOYO6G.js.map} +0 -0
  146. /package/dist/{chunk-FXFDBF3P.js.map → chunk-3WIO7NBR.js.map} +0 -0
  147. /package/dist/{chunk-O7ODGJYL.js.map → chunk-47AVIIOT.js.map} +0 -0
  148. /package/dist/{chunk-Q6CDMOM6.js.map → chunk-7CW3BMPH.js.map} +0 -0
  149. /package/dist/{chunk-3T3RMDNX.js.map → chunk-AUHSTJJ3.js.map} +0 -0
  150. /package/dist/{chunk-PJBQKMCD.js.map → chunk-DM4GSE26.js.map} +0 -0
  151. /package/dist/{chunk-KTNDT45N.js.map → chunk-FQ33BYFR.js.map} +0 -0
  152. /package/dist/{chunk-BYTU2YC3.js.map → chunk-HGCRXJGP.js.map} +0 -0
  153. /package/dist/{chunk-G5BZE7UA.js.map → chunk-HJJMP6IX.js.map} +0 -0
  154. /package/dist/{chunk-IQVNVTOP.js.map → chunk-I5THIMPP.js.map} +0 -0
  155. /package/dist/{chunk-C6NHFMIP.js.map → chunk-IK2L4EN3.js.map} +0 -0
  156. /package/dist/{chunk-AJICZLHT.js.map → chunk-KPULTUOK.js.map} +0 -0
  157. /package/dist/{chunk-RQYEEA2O.js.map → chunk-N5FSLVKO.js.map} +0 -0
  158. /package/dist/{chunk-3IJSIVKT.js.map → chunk-QQBJC2FQ.js.map} +0 -0
  159. /package/dist/{chunk-WL7HS7EM.js.map → chunk-UINQOUZR.js.map} +0 -0
  160. /package/dist/{chunk-HQ4KWN76.js.map → chunk-X3G37FXT.js.map} +0 -0
  161. /package/dist/{chunk-OYV2DN66.js.map → chunk-X5HF2OFP.js.map} +0 -0
  162. /package/dist/{chunk-L6JPBJAS.js.map → chunk-YAHRT6MB.js.map} +0 -0
  163. /package/dist/{chunk-B6SXRCBO.js.map → chunk-ZGSER5TG.js.map} +0 -0
  164. /package/dist/{databricks_volume-HNQ4DJVJ.js.map → databricks_volume-7XOUYSTY.js.map} +0 -0
  165. /package/dist/{digitalocean-6SPR4S7V.js.map → digitalocean-3CQ4CPPZ.js.map} +0 -0
  166. /package/dist/{discord-SAV2RBJV.js.map → discord-BG7OSRJG.js.map} +0 -0
  167. /package/dist/{disk-POACMF4G.js.map → disk-XVLBCVKE.js.map} +0 -0
  168. /package/dist/{dropbox-CQ7MTYX2.js.map → dropbox-74GYLV3R.js.map} +0 -0
  169. /package/dist/{email-KBQ7CXS7.js.map → email-5IZ7OBQ4.js.map} +0 -0
  170. /package/dist/{gcs-SMIE4VMT.js.map → gcs-EMEYU2XT.js.map} +0 -0
  171. /package/dist/{gdocs-X5Y2SIQX.js.map → gdocs-R67TDPON.js.map} +0 -0
  172. /package/dist/{gdrive-SIQPRIGI.js.map → gdrive-PRN2ALRK.js.map} +0 -0
  173. /package/dist/{github-KBHWANKQ.js.map → github-DV7E6OFV.js.map} +0 -0
  174. /package/dist/{github_ci-HPITNK37.js.map → github_ci-Q554V5PA.js.map} +0 -0
  175. /package/dist/{gmail-DKHAGJNX.js.map → gmail-OLN2LT4O.js.map} +0 -0
  176. /package/dist/{gsheets-ZSUDIWGK.js.map → gsheets-H4RYMQJ5.js.map} +0 -0
  177. /package/dist/{gslides-GYXM7IMJ.js.map → gslides-YLCHKJOM.js.map} +0 -0
  178. /package/dist/{hf_buckets-RIOMV7WG.js.map → hf_buckets-DTKXKKFF.js.map} +0 -0
  179. /package/dist/{hf_datasets-QF4BQ3OK.js.map → hf_datasets-55C4APKR.js.map} +0 -0
  180. /package/dist/{hf_models-62GC2HPZ.js.map → hf_models-RO5JR36V.js.map} +0 -0
  181. /package/dist/{hf_spaces-NVSMUNRM.js.map → hf_spaces-ZVZ3EDRX.js.map} +0 -0
  182. /package/dist/{langfuse-HUAYVPHF.js.map → langfuse-ACASJZ7O.js.map} +0 -0
  183. /package/dist/{linear-2MM55KBC.js.map → linear-IC37LZV7.js.map} +0 -0
  184. /package/dist/{minio-L3XE6PQS.js.map → minio-HZ576XFQ.js.map} +0 -0
  185. /package/dist/{mongodb-ZOX4FRHJ.js.map → mongodb-JVR62OIO.js.map} +0 -0
  186. /package/dist/{notion-UK4GTMT4.js.map → notion-HKRPQMJS.js.map} +0 -0
  187. /package/dist/{oci-NURLWPL2.js.map → oci-ZLVECXTW.js.map} +0 -0
  188. /package/dist/{postgres-JNFMPAO2.js.map → postgres-P36Z2YN4.js.map} +0 -0
  189. /package/dist/{qingstor-W55D5YFO.js.map → qingstor-YLP6K3L4.js.map} +0 -0
  190. /package/dist/{r2-FSZK7IFI.js.map → r2-RPK25ANI.js.map} +0 -0
  191. /package/dist/{redis-S6GIPA4Z.js.map → redis-V5ULXULL.js.map} +0 -0
  192. /package/dist/{s3-GMPUJ65D.js.map → s3-4OIOCAAT.js.map} +0 -0
  193. /package/dist/{scaleway-5VM55Y6D.js.map → scaleway-CCWCLUHB.js.map} +0 -0
  194. /package/dist/{seaweedfs-J3EPUEPE.js.map → seaweedfs-QSWKF2FN.js.map} +0 -0
  195. /package/dist/{slack-FVBXY7KD.js.map → slack-YPS7PII3.js.map} +0 -0
  196. /package/dist/{ssh-GCXETJ3Z.js.map → ssh-YFP3SMTJ.js.map} +0 -0
  197. /package/dist/{supabase-HLWNHBBE.js.map → supabase-6CFTOKGZ.js.map} +0 -0
  198. /package/dist/{tencent-YDO73XBD.js.map → tencent-IWZZOSQ4.js.map} +0 -0
  199. /package/dist/{trello-CQ53BQUL.js.map → trello-XYKWZD6P.js.map} +0 -0
  200. /package/dist/{wasabi-SOZKPMRQ.js.map → wasabi-6Z4DC5S5.js.map} +0 -0
@@ -349,6 +349,7 @@ async function read(accessor, p) {
349
349
  }
350
350
 
351
351
  // src/core/ssh/write.ts
352
+ import { invalidateAfterWrite } from "@struktoai/mirage-core";
352
353
  async function writeBytes(accessor, p, data) {
353
354
  const sftp = await accessor.sftp();
354
355
  const virtual = stripPrefix(p);
@@ -359,6 +360,7 @@ async function writeBytes(accessor, p, data) {
359
360
  else resolveFn();
360
361
  });
361
362
  });
363
+ await invalidateAfterWrite(p);
362
364
  }
363
365
 
364
366
  // src/core/ssh/copy.ts
@@ -369,7 +371,12 @@ async function copy(accessor, src, dst) {
369
371
 
370
372
  // src/core/ssh/find.ts
371
373
  import { norm } from "@struktoai/mirage-core";
372
- import { buildTree, keep } from "@struktoai/mirage-core";
374
+ import {
375
+ buildTree,
376
+ emitStartPath,
377
+ keep,
378
+ startBasename
379
+ } from "@struktoai/mirage-core";
373
380
  function isFileType(t) {
374
381
  return t === "f" || t === "file";
375
382
  }
@@ -453,6 +460,7 @@ async function walk(ctx, virtual, depth) {
453
460
  }
454
461
  async function find(accessor, p, options = {}) {
455
462
  const virtual = norm(stripPrefix(p));
463
+ const startName = startBasename(p.original);
456
464
  const results = [];
457
465
  const baseDepth = (virtual.match(/\//g) ?? []).length;
458
466
  const typeKind = isFileType(options.type) ? "f" : isDirType(options.type) ? "d" : null;
@@ -464,21 +472,16 @@ async function find(accessor, p, options = {}) {
464
472
  nameExclude: options.nameExclude,
465
473
  orNames: options.orNames
466
474
  });
467
- if (virtual !== "/" && (options.maxDepth == null || options.maxDepth >= 0)) {
475
+ if (options.maxDepth == null || options.maxDepth >= 0) {
468
476
  const st = await statRemote(accessor, joinRoot(accessor.config.root ?? "/", virtual));
469
- if (st !== null && keep(
470
- {
471
- key: virtual,
472
- name: virtual.slice(virtual.lastIndexOf("/") + 1),
473
- kind: st.isDir ? "d" : "f",
474
- depth: 0,
475
- isEmpty: st.isDir ? false : st.size === 0
476
- },
477
+ emitStartPath(results, virtual, startName, {
478
+ kind: st?.isDir ? "d" : "f",
479
+ isEmpty: st === null ? null : st.isDir ? false : st.size === 0,
480
+ exists: st !== null,
477
481
  tree,
478
- options.minDepth
479
- )) {
480
- results.push(virtual);
481
- }
482
+ maxDepth: options.maxDepth,
483
+ minDepth: options.minDepth
484
+ });
482
485
  }
483
486
  await walk({ accessor, options, results, baseDepth, tree }, virtual, 0);
484
487
  results.sort();
@@ -761,6 +764,7 @@ import {
761
764
  } from "@struktoai/mirage-core";
762
765
 
763
766
  // src/core/ssh/mkdir.ts
767
+ import { invalidateAfterWrite as invalidateAfterWrite2 } from "@struktoai/mirage-core";
764
768
  import { enoent as enoent5, stripSlash as stripSlash2 } from "@struktoai/mirage-core";
765
769
  async function statRemote3(sftp, remote) {
766
770
  return new Promise((resolveFn) => {
@@ -810,6 +814,7 @@ async function mkdir(accessor, p, recursive) {
810
814
  if (existing?.isDirectory()) continue;
811
815
  await mkdirOne(sftp, stepRemote, true);
812
816
  }
817
+ await invalidateAfterWrite2(p);
813
818
  }
814
819
 
815
820
  // src/commands/builtin/ssh/mkdir.ts
@@ -851,6 +856,7 @@ import {
851
856
  } from "@struktoai/mirage-core";
852
857
 
853
858
  // src/core/ssh/rename.ts
859
+ import { invalidateAfterUnlink, invalidateAfterWrite as invalidateAfterWrite3 } from "@struktoai/mirage-core";
854
860
  import { enoent as enoent6 } from "@struktoai/mirage-core";
855
861
  async function rename(accessor, src, dst) {
856
862
  const sftp = await accessor.sftp();
@@ -869,6 +875,8 @@ async function rename(accessor, src, dst) {
869
875
  else rejectFn(err);
870
876
  });
871
877
  });
878
+ await invalidateAfterWrite3(dst);
879
+ await invalidateAfterUnlink(src);
872
880
  }
873
881
 
874
882
  // src/commands/builtin/ssh/mv.ts
@@ -936,7 +944,7 @@ import {
936
944
  } from "@struktoai/mirage-core";
937
945
 
938
946
  // src/core/ssh/rmdir.ts
939
- import { enoent as enoent7 } from "@struktoai/mirage-core";
947
+ import { enoent as enoent7, invalidateAfterUnlink as invalidateAfterUnlink2 } from "@struktoai/mirage-core";
940
948
  async function rmdir(accessor, p) {
941
949
  const sftp = await accessor.sftp();
942
950
  const virtual = stripPrefix(p);
@@ -951,9 +959,11 @@ async function rmdir(accessor, p) {
951
959
  else rejectFn(err);
952
960
  });
953
961
  });
962
+ await invalidateAfterUnlink2(p);
954
963
  }
955
964
 
956
965
  // src/core/ssh/unlink.ts
966
+ import { invalidateAfterUnlink as invalidateAfterUnlink3 } from "@struktoai/mirage-core";
957
967
  import { enoent as enoent8 } from "@struktoai/mirage-core";
958
968
  async function unlink(accessor, p) {
959
969
  const sftp = await accessor.sftp();
@@ -969,10 +979,11 @@ async function unlink(accessor, p) {
969
979
  else rejectFn(err);
970
980
  });
971
981
  });
982
+ await invalidateAfterUnlink3(p);
972
983
  }
973
984
 
974
985
  // src/core/ssh/rm.ts
975
- import { enoent as enoent9 } from "@struktoai/mirage-core";
986
+ import { enoent as enoent9, invalidateAfterUnlink as invalidateAfterUnlink4 } from "@struktoai/mirage-core";
976
987
  async function statRemote4(sftp, remote) {
977
988
  return new Promise((resolveFn, rejectFn) => {
978
989
  sftp.lstat(remote, (err, stats) => {
@@ -1029,6 +1040,7 @@ async function rmR(accessor, p) {
1029
1040
  if (isNoSuchFile(err)) throw enoent9(p);
1030
1041
  throw err;
1031
1042
  }
1043
+ await invalidateAfterUnlink4(p);
1032
1044
  }
1033
1045
 
1034
1046
  // src/commands/builtin/ssh/rm.ts
@@ -1258,7 +1270,13 @@ var SSH_DIFF = command29({
1258
1270
  name: "diff",
1259
1271
  resource: ResourceName29.SSH,
1260
1272
  spec: specOf29("diff"),
1261
- fn: (accessor, paths, _texts, opts) => diffGeneric(paths, opts, (p) => stream(accessor, p))
1273
+ fn: (accessor, paths, _texts, opts) => diffGeneric(
1274
+ paths,
1275
+ opts,
1276
+ (p) => stream(accessor, p),
1277
+ (p) => readdir(accessor, p, opts.index ?? void 0),
1278
+ (p) => stat(accessor, p)
1279
+ )
1262
1280
  });
1263
1281
 
1264
1282
  // src/commands/builtin/ssh/expand.ts
@@ -1478,53 +1496,46 @@ var SSH_REV = command45({
1478
1496
  });
1479
1497
 
1480
1498
  // src/commands/builtin/ssh/sed.ts
1481
- import { ResourceName as ResourceName46, command as command46, specOf as specOf46, sedGeneric } from "@struktoai/mirage-core";
1482
- var SSH_SED = command46({
1483
- name: "sed",
1499
+ import { ResourceName as ResourceName46, makeSed } from "@struktoai/mirage-core";
1500
+ var SSH_SED = makeSed({
1484
1501
  resource: ResourceName46.SSH,
1485
- spec: specOf46("sed"),
1486
- fn: (accessor, paths, texts, opts) => sedGeneric(
1487
- paths,
1488
- texts,
1489
- opts,
1490
- (p) => stream(accessor, p),
1491
- (p, d) => writeBytes(accessor, p, d)
1492
- )
1502
+ stream: (a, p) => stream(a, p),
1503
+ write: (a, p, d) => writeBytes(a, p, d)
1493
1504
  });
1494
1505
 
1495
1506
  // src/commands/builtin/ssh/sha256sum.ts
1496
- import { ResourceName as ResourceName47, command as command47, sha256sumGeneric, specOf as specOf47 } from "@struktoai/mirage-core";
1497
- var SSH_SHA256SUM = command47({
1507
+ import { ResourceName as ResourceName47, command as command46, sha256sumGeneric, specOf as specOf46 } from "@struktoai/mirage-core";
1508
+ var SSH_SHA256SUM = command46({
1498
1509
  name: "sha256sum",
1499
1510
  resource: ResourceName47.SSH,
1500
- spec: specOf47("sha256sum"),
1511
+ spec: specOf46("sha256sum"),
1501
1512
  fn: (accessor, paths, _texts, opts) => sha256sumGeneric(paths, opts, (p) => stream(accessor, p))
1502
1513
  });
1503
1514
 
1504
1515
  // src/commands/builtin/ssh/shuf.ts
1505
- import { ResourceName as ResourceName48, command as command48, specOf as specOf48, shufGeneric } from "@struktoai/mirage-core";
1506
- var SSH_SHUF = command48({
1516
+ import { ResourceName as ResourceName48, command as command47, specOf as specOf47, shufGeneric } from "@struktoai/mirage-core";
1517
+ var SSH_SHUF = command47({
1507
1518
  name: "shuf",
1508
1519
  resource: ResourceName48.SSH,
1509
- spec: specOf48("shuf"),
1520
+ spec: specOf47("shuf"),
1510
1521
  fn: (accessor, paths, texts, opts) => shufGeneric(paths, texts, opts, (p) => stream(accessor, p))
1511
1522
  });
1512
1523
 
1513
1524
  // src/commands/builtin/ssh/sort.ts
1514
- import { ResourceName as ResourceName49, command as command49, specOf as specOf49, sortGeneric } from "@struktoai/mirage-core";
1515
- var SSH_SORT = command49({
1525
+ import { ResourceName as ResourceName49, command as command48, specOf as specOf48, sortGeneric } from "@struktoai/mirage-core";
1526
+ var SSH_SORT = command48({
1516
1527
  name: "sort",
1517
1528
  resource: ResourceName49.SSH,
1518
- spec: specOf49("sort"),
1529
+ spec: specOf48("sort"),
1519
1530
  fn: (accessor, paths, _texts, opts) => sortGeneric(paths, opts, (p) => stream(accessor, p))
1520
1531
  });
1521
1532
 
1522
1533
  // src/commands/builtin/ssh/split.ts
1523
- import { ResourceName as ResourceName50, command as command50, specOf as specOf50, splitGeneric } from "@struktoai/mirage-core";
1524
- var SSH_SPLIT = command50({
1534
+ import { ResourceName as ResourceName50, command as command49, specOf as specOf49, splitGeneric } from "@struktoai/mirage-core";
1535
+ var SSH_SPLIT = command49({
1525
1536
  name: "split",
1526
1537
  resource: ResourceName50.SSH,
1527
- spec: specOf50("split"),
1538
+ spec: specOf49("split"),
1528
1539
  fn: (accessor, paths, _texts, opts) => splitGeneric(
1529
1540
  paths,
1530
1541
  opts,
@@ -1535,29 +1546,29 @@ var SSH_SPLIT = command50({
1535
1546
  });
1536
1547
 
1537
1548
  // src/commands/builtin/ssh/strings.ts
1538
- import { ResourceName as ResourceName51, command as command51, specOf as specOf51, stringsGeneric } from "@struktoai/mirage-core";
1539
- var SSH_STRINGS = command51({
1549
+ import { ResourceName as ResourceName51, command as command50, specOf as specOf50, stringsGeneric } from "@struktoai/mirage-core";
1550
+ var SSH_STRINGS = command50({
1540
1551
  name: "strings",
1541
1552
  resource: ResourceName51.SSH,
1542
- spec: specOf51("strings"),
1553
+ spec: specOf50("strings"),
1543
1554
  fn: (accessor, paths, _texts, opts) => stringsGeneric(paths, opts, (p) => stream(accessor, p))
1544
1555
  });
1545
1556
 
1546
1557
  // src/commands/builtin/ssh/tac.ts
1547
- import { ResourceName as ResourceName52, command as command52, specOf as specOf52, tacGeneric } from "@struktoai/mirage-core";
1548
- var SSH_TAC = command52({
1558
+ import { ResourceName as ResourceName52, command as command51, specOf as specOf51, tacGeneric } from "@struktoai/mirage-core";
1559
+ var SSH_TAC = command51({
1549
1560
  name: "tac",
1550
1561
  resource: ResourceName52.SSH,
1551
- spec: specOf52("tac"),
1562
+ spec: specOf51("tac"),
1552
1563
  fn: (accessor, paths, _texts, opts) => tacGeneric(paths, opts, (p) => stream(accessor, p))
1553
1564
  });
1554
1565
 
1555
1566
  // src/commands/builtin/ssh/tar.ts
1556
- import { ResourceName as ResourceName53, command as command53, specOf as specOf53, tarGeneric } from "@struktoai/mirage-core";
1557
- var SSH_TAR = command53({
1567
+ import { ResourceName as ResourceName53, command as command52, specOf as specOf52, tarGeneric } from "@struktoai/mirage-core";
1568
+ var SSH_TAR = command52({
1558
1569
  name: "tar",
1559
1570
  resource: ResourceName53.SSH,
1560
- spec: specOf53("tar"),
1571
+ spec: specOf52("tar"),
1561
1572
  fn: (accessor, paths, _texts, opts) => tarGeneric(
1562
1573
  paths,
1563
1574
  opts,
@@ -1569,11 +1580,11 @@ var SSH_TAR = command53({
1569
1580
  });
1570
1581
 
1571
1582
  // src/commands/builtin/ssh/tee.ts
1572
- import { ResourceName as ResourceName54, command as command54, specOf as specOf54, teeGeneric } from "@struktoai/mirage-core";
1573
- var SSH_TEE = command54({
1583
+ import { ResourceName as ResourceName54, command as command53, specOf as specOf53, teeGeneric } from "@struktoai/mirage-core";
1584
+ var SSH_TEE = command53({
1574
1585
  name: "tee",
1575
1586
  resource: ResourceName54.SSH,
1576
- spec: specOf54("tee"),
1587
+ spec: specOf53("tee"),
1577
1588
  fn: (accessor, paths, texts, opts) => teeGeneric(
1578
1589
  paths,
1579
1590
  texts,
@@ -1585,47 +1596,47 @@ var SSH_TEE = command54({
1585
1596
  });
1586
1597
 
1587
1598
  // src/commands/builtin/ssh/tr.ts
1588
- import { ResourceName as ResourceName55, command as command55, specOf as specOf55, trGeneric } from "@struktoai/mirage-core";
1589
- var SSH_TR = command55({
1599
+ import { ResourceName as ResourceName55, command as command54, specOf as specOf54, trGeneric } from "@struktoai/mirage-core";
1600
+ var SSH_TR = command54({
1590
1601
  name: "tr",
1591
1602
  resource: ResourceName55.SSH,
1592
- spec: specOf55("tr"),
1603
+ spec: specOf54("tr"),
1593
1604
  fn: (accessor, paths, texts, opts) => trGeneric(paths, texts, opts, (p) => stream(accessor, p))
1594
1605
  });
1595
1606
 
1596
1607
  // src/commands/builtin/ssh/tsort.ts
1597
- import { ResourceName as ResourceName56, command as command56, specOf as specOf56, tsortGeneric } from "@struktoai/mirage-core";
1598
- var SSH_TSORT = command56({
1608
+ import { ResourceName as ResourceName56, command as command55, specOf as specOf55, tsortGeneric } from "@struktoai/mirage-core";
1609
+ var SSH_TSORT = command55({
1599
1610
  name: "tsort",
1600
1611
  resource: ResourceName56.SSH,
1601
- spec: specOf56("tsort"),
1612
+ spec: specOf55("tsort"),
1602
1613
  fn: (accessor, paths, _texts, opts) => tsortGeneric(paths, opts, (p) => stream(accessor, p))
1603
1614
  });
1604
1615
 
1605
1616
  // src/commands/builtin/ssh/unexpand.ts
1606
- import { ResourceName as ResourceName57, command as command57, specOf as specOf57, unexpandGeneric } from "@struktoai/mirage-core";
1607
- var SSH_UNEXPAND = command57({
1617
+ import { ResourceName as ResourceName57, command as command56, specOf as specOf56, unexpandGeneric } from "@struktoai/mirage-core";
1618
+ var SSH_UNEXPAND = command56({
1608
1619
  name: "unexpand",
1609
1620
  resource: ResourceName57.SSH,
1610
- spec: specOf57("unexpand"),
1621
+ spec: specOf56("unexpand"),
1611
1622
  fn: (accessor, paths, _texts, opts) => unexpandGeneric(paths, opts, (p) => stream(accessor, p))
1612
1623
  });
1613
1624
 
1614
1625
  // src/commands/builtin/ssh/uniq.ts
1615
- import { ResourceName as ResourceName58, command as command58, specOf as specOf58, uniqGeneric } from "@struktoai/mirage-core";
1616
- var SSH_UNIQ = command58({
1626
+ import { ResourceName as ResourceName58, command as command57, specOf as specOf57, uniqGeneric } from "@struktoai/mirage-core";
1627
+ var SSH_UNIQ = command57({
1617
1628
  name: "uniq",
1618
1629
  resource: ResourceName58.SSH,
1619
- spec: specOf58("uniq"),
1630
+ spec: specOf57("uniq"),
1620
1631
  fn: (accessor, paths, _texts, opts) => uniqGeneric(paths, opts, (p) => stream(accessor, p))
1621
1632
  });
1622
1633
 
1623
1634
  // src/commands/builtin/ssh/unzip.ts
1624
- import { ResourceName as ResourceName59, command as command59, specOf as specOf59, unzipGeneric } from "@struktoai/mirage-core";
1625
- var SSH_UNZIP = command59({
1635
+ import { ResourceName as ResourceName59, command as command58, specOf as specOf58, unzipGeneric } from "@struktoai/mirage-core";
1636
+ var SSH_UNZIP = command58({
1626
1637
  name: "unzip",
1627
1638
  resource: ResourceName59.SSH,
1628
- spec: specOf59("unzip"),
1639
+ spec: specOf58("unzip"),
1629
1640
  fn: (accessor, paths, _texts, opts) => unzipGeneric(
1630
1641
  paths,
1631
1642
  opts,
@@ -1637,38 +1648,38 @@ var SSH_UNZIP = command59({
1637
1648
  });
1638
1649
 
1639
1650
  // src/commands/builtin/ssh/xxd.ts
1640
- import { ResourceName as ResourceName60, command as command60, specOf as specOf60, xxdGeneric } from "@struktoai/mirage-core";
1641
- var SSH_XXD = command60({
1651
+ import { ResourceName as ResourceName60, command as command59, specOf as specOf59, xxdGeneric } from "@struktoai/mirage-core";
1652
+ var SSH_XXD = command59({
1642
1653
  name: "xxd",
1643
1654
  resource: ResourceName60.SSH,
1644
- spec: specOf60("xxd"),
1655
+ spec: specOf59("xxd"),
1645
1656
  fn: (accessor, paths, _texts, opts) => xxdGeneric(paths, opts, (p) => stream(accessor, p))
1646
1657
  });
1647
1658
 
1648
1659
  // src/commands/builtin/ssh/zcat.ts
1649
- import { ResourceName as ResourceName61, command as command61, specOf as specOf61, zcatGeneric } from "@struktoai/mirage-core";
1650
- var SSH_ZCAT = command61({
1660
+ import { ResourceName as ResourceName61, command as command60, specOf as specOf60, zcatGeneric } from "@struktoai/mirage-core";
1661
+ var SSH_ZCAT = command60({
1651
1662
  name: "zcat",
1652
1663
  resource: ResourceName61.SSH,
1653
- spec: specOf61("zcat"),
1664
+ spec: specOf60("zcat"),
1654
1665
  fn: (accessor, paths, _texts, opts) => zcatGeneric(paths, opts, (p) => stream(accessor, p))
1655
1666
  });
1656
1667
 
1657
1668
  // src/commands/builtin/ssh/zgrep.ts
1658
- import { ResourceName as ResourceName62, command as command62, specOf as specOf62, zgrepGeneric } from "@struktoai/mirage-core";
1659
- var SSH_ZGREP = command62({
1669
+ import { ResourceName as ResourceName62, command as command61, specOf as specOf61, zgrepGeneric } from "@struktoai/mirage-core";
1670
+ var SSH_ZGREP = command61({
1660
1671
  name: "zgrep",
1661
1672
  resource: ResourceName62.SSH,
1662
- spec: specOf62("zgrep"),
1673
+ spec: specOf61("zgrep"),
1663
1674
  fn: (accessor, paths, texts, opts) => zgrepGeneric(paths, texts, opts, (p) => stream(accessor, p))
1664
1675
  });
1665
1676
 
1666
1677
  // src/commands/builtin/ssh/zip_cmd.ts
1667
- import { ResourceName as ResourceName63, command as command63, specOf as specOf63, zipGeneric } from "@struktoai/mirage-core";
1668
- var SSH_ZIP = command63({
1678
+ import { ResourceName as ResourceName63, command as command62, specOf as specOf62, zipGeneric } from "@struktoai/mirage-core";
1679
+ var SSH_ZIP = command62({
1669
1680
  name: "zip",
1670
1681
  resource: ResourceName63.SSH,
1671
- spec: specOf63("zip"),
1682
+ spec: specOf62("zip"),
1672
1683
  fn: (accessor, paths, _texts, opts) => zipGeneric(
1673
1684
  paths,
1674
1685
  opts,
@@ -1950,7 +1961,7 @@ var SSH_PROMPT = `{prefix}
1950
1961
  // src/resource/ssh/ssh.ts
1951
1962
  var SSHResource = class extends BaseResource {
1952
1963
  kind = ResourceName75.SSH;
1953
- isRemote = true;
1964
+ cachesReads = true;
1954
1965
  indexTtl = 60;
1955
1966
  prompt = SSH_PROMPT;
1956
1967
  config;
@@ -2083,4 +2094,4 @@ export {
2083
2094
  SSH_PROMPT,
2084
2095
  SSHResource
2085
2096
  };
2086
- //# sourceMappingURL=chunk-5HCVKTP3.js.map
2097
+ //# sourceMappingURL=chunk-WHFUWWI6.js.map