@struktoai/mirage-browser 0.0.3 → 0.0.5-alpha.1

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 (260) hide show
  1. package/README.md +2 -1
  2. package/dist/aliyun-DR6KT3H6.js +8 -0
  3. package/dist/backblaze-XCLZXTES.js +8 -0
  4. package/dist/box-XBCSU3AA.js +8 -0
  5. package/dist/ceph-F5S2NMTO.js +8 -0
  6. package/dist/{chunk-HYUESAQS.js → chunk-2J35WXX5.js} +7 -3
  7. package/dist/chunk-2J35WXX5.js.map +1 -0
  8. package/dist/{chunk-CGZGX2GO.js → chunk-2WNXK742.js} +10 -12
  9. package/dist/chunk-2WNXK742.js.map +1 -0
  10. package/dist/{chunk-X2CCEHOR.js → chunk-2WSKXBSV.js} +22 -12
  11. package/dist/chunk-2WSKXBSV.js.map +1 -0
  12. package/dist/{chunk-SOF74I3T.js → chunk-37WKCB2E.js} +7 -5
  13. package/dist/chunk-37WKCB2E.js.map +1 -0
  14. package/dist/{chunk-ROHDW6KT.js → chunk-3IYCVC7W.js} +11 -5
  15. package/dist/chunk-3IYCVC7W.js.map +1 -0
  16. package/dist/{chunk-LSURHXZH.js → chunk-46HNNKFR.js} +11 -5
  17. package/dist/chunk-46HNNKFR.js.map +1 -0
  18. package/dist/chunk-4IF4TGAI.js +11 -0
  19. package/dist/chunk-4IF4TGAI.js.map +1 -0
  20. package/dist/{chunk-DA5EW34P.js → chunk-5OZJMTYW.js} +17 -13
  21. package/dist/chunk-5OZJMTYW.js.map +1 -0
  22. package/dist/{chunk-PV53AX35.js → chunk-5UM6EBVW.js} +18 -12
  23. package/dist/chunk-5UM6EBVW.js.map +1 -0
  24. package/dist/{chunk-NWZNQ3RC.js → chunk-6HRSCX2U.js} +11 -5
  25. package/dist/chunk-6HRSCX2U.js.map +1 -0
  26. package/dist/{chunk-F5QWZ7GM.js → chunk-7HWQAYXR.js} +11 -5
  27. package/dist/chunk-7HWQAYXR.js.map +1 -0
  28. package/dist/{chunk-OSMEXGRN.js → chunk-AUZNQ7EI.js} +13 -20
  29. package/dist/chunk-AUZNQ7EI.js.map +1 -0
  30. package/dist/{chunk-RQ273N5K.js → chunk-BGA2F226.js} +26 -21
  31. package/dist/chunk-BGA2F226.js.map +1 -0
  32. package/dist/{chunk-HXQ7HDA6.js → chunk-BV372CUO.js} +18 -20
  33. package/dist/chunk-BV372CUO.js.map +1 -0
  34. package/dist/{chunk-57QQAM7V.js → chunk-C4THTILY.js} +11 -5
  35. package/dist/chunk-C4THTILY.js.map +1 -0
  36. package/dist/{chunk-DVXOMWD4.js → chunk-D4MEOKNQ.js} +11 -5
  37. package/dist/chunk-D4MEOKNQ.js.map +1 -0
  38. package/dist/chunk-D4RAMWYH.js +88 -0
  39. package/dist/chunk-D4RAMWYH.js.map +1 -0
  40. package/dist/{chunk-NLBT6TBM.js → chunk-EHIT6WCY.js} +11 -5
  41. package/dist/chunk-EHIT6WCY.js.map +1 -0
  42. package/dist/{chunk-CNDGXKMU.js → chunk-EN6TZYT2.js} +11 -5
  43. package/dist/chunk-EN6TZYT2.js.map +1 -0
  44. package/dist/{chunk-QLLRQNOJ.js → chunk-FTDVV7EQ.js} +11 -5
  45. package/dist/chunk-FTDVV7EQ.js.map +1 -0
  46. package/dist/{chunk-G26SGOFR.js → chunk-G67Q2Z6I.js} +11 -5
  47. package/dist/chunk-G67Q2Z6I.js.map +1 -0
  48. package/dist/{chunk-XBOJZZRT.js → chunk-GM2QMJAY.js} +13 -20
  49. package/dist/chunk-GM2QMJAY.js.map +1 -0
  50. package/dist/{chunk-XYKNXGPR.js → chunk-HRWLHJX2.js} +14 -20
  51. package/dist/chunk-HRWLHJX2.js.map +1 -0
  52. package/dist/{chunk-DHZMC42C.js → chunk-INEXV2PN.js} +11 -5
  53. package/dist/chunk-INEXV2PN.js.map +1 -0
  54. package/dist/chunk-IZMKMD3O.js +11 -0
  55. package/dist/chunk-IZMKMD3O.js.map +1 -0
  56. package/dist/{chunk-4NLXLDMV.js → chunk-JUVMJ5GI.js} +13 -20
  57. package/dist/chunk-JUVMJ5GI.js.map +1 -0
  58. package/dist/{chunk-BIIG7ZAQ.js → chunk-KL2VFYUV.js} +7 -5
  59. package/dist/chunk-KL2VFYUV.js.map +1 -0
  60. package/dist/{chunk-J54OBIJA.js → chunk-L64GRKOD.js} +12 -3
  61. package/dist/chunk-L64GRKOD.js.map +1 -0
  62. package/dist/{chunk-54NTYJEO.js → chunk-LPDLPRPS.js} +1 -3
  63. package/dist/{chunk-54NTYJEO.js.map → chunk-LPDLPRPS.js.map} +1 -1
  64. package/dist/chunk-M2UF2JHJ.js +11 -0
  65. package/dist/chunk-M2UF2JHJ.js.map +1 -0
  66. package/dist/{chunk-KNJKYCTA.js → chunk-NVHPJ5CV.js} +19 -12
  67. package/dist/chunk-NVHPJ5CV.js.map +1 -0
  68. package/dist/{chunk-O5ONB7QT.js → chunk-OSTDTTWI.js} +14 -5
  69. package/dist/chunk-OSTDTTWI.js.map +1 -0
  70. package/dist/{chunk-J7PLA5S3.js → chunk-PQCRGTSA.js} +11 -5
  71. package/dist/chunk-PQCRGTSA.js.map +1 -0
  72. package/dist/{chunk-BJHHL4UT.js → chunk-QE7QNA45.js} +14 -11
  73. package/dist/chunk-QE7QNA45.js.map +1 -0
  74. package/dist/{chunk-K2S42IR4.js → chunk-QG2NUNCY.js} +11 -5
  75. package/dist/chunk-QG2NUNCY.js.map +1 -0
  76. package/dist/chunk-UFHBDBZD.js +1212 -0
  77. package/dist/chunk-UFHBDBZD.js.map +1 -0
  78. package/dist/{chunk-KTE5PB2D.js → chunk-UY22T4AC.js} +22 -14
  79. package/dist/chunk-UY22T4AC.js.map +1 -0
  80. package/dist/chunk-XJBC3OYX.js +11 -0
  81. package/dist/chunk-XJBC3OYX.js.map +1 -0
  82. package/dist/{chunk-6YP3B7UK.js → chunk-Y6DYUK6J.js} +11 -5
  83. package/dist/chunk-Y6DYUK6J.js.map +1 -0
  84. package/dist/{chunk-DFHFILVF.js → chunk-YOCTIHQZ.js} +14 -12
  85. package/dist/chunk-YOCTIHQZ.js.map +1 -0
  86. package/dist/{chunk-TQ6VRUEI.js → chunk-ZDJPUXYH.js} +14 -12
  87. package/dist/chunk-ZDJPUXYH.js.map +1 -0
  88. package/dist/{chunk-2AEAISO2.js → chunk-ZKCOSE3R.js} +18 -18
  89. package/dist/chunk-ZKCOSE3R.js.map +1 -0
  90. package/dist/chunk-ZTHVEXIV.js +11 -0
  91. package/dist/chunk-ZTHVEXIV.js.map +1 -0
  92. package/dist/{config-ET26F632.js → config-2Y6LZKLV.js} +2 -4
  93. package/dist/config-4GSOMUMF.js +9 -0
  94. package/dist/config-5YBUWFUP.js +9 -0
  95. package/dist/config-DE5OZ4I7.js +9 -0
  96. package/dist/config-ELDOFRJW.js +9 -0
  97. package/dist/config-FPM3LAW7.js +9 -0
  98. package/dist/config-JY557MA6.js +9 -0
  99. package/dist/{config-NV5WXP64.js → config-UU27ALAA.js} +2 -4
  100. package/dist/config-WRACCRPN.js +9 -0
  101. package/dist/digitalocean-QDHTRS2W.js +8 -0
  102. package/dist/discord-ERUI7OAQ.js +7 -0
  103. package/dist/dropbox-3U6D4HLE.js +8 -0
  104. package/dist/gcal-MTBSDG34.js +8 -0
  105. package/dist/gcs-KNGRBBET.js +8 -0
  106. package/dist/gdocs-RUIOIRKP.js +8 -0
  107. package/dist/gdrive-5JB7ZKEP.js +8 -0
  108. package/dist/github-CIXBFBVO.js +7 -0
  109. package/dist/github_ci-HR6YOYAO.js +8 -0
  110. package/dist/gmail-JHGWTQU5.js +8 -0
  111. package/dist/gsheets-N54JO2RS.js +8 -0
  112. package/dist/gslides-B4VMNLMB.js +8 -0
  113. package/dist/index.d.ts +292 -348
  114. package/dist/index.js +171 -110
  115. package/dist/index.js.map +1 -1
  116. package/dist/langfuse-HEUJGDOC.js +7 -0
  117. package/dist/linear-J4QQ3CA6.js +7 -0
  118. package/dist/minio-BXWHJ6K5.js +8 -0
  119. package/dist/mongodb-YZP643ZU.js +7 -0
  120. package/dist/notion-I5S5SRLO.js +7 -0
  121. package/dist/oci-XOPKH4AE.js +8 -0
  122. package/dist/opfs-36QO72Y5.js +7 -0
  123. package/dist/postgres-HPOMN2AR.js +7 -0
  124. package/dist/qingstor-JKAHLK62.js +8 -0
  125. package/dist/r2-L3QXQ76M.js +8 -0
  126. package/dist/{s3-GI7SDKGR.js → s3-LRZJPGHK.js} +2 -2
  127. package/dist/scaleway-CGNDYNKS.js +8 -0
  128. package/dist/seaweedfs-BSQWCBIR.js +8 -0
  129. package/dist/slack-62ECSENR.js +7 -0
  130. package/dist/supabase-J66NXWAF.js +8 -0
  131. package/dist/tencent-AC667LV3.js +8 -0
  132. package/dist/trello-SUPG6VDF.js +7 -0
  133. package/dist/trello-SUPG6VDF.js.map +1 -0
  134. package/dist/wasabi-5KKPW6LH.js +8 -0
  135. package/dist/wasabi-5KKPW6LH.js.map +1 -0
  136. package/package.json +2 -3
  137. package/dist/aliyun-GMNRT7BJ.js +0 -8
  138. package/dist/backblaze-O6CLR73B.js +0 -8
  139. package/dist/box-GXWDWZRN.js +0 -8
  140. package/dist/ceph-SM7MXDAY.js +0 -8
  141. package/dist/chunk-2AEAISO2.js.map +0 -1
  142. package/dist/chunk-2H4KUUFP.js +0 -26
  143. package/dist/chunk-2H4KUUFP.js.map +0 -1
  144. package/dist/chunk-4NLXLDMV.js.map +0 -1
  145. package/dist/chunk-57QQAM7V.js.map +0 -1
  146. package/dist/chunk-6YP3B7UK.js.map +0 -1
  147. package/dist/chunk-BIIG7ZAQ.js.map +0 -1
  148. package/dist/chunk-BJHHL4UT.js.map +0 -1
  149. package/dist/chunk-CGZGX2GO.js.map +0 -1
  150. package/dist/chunk-CNDGXKMU.js.map +0 -1
  151. package/dist/chunk-DA5EW34P.js.map +0 -1
  152. package/dist/chunk-DFHFILVF.js.map +0 -1
  153. package/dist/chunk-DHZMC42C.js.map +0 -1
  154. package/dist/chunk-DVXOMWD4.js.map +0 -1
  155. package/dist/chunk-F5QWZ7GM.js.map +0 -1
  156. package/dist/chunk-G26SGOFR.js.map +0 -1
  157. package/dist/chunk-HXQ7HDA6.js.map +0 -1
  158. package/dist/chunk-HYUESAQS.js.map +0 -1
  159. package/dist/chunk-J54OBIJA.js.map +0 -1
  160. package/dist/chunk-J7PLA5S3.js.map +0 -1
  161. package/dist/chunk-JSAQMYPK.js +0 -26
  162. package/dist/chunk-JSAQMYPK.js.map +0 -1
  163. package/dist/chunk-K2S42IR4.js.map +0 -1
  164. package/dist/chunk-KNJKYCTA.js.map +0 -1
  165. package/dist/chunk-KTE5PB2D.js.map +0 -1
  166. package/dist/chunk-KV2DM5H6.js +0 -2116
  167. package/dist/chunk-KV2DM5H6.js.map +0 -1
  168. package/dist/chunk-LSURHXZH.js.map +0 -1
  169. package/dist/chunk-NLBT6TBM.js.map +0 -1
  170. package/dist/chunk-NMZBJOFW.js +0 -26
  171. package/dist/chunk-NMZBJOFW.js.map +0 -1
  172. package/dist/chunk-NWZNQ3RC.js.map +0 -1
  173. package/dist/chunk-O5ONB7QT.js.map +0 -1
  174. package/dist/chunk-OSMEXGRN.js.map +0 -1
  175. package/dist/chunk-PV53AX35.js.map +0 -1
  176. package/dist/chunk-QLLRQNOJ.js.map +0 -1
  177. package/dist/chunk-ROHDW6KT.js.map +0 -1
  178. package/dist/chunk-RQ273N5K.js.map +0 -1
  179. package/dist/chunk-SOF74I3T.js.map +0 -1
  180. package/dist/chunk-TQ6VRUEI.js.map +0 -1
  181. package/dist/chunk-X2CCEHOR.js.map +0 -1
  182. package/dist/chunk-XBOJZZRT.js.map +0 -1
  183. package/dist/chunk-XYKNXGPR.js.map +0 -1
  184. package/dist/chunk-YGRKFONX.js +0 -26
  185. package/dist/chunk-YGRKFONX.js.map +0 -1
  186. package/dist/config-7IZCGWKX.js +0 -11
  187. package/dist/config-AT74FARJ.js +0 -11
  188. package/dist/config-C2AYHACT.js +0 -11
  189. package/dist/config-GHJOYNM6.js +0 -11
  190. package/dist/config-L55UXIF4.js +0 -11
  191. package/dist/config-V7BLK5WP.js +0 -11
  192. package/dist/digitalocean-XFH2V2A3.js +0 -8
  193. package/dist/discord-OQMSHM3L.js +0 -7
  194. package/dist/dropbox-IAOKM7G5.js +0 -8
  195. package/dist/gcs-JYZB6CVP.js +0 -8
  196. package/dist/gdocs-PHKQGLZL.js +0 -8
  197. package/dist/gdrive-4JQLGOOP.js +0 -8
  198. package/dist/github-DU7Z4RSU.js +0 -7
  199. package/dist/github_ci-XSAJDNXC.js +0 -8
  200. package/dist/gmail-DEQP2M7T.js +0 -8
  201. package/dist/gsheets-KCIHSMOK.js +0 -8
  202. package/dist/gslides-2KBUKKM5.js +0 -8
  203. package/dist/langfuse-FNCMKFSL.js +0 -7
  204. package/dist/linear-XTFO4WKD.js +0 -7
  205. package/dist/minio-NGPBAJY3.js +0 -8
  206. package/dist/mongodb-PGOX6QSY.js +0 -7
  207. package/dist/notion-HYYNQ7KI.js +0 -7
  208. package/dist/oci-EGDBSMLM.js +0 -8
  209. package/dist/opfs-5WGXB5OG.js +0 -7
  210. package/dist/postgres-5HYED4AC.js +0 -7
  211. package/dist/qingstor-2T4Y6MEG.js +0 -8
  212. package/dist/r2-3B45S2KV.js +0 -8
  213. package/dist/scaleway-ICCXVAY6.js +0 -8
  214. package/dist/seaweedfs-MF77EC33.js +0 -8
  215. package/dist/slack-6LGQERIU.js +0 -7
  216. package/dist/supabase-XTOVMHXU.js +0 -8
  217. package/dist/tencent-FXFKSOTN.js +0 -8
  218. package/dist/trello-DZK4NEVY.js +0 -7
  219. package/dist/wasabi-KVE2B6RB.js +0 -8
  220. /package/dist/{aliyun-GMNRT7BJ.js.map → aliyun-DR6KT3H6.js.map} +0 -0
  221. /package/dist/{backblaze-O6CLR73B.js.map → backblaze-XCLZXTES.js.map} +0 -0
  222. /package/dist/{box-GXWDWZRN.js.map → box-XBCSU3AA.js.map} +0 -0
  223. /package/dist/{ceph-SM7MXDAY.js.map → ceph-F5S2NMTO.js.map} +0 -0
  224. /package/dist/{config-7IZCGWKX.js.map → config-2Y6LZKLV.js.map} +0 -0
  225. /package/dist/{config-AT74FARJ.js.map → config-4GSOMUMF.js.map} +0 -0
  226. /package/dist/{config-C2AYHACT.js.map → config-5YBUWFUP.js.map} +0 -0
  227. /package/dist/{config-ET26F632.js.map → config-DE5OZ4I7.js.map} +0 -0
  228. /package/dist/{config-GHJOYNM6.js.map → config-ELDOFRJW.js.map} +0 -0
  229. /package/dist/{config-L55UXIF4.js.map → config-FPM3LAW7.js.map} +0 -0
  230. /package/dist/{config-NV5WXP64.js.map → config-JY557MA6.js.map} +0 -0
  231. /package/dist/{config-V7BLK5WP.js.map → config-UU27ALAA.js.map} +0 -0
  232. /package/dist/{digitalocean-XFH2V2A3.js.map → config-WRACCRPN.js.map} +0 -0
  233. /package/dist/{discord-OQMSHM3L.js.map → digitalocean-QDHTRS2W.js.map} +0 -0
  234. /package/dist/{dropbox-IAOKM7G5.js.map → discord-ERUI7OAQ.js.map} +0 -0
  235. /package/dist/{gcs-JYZB6CVP.js.map → dropbox-3U6D4HLE.js.map} +0 -0
  236. /package/dist/{gdocs-PHKQGLZL.js.map → gcal-MTBSDG34.js.map} +0 -0
  237. /package/dist/{gdrive-4JQLGOOP.js.map → gcs-KNGRBBET.js.map} +0 -0
  238. /package/dist/{github-DU7Z4RSU.js.map → gdocs-RUIOIRKP.js.map} +0 -0
  239. /package/dist/{github_ci-XSAJDNXC.js.map → gdrive-5JB7ZKEP.js.map} +0 -0
  240. /package/dist/{gmail-DEQP2M7T.js.map → github-CIXBFBVO.js.map} +0 -0
  241. /package/dist/{gsheets-KCIHSMOK.js.map → github_ci-HR6YOYAO.js.map} +0 -0
  242. /package/dist/{gslides-2KBUKKM5.js.map → gmail-JHGWTQU5.js.map} +0 -0
  243. /package/dist/{langfuse-FNCMKFSL.js.map → gsheets-N54JO2RS.js.map} +0 -0
  244. /package/dist/{linear-XTFO4WKD.js.map → gslides-B4VMNLMB.js.map} +0 -0
  245. /package/dist/{minio-NGPBAJY3.js.map → langfuse-HEUJGDOC.js.map} +0 -0
  246. /package/dist/{mongodb-PGOX6QSY.js.map → linear-J4QQ3CA6.js.map} +0 -0
  247. /package/dist/{notion-HYYNQ7KI.js.map → minio-BXWHJ6K5.js.map} +0 -0
  248. /package/dist/{oci-EGDBSMLM.js.map → mongodb-YZP643ZU.js.map} +0 -0
  249. /package/dist/{opfs-5WGXB5OG.js.map → notion-I5S5SRLO.js.map} +0 -0
  250. /package/dist/{postgres-5HYED4AC.js.map → oci-XOPKH4AE.js.map} +0 -0
  251. /package/dist/{qingstor-2T4Y6MEG.js.map → opfs-36QO72Y5.js.map} +0 -0
  252. /package/dist/{r2-3B45S2KV.js.map → postgres-HPOMN2AR.js.map} +0 -0
  253. /package/dist/{s3-GI7SDKGR.js.map → qingstor-JKAHLK62.js.map} +0 -0
  254. /package/dist/{scaleway-ICCXVAY6.js.map → r2-L3QXQ76M.js.map} +0 -0
  255. /package/dist/{seaweedfs-MF77EC33.js.map → s3-LRZJPGHK.js.map} +0 -0
  256. /package/dist/{slack-6LGQERIU.js.map → scaleway-CGNDYNKS.js.map} +0 -0
  257. /package/dist/{supabase-XTOVMHXU.js.map → seaweedfs-BSQWCBIR.js.map} +0 -0
  258. /package/dist/{tencent-FXFKSOTN.js.map → slack-62ECSENR.js.map} +0 -0
  259. /package/dist/{trello-DZK4NEVY.js.map → supabase-J66NXWAF.js.map} +0 -0
  260. /package/dist/{wasabi-KVE2B6RB.js.map → tencent-AC667LV3.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  S3Resource
3
- } from "./chunk-RQ273N5K.js";
3
+ } from "./chunk-BGA2F226.js";
4
4
 
5
5
  // src/resource/scaleway/scaleway.ts
6
6
  import {
@@ -10,7 +10,11 @@ import {
10
10
  } from "@struktoai/mirage-core";
11
11
 
12
12
  // src/resource/scaleway/config.ts
13
- import { redactConfigWithSchema, secretSchema, z } from "@struktoai/mirage-core";
13
+ import {
14
+ redactConfigWithSchema,
15
+ secretSchema,
16
+ z
17
+ } from "@struktoai/mirage-core";
14
18
  var ScalewayConfigSchema = z.object({
15
19
  bucket: z.string(),
16
20
  presignedUrlProvider: secretSchema(
@@ -18,7 +22,8 @@ var ScalewayConfigSchema = z.object({
18
22
  ),
19
23
  region: z.string().optional(),
20
24
  endpoint: z.string().optional(),
21
- defaultContentType: z.string().optional()
25
+ defaultContentType: z.string().optional(),
26
+ keyPrefix: z.string().optional()
22
27
  });
23
28
  function resolvedScalewayEndpoint(config) {
24
29
  if (config.endpoint !== void 0 && config.endpoint !== "") return config.endpoint;
@@ -35,7 +40,8 @@ function scalewayToS3Config(config) {
35
40
  presignedUrlProvider: config.presignedUrlProvider,
36
41
  ...config.region !== void 0 ? { region: config.region } : {},
37
42
  ...endpoint !== void 0 ? { endpoint } : {},
38
- ...config.defaultContentType !== void 0 ? { defaultContentType: config.defaultContentType } : {}
43
+ ...config.defaultContentType !== void 0 ? { defaultContentType: config.defaultContentType } : {},
44
+ ...config.keyPrefix !== void 0 ? { keyPrefix: config.keyPrefix } : {}
39
45
  };
40
46
  }
41
47
  function redactScalewayConfig(config) {
@@ -86,4 +92,4 @@ export {
86
92
  SCALEWAY_BROWSER_PROMPT,
87
93
  ScalewayResource
88
94
  };
89
- //# sourceMappingURL=chunk-DVXOMWD4.js.map
95
+ //# sourceMappingURL=chunk-D4MEOKNQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/scaleway/scaleway.ts","../src/resource/scaleway/config.ts","../src/resource/scaleway/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport {\n redactScalewayConfig,\n scalewayToS3Config,\n type ScalewayConfig,\n type ScalewayConfigRedacted,\n} from './config.ts'\nimport { SCALEWAY_BROWSER_PROMPT } from './prompt.ts'\n\nexport interface ScalewayResourceState {\n type: string\n config: ScalewayConfigRedacted\n}\n\nexport class ScalewayResource extends S3Resource {\n override readonly kind: string = ResourceName.SCALEWAY\n override readonly prompt: string = SCALEWAY_BROWSER_PROMPT\n readonly scalewayConfig: ScalewayConfig\n private readonly scalewayOps: readonly RegisteredOp[]\n private readonly scalewayCommands: readonly RegisteredCommand[]\n\n constructor(config: ScalewayConfig) {\n super(scalewayToS3Config(config))\n this.scalewayConfig = config\n this.scalewayOps = remapOpsResource(super.ops(), ResourceName.SCALEWAY)\n this.scalewayCommands = remapCommandsResource(super.commands(), ResourceName.SCALEWAY)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.scalewayOps\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.scalewayCommands\n }\n\n override getState(): Promise<ScalewayResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactScalewayConfig(this.scalewayConfig),\n })\n }\n\n override loadState(_state: ScalewayResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n redactConfigWithSchema,\n type ConfigOf,\n type RedactedConfig,\n secretSchema,\n z,\n} from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\n\nconst ScalewayConfigSchema = z.object({\n bucket: z.string(),\n presignedUrlProvider: secretSchema(\n z.custom<S3BrowserPresignedUrlProvider>((value) => typeof value === 'function'),\n ),\n region: z.string().optional(),\n endpoint: z.string().optional(),\n defaultContentType: z.string().optional(),\n keyPrefix: z.string().optional(),\n})\n\nexport type ScalewayConfig = ConfigOf<typeof ScalewayConfigSchema>\n\nexport type ScalewayConfigRedacted = RedactedConfig<ScalewayConfig, 'presignedUrlProvider'>\n\nexport function resolvedScalewayEndpoint(config: ScalewayConfig): string | undefined {\n if (config.endpoint !== undefined && config.endpoint !== '') return config.endpoint\n if (config.region !== undefined && config.region !== '') {\n const region = config.region\n return `https://s3.${region}.scw.cloud`\n }\n return undefined\n}\n\nexport function scalewayToS3Config(config: ScalewayConfig): S3Config {\n const endpoint = resolvedScalewayEndpoint(config)\n return {\n bucket: config.bucket,\n presignedUrlProvider: config.presignedUrlProvider,\n ...(config.region !== undefined ? { region: config.region } : {}),\n ...(endpoint !== undefined ? { endpoint } : {}),\n ...(config.defaultContentType !== undefined\n ? { defaultContentType: config.defaultContentType }\n : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n }\n}\n\nexport function redactScalewayConfig(config: ScalewayConfig): ScalewayConfigRedacted {\n return redactConfigWithSchema(ScalewayConfigSchema, config) as unknown as ScalewayConfigRedacted\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const SCALEWAY_BROWSER_PROMPT = `{prefix}\n Remote Scaleway Object Storage bucket (S3-compatible) accessed via presigned URLs (browser runtime).\n Supports the full filesystem command set: ls/tree/cat/grep/find/du/cp/mv/rm/etc.\n Listing operations require the presigner to sign LIST/COPY operations in\n addition to GET/PUT/HEAD/DELETE — see S3BrowserPresignedUrlProvider docs.`\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACNP;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,uBAAuB,EAAE,OAAO;AAAA,EACpC,QAAQ,EAAE,OAAO;AAAA,EACjB,sBAAsB;AAAA,IACpB,EAAE,OAAsC,CAAC,UAAU,OAAO,UAAU,UAAU;AAAA,EAChF;AAAA,EACA,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,oBAAoB,EAAE,OAAO,EAAE,SAAS;AAAA,EACxC,WAAW,EAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAMM,SAAS,yBAAyB,QAA4C;AACnF,MAAI,OAAO,aAAa,UAAa,OAAO,aAAa,GAAI,QAAO,OAAO;AAC3E,MAAI,OAAO,WAAW,UAAa,OAAO,WAAW,IAAI;AACvD,UAAM,SAAS,OAAO;AACtB,WAAO,cAAc,MAAM;AAAA,EAC7B;AACA,SAAO;AACT;AAEO,SAAS,mBAAmB,QAAkC;AACnE,QAAM,WAAW,yBAAyB,MAAM;AAChD,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,sBAAsB,OAAO;AAAA,IAC7B,GAAI,OAAO,WAAW,SAAY,EAAE,QAAQ,OAAO,OAAO,IAAI,CAAC;AAAA,IAC/D,GAAI,aAAa,SAAY,EAAE,SAAS,IAAI,CAAC;AAAA,IAC7C,GAAI,OAAO,uBAAuB,SAC9B,EAAE,oBAAoB,OAAO,mBAAmB,IAChD,CAAC;AAAA,IACL,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,qBAAqB,QAAgD;AACnF,SAAO,uBAAuB,sBAAsB,MAAM;AAC5D;;;ACjDO,IAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;;;AFqBhC,IAAM,mBAAN,cAA+B,WAAW;AAAA,EAC7B,OAAe,aAAa;AAAA,EAC5B,SAAiB;AAAA,EAC1B;AAAA,EACQ;AAAA,EACA;AAAA,EAEjB,YAAY,QAAwB;AAClC,UAAM,mBAAmB,MAAM,CAAC;AAChC,SAAK,iBAAiB;AACtB,SAAK,cAAc,iBAAiB,MAAM,IAAI,GAAG,aAAa,QAAQ;AACtE,SAAK,mBAAmB,sBAAsB,MAAM,SAAS,GAAG,aAAa,QAAQ;AAAA,EACvF;AAAA,EAES,MAA+B;AACtC,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAyC;AAChD,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAA2C;AAClD,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,qBAAqB,KAAK,cAAc;AAAA,IAClD,CAAC;AAAA,EACH;AAAA,EAES,UAAU,QAA8C;AAC/D,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
@@ -0,0 +1,88 @@
1
+ import {
2
+ redactGoogleConfig
3
+ } from "./chunk-ZTHVEXIV.js";
4
+
5
+ // src/resource/gcal/gcal.ts
6
+ import { mountKey, mountPrefixOf } from "@struktoai/mirage-core";
7
+ import {
8
+ GCAL_COMMANDS,
9
+ GCAL_PROMPT,
10
+ GCAL_WRITE_PROMPT,
11
+ GCAL_OPS,
12
+ GCalAccessor,
13
+ PathSpec,
14
+ RAMIndexCacheStore,
15
+ ResourceName,
16
+ TokenManager,
17
+ gcalRead,
18
+ gcalReaddir,
19
+ makeResolveGlob,
20
+ gcalStat
21
+ } from "@struktoai/mirage-core";
22
+ var gcalResolveGlob = makeResolveGlob(gcalReaddir);
23
+ var GCalResource = class {
24
+ kind = ResourceName.GCAL;
25
+ cachesReads = true;
26
+ // Shorter than the other Google mounts: a calendar is edited by other
27
+ // people and a day-long index would keep serving a schedule that has
28
+ // already moved.
29
+ indexTtl = 300;
30
+ prompt = GCAL_PROMPT;
31
+ writePrompt = GCAL_WRITE_PROMPT;
32
+ config;
33
+ accessor;
34
+ index;
35
+ constructor(config) {
36
+ this.config = config;
37
+ const tm = new TokenManager(config);
38
+ this.accessor = new GCalAccessor({ tokenManager: tm, config });
39
+ this.index = new RAMIndexCacheStore({ ttl: 300 });
40
+ }
41
+ open() {
42
+ return Promise.resolve();
43
+ }
44
+ close() {
45
+ return Promise.resolve();
46
+ }
47
+ commands() {
48
+ return GCAL_COMMANDS;
49
+ }
50
+ ops() {
51
+ return GCAL_OPS;
52
+ }
53
+ readFile(p) {
54
+ return gcalRead(this.accessor, p, this.index);
55
+ }
56
+ readdir(p) {
57
+ return gcalReaddir(this.accessor, p, this.index);
58
+ }
59
+ stat(p) {
60
+ return gcalStat(this.accessor, p, this.index);
61
+ }
62
+ glob(paths, prefix = "") {
63
+ const effective = prefix !== "" ? paths.map(
64
+ (p) => mountPrefixOf(p.virtual, p.resourcePath) !== "" ? p : new PathSpec({
65
+ virtual: p.virtual,
66
+ directory: p.directory,
67
+ ...p.pattern !== null ? { pattern: p.pattern } : {},
68
+ resolved: p.resolved,
69
+ resourcePath: mountKey(p.virtual, prefix)
70
+ })
71
+ ) : paths;
72
+ return gcalResolveGlob(this.accessor, effective, this.index);
73
+ }
74
+ getState() {
75
+ return Promise.resolve({
76
+ type: this.kind,
77
+ config: redactGoogleConfig(this.config)
78
+ });
79
+ }
80
+ loadState(_state) {
81
+ return Promise.resolve();
82
+ }
83
+ };
84
+
85
+ export {
86
+ GCalResource
87
+ };
88
+ //# sourceMappingURL=chunk-D4RAMWYH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/gcal/gcal.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { mountKey, mountPrefixOf } from '@struktoai/mirage-core'\nimport {\n type FileStat,\n GCAL_COMMANDS,\n GCAL_PROMPT,\n GCAL_WRITE_PROMPT,\n GCAL_OPS,\n GCalAccessor,\n type IndexCacheStore,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n TokenManager,\n gcalRead,\n gcalReaddir,\n makeResolveGlob,\n gcalStat,\n} from '@struktoai/mirage-core'\nimport { redactGCalConfig, type GCalConfig, type GCalConfigRedacted } from './config.ts'\n\nconst gcalResolveGlob = makeResolveGlob(gcalReaddir)\n\nexport interface GCalResourceState {\n type: string\n config: GCalConfigRedacted\n}\n\nexport class GCalResource implements Resource {\n readonly kind: string = ResourceName.GCAL\n readonly cachesReads: boolean = true\n // Shorter than the other Google mounts: a calendar is edited by other\n // people and a day-long index would keep serving a schedule that has\n // already moved.\n readonly indexTtl: number = 300\n readonly prompt: string = GCAL_PROMPT\n readonly writePrompt: string = GCAL_WRITE_PROMPT\n readonly config: GCalConfig\n readonly accessor: GCalAccessor\n readonly index: IndexCacheStore\n\n constructor(config: GCalConfig) {\n this.config = config\n const tm = new TokenManager(config)\n this.accessor = new GCalAccessor({ tokenManager: tm, config })\n this.index = new RAMIndexCacheStore({ ttl: 300 })\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return GCAL_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return GCAL_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return gcalRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return gcalReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return gcalStat(this.accessor, p, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n mountPrefixOf(p.virtual, p.resourcePath) !== ''\n ? p\n : new PathSpec({\n virtual: p.virtual,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n resourcePath: mountKey(p.virtual, prefix),\n }),\n )\n : paths\n return gcalResolveGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<GCalResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactGCalConfig(this.config),\n })\n }\n\n loadState(_state: GCalResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA,SAAS,UAAU,qBAAqB;AACxC;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,kBAAkB,gBAAgB,WAAW;AAO5C,IAAM,eAAN,MAAuC;AAAA,EACnC,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA;AAAA;AAAA;AAAA,EAIvB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB,cAAsB;AAAA,EACtB;AAAA,EACA;AAAA,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CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA0C;AAClD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  S3Resource
3
- } from "./chunk-RQ273N5K.js";
3
+ } from "./chunk-BGA2F226.js";
4
4
 
5
5
  // src/resource/aliyun/aliyun.ts
6
6
  import {
@@ -10,7 +10,11 @@ import {
10
10
  } from "@struktoai/mirage-core";
11
11
 
12
12
  // src/resource/aliyun/config.ts
13
- import { redactConfigWithSchema, secretSchema, z } from "@struktoai/mirage-core";
13
+ import {
14
+ redactConfigWithSchema,
15
+ secretSchema,
16
+ z
17
+ } from "@struktoai/mirage-core";
14
18
  var AliyunConfigSchema = z.object({
15
19
  bucket: z.string(),
16
20
  presignedUrlProvider: secretSchema(
@@ -18,7 +22,8 @@ var AliyunConfigSchema = z.object({
18
22
  ),
19
23
  region: z.string().optional(),
20
24
  endpoint: z.string().optional(),
21
- defaultContentType: z.string().optional()
25
+ defaultContentType: z.string().optional(),
26
+ keyPrefix: z.string().optional()
22
27
  });
23
28
  function resolvedAliyunEndpoint(config) {
24
29
  if (config.endpoint !== void 0 && config.endpoint !== "") return config.endpoint;
@@ -35,7 +40,8 @@ function aliyunToS3Config(config) {
35
40
  presignedUrlProvider: config.presignedUrlProvider,
36
41
  ...config.region !== void 0 ? { region: config.region } : {},
37
42
  ...endpoint !== void 0 ? { endpoint } : {},
38
- ...config.defaultContentType !== void 0 ? { defaultContentType: config.defaultContentType } : {}
43
+ ...config.defaultContentType !== void 0 ? { defaultContentType: config.defaultContentType } : {},
44
+ ...config.keyPrefix !== void 0 ? { keyPrefix: config.keyPrefix } : {}
39
45
  };
40
46
  }
41
47
  function redactAliyunConfig(config) {
@@ -86,4 +92,4 @@ export {
86
92
  ALIYUN_BROWSER_PROMPT,
87
93
  AliyunResource
88
94
  };
89
- //# sourceMappingURL=chunk-NLBT6TBM.js.map
95
+ //# sourceMappingURL=chunk-EHIT6WCY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/aliyun/aliyun.ts","../src/resource/aliyun/config.ts","../src/resource/aliyun/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport {\n aliyunToS3Config,\n redactAliyunConfig,\n type AliyunConfig,\n type AliyunConfigRedacted,\n} from './config.ts'\nimport { ALIYUN_BROWSER_PROMPT } from './prompt.ts'\n\nexport interface AliyunResourceState {\n type: string\n config: AliyunConfigRedacted\n}\n\nexport class AliyunResource extends S3Resource {\n override readonly kind: string = ResourceName.ALIYUN\n override readonly prompt: string = ALIYUN_BROWSER_PROMPT\n readonly aliyunConfig: AliyunConfig\n private readonly aliyunOps: readonly RegisteredOp[]\n private readonly aliyunCommands: readonly RegisteredCommand[]\n\n constructor(config: AliyunConfig) {\n super(aliyunToS3Config(config))\n this.aliyunConfig = config\n this.aliyunOps = remapOpsResource(super.ops(), ResourceName.ALIYUN)\n this.aliyunCommands = remapCommandsResource(super.commands(), ResourceName.ALIYUN)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.aliyunOps\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.aliyunCommands\n }\n\n override getState(): Promise<AliyunResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactAliyunConfig(this.aliyunConfig),\n })\n }\n\n override loadState(_state: AliyunResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n redactConfigWithSchema,\n type ConfigOf,\n type RedactedConfig,\n secretSchema,\n z,\n} from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\n\nconst AliyunConfigSchema = z.object({\n bucket: z.string(),\n presignedUrlProvider: secretSchema(\n z.custom<S3BrowserPresignedUrlProvider>((value) => typeof value === 'function'),\n ),\n region: z.string().optional(),\n endpoint: z.string().optional(),\n defaultContentType: z.string().optional(),\n keyPrefix: z.string().optional(),\n})\n\nexport type AliyunConfig = ConfigOf<typeof AliyunConfigSchema>\n\nexport type AliyunConfigRedacted = RedactedConfig<AliyunConfig, 'presignedUrlProvider'>\n\nexport function resolvedAliyunEndpoint(config: AliyunConfig): string | undefined {\n if (config.endpoint !== undefined && config.endpoint !== '') return config.endpoint\n if (config.region !== undefined && config.region !== '') {\n const region = config.region\n return `https://s3.oss-${region}.aliyuncs.com`\n }\n return undefined\n}\n\nexport function aliyunToS3Config(config: AliyunConfig): S3Config {\n const endpoint = resolvedAliyunEndpoint(config)\n return {\n bucket: config.bucket,\n presignedUrlProvider: config.presignedUrlProvider,\n ...(config.region !== undefined ? { region: config.region } : {}),\n ...(endpoint !== undefined ? { endpoint } : {}),\n ...(config.defaultContentType !== undefined\n ? { defaultContentType: config.defaultContentType }\n : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n }\n}\n\nexport function redactAliyunConfig(config: AliyunConfig): AliyunConfigRedacted {\n return redactConfigWithSchema(AliyunConfigSchema, config) as unknown as AliyunConfigRedacted\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const ALIYUN_BROWSER_PROMPT = `{prefix}\n Remote Alibaba Cloud OSS bucket (S3-compatible) accessed via presigned URLs (browser runtime).\n Supports the full filesystem command set: ls/tree/cat/grep/find/du/cp/mv/rm/etc.\n Listing operations require the presigner to sign LIST/COPY operations in\n addition to GET/PUT/HEAD/DELETE — see S3BrowserPresignedUrlProvider docs.`\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACNP;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,qBAAqB,EAAE,OAAO;AAAA,EAClC,QAAQ,EAAE,OAAO;AAAA,EACjB,sBAAsB;AAAA,IACpB,EAAE,OAAsC,CAAC,UAAU,OAAO,UAAU,UAAU;AAAA,EAChF;AAAA,EACA,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,oBAAoB,EAAE,OAAO,EAAE,SAAS;AAAA,EACxC,WAAW,EAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAMM,SAAS,uBAAuB,QAA0C;AAC/E,MAAI,OAAO,aAAa,UAAa,OAAO,aAAa,GAAI,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A,EACH;AAAA,EAES,UAAU,QAA4C;AAC7D,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  S3Resource
3
- } from "./chunk-RQ273N5K.js";
3
+ } from "./chunk-BGA2F226.js";
4
4
 
5
5
  // src/resource/r2/r2.ts
6
6
  import {
@@ -10,7 +10,11 @@ import {
10
10
  } from "@struktoai/mirage-core";
11
11
 
12
12
  // src/resource/r2/config.ts
13
- import { redactConfigWithSchema, secretSchema, z } from "@struktoai/mirage-core";
13
+ import {
14
+ redactConfigWithSchema,
15
+ secretSchema,
16
+ z
17
+ } from "@struktoai/mirage-core";
14
18
  var R2ConfigSchema = z.object({
15
19
  bucket: z.string(),
16
20
  presignedUrlProvider: secretSchema(
@@ -19,7 +23,8 @@ var R2ConfigSchema = z.object({
19
23
  accountId: z.string().optional(),
20
24
  region: z.string().optional(),
21
25
  endpoint: z.string().optional(),
22
- defaultContentType: z.string().optional()
26
+ defaultContentType: z.string().optional(),
27
+ keyPrefix: z.string().optional()
23
28
  });
24
29
  function resolvedR2Endpoint(config) {
25
30
  if (config.endpoint !== void 0 && config.endpoint !== "") return config.endpoint;
@@ -35,7 +40,8 @@ function r2ToS3Config(config) {
35
40
  presignedUrlProvider: config.presignedUrlProvider,
36
41
  region: config.region ?? "auto",
37
42
  ...endpoint !== void 0 ? { endpoint } : {},
38
- ...config.defaultContentType !== void 0 ? { defaultContentType: config.defaultContentType } : {}
43
+ ...config.defaultContentType !== void 0 ? { defaultContentType: config.defaultContentType } : {},
44
+ ...config.keyPrefix !== void 0 ? { keyPrefix: config.keyPrefix } : {}
39
45
  };
40
46
  }
41
47
  function redactR2Config(config) {
@@ -86,4 +92,4 @@ export {
86
92
  R2_BROWSER_PROMPT,
87
93
  R2Resource
88
94
  };
89
- //# sourceMappingURL=chunk-CNDGXKMU.js.map
95
+ //# sourceMappingURL=chunk-EN6TZYT2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/r2/r2.ts","../src/resource/r2/config.ts","../src/resource/r2/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport { r2ToS3Config, redactR2Config, type R2Config, type R2ConfigRedacted } from './config.ts'\nimport { R2_BROWSER_PROMPT } from './prompt.ts'\n\nexport interface R2ResourceState {\n type: string\n config: R2ConfigRedacted\n}\n\nexport class R2Resource extends S3Resource {\n override readonly kind: string = ResourceName.R2\n override readonly prompt: string = R2_BROWSER_PROMPT\n readonly r2Config: R2Config\n private readonly r2Ops: readonly RegisteredOp[]\n private readonly r2Commands: readonly RegisteredCommand[]\n\n constructor(config: R2Config) {\n super(r2ToS3Config(config))\n this.r2Config = config\n this.r2Ops = remapOpsResource(super.ops(), ResourceName.R2)\n this.r2Commands = remapCommandsResource(super.commands(), ResourceName.R2)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.r2Ops\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.r2Commands\n }\n\n override getState(): Promise<R2ResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactR2Config(this.r2Config),\n })\n }\n\n override loadState(_state: R2ResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n redactConfigWithSchema,\n type ConfigOf,\n type RedactedConfig,\n secretSchema,\n z,\n} from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\n\nconst R2ConfigSchema = z.object({\n bucket: z.string(),\n presignedUrlProvider: secretSchema(\n z.custom<S3BrowserPresignedUrlProvider>((value) => typeof value === 'function'),\n ),\n accountId: z.string().optional(),\n region: z.string().optional(),\n endpoint: z.string().optional(),\n defaultContentType: z.string().optional(),\n keyPrefix: z.string().optional(),\n})\n\nexport type R2Config = ConfigOf<typeof R2ConfigSchema>\n\nexport type R2ConfigRedacted = RedactedConfig<R2Config, 'presignedUrlProvider'>\n\nexport function resolvedR2Endpoint(config: R2Config): string | undefined {\n if (config.endpoint !== undefined && config.endpoint !== '') return config.endpoint\n if (config.accountId !== undefined && config.accountId !== '') {\n return `https://${config.accountId}.r2.cloudflarestorage.com`\n }\n return undefined\n}\n\nexport function r2ToS3Config(config: R2Config): S3Config {\n const endpoint = resolvedR2Endpoint(config)\n return {\n bucket: config.bucket,\n presignedUrlProvider: config.presignedUrlProvider,\n region: config.region ?? 'auto',\n ...(endpoint !== undefined ? { endpoint } : {}),\n ...(config.defaultContentType !== undefined\n ? { defaultContentType: config.defaultContentType }\n : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n }\n}\n\nexport function redactR2Config(config: R2Config): R2ConfigRedacted {\n return redactConfigWithSchema(R2ConfigSchema, config) as unknown as R2ConfigRedacted\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const R2_BROWSER_PROMPT = `{prefix}\n Remote Cloudflare R2 bucket accessed via presigned URLs (browser runtime).\n Supports the full filesystem command set: ls/tree/cat/grep/find/du/cp/mv/rm/etc.\n Listing operations require the presigner to sign LIST/COPY operations in\n addition to GET/PUT/HEAD/DELETE — see S3BrowserPresignedUrlProvider docs.`\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACNP;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,iBAAiB,EAAE,OAAO;AAAA,EAC9B,QAAQ,EAAE,OAAO;AAAA,EACjB,sBAAsB;AAAA,IACpB,EAAE,OAAsC,CAAC,UAAU,OAAO,UAAU,UAAU;AAAA,EAChF;AAAA,EACA,WAAW,EAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,oBAAoB,EAAE,OAAO,EAAE,SAAS;AAAA,EACxC,WAAW,EAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAMM,SAAS,mBAAmB,QAAsC;AACvE,MAAI,OAAO,aAAa,UAAa,OAAO,aAAa,GAAI,QAAO,OAAO;AAC3E,MAAI,OAAO,cAAc,UAAa,OAAO,cAAc,IAAI;AAC7D,WAAO,WAAW,OAAO,SAAS;AAAA,EACpC;AACA,SAAO;AACT;AAEO,SAAS,aAAa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fs.ts
6
6
  import {
@@ -10,7 +10,11 @@ import {
10
10
  } from "@struktoai/mirage-core";
11
11
 
12
12
  // src/resource/seaweedfs/config.ts
13
- import { redactConfigWithSchema, secretSchema, z } from "@struktoai/mirage-core";
13
+ import {
14
+ redactConfigWithSchema,
15
+ secretSchema,
16
+ z
17
+ } from "@struktoai/mirage-core";
14
18
  var SeaweedFSConfigSchema = z.object({
15
19
  bucket: z.string(),
16
20
  presignedUrlProvider: secretSchema(
@@ -18,7 +22,8 @@ var SeaweedFSConfigSchema = z.object({
18
22
  ),
19
23
  endpoint: z.string().optional(),
20
24
  region: z.string().optional(),
21
- defaultContentType: z.string().optional()
25
+ defaultContentType: z.string().optional(),
26
+ keyPrefix: z.string().optional()
22
27
  });
23
28
  function seaweedfsToS3Config(config) {
24
29
  return {
@@ -26,7 +31,8 @@ function seaweedfsToS3Config(config) {
26
31
  presignedUrlProvider: config.presignedUrlProvider,
27
32
  ...config.region !== void 0 ? { region: config.region } : {},
28
33
  ...config.endpoint !== void 0 ? { endpoint: config.endpoint } : {},
29
- ...config.defaultContentType !== void 0 ? { defaultContentType: config.defaultContentType } : {}
34
+ ...config.defaultContentType !== void 0 ? { defaultContentType: config.defaultContentType } : {},
35
+ ...config.keyPrefix !== void 0 ? { keyPrefix: config.keyPrefix } : {}
30
36
  };
31
37
  }
32
38
  function redactSeaweedFSConfig(config) {
@@ -76,4 +82,4 @@ export {
76
82
  SEAWEEDFS_BROWSER_PROMPT,
77
83
  SeaweedFSResource
78
84
  };
79
- //# sourceMappingURL=chunk-QLLRQNOJ.js.map
85
+ //# sourceMappingURL=chunk-FTDVV7EQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/seaweedfs/seaweedfs.ts","../src/resource/seaweedfs/config.ts","../src/resource/seaweedfs/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport {\n redactSeaweedFSConfig,\n seaweedfsToS3Config,\n type SeaweedFSConfig,\n type SeaweedFSConfigRedacted,\n} from './config.ts'\nimport { SEAWEEDFS_BROWSER_PROMPT } from './prompt.ts'\n\nexport interface SeaweedFSResourceState {\n type: string\n config: SeaweedFSConfigRedacted\n}\n\nexport class SeaweedFSResource extends S3Resource {\n override readonly kind: string = ResourceName.SEAWEEDFS\n override readonly prompt: string = SEAWEEDFS_BROWSER_PROMPT\n readonly seaweedfsConfig: SeaweedFSConfig\n private readonly seaweedfsOps: readonly RegisteredOp[]\n private readonly seaweedfsCommands: readonly RegisteredCommand[]\n\n constructor(config: SeaweedFSConfig) {\n super(seaweedfsToS3Config(config))\n this.seaweedfsConfig = config\n this.seaweedfsOps = remapOpsResource(super.ops(), ResourceName.SEAWEEDFS)\n this.seaweedfsCommands = remapCommandsResource(super.commands(), ResourceName.SEAWEEDFS)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.seaweedfsOps\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.seaweedfsCommands\n }\n\n override getState(): Promise<SeaweedFSResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactSeaweedFSConfig(this.seaweedfsConfig),\n })\n }\n\n override loadState(_state: SeaweedFSResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n redactConfigWithSchema,\n type ConfigOf,\n type RedactedConfig,\n secretSchema,\n z,\n} from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\n\nconst SeaweedFSConfigSchema = z.object({\n bucket: z.string(),\n presignedUrlProvider: secretSchema(\n z.custom<S3BrowserPresignedUrlProvider>((value) => typeof value === 'function'),\n ),\n endpoint: z.string().optional(),\n region: z.string().optional(),\n defaultContentType: z.string().optional(),\n keyPrefix: z.string().optional(),\n})\n\nexport type SeaweedFSConfig = ConfigOf<typeof SeaweedFSConfigSchema>\n\nexport type SeaweedFSConfigRedacted = RedactedConfig<SeaweedFSConfig, 'presignedUrlProvider'>\n\nexport function seaweedfsToS3Config(config: SeaweedFSConfig): S3Config {\n return {\n bucket: config.bucket,\n presignedUrlProvider: config.presignedUrlProvider,\n ...(config.region !== undefined ? { region: config.region } : {}),\n ...(config.endpoint !== undefined ? { endpoint: config.endpoint } : {}),\n ...(config.defaultContentType !== undefined\n ? { defaultContentType: config.defaultContentType }\n : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n }\n}\n\nexport function redactSeaweedFSConfig(config: SeaweedFSConfig): SeaweedFSConfigRedacted {\n return redactConfigWithSchema(SeaweedFSConfigSchema, config) as unknown as SeaweedFSConfigRedacted\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const SEAWEEDFS_BROWSER_PROMPT = `{prefix}\n Remote SeaweedFS bucket (S3-compatible gateway) accessed via presigned URLs (browser runtime).\n Supports the full filesystem command set: ls/tree/cat/grep/find/du/cp/mv/rm/etc.\n Listing operations require the presigner to sign LIST/COPY operations in\n addition to GET/PUT/HEAD/DELETE — see S3BrowserPresignedUrlProvider docs.`\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACNP;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,wBAAwB,EAAE,OAAO;AAAA,EACrC,QAAQ,EAAE,OAAO;AAAA,EACjB,sBAAsB;AAAA,IACpB,EAAE,OAAsC,CAAC,UAAU,OAAO,UAAU,UAAU;AAAA,EAChF;AAAA,EACA,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,oBAAoB,EAAE,OAAO,EAAE,SAAS;AAAA,EACxC,WAAW,EAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAMM,SAAS,oBAAoB,QAAmC;AACrE,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,sBAAsB,OAAO;AAAA,IAC7B,GAAI,OAAO,WAAW,SAAY,EAAE,QAAQ,OAAO,OAAO,IAAI,CAAC;AAAA,IAC/D,GAAI,OAAO,aAAa,SAAY,EAAE,UAAU,OAAO,SAAS,IAAI,CAAC;AAAA,IACrE,GAAI,OAAO,uBAAuB,SAC9B,EAAE,oBAAoB,OAAO,mBAAmB,IAChD,CAAC;AAAA,IACL,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,sBAAsB,QAAkD;AACtF,SAAO,uBAAuB,uBAAuB,MAAM;AAC7D;;;ACvCO,IAAM,2BAA2B;AAAA;AAAA;AAAA;AAAA;;;AFqBjC,IAAM,oBAAN,cAAgC,WAAW;AAAA,EAC9B,OAAe,aAAa;AAAA,EAC5B,SAAiB;AAAA,EAC1B;AAAA,EACQ;AAAA,EACA;AAAA,EAEjB,YAAY,QAAyB;AACnC,UAAM,oBAAoB,MAAM,CAAC;AACjC,SAAK,kBAAkB;AACvB,SAAK,eAAe,iBAAiB,MAAM,IAAI,GAAG,aAAa,SAAS;AACxE,SAAK,oBAAoB,sBAAsB,MAAM,SAAS,GAAG,aAAa,SAAS;AAAA,EACzF;AAAA,EAES,MAA+B;AACtC,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAyC;AAChD,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAA4C;AACnD,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,sBAAsB,KAAK,eAAe;AAAA,IACpD,CAAC;AAAA,EACH;AAAA,EAES,UAAU,QAA+C;AAChE,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  S3Resource
3
- } from "./chunk-RQ273N5K.js";
3
+ } from "./chunk-BGA2F226.js";
4
4
 
5
5
  // src/resource/tencent/tencent.ts
6
6
  import {
@@ -10,7 +10,11 @@ import {
10
10
  } from "@struktoai/mirage-core";
11
11
 
12
12
  // src/resource/tencent/config.ts
13
- import { redactConfigWithSchema, secretSchema, z } from "@struktoai/mirage-core";
13
+ import {
14
+ redactConfigWithSchema,
15
+ secretSchema,
16
+ z
17
+ } from "@struktoai/mirage-core";
14
18
  var TencentConfigSchema = z.object({
15
19
  bucket: z.string(),
16
20
  presignedUrlProvider: secretSchema(
@@ -18,7 +22,8 @@ var TencentConfigSchema = z.object({
18
22
  ),
19
23
  region: z.string().optional(),
20
24
  endpoint: z.string().optional(),
21
- defaultContentType: z.string().optional()
25
+ defaultContentType: z.string().optional(),
26
+ keyPrefix: z.string().optional()
22
27
  });
23
28
  function resolvedTencentEndpoint(config) {
24
29
  if (config.endpoint !== void 0 && config.endpoint !== "") return config.endpoint;
@@ -35,7 +40,8 @@ function tencentToS3Config(config) {
35
40
  presignedUrlProvider: config.presignedUrlProvider,
36
41
  ...config.region !== void 0 ? { region: config.region } : {},
37
42
  ...endpoint !== void 0 ? { endpoint } : {},
38
- ...config.defaultContentType !== void 0 ? { defaultContentType: config.defaultContentType } : {}
43
+ ...config.defaultContentType !== void 0 ? { defaultContentType: config.defaultContentType } : {},
44
+ ...config.keyPrefix !== void 0 ? { keyPrefix: config.keyPrefix } : {}
39
45
  };
40
46
  }
41
47
  function redactTencentConfig(config) {
@@ -86,4 +92,4 @@ export {
86
92
  TENCENT_BROWSER_PROMPT,
87
93
  TencentResource
88
94
  };
89
- //# sourceMappingURL=chunk-G26SGOFR.js.map
95
+ //# sourceMappingURL=chunk-G67Q2Z6I.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/tencent/tencent.ts","../src/resource/tencent/config.ts","../src/resource/tencent/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport {\n redactTencentConfig,\n tencentToS3Config,\n type TencentConfig,\n type TencentConfigRedacted,\n} from './config.ts'\nimport { TENCENT_BROWSER_PROMPT } from './prompt.ts'\n\nexport interface TencentResourceState {\n type: string\n config: TencentConfigRedacted\n}\n\nexport class TencentResource extends S3Resource {\n override readonly kind: string = ResourceName.TENCENT\n override readonly prompt: string = TENCENT_BROWSER_PROMPT\n readonly tencentConfig: TencentConfig\n private readonly tencentOps: readonly RegisteredOp[]\n private readonly tencentCommands: readonly RegisteredCommand[]\n\n constructor(config: TencentConfig) {\n super(tencentToS3Config(config))\n this.tencentConfig = config\n this.tencentOps = remapOpsResource(super.ops(), ResourceName.TENCENT)\n this.tencentCommands = remapCommandsResource(super.commands(), ResourceName.TENCENT)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.tencentOps\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.tencentCommands\n }\n\n override getState(): Promise<TencentResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactTencentConfig(this.tencentConfig),\n })\n }\n\n override loadState(_state: TencentResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n redactConfigWithSchema,\n type ConfigOf,\n type RedactedConfig,\n secretSchema,\n z,\n} from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\n\nconst TencentConfigSchema = z.object({\n bucket: z.string(),\n presignedUrlProvider: secretSchema(\n z.custom<S3BrowserPresignedUrlProvider>((value) => typeof value === 'function'),\n ),\n region: z.string().optional(),\n endpoint: z.string().optional(),\n defaultContentType: z.string().optional(),\n keyPrefix: z.string().optional(),\n})\n\nexport type TencentConfig = ConfigOf<typeof TencentConfigSchema>\n\nexport type TencentConfigRedacted = RedactedConfig<TencentConfig, 'presignedUrlProvider'>\n\nexport function resolvedTencentEndpoint(config: TencentConfig): string | undefined {\n if (config.endpoint !== undefined && config.endpoint !== '') return config.endpoint\n if (config.region !== undefined && config.region !== '') {\n const region = config.region\n return `https://cos.${region}.myqcloud.com`\n }\n return undefined\n}\n\nexport function tencentToS3Config(config: TencentConfig): S3Config {\n const endpoint = resolvedTencentEndpoint(config)\n return {\n bucket: config.bucket,\n presignedUrlProvider: config.presignedUrlProvider,\n ...(config.region !== undefined ? { region: config.region } : {}),\n ...(endpoint !== undefined ? { endpoint } : {}),\n ...(config.defaultContentType !== undefined\n ? { defaultContentType: config.defaultContentType }\n : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n }\n}\n\nexport function redactTencentConfig(config: TencentConfig): TencentConfigRedacted {\n return redactConfigWithSchema(TencentConfigSchema, config) as unknown as TencentConfigRedacted\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const TENCENT_BROWSER_PROMPT = `{prefix}\n Remote Tencent Cloud COS bucket (S3-compatible) accessed via presigned URLs (browser runtime).\n Supports the full filesystem command set: ls/tree/cat/grep/find/du/cp/mv/rm/etc.\n Listing operations require the presigner to sign LIST/COPY operations in\n addition to GET/PUT/HEAD/DELETE — see S3BrowserPresignedUrlProvider docs.`\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACNP;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,sBAAsB,EAAE,OAAO;AAAA,EACnC,QAAQ,EAAE,OAAO;AAAA,EACjB,sBAAsB;AAAA,IACpB,EAAE,OAAsC,CAAC,UAAU,OAAO,UAAU,UAAU;AAAA,EAChF;AAAA,EACA,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,oBAAoB,EAAE,OAAO,EAAE,SAAS;AAAA,EACxC,WAAW,EAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAMM,SAAS,wBAAwB,QAA2C;AACjF,MAAI,OAAO,aAAa,UAAa,OAAO,aAAa,GAAI,QAAO,OAAO;AAC3E,MAAI,OAAO,WAAW,UAAa,OAAO,WAAW,IAAI;AACvD,UAAM,SAAS,OAAO;AACtB,WAAO,eAAe,MAAM;AAAA,EAC9B;AACA,SAAO;AACT;AAEO,SAAS,kBAAkB,QAAiC;AACjE,QAAM,WAAW,wBAAwB,MAAM;AAC/C,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,sBAAsB,OAAO;AAAA,IAC7B,GAAI,OAAO,WAAW,SAAY,EAAE,QAAQ,OAAO,OAAO,IAAI,CAAC;AAAA,IAC/D,GAAI,aAAa,SAAY,EAAE,SAAS,IAAI,CAAC;AAAA,IAC7C,GAAI,OAAO,uBAAuB,SAC9B,EAAE,oBAAoB,OAAO,mBAAmB,IAChD,CAAC;AAAA,IACL,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,oBAAoB,QAA8C;AAChF,SAAO,uBAAuB,qBAAqB,MAAM;AAC3D;;;ACjDO,IAAM,yBAAyB;AAAA;AAAA;AAAA;AAAA;;;AFqB/B,IAAM,kBAAN,cAA8B,WAAW;AAAA,EAC5B,OAAe,aAAa;AAAA,EAC5B,SAAiB;AAAA,EAC1B;AAAA,EACQ;AAAA,EACA;AAAA,EAEjB,YAAY,QAAuB;AACjC,UAAM,kBAAkB,MAAM,CAAC;AAC/B,SAAK,gBAAgB;AACrB,SAAK,aAAa,iBAAiB,MAAM,IAAI,GAAG,aAAa,OAAO;AACpE,SAAK,kBAAkB,sBAAsB,MAAM,SAAS,GAAG,aAAa,OAAO;AAAA,EACrF;AAAA,EAES,MAA+B;AACtC,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAyC;AAChD,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAA0C;AACjD,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,oBAAoB,KAAK,aAAa;AAAA,IAChD,CAAC;AAAA,EACH;AAAA,EAES,UAAU,QAA6C;AAC9D,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
@@ -1,12 +1,13 @@
1
1
  import {
2
- redactGSheetsConfig
3
- } from "./chunk-YGRKFONX.js";
2
+ redactGoogleConfig
3
+ } from "./chunk-M2UF2JHJ.js";
4
4
 
5
5
  // src/resource/gsheets/gsheets.ts
6
+ import { mountKey, mountPrefixOf } from "@struktoai/mirage-core";
6
7
  import {
7
8
  GSHEETS_COMMANDS,
8
9
  GSHEETS_PROMPT,
9
- GSHEETS_VFS_OPS,
10
+ GSHEETS_OPS,
10
11
  GSHEETS_WRITE_PROMPT,
11
12
  GSheetsAccessor,
12
13
  PathSpec,
@@ -15,9 +16,10 @@ import {
15
16
  TokenManager,
16
17
  gsheetsRead,
17
18
  gsheetsReaddir,
18
- gsheetsResolveGlob,
19
+ makeResolveGlob,
19
20
  gsheetsStat
20
21
  } from "@struktoai/mirage-core";
22
+ var gsheetsResolveGlob = makeResolveGlob(gsheetsReaddir);
21
23
  var GSheetsResource = class {
22
24
  kind = ResourceName.GSHEETS;
23
25
  cachesReads = true;
@@ -29,12 +31,7 @@ var GSheetsResource = class {
29
31
  index;
30
32
  constructor(config) {
31
33
  this.config = config;
32
- const tm = new TokenManager({
33
- clientId: config.clientId,
34
- ...config.clientSecret !== void 0 ? { clientSecret: config.clientSecret } : {},
35
- refreshToken: config.refreshToken,
36
- ...config.refreshFn !== void 0 ? { refreshFn: config.refreshFn } : {}
37
- });
34
+ const tm = new TokenManager(config);
38
35
  this.accessor = new GSheetsAccessor({ tokenManager: tm });
39
36
  this.index = new RAMIndexCacheStore({ ttl: 86400 });
40
37
  }
@@ -48,7 +45,7 @@ var GSheetsResource = class {
48
45
  return GSHEETS_COMMANDS;
49
46
  }
50
47
  ops() {
51
- return GSHEETS_VFS_OPS;
48
+ return GSHEETS_OPS;
52
49
  }
53
50
  readFile(p) {
54
51
  return gsheetsRead(this.accessor, p, this.index);
@@ -59,18 +56,14 @@ var GSheetsResource = class {
59
56
  stat(p) {
60
57
  return gsheetsStat(this.accessor, p, this.index);
61
58
  }
62
- async fingerprint(p) {
63
- const lookup = await this.index.get(p.original);
64
- return lookup.entry?.remoteTime ?? null;
65
- }
66
59
  glob(paths, prefix = "") {
67
60
  const effective = prefix !== "" ? paths.map(
68
- (p) => p.prefix !== "" ? p : new PathSpec({
69
- original: p.original,
61
+ (p) => mountPrefixOf(p.virtual, p.resourcePath) !== "" ? p : new PathSpec({
62
+ virtual: p.virtual,
70
63
  directory: p.directory,
71
64
  ...p.pattern !== null ? { pattern: p.pattern } : {},
72
65
  resolved: p.resolved,
73
- prefix
66
+ resourcePath: mountKey(p.virtual, prefix)
74
67
  })
75
68
  ) : paths;
76
69
  return gsheetsResolveGlob(this.accessor, effective, this.index);
@@ -78,7 +71,7 @@ var GSheetsResource = class {
78
71
  getState() {
79
72
  return Promise.resolve({
80
73
  type: this.kind,
81
- config: redactGSheetsConfig(this.config)
74
+ config: redactGoogleConfig(this.config)
82
75
  });
83
76
  }
84
77
  loadState(_state) {
@@ -89,4 +82,4 @@ var GSheetsResource = class {
89
82
  export {
90
83
  GSheetsResource
91
84
  };
92
- //# sourceMappingURL=chunk-XBOJZZRT.js.map
85
+ //# sourceMappingURL=chunk-GM2QMJAY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/gsheets/gsheets.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { mountKey, mountPrefixOf } from '@struktoai/mirage-core'\nimport {\n type FileStat,\n GSHEETS_COMMANDS,\n GSHEETS_PROMPT,\n GSHEETS_OPS,\n GSHEETS_WRITE_PROMPT,\n GSheetsAccessor,\n type IndexCacheStore,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n TokenManager,\n gsheetsRead,\n gsheetsReaddir,\n makeResolveGlob,\n gsheetsStat,\n} from '@struktoai/mirage-core'\nimport { redactGSheetsConfig, type GSheetsConfig, type GSheetsConfigRedacted } from './config.ts'\n\nconst gsheetsResolveGlob = makeResolveGlob(gsheetsReaddir)\n\nexport interface GSheetsResourceState {\n type: string\n config: GSheetsConfigRedacted\n}\n\nexport class GSheetsResource implements Resource {\n readonly kind: string = ResourceName.GSHEETS\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 86_400\n readonly prompt: string = GSHEETS_PROMPT\n readonly writePrompt: string = GSHEETS_WRITE_PROMPT\n readonly config: GSheetsConfig\n readonly accessor: GSheetsAccessor\n readonly index: IndexCacheStore\n\n constructor(config: GSheetsConfig) {\n this.config = config\n const tm = new TokenManager(config)\n this.accessor = new GSheetsAccessor({ tokenManager: tm })\n this.index = new RAMIndexCacheStore({ ttl: 86_400 })\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return GSHEETS_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return GSHEETS_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return gsheetsRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return gsheetsReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return gsheetsStat(this.accessor, p, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n mountPrefixOf(p.virtual, p.resourcePath) !== ''\n ? p\n : new PathSpec({\n virtual: p.virtual,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n resourcePath: mountKey(p.virtual, prefix),\n }),\n )\n : paths\n return gsheetsResolveGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<GSheetsResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactGSheetsConfig(this.config),\n })\n }\n\n loadState(_state: GSheetsResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA,SAAS,UAAU,qBAAqB;AACxC;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,qBAAqB,gBAAgB,cAAc;AAOlD,IAAM,kBAAN,MAA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AChE;AAAA,EAEA,WAA0C;AACxC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,mBAAoB,KAAK,MAAM;AAAA,IACzC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA6C;AACrD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
@@ -1,12 +1,13 @@
1
1
  import {
2
- redactGDriveConfig
3
- } from "./chunk-NMZBJOFW.js";
2
+ redactGoogleConfig
3
+ } from "./chunk-IZMKMD3O.js";
4
4
 
5
5
  // src/resource/gdrive/gdrive.ts
6
+ import { mountKey, mountPrefixOf } from "@struktoai/mirage-core";
6
7
  import {
7
8
  GDRIVE_COMMANDS,
8
9
  GDRIVE_PROMPT,
9
- GDRIVE_VFS_OPS,
10
+ GDRIVE_OPS,
10
11
  GDriveAccessor,
11
12
  PathSpec,
12
13
  RAMIndexCacheStore,
@@ -14,12 +15,14 @@ import {
14
15
  TokenManager,
15
16
  gdriveRead,
16
17
  gdriveReaddir,
17
- gdriveResolveGlob,
18
+ makeResolveGlob,
18
19
  gdriveStat
19
20
  } from "@struktoai/mirage-core";
21
+ var gdriveResolveGlob = makeResolveGlob(gdriveReaddir);
20
22
  var GDriveResource = class {
21
23
  kind = ResourceName.GDRIVE;
22
24
  cachesReads = true;
25
+ supportsSnapshot = true;
23
26
  indexTtl = 86400;
24
27
  prompt = GDRIVE_PROMPT;
25
28
  config;
@@ -27,12 +30,7 @@ var GDriveResource = class {
27
30
  index;
28
31
  constructor(config) {
29
32
  this.config = config;
30
- const tm = new TokenManager({
31
- clientId: config.clientId,
32
- ...config.clientSecret !== void 0 ? { clientSecret: config.clientSecret } : {},
33
- refreshToken: config.refreshToken,
34
- ...config.refreshFn !== void 0 ? { refreshFn: config.refreshFn } : {}
35
- });
33
+ const tm = new TokenManager(config);
36
34
  this.accessor = new GDriveAccessor({ tokenManager: tm });
37
35
  this.index = new RAMIndexCacheStore({ ttl: 86400 });
38
36
  }
@@ -46,7 +44,7 @@ var GDriveResource = class {
46
44
  return GDRIVE_COMMANDS;
47
45
  }
48
46
  ops() {
49
- return GDRIVE_VFS_OPS;
47
+ return GDRIVE_OPS;
50
48
  }
51
49
  readFile(p) {
52
50
  return gdriveRead(this.accessor, p, this.index);
@@ -57,18 +55,14 @@ var GDriveResource = class {
57
55
  stat(p) {
58
56
  return gdriveStat(this.accessor, p, this.index);
59
57
  }
60
- async fingerprint(p) {
61
- const lookup = await this.index.get(p.original);
62
- return lookup.entry?.remoteTime ?? null;
63
- }
64
58
  glob(paths, prefix = "") {
65
59
  const effective = prefix !== "" ? paths.map(
66
- (p) => p.prefix !== "" ? p : new PathSpec({
67
- original: p.original,
60
+ (p) => mountPrefixOf(p.virtual, p.resourcePath) !== "" ? p : new PathSpec({
61
+ virtual: p.virtual,
68
62
  directory: p.directory,
69
63
  ...p.pattern !== null ? { pattern: p.pattern } : {},
70
64
  resolved: p.resolved,
71
- prefix
65
+ resourcePath: mountKey(p.virtual, prefix)
72
66
  })
73
67
  ) : paths;
74
68
  return gdriveResolveGlob(this.accessor, effective, this.index);
@@ -76,7 +70,7 @@ var GDriveResource = class {
76
70
  getState() {
77
71
  return Promise.resolve({
78
72
  type: this.kind,
79
- config: redactGDriveConfig(this.config)
73
+ config: redactGoogleConfig(this.config)
80
74
  });
81
75
  }
82
76
  loadState(_state) {
@@ -87,4 +81,4 @@ var GDriveResource = class {
87
81
  export {
88
82
  GDriveResource
89
83
  };
90
- //# sourceMappingURL=chunk-XYKNXGPR.js.map
84
+ //# sourceMappingURL=chunk-HRWLHJX2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/gdrive/gdrive.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { mountKey, mountPrefixOf } from '@struktoai/mirage-core'\nimport {\n type FileStat,\n GDRIVE_COMMANDS,\n GDRIVE_PROMPT,\n GDRIVE_OPS,\n GDriveAccessor,\n type IndexCacheStore,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n TokenManager,\n gdriveRead,\n gdriveReaddir,\n makeResolveGlob,\n gdriveStat,\n} from '@struktoai/mirage-core'\nimport { redactGDriveConfig, type GDriveConfig, type GDriveConfigRedacted } from './config.ts'\n\nconst gdriveResolveGlob = makeResolveGlob(gdriveReaddir)\n\nexport interface GDriveResourceState {\n type: string\n config: GDriveConfigRedacted\n}\n\nexport class GDriveResource implements Resource {\n readonly kind: string = ResourceName.GDRIVE\n readonly cachesReads: boolean = true\n readonly supportsSnapshot: boolean = true\n readonly indexTtl: number = 86_400\n readonly prompt: string = GDRIVE_PROMPT\n readonly config: GDriveConfig\n readonly accessor: GDriveAccessor\n readonly index: IndexCacheStore\n\n constructor(config: GDriveConfig) {\n this.config = config\n const tm = new TokenManager(config)\n this.accessor = new GDriveAccessor({ tokenManager: tm })\n this.index = new RAMIndexCacheStore({ ttl: 86_400 })\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return GDRIVE_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return GDRIVE_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return gdriveRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return gdriveReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return gdriveStat(this.accessor, p, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n mountPrefixOf(p.virtual, p.resourcePath) !== ''\n ? p\n : new PathSpec({\n virtual: p.virtual,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n resourcePath: mountKey(p.virtual, prefix),\n }),\n )\n : paths\n return gdriveResolveGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<GDriveResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactGDriveConfig(this.config),\n })\n }\n\n loadState(_state: GDriveResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA,SAAS,UAAU,qBAAqB;AACxC;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,oBAAoB,gBAAgB,aAAa;AAOhD,IAAM,iBAAN,MAAyC;AAAA,EACrC,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,mBAA4B;AAAA,EAC5B,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,QAAsB;AAChC,SAAK,SAAS;AACd,UAAM,KAAK,IAAI,aAAa,MAAM;AAClC,SAAK,WAAW,IAAI,eAAe,EAAE,cAAc,GAAG,CAAC;AACvD,SAAK,QAAQ,IAAI,mBAAmB,EAAE,KAAK,MAAO,CAAC;AAAA,EACrD;AAAA,EAEA,OAAsB;AACpB,WAAO,QAAQ,QAAQ;AAAA,EACzB;AAAA,EAEA,QAAuB;AACrB,WAAO,QAAQ,QAAQ;AAAA,EACzB;AAAA,EAEA,WAAyC;AACvC,WAAO;AAAA,EACT;AAAA,EAEA,MAA+B;AAC7B,WAAO;AAA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