@struktoai/mirage-browser 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-GMNRT7BJ.js +8 -0
- package/dist/backblaze-O6CLR73B.js +8 -0
- package/dist/{box-VJSE5N7P.js → box-GXWDWZRN.js} +2 -2
- package/dist/ceph-SM7MXDAY.js +8 -0
- package/dist/{chunk-SBAUYZJB.js → chunk-2AEAISO2.js} +2 -2
- package/dist/chunk-2AEAISO2.js.map +1 -0
- package/dist/{chunk-6K57U6CM.js → chunk-4NLXLDMV.js} +2 -2
- package/dist/chunk-4NLXLDMV.js.map +1 -0
- package/dist/{chunk-D3JDGGKO.js → chunk-57QQAM7V.js} +2 -2
- package/dist/{chunk-YEDSFMWK.js → chunk-6YP3B7UK.js} +2 -2
- package/dist/{chunk-EH2BN4JC.js → chunk-BIIG7ZAQ.js} +2 -2
- package/dist/chunk-BIIG7ZAQ.js.map +1 -0
- package/dist/{chunk-INLL7LRM.js → chunk-BJHHL4UT.js} +2 -2
- package/dist/chunk-BJHHL4UT.js.map +1 -0
- package/dist/{chunk-JVTKE6DB.js → chunk-CGZGX2GO.js} +2 -2
- package/dist/chunk-CGZGX2GO.js.map +1 -0
- package/dist/{chunk-MO5DGX42.js → chunk-CNDGXKMU.js} +2 -2
- package/dist/{chunk-HGSTRD7H.js → chunk-DA5EW34P.js} +2 -2
- package/dist/chunk-DA5EW34P.js.map +1 -0
- package/dist/{chunk-RD7ED27I.js → chunk-DFHFILVF.js} +2 -2
- package/dist/chunk-DFHFILVF.js.map +1 -0
- package/dist/{chunk-CAKSQ2LV.js → chunk-DHZMC42C.js} +2 -2
- package/dist/{chunk-72GY5B23.js → chunk-DVXOMWD4.js} +2 -2
- package/dist/{chunk-WZ53HLH6.js → chunk-F5QWZ7GM.js} +2 -2
- package/dist/{chunk-CO4FMKOF.js → chunk-G26SGOFR.js} +2 -2
- package/dist/{chunk-D6HF462C.js → chunk-HXQ7HDA6.js} +2 -2
- package/dist/chunk-HXQ7HDA6.js.map +1 -0
- package/dist/{chunk-RJ5FBBL6.js → chunk-J7PLA5S3.js} +2 -2
- package/dist/{chunk-32VC36P4.js → chunk-K2S42IR4.js} +2 -2
- package/dist/{chunk-JCS5EG5A.js → chunk-KNJKYCTA.js} +2 -2
- package/dist/chunk-KNJKYCTA.js.map +1 -0
- package/dist/{chunk-T43CZ3IZ.js → chunk-KTE5PB2D.js} +2 -2
- package/dist/chunk-KTE5PB2D.js.map +1 -0
- package/dist/{chunk-SJB2KXDM.js → chunk-KV2DM5H6.js} +136 -129
- package/dist/chunk-KV2DM5H6.js.map +1 -0
- package/dist/{chunk-EUKHGXCE.js → chunk-LSURHXZH.js} +2 -2
- package/dist/{chunk-GHKX2BA3.js → chunk-NLBT6TBM.js} +2 -2
- package/dist/{chunk-RJ4RR3BR.js → chunk-NWZNQ3RC.js} +2 -2
- package/dist/{chunk-TPFH5V4D.js → chunk-OSMEXGRN.js} +2 -2
- package/dist/chunk-OSMEXGRN.js.map +1 -0
- package/dist/{chunk-N43C6XFP.js → chunk-PV53AX35.js} +2 -2
- package/dist/chunk-PV53AX35.js.map +1 -0
- package/dist/{chunk-63GZEZW4.js → chunk-QLLRQNOJ.js} +2 -2
- package/dist/{chunk-WEJGUCCL.js → chunk-ROHDW6KT.js} +2 -2
- package/dist/{chunk-XFREXNA2.js → chunk-RQ273N5K.js} +2 -2
- package/dist/chunk-RQ273N5K.js.map +1 -0
- package/dist/{chunk-UZWJ462U.js → chunk-SOF74I3T.js} +2 -2
- package/dist/chunk-SOF74I3T.js.map +1 -0
- package/dist/{chunk-BUXWUKN7.js → chunk-TQ6VRUEI.js} +2 -2
- package/dist/chunk-TQ6VRUEI.js.map +1 -0
- package/dist/{chunk-ATLYBQSC.js → chunk-X2CCEHOR.js} +2 -2
- package/dist/chunk-X2CCEHOR.js.map +1 -0
- package/dist/{chunk-RZRXEXHM.js → chunk-XBOJZZRT.js} +2 -2
- package/dist/chunk-XBOJZZRT.js.map +1 -0
- package/dist/{chunk-4YJMDF2S.js → chunk-XYKNXGPR.js} +2 -2
- package/dist/chunk-XYKNXGPR.js.map +1 -0
- package/dist/digitalocean-XFH2V2A3.js +8 -0
- package/dist/discord-OQMSHM3L.js +7 -0
- package/dist/{dropbox-GI273OVA.js → dropbox-IAOKM7G5.js} +2 -2
- package/dist/gcs-JYZB6CVP.js +8 -0
- package/dist/{gdocs-EI2EFVKG.js → gdocs-PHKQGLZL.js} +2 -2
- package/dist/{gdrive-62HD67IP.js → gdrive-4JQLGOOP.js} +2 -2
- package/dist/github-DU7Z4RSU.js +7 -0
- package/dist/{github_ci-7P7VGBKM.js → github_ci-XSAJDNXC.js} +2 -2
- package/dist/{gmail-B7HXHZ7D.js → gmail-DEQP2M7T.js} +2 -2
- package/dist/{gsheets-OTBW2JWG.js → gsheets-KCIHSMOK.js} +2 -2
- package/dist/{gslides-MXSR4HRY.js → gslides-2KBUKKM5.js} +2 -2
- package/dist/index.d.ts +18 -18
- package/dist/index.js +71 -67
- package/dist/index.js.map +1 -1
- package/dist/langfuse-FNCMKFSL.js +7 -0
- package/dist/linear-XTFO4WKD.js +7 -0
- package/dist/minio-NGPBAJY3.js +8 -0
- package/dist/mongodb-PGOX6QSY.js +7 -0
- package/dist/notion-HYYNQ7KI.js +7 -0
- package/dist/oci-EGDBSMLM.js +8 -0
- package/dist/opfs-5WGXB5OG.js +7 -0
- package/dist/postgres-5HYED4AC.js +7 -0
- package/dist/qingstor-2T4Y6MEG.js +8 -0
- package/dist/r2-3B45S2KV.js +8 -0
- package/dist/{s3-GD2WKLWR.js → s3-GI7SDKGR.js} +2 -2
- package/dist/scaleway-ICCXVAY6.js +8 -0
- package/dist/seaweedfs-MF77EC33.js +8 -0
- package/dist/slack-6LGQERIU.js +7 -0
- package/dist/supabase-XTOVMHXU.js +8 -0
- package/dist/tencent-FXFKSOTN.js +8 -0
- package/dist/trello-DZK4NEVY.js +7 -0
- package/dist/wasabi-KVE2B6RB.js +8 -0
- package/package.json +2 -2
- package/dist/aliyun-F2ORS3KZ.js +0 -8
- package/dist/backblaze-HOVWPSV7.js +0 -8
- package/dist/ceph-CQKQ4NWW.js +0 -8
- package/dist/chunk-4YJMDF2S.js.map +0 -1
- package/dist/chunk-6K57U6CM.js.map +0 -1
- package/dist/chunk-ATLYBQSC.js.map +0 -1
- package/dist/chunk-BUXWUKN7.js.map +0 -1
- package/dist/chunk-D6HF462C.js.map +0 -1
- package/dist/chunk-EH2BN4JC.js.map +0 -1
- package/dist/chunk-HGSTRD7H.js.map +0 -1
- package/dist/chunk-INLL7LRM.js.map +0 -1
- package/dist/chunk-JCS5EG5A.js.map +0 -1
- package/dist/chunk-JVTKE6DB.js.map +0 -1
- package/dist/chunk-N43C6XFP.js.map +0 -1
- package/dist/chunk-RD7ED27I.js.map +0 -1
- package/dist/chunk-RZRXEXHM.js.map +0 -1
- package/dist/chunk-SBAUYZJB.js.map +0 -1
- package/dist/chunk-SJB2KXDM.js.map +0 -1
- package/dist/chunk-T43CZ3IZ.js.map +0 -1
- package/dist/chunk-TPFH5V4D.js.map +0 -1
- package/dist/chunk-UZWJ462U.js.map +0 -1
- package/dist/chunk-XFREXNA2.js.map +0 -1
- package/dist/digitalocean-KC7VIWZK.js +0 -8
- package/dist/discord-W3DSEXKN.js +0 -7
- package/dist/gcs-WRQTU27E.js +0 -8
- package/dist/github-SWLYD3LS.js +0 -7
- package/dist/langfuse-FWKU6E3F.js +0 -7
- package/dist/linear-SHVG3XVT.js +0 -7
- package/dist/minio-246KOHBJ.js +0 -8
- package/dist/mongodb-2ITJUDCF.js +0 -7
- package/dist/notion-BOBBSJSG.js +0 -7
- package/dist/oci-T7VREPQW.js +0 -8
- package/dist/opfs-3XNAXR5B.js +0 -7
- package/dist/postgres-CK4HWZSL.js +0 -7
- package/dist/qingstor-WIC27LS3.js +0 -8
- package/dist/r2-EAX6KHEI.js +0 -8
- package/dist/scaleway-OVFRZBKW.js +0 -8
- package/dist/seaweedfs-EOJVO432.js +0 -8
- package/dist/slack-RNXMU5OC.js +0 -7
- package/dist/supabase-VSUNLIJ6.js +0 -8
- package/dist/tencent-YYM5WUVU.js +0 -8
- package/dist/trello-MNR3VPTT.js +0 -7
- package/dist/wasabi-K5ANTZ2C.js +0 -8
- /package/dist/{aliyun-F2ORS3KZ.js.map → aliyun-GMNRT7BJ.js.map} +0 -0
- /package/dist/{backblaze-HOVWPSV7.js.map → backblaze-O6CLR73B.js.map} +0 -0
- /package/dist/{box-VJSE5N7P.js.map → box-GXWDWZRN.js.map} +0 -0
- /package/dist/{ceph-CQKQ4NWW.js.map → ceph-SM7MXDAY.js.map} +0 -0
- /package/dist/{chunk-D3JDGGKO.js.map → chunk-57QQAM7V.js.map} +0 -0
- /package/dist/{chunk-YEDSFMWK.js.map → chunk-6YP3B7UK.js.map} +0 -0
- /package/dist/{chunk-MO5DGX42.js.map → chunk-CNDGXKMU.js.map} +0 -0
- /package/dist/{chunk-CAKSQ2LV.js.map → chunk-DHZMC42C.js.map} +0 -0
- /package/dist/{chunk-72GY5B23.js.map → chunk-DVXOMWD4.js.map} +0 -0
- /package/dist/{chunk-WZ53HLH6.js.map → chunk-F5QWZ7GM.js.map} +0 -0
- /package/dist/{chunk-CO4FMKOF.js.map → chunk-G26SGOFR.js.map} +0 -0
- /package/dist/{chunk-RJ5FBBL6.js.map → chunk-J7PLA5S3.js.map} +0 -0
- /package/dist/{chunk-32VC36P4.js.map → chunk-K2S42IR4.js.map} +0 -0
- /package/dist/{chunk-EUKHGXCE.js.map → chunk-LSURHXZH.js.map} +0 -0
- /package/dist/{chunk-GHKX2BA3.js.map → chunk-NLBT6TBM.js.map} +0 -0
- /package/dist/{chunk-RJ4RR3BR.js.map → chunk-NWZNQ3RC.js.map} +0 -0
- /package/dist/{chunk-63GZEZW4.js.map → chunk-QLLRQNOJ.js.map} +0 -0
- /package/dist/{chunk-WEJGUCCL.js.map → chunk-ROHDW6KT.js.map} +0 -0
- /package/dist/{digitalocean-KC7VIWZK.js.map → digitalocean-XFH2V2A3.js.map} +0 -0
- /package/dist/{discord-W3DSEXKN.js.map → discord-OQMSHM3L.js.map} +0 -0
- /package/dist/{dropbox-GI273OVA.js.map → dropbox-IAOKM7G5.js.map} +0 -0
- /package/dist/{gcs-WRQTU27E.js.map → gcs-JYZB6CVP.js.map} +0 -0
- /package/dist/{gdocs-EI2EFVKG.js.map → gdocs-PHKQGLZL.js.map} +0 -0
- /package/dist/{gdrive-62HD67IP.js.map → gdrive-4JQLGOOP.js.map} +0 -0
- /package/dist/{github-SWLYD3LS.js.map → github-DU7Z4RSU.js.map} +0 -0
- /package/dist/{github_ci-7P7VGBKM.js.map → github_ci-XSAJDNXC.js.map} +0 -0
- /package/dist/{gmail-B7HXHZ7D.js.map → gmail-DEQP2M7T.js.map} +0 -0
- /package/dist/{gsheets-OTBW2JWG.js.map → gsheets-KCIHSMOK.js.map} +0 -0
- /package/dist/{gslides-MXSR4HRY.js.map → gslides-2KBUKKM5.js.map} +0 -0
- /package/dist/{langfuse-FWKU6E3F.js.map → langfuse-FNCMKFSL.js.map} +0 -0
- /package/dist/{linear-SHVG3XVT.js.map → linear-XTFO4WKD.js.map} +0 -0
- /package/dist/{minio-246KOHBJ.js.map → minio-NGPBAJY3.js.map} +0 -0
- /package/dist/{mongodb-2ITJUDCF.js.map → mongodb-PGOX6QSY.js.map} +0 -0
- /package/dist/{notion-BOBBSJSG.js.map → notion-HYYNQ7KI.js.map} +0 -0
- /package/dist/{oci-T7VREPQW.js.map → oci-EGDBSMLM.js.map} +0 -0
- /package/dist/{opfs-3XNAXR5B.js.map → opfs-5WGXB5OG.js.map} +0 -0
- /package/dist/{postgres-CK4HWZSL.js.map → postgres-5HYED4AC.js.map} +0 -0
- /package/dist/{qingstor-WIC27LS3.js.map → qingstor-2T4Y6MEG.js.map} +0 -0
- /package/dist/{r2-EAX6KHEI.js.map → r2-3B45S2KV.js.map} +0 -0
- /package/dist/{s3-GD2WKLWR.js.map → s3-GI7SDKGR.js.map} +0 -0
- /package/dist/{scaleway-OVFRZBKW.js.map → scaleway-ICCXVAY6.js.map} +0 -0
- /package/dist/{seaweedfs-EOJVO432.js.map → seaweedfs-MF77EC33.js.map} +0 -0
- /package/dist/{slack-RNXMU5OC.js.map → slack-6LGQERIU.js.map} +0 -0
- /package/dist/{supabase-VSUNLIJ6.js.map → supabase-XTOVMHXU.js.map} +0 -0
- /package/dist/{tencent-YYM5WUVU.js.map → tencent-FXFKSOTN.js.map} +0 -0
- /package/dist/{trello-MNR3VPTT.js.map → trello-DZK4NEVY.js.map} +0 -0
- /package/dist/{wasabi-K5ANTZ2C.js.map → wasabi-KVE2B6RB.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/opfs/opfs.ts","../src/accessor/opfs.ts","../src/commands/builtin/opfs/index.ts","../src/core/opfs/read.ts","../src/core/opfs/utils.ts","../src/core/opfs/stat.ts","../src/commands/builtin/opfs/awk.ts","../src/core/opfs/stream.ts","../src/commands/builtin/opfs/base64_cmd.ts","../src/commands/builtin/opfs/basename.ts","../src/commands/builtin/opfs/cat/cat.ts","../src/commands/builtin/opfs/cmp.ts","../src/commands/builtin/opfs/column.ts","../src/commands/builtin/opfs/comm.ts","../src/commands/builtin/opfs/cp.ts","../src/core/opfs/copy.ts","../src/core/opfs/find.ts","../src/commands/builtin/opfs/csplit.ts","../src/core/opfs/write.ts","../src/commands/builtin/opfs/cut/cut.ts","../src/commands/builtin/opfs/diff.ts","../src/commands/builtin/opfs/dirname.ts","../src/commands/builtin/opfs/du.ts","../src/core/opfs/du.ts","../src/commands/builtin/opfs/expand.ts","../src/commands/builtin/opfs/file/file.ts","../src/commands/builtin/opfs/find.ts","../src/commands/builtin/opfs/fmt.ts","../src/commands/builtin/opfs/fold.ts","../src/commands/builtin/opfs/grep/grep.ts","../src/core/opfs/readdir.ts","../src/commands/builtin/opfs/gunzip.ts","../src/core/opfs/unlink.ts","../src/commands/builtin/opfs/gzip.ts","../src/commands/builtin/opfs/head/head.ts","../src/commands/builtin/opfs/iconv.ts","../src/commands/builtin/opfs/join.ts","../src/commands/builtin/opfs/jq.ts","../src/commands/builtin/opfs/ln.ts","../src/core/opfs/exists.ts","../src/commands/builtin/opfs/look.ts","../src/commands/builtin/opfs/ls/ls.ts","../src/commands/builtin/opfs/md5.ts","../src/commands/builtin/opfs/mkdir.ts","../src/core/opfs/mkdir.ts","../src/commands/builtin/opfs/mktemp.ts","../src/commands/builtin/opfs/mv.ts","../src/core/opfs/rename.ts","../src/commands/builtin/opfs/nl.ts","../src/commands/builtin/opfs/paste.ts","../src/commands/builtin/opfs/patch.ts","../src/commands/builtin/opfs/readlink.ts","../src/commands/builtin/opfs/realpath.ts","../src/commands/builtin/opfs/rev.ts","../src/commands/builtin/opfs/rg.ts","../src/commands/builtin/opfs/rm.ts","../src/core/opfs/rmdir.ts","../src/core/opfs/rm.ts","../src/commands/builtin/opfs/sed.ts","../src/commands/builtin/opfs/sha256sum.ts","../src/commands/builtin/opfs/shuf.ts","../src/commands/builtin/opfs/sort.ts","../src/commands/builtin/opfs/split.ts","../src/commands/builtin/opfs/stat/stat.ts","../src/commands/builtin/opfs/strings.ts","../src/commands/builtin/opfs/tac.ts","../src/commands/builtin/opfs/tail/tail.ts","../src/commands/builtin/opfs/tar.ts","../src/commands/builtin/opfs/tee.ts","../src/commands/builtin/opfs/touch.ts","../src/commands/builtin/opfs/tr.ts","../src/commands/builtin/opfs/tree.ts","../src/commands/builtin/opfs/tsort.ts","../src/commands/builtin/opfs/unexpand.ts","../src/commands/builtin/opfs/uniq.ts","../src/commands/builtin/opfs/unzip.ts","../src/commands/builtin/opfs/wc/wc.ts","../src/commands/builtin/opfs/xxd.ts","../src/commands/builtin/opfs/zcat.ts","../src/commands/builtin/opfs/zgrep.ts","../src/commands/builtin/opfs/zip_cmd.ts","../src/core/opfs/append.ts","../src/core/opfs/glob.ts","../src/core/opfs/constants.ts","../src/core/opfs/truncate.ts","../src/ops/opfs/append.ts","../src/ops/opfs/create.ts","../src/core/opfs/create.ts","../src/ops/opfs/mkdir.ts","../src/ops/opfs/read.ts","../src/ops/opfs/readdir.ts","../src/ops/opfs/rename.ts","../src/ops/opfs/rmdir.ts","../src/ops/opfs/stat.ts","../src/ops/opfs/truncate.ts","../src/ops/opfs/unlink.ts","../src/ops/opfs/write.ts","../src/ops/opfs/index.ts","../src/resource/opfs/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n type FileStat,\n type FindOptions,\n type PathSpec,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n lstripSlash,\n} from '@struktoai/mirage-core'\nimport { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { OPFS_COMMANDS } from '../../commands/builtin/opfs/index.ts'\nimport { appendBytes as appendCore } from '../../core/opfs/append.ts'\nimport { copy as copyCore } from '../../core/opfs/copy.ts'\nimport { du as duCore } from '../../core/opfs/du.ts'\nimport { exists as existsCore } from '../../core/opfs/exists.ts'\nimport { find as findCore, type FindOptions as OPFSFindOptions } from '../../core/opfs/find.ts'\nimport { resolveGlob as globCore } from '../../core/opfs/glob.ts'\nimport { mkdir as mkdirCore } from '../../core/opfs/mkdir.ts'\nimport { read as readCoreFn } from '../../core/opfs/read.ts'\nimport { readdir as readdirCore } from '../../core/opfs/readdir.ts'\nimport { rename as renameCore } from '../../core/opfs/rename.ts'\nimport { rmR as rmRCore } from '../../core/opfs/rm.ts'\nimport { rmdir as rmdirCore } from '../../core/opfs/rmdir.ts'\nimport { stat as statCore } from '../../core/opfs/stat.ts'\nimport { stream as streamCore } from '../../core/opfs/stream.ts'\nimport { truncate as truncateCore } from '../../core/opfs/truncate.ts'\nimport { unlink as unlinkCore } from '../../core/opfs/unlink.ts'\nimport { iterEntries, toWritableChunk } from '../../core/opfs/utils.ts'\nimport { writeBytes as writeCore } from '../../core/opfs/write.ts'\nimport { OPFS_OPS } from '../../ops/opfs/index.ts'\nimport { OPFS_PROMPT } from './prompt.ts'\n\nexport interface OPFSResourceOptions {\n root?: string\n}\n\nexport interface OPFSResourceState {\n type: string\n files: Record<string, Uint8Array>\n dirs: string[]\n}\n\nasync function walkFiles(\n dir: FileSystemDirectoryHandle,\n currentPath: string,\n files: Record<string, Uint8Array>,\n): Promise<void> {\n for await (const [name, handle] of iterEntries(dir)) {\n const childPath = currentPath === '' ? name : `${currentPath}/${name}`\n if (handle.kind === 'file') {\n const fh = await dir.getFileHandle(name, { create: false })\n const file = await fh.getFile()\n files[childPath] = new Uint8Array(await file.arrayBuffer())\n } else {\n const child = await dir.getDirectoryHandle(name, { create: false })\n await walkFiles(child, childPath, files)\n }\n }\n}\n\nasync function walkDirs(\n dir: FileSystemDirectoryHandle,\n currentPath: string,\n dirs: string[],\n): Promise<void> {\n for await (const [name, handle] of iterEntries(dir)) {\n if (handle.kind !== 'directory') continue\n const childPath = currentPath === '' ? `/${name}` : `${currentPath}/${name}`\n dirs.push(childPath)\n const child = await dir.getDirectoryHandle(name, { create: false })\n await walkDirs(child, childPath, dirs)\n }\n}\n\nasync function splitAndCreate(\n root: FileSystemDirectoryHandle,\n relativePath: string,\n): Promise<FileSystemDirectoryHandle> {\n let handle = root\n for (const seg of relativePath.split('/')) {\n if (seg === '' || seg === '.') continue\n handle = await handle.getDirectoryHandle(seg, { create: true })\n }\n return handle\n}\n\nexport class OPFSResource implements Resource {\n readonly kind = ResourceName.OPFS\n readonly prompt = OPFS_PROMPT\n readonly rootName: string\n readonly accessor: OPFSAccessor\n private rootHandle: FileSystemDirectoryHandle | null = null\n private openPromise: Promise<FileSystemDirectoryHandle> | null = null\n\n constructor(options: OPFSResourceOptions = {}) {\n this.rootName = options.root ?? ''\n this.accessor = new OPFSAccessor(this)\n }\n\n open(): Promise<void> {\n return this.ensureOpen().then(() => undefined)\n }\n\n close(): Promise<void> {\n this.rootHandle = null\n this.openPromise = null\n return Promise.resolve()\n }\n\n /**\n * Lazily resolve to a usable root handle. Memoizes `navigator.storage`\n * traversal so the resource self-initializes on first method call without\n * relying on an external orchestrator.\n */\n private ensureOpen(): Promise<FileSystemDirectoryHandle> {\n if (this.rootHandle !== null) return Promise.resolve(this.rootHandle)\n this.openPromise ??= (async () => {\n const origin = await navigator.storage.getDirectory()\n let handle = origin\n for (const seg of this.rootName.split('/')) {\n if (seg === '' || seg === '.') continue\n handle = await handle.getDirectoryHandle(seg, { create: true })\n }\n this.rootHandle = handle\n return handle\n })()\n return this.openPromise\n }\n\n requireHandle(): FileSystemDirectoryHandle {\n if (this.rootHandle === null) {\n throw new Error('OPFSResource is not open — call open() first')\n }\n return this.rootHandle\n }\n\n ops(): readonly RegisteredOp[] {\n return OPFS_OPS\n }\n\n commands(): readonly RegisteredCommand[] {\n return OPFS_COMMANDS\n }\n\n async *streamPath(p: PathSpec): AsyncIterable<Uint8Array> {\n await this.ensureOpen()\n yield* streamCore(this.accessor, p)\n }\n\n async readFile(p: PathSpec): Promise<Uint8Array> {\n await this.ensureOpen()\n return readCoreFn(this.accessor, p)\n }\n\n async writeFile(p: PathSpec, data: Uint8Array): Promise<void> {\n await this.ensureOpen()\n return writeCore(this.accessor, p, data)\n }\n\n async appendFile(p: PathSpec, data: Uint8Array): Promise<void> {\n await this.ensureOpen()\n return appendCore(this.accessor, p, data)\n }\n\n async readdir(p: PathSpec): Promise<string[]> {\n await this.ensureOpen()\n return readdirCore(this.accessor, p)\n }\n\n async stat(p: PathSpec): Promise<FileStat> {\n await this.ensureOpen()\n return statCore(this.accessor, p)\n }\n\n async exists(p: PathSpec): Promise<boolean> {\n await this.ensureOpen()\n return existsCore(this.accessor, p)\n }\n\n async mkdir(p: PathSpec, options?: { recursive?: boolean }): Promise<void> {\n await this.ensureOpen()\n return mkdirCore(this.accessor, p, options?.recursive === true)\n }\n\n async rmdir(p: PathSpec): Promise<void> {\n await this.ensureOpen()\n return rmdirCore(this.accessor, p)\n }\n\n async unlink(p: PathSpec): Promise<void> {\n await this.ensureOpen()\n return unlinkCore(this.accessor, p)\n }\n\n async rename(src: PathSpec, dst: PathSpec): Promise<void> {\n await this.ensureOpen()\n return renameCore(this.accessor, src, dst)\n }\n\n async truncate(p: PathSpec, length: number): Promise<void> {\n await this.ensureOpen()\n return truncateCore(this.accessor, p, length)\n }\n\n async copy(src: PathSpec, dst: PathSpec): Promise<void> {\n await this.ensureOpen()\n return copyCore(this.accessor, src, dst)\n }\n\n async rmR(p: PathSpec): Promise<void> {\n await this.ensureOpen()\n return rmRCore(this.accessor, p)\n }\n\n async du(p: PathSpec): Promise<number> {\n await this.ensureOpen()\n return duCore(this.accessor, p)\n }\n\n async find(p: PathSpec, options: FindOptions = {}): Promise<string[]> {\n await this.ensureOpen()\n return findCore(this.accessor, p, options as OPFSFindOptions)\n }\n\n async glob(paths: readonly PathSpec[]): Promise<PathSpec[]> {\n await this.ensureOpen()\n return globCore(this.accessor, paths)\n }\n\n async getState(): Promise<OPFSResourceState> {\n const handle = await this.ensureOpen()\n const files: Record<string, Uint8Array> = {}\n await walkFiles(handle, '', files)\n const dirs: string[] = []\n await walkDirs(handle, '', dirs)\n dirs.sort()\n return {\n type: this.kind,\n files,\n dirs,\n }\n }\n\n async loadState(state: OPFSResourceState): Promise<void> {\n const handle = await this.ensureOpen()\n for (const dir of state.dirs) {\n const rel = lstripSlash(dir)\n if (rel === '') continue\n await splitAndCreate(handle, rel)\n }\n for (const [rel, data] of Object.entries(state.files)) {\n const segs = rel.split('/').filter((s) => s !== '' && s !== '.')\n const fileName = segs.pop()\n if (fileName === undefined) continue\n let dir = handle\n for (const seg of segs) {\n dir = await dir.getDirectoryHandle(seg, { create: true })\n }\n const fh = await dir.getFileHandle(fileName, { create: true })\n const writable = await fh.createWritable()\n await writable.write(toWritableChunk(data))\n await writable.close()\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 { Accessor } from '@struktoai/mirage-core'\n\nexport interface OPFSHandleProvider {\n requireHandle(): FileSystemDirectoryHandle\n}\n\nexport class OPFSAccessor extends Accessor {\n private readonly provider: OPFSHandleProvider\n\n constructor(provider: OPFSHandleProvider) {\n super()\n this.provider = provider\n }\n\n get rootHandle(): FileSystemDirectoryHandle {\n return this.provider.requireHandle()\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 { makeFiletypeCommands, ResourceName, type RegisteredCommand } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { read as opfsRead } from '../../../core/opfs/read.ts'\nimport { stat as opfsStat } from '../../../core/opfs/stat.ts'\nimport { OPFS_AWK } from './awk.ts'\nimport { OPFS_BASE64 } from './base64_cmd.ts'\nimport { OPFS_BASENAME } from './basename.ts'\nimport { OPFS_CAT } from './cat/cat.ts'\nimport { OPFS_CMP } from './cmp.ts'\nimport { OPFS_COLUMN } from './column.ts'\nimport { OPFS_COMM } from './comm.ts'\nimport { OPFS_CP } from './cp.ts'\nimport { OPFS_CSPLIT } from './csplit.ts'\nimport { OPFS_CUT } from './cut/cut.ts'\nimport { OPFS_DIFF } from './diff.ts'\nimport { OPFS_DIRNAME } from './dirname.ts'\nimport { OPFS_DU } from './du.ts'\nimport { OPFS_EXPAND } from './expand.ts'\nimport { OPFS_FILE } from './file/file.ts'\nimport { OPFS_FIND } from './find.ts'\nimport { OPFS_FMT } from './fmt.ts'\nimport { OPFS_FOLD } from './fold.ts'\nimport { OPFS_GREP } from './grep/grep.ts'\nimport { OPFS_GUNZIP } from './gunzip.ts'\nimport { OPFS_GZIP } from './gzip.ts'\nimport { OPFS_HEAD } from './head/head.ts'\nimport { OPFS_ICONV } from './iconv.ts'\nimport { OPFS_JOIN } from './join.ts'\nimport { OPFS_JQ } from './jq.ts'\nimport { OPFS_LN } from './ln.ts'\nimport { OPFS_LOOK } from './look.ts'\nimport { OPFS_LS } from './ls/ls.ts'\nimport { OPFS_MD5 } from './md5.ts'\nimport { OPFS_MKDIR } from './mkdir.ts'\nimport { OPFS_MKTEMP } from './mktemp.ts'\nimport { OPFS_MV } from './mv.ts'\nimport { OPFS_NL } from './nl.ts'\nimport { OPFS_PASTE } from './paste.ts'\nimport { OPFS_PATCH } from './patch.ts'\nimport { OPFS_READLINK } from './readlink.ts'\nimport { OPFS_REALPATH } from './realpath.ts'\nimport { OPFS_REV } from './rev.ts'\nimport { OPFS_RG } from './rg.ts'\nimport { OPFS_RM } from './rm.ts'\nimport { OPFS_SED } from './sed.ts'\nimport { OPFS_SHA256SUM } from './sha256sum.ts'\nimport { OPFS_SHUF } from './shuf.ts'\nimport { OPFS_SORT } from './sort.ts'\nimport { OPFS_SPLIT } from './split.ts'\nimport { OPFS_STAT } from './stat/stat.ts'\nimport { OPFS_STRINGS } from './strings.ts'\nimport { OPFS_TAC } from './tac.ts'\nimport { OPFS_TAIL } from './tail/tail.ts'\nimport { OPFS_TAR } from './tar.ts'\nimport { OPFS_TEE } from './tee.ts'\nimport { OPFS_TOUCH } from './touch.ts'\nimport { OPFS_TR } from './tr.ts'\nimport { OPFS_TREE } from './tree.ts'\nimport { OPFS_TSORT } from './tsort.ts'\nimport { OPFS_UNEXPAND } from './unexpand.ts'\nimport { OPFS_UNIQ } from './uniq.ts'\nimport { OPFS_UNZIP } from './unzip.ts'\nimport { OPFS_WC } from './wc/wc.ts'\nimport { OPFS_XXD } from './xxd.ts'\nimport { OPFS_ZCAT } from './zcat.ts'\nimport { OPFS_ZGREP } from './zgrep.ts'\nimport { OPFS_ZIP } from './zip_cmd.ts'\n\nexport const OPFS_COMMANDS: readonly RegisteredCommand[] = [\n ...makeFiletypeCommands<OPFSAccessor>({\n resource: ResourceName.OPFS,\n readBytes: opfsRead,\n statEntry: opfsStat,\n }),\n ...OPFS_AWK,\n ...OPFS_BASE64,\n ...OPFS_BASENAME,\n ...OPFS_CAT,\n ...OPFS_CMP,\n ...OPFS_COLUMN,\n ...OPFS_COMM,\n ...OPFS_CP,\n ...OPFS_CSPLIT,\n ...OPFS_CUT,\n ...OPFS_DIFF,\n ...OPFS_DIRNAME,\n ...OPFS_DU,\n ...OPFS_EXPAND,\n ...OPFS_FILE,\n ...OPFS_FIND,\n ...OPFS_FMT,\n ...OPFS_FOLD,\n ...OPFS_GREP,\n ...OPFS_GUNZIP,\n ...OPFS_GZIP,\n ...OPFS_HEAD,\n ...OPFS_ICONV,\n ...OPFS_JOIN,\n ...OPFS_JQ,\n ...OPFS_LN,\n ...OPFS_LOOK,\n ...OPFS_LS,\n ...OPFS_MD5,\n ...OPFS_MKDIR,\n ...OPFS_MKTEMP,\n ...OPFS_MV,\n ...OPFS_NL,\n ...OPFS_PASTE,\n ...OPFS_PATCH,\n ...OPFS_READLINK,\n ...OPFS_REALPATH,\n ...OPFS_REV,\n ...OPFS_RG,\n ...OPFS_RM,\n ...OPFS_SED,\n ...OPFS_SHA256SUM,\n ...OPFS_SHUF,\n ...OPFS_SORT,\n ...OPFS_SPLIT,\n ...OPFS_STAT,\n ...OPFS_STRINGS,\n ...OPFS_TAC,\n ...OPFS_TAIL,\n ...OPFS_TAR,\n ...OPFS_TEE,\n ...OPFS_TOUCH,\n ...OPFS_TR,\n ...OPFS_TREE,\n ...OPFS_TSORT,\n ...OPFS_UNEXPAND,\n ...OPFS_UNIQ,\n ...OPFS_UNZIP,\n ...OPFS_WC,\n ...OPFS_XXD,\n ...OPFS_ZCAT,\n ...OPFS_ZGREP,\n ...OPFS_ZIP,\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, record, ResourceName } from '@struktoai/mirage-core'\nimport { enoent } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { isNotFound, resolveFileHandle } from './utils.ts'\n\nexport async function read(accessor: OPFSAccessor, path: PathSpec): Promise<Uint8Array> {\n const root = accessor.rootHandle\n const start = performance.now()\n const virtual = path.stripPrefix\n let handle: FileSystemFileHandle\n try {\n handle = await resolveFileHandle(root, virtual, { create: false })\n } catch (err) {\n if (isNotFound(err)) throw enoent(path)\n throw err\n }\n const file = await handle.getFile()\n const bytes = new Uint8Array(await file.arrayBuffer())\n record('read', virtual, ResourceName.OPFS, bytes.byteLength, start)\n return bytes\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 dirname(p: string): string {\n const i = p.lastIndexOf('/')\n if (i < 0) return ''\n if (i === 0) return '/'\n return p.slice(0, i)\n}\n\nexport function splitSegments(virtual: string): string[] {\n const parts: string[] = []\n for (const seg of virtual.split('/')) {\n if (seg === '' || seg === '.') continue\n if (seg === '..') {\n if (parts.length === 0) {\n throw new Error(`path escapes root: ${virtual}`)\n }\n parts.pop()\n continue\n }\n parts.push(seg)\n }\n return parts\n}\n\nexport async function resolveDirHandle(\n root: FileSystemDirectoryHandle,\n virtual: string,\n options: { create?: boolean } = {},\n): Promise<FileSystemDirectoryHandle> {\n const segs = splitSegments(virtual)\n let handle = root\n for (const seg of segs) {\n handle = await handle.getDirectoryHandle(seg, { create: options.create ?? false })\n }\n return handle\n}\n\nexport async function resolveFileHandle(\n root: FileSystemDirectoryHandle,\n virtual: string,\n options: { create?: boolean } = {},\n): Promise<FileSystemFileHandle> {\n const segs = splitSegments(virtual)\n const fileName = segs.pop()\n if (fileName === undefined) {\n throw new Error(`not a file: ${virtual}`)\n }\n let dir = root\n for (const seg of segs) {\n dir = await dir.getDirectoryHandle(seg, { create: options.create ?? false })\n }\n return dir.getFileHandle(fileName, { create: options.create ?? false })\n}\n\nexport async function resolveParentDirHandle(\n root: FileSystemDirectoryHandle,\n virtual: string,\n options: { create?: boolean } = {},\n): Promise<[FileSystemDirectoryHandle, string]> {\n const segs = splitSegments(virtual)\n const name = segs.pop()\n if (name === undefined) {\n throw new Error(`no parent directory: ${virtual}`)\n }\n let dir = root\n for (const seg of segs) {\n dir = await dir.getDirectoryHandle(seg, { create: options.create ?? false })\n }\n return [dir, name]\n}\n\nexport function isNotFound(err: unknown): boolean {\n if (err instanceof DOMException) {\n return err.name === 'NotFoundError'\n }\n return false\n}\n\nexport function isTypeMismatch(err: unknown): boolean {\n if (err instanceof DOMException) {\n return err.name === 'TypeMismatchError'\n }\n return false\n}\n\ninterface DirEntryIter {\n entries(): AsyncIterableIterator<[string, FileSystemHandle]>\n}\n\nexport function toWritableChunk(data: Uint8Array): Blob {\n const copy = new Uint8Array(data.byteLength)\n copy.set(data)\n return new Blob([copy])\n}\n\nexport async function* iterEntries(\n dir: FileSystemDirectoryHandle,\n): AsyncIterable<[string, FileSystemHandle]> {\n const iter = (dir as unknown as DirEntryIter).entries()\n for await (const [name, handle] of iter) {\n yield [name, handle]\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 { FileStat, FileType, guessType, type PathSpec } from '@struktoai/mirage-core'\nimport { enoent } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { isNotFound, resolveDirHandle, resolveParentDirHandle, splitSegments } from './utils.ts'\n\nexport async function stat(accessor: OPFSAccessor, p: PathSpec): Promise<FileStat> {\n const root = accessor.rootHandle\n const virtual = p.stripPrefix\n const segs = splitSegments(virtual)\n const last = segs.at(-1)\n if (last === undefined) {\n return new FileStat({\n name: '/',\n size: null,\n modified: null,\n type: FileType.DIRECTORY,\n })\n }\n const name = last\n let parentDir: FileSystemDirectoryHandle\n let entryName: string\n try {\n ;[parentDir, entryName] = await resolveParentDirHandle(root, virtual, { create: false })\n } catch (err) {\n if (isNotFound(err)) throw enoent(p)\n throw err\n }\n try {\n const fileHandle = await parentDir.getFileHandle(entryName, { create: false })\n const file = await fileHandle.getFile()\n const modified = new Date(file.lastModified).toISOString()\n return new FileStat({\n name,\n size: file.size,\n modified,\n fingerprint: modified,\n type: guessType(name),\n })\n } catch (err) {\n if (!isNotFound(err) && !(err instanceof DOMException && err.name === 'TypeMismatchError')) {\n throw err\n }\n }\n try {\n await resolveDirHandle(root, virtual, { create: false })\n return new FileStat({\n name,\n size: null,\n modified: null,\n type: FileType.DIRECTORY,\n })\n } catch (err) {\n if (isNotFound(err)) throw enoent(p)\n throw err\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, awkGeneric, command, specOf } from '@struktoai/mirage-core'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\n\nexport const OPFS_AWK = command({\n name: 'awk',\n resource: ResourceName.OPFS,\n spec: specOf('awk'),\n fn: (accessor: OPFSAccessor, paths, texts, opts) =>\n awkGeneric(paths, texts, opts, (p) => opfsStream(accessor, 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, recordStream, ResourceName } from '@struktoai/mirage-core'\nimport { enoent } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { isNotFound, resolveFileHandle } from './utils.ts'\n\nexport async function* stream(accessor: OPFSAccessor, path: PathSpec): AsyncIterable<Uint8Array> {\n const root = accessor.rootHandle\n const virtual = path.stripPrefix\n let handle: FileSystemFileHandle\n try {\n handle = await resolveFileHandle(root, virtual, { create: false })\n } catch (err) {\n if (isNotFound(err)) throw enoent(path)\n throw err\n }\n const file = await handle.getFile()\n const rec = recordStream('read', virtual, ResourceName.OPFS)\n const reader = file.stream().getReader()\n for (;;) {\n const { value, done } = await reader.read()\n if (done) break\n if (rec !== null) rec.bytes += value.byteLength\n yield value\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, command, specOf, base64Generic } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_BASE64 = command({\n name: 'base64',\n resource: ResourceName.OPFS,\n spec: specOf('base64'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n base64Generic(paths, opts, (p) => opfsStream(accessor, 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, command, specOf, basenameFn } from '@struktoai/mirage-core'\n\nexport const OPFS_BASENAME = command({\n name: 'basename',\n resource: ResourceName.OPFS,\n spec: specOf('basename'),\n fn: basenameFn,\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 ResourceName,\n catGeneric,\n catProvisionGeneric,\n command,\n concatAggregate,\n specOf,\n} from '@struktoai/mirage-core'\nimport { stream as opfsStream } from '../../../../core/opfs/stream.ts'\nimport { stat as opfsStat } from '../../../../core/opfs/stat.ts'\nimport type { OPFSAccessor } from '../../../../accessor/opfs.ts'\n\nexport const OPFS_CAT = command({\n name: 'cat',\n resource: ResourceName.OPFS,\n spec: specOf('cat'),\n fn: (accessor: OPFSAccessor, paths, texts, opts) =>\n catGeneric(\n paths,\n texts,\n opts,\n (p) => opfsStat(accessor, p),\n (p) => opfsStream(accessor, p),\n ),\n provision: (accessor: OPFSAccessor, paths, _texts, _opts) =>\n catProvisionGeneric(paths, (p) => opfsStat(accessor, p)),\n aggregate: concatAggregate,\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, command, specOf, cmpGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_CMP = command({\n name: 'cmp',\n resource: ResourceName.OPFS,\n spec: specOf('cmp'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n cmpGeneric(paths, opts, (p) => opfsStream(accessor, 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, command, specOf, columnGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_COLUMN = command({\n name: 'column',\n resource: ResourceName.OPFS,\n spec: specOf('column'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n columnGeneric(paths, opts, (p) => opfsStream(accessor, 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, command, specOf, commGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_COMM = command({\n name: 'comm',\n resource: ResourceName.OPFS,\n spec: specOf('comm'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n commGeneric(paths, opts, (p) => opfsStream(accessor, 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 {\n IOResult,\n ResourceName,\n command,\n cpGeneric,\n specOf,\n type CommandFnResult,\n type CommandOpts,\n type FindOptions,\n type PathSpec,\n} from '@struktoai/mirage-core'\nimport { copy as coreCopy } from '../../../core/opfs/copy.ts'\nimport { find as coreFind } from '../../../core/opfs/find.ts'\nimport { stat as coreStat } from '../../../core/opfs/stat.ts'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\n\nfunction cpCommand(\n accessor: OPFSAccessor,\n paths: PathSpec[],\n _texts: string[],\n opts: CommandOpts,\n): Promise<CommandFnResult> {\n if (paths.length < 2) {\n return Promise.resolve([\n null,\n new IOResult({ exitCode: 1, stderr: new TextEncoder().encode('cp: missing operand\\n') }),\n ])\n }\n const recursive = opts.flags.r === true || opts.flags.R === true || opts.flags.a === true\n return cpGeneric(\n paths,\n (src: PathSpec, target: PathSpec) => coreCopy(accessor, src, target),\n (src: PathSpec, options: FindOptions) => coreFind(accessor, src, options),\n (p: PathSpec) => coreStat(accessor, p),\n recursive,\n opts.flags.n === true,\n opts.flags.v === true,\n opts.index ?? undefined,\n )\n}\n\nexport const OPFS_CP = command({\n name: 'cp',\n resource: ResourceName.OPFS,\n spec: specOf('cp'),\n fn: cpCommand,\n write: true,\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 { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { isNotFound, resolveFileHandle, toWritableChunk } from './utils.ts'\n\nexport async function copy(accessor: OPFSAccessor, src: PathSpec, dst: PathSpec): Promise<void> {\n const root = accessor.rootHandle\n let srcHandle: FileSystemFileHandle\n try {\n srcHandle = await resolveFileHandle(root, src.stripPrefix, { create: false })\n } catch (err) {\n if (isNotFound(err)) throw new Error(`file not found: ${src.stripPrefix}`)\n throw err\n }\n const file = await srcHandle.getFile()\n const data = new Uint8Array(await file.arrayBuffer())\n const dstHandle = await resolveFileHandle(root, dst.stripPrefix, { create: true })\n const writable = await dstHandle.createWritable()\n await writable.write(toWritableChunk(data))\n await writable.close()\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 { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { isNotFound, iterEntries, norm, resolveDirHandle } from './utils.ts'\nimport { buildTree, keep, type PredNode } 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 mtimeMin?: number | null\n mtimeMax?: number | null\n}\n\ninterface WalkCtx {\n options: FindOptions\n tree: PredNode\n results: string[]\n}\n\nasync function walk(\n ctx: WalkCtx,\n dir: FileSystemDirectoryHandle,\n current: string,\n depth: number,\n): Promise<void> {\n const opts = ctx.options\n if (opts.maxDepth !== null && opts.maxDepth !== undefined && depth > opts.maxDepth) return\n let iter: AsyncIterable<[string, FileSystemHandle]>\n try {\n iter = iterEntries(dir)\n } catch {\n return\n }\n for await (const [entryName, handle] of iter) {\n const kind: 'f' | 'd' = handle.kind === 'directory' ? 'd' : 'f'\n const entryPath = current === '/' ? `/${entryName}` : `${current}/${entryName}`\n const entryDepth = depth + 1\n\n let accept = true\n if (opts.maxDepth !== null && opts.maxDepth !== undefined && entryDepth > opts.maxDepth) {\n accept = false\n }\n let isEmpty: boolean | null = null\n if (accept && opts.empty === true) {\n try {\n if (kind === 'f') {\n isEmpty = (await (handle as FileSystemFileHandle).getFile()).size === 0\n } else {\n isEmpty = true\n for await (const _child of iterEntries(handle as FileSystemDirectoryHandle)) {\n void _child\n isEmpty = false\n break\n }\n }\n } catch {\n isEmpty = null\n }\n }\n if (\n accept &&\n !keep(\n { key: entryPath, name: entryName, kind, depth: entryDepth, isEmpty },\n ctx.tree,\n opts.minDepth,\n )\n ) {\n accept = false\n }\n\n if (\n accept &&\n kind === 'f' &&\n (opts.minSize !== null ||\n opts.maxSize !== null ||\n opts.mtimeMin !== null ||\n opts.mtimeMax !== null)\n ) {\n try {\n const fh = await dir.getFileHandle(entryName, { create: false })\n const file = await fh.getFile()\n if (opts.minSize !== null && opts.minSize !== undefined && file.size < opts.minSize)\n accept = false\n if (opts.maxSize !== null && opts.maxSize !== undefined && file.size > opts.maxSize)\n accept = false\n if (accept && (opts.mtimeMin !== undefined || opts.mtimeMax !== undefined)) {\n const mtime = file.lastModified / 1000\n if (opts.mtimeMin !== null && opts.mtimeMin !== undefined && mtime < opts.mtimeMin)\n accept = false\n if (opts.mtimeMax !== null && opts.mtimeMax !== undefined && mtime > opts.mtimeMax)\n accept = false\n }\n } catch {\n accept = false\n }\n }\n\n if (accept) ctx.results.push(entryPath)\n\n if (kind === 'd') {\n try {\n const child = await dir.getDirectoryHandle(entryName, { create: false })\n await walk(ctx, child, entryPath, depth + 1)\n } catch {\n // ignore\n }\n }\n }\n}\n\nexport async function find(\n accessor: OPFSAccessor,\n p: PathSpec,\n options: FindOptions = {},\n): Promise<string[]> {\n const root = accessor.rootHandle\n const virtual = norm(p.stripPrefix)\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 let dir: FileSystemDirectoryHandle\n try {\n dir = await resolveDirHandle(root, virtual, { create: false })\n } catch (err) {\n if (isNotFound(err)) return results\n throw err\n }\n if (virtual !== '/' && (options.maxDepth == null || options.maxDepth >= 0)) {\n let rootEmpty: boolean | null = null\n if (options.empty === true) {\n rootEmpty = true\n for await (const _child of iterEntries(dir)) {\n void _child\n rootEmpty = false\n break\n }\n }\n if (\n keep(\n {\n key: virtual,\n name: virtual.slice(virtual.lastIndexOf('/') + 1),\n kind: 'd',\n depth: 0,\n isEmpty: rootEmpty,\n },\n tree,\n options.minDepth,\n )\n ) {\n results.push(virtual)\n }\n }\n await walk({ options, tree, results }, dir, virtual, 0)\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 { ResourceName, command, specOf, csplitGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\nimport { writeBytes as opfsWrite } from '../../../core/opfs/write.ts'\n\nexport const OPFS_CSPLIT = command({\n name: 'csplit',\n resource: ResourceName.OPFS,\n spec: specOf('csplit'),\n fn: (accessor: OPFSAccessor, paths, texts, opts) =>\n csplitGeneric(\n paths,\n texts,\n opts,\n (p) => opfsStream(accessor, p),\n (p, d) => opfsWrite(accessor, p, d),\n ),\n write: true,\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, record, ResourceName } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { resolveFileHandle, toWritableChunk } from './utils.ts'\n\nexport async function writeBytes(\n accessor: OPFSAccessor,\n p: PathSpec,\n data: Uint8Array,\n): Promise<void> {\n const root = accessor.rootHandle\n const start = performance.now()\n const virtual = p.stripPrefix\n const handle = await resolveFileHandle(root, virtual, { create: true })\n const writable = await handle.createWritable()\n await writable.write(toWritableChunk(data))\n await writable.close()\n record('write', virtual, ResourceName.OPFS, data.byteLength, start)\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, command, cutGeneric, specOf } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../../core/opfs/stream.ts'\n\nexport const OPFS_CUT = command({\n name: 'cut',\n resource: ResourceName.OPFS,\n spec: specOf('cut'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n cutGeneric(paths, opts, (p) => opfsStream(accessor, 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, command, diffGeneric, specOf } from '@struktoai/mirage-core'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\n\nexport const OPFS_DIFF = command({\n name: 'diff',\n resource: ResourceName.OPFS,\n spec: specOf('diff'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n diffGeneric(paths, opts, (p) => opfsStream(accessor, 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, command, specOf, dirnameFn } from '@struktoai/mirage-core'\n\nexport const OPFS_DIRNAME = command({\n name: 'dirname',\n resource: ResourceName.OPFS,\n spec: specOf('dirname'),\n fn: dirnameFn,\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, command, duGeneric, specOf } from '@struktoai/mirage-core'\nimport { du as opfsDu, duAll as opfsDuAll } from '../../../core/opfs/du.ts'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\n\nexport const OPFS_DU = command({\n name: 'du',\n resource: ResourceName.OPFS,\n spec: specOf('du'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n duGeneric(\n paths,\n opts,\n (p) => opfsDu(accessor, p),\n (p) => opfsDuAll(accessor, p),\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 } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { isNotFound, iterEntries, norm, resolveDirHandle, resolveParentDirHandle } from './utils.ts'\n\nasync function walkSizes(dir: FileSystemDirectoryHandle): Promise<number> {\n let total = 0\n for await (const [name, handle] of iterEntries(dir)) {\n if (handle.kind === 'file') {\n try {\n const fh = await dir.getFileHandle(name, { create: false })\n const file = await fh.getFile()\n total += file.size\n } catch {\n // ignore\n }\n } else {\n try {\n const child = await dir.getDirectoryHandle(name, { create: false })\n total += await walkSizes(child)\n } catch {\n // ignore\n }\n }\n }\n return total\n}\n\nasync function walkAll(\n dir: FileSystemDirectoryHandle,\n currentPath: string,\n entries: [string, number][],\n): Promise<number> {\n let total = 0\n for await (const [name, handle] of iterEntries(dir)) {\n const childPath = currentPath === '/' ? `/${name}` : `${currentPath}/${name}`\n if (handle.kind === 'file') {\n try {\n const fh = await dir.getFileHandle(name, { create: false })\n const file = await fh.getFile()\n entries.push([childPath, file.size])\n total += file.size\n } catch {\n // ignore\n }\n } else {\n try {\n const child = await dir.getDirectoryHandle(name, { create: false })\n total += await walkAll(child, childPath, entries)\n } catch {\n // ignore\n }\n }\n }\n return total\n}\n\nasync function sizeOfPath(root: FileSystemDirectoryHandle, virtual: string): Promise<number> {\n try {\n const [parentDir, name] = await resolveParentDirHandle(root, virtual, { create: false })\n try {\n const fh = await parentDir.getFileHandle(name, { create: false })\n const file = await fh.getFile()\n return file.size\n } catch (err) {\n if (!isNotFound(err) && !(err instanceof DOMException && err.name === 'TypeMismatchError')) {\n throw err\n }\n }\n const dir = await parentDir.getDirectoryHandle(name, { create: false })\n return await walkSizes(dir)\n } catch (err) {\n if (isNotFound(err)) return 0\n if (err instanceof Error && err.message.startsWith('no parent directory')) {\n try {\n const rootDir = await resolveDirHandle(root, virtual, { create: false })\n return await walkSizes(rootDir)\n } catch {\n return 0\n }\n }\n throw err\n }\n}\n\nexport async function du(accessor: OPFSAccessor, p: PathSpec): Promise<number> {\n return sizeOfPath(accessor.rootHandle, p.stripPrefix)\n}\n\nexport async function duAll(\n accessor: OPFSAccessor,\n p: PathSpec,\n): Promise<[entries: [string, number][], total: number]> {\n const root = accessor.rootHandle\n const virtual = norm(p.stripPrefix)\n const entries: [string, number][] = []\n try {\n const [parentDir, name] = await resolveParentDirHandle(root, virtual, { create: false })\n try {\n const fh = await parentDir.getFileHandle(name, { create: false })\n const file = await fh.getFile()\n entries.push([virtual, file.size])\n return [entries, file.size]\n } catch (err) {\n if (!isNotFound(err) && !(err instanceof DOMException && err.name === 'TypeMismatchError')) {\n throw err\n }\n }\n const dir = await parentDir.getDirectoryHandle(name, { create: false })\n const total = await walkAll(dir, virtual, entries)\n entries.sort((a, b) => (a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0))\n return [entries, total]\n } catch (err) {\n if (isNotFound(err)) return [entries, 0]\n if (err instanceof Error && err.message.startsWith('no parent directory')) {\n try {\n const rootDir = await resolveDirHandle(root, virtual, { create: false })\n const total = await walkAll(rootDir, virtual, entries)\n entries.sort((a, b) => (a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0))\n return [entries, total]\n } catch {\n return [entries, 0]\n }\n }\n throw err\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, command, specOf, expandGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_EXPAND = command({\n name: 'expand',\n resource: ResourceName.OPFS,\n spec: specOf('expand'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n expandGeneric(paths, opts, (p) => opfsStream(accessor, 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, command, fileGeneric, specOf } from '@struktoai/mirage-core'\nimport { stat as opfsStat } from '../../../../core/opfs/stat.ts'\nimport { read as opfsRead } from '../../../../core/opfs/read.ts'\nimport type { OPFSAccessor } from '../../../../accessor/opfs.ts'\n\nexport const OPFS_FILE = command({\n name: 'file',\n resource: ResourceName.OPFS,\n spec: specOf('file'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n fileGeneric(\n paths,\n opts,\n (p) => opfsStat(accessor, p),\n (p) => opfsRead(accessor, p),\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, command, findGeneric, specOf } from '@struktoai/mirage-core'\nimport { find as opfsFind } from '../../../core/opfs/find.ts'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\n\nexport const OPFS_FIND = command({\n name: 'find',\n resource: ResourceName.OPFS,\n spec: specOf('find'),\n fn: (accessor: OPFSAccessor, paths, texts, opts) =>\n findGeneric(paths, texts, opts, (root, options) => opfsFind(accessor, root, options)),\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 ResourceName,\n command,\n fmtGeneric,\n specOf,\n type CommandFnResult,\n type CommandOpts,\n type PathSpec,\n} from '@struktoai/mirage-core'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\n\nasync function fmtCommand(\n accessor: OPFSAccessor,\n paths: PathSpec[],\n _texts: string[],\n opts: CommandOpts,\n): Promise<CommandFnResult> {\n return fmtGeneric(paths, opts, (p) => opfsStream(accessor, p))\n}\n\nexport const OPFS_FMT = command({\n name: 'fmt',\n resource: ResourceName.OPFS,\n spec: specOf('fmt'),\n fn: fmtCommand,\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, command, specOf, foldGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_FOLD = command({\n name: 'fold',\n resource: ResourceName.OPFS,\n spec: specOf('fold'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n foldGeneric(paths, opts, (p) => opfsStream(accessor, 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, command, grepGeneric, prefixAggregate, specOf } from '@struktoai/mirage-core'\nimport { stream as opfsStream } from '../../../../core/opfs/stream.ts'\nimport { stat as opfsStat } from '../../../../core/opfs/stat.ts'\nimport { readdir as opfsReaddir } from '../../../../core/opfs/readdir.ts'\nimport type { OPFSAccessor } from '../../../../accessor/opfs.ts'\n\nexport const OPFS_GREP = command({\n name: 'grep',\n resource: ResourceName.OPFS,\n spec: specOf('grep'),\n fn: (accessor: OPFSAccessor, paths, texts, opts) =>\n grepGeneric(\n 'grep',\n paths,\n texts,\n opts,\n (p) => opfsStat(accessor, p),\n (p) => opfsReaddir(accessor, p),\n (p) => opfsStream(accessor, p),\n ),\n aggregate: prefixAggregate,\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 { enotdir } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { isNotFound, iterEntries, norm, resolveDirHandle } from './utils.ts'\n\nexport async function readdir(accessor: OPFSAccessor, path: PathSpec): Promise<string[]> {\n const root = accessor.rootHandle\n const virtual = path.pattern !== null ? path.directory : path.stripPrefix\n let dir: FileSystemDirectoryHandle\n try {\n dir = await resolveDirHandle(root, virtual, { create: false })\n } catch (err) {\n if (isNotFound(err)) throw enotdir(path)\n if (err instanceof DOMException && err.name === 'TypeMismatchError') {\n throw enotdir(path)\n }\n throw err\n }\n const names: string[] = []\n for await (const [name] of iterEntries(dir)) {\n names.push(name)\n }\n const base = norm(virtual)\n const dirPrefix = base === '/' ? '/' : `${base}/`\n const mountPrefix = path.prefix\n return names.map((n) => `${mountPrefix}${dirPrefix}${n}`).sort()\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, command, specOf, gunzipGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\nimport { writeBytes as opfsWrite } from '../../../core/opfs/write.ts'\nimport { unlink as opfsUnlink } from '../../../core/opfs/unlink.ts'\n\nexport const OPFS_GUNZIP = command({\n name: 'gunzip',\n resource: ResourceName.OPFS,\n spec: specOf('gunzip'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n gunzipGeneric(\n paths,\n opts,\n (p) => opfsStream(accessor, p),\n (p, d) => opfsWrite(accessor, p, d),\n (p) => opfsUnlink(accessor, p),\n ),\n write: true,\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 { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { isNotFound, resolveParentDirHandle } from './utils.ts'\n\nexport async function unlink(accessor: OPFSAccessor, path: PathSpec): Promise<void> {\n const root = accessor.rootHandle\n const virtual = path.stripPrefix\n let parentDir: FileSystemDirectoryHandle\n let name: string\n try {\n ;[parentDir, name] = await resolveParentDirHandle(root, virtual, { create: false })\n } catch (err) {\n if (isNotFound(err)) return\n if (err instanceof Error && err.message.startsWith('no parent directory')) return\n throw err\n }\n try {\n await parentDir.removeEntry(name)\n } catch (err) {\n if (isNotFound(err)) return\n throw err\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, command, specOf, gzipGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\nimport { writeBytes as opfsWrite } from '../../../core/opfs/write.ts'\nimport { unlink as opfsUnlink } from '../../../core/opfs/unlink.ts'\n\nexport const OPFS_GZIP = command({\n name: 'gzip',\n resource: ResourceName.OPFS,\n spec: specOf('gzip'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n gzipGeneric(\n paths,\n opts,\n (p) => opfsStream(accessor, p),\n (p, d) => opfsWrite(accessor, p, d),\n (p) => opfsUnlink(accessor, p),\n ),\n write: true,\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 ResourceName,\n command,\n headGeneric,\n headProvisionGeneric,\n headerAggregate,\n specOf,\n} from '@struktoai/mirage-core'\nimport { stream as opfsStream } from '../../../../core/opfs/stream.ts'\nimport { stat as opfsStat } from '../../../../core/opfs/stat.ts'\nimport type { OPFSAccessor } from '../../../../accessor/opfs.ts'\n\nexport const OPFS_HEAD = command({\n name: 'head',\n resource: ResourceName.OPFS,\n spec: specOf('head'),\n fn: (accessor: OPFSAccessor, paths, texts, opts) =>\n headGeneric(\n paths,\n texts,\n opts,\n (p) => opfsStat(accessor, p),\n (p) => opfsStream(accessor, p),\n ),\n provision: (accessor: OPFSAccessor, paths, texts, opts) =>\n headProvisionGeneric(paths, texts, opts, (p) => opfsStat(accessor, p)),\n aggregate: headerAggregate,\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, command, specOf, iconvGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\nimport { writeBytes as opfsWrite } from '../../../core/opfs/write.ts'\n\nexport const OPFS_ICONV = command({\n name: 'iconv',\n resource: ResourceName.OPFS,\n spec: specOf('iconv'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n iconvGeneric(\n paths,\n opts,\n (p) => opfsStream(accessor, p),\n (p, d) => opfsWrite(accessor, p, d),\n ),\n write: true,\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, command, specOf, joinGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_JOIN = command({\n name: 'join',\n resource: ResourceName.OPFS,\n spec: specOf('join'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n joinGeneric(paths, opts, (p) => opfsStream(accessor, 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 {\n ResourceName,\n command,\n jqGeneric,\n jqProvisionGeneric,\n specOf,\n} from '@struktoai/mirage-core'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\nimport { stat as opfsStat } from '../../../core/opfs/stat.ts'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\n\nexport const OPFS_JQ = command({\n name: 'jq',\n resource: ResourceName.OPFS,\n spec: specOf('jq'),\n fn: (accessor: OPFSAccessor, paths, texts, opts) =>\n jqGeneric(paths, texts, opts, (p) => opfsStream(accessor, p)),\n provision: (accessor: OPFSAccessor, paths, texts, _opts) =>\n jqProvisionGeneric(paths, texts, (p) => opfsStat(accessor, 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 {\n IOResult,\n ResourceName,\n command,\n materialize,\n specOf,\n type ByteSource,\n type CommandFnResult,\n type CommandOpts,\n type PathSpec,\n} from '@struktoai/mirage-core'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\nimport { writeBytes as opfsWrite } from '../../../core/opfs/write.ts'\nimport { exists as opfsExists } from '../../../core/opfs/exists.ts'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\n\nconst ENC = new TextEncoder()\n\nasync function lnCommand(\n accessor: OPFSAccessor,\n paths: PathSpec[],\n texts: string[],\n opts: CommandOpts,\n): Promise<CommandFnResult> {\n if (paths.length < 2) {\n return [\n null,\n new IOResult({ exitCode: 1, stderr: ENC.encode('ln: usage: ln [-s] [-f] source dest\\n') }),\n ]\n }\n const source = paths[0]\n const dest = paths[1]\n if (source === undefined || dest === undefined) return [null, new IOResult()]\n if (opts.flags.n === true && (await opfsExists(accessor, dest))) {\n return [null, new IOResult()]\n }\n const data = await materialize(opfsStream(accessor, source))\n await opfsWrite(accessor, dest, data)\n const out: ByteSource | null =\n opts.flags.v === true ? ENC.encode(`'${source.original}' -> '${dest.original}'\\n`) : null\n return [out, new IOResult({ writes: { [dest.stripPrefix]: data } })]\n}\n\nexport const OPFS_LN = command({\n name: 'ln',\n resource: ResourceName.OPFS,\n spec: specOf('ln'),\n fn: lnCommand,\n write: true,\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 { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { isNotFound, resolveDirHandle, resolveParentDirHandle } from './utils.ts'\n\nexport async function exists(accessor: OPFSAccessor, path: PathSpec): Promise<boolean> {\n const root = accessor.rootHandle\n const virtual = path.stripPrefix\n if (virtual === '/' || virtual === '') return true\n try {\n const [parentDir, name] = await resolveParentDirHandle(root, virtual, { create: false })\n try {\n await parentDir.getFileHandle(name, { create: false })\n return true\n } catch (err) {\n if (!isNotFound(err) && !(err instanceof DOMException && err.name === 'TypeMismatchError')) {\n throw err\n }\n }\n try {\n await parentDir.getDirectoryHandle(name, { create: false })\n return true\n } catch (err) {\n if (isNotFound(err) || (err instanceof DOMException && err.name === 'TypeMismatchError')) {\n return false\n }\n throw err\n }\n } catch (err) {\n if (isNotFound(err)) return false\n if (err instanceof Error && err.message.startsWith('path escapes root')) return false\n if (err instanceof Error && err.message.startsWith('no parent directory')) {\n try {\n await resolveDirHandle(root, virtual, { create: false })\n return true\n } catch {\n return false\n }\n }\n throw err\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, command, specOf, lookGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_LOOK = command({\n name: 'look',\n resource: ResourceName.OPFS,\n spec: specOf('look'),\n fn: (accessor: OPFSAccessor, paths, texts, opts) =>\n lookGeneric(paths, texts, opts, (p) => opfsStream(accessor, 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, command, lsGeneric, specOf } from '@struktoai/mirage-core'\nimport { stat as opfsStat } from '../../../../core/opfs/stat.ts'\nimport { readdir as opfsReaddir } from '../../../../core/opfs/readdir.ts'\nimport type { OPFSAccessor } from '../../../../accessor/opfs.ts'\n\nexport const OPFS_LS = command({\n name: 'ls',\n resource: ResourceName.OPFS,\n spec: specOf('ls'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n lsGeneric(\n paths,\n opts,\n (p) => opfsReaddir(accessor, p),\n (p) => opfsStat(accessor, p),\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, command, specOf, md5Generic } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_MD5 = command({\n name: 'md5',\n resource: ResourceName.OPFS,\n spec: specOf('md5'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n md5Generic(paths, opts, (p) => opfsStream(accessor, 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 {\n IOResult,\n ResourceName,\n command,\n specOf,\n type CommandFnResult,\n type CommandOpts,\n type PathSpec,\n} from '@struktoai/mirage-core'\nimport { mkdir as opfsMkdir } from '../../../core/opfs/mkdir.ts'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\n\nasync function mkdirCommand(\n accessor: OPFSAccessor,\n paths: PathSpec[],\n texts: string[],\n opts: CommandOpts,\n): Promise<CommandFnResult> {\n const parents = opts.flags.p === true\n if (paths.length === 0) {\n return [\n null,\n new IOResult({\n exitCode: 1,\n stderr: new TextEncoder().encode('mkdir: missing operand\\n'),\n }),\n ]\n }\n for (const p of paths) {\n await opfsMkdir(accessor, p, parents)\n }\n return [null, new IOResult()]\n}\n\nexport const OPFS_MKDIR = command({\n name: 'mkdir',\n resource: ResourceName.OPFS,\n spec: specOf('mkdir'),\n fn: mkdirCommand,\n write: true,\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 { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { isNotFound, resolveDirHandle, resolveParentDirHandle, splitSegments } from './utils.ts'\n\nexport async function mkdir(\n accessor: OPFSAccessor,\n path: PathSpec,\n parents = false,\n): Promise<void> {\n const root = accessor.rootHandle\n const virtual = path.stripPrefix\n const segs = splitSegments(virtual)\n if (segs.length === 0) return\n if (parents) {\n await resolveDirHandle(root, virtual, { create: true })\n return\n }\n let parentDir: FileSystemDirectoryHandle\n let name: string\n try {\n ;[parentDir, name] = await resolveParentDirHandle(root, virtual, { create: false })\n } catch (err) {\n if (isNotFound(err)) {\n throw new Error(`parent directory does not exist: ${virtual}`)\n }\n throw err\n }\n try {\n await parentDir.getDirectoryHandle(name, { create: false })\n return\n } catch (err) {\n if (!isNotFound(err)) {\n if (err instanceof DOMException && err.name === 'TypeMismatchError') {\n throw new Error(`path exists and is not a directory: ${virtual}`)\n }\n throw err\n }\n }\n await parentDir.getDirectoryHandle(name, { create: true })\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, command, mktempGeneric, specOf } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { mkdir as opfsMkdir } from '../../../core/opfs/mkdir.ts'\nimport { writeBytes as opfsWrite } from '../../../core/opfs/write.ts'\n\nexport const OPFS_MKTEMP = command({\n name: 'mktemp',\n resource: ResourceName.OPFS,\n spec: specOf('mktemp'),\n fn: (accessor: OPFSAccessor, _paths, texts, opts) =>\n mktempGeneric(\n texts,\n opts,\n (p, parents) => opfsMkdir(accessor, p, parents),\n (p, d) => opfsWrite(accessor, p, d),\n ),\n write: true,\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 IOResult,\n ResourceName,\n command,\n mvGeneric,\n specOf,\n type CommandFnResult,\n type CommandOpts,\n type PathSpec,\n} from '@struktoai/mirage-core'\nimport { rename as coreRename } from '../../../core/opfs/rename.ts'\nimport { stat as coreStat } from '../../../core/opfs/stat.ts'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\n\nfunction mvCommand(\n accessor: OPFSAccessor,\n paths: PathSpec[],\n _texts: string[],\n opts: CommandOpts,\n): Promise<CommandFnResult> {\n if (paths.length < 2) {\n return Promise.resolve([\n null,\n new IOResult({ exitCode: 1, stderr: new TextEncoder().encode('mv: missing operand\\n') }),\n ])\n }\n return mvGeneric(\n paths,\n (src: PathSpec, target: PathSpec) => coreRename(accessor, src, target),\n (p: PathSpec) => coreStat(accessor, p),\n opts.flags.n === true,\n opts.flags.v === true,\n opts.index ?? undefined,\n )\n}\n\nexport const OPFS_MV = command({\n name: 'mv',\n resource: ResourceName.OPFS,\n spec: specOf('mv'),\n fn: mvCommand,\n write: true,\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 { OPFSAccessor } from '../../accessor/opfs.ts'\nimport {\n isNotFound,\n iterEntries,\n resolveDirHandle,\n resolveFileHandle,\n resolveParentDirHandle,\n toWritableChunk,\n} from './utils.ts'\n\nasync function copyDirRecursive(\n root: FileSystemDirectoryHandle,\n srcPath: string,\n dstPath: string,\n): Promise<void> {\n const srcDir = await resolveDirHandle(root, srcPath, { create: false })\n const dstDir = await resolveDirHandle(root, dstPath, { create: true })\n for await (const [name, handle] of iterEntries(srcDir)) {\n if (handle.kind === 'file') {\n const srcFile = await srcDir.getFileHandle(name, { create: false })\n const file = await srcFile.getFile()\n const data = new Uint8Array(await file.arrayBuffer())\n const dstFile = await dstDir.getFileHandle(name, { create: true })\n const writable = await dstFile.createWritable()\n await writable.write(toWritableChunk(data))\n await writable.close()\n } else {\n await copyDirRecursive(root, `${srcPath}/${name}`, `${dstPath}/${name}`)\n }\n }\n}\n\nexport async function rename(accessor: OPFSAccessor, src: PathSpec, dst: PathSpec): Promise<void> {\n const root = accessor.rootHandle\n const srcPath = src.stripPrefix\n const dstPath = dst.stripPrefix\n let srcParent: FileSystemDirectoryHandle\n let srcName: string\n try {\n ;[srcParent, srcName] = await resolveParentDirHandle(root, srcPath, { create: false })\n } catch (err) {\n if (isNotFound(err)) throw new Error(`file or directory not found: ${srcPath}`)\n throw err\n }\n let isFile = false\n try {\n await srcParent.getFileHandle(srcName, { create: false })\n isFile = true\n } catch (err) {\n if (!isNotFound(err) && !(err instanceof DOMException && err.name === 'TypeMismatchError')) {\n throw err\n }\n }\n if (!isFile) {\n try {\n await srcParent.getDirectoryHandle(srcName, { create: false })\n } catch (err) {\n if (isNotFound(err)) throw new Error(`file or directory not found: ${srcPath}`)\n throw err\n }\n }\n if (isFile) {\n const srcFile = await resolveFileHandle(root, srcPath, { create: false })\n const file = await srcFile.getFile()\n const data = new Uint8Array(await file.arrayBuffer())\n const dstFile = await resolveFileHandle(root, dstPath, { create: true })\n const writable = await dstFile.createWritable()\n await writable.write(toWritableChunk(data))\n await writable.close()\n await srcParent.removeEntry(srcName)\n return\n }\n await copyDirRecursive(root, srcPath, dstPath)\n await srcParent.removeEntry(srcName, { recursive: true })\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, command, specOf, nlGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_NL = command({\n name: 'nl',\n resource: ResourceName.OPFS,\n spec: specOf('nl'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n nlGeneric(paths, opts, (p) => opfsStream(accessor, 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, command, specOf, pasteGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_PASTE = command({\n name: 'paste',\n resource: ResourceName.OPFS,\n spec: specOf('paste'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n pasteGeneric(paths, opts, (p) => opfsStream(accessor, 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, command, specOf, patchGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\nimport { writeBytes as opfsWrite } from '../../../core/opfs/write.ts'\n\nexport const OPFS_PATCH = command({\n name: 'patch',\n resource: ResourceName.OPFS,\n spec: specOf('patch'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n patchGeneric(\n paths,\n opts,\n (p) => opfsStream(accessor, p),\n (p, d) => opfsWrite(accessor, p, d),\n ),\n write: true,\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 ResourceName,\n command,\n readlinkGeneric,\n specOf,\n type Accessor,\n} from '@struktoai/mirage-core'\n\nexport const OPFS_READLINK = command({\n name: 'readlink',\n resource: ResourceName.OPFS,\n spec: specOf('readlink'),\n fn: (_accessor: Accessor, paths, texts, opts) => readlinkGeneric(paths, texts, opts),\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, command, realpathGeneric, specOf } from '@struktoai/mirage-core'\nimport { stat as opfsStat } from '../../../core/opfs/stat.ts'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\n\nexport const OPFS_REALPATH = command({\n name: 'realpath',\n resource: ResourceName.OPFS,\n spec: specOf('realpath'),\n fn: (accessor: OPFSAccessor, paths, texts, opts) =>\n realpathGeneric(paths, texts, opts, (p) => opfsStat(accessor, 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, command, specOf, revGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_REV = command({\n name: 'rev',\n resource: ResourceName.OPFS,\n spec: specOf('rev'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n revGeneric(paths, opts, (p) => opfsStream(accessor, 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, command, rgGeneric, specOf } from '@struktoai/mirage-core'\nimport { readdir as opfsReaddir } from '../../../core/opfs/readdir.ts'\nimport { stat as opfsStat } from '../../../core/opfs/stat.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\n\nexport const OPFS_RG = command({\n name: 'rg',\n resource: ResourceName.OPFS,\n spec: specOf('rg'),\n fn: (accessor: OPFSAccessor, paths, texts, opts) =>\n rgGeneric(\n paths,\n texts,\n opts,\n (p) => opfsStat(accessor, p),\n (p) => opfsReaddir(accessor, p),\n (p) => opfsStream(accessor, p),\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 FileType,\n IOResult,\n ResourceName,\n command,\n specOf,\n type CommandFnResult,\n type CommandOpts,\n type PathSpec,\n} from '@struktoai/mirage-core'\nimport { rmdir as opfsRmdir } from '../../../core/opfs/rmdir.ts'\nimport { stat as opfsStat } from '../../../core/opfs/stat.ts'\nimport { unlink as opfsUnlink } from '../../../core/opfs/unlink.ts'\nimport { rmR as opfsRmR } from '../../../core/opfs/rm.ts'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\n\nasync function rmCommand(\n accessor: OPFSAccessor,\n paths: PathSpec[],\n texts: string[],\n opts: CommandOpts,\n): Promise<CommandFnResult> {\n if (paths.length === 0) {\n return [\n null,\n new IOResult({\n exitCode: 1,\n stderr: new TextEncoder().encode('rm: missing operand\\n'),\n }),\n ]\n }\n const recursive = opts.flags.r === true || opts.flags.R === true\n for (const p of paths) {\n let isDir = false\n try {\n const st = await opfsStat(accessor, p)\n isDir = st.type === FileType.DIRECTORY\n } catch {\n isDir = false\n }\n if (isDir) {\n if (recursive) {\n await opfsRmR(accessor, p)\n } else {\n await opfsRmdir(accessor, p)\n }\n } else {\n await opfsUnlink(accessor, p)\n }\n }\n return [null, new IOResult()]\n}\n\nexport const OPFS_RM = command({\n name: 'rm',\n resource: ResourceName.OPFS,\n spec: specOf('rm'),\n fn: rmCommand,\n write: true,\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 { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { isNotFound, resolveParentDirHandle } from './utils.ts'\n\nexport async function rmdir(accessor: OPFSAccessor, path: PathSpec): Promise<void> {\n const root = accessor.rootHandle\n const virtual = path.stripPrefix\n let parentDir: FileSystemDirectoryHandle\n let name: string\n try {\n ;[parentDir, name] = await resolveParentDirHandle(root, virtual, { create: false })\n } catch (err) {\n if (isNotFound(err)) return\n if (err instanceof Error && err.message.startsWith('no parent directory')) return\n throw err\n }\n try {\n await parentDir.removeEntry(name, { recursive: false })\n } catch (err) {\n if (isNotFound(err)) return\n throw err\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 } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { isNotFound, resolveParentDirHandle } from './utils.ts'\n\nexport async function rmR(accessor: OPFSAccessor, path: PathSpec): Promise<void> {\n const root = accessor.rootHandle\n const virtual = path.stripPrefix\n let parentDir: FileSystemDirectoryHandle\n let name: string\n try {\n ;[parentDir, name] = await resolveParentDirHandle(root, virtual, { create: false })\n } catch (err) {\n if (isNotFound(err)) return\n if (err instanceof Error && err.message.startsWith('no parent directory')) return\n throw err\n }\n try {\n await parentDir.removeEntry(name, { recursive: true })\n } catch (err) {\n if (isNotFound(err)) return\n throw err\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, command, specOf, sedGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\nimport { writeBytes as opfsWrite } from '../../../core/opfs/write.ts'\n\nexport const OPFS_SED = command({\n name: 'sed',\n resource: ResourceName.OPFS,\n spec: specOf('sed'),\n fn: (accessor: OPFSAccessor, paths, texts, opts) =>\n sedGeneric(\n paths,\n texts,\n opts,\n (p) => opfsStream(accessor, p),\n (p, d) => opfsWrite(accessor, p, d),\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, command, sha256sumGeneric, specOf } from '@struktoai/mirage-core'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\n\nexport const OPFS_SHA256SUM = command({\n name: 'sha256sum',\n resource: ResourceName.OPFS,\n spec: specOf('sha256sum'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n sha256sumGeneric(paths, opts, (p) => opfsStream(accessor, 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, command, specOf, shufGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_SHUF = command({\n name: 'shuf',\n resource: ResourceName.OPFS,\n spec: specOf('shuf'),\n fn: (accessor: OPFSAccessor, paths, texts, opts) =>\n shufGeneric(paths, texts, opts, (p) => opfsStream(accessor, 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, command, specOf, sortGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_SORT = command({\n name: 'sort',\n resource: ResourceName.OPFS,\n spec: specOf('sort'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n sortGeneric(paths, opts, (p) => opfsStream(accessor, 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, command, specOf, splitGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\nimport { writeBytes as opfsWrite } from '../../../core/opfs/write.ts'\n\nexport const OPFS_SPLIT = command({\n name: 'split',\n resource: ResourceName.OPFS,\n spec: specOf('split'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n splitGeneric(\n paths,\n opts,\n (p) => opfsStream(accessor, p),\n (p, d) => opfsWrite(accessor, p, d),\n ),\n write: true,\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 ResourceName,\n command,\n specOf,\n statGeneric,\n statProvisionGeneric,\n} from '@struktoai/mirage-core'\nimport { stat as opfsStat } from '../../../../core/opfs/stat.ts'\nimport type { OPFSAccessor } from '../../../../accessor/opfs.ts'\n\nexport const OPFS_STAT = command({\n name: 'stat',\n resource: ResourceName.OPFS,\n spec: specOf('stat'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n statGeneric(paths, opts, (p) => opfsStat(accessor, p)),\n provision: statProvisionGeneric,\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, command, specOf, stringsGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_STRINGS = command({\n name: 'strings',\n resource: ResourceName.OPFS,\n spec: specOf('strings'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n stringsGeneric(paths, opts, (p) => opfsStream(accessor, 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, command, specOf, tacGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_TAC = command({\n name: 'tac',\n resource: ResourceName.OPFS,\n spec: specOf('tac'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n tacGeneric(paths, opts, (p) => opfsStream(accessor, 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, command, headerAggregate, specOf, tailGeneric } from '@struktoai/mirage-core'\nimport { stream as opfsStream } from '../../../../core/opfs/stream.ts'\nimport type { OPFSAccessor } from '../../../../accessor/opfs.ts'\n\nexport const OPFS_TAIL = command({\n name: 'tail',\n resource: ResourceName.OPFS,\n spec: specOf('tail'),\n fn: (accessor: OPFSAccessor, paths, texts, opts) =>\n tailGeneric(paths, texts, opts, (p) => opfsStream(accessor, p)),\n aggregate: headerAggregate,\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, command, specOf, tarGeneric } from '@struktoai/mirage-core'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\nimport { writeBytes as opfsWrite } from '../../../core/opfs/write.ts'\nimport { mkdir as opfsMkdir } from '../../../core/opfs/mkdir.ts'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\n\nexport const OPFS_TAR = command({\n name: 'tar',\n resource: ResourceName.OPFS,\n spec: specOf('tar'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n tarGeneric(\n paths,\n opts,\n (p) => opfsStream(accessor, p),\n (p, data) => opfsWrite(accessor, p, data),\n (p) => opfsMkdir(accessor, p),\n ),\n write: true,\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, command, specOf, teeGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\nimport { writeBytes as opfsWrite } from '../../../core/opfs/write.ts'\n\nexport const OPFS_TEE = command({\n name: 'tee',\n resource: ResourceName.OPFS,\n spec: specOf('tee'),\n fn: (accessor: OPFSAccessor, paths, texts, opts) =>\n teeGeneric(\n paths,\n texts,\n opts,\n (p) => opfsStream(accessor, p),\n (p, d) => opfsWrite(accessor, p, d),\n ),\n write: true,\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 IOResult,\n ResourceName,\n command,\n specOf,\n type CommandFnResult,\n type CommandOpts,\n type PathSpec,\n} from '@struktoai/mirage-core'\nimport { writeBytes as opfsWrite } from '../../../core/opfs/write.ts'\nimport { exists as opfsExists } from '../../../core/opfs/exists.ts'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\n\nconst ENC = new TextEncoder()\n\nasync function touchCommand(\n accessor: OPFSAccessor,\n paths: PathSpec[],\n texts: string[],\n opts: CommandOpts,\n): Promise<CommandFnResult> {\n if (paths.length === 0) {\n return [null, new IOResult({ exitCode: 1, stderr: ENC.encode('touch: missing operand\\n') })]\n }\n const createOnly = opts.flags.c === true\n for (const p of paths) {\n if (createOnly) continue\n if (!(await opfsExists(accessor, p))) {\n await opfsWrite(accessor, p, new Uint8Array(0))\n }\n }\n return [null, new IOResult()]\n}\n\nexport const OPFS_TOUCH = command({\n name: 'touch',\n resource: ResourceName.OPFS,\n spec: specOf('touch'),\n fn: touchCommand,\n write: true,\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, command, specOf, trGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_TR = command({\n name: 'tr',\n resource: ResourceName.OPFS,\n spec: specOf('tr'),\n fn: (accessor: OPFSAccessor, paths, texts, opts) =>\n trGeneric(paths, texts, opts, (p) => opfsStream(accessor, 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, command, specOf, treeGeneric } from '@struktoai/mirage-core'\nimport { readdir as opfsReaddir } from '../../../core/opfs/readdir.ts'\nimport { stat as opfsStat } from '../../../core/opfs/stat.ts'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\n\nexport const OPFS_TREE = command({\n name: 'tree',\n resource: ResourceName.OPFS,\n spec: specOf('tree'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n treeGeneric(\n paths,\n opts,\n (p) => opfsReaddir(accessor, p),\n (p) => opfsStat(accessor, p),\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, command, specOf, tsortGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_TSORT = command({\n name: 'tsort',\n resource: ResourceName.OPFS,\n spec: specOf('tsort'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n tsortGeneric(paths, opts, (p) => opfsStream(accessor, 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, command, specOf, unexpandGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_UNEXPAND = command({\n name: 'unexpand',\n resource: ResourceName.OPFS,\n spec: specOf('unexpand'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n unexpandGeneric(paths, opts, (p) => opfsStream(accessor, 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, command, specOf, uniqGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_UNIQ = command({\n name: 'uniq',\n resource: ResourceName.OPFS,\n spec: specOf('uniq'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n uniqGeneric(paths, opts, (p) => opfsStream(accessor, 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, command, specOf, unzipGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\nimport { writeBytes as opfsWrite } from '../../../core/opfs/write.ts'\nimport { mkdir as opfsMkdir } from '../../../core/opfs/mkdir.ts'\n\nexport const OPFS_UNZIP = command({\n name: 'unzip',\n resource: ResourceName.OPFS,\n spec: specOf('unzip'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n unzipGeneric(\n paths,\n opts,\n (p) => opfsStream(accessor, p),\n (p, d) => opfsWrite(accessor, p, d),\n (p, parents) => opfsMkdir(accessor, p, parents),\n ),\n write: true,\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, command, specOf, wcAggregate, wcGeneric } from '@struktoai/mirage-core'\nimport { stream as opfsStream } from '../../../../core/opfs/stream.ts'\nimport type { OPFSAccessor } from '../../../../accessor/opfs.ts'\n\nexport const OPFS_WC = command({\n name: 'wc',\n resource: ResourceName.OPFS,\n spec: specOf('wc'),\n fn: (accessor: OPFSAccessor, paths, texts, opts) =>\n wcGeneric(paths, texts, opts, (p) => opfsStream(accessor, p)),\n aggregate: wcAggregate,\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, command, specOf, xxdGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_XXD = command({\n name: 'xxd',\n resource: ResourceName.OPFS,\n spec: specOf('xxd'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n xxdGeneric(paths, opts, (p) => opfsStream(accessor, 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, command, specOf, zcatGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_ZCAT = command({\n name: 'zcat',\n resource: ResourceName.OPFS,\n spec: specOf('zcat'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n zcatGeneric(paths, opts, (p) => opfsStream(accessor, 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, command, specOf, zgrepGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\n\nexport const OPFS_ZGREP = command({\n name: 'zgrep',\n resource: ResourceName.OPFS,\n spec: specOf('zgrep'),\n fn: (accessor: OPFSAccessor, paths, texts, opts) =>\n zgrepGeneric(paths, texts, opts, (p) => opfsStream(accessor, 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, command, specOf, zipGeneric } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../../accessor/opfs.ts'\nimport { stream as opfsStream } from '../../../core/opfs/stream.ts'\nimport { writeBytes as opfsWrite } from '../../../core/opfs/write.ts'\n\nexport const OPFS_ZIP = command({\n name: 'zip',\n resource: ResourceName.OPFS,\n spec: specOf('zip'),\n fn: (accessor: OPFSAccessor, paths, _texts, opts) =>\n zipGeneric(\n paths,\n opts,\n (p) => opfsStream(accessor, p),\n (p, d) => opfsWrite(accessor, p, d),\n ),\n write: true,\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, record, ResourceName } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { resolveFileHandle, toWritableChunk } from './utils.ts'\n\nexport async function appendBytes(\n accessor: OPFSAccessor,\n p: PathSpec,\n data: Uint8Array,\n): Promise<void> {\n const root = accessor.rootHandle\n const start = performance.now()\n const virtual = p.stripPrefix\n const handle = await resolveFileHandle(root, virtual, { create: true })\n const existing = await handle.getFile()\n const existingBytes = new Uint8Array(await existing.arrayBuffer())\n const merged = new Uint8Array(existingBytes.byteLength + data.byteLength)\n merged.set(existingBytes, 0)\n merged.set(data, existingBytes.byteLength)\n const writable = await handle.createWritable()\n await writable.write(toWritableChunk(merged))\n await writable.close()\n record('append', virtual, ResourceName.OPFS, data.byteLength, start)\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 { PathSpec } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../accessor/opfs.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: OPFSAccessor,\n paths: readonly PathSpec[],\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)\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\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 type { PathSpec } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { isNotFound, resolveFileHandle, toWritableChunk } from './utils.ts'\n\nexport async function truncate(\n accessor: OPFSAccessor,\n path: PathSpec,\n length: number,\n): Promise<void> {\n const root = accessor.rootHandle\n const virtual = path.stripPrefix\n let handle: FileSystemFileHandle\n let existing: Uint8Array\n try {\n handle = await resolveFileHandle(root, virtual, { create: false })\n const file = await handle.getFile()\n existing = new Uint8Array(await file.arrayBuffer())\n } catch (err) {\n if (isNotFound(err)) {\n handle = await resolveFileHandle(root, virtual, { create: true })\n existing = new Uint8Array()\n } else {\n throw err\n }\n }\n const out = new Uint8Array(length)\n out.set(existing.subarray(0, Math.min(existing.byteLength, length)))\n const writable = await handle.createWritable()\n await writable.write(toWritableChunk(out))\n await writable.close()\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 { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { appendBytes as coreAppend } from '../../core/opfs/append.ts'\n\nexport const appendOp: RegisteredOp = {\n name: 'append',\n resource: ResourceName.OPFS,\n filetype: null,\n write: true,\n fn: (accessor: OPFSAccessor, 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 coreAppend(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 { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { create as coreCreate } from '../../core/opfs/create.ts'\n\nexport const createOp: RegisteredOp = {\n name: 'create',\n resource: ResourceName.OPFS,\n filetype: null,\n write: true,\n fn: (accessor: OPFSAccessor, path: PathSpec) => coreCreate(accessor, 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 { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { writeBytes } from './write.ts'\n\nexport function create(accessor: OPFSAccessor, path: PathSpec): Promise<void> {\n return writeBytes(accessor, path, new Uint8Array())\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 { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { mkdir as coreMkdir } from '../../core/opfs/mkdir.ts'\n\nexport const mkdirOp: RegisteredOp = {\n name: 'mkdir',\n resource: ResourceName.OPFS,\n filetype: null,\n write: true,\n fn: (accessor: OPFSAccessor, path: PathSpec) => coreMkdir(accessor, path, true),\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 { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { read as coreRead } from '../../core/opfs/read.ts'\n\nexport const readOp: RegisteredOp = {\n name: 'read',\n resource: ResourceName.OPFS,\n filetype: null,\n write: false,\n fn: (accessor: OPFSAccessor, path: PathSpec) => coreRead(accessor, 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, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { readdir as coreReaddir } from '../../core/opfs/readdir.ts'\n\nexport const readdirOp: RegisteredOp = {\n name: 'readdir',\n resource: ResourceName.OPFS,\n filetype: null,\n write: false,\n fn: (accessor: OPFSAccessor, path: PathSpec) => coreReaddir(accessor, 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, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { rename as coreRename } from '../../core/opfs/rename.ts'\n\nexport const renameOp: RegisteredOp = {\n name: 'rename',\n resource: ResourceName.OPFS,\n filetype: null,\n write: true,\n fn: (accessor: OPFSAccessor, 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 coreRename(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 { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { rmdir as coreRmdir } from '../../core/opfs/rmdir.ts'\n\nexport const rmdirOp: RegisteredOp = {\n name: 'rmdir',\n resource: ResourceName.OPFS,\n filetype: null,\n write: true,\n fn: (accessor: OPFSAccessor, path: PathSpec) => coreRmdir(accessor, 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, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { stat as coreStat } from '../../core/opfs/stat.ts'\n\nexport const statOp: RegisteredOp = {\n name: 'stat',\n resource: ResourceName.OPFS,\n filetype: null,\n write: false,\n fn: (accessor: OPFSAccessor, path: PathSpec) => coreStat(accessor, 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, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { truncate as coreTruncate } from '../../core/opfs/truncate.ts'\n\nexport const truncateOp: RegisteredOp = {\n name: 'truncate',\n resource: ResourceName.OPFS,\n filetype: null,\n write: true,\n fn: (accessor: OPFSAccessor, 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 coreTruncate(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 { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { unlink as coreUnlink } from '../../core/opfs/unlink.ts'\n\nexport const unlinkOp: RegisteredOp = {\n name: 'unlink',\n resource: ResourceName.OPFS,\n filetype: null,\n write: true,\n fn: (accessor: OPFSAccessor, path: PathSpec) => coreUnlink(accessor, 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, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { OPFSAccessor } from '../../accessor/opfs.ts'\nimport { writeBytes } from '../../core/opfs/write.ts'\n\nexport const writeOp: RegisteredOp = {\n name: 'write',\n resource: ResourceName.OPFS,\n filetype: null,\n write: true,\n fn: (accessor: OPFSAccessor, path: PathSpec, args: readonly unknown[]) => {\n const data = args[0]\n if (!(data instanceof Uint8Array)) {\n throw new TypeError('write op requires a Uint8Array as the first arg')\n }\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 { 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 OPFS_OPS: readonly RegisteredOp[] = [\n appendOp,\n createOp,\n mkdirOp,\n readOp,\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 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 OPFS_PROMPT = `{prefix}\n Browser Origin Private File System. Persistent per-origin storage that survives page reloads.\n Standard commands: ls, cat, head, tail, grep, wc, find, tree, mkdir, touch, cp, mv, rm, tee.`\n"],"mappings":";AAcA;AAAA,EAOE,gBAAAA;AAAA,EACA;AAAA,OACK;;;ACTP,SAAS,gBAAgB;AAMlB,IAAM,eAAN,cAA2B,SAAS;AAAA,EACxB;AAAA,EAEjB,YAAY,UAA8B;AACxC,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,UAAM,KAAK,WAAW;AACtB,WAAO,YAAS,KAAK,UAAU,KAAK;AAAA,EACtC;AAAA,EAEA,MAAM,WAAuC;AAC3C,UAAM,SAAS,MAAM,KAAK,WAAW;AACrC,UAAM,QAAoC,CAAC;AAC3C,UAAM,UAAU,QAAQ,IAAI,KAAK;AACjC,UAAM,OAAiB,CAAC;AACxB,UAAM,SAAS,QAAQ,IAAI,IAAI;AAC/B,SAAK,KAAK;AACV,WAAO;AAAA,MACL,MAAM,KAAK;AAAA,MACX;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EAEA,MAAM,UAAU,OAAyC;AACvD,UAAM,SAAS,MAAM,KAAK,WAAW;AACrC,eAAW,OAAO,MAAM,MAAM;AAC5B,YAAM,MAAM,YAAY,GAAG;AAC3B,UAAI,QAAQ,GAAI;AAChB,YAAM,eAAe,QAAQ,GAAG;AAAA,IAClC;AACA,eAAW,CAAC,KAAK,IAAI,KAAK,OAAO,QAAQ,MAAM,KAAK,GAAG;AACrD,YAAM,OAAO,IAAI,MAAM,GAAG,EAAE,OAAO,CAAC,MAAM,MAAM,MAAM,MAAM,GAAG;AAC/D,YAAM,WAAW,KAAK,IAAI;AAC1B,UAAI,aAAa,OAAW;AAC5B,UAAI,MAAM;AACV,iBAAW,OAAO,MAAM;AACtB,cAAM,MAAM,IAAI,mBAAmB,KAAK,EAAE,QAAQ,KAAK,CAAC;AAAA,MAC1D;AACA,YAAM,KAAK,MAAM,IAAI,cAAc,UAAU,EAAE,QAAQ,KAAK,CAAC;AAC7D,YAAM,WAAW,MAAM,GAAG,eAAe;AACzC,YAAM,SAAS,MAAM,gBAAgB,IAAI,CAAC;AAC1C,YAAM,SAAS,MAAM;AAAA,IACvB;AAAA,EACF;AACF;","names":["ResourceName","ResourceName","copy","enoent","enoent","ResourceName","ResourceName","enoent","enoent","ResourceName","ResourceName","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","record","ResourceName","record","ResourceName","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","IOResult","ResourceName","command","specOf","IOResult","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","IOResult","ResourceName","command","specOf","IOResult","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","IOResult","ResourceName","command","specOf","IOResult","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","FileType","IOResult","ResourceName","command","specOf","IOResult","FileType","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","headerAggregate","specOf","command","ResourceName","specOf","headerAggregate","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","IOResult","ResourceName","command","specOf","ENC","IOResult","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","command","specOf","command","ResourceName","specOf","ResourceName","record","ResourceName","record","ResourceName","gnuBasename","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName"]}
|