@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.
- package/README.md +1 -1
- package/dist/{aliyun-TMZRUYCG.js → aliyun-JMJ3PFYY.js} +3 -3
- package/dist/{backblaze-OHW57DLK.js → backblaze-TDFD23QO.js} +3 -3
- package/dist/{box-UXTCAFOZ.js → box-GQ2U2R6R.js} +2 -2
- package/dist/{ceph-TNN4I2FT.js → ceph-S2VOYO6G.js} +3 -3
- package/dist/{chunk-FXFDBF3P.js → chunk-3WIO7NBR.js} +2 -2
- package/dist/{chunk-O7ODGJYL.js → chunk-47AVIIOT.js} +2 -2
- package/dist/{chunk-Q6CDMOM6.js → chunk-7CW3BMPH.js} +2 -2
- package/dist/{chunk-E7RW3SBV.js → chunk-A7IVFIOP.js} +2 -2
- package/dist/chunk-A7IVFIOP.js.map +1 -0
- package/dist/{chunk-3T3RMDNX.js → chunk-AUHSTJJ3.js} +2 -2
- package/dist/{chunk-PJBQKMCD.js → chunk-DM4GSE26.js} +2 -2
- package/dist/{chunk-5DLOHQJ2.js → chunk-EM4J5EQS.js} +2 -2
- package/dist/chunk-EM4J5EQS.js.map +1 -0
- package/dist/{chunk-ABTEGAFB.js → chunk-EZQ5HBAC.js} +2 -2
- package/dist/chunk-EZQ5HBAC.js.map +1 -0
- package/dist/{chunk-KTNDT45N.js → chunk-FQ33BYFR.js} +2 -2
- package/dist/{chunk-YAVGCQUP.js → chunk-G2WCEUQL.js} +2 -2
- package/dist/chunk-G2WCEUQL.js.map +1 -0
- package/dist/{chunk-RLGWMJD3.js → chunk-GCFYZSVR.js} +133 -3
- package/dist/chunk-GCFYZSVR.js.map +1 -0
- package/dist/{chunk-NHS7WLEQ.js → chunk-GS5AUKUO.js} +2 -2
- package/dist/chunk-GS5AUKUO.js.map +1 -0
- package/dist/{chunk-BYTU2YC3.js → chunk-HGCRXJGP.js} +2 -2
- package/dist/{chunk-G5BZE7UA.js → chunk-HJJMP6IX.js} +2 -2
- package/dist/{chunk-IQVNVTOP.js → chunk-I5THIMPP.js} +2 -2
- package/dist/chunk-IDYHQQOH.js +1095 -0
- package/dist/chunk-IDYHQQOH.js.map +1 -0
- package/dist/{chunk-C6NHFMIP.js → chunk-IK2L4EN3.js} +2 -2
- package/dist/{chunk-LYDMMNL2.js → chunk-JAGJTM3Q.js} +2 -2
- package/dist/chunk-JAGJTM3Q.js.map +1 -0
- package/dist/{chunk-A7X4L4JM.js → chunk-JCC4CU2I.js} +2 -2
- package/dist/chunk-JCC4CU2I.js.map +1 -0
- package/dist/{chunk-AJICZLHT.js → chunk-KPULTUOK.js} +2 -2
- package/dist/{chunk-YPT4JBUY.js → chunk-LV2G7VHL.js} +2 -2
- package/dist/chunk-LV2G7VHL.js.map +1 -0
- package/dist/{chunk-C6NHEDHY.js → chunk-M5FVUIYP.js} +2 -2
- package/dist/chunk-M5FVUIYP.js.map +1 -0
- package/dist/{chunk-HEHERHQ5.js → chunk-MPCCRRE6.js} +2 -2
- package/dist/chunk-MPCCRRE6.js.map +1 -0
- package/dist/{chunk-RQYEEA2O.js → chunk-N5FSLVKO.js} +2 -2
- package/dist/{chunk-CASCUFK2.js → chunk-NOHWIBRX.js} +2 -2
- package/dist/chunk-NOHWIBRX.js.map +1 -0
- package/dist/{chunk-TRTUHCS4.js → chunk-QCZ2XUKH.js} +2 -2
- package/dist/chunk-QCZ2XUKH.js.map +1 -0
- package/dist/{chunk-3IJSIVKT.js → chunk-QQBJC2FQ.js} +2 -2
- package/dist/{chunk-JZQHKDSY.js → chunk-RNQN2FOU.js} +2 -2
- package/dist/chunk-RNQN2FOU.js.map +1 -0
- package/dist/{chunk-DTAY7LPC.js → chunk-S5OVP467.js} +2 -2
- package/dist/chunk-S5OVP467.js.map +1 -0
- package/dist/{chunk-5YOCVEUB.js → chunk-SWCDFEUK.js} +2 -2
- package/dist/chunk-SWCDFEUK.js.map +1 -0
- package/dist/{chunk-MHCMHKM6.js → chunk-TA3WMOMU.js} +2 -2
- package/dist/chunk-TA3WMOMU.js.map +1 -0
- package/dist/{chunk-WSGEIVY3.js → chunk-TURD42QO.js} +101 -85
- package/dist/chunk-TURD42QO.js.map +1 -0
- package/dist/{chunk-WL7HS7EM.js → chunk-UINQOUZR.js} +2 -2
- package/dist/{chunk-A4Z6DZ22.js → chunk-VWKUT4CW.js} +2 -2
- package/dist/chunk-VWKUT4CW.js.map +1 -0
- package/dist/{chunk-ERELJ7BS.js → chunk-WAR4Q2NM.js} +2 -2
- package/dist/chunk-WAR4Q2NM.js.map +1 -0
- package/dist/{chunk-5HCVKTP3.js → chunk-WHFUWWI6.js} +92 -81
- package/dist/chunk-WHFUWWI6.js.map +1 -0
- package/dist/{chunk-HQ4KWN76.js → chunk-X3G37FXT.js} +2 -2
- package/dist/{chunk-OYV2DN66.js → chunk-X5HF2OFP.js} +2 -2
- package/dist/chunk-XWVDS66D.js +963 -0
- package/dist/chunk-XWVDS66D.js.map +1 -0
- package/dist/{chunk-L6JPBJAS.js → chunk-YAHRT6MB.js} +2 -2
- package/dist/{chunk-XRU5WXZX.js → chunk-ZEGAMJO2.js} +2 -2
- package/dist/chunk-ZEGAMJO2.js.map +1 -0
- package/dist/{chunk-B6SXRCBO.js → chunk-ZGSER5TG.js} +2 -2
- package/dist/databricks_volume-7XOUYSTY.js +7 -0
- package/dist/{digitalocean-6SPR4S7V.js → digitalocean-3CQ4CPPZ.js} +3 -3
- package/dist/{discord-SAV2RBJV.js → discord-BG7OSRJG.js} +2 -2
- package/dist/{disk-POACMF4G.js → disk-XVLBCVKE.js} +2 -2
- package/dist/{dropbox-CQ7MTYX2.js → dropbox-74GYLV3R.js} +2 -2
- package/dist/{email-KBQ7CXS7.js → email-5IZ7OBQ4.js} +2 -2
- package/dist/{gcs-SMIE4VMT.js → gcs-EMEYU2XT.js} +3 -3
- package/dist/{gdocs-X5Y2SIQX.js → gdocs-R67TDPON.js} +2 -2
- package/dist/{gdrive-SIQPRIGI.js → gdrive-PRN2ALRK.js} +2 -2
- package/dist/{github-KBHWANKQ.js → github-DV7E6OFV.js} +2 -2
- package/dist/{github_ci-HPITNK37.js → github_ci-Q554V5PA.js} +2 -2
- package/dist/{gmail-DKHAGJNX.js → gmail-OLN2LT4O.js} +2 -2
- package/dist/{gsheets-ZSUDIWGK.js → gsheets-H4RYMQJ5.js} +2 -2
- package/dist/{gslides-GYXM7IMJ.js → gslides-YLCHKJOM.js} +2 -2
- package/dist/{hf_buckets-RIOMV7WG.js → hf_buckets-DTKXKKFF.js} +3 -3
- package/dist/{hf_datasets-QF4BQ3OK.js → hf_datasets-55C4APKR.js} +3 -3
- package/dist/{hf_models-62GC2HPZ.js → hf_models-RO5JR36V.js} +3 -3
- package/dist/{hf_spaces-NVSMUNRM.js → hf_spaces-ZVZ3EDRX.js} +3 -3
- package/dist/index.d.ts +110 -44
- package/dist/index.js +520 -232
- package/dist/index.js.map +1 -1
- package/dist/{langfuse-HUAYVPHF.js → langfuse-ACASJZ7O.js} +2 -2
- package/dist/{linear-2MM55KBC.js → linear-IC37LZV7.js} +2 -2
- package/dist/{minio-L3XE6PQS.js → minio-HZ576XFQ.js} +3 -3
- package/dist/mongodb-JVR62OIO.js +7 -0
- package/dist/{notion-UK4GTMT4.js → notion-HKRPQMJS.js} +2 -2
- package/dist/{oci-NURLWPL2.js → oci-ZLVECXTW.js} +3 -3
- package/dist/postgres-P36Z2YN4.js +7 -0
- package/dist/{qingstor-W55D5YFO.js → qingstor-YLP6K3L4.js} +3 -3
- package/dist/{r2-FSZK7IFI.js → r2-RPK25ANI.js} +3 -3
- package/dist/{redis-S6GIPA4Z.js → redis-V5ULXULL.js} +2 -2
- package/dist/{s3-GMPUJ65D.js → s3-4OIOCAAT.js} +2 -2
- package/dist/{scaleway-5VM55Y6D.js → scaleway-CCWCLUHB.js} +3 -3
- package/dist/{seaweedfs-J3EPUEPE.js → seaweedfs-QSWKF2FN.js} +3 -3
- package/dist/{slack-FVBXY7KD.js → slack-YPS7PII3.js} +2 -2
- package/dist/{ssh-GCXETJ3Z.js → ssh-YFP3SMTJ.js} +2 -2
- package/dist/{supabase-HLWNHBBE.js → supabase-6CFTOKGZ.js} +3 -3
- package/dist/{tencent-YDO73XBD.js → tencent-IWZZOSQ4.js} +3 -3
- package/dist/{trello-CQ53BQUL.js → trello-XYKWZD6P.js} +2 -2
- package/dist/{wasabi-SOZKPMRQ.js → wasabi-6Z4DC5S5.js} +3 -3
- package/package.json +7 -5
- package/dist/chunk-5DLOHQJ2.js.map +0 -1
- package/dist/chunk-5HCVKTP3.js.map +0 -1
- package/dist/chunk-5YOCVEUB.js.map +0 -1
- package/dist/chunk-A4Z6DZ22.js.map +0 -1
- package/dist/chunk-A7X4L4JM.js.map +0 -1
- package/dist/chunk-ABTEGAFB.js.map +0 -1
- package/dist/chunk-C6NHEDHY.js.map +0 -1
- package/dist/chunk-CASCUFK2.js.map +0 -1
- package/dist/chunk-DTAY7LPC.js.map +0 -1
- package/dist/chunk-E7RW3SBV.js.map +0 -1
- package/dist/chunk-ERELJ7BS.js.map +0 -1
- package/dist/chunk-HEHERHQ5.js.map +0 -1
- package/dist/chunk-JZQHKDSY.js.map +0 -1
- package/dist/chunk-LYDMMNL2.js.map +0 -1
- package/dist/chunk-MHCMHKM6.js.map +0 -1
- package/dist/chunk-N72CAZEH.js +0 -1990
- package/dist/chunk-N72CAZEH.js.map +0 -1
- package/dist/chunk-NHS7WLEQ.js.map +0 -1
- package/dist/chunk-PBBG7VFT.js +0 -1896
- package/dist/chunk-PBBG7VFT.js.map +0 -1
- package/dist/chunk-RLGWMJD3.js.map +0 -1
- package/dist/chunk-TRTUHCS4.js.map +0 -1
- package/dist/chunk-WSGEIVY3.js.map +0 -1
- package/dist/chunk-XRU5WXZX.js.map +0 -1
- package/dist/chunk-YAVGCQUP.js.map +0 -1
- package/dist/chunk-YPT4JBUY.js.map +0 -1
- package/dist/databricks_volume-HNQ4DJVJ.js +0 -7
- package/dist/mongodb-ZOX4FRHJ.js +0 -7
- package/dist/postgres-JNFMPAO2.js +0 -7
- /package/dist/{aliyun-TMZRUYCG.js.map → aliyun-JMJ3PFYY.js.map} +0 -0
- /package/dist/{backblaze-OHW57DLK.js.map → backblaze-TDFD23QO.js.map} +0 -0
- /package/dist/{box-UXTCAFOZ.js.map → box-GQ2U2R6R.js.map} +0 -0
- /package/dist/{ceph-TNN4I2FT.js.map → ceph-S2VOYO6G.js.map} +0 -0
- /package/dist/{chunk-FXFDBF3P.js.map → chunk-3WIO7NBR.js.map} +0 -0
- /package/dist/{chunk-O7ODGJYL.js.map → chunk-47AVIIOT.js.map} +0 -0
- /package/dist/{chunk-Q6CDMOM6.js.map → chunk-7CW3BMPH.js.map} +0 -0
- /package/dist/{chunk-3T3RMDNX.js.map → chunk-AUHSTJJ3.js.map} +0 -0
- /package/dist/{chunk-PJBQKMCD.js.map → chunk-DM4GSE26.js.map} +0 -0
- /package/dist/{chunk-KTNDT45N.js.map → chunk-FQ33BYFR.js.map} +0 -0
- /package/dist/{chunk-BYTU2YC3.js.map → chunk-HGCRXJGP.js.map} +0 -0
- /package/dist/{chunk-G5BZE7UA.js.map → chunk-HJJMP6IX.js.map} +0 -0
- /package/dist/{chunk-IQVNVTOP.js.map → chunk-I5THIMPP.js.map} +0 -0
- /package/dist/{chunk-C6NHFMIP.js.map → chunk-IK2L4EN3.js.map} +0 -0
- /package/dist/{chunk-AJICZLHT.js.map → chunk-KPULTUOK.js.map} +0 -0
- /package/dist/{chunk-RQYEEA2O.js.map → chunk-N5FSLVKO.js.map} +0 -0
- /package/dist/{chunk-3IJSIVKT.js.map → chunk-QQBJC2FQ.js.map} +0 -0
- /package/dist/{chunk-WL7HS7EM.js.map → chunk-UINQOUZR.js.map} +0 -0
- /package/dist/{chunk-HQ4KWN76.js.map → chunk-X3G37FXT.js.map} +0 -0
- /package/dist/{chunk-OYV2DN66.js.map → chunk-X5HF2OFP.js.map} +0 -0
- /package/dist/{chunk-L6JPBJAS.js.map → chunk-YAHRT6MB.js.map} +0 -0
- /package/dist/{chunk-B6SXRCBO.js.map → chunk-ZGSER5TG.js.map} +0 -0
- /package/dist/{databricks_volume-HNQ4DJVJ.js.map → databricks_volume-7XOUYSTY.js.map} +0 -0
- /package/dist/{digitalocean-6SPR4S7V.js.map → digitalocean-3CQ4CPPZ.js.map} +0 -0
- /package/dist/{discord-SAV2RBJV.js.map → discord-BG7OSRJG.js.map} +0 -0
- /package/dist/{disk-POACMF4G.js.map → disk-XVLBCVKE.js.map} +0 -0
- /package/dist/{dropbox-CQ7MTYX2.js.map → dropbox-74GYLV3R.js.map} +0 -0
- /package/dist/{email-KBQ7CXS7.js.map → email-5IZ7OBQ4.js.map} +0 -0
- /package/dist/{gcs-SMIE4VMT.js.map → gcs-EMEYU2XT.js.map} +0 -0
- /package/dist/{gdocs-X5Y2SIQX.js.map → gdocs-R67TDPON.js.map} +0 -0
- /package/dist/{gdrive-SIQPRIGI.js.map → gdrive-PRN2ALRK.js.map} +0 -0
- /package/dist/{github-KBHWANKQ.js.map → github-DV7E6OFV.js.map} +0 -0
- /package/dist/{github_ci-HPITNK37.js.map → github_ci-Q554V5PA.js.map} +0 -0
- /package/dist/{gmail-DKHAGJNX.js.map → gmail-OLN2LT4O.js.map} +0 -0
- /package/dist/{gsheets-ZSUDIWGK.js.map → gsheets-H4RYMQJ5.js.map} +0 -0
- /package/dist/{gslides-GYXM7IMJ.js.map → gslides-YLCHKJOM.js.map} +0 -0
- /package/dist/{hf_buckets-RIOMV7WG.js.map → hf_buckets-DTKXKKFF.js.map} +0 -0
- /package/dist/{hf_datasets-QF4BQ3OK.js.map → hf_datasets-55C4APKR.js.map} +0 -0
- /package/dist/{hf_models-62GC2HPZ.js.map → hf_models-RO5JR36V.js.map} +0 -0
- /package/dist/{hf_spaces-NVSMUNRM.js.map → hf_spaces-ZVZ3EDRX.js.map} +0 -0
- /package/dist/{langfuse-HUAYVPHF.js.map → langfuse-ACASJZ7O.js.map} +0 -0
- /package/dist/{linear-2MM55KBC.js.map → linear-IC37LZV7.js.map} +0 -0
- /package/dist/{minio-L3XE6PQS.js.map → minio-HZ576XFQ.js.map} +0 -0
- /package/dist/{mongodb-ZOX4FRHJ.js.map → mongodb-JVR62OIO.js.map} +0 -0
- /package/dist/{notion-UK4GTMT4.js.map → notion-HKRPQMJS.js.map} +0 -0
- /package/dist/{oci-NURLWPL2.js.map → oci-ZLVECXTW.js.map} +0 -0
- /package/dist/{postgres-JNFMPAO2.js.map → postgres-P36Z2YN4.js.map} +0 -0
- /package/dist/{qingstor-W55D5YFO.js.map → qingstor-YLP6K3L4.js.map} +0 -0
- /package/dist/{r2-FSZK7IFI.js.map → r2-RPK25ANI.js.map} +0 -0
- /package/dist/{redis-S6GIPA4Z.js.map → redis-V5ULXULL.js.map} +0 -0
- /package/dist/{s3-GMPUJ65D.js.map → s3-4OIOCAAT.js.map} +0 -0
- /package/dist/{scaleway-5VM55Y6D.js.map → scaleway-CCWCLUHB.js.map} +0 -0
- /package/dist/{seaweedfs-J3EPUEPE.js.map → seaweedfs-QSWKF2FN.js.map} +0 -0
- /package/dist/{slack-FVBXY7KD.js.map → slack-YPS7PII3.js.map} +0 -0
- /package/dist/{ssh-GCXETJ3Z.js.map → ssh-YFP3SMTJ.js.map} +0 -0
- /package/dist/{supabase-HLWNHBBE.js.map → supabase-6CFTOKGZ.js.map} +0 -0
- /package/dist/{tencent-YDO73XBD.js.map → tencent-IWZZOSQ4.js.map} +0 -0
- /package/dist/{trello-CQ53BQUL.js.map → trello-XYKWZD6P.js.map} +0 -0
- /package/dist/{wasabi-SOZKPMRQ.js.map → wasabi-6Z4DC5S5.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/redis/redis.ts","../src/commands/builtin/redis/index.ts","../src/core/redis/read.ts","../src/core/redis/utils.ts","../src/core/redis/stat.ts","../src/core/redis/constants.ts","../src/core/redis/copy.ts","../src/core/redis/du.ts","../src/core/redis/exists.ts","../src/core/redis/find.ts","../src/core/redis/mkdir.ts","../src/core/redis/readdir.ts","../src/core/redis/entry.ts","../src/core/redis/rename.ts","../src/core/redis/rm.ts","../src/core/redis/rmdir.ts","../src/core/redis/stream.ts","../src/core/redis/unlink.ts","../src/core/redis/write.ts","../src/commands/builtin/redis/ops.ts","../src/commands/builtin/redis/sed.ts","../src/accessor/redis.ts","../src/core/redis/append.ts","../src/core/redis/create.ts","../src/core/redis/glob.ts","../src/core/redis/truncate.ts","../src/ops/redis/append.ts","../src/ops/redis/create.ts","../src/ops/redis/mkdir.ts","../src/ops/redis/read.ts","../src/ops/redis/read_feather.ts","../src/ops/redis/read_hdf5.ts","../src/ops/redis/read_parquet.ts","../src/ops/redis/readdir.ts","../src/ops/redis/rename.ts","../src/ops/redis/rmdir.ts","../src/ops/redis/stat.ts","../src/ops/redis/truncate.ts","../src/ops/redis/unlink.ts","../src/ops/redis/write.ts","../src/ops/redis/index.ts","../src/resource/redis/prompt.ts","../src/resource/redis/store.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 BaseResource,\n type FileStat,\n type FindOptions,\n PathSpec,\n type RegisteredCommand,\n type RegisteredOp,\n REDACTED_SECRET,\n type Resource,\n ResourceName,\n} from '@struktoai/mirage-core'\nimport { REDIS_COMMANDS } from '../../commands/builtin/redis/index.ts'\nimport type { RedisClientType } from 'redis'\nimport { RedisAccessor } from '../../accessor/redis.ts'\nimport { appendBytes } from '../../core/redis/append.ts'\nimport { copy as copyCore } from '../../core/redis/copy.ts'\nimport { create as createCore } from '../../core/redis/create.ts'\nimport { du as duCore, duAll as duAllCore } from '../../core/redis/du.ts'\nimport { exists as existsCore } from '../../core/redis/exists.ts'\nimport { find as findCore, type FindOptions as RedisFindOptions } from '../../core/redis/find.ts'\nimport { resolveGlob as globCore } from '../../core/redis/glob.ts'\nimport { mkdir as mkdirCore } from '../../core/redis/mkdir.ts'\nimport { read as readCore } from '../../core/redis/read.ts'\nimport { readdir as readdirCore } from '../../core/redis/readdir.ts'\nimport { rename as renameCore } from '../../core/redis/rename.ts'\nimport { rmR as rmRCore } from '../../core/redis/rm.ts'\nimport { rmdir as rmdirCore } from '../../core/redis/rmdir.ts'\nimport { stat as statCore } from '../../core/redis/stat.ts'\nimport { stream as streamCore } from '../../core/redis/stream.ts'\nimport { truncate as truncateCore } from '../../core/redis/truncate.ts'\nimport { unlink as unlinkCore } from '../../core/redis/unlink.ts'\nimport { writeBytes as writeCore } from '../../core/redis/write.ts'\nimport { REDIS_OPS } from '../../ops/redis/index.ts'\nimport { REDIS_PROMPT } from './prompt.ts'\nimport { RedisStore } from './store.ts'\n\nexport interface RedisResourceOptions {\n url?: string\n keyPrefix?: string\n}\n\nexport interface RedisModule {\n createClient: (options: { url: string }) => RedisClientType\n RESP_TYPES: { readonly BLOB_STRING: number }\n}\n\nexport interface RedisResourceState {\n type: string\n config: {\n url: typeof REDACTED_SECRET\n keyPrefix: string\n }\n keyPrefix: string\n files: Record<string, Uint8Array>\n dirs: string[]\n}\n\nexport class RedisResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.REDIS\n readonly cachesReads: boolean = false\n readonly indexTtl: number = 0\n readonly prompt: string = REDIS_PROMPT\n readonly url: string\n readonly keyPrefix: string\n readonly store: RedisStore\n readonly accessor: RedisAccessor\n\n readonly opsMap: Record<string, unknown> = {\n read_bytes: readCore,\n write: writeCore,\n readdir: readdirCore,\n stat: statCore,\n unlink: unlinkCore,\n rmdir: rmdirCore,\n copy: copyCore,\n rename: renameCore,\n mkdir: mkdirCore,\n read_stream: streamCore,\n rm_recursive: rmRCore,\n du_total: duCore,\n du_all: duAllCore,\n create: createCore,\n truncate: truncateCore,\n exists: existsCore,\n find_flat: findCore,\n append: appendBytes,\n }\n\n constructor(options: RedisResourceOptions = {}) {\n super()\n this.url = options.url ?? 'redis://localhost:6379/0'\n this.keyPrefix = options.keyPrefix ?? 'mirage:fs:'\n this.store = new RedisStore({ url: this.url, keyPrefix: this.keyPrefix })\n this.accessor = new RedisAccessor(this.store)\n }\n\n async open(): Promise<void> {\n await this.store.client()\n }\n\n close(): Promise<void> {\n return this.store.close()\n }\n\n client(): Promise<RedisClientType> {\n return this.store.client()\n }\n\n protected module(): Promise<RedisModule> {\n return import('redis') as unknown as Promise<RedisModule>\n }\n\n ops(): readonly RegisteredOp[] {\n return REDIS_OPS\n }\n\n commands(): readonly RegisteredCommand[] {\n return REDIS_COMMANDS\n }\n\n streamPath(p: PathSpec): AsyncIterable<Uint8Array> {\n return streamCore(this.accessor, p)\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return readCore(this.accessor, p)\n }\n\n writeFile(p: PathSpec, data: Uint8Array): Promise<void> {\n return writeCore(this.accessor, p, data)\n }\n\n appendFile(p: PathSpec, data: Uint8Array): Promise<void> {\n return appendBytes(this.accessor, p, data)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return readdirCore(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return statCore(this.accessor, p)\n }\n\n exists(p: PathSpec): Promise<boolean> {\n return existsCore(this.accessor, p)\n }\n\n mkdir(p: PathSpec, options?: { recursive?: boolean }): Promise<void> {\n return mkdirCore(this.accessor, p, options?.recursive === true)\n }\n\n rmdir(p: PathSpec): Promise<void> {\n return rmdirCore(this.accessor, p)\n }\n\n unlink(p: PathSpec): Promise<void> {\n return unlinkCore(this.accessor, p)\n }\n\n rename(src: PathSpec, dst: PathSpec): Promise<void> {\n return renameCore(this.accessor, src, dst)\n }\n\n truncate(p: PathSpec, length: number): Promise<void> {\n return truncateCore(this.accessor, p, length)\n }\n\n copy(src: PathSpec, dst: PathSpec): Promise<void> {\n return copyCore(this.accessor, src, dst)\n }\n\n rmR(p: PathSpec): Promise<void> {\n return rmRCore(this.accessor, p)\n }\n\n du(p: PathSpec): Promise<number> {\n return duCore(this.accessor, p)\n }\n\n find(p: PathSpec, options: FindOptions = {}): Promise<string[]> {\n return findCore(this.accessor, p, options as RedisFindOptions)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective = prefix\n ? paths.map((p) =>\n p.prefix\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return globCore(this.accessor, effective, this.index)\n }\n\n async getState(): Promise<RedisResourceState> {\n const files: Record<string, Uint8Array> = {}\n for (const key of await this.store.listFiles()) {\n const data = await this.store.getFile(key)\n if (data !== null) files[key] = data\n }\n const dirs = [...(await this.store.listDirs())].sort()\n return {\n type: this.kind,\n config: {\n url: REDACTED_SECRET,\n keyPrefix: this.keyPrefix,\n },\n keyPrefix: this.keyPrefix,\n files,\n dirs,\n }\n }\n\n async loadState(state: RedisResourceState): Promise<void> {\n const c = await this.store.client()\n const pipe = c.multi()\n const dirKey = `${this.keyPrefix}dir`\n for (const [path, data] of Object.entries(state.files)) {\n pipe.set(\n `${this.keyPrefix}file:${path}`,\n Buffer.from(data.buffer, data.byteOffset, data.byteLength),\n )\n }\n for (const dir of state.dirs) {\n pipe.sAdd(dirKey, dir)\n }\n await pipe.exec()\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 type RegisteredCommand,\n ResourceName,\n makeFiletypeCommands,\n makeGenericCommands,\n} from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../../accessor/redis.ts'\nimport { read as redisRead } from '../../../core/redis/read.ts'\nimport { stat as redisStat } from '../../../core/redis/stat.ts'\nimport { REDIS_CMD_OPS } from './ops.ts'\nimport { REDIS_SED } from './sed.ts'\n\nexport const REDIS_COMMANDS: readonly RegisteredCommand[] = [\n ...makeFiletypeCommands<RedisAccessor>({\n resource: ResourceName.REDIS,\n readBytes: redisRead,\n statEntry: redisStat,\n }),\n ...makeGenericCommands<RedisAccessor>(ResourceName.REDIS, REDIS_CMD_OPS),\n ...REDIS_SED,\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 { type IndexCacheStore, record, ResourceName, type PathSpec } from '@struktoai/mirage-core'\nimport { enoent } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\n\nexport async function read(\n accessor: RedisAccessor,\n path: PathSpec,\n _index?: IndexCacheStore,\n): Promise<Uint8Array> {\n const start = performance.now()\n const p = norm(path.stripPrefix)\n const data = await accessor.store.getFile(p)\n if (data === null) {\n throw enoent(path)\n }\n record('read', p, ResourceName.REDIS, data.byteLength, start)\n return data\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 { norm, parent, gnuBasename as basename } from '@struktoai/mirage-core'\n\nexport function nowIso(): string {\n return new Date().toISOString()\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 FileStat,\n FileType,\n guessType,\n type IndexCacheStore,\n type PathSpec,\n} from '@struktoai/mirage-core'\nimport { enoent } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { basename, norm } from './utils.ts'\n\nexport async function stat(\n accessor: RedisAccessor,\n path: PathSpec,\n _index?: IndexCacheStore,\n): Promise<FileStat> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n if (await store.hasDir(p)) {\n return new FileStat({\n name: basename(p),\n modified: await store.getModified(p),\n type: FileType.DIRECTORY,\n })\n }\n if (await store.hasFile(p)) {\n const size = await store.fileLen(p)\n return new FileStat({\n name: basename(p),\n size,\n modified: await store.getModified(p),\n type: guessType(p),\n })\n }\n throw enoent(path)\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 SCOPE_WARN = 5000\nexport const SCOPE_ERROR = 50000\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 { invalidateAfterWrite, type PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso } from './utils.ts'\n\nexport async function copy(accessor: RedisAccessor, src: PathSpec, dst: PathSpec): Promise<void> {\n const s = norm(src.stripPrefix)\n const d = norm(dst.stripPrefix)\n const store = accessor.store\n const data = await store.getFile(s)\n if (data === null) {\n throw new Error(`file not found: ${s}`)\n }\n await store.setFile(d, data)\n await store.setModified(d, nowIso())\n await invalidateAfterWrite(dst)\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 type { PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\nimport { rstripSlash } from '@struktoai/mirage-core'\n\nexport async function du(accessor: RedisAccessor, path: PathSpec): Promise<number> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n const prefix = rstripSlash(p) + '/'\n let total = 0\n for (const key of await store.listFiles()) {\n if (key === p || key.startsWith(prefix)) {\n total += await store.fileLen(key)\n }\n }\n return total\n}\n\nexport async function duAll(\n accessor: RedisAccessor,\n path: PathSpec,\n): Promise<{ entries: [string, number][]; total: number }> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n const prefix = rstripSlash(p) + '/'\n const entries: [string, number][] = []\n let total = 0\n for (const key of await store.listFiles()) {\n if (key === p || key.startsWith(prefix)) {\n const size = await store.fileLen(key)\n entries.push([key, size])\n total += size\n }\n }\n return { entries, total }\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 type { PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\n\nexport async function exists(accessor: RedisAccessor, path: PathSpec): Promise<boolean> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n return (await store.hasFile(p)) || (await store.hasDir(p))\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 type { PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\nimport {\n buildTree,\n computeNonemptyDirs,\n emitStartPath,\n keep,\n type PredNode,\n rstripSlash,\n startBasename,\n} from '@struktoai/mirage-core'\n\nexport interface FindOptions {\n name?: string | null\n type?: 'f' | 'd' | null\n minSize?: number | null\n maxSize?: number | null\n maxDepth?: number | null\n minDepth?: number | null\n nameExclude?: string | null\n orNames?: string[] | null\n iname?: string | null\n pathPattern?: string | null\n empty?: boolean | null\n tree?: PredNode | null\n}\n\nexport async function find(\n accessor: RedisAccessor,\n path: PathSpec,\n options: FindOptions = {},\n): Promise<string[]> {\n const p = norm(path.stripPrefix)\n const startName = startBasename(path.original)\n const store = accessor.store\n const prefix = rstripSlash(p) + '/'\n const baseDepth = p === '/' ? 0 : (p.match(/\\//g) ?? []).length\n const results: string[] = []\n const tree =\n options.tree ??\n buildTree({\n name: options.name,\n iname: options.iname,\n pathPattern: options.pathPattern,\n type: options.type,\n nameExclude: options.nameExclude,\n orNames: options.orNames,\n empty: options.empty,\n })\n const empty = options.empty === true\n const allFiles = await store.listFiles()\n const allDirs = await store.listDirs()\n const nonempty = empty\n ? computeNonemptyDirs([...allFiles, ...[...allDirs].filter((k) => k !== '/')])\n : new Set<string>()\n const candidates: [string, 'f' | 'd'][] = []\n if (options.type !== 'd') {\n for (const key of allFiles) candidates.push([key, 'f'])\n }\n if (options.type !== 'f') {\n for (const key of allDirs) {\n candidates.push([key, 'd'])\n }\n }\n let rootKind: 'f' | 'd' | null = null\n let rootIsEmpty: boolean | null = null\n let rootSize: number | null = null\n for (const [key, kind] of candidates) {\n if (key !== p && !key.startsWith(prefix)) continue\n if (key === p) {\n rootKind = kind\n if (empty) {\n rootIsEmpty = kind === 'f' ? (await store.fileLen(key)) === 0 : !nonempty.has(key)\n }\n if (kind === 'f') rootSize = await store.fileLen(key)\n continue\n }\n const depth = (key.match(/\\//g) ?? []).length - baseDepth\n if (options.maxDepth !== null && options.maxDepth !== undefined && depth > options.maxDepth)\n continue\n const basename = key.slice(key.lastIndexOf('/') + 1)\n let isEmpty: boolean | null = null\n if (empty) {\n isEmpty = kind === 'f' ? (await store.fileLen(key)) === 0 : !nonempty.has(key)\n }\n if (!keep({ key, name: basename, kind, depth, isEmpty }, tree, options.minDepth)) continue\n if (\n kind === 'f' &&\n ((options.minSize !== null && options.minSize !== undefined) ||\n (options.maxSize !== null && options.maxSize !== undefined))\n ) {\n const size = await store.fileLen(key)\n if (options.minSize !== null && options.minSize !== undefined && size < options.minSize)\n continue\n if (options.maxSize !== null && options.maxSize !== undefined && size > options.maxSize)\n continue\n }\n results.push(key)\n }\n if (rootKind !== null) {\n emitStartPath(results, p, startName, {\n kind: rootKind,\n isEmpty: rootIsEmpty,\n exists: true,\n tree,\n maxDepth: options.maxDepth,\n minDepth: options.minDepth,\n size: rootSize,\n minSize: options.minSize,\n maxSize: options.maxSize,\n })\n }\n results.sort()\n return results\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 { type PathSpec, invalidateAfterWrite } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso, parent } from './utils.ts'\nimport { stripSlash } from '@struktoai/mirage-core'\n\nexport async function mkdir(\n accessor: RedisAccessor,\n path: PathSpec,\n parents = false,\n): Promise<void> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n if (parents) {\n const parts = stripSlash(p).split('/')\n let current = ''\n const now = nowIso()\n for (const part of parts) {\n current += `/${part}`\n await store.addDir(current)\n const mod = await store.getModified(current)\n if (mod === null) {\n await store.setModified(current, now)\n }\n }\n return\n }\n const par = parent(p)\n if (par !== '/' && !(await store.hasDir(par))) {\n throw new Error(`parent directory does not exist: ${par}`)\n }\n await store.addDir(p)\n await store.setModified(p, nowIso())\n await invalidateAfterWrite(p)\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 { type IndexCacheStore, type PathSpec } from '@struktoai/mirage-core'\nimport { enotdir } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { RedisIndexEntry } from './entry.ts'\nimport { norm } from './utils.ts'\n\nexport async function readdir(\n accessor: RedisAccessor,\n path: PathSpec,\n index?: IndexCacheStore,\n): Promise<string[]> {\n const virtual = path.pattern !== null ? path.directory : path.stripPrefix\n const mountPrefix = path.prefix\n const virtualKey = mountPrefix + virtual\n if (index !== undefined) {\n const cached = await index.listDir(virtualKey)\n if (cached.entries !== undefined && cached.entries !== null) {\n return cached.entries\n }\n }\n const store = accessor.store\n const p = norm(virtual)\n if (!(await store.hasDir(p))) {\n throw enotdir(path)\n }\n const dirPrefix = p === '/' ? '/' : `${p}/`\n const seen = new Set<string>()\n const files = await store.listFiles()\n const dirs = await store.listDirs()\n for (const key of [...files, ...dirs]) {\n if (key === p) continue\n if (!key.startsWith(dirPrefix)) continue\n const remainder = key.slice(dirPrefix.length)\n const first = remainder.split('/')[0]\n if (first !== undefined && first.length > 0) seen.add(dirPrefix + first)\n }\n const sorted = [...seen].sort()\n const virtualEntries = sorted.map((entry) => `${mountPrefix}${entry}`)\n if (index !== undefined) {\n const fileSet = new Set(files)\n const entries: [string, RedisIndexEntry][] = sorted.map((e) => {\n const name = e.slice(e.lastIndexOf('/') + 1)\n return [name, fileSet.has(e) ? RedisIndexEntry.file(e) : RedisIndexEntry.folder(e)]\n })\n await index.setDir(virtualKey, entries)\n }\n return virtualEntries\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 { IndexEntry } from '@struktoai/mirage-core'\n\nexport const RedisResourceType = Object.freeze({\n FILE: 'file',\n FOLDER: 'folder',\n} as const)\n\nexport type RedisResourceType = (typeof RedisResourceType)[keyof typeof RedisResourceType]\n\nexport class RedisIndexEntry extends IndexEntry {\n static file(path: string, size = 0): RedisIndexEntry {\n const name = path.slice(path.lastIndexOf('/') + 1)\n return new RedisIndexEntry({\n id: path,\n name,\n resourceType: RedisResourceType.FILE,\n vfsName: name,\n size,\n })\n }\n\n static folder(path: string): RedisIndexEntry {\n const name = path.slice(path.lastIndexOf('/') + 1)\n return new RedisIndexEntry({\n id: path,\n name,\n resourceType: RedisResourceType.FOLDER,\n vfsName: name,\n })\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 { type PathSpec, invalidateAfterUnlink, invalidateAfterWrite } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso } from './utils.ts'\nimport { rstripSlash } from '@struktoai/mirage-core'\n\nexport async function rename(accessor: RedisAccessor, src: PathSpec, dst: PathSpec): Promise<void> {\n const s = norm(src.stripPrefix)\n const d = norm(dst.stripPrefix)\n const now = nowIso()\n const store = accessor.store\n if (await store.hasFile(s)) {\n const data = await store.getFile(s)\n const mod = await store.getModified(s)\n if (data === null) throw new Error(`file not found: ${s}`)\n await store.delFile(s)\n await store.delModified(s)\n await store.setFile(d, data)\n await store.setModified(d, mod ?? now)\n await invalidateAfterUnlink(s)\n await invalidateAfterWrite(d)\n return\n }\n if (await store.hasDir(s)) {\n const mod = await store.getModified(s)\n await store.removeDir(s)\n await store.delModified(s)\n await store.addDir(d)\n await store.setModified(d, mod ?? now)\n const prefix = rstripSlash(s) + '/'\n const dPrefix = rstripSlash(d) + '/'\n const files = await store.listFiles()\n for (const key of files) {\n if (key.startsWith(prefix)) {\n const newKey = dPrefix + key.slice(prefix.length)\n const data = await store.getFile(key)\n if (data === null) continue\n await store.delFile(key)\n await store.setFile(newKey, data)\n }\n }\n await invalidateAfterUnlink(s)\n await invalidateAfterWrite(d)\n return\n }\n throw new Error(`file not found: ${s}`)\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 type { PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\nimport { invalidateAfterUnlink, rstripSlash } from '@struktoai/mirage-core'\n\nexport async function rmR(accessor: RedisAccessor, path: PathSpec): Promise<void> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n const prefix = rstripSlash(p) + '/'\n const files = await store.listFiles()\n for (const key of files) {\n if (key === p || key.startsWith(prefix)) {\n await store.delFile(key)\n await store.delModified(key)\n }\n }\n const dirs = await store.listDirs()\n for (const key of dirs) {\n if (key === p || key.startsWith(prefix)) {\n await store.removeDir(key)\n await store.delModified(key)\n }\n }\n await invalidateAfterUnlink(path)\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 type { PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\nimport { invalidateAfterUnlink, rstripSlash } from '@struktoai/mirage-core'\n\nexport async function rmdir(accessor: RedisAccessor, path: PathSpec): Promise<void> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n if (!(await store.hasDir(p))) {\n throw new Error(`not a directory: ${p}`)\n }\n const prefix = rstripSlash(p) + '/'\n const files = await store.listFiles()\n const dirs = await store.listDirs()\n const candidates = [...files, ...dirs]\n for (const k of candidates) {\n if (k !== p && k.startsWith(prefix)) {\n throw new Error(`directory not empty: ${p}`)\n }\n }\n await store.removeDir(p)\n await invalidateAfterUnlink(path)\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 type IndexCacheStore,\n recordStream,\n ResourceName,\n type PathSpec,\n} from '@struktoai/mirage-core'\nimport { enoent } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\n\nexport async function* stream(\n accessor: RedisAccessor,\n path: PathSpec,\n _index?: IndexCacheStore,\n): AsyncIterable<Uint8Array> {\n const p = norm(path.stripPrefix)\n const data = await accessor.store.getFile(p)\n if (data === null) throw enoent(path)\n const rec = recordStream('read', p, ResourceName.REDIS)\n if (rec !== null) rec.bytes = data.byteLength\n yield data\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 { type PathSpec, invalidateAfterUnlink } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\n\nexport async function unlink(accessor: RedisAccessor, path: PathSpec): Promise<void> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n if (!(await store.hasFile(p))) {\n throw new Error(`file not found: ${p}`)\n }\n await store.delFile(p)\n await store.delModified(p)\n await invalidateAfterUnlink(p)\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 { ResourceName, invalidateAfterWrite, record, type PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso, parent } from './utils.ts'\n\nexport async function writeBytes(\n accessor: RedisAccessor,\n path: PathSpec,\n data: Uint8Array,\n): Promise<void> {\n const start = performance.now()\n const p = norm(path.stripPrefix)\n const par = parent(p)\n const store = accessor.store\n if (par !== '/' && !(await store.hasDir(par))) {\n throw new Error(`parent directory does not exist: ${par}`)\n }\n await store.setFile(p, data)\n await store.setModified(p, nowIso())\n record('write', p, ResourceName.REDIS, data.byteLength, start)\n await invalidateAfterWrite(p)\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 type { CommandIO } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../../accessor/redis.ts'\nimport { SCOPE_ERROR } from '../../../core/redis/constants.ts'\nimport { copy as redisCopy } from '../../../core/redis/copy.ts'\nimport { du as redisDu, duAll as redisDuAll } from '../../../core/redis/du.ts'\nimport { exists as redisExists } from '../../../core/redis/exists.ts'\nimport { find as redisFind } from '../../../core/redis/find.ts'\nimport { mkdir as redisMkdir } from '../../../core/redis/mkdir.ts'\nimport { read as redisRead } from '../../../core/redis/read.ts'\nimport { readdir as redisReaddir } from '../../../core/redis/readdir.ts'\nimport { rename as redisRename } from '../../../core/redis/rename.ts'\nimport { rmR as redisRmR } from '../../../core/redis/rm.ts'\nimport { rmdir as redisRmdir } from '../../../core/redis/rmdir.ts'\nimport { stat as redisStat } from '../../../core/redis/stat.ts'\nimport { stream as redisStream } from '../../../core/redis/stream.ts'\nimport { unlink as redisUnlink } from '../../../core/redis/unlink.ts'\nimport { writeBytes as redisWrite } from '../../../core/redis/write.ts'\n\nexport const REDIS_CMD_OPS: CommandIO<RedisAccessor> = {\n readdir: redisReaddir,\n readBytes: redisRead,\n readStream: redisStream,\n stat: redisStat,\n isMounted: () => true,\n local: true,\n maxGlobMatches: SCOPE_ERROR,\n write: redisWrite,\n exists: redisExists,\n mkdir: redisMkdir,\n unlink: redisUnlink,\n rmdir: redisRmdir,\n rmR: redisRmR,\n rename: redisRename,\n copy: redisCopy,\n find: redisFind,\n duTotal: redisDu,\n duAll: async (accessor, path) => {\n const { entries, total } = await redisDuAll(accessor, path)\n return [entries, total]\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 { ResourceName, makeSed } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../../accessor/redis.ts'\nimport { stream as redisStream } from '../../../core/redis/stream.ts'\nimport { writeBytes as redisWrite } from '../../../core/redis/write.ts'\n\nexport const REDIS_SED = makeSed<RedisAccessor>({\n resource: ResourceName.REDIS,\n stream: (a, p) => redisStream(a, p),\n write: (a, p, d) => redisWrite(a, p, d),\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 { Accessor } from '@struktoai/mirage-core'\nimport type { RedisStore } from '../resource/redis/store.ts'\n\nexport class RedisAccessor extends Accessor {\n readonly store: RedisStore\n\n constructor(store: RedisStore) {\n super()\n this.store = store\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 { ResourceName, invalidateAfterWrite, record, type PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso } from './utils.ts'\n\nexport async function appendBytes(\n accessor: RedisAccessor,\n path: PathSpec,\n data: Uint8Array,\n): Promise<void> {\n const start = performance.now()\n const p = norm(path.stripPrefix)\n const store = accessor.store\n const existing = await store.getFile(p)\n if (existing !== null) {\n const merged = new Uint8Array(existing.byteLength + data.byteLength)\n merged.set(existing, 0)\n merged.set(data, existing.byteLength)\n await store.setFile(p, merged)\n } else {\n await store.setFile(p, data)\n }\n await store.setModified(p, nowIso())\n record('append', p, ResourceName.REDIS, data.byteLength, start)\n await invalidateAfterWrite(p)\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 { invalidateAfterWrite, type PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso } from './utils.ts'\n\nexport async function create(accessor: RedisAccessor, path: PathSpec): Promise<void> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n await store.setFile(p, new Uint8Array(0))\n await store.setModified(p, nowIso())\n await invalidateAfterWrite(path)\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 { type IndexCacheStore, PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { SCOPE_ERROR } from './constants.ts'\nimport { readdir } from './readdir.ts'\nimport { fnmatch } from '@struktoai/mirage-core'\nimport { gnuBasename } from '@struktoai/mirage-core'\n\nexport async function resolveGlob(\n accessor: RedisAccessor,\n paths: readonly PathSpec[],\n index?: IndexCacheStore,\n): Promise<PathSpec[]> {\n const result: PathSpec[] = []\n for (const p of paths) {\n if (p.resolved) {\n result.push(p)\n } else if (p.pattern !== null) {\n const dirSpec = new PathSpec({\n original: p.directory,\n directory: p.directory,\n resolved: true,\n prefix: p.prefix,\n })\n const entries = await readdir(accessor, dirSpec, index)\n const matched: PathSpec[] = []\n for (const e of entries) {\n if (fnmatch(gnuBasename(e), p.pattern)) {\n matched.push(\n new PathSpec({\n original: e,\n directory: p.directory,\n resolved: true,\n prefix: p.prefix,\n }),\n )\n }\n }\n if (matched.length > SCOPE_ERROR) matched.length = SCOPE_ERROR\n result.push(...matched)\n } else {\n result.push(p)\n }\n }\n return result\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 { type PathSpec, invalidateAfterWrite } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso } from './utils.ts'\n\nexport async function truncate(\n accessor: RedisAccessor,\n path: PathSpec,\n length: number,\n): Promise<void> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n const existing = await store.getFile(p)\n const data = existing ?? new Uint8Array(0)\n const out = new Uint8Array(length)\n const copyLen = Math.min(data.byteLength, length)\n out.set(data.subarray(0, copyLen), 0)\n await store.setFile(p, out)\n await store.setModified(p, nowIso())\n await invalidateAfterWrite(p)\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 type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { appendBytes } from '../../core/redis/append.ts'\n\nexport const appendOp: RegisteredOp = {\n name: 'append',\n resource: ResourceName.REDIS,\n filetype: null,\n write: true,\n fn: (accessor: RedisAccessor, path: PathSpec, args: readonly unknown[]) => {\n const data = args[0]\n if (!(data instanceof Uint8Array)) {\n throw new TypeError('append op requires a Uint8Array as the first arg')\n }\n return appendBytes(accessor, path, data)\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 type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { create } from '../../core/redis/create.ts'\n\nexport const createOp: RegisteredOp = {\n name: 'create',\n resource: ResourceName.REDIS,\n filetype: null,\n write: true,\n fn: (accessor: RedisAccessor, path: PathSpec) => {\n return create(accessor, path)\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 type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { mkdir } from '../../core/redis/mkdir.ts'\n\nexport const mkdirOp: RegisteredOp = {\n name: 'mkdir',\n resource: ResourceName.REDIS,\n filetype: null,\n write: true,\n fn: (accessor: RedisAccessor, path: PathSpec, args: readonly unknown[]) => {\n const parents = args[0]\n return mkdir(accessor, path, parents === true)\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 type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { read as coreRead } from '../../core/redis/read.ts'\n\nexport const readOp: RegisteredOp = {\n name: 'read',\n resource: ResourceName.REDIS,\n filetype: null,\n write: false,\n fn: (accessor: RedisAccessor, path: PathSpec) => {\n return coreRead(accessor, path)\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 featherCat,\n type OpKwargs,\n type PathSpec,\n type RegisteredOp,\n ResourceName,\n} from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { read as coreRead } from '../../core/redis/read.ts'\n\nexport const readFeatherOp: RegisteredOp = {\n name: 'read',\n resource: ResourceName.REDIS,\n filetype: '.feather',\n write: false,\n fn: async (\n accessor: RedisAccessor,\n path: PathSpec,\n _args: readonly unknown[],\n kwargs: OpKwargs,\n ) => {\n const raw = await coreRead(accessor, path, kwargs.index)\n return featherCat(raw)\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 hdf5Cat,\n type OpKwargs,\n type PathSpec,\n type RegisteredOp,\n ResourceName,\n} from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { read as coreRead } from '../../core/redis/read.ts'\n\nexport const readHdf5Op: RegisteredOp = {\n name: 'read',\n resource: ResourceName.REDIS,\n filetype: '.hdf5',\n write: false,\n fn: async (\n accessor: RedisAccessor,\n path: PathSpec,\n _args: readonly unknown[],\n kwargs: OpKwargs,\n ) => {\n const raw = await coreRead(accessor, path, kwargs.index)\n return hdf5Cat(raw)\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 type OpKwargs,\n parquetCat,\n type PathSpec,\n type RegisteredOp,\n ResourceName,\n} from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { read as coreRead } from '../../core/redis/read.ts'\n\nexport const readParquetOp: RegisteredOp = {\n name: 'read',\n resource: ResourceName.REDIS,\n filetype: '.parquet',\n write: false,\n fn: async (\n accessor: RedisAccessor,\n path: PathSpec,\n _args: readonly unknown[],\n kwargs: OpKwargs,\n ) => {\n const raw = await coreRead(accessor, path, kwargs.index)\n return parquetCat(raw)\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 type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { readdir } from '../../core/redis/readdir.ts'\n\nexport const readdirOp: RegisteredOp = {\n name: 'readdir',\n resource: ResourceName.REDIS,\n filetype: null,\n write: false,\n fn: (accessor: RedisAccessor, path: PathSpec) => {\n return readdir(accessor, path)\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 type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { rename } from '../../core/redis/rename.ts'\n\nexport const renameOp: RegisteredOp = {\n name: 'rename',\n resource: ResourceName.REDIS,\n filetype: null,\n write: true,\n fn: (accessor: RedisAccessor, path: PathSpec, args: readonly unknown[]) => {\n const dst = args[0]\n if (dst === undefined || dst === null || typeof dst !== 'object' || !('original' in dst)) {\n throw new TypeError('rename op requires a PathSpec destination as the first arg')\n }\n return rename(accessor, path, dst as PathSpec)\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 type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { rmdir } from '../../core/redis/rmdir.ts'\n\nexport const rmdirOp: RegisteredOp = {\n name: 'rmdir',\n resource: ResourceName.REDIS,\n filetype: null,\n write: true,\n fn: (accessor: RedisAccessor, path: PathSpec) => {\n return rmdir(accessor, path)\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 type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { stat as coreStat } from '../../core/redis/stat.ts'\n\nexport const statOp: RegisteredOp = {\n name: 'stat',\n resource: ResourceName.REDIS,\n filetype: null,\n write: false,\n fn: (accessor: RedisAccessor, path: PathSpec) => {\n return coreStat(accessor, path)\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 type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { truncate } from '../../core/redis/truncate.ts'\n\nexport const truncateOp: RegisteredOp = {\n name: 'truncate',\n resource: ResourceName.REDIS,\n filetype: null,\n write: true,\n fn: (accessor: RedisAccessor, path: PathSpec, args: readonly unknown[]) => {\n const length = args[0]\n if (typeof length !== 'number') {\n throw new TypeError('truncate op requires a number length as the first arg')\n }\n return truncate(accessor, path, length)\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 type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { unlink } from '../../core/redis/unlink.ts'\n\nexport const unlinkOp: RegisteredOp = {\n name: 'unlink',\n resource: ResourceName.REDIS,\n filetype: null,\n write: true,\n fn: (accessor: RedisAccessor, path: PathSpec) => {\n return unlink(accessor, path)\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 { extractWriteData, type PathSpec, type RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { writeBytes } from '../../core/redis/write.ts'\n\nexport const writeOp: RegisteredOp = {\n name: 'write',\n resource: ResourceName.REDIS,\n filetype: null,\n write: true,\n fn: (accessor: RedisAccessor, path: PathSpec, args: readonly unknown[]) => {\n const data = extractWriteData(args)\n return writeBytes(accessor, path, data)\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 type { RegisteredOp } from '@struktoai/mirage-core'\nimport { appendOp } from './append.ts'\nimport { createOp } from './create.ts'\nimport { mkdirOp } from './mkdir.ts'\nimport { readOp } from './read.ts'\nimport { readFeatherOp } from './read_feather.ts'\nimport { readHdf5Op } from './read_hdf5.ts'\nimport { readParquetOp } from './read_parquet.ts'\nimport { readdirOp } from './readdir.ts'\nimport { renameOp } from './rename.ts'\nimport { rmdirOp } from './rmdir.ts'\nimport { statOp } from './stat.ts'\nimport { truncateOp } from './truncate.ts'\nimport { unlinkOp } from './unlink.ts'\nimport { writeOp } from './write.ts'\n\nexport const REDIS_OPS: readonly RegisteredOp[] = [\n appendOp,\n createOp,\n mkdirOp,\n readOp,\n readFeatherOp,\n readHdf5Op,\n readParquetOp,\n readdirOp,\n renameOp,\n rmdirOp,\n statOp,\n truncateOp,\n unlinkOp,\n writeOp,\n]\n\nexport {\n appendOp,\n createOp,\n mkdirOp,\n readOp,\n readFeatherOp,\n readHdf5Op,\n readParquetOp,\n readdirOp,\n renameOp,\n rmdirOp,\n statOp,\n truncateOp,\n unlinkOp,\n writeOp,\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 REDIS_PROMPT = `Redis-backed persistent filesystem. Behaves like a standard filesystem.\nStandard commands: ls, cat, head, tail, grep, wc, find, tree, mkdir, touch, cp, mv, rm, tee.`\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 type { RedisClientType } from 'redis'\nimport { loadOptionalPeer } from '../../optional_peer.ts'\n\nexport interface RedisStoreOptions {\n url?: string\n client?: RedisClientType\n keyPrefix?: string\n}\n\nexport class RedisStore {\n readonly url: string\n readonly keyPrefix: string\n private readonly providedClient: RedisClientType | null\n private clientPromise: Promise<RedisClientType> | null = null\n\n constructor(options: RedisStoreOptions = {}) {\n this.url = options.url ?? 'redis://localhost:6379/0'\n this.keyPrefix = options.keyPrefix ?? 'mirage:fs:'\n this.providedClient = options.client ?? null\n }\n\n fk(path: string): string {\n return `${this.keyPrefix}file:${path}`\n }\n\n dk(): string {\n return `${this.keyPrefix}dir`\n }\n\n mk(path: string): string {\n return `${this.keyPrefix}modified:${path}`\n }\n\n async client(): Promise<RedisClientType> {\n if (this.providedClient !== null) return this.providedClient\n this.clientPromise ??= (async () => {\n const mod = await loadOptionalPeer(\n () =>\n import('redis') as unknown as Promise<{\n createClient: (o: { url: string }) => RedisClientType\n }>,\n { feature: 'RedisResource / RedisFileCacheStore', packageName: 'redis' },\n )\n const c = mod.createClient({\n url: this.url,\n socket: { reconnectStrategy: false },\n } as Parameters<typeof mod.createClient>[0])\n await c.connect()\n await c.sAdd(this.dk(), '/')\n return c\n })()\n return this.clientPromise\n }\n\n async getFile(path: string): Promise<Uint8Array | null> {\n const c = await this.client()\n const typed = c as unknown as {\n withTypeMapping: (m: Record<number, unknown>) => {\n get: (k: string) => Promise<Buffer | null>\n }\n }\n const mod = (await import('redis')) as unknown as {\n RESP_TYPES: { readonly BLOB_STRING: number }\n }\n const blob = mod.RESP_TYPES.BLOB_STRING\n const mapping: Record<number, unknown> = { [blob]: Buffer }\n const raw = await typed.withTypeMapping(mapping).get(this.fk(path))\n if (raw === null) return null\n return new Uint8Array(raw.buffer, raw.byteOffset, raw.byteLength)\n }\n\n async setFile(path: string, data: Uint8Array): Promise<void> {\n const c = await this.client()\n await c.set(this.fk(path), Buffer.from(data.buffer, data.byteOffset, data.byteLength))\n }\n\n async delFile(path: string): Promise<void> {\n const c = await this.client()\n await c.del(this.fk(path))\n }\n\n async hasFile(path: string): Promise<boolean> {\n const c = await this.client()\n return (await c.exists(this.fk(path))) > 0\n }\n\n async listFiles(prefix = ''): Promise<string[]> {\n const c = await this.client()\n const pattern = `${this.keyPrefix}file:${prefix}*`\n const strip = `${this.keyPrefix}file:`.length\n const result: string[] = []\n for await (const k of c.scanIterator({ MATCH: pattern })) {\n const keys = Array.isArray(k) ? k : [k]\n for (const key of keys) result.push(key.slice(strip))\n }\n return result.sort()\n }\n\n async fileLen(path: string): Promise<number> {\n const c = await this.client()\n return c.strLen(this.fk(path))\n }\n\n async getRange(path: string, start: number, end: number): Promise<Uint8Array> {\n const c = await this.client()\n const typed = c as unknown as {\n withTypeMapping: (m: Record<number, unknown>) => {\n getRange: (k: string, s: number, e: number) => Promise<Buffer>\n }\n }\n const mod = (await import('redis')) as unknown as {\n RESP_TYPES: { readonly BLOB_STRING: number }\n }\n const blob = mod.RESP_TYPES.BLOB_STRING\n const mapping: Record<number, unknown> = { [blob]: Buffer }\n const raw = await typed.withTypeMapping(mapping).getRange(this.fk(path), start, end)\n return new Uint8Array(raw.buffer, raw.byteOffset, raw.byteLength)\n }\n\n async hasDir(path: string): Promise<boolean> {\n const c = await this.client()\n return (await c.sIsMember(this.dk(), path)) === 1\n }\n\n async addDir(path: string): Promise<void> {\n const c = await this.client()\n await c.sAdd(this.dk(), path)\n }\n\n async removeDir(path: string): Promise<void> {\n const c = await this.client()\n await c.sRem(this.dk(), path)\n }\n\n async listDirs(): Promise<Set<string>> {\n const c = await this.client()\n const members = await c.sMembers(this.dk())\n return new Set(members)\n }\n\n async getModified(path: string): Promise<string | null> {\n const c = await this.client()\n return c.get(this.mk(path))\n }\n\n async setModified(path: string, ts: string): Promise<void> {\n const c = await this.client()\n await c.set(this.mk(path), ts)\n }\n\n async delModified(path: string): Promise<void> {\n const c = await this.client()\n await c.del(this.mk(path))\n }\n\n async clear(): Promise<void> {\n const c = await this.client()\n for (const pattern of [`${this.keyPrefix}file:*`, `${this.keyPrefix}modified:*`]) {\n const keys: string[] = []\n for await (const k of c.scanIterator({ MATCH: pattern })) {\n if (Array.isArray(k)) keys.push(...k)\n else keys.push(k)\n }\n if (keys.length > 0) await c.del(keys)\n }\n await c.del(this.dk())\n }\n\n async close(): Promise<void> {\n if (this.providedClient !== null) return\n if (this.clientPromise === null) return\n const c = await this.clientPromise\n const typed = c as unknown as { destroy?: () => void }\n if (typeof typed.destroy === 'function') typed.destroy()\n else if (c.isOpen) await c.quit()\n this.clientPromise = null\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EAGA,YAAAA;AAAA,EAGA;AAAA,EAEA,gBAAAC;AAAA,OACK;;;ACVP;AAAA,EAEE,gBAAAC;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACLP,SAA+B,QAAQ,oBAAmC;AAC1E,SAAS,cAAc;;;ACDvB,SAAS,MAAM,QAAuB,mBAAgB;AAE/C,SAAS,SAAiB;AAC/B,UAAO,oBAAI,KAAK,GAAE,YAAY;AAChC;;;ADCA,eAAsB,KACpB,UACA,MACA,QACqB;AACrB,QAAM,QAAQ,YAAY,IAAI;AAC9B,QAAM,IAAI,KAAK,KAAK,WAAW;AAC/B,QAAM,OAAO,MAAM,SAAS,MAAM,QAAQ,CAAC;AAC3C,MAAI,SAAS,MAAM;AACjB,UAAM,OAAO,IAAI;AAAA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,MAAM,KAAK,MAAM,OAAO;AAClC,UAAM,OAAO,EAAE,MAAM;AACrB,UAAM,SAAS,GAAG,KAAK,SAAS;AAChC,eAAW,CAAC,MAAM,IAAI,KAAK,OAAO,QAAQ,MAAM,KAAK,GAAG;AACtD,WAAK;AAAA,QACH,GAAG,KAAK,SAAS,QAAQ,IAAI;AAAA,QAC7B,OAAO,KAAK,KAAK,QAAQ,KAAK,YAAY,KAAK,UAAU;AAAA,MAC3D;AAAA,IACF;AACA,eAAW,OAAO,MAAM,MAAM;AAC5B,WAAK,KAAK,QAAQ,GAAG;AAAA,IACvB;AACA,UAAM,KAAK,KAAK;AAAA,EAClB;AACF;","names":["PathSpec","ResourceName","ResourceName","enoent","enoent","rstripSlash","invalidateAfterWrite","invalidateAfterWrite","invalidateAfterWrite","rstripSlash","invalidateAfterWrite","invalidateAfterUnlink","rstripSlash","invalidateAfterUnlink","rstripSlash","ResourceName","enoent","enoent","ResourceName","invalidateAfterUnlink","invalidateAfterUnlink","ResourceName","invalidateAfterWrite","record","record","ResourceName","invalidateAfterWrite","ResourceName","ResourceName","ResourceName","ResourceName","invalidateAfterWrite","record","record","ResourceName","invalidateAfterWrite","invalidateAfterWrite","invalidateAfterWrite","gnuBasename","invalidateAfterWrite","invalidateAfterWrite","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","PathSpec"]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-OPYQ5KIO.js";
|
|
5
5
|
import {
|
|
6
6
|
S3Resource
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TA3WMOMU.js";
|
|
8
8
|
|
|
9
9
|
// src/resource/ceph/ceph.ts
|
|
10
10
|
import {
|
|
@@ -54,4 +54,4 @@ export {
|
|
|
54
54
|
CEPH_PROMPT,
|
|
55
55
|
CephResource
|
|
56
56
|
};
|
|
57
|
-
//# sourceMappingURL=chunk-
|
|
57
|
+
//# sourceMappingURL=chunk-IK2L4EN3.js.map
|
|
@@ -34,7 +34,7 @@ var NodeDiscordTransport = class extends HttpDiscordTransport {
|
|
|
34
34
|
};
|
|
35
35
|
var DiscordResource = class extends BaseResource {
|
|
36
36
|
kind = ResourceName.DISCORD;
|
|
37
|
-
|
|
37
|
+
cachesReads = true;
|
|
38
38
|
indexTtl = 600;
|
|
39
39
|
prompt = DISCORD_PROMPT;
|
|
40
40
|
writePrompt = DISCORD_WRITE_PROMPT;
|
|
@@ -96,4 +96,4 @@ var DiscordResource = class extends BaseResource {
|
|
|
96
96
|
export {
|
|
97
97
|
DiscordResource
|
|
98
98
|
};
|
|
99
|
-
//# sourceMappingURL=chunk-
|
|
99
|
+
//# sourceMappingURL=chunk-JAGJTM3Q.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/discord/discord.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 BaseResource,\n DISCORD_API,\n DISCORD_COMMANDS,\n DISCORD_PROMPT,\n DISCORD_VFS_OPS,\n DISCORD_WRITE_PROMPT,\n DiscordAccessor,\n type FileStat,\n HttpDiscordTransport,\n PathSpec,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n discordRead,\n discordReaddir,\n discordStat,\n resolveDiscordGlob,\n} from '@struktoai/mirage-core'\nimport { redactDiscordConfig, type DiscordConfig, type DiscordConfigRedacted } from './config.ts'\n\nclass NodeDiscordTransport extends HttpDiscordTransport {\n constructor(private readonly token: string) {\n super()\n }\n protected baseUrl(): string {\n return DISCORD_API\n }\n protected authHeaders(): Record<string, string> {\n return { Authorization: `Bot ${this.token}` }\n }\n}\n\nexport interface DiscordResourceState {\n type: string\n config: DiscordConfigRedacted\n}\n\nexport class DiscordResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.DISCORD\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 600\n readonly prompt: string = DISCORD_PROMPT\n readonly writePrompt: string = DISCORD_WRITE_PROMPT\n readonly config: DiscordConfig\n readonly accessor: DiscordAccessor\n\n constructor(config: DiscordConfig) {\n super()\n this.config = config\n this.accessor = new DiscordAccessor(new NodeDiscordTransport(config.token))\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 DISCORD_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return DISCORD_VFS_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return discordRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return discordReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return discordStat(this.accessor, p, this.index)\n }\n\n async fingerprint(p: PathSpec): Promise<string | null> {\n const lookup = await this.index.get(p.original)\n return lookup.entry?.remoteTime ?? null\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return resolveDiscordGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<DiscordResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactDiscordConfig(this.config),\n })\n }\n\n loadState(_state: DiscordResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,uBAAN,cAAmC,qBAAqB;AAAA,EACtD,YAA6B,OAAe;AAC1C,UAAM;AADqB;AAAA,EAE7B;AAAA,EAF6B;AAAA,EAGnB,UAAkB;AAC1B,WAAO;AAAA,EACT;AAAA,EACU,cAAsC;AAC9C,WAAO,EAAE,eAAe,OAAO,KAAK,KAAK,GAAG;AAAA,EAC9C;AACF;AAOO,IAAM,kBAAN,cAA8B,aAAiC;AAAA,EAC3D,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB,cAAsB;AAAA,EACtB;AAAA,EACA;AAAA,EAET,YAAY,QAAuB;AACjC,UAAM;AACN,SAAK,SAAS;AACd,SAAK,WAAW,IAAI,gBAAgB,IAAI,qBAAqB,OAAO,KAAK,CAAC;AAAA,EAC5E;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;AAAA,EACT;AAAA,EAEA,SAAS,GAAkC;AACzC,WAAO,YAAY,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EACjD;AAAA,EAEA,QAAQ,GAAgC;AACtC,WAAO,eAAe,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EACpD;AAAA,EAEA,KAAK,GAAgC;AACnC,WAAO,YAAY,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EACjD;AAAA,EAEA,MAAM,YAAY,GAAqC;AACrD,UAAM,SAAS,MAAM,KAAK,MAAM,IAAI,EAAE,QAAQ;AAC9C,WAAO,OAAO,OAAO,cAAc;AAAA,EACrC;AAAA,EAEA,KAAK,OAA4B,SAAS,IAAyB;AACjE,UAAM,YACJ,WAAW,KACP,MAAM;AAAA,MAAI,CAAC,MACT,EAAE,WAAW,KACT,IACA,IAAI,SAAS;AAAA,QACX,UAAU,EAAE;AAAA,QACZ,WAAW,EAAE;AAAA,QACb,GAAI,EAAE,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ;AAAA,MACF,CAAC;AAAA,IACP,IACA;AACN,WAAO,mBAAmB,KAAK,UAAU,WAAW,KAAK,KAAK;AAAA,EAChE;AAAA,EAEA,WAA0C;AACxC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,oBAAoB,KAAK,MAAM;AAAA,IACzC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA6C;AACrD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "@struktoai/mirage-core";
|
|
21
21
|
var GDocsResource = class extends BaseResource {
|
|
22
22
|
kind = ResourceName.GDOCS;
|
|
23
|
-
|
|
23
|
+
cachesReads = true;
|
|
24
24
|
indexTtl = 86400;
|
|
25
25
|
prompt = GDOCS_PROMPT;
|
|
26
26
|
writePrompt = GDOCS_WRITE_PROMPT;
|
|
@@ -87,4 +87,4 @@ var GDocsResource = class extends BaseResource {
|
|
|
87
87
|
export {
|
|
88
88
|
GDocsResource
|
|
89
89
|
};
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-JCC4CU2I.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/gdocs/gdocs.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 BaseResource,\n type FileStat,\n GDOCS_COMMANDS,\n GDOCS_PROMPT,\n GDOCS_VFS_OPS,\n GDOCS_WRITE_PROMPT,\n GDocsAccessor,\n PathSpec,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n TokenManager,\n gdocsRead,\n gdocsReaddir,\n gdocsResolveGlob,\n gdocsStat,\n} from '@struktoai/mirage-core'\nimport { redactGDocsConfig, type GDocsConfig, type GDocsConfigRedacted } from './config.ts'\n\nexport interface GDocsResourceState {\n type: string\n config: GDocsConfigRedacted\n}\n\nexport class GDocsResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.GDOCS\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 86_400\n readonly prompt: string = GDOCS_PROMPT\n readonly writePrompt: string = GDOCS_WRITE_PROMPT\n readonly config: GDocsConfig\n readonly accessor: GDocsAccessor\n\n constructor(config: GDocsConfig) {\n super()\n this.config = config\n const tm = new TokenManager({\n clientId: config.clientId,\n clientSecret: config.clientSecret,\n refreshToken: config.refreshToken,\n })\n this.accessor = new GDocsAccessor({ tokenManager: tm })\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 GDOCS_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return GDOCS_VFS_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return gdocsRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return gdocsReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return gdocsStat(this.accessor, p, this.index)\n }\n\n async fingerprint(p: PathSpec): Promise<string | null> {\n const lookup = await this.index.get(p.original)\n return lookup.entry?.remoteTime ?? null\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return gdocsResolveGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<GDocsResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactGDocsConfig(this.config),\n })\n }\n\n loadState(_state: GDocsResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQA,IAAM,gBAAN,cAA4B,aAAiC;AAAA,EACzD,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB,cAAsB;AAAA,EACtB;AAAA,EACA;AAAA,EAET,YAAY,QAAqB;AAC/B,UAAM;AACN,SAAK,SAAS;AACd,UAAM,KAAK,IAAI,aAAa;AAAA,MAC1B,UAAU,OAAO;AAAA,MACjB,cAAc,OAAO;AAAA,MACrB,cAAc,OAAO;AAAA,IACvB,CAAC;AACD,SAAK,WAAW,IA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
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-ZNWVJ6UW.js";
|
|
5
5
|
import {
|
|
6
6
|
S3Resource
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TA3WMOMU.js";
|
|
8
8
|
|
|
9
9
|
// src/resource/digitalocean/digitalocean.ts
|
|
10
10
|
import {
|
|
@@ -54,4 +54,4 @@ export {
|
|
|
54
54
|
DIGITALOCEAN_PROMPT,
|
|
55
55
|
DigitalOceanResource
|
|
56
56
|
};
|
|
57
|
-
//# sourceMappingURL=chunk-
|
|
57
|
+
//# sourceMappingURL=chunk-KPULTUOK.js.map
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "@struktoai/mirage-core";
|
|
24
24
|
var GitHubResource = class _GitHubResource extends BaseResource {
|
|
25
25
|
kind = ResourceName.GITHUB;
|
|
26
|
-
|
|
26
|
+
cachesReads = true;
|
|
27
27
|
indexTtl = 86400;
|
|
28
28
|
config;
|
|
29
29
|
accessor;
|
|
@@ -107,4 +107,4 @@ var GitHubResource = class _GitHubResource extends BaseResource {
|
|
|
107
107
|
export {
|
|
108
108
|
GitHubResource
|
|
109
109
|
};
|
|
110
|
-
//# sourceMappingURL=chunk-
|
|
110
|
+
//# sourceMappingURL=chunk-LV2G7VHL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/github/github.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 BaseResource,\n fetchGitHubRepoInfo,\n fetchGitHubTree,\n type FileStat,\n GITHUB_COMMANDS,\n GITHUB_VFS_OPS,\n GitHubAccessor,\n HttpGitHubTransport,\n type IndexCacheStore,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n githubBuildTreeMap,\n githubPopulateIndex,\n githubRead,\n githubReaddir,\n githubResolveGlob,\n githubStat,\n} from '@struktoai/mirage-core'\nimport { redactGitHubConfig, type GitHubConfig, type GitHubConfigRedacted } from './config.ts'\n\nexport interface GitHubResourceState {\n type: string\n config: GitHubConfigRedacted\n defaultBranch: string\n truncated: boolean\n}\n\nexport class GitHubResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.GITHUB\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 86_400\n readonly config: GitHubConfig\n readonly accessor: GitHubAccessor\n\n private constructor(config: GitHubConfig, accessor: GitHubAccessor, index: IndexCacheStore) {\n super()\n this.config = config\n this.accessor = accessor\n this._index = index\n }\n\n static async create(config: GitHubConfig): Promise<GitHubResource> {\n const transportOpts: { token: string; baseUrl?: string } = { token: config.token }\n if (config.baseUrl !== undefined) transportOpts.baseUrl = config.baseUrl\n const transport = new HttpGitHubTransport(transportOpts)\n const repoInfo = await fetchGitHubRepoInfo(transport, config.owner, config.repo)\n const ref = config.ref ?? repoInfo.default_branch\n const { tree, truncated } = await fetchGitHubTree(transport, config.owner, config.repo, ref)\n const treeMap = githubBuildTreeMap(tree)\n const accessor = new GitHubAccessor({\n transport,\n owner: config.owner,\n repo: config.repo,\n ref,\n defaultBranch: repoInfo.default_branch,\n truncated,\n tree: treeMap,\n })\n const index = new RAMIndexCacheStore({ ttl: 86_400 })\n await githubPopulateIndex(index, tree)\n return new GitHubResource(config, accessor, index)\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 GITHUB_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return GITHUB_VFS_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return githubRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return githubReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return githubStat(this.accessor, p, this.index)\n }\n\n async fingerprint(p: PathSpec): Promise<string | null> {\n const lookup = await this.index.get(p.original)\n return lookup.entry?.id ?? null\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return githubResolveGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<GitHubResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactGitHubConfig(this.config),\n defaultBranch: this.accessor.defaultBranch,\n truncated: this.accessor.truncated,\n })\n }\n\n loadState(_state: GitHubResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUA,IAAM,iBAAN,MAAM,wBAAuB,aAAiC;AAAA,EAC1D,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB;AAAA,EACA;AAAA,EAED,YAAY,QAAsB,UAA0B,OAAwB;AAC1F,UAAM;AACN,SAAK,SAAS;AACd,SAAK,WAAW;AAChB,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,aAAa,OAAO,QAA+C;AACjE,UAAM,g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,EAC7B;AAAA,EAEA,KAAK,OAA4B,SAAS,IAAyB;AACjE,UAAM,YACJ,WAAW,KACP,MAAM;AAAA,MAAI,CAAC,MACT,EAAE,WAAW,KACT,IACA,IAAI,SAAS;AAAA,QACX,UAAU,EAAE;AAAA,QACZ,WAAW,EAAE;AAAA,QACb,GAAI,EAAE,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ;AAAA,MACF,CAAC;AAAA,IACP,IACA;AACN,WAAO,kBAAkB,KAAK,UAAU,WAAW,KAAK,KAAK;AAAA,EAC/D;AAAA,EAEA,WAAyC;AACvC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,mBAAmB,KAAK,MAAM;AAAA,MACtC,eAAe,KAAK,SAAS;AAAA,MAC7B,WAAW,KAAK,SAAS;AAAA,IAC3B,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA4C;AACpD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "@struktoai/mirage-core";
|
|
21
21
|
var SlackResource = class extends BaseResource {
|
|
22
22
|
kind = ResourceName.SLACK;
|
|
23
|
-
|
|
23
|
+
cachesReads = true;
|
|
24
24
|
indexTtl = 600;
|
|
25
25
|
prompt = SLACK_PROMPT;
|
|
26
26
|
writePrompt = SLACK_WRITE_PROMPT;
|
|
@@ -82,4 +82,4 @@ var SlackResource = class extends BaseResource {
|
|
|
82
82
|
export {
|
|
83
83
|
SlackResource
|
|
84
84
|
};
|
|
85
|
-
//# sourceMappingURL=chunk-
|
|
85
|
+
//# sourceMappingURL=chunk-M5FVUIYP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/slack/slack.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 BaseResource,\n type FileStat,\n NodeSlackTransport,\n PathSpec,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n resolveSlackGlob,\n SLACK_COMMANDS,\n SLACK_PROMPT,\n SLACK_VFS_OPS,\n SLACK_WRITE_PROMPT,\n SlackAccessor,\n slackRead,\n slackReaddir,\n slackStat,\n} from '@struktoai/mirage-core'\nimport { redactSlackConfig, type SlackConfig, type SlackConfigRedacted } from './config.ts'\n\nexport interface SlackResourceState {\n type: string\n config: SlackConfigRedacted\n}\n\nexport class SlackResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.SLACK\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 600\n readonly prompt: string = SLACK_PROMPT\n readonly writePrompt: string = SLACK_WRITE_PROMPT\n readonly config: SlackConfig\n readonly accessor: SlackAccessor\n\n constructor(config: SlackConfig) {\n super()\n this.config = config\n this.accessor = new SlackAccessor(new NodeSlackTransport(config.token, config.searchToken))\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 SLACK_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return SLACK_VFS_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return slackRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return slackReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return slackStat(this.accessor, p, this.index)\n }\n\n async fingerprint(p: PathSpec): Promise<string | null> {\n const lookup = await this.index.get(p.original)\n return lookup.entry?.remoteTime ?? null\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return resolveSlackGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<SlackResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactSlackConfig(this.config),\n })\n }\n\n loadState(_state: SlackResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQA,IAAM,gBAAN,cAA4B,aAAiC;AAAA,EACzD,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB,cAAsB;AAAA,EACtB;AAAA,EACA;AAAA,EAET,YAAY,QAAqB;AAC/B,UAAM;AACN,SAAK,SAAS;AACd,SAAK,WAAW,IAAI,cAAc,IAAI,mBAAmB,OAAO,OAAO,OAAO,WAAW,CAAC;AAAA,EAC5F;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;AAAA,EACT;AAAA,EAEA,SAAS,GAAkC;AACzC,WAAO,UAAU,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EAC/C;AAAA,EAEA,QAAQ,GAAgC;AACtC,WAAO,aAAa,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EAClD;AAAA,EAEA,KAAK,GAAgC;AACnC,WAAO,UAAU,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EAC/C;AAAA,EAEA,MAAM,YAAY,GAAqC;AACrD,UAAM,SAAS,MAAM,KAAK,MAAM,IAAI,EAAE,QAAQ;AAC9C,WAAO,OAAO,OAAO,cAAc;AAAA,EACrC;AAAA,EAEA,KAAK,OAA4B,SAAS,IAAyB;AACjE,UAAM,YACJ,WAAW,KACP,MAAM;AAAA,MAAI,CAAC,MACT,EAAE,WAAW,KACT,IACA,IAAI,SAAS;AAAA,QACX,UAAU,EAAE;AAAA,QACZ,WAAW,EAAE;AAAA,QACb,GAAI,EAAE,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ;AAAA,MACF,CAAC;AAAA,IACP,IACA;AACN,WAAO,iBAAiB,KAAK,UAAU,WAAW,KAAK,KAAK;AAAA,EAC9D;AAAA,EAEA,WAAwC;AACtC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,kBAAkB,KAAK,MAAM;AAAA,IACvC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA2C;AACnD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "@struktoai/mirage-core";
|
|
21
21
|
var GmailResource = class extends BaseResource {
|
|
22
22
|
kind = ResourceName.GMAIL;
|
|
23
|
-
|
|
23
|
+
cachesReads = true;
|
|
24
24
|
indexTtl = 86400;
|
|
25
25
|
prompt = GMAIL_PROMPT;
|
|
26
26
|
writePrompt = GMAIL_WRITE_PROMPT;
|
|
@@ -83,4 +83,4 @@ var GmailResource = class extends BaseResource {
|
|
|
83
83
|
export {
|
|
84
84
|
GmailResource
|
|
85
85
|
};
|
|
86
|
-
//# sourceMappingURL=chunk-
|
|
86
|
+
//# sourceMappingURL=chunk-MPCCRRE6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/gmail/gmail.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 BaseResource,\n type FileStat,\n GMAIL_COMMANDS,\n GMAIL_PROMPT,\n GMAIL_WRITE_PROMPT,\n GMAIL_VFS_OPS,\n GmailAccessor,\n PathSpec,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n TokenManager,\n gmailRead,\n gmailReaddir,\n gmailResolveGlob,\n gmailStat,\n} from '@struktoai/mirage-core'\nimport { redactGmailConfig, type GmailConfig, type GmailConfigRedacted } from './config.ts'\n\nexport interface GmailResourceState {\n type: string\n config: GmailConfigRedacted\n}\n\nexport class GmailResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.GMAIL\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 86_400\n readonly prompt: string = GMAIL_PROMPT\n readonly writePrompt: string = GMAIL_WRITE_PROMPT\n readonly config: GmailConfig\n readonly accessor: GmailAccessor\n\n constructor(config: GmailConfig) {\n super()\n this.config = config\n const tm = new TokenManager(config)\n this.accessor = new GmailAccessor({ tokenManager: tm })\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 GMAIL_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return GMAIL_VFS_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return gmailRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return gmailReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return gmailStat(this.accessor, p, this.index)\n }\n\n async fingerprint(p: PathSpec): Promise<string | null> {\n const lookup = await this.index.get(p.original)\n return lookup.entry?.remoteTime ?? null\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return gmailResolveGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<GmailResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactGmailConfig(this.config),\n })\n }\n\n loadState(_state: GmailResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQA,IAAM,gBAAN,cAA4B,aAAiC;AAAA,EACzD,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB,cAAsB;AAAA,EACtB;AAAA,EACA;AAAA,EAET,YAAY,QAAqB;AAC/B,UAAM;AACN,SAAK,SAAS;AACd,UAAM,KAAK,IAAI,aAAa,MAAM;AAClC,SAAK,WAAW,IAAI,cAAc,EAAE,cAAc,GAAG,CAAC;AAAA,EACxD;AAAA,EAEA,OAAsB;AACpB,WAAO,QAAQ,QAAQ;AAAA,EACzB;AAAA,E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
|
4
|
+
} from "./chunk-TURD42QO.js";
|
|
5
5
|
import {
|
|
6
6
|
assertHfRepoId,
|
|
7
7
|
redactHfRepoConfig
|
|
@@ -47,4 +47,4 @@ export {
|
|
|
47
47
|
HF_DATASETS_PROMPT,
|
|
48
48
|
HfDatasetsResource
|
|
49
49
|
};
|
|
50
|
-
//# sourceMappingURL=chunk-
|
|
50
|
+
//# sourceMappingURL=chunk-N5FSLVKO.js.map
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "@struktoai/mirage-core";
|
|
21
21
|
var NotionResource = class extends BaseResource {
|
|
22
22
|
kind = ResourceName.NOTION;
|
|
23
|
-
|
|
23
|
+
cachesReads = true;
|
|
24
24
|
indexTtl = 600;
|
|
25
25
|
prompt = NOTION_PROMPT;
|
|
26
26
|
writePrompt = NOTION_WRITE_PROMPT;
|
|
@@ -84,4 +84,4 @@ var NotionResource = class extends BaseResource {
|
|
|
84
84
|
export {
|
|
85
85
|
NotionResource
|
|
86
86
|
};
|
|
87
|
-
//# sourceMappingURL=chunk-
|
|
87
|
+
//# sourceMappingURL=chunk-NOHWIBRX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/notion/notion.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 BaseResource,\n type FileStat,\n HttpNotionTransport,\n NOTION_COMMANDS,\n NOTION_PROMPT,\n NOTION_VFS_OPS,\n NOTION_WRITE_PROMPT,\n NotionAccessor,\n notionRead,\n notionReaddir,\n notionStat,\n PathSpec,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n resolveNotionGlob,\n} from '@struktoai/mirage-core'\nimport { redactNotionConfig, type NotionConfig, type NotionConfigRedacted } from './config.ts'\n\nexport interface NotionResourceState {\n type: string\n config: NotionConfigRedacted\n}\n\nexport class NotionResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.NOTION\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 600\n readonly prompt: string = NOTION_PROMPT\n readonly writePrompt: string = NOTION_WRITE_PROMPT\n readonly config: NotionConfig\n readonly accessor: NotionAccessor\n\n constructor(config: NotionConfig) {\n super()\n this.config = config\n const transportOpts: { apiKey: string; baseUrl?: string } = { apiKey: config.apiKey }\n if (config.baseUrl !== undefined) transportOpts.baseUrl = config.baseUrl\n this.accessor = new NotionAccessor(new HttpNotionTransport(transportOpts))\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 NOTION_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return NOTION_VFS_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return notionRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return notionReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return notionStat(this.accessor, p, this.index)\n }\n\n async fingerprint(p: PathSpec): Promise<string | null> {\n const lookup = await this.index.get(p.original)\n return lookup.entry?.remoteTime ?? null\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return resolveNotionGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<NotionResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactNotionConfig(this.config),\n })\n }\n\n loadState(_state: NotionResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,OACK;AAQA,IAAM,iBAAN,cAA6B,aAAiC;AAAA,EAC1D,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB,cAAsB;AAAA,EACtB;AAAA,EACA;AAAA,EAET,YAAY,QAAsB;AAChC,UAAM;AACN,SAAK,SAAS;AACd,UAAM,gBAAsD,EAAE,QAAQ,OAAO,OAAO;AACpF,QAAI,OAAO,YAAY,OAAW,eAAc,UAAU,OAAO;AACjE,SAAK,WAAW,IAAI,eAAe,IAAI,oBAAoB,aAAa,CAAC;AAAA,EAC3E;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;AAAA,EACT;AAAA,EAEA,SAAS,GAAkC;AACzC,WAAO,WAAW,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EAChD;AAAA,EAEA,QAAQ,GAAgC;AACtC,WAAO,cAAc,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EACnD;AAAA,EAEA,KAAK,GAAgC;AACnC,WAAO,WAAW,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EAChD;AAAA,EAEA,MAAM,YAAY,GAAqC;AACrD,UAAM,SAAS,MAAM,KAAK,MAAM,IAAI,EAAE,QAAQ;AAC9C,WAAO,OAAO,OAAO,cAAc;AAAA,EACrC;AAAA,EAEA,KAAK,OAA4B,SAAS,IAAyB;AACjE,UAAM,YACJ,WAAW,KACP,MAAM;AAAA,MAAI,CAAC,MACT,EAAE,WAAW,KACT,IACA,IAAI,SAAS;AAAA,QACX,UAAU,EAAE;AAAA,QACZ,WAAW,EAAE;AAAA,QACb,GAAI,EAAE,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ;AAAA,MACF,CAAC;AAAA,IACP,IACA;AACN,WAAO,kBAAkB,KAAK,UAAU,WAAW,KAAK,KAAK;AAAA,EAC/D;AAAA,EAEA,WAAyC;AACvC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,mBAAmB,KAAK,MAAM;AAAA,IACxC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA4C;AACpD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "@struktoai/mirage-core";
|
|
20
20
|
var GDriveResource = class extends BaseResource {
|
|
21
21
|
kind = ResourceName.GDRIVE;
|
|
22
|
-
|
|
22
|
+
cachesReads = true;
|
|
23
23
|
indexTtl = 86400;
|
|
24
24
|
prompt = GDRIVE_PROMPT;
|
|
25
25
|
config;
|
|
@@ -85,4 +85,4 @@ var GDriveResource = class extends BaseResource {
|
|
|
85
85
|
export {
|
|
86
86
|
GDriveResource
|
|
87
87
|
};
|
|
88
|
-
//# sourceMappingURL=chunk-
|
|
88
|
+
//# sourceMappingURL=chunk-QCZ2XUKH.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 {\n BaseResource,\n type FileStat,\n GDRIVE_COMMANDS,\n GDRIVE_PROMPT,\n GDRIVE_VFS_OPS,\n GDriveAccessor,\n PathSpec,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n TokenManager,\n gdriveRead,\n gdriveReaddir,\n gdriveResolveGlob,\n gdriveStat,\n} from '@struktoai/mirage-core'\nimport { redactGDriveConfig, type GDriveConfig, type GDriveConfigRedacted } from './config.ts'\n\nexport interface GDriveResourceState {\n type: string\n config: GDriveConfigRedacted\n}\n\nexport class GDriveResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.GDRIVE\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 86_400\n readonly prompt: string = GDRIVE_PROMPT\n readonly config: GDriveConfig\n readonly accessor: GDriveAccessor\n\n constructor(config: GDriveConfig) {\n super()\n this.config = config\n const tm = new TokenManager({\n clientId: config.clientId,\n clientSecret: config.clientSecret,\n refreshToken: config.refreshToken,\n })\n this.accessor = new GDriveAccessor({ tokenManager: tm })\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_VFS_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 async fingerprint(p: PathSpec): Promise<string | null> {\n const lookup = await this.index.get(p.original)\n return lookup.entry?.remoteTime ?? null\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n 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;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQA,IAAM,iBAAN,cAA6B,aAAiC;AAAA,EAC1D,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EAET,YAAY,QAAsB;AAChC,UAAM;AACN,SAAK,SAAS;AACd,UAAM,KAAK,IAAI,aAAa;AAAA,MAC1B,UAAU,OAAO;AAAA,MACjB,cAAc,OAAO;AAAA,MACrB,cAAc,OAAO;AAAA,IACvB,CAAC;AACD,SAAK,WAAW,IAAI,eAAe,EAAE,cAAc,GAAG,CAAC;AAAA,EACzD;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;AAAA,EACT;AAAA,EAEA,SAAS,GAAkC;AACzC,WAAO,WAAW,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EAChD;AAAA,EAEA,QAAQ,GAAgC;AACtC,WAAO,cAAc,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EACnD;AAAA,EAEA,KAAK,GAAgC;AACnC,WAAO,WAAW,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EAChD;AAAA,EAEA,MAAM,YAAY,GAAqC;AACrD,UAAM,SAAS,MAAM,KAAK,MAAM,IAAI,EAAE,QAAQ;AAC9C,WAAO,OAAO,OAAO,cAAc;AAAA,EACrC;AAAA,EAEA,KAAK,OAA4B,SAAS,IAAyB;AACjE,UAAM,YACJ,WAAW,KACP,MAAM;AAAA,MAAI,CAAC,MACT,EAAE,WAAW,KACT,IACA,IAAI,SAAS;AAAA,QACX,UAAU,EAAE;AAAA,QACZ,WAAW,EAAE;AAAA,QACb,GAAI,EAAE,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ;AAAA,MACF,CAAC;AAAA,IACP,IACA;AACN,WAAO,kBAAkB,KAAK,UAAU,WAAW,KAAK,KAAK;AAAA,EAC/D;AAAA,EAEA,WAAyC;AACvC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,mBAAmB,KAAK,MAAM;AAAA,IACxC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA4C;AACpD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-OHROA3FQ.js";
|
|
5
5
|
import {
|
|
6
6
|
S3Resource
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TA3WMOMU.js";
|
|
8
8
|
|
|
9
9
|
// src/resource/qingstor/qingstor.ts
|
|
10
10
|
import {
|
|
@@ -54,4 +54,4 @@ export {
|
|
|
54
54
|
QINGSTOR_PROMPT,
|
|
55
55
|
QingStorResource
|
|
56
56
|
};
|
|
57
|
-
//# sourceMappingURL=chunk-
|
|
57
|
+
//# sourceMappingURL=chunk-QQBJC2FQ.js.map
|
|
@@ -87,7 +87,7 @@ async function resolveAuth(config) {
|
|
|
87
87
|
}
|
|
88
88
|
var DatabricksVolumeResource = class _DatabricksVolumeResource extends BaseResource {
|
|
89
89
|
kind = ResourceName.DATABRICKS_VOLUME;
|
|
90
|
-
|
|
90
|
+
cachesReads = true;
|
|
91
91
|
indexTtl = 600;
|
|
92
92
|
prompt = DATABRICKS_VOLUME_PROMPT;
|
|
93
93
|
config;
|
|
@@ -213,4 +213,4 @@ export {
|
|
|
213
213
|
loadDatabricksProfile,
|
|
214
214
|
DatabricksVolumeResource
|
|
215
215
|
};
|
|
216
|
-
//# sourceMappingURL=chunk-
|
|
216
|
+
//# sourceMappingURL=chunk-RNQN2FOU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/databricks_volume/databricks_volume.ts","../src/resource/databricks_volume/config.ts","../src/resource/databricks_volume/profile.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 BaseResource,\n DATABRICKS_VOLUME_COMMANDS,\n DATABRICKS_VOLUME_OPS,\n DATABRICKS_VOLUME_PROMPT,\n DatabricksVolumeAccessor,\n databricksVolumeCopy,\n databricksVolumeCreate,\n databricksVolumeExists,\n databricksVolumeFind,\n databricksVolumeMkdir,\n databricksVolumeRangeRead,\n databricksVolumeRead,\n databricksVolumeReadStream,\n databricksVolumeReaddir,\n databricksVolumeRename,\n databricksVolumeRmRecursive,\n databricksVolumeRmdir,\n databricksVolumeStat,\n databricksVolumeUnlink,\n databricksVolumeWrite,\n type FileStat,\n type FindOptions,\n PathSpec,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n resolveDatabricksVolumeGlob,\n} from '@struktoai/mirage-core'\nimport {\n redactDatabricksVolumeConfig,\n type DatabricksVolumeConfig,\n type DatabricksVolumeConfigRedacted,\n} from './config.ts'\nimport { loadDatabricksProfile } from './profile.ts'\n\nexport interface DatabricksVolumeResourceState {\n type: string\n config: DatabricksVolumeConfigRedacted\n}\n\nasync function resolveAuth(config: DatabricksVolumeConfig): Promise<[string, string]> {\n let host = config.host ?? process.env.DATABRICKS_HOST\n let token = config.token ?? process.env.DATABRICKS_TOKEN\n if (host === undefined || host === '' || token === undefined || token === '') {\n const profileName = config.profile ?? process.env.DATABRICKS_CONFIG_PROFILE ?? 'DEFAULT'\n const profile = await loadDatabricksProfile(profileName)\n host = host !== undefined && host !== '' ? host : profile.host\n token = token !== undefined && token !== '' ? token : profile.token\n }\n if (host === undefined || host === '' || token === undefined || token === '') {\n throw new Error(\n 'databricks_volume: missing credentials; set host/token in the config, ' +\n 'DATABRICKS_HOST/DATABRICKS_TOKEN env vars, or a ~/.databrickscfg profile',\n )\n }\n return [host, token]\n}\n\nexport class DatabricksVolumeResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.DATABRICKS_VOLUME\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 600\n readonly prompt: string = DATABRICKS_VOLUME_PROMPT\n readonly config: DatabricksVolumeConfig\n readonly accessor: DatabricksVolumeAccessor\n readonly opsMap: Record<string, unknown> = {\n read_bytes: databricksVolumeRead,\n write: databricksVolumeWrite,\n readdir: databricksVolumeReaddir,\n stat: databricksVolumeStat,\n read_stream: databricksVolumeReadStream,\n range_read: databricksVolumeRangeRead,\n exists: databricksVolumeExists,\n create: databricksVolumeCreate,\n unlink: databricksVolumeUnlink,\n mkdir: databricksVolumeMkdir,\n rmdir: databricksVolumeRmdir,\n copy: databricksVolumeCopy,\n rename: databricksVolumeRename,\n rm_recursive: databricksVolumeRmRecursive,\n }\n\n private constructor(config: DatabricksVolumeConfig, accessor: DatabricksVolumeAccessor) {\n super()\n this.config = config\n this.accessor = accessor\n }\n\n static async create(config: DatabricksVolumeConfig): Promise<DatabricksVolumeResource> {\n const [host, token] = await resolveAuth(config)\n const accessor = new DatabricksVolumeAccessor(config, host, token)\n return new DatabricksVolumeResource(config, accessor)\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 DATABRICKS_VOLUME_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return DATABRICKS_VOLUME_OPS\n }\n\n streamPath(p: PathSpec): AsyncIterable<Uint8Array> {\n return databricksVolumeReadStream(this.accessor, p)\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return databricksVolumeRead(this.accessor, p)\n }\n\n writeFile(p: PathSpec, data: Uint8Array): Promise<void> {\n return databricksVolumeWrite(this.accessor, p, data)\n }\n\n async appendFile(p: PathSpec, data: Uint8Array): Promise<void> {\n let existing: Uint8Array\n try {\n existing = await databricksVolumeRead(this.accessor, p)\n } catch (err) {\n if ((err as { code?: string } | null)?.code === 'ENOENT') {\n existing = new Uint8Array()\n } else {\n throw err\n }\n }\n const merged = new Uint8Array(existing.byteLength + data.byteLength)\n merged.set(existing, 0)\n merged.set(data, existing.byteLength)\n await databricksVolumeWrite(this.accessor, p, merged)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return databricksVolumeReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return databricksVolumeStat(this.accessor, p)\n }\n\n exists(p: PathSpec): Promise<boolean> {\n return databricksVolumeExists(this.accessor, p)\n }\n\n mkdir(p: PathSpec): Promise<void> {\n return databricksVolumeMkdir(this.accessor, p, undefined, true)\n }\n\n rmdir(p: PathSpec): Promise<void> {\n return databricksVolumeRmdir(this.accessor, p)\n }\n\n unlink(p: PathSpec): Promise<void> {\n return databricksVolumeUnlink(this.accessor, p)\n }\n\n rename(src: PathSpec, dst: PathSpec): Promise<void> {\n return databricksVolumeRename(this.accessor, src, dst)\n }\n\n copy(src: PathSpec, dst: PathSpec): Promise<void> {\n return databricksVolumeCopy(this.accessor, src, dst)\n }\n\n async rmR(p: PathSpec): Promise<void> {\n await databricksVolumeRmRecursive(this.accessor, p)\n }\n\n find(p: PathSpec, options: FindOptions = {}): Promise<string[]> {\n return databricksVolumeFind(this.accessor, p, options, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective = prefix\n ? paths.map((p) =>\n p.prefix\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return resolveDatabricksVolumeGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<DatabricksVolumeResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactDatabricksVolumeConfig(this.config),\n })\n }\n\n loadState(_state: DatabricksVolumeResourceState): 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\nexport {\n DatabricksVolumeConfigSchema,\n normalizeDatabricksVolumeConfig,\n redactDatabricksVolumeConfig,\n type DatabricksVolumeConfig,\n type DatabricksVolumeConfigRedacted,\n} from '@struktoai/mirage-core'\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 { readFile } from 'node:fs/promises'\nimport { homedir } from 'node:os'\nimport { join } from 'node:path'\n\nexport interface DatabricksProfile {\n host?: string\n token?: string\n}\n\nexport function parseDatabricksCfg(content: string, profile: string): DatabricksProfile {\n const result: DatabricksProfile = {}\n let inSection = false\n for (const rawLine of content.split('\\n')) {\n const line = rawLine.trim()\n if (line === '' || line.startsWith('#') || line.startsWith(';')) continue\n if (line.startsWith('[') && line.endsWith(']')) {\n inSection = line.slice(1, -1).trim() === profile\n continue\n }\n if (!inSection) continue\n const eq = line.indexOf('=')\n if (eq === -1) continue\n const key = line.slice(0, eq).trim()\n const value = line.slice(eq + 1).trim()\n if (key === 'host') result.host = value\n if (key === 'token') result.token = value\n }\n return result\n}\n\nexport async function loadDatabricksProfile(profile: string): Promise<DatabricksProfile> {\n const cfgPath = process.env.DATABRICKS_CONFIG_FILE ?? join(homedir(), '.databrickscfg')\n let content: string\n try {\n content = await readFile(cfgPath, 'utf-8')\n } catch (err) {\n if ((err as { code?: string } | null)?.code === 'ENOENT') return {}\n throw err\n }\n return parseDatabricksCfg(content, profile)\n}\n"],"mappings":";AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AA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