@struktoai/mirage-node 0.0.7 → 0.0.8
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 +143 -48
- package/dist/accessor/disk.d.ts +6 -0
- package/dist/accessor/disk.d.ts.map +1 -1
- package/dist/accessor/disk.js +8 -0
- package/dist/accessor/disk.js.map +1 -1
- package/dist/accessor/email.d.ts.map +1 -1
- package/dist/accessor/email.js +5 -0
- package/dist/accessor/email.js.map +1 -1
- package/dist/accessor/gridfs.d.ts.map +1 -1
- package/dist/accessor/gridfs.js +6 -1
- package/dist/accessor/gridfs.js.map +1 -1
- package/dist/accessor/hf_hub.d.ts +3 -7
- package/dist/accessor/hf_hub.d.ts.map +1 -1
- package/dist/accessor/hf_hub.js +10 -10
- package/dist/accessor/hf_hub.js.map +1 -1
- package/dist/cache/file/redis.d.ts +8 -7
- package/dist/cache/file/redis.d.ts.map +1 -1
- package/dist/cache/file/redis.js +46 -50
- package/dist/cache/file/redis.js.map +1 -1
- package/dist/commands/builtin/utils/http.js +13 -5
- package/dist/commands/builtin/utils/http.js.map +1 -1
- package/dist/commands/cli/builtin/hf/index.d.ts.map +1 -1
- package/dist/commands/cli/builtin/hf/index.js +4 -5
- package/dist/commands/cli/builtin/hf/index.js.map +1 -1
- package/dist/commands/cli/builtin/hf/upload.d.ts.map +1 -1
- package/dist/commands/cli/builtin/hf/upload.js +2 -5
- package/dist/commands/cli/builtin/hf/upload.js.map +1 -1
- package/dist/commands/cli/builtin/himalaya/builder.d.ts +2 -2
- package/dist/commands/cli/builtin/himalaya/builder.d.ts.map +1 -1
- package/dist/commands/cli/builtin/himalaya/builder.js +1 -1
- package/dist/commands/cli/builtin/himalaya/builder.js.map +1 -1
- package/dist/commands/cli/builtin/himalaya/deliver.d.ts +35 -7
- package/dist/commands/cli/builtin/himalaya/deliver.d.ts.map +1 -1
- package/dist/commands/cli/builtin/himalaya/deliver.js.map +1 -1
- package/dist/commands/cli/builtin/himalaya/index.d.ts.map +1 -1
- package/dist/commands/cli/builtin/himalaya/index.js +4 -5
- package/dist/commands/cli/builtin/himalaya/index.js.map +1 -1
- package/dist/commands/cli/builtin/himalaya/query.d.ts +2 -2
- package/dist/commands/cli/builtin/himalaya/query.d.ts.map +1 -1
- package/dist/commands/cli/builtin/himalaya/query.js +1 -1
- package/dist/commands/cli/builtin/himalaya/query.js.map +1 -1
- package/dist/commands/cli/builtin/himalaya/send.d.ts.map +1 -1
- package/dist/commands/cli/builtin/himalaya/send.js +2 -1
- package/dist/commands/cli/builtin/himalaya/send.js.map +1 -1
- package/dist/commands/cli/builtin/himalaya/smtp.d.ts +2 -2
- package/dist/commands/cli/builtin/himalaya/smtp.d.ts.map +1 -1
- package/dist/commands/cli/builtin/himalaya/smtp.js +5 -0
- package/dist/commands/cli/builtin/himalaya/smtp.js.map +1 -1
- package/dist/commands/cli/builtin/himalaya/util.d.ts +1 -1
- package/dist/commands/cli/builtin/himalaya/util.d.ts.map +1 -1
- package/dist/commands/cli/builtin/himalaya/util.js +6 -5
- package/dist/commands/cli/builtin/himalaya/util.js.map +1 -1
- package/dist/config.d.ts +57 -37
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +152 -277
- package/dist/config.js.map +1 -1
- package/dist/core/disk/capacity.d.ts +13 -0
- package/dist/core/disk/capacity.d.ts.map +1 -0
- package/dist/core/disk/capacity.js +93 -0
- package/dist/core/disk/capacity.js.map +1 -0
- package/dist/core/disk/constants.d.ts +0 -1
- package/dist/core/disk/constants.d.ts.map +1 -1
- package/dist/core/disk/constants.js +0 -1
- package/dist/core/disk/constants.js.map +1 -1
- package/dist/core/disk/copy.d.ts.map +1 -1
- package/dist/core/disk/copy.js +24 -13
- package/dist/core/disk/copy.js.map +1 -1
- package/dist/core/disk/mkdir.d.ts.map +1 -1
- package/dist/core/disk/mkdir.js +9 -0
- package/dist/core/disk/mkdir.js.map +1 -1
- package/dist/core/disk/read.d.ts +3 -3
- package/dist/core/disk/read.d.ts.map +1 -1
- package/dist/core/disk/read.js +4 -19
- package/dist/core/disk/read.js.map +1 -1
- package/dist/core/disk/rename.d.ts +3 -0
- package/dist/core/disk/rename.d.ts.map +1 -1
- package/dist/core/disk/rename.js +15 -1
- package/dist/core/disk/rename.js.map +1 -1
- package/dist/core/disk/rm.d.ts.map +1 -1
- package/dist/core/disk/rm.js +11 -1
- package/dist/core/disk/rm.js.map +1 -1
- package/dist/core/disk/rmdir.d.ts.map +1 -1
- package/dist/core/disk/rmdir.js +4 -0
- package/dist/core/disk/rmdir.js.map +1 -1
- package/dist/core/disk/set_attrs.d.ts +2 -9
- package/dist/core/disk/set_attrs.d.ts.map +1 -1
- package/dist/core/disk/set_attrs.js +2 -1
- package/dist/core/disk/set_attrs.js.map +1 -1
- package/dist/core/disk/stream.d.ts +8 -0
- package/dist/core/disk/stream.d.ts.map +1 -1
- package/dist/core/disk/stream.js +33 -13
- package/dist/core/disk/stream.js.map +1 -1
- package/dist/core/disk/unlink.d.ts.map +1 -1
- package/dist/core/disk/unlink.js +4 -0
- package/dist/core/disk/unlink.js.map +1 -1
- package/dist/core/disk/utils.d.ts +2 -0
- package/dist/core/disk/utils.d.ts.map +1 -1
- package/dist/core/disk/utils.js +68 -21
- package/dist/core/disk/utils.js.map +1 -1
- package/dist/core/disk/write.d.ts +7 -2
- package/dist/core/disk/write.d.ts.map +1 -1
- package/dist/core/disk/write.js +22 -16
- package/dist/core/disk/write.js.map +1 -1
- package/dist/core/email/_parse.d.ts +60 -12
- package/dist/core/email/_parse.d.ts.map +1 -1
- package/dist/core/email/_parse.js +2 -2
- package/dist/core/email/_parse.js.map +1 -1
- package/dist/core/email/client.d.ts +36 -9
- package/dist/core/email/client.d.ts.map +1 -1
- package/dist/core/email/client.js +15 -0
- package/dist/core/email/client.js.map +1 -1
- package/dist/core/email/config.d.ts +6 -9
- package/dist/core/email/config.d.ts.map +1 -1
- package/dist/core/email/config.js +31 -27
- package/dist/core/email/config.js.map +1 -1
- package/dist/core/email/readdir.d.ts +2 -2
- package/dist/core/email/readdir.d.ts.map +1 -1
- package/dist/core/email/readdir.js +1 -1
- package/dist/core/email/readdir.js.map +1 -1
- package/dist/core/email/render.d.ts +5 -5
- package/dist/core/email/render.d.ts.map +1 -1
- package/dist/core/email/render.js.map +1 -1
- package/dist/core/email/search.d.ts +2 -2
- package/dist/core/email/search.d.ts.map +1 -1
- package/dist/core/email/search.js +1 -1
- package/dist/core/email/search.js.map +1 -1
- package/dist/core/gridfs/client.d.ts +25 -2
- package/dist/core/gridfs/client.d.ts.map +1 -1
- package/dist/core/gridfs/client.js +74 -7
- package/dist/core/gridfs/client.js.map +1 -1
- package/dist/core/gridfs/constants.d.ts +1 -0
- package/dist/core/gridfs/constants.d.ts.map +1 -1
- package/dist/core/gridfs/constants.js +5 -0
- package/dist/core/gridfs/constants.js.map +1 -1
- package/dist/core/gridfs/driver.d.ts +1 -0
- package/dist/core/gridfs/driver.d.ts.map +1 -1
- package/dist/core/gridfs/driver.js +80 -67
- package/dist/core/gridfs/driver.js.map +1 -1
- package/dist/core/gridfs/events.d.ts +8 -3
- package/dist/core/gridfs/events.d.ts.map +1 -1
- package/dist/core/gridfs/events.js +11 -3
- package/dist/core/gridfs/events.js.map +1 -1
- package/dist/core/gridfs/read.d.ts +2 -7
- package/dist/core/gridfs/read.d.ts.map +1 -1
- package/dist/core/gridfs/read.js +4 -9
- package/dist/core/gridfs/read.js.map +1 -1
- package/dist/core/gridfs/stream.d.ts.map +1 -1
- package/dist/core/gridfs/stream.js +5 -2
- package/dist/core/gridfs/stream.js.map +1 -1
- package/dist/core/gridfs/write.d.ts +1 -1
- package/dist/core/gridfs/write.d.ts.map +1 -1
- package/dist/core/gridfs/write.js +2 -2
- package/dist/core/gridfs/write.js.map +1 -1
- package/dist/core/hf_buckets/driver.d.ts.map +1 -1
- package/dist/core/hf_buckets/driver.js +16 -0
- package/dist/core/hf_buckets/driver.js.map +1 -1
- package/dist/core/hf_buckets/read.d.ts +2 -6
- package/dist/core/hf_buckets/read.d.ts.map +1 -1
- package/dist/core/hf_buckets/read.js +1 -1
- package/dist/core/hf_buckets/read.js.map +1 -1
- package/dist/core/hf_buckets/stream.d.ts.map +1 -1
- package/dist/core/hf_buckets/stream.js +2 -0
- package/dist/core/hf_buckets/stream.js.map +1 -1
- package/dist/core/hf_hub/admin.d.ts +3 -4
- package/dist/core/hf_hub/admin.d.ts.map +1 -1
- package/dist/core/hf_hub/admin.js +4 -4
- package/dist/core/hf_hub/admin.js.map +1 -1
- package/dist/core/hf_hub/client.d.ts +11 -24
- package/dist/core/hf_hub/client.d.ts.map +1 -1
- package/dist/core/hf_hub/client.js +40 -97
- package/dist/core/hf_hub/client.js.map +1 -1
- package/dist/core/hf_hub/commit.d.ts +8 -9
- package/dist/core/hf_hub/commit.d.ts.map +1 -1
- package/dist/core/hf_hub/commit.js +4 -6
- package/dist/core/hf_hub/commit.js.map +1 -1
- package/dist/core/hf_hub/config.d.ts +5 -4
- package/dist/core/hf_hub/config.d.ts.map +1 -1
- package/dist/core/hf_hub/config.js +3 -1
- package/dist/core/hf_hub/config.js.map +1 -1
- package/dist/core/hf_hub/constants.d.ts +0 -1
- package/dist/core/hf_hub/constants.d.ts.map +1 -1
- package/dist/core/hf_hub/constants.js +0 -1
- package/dist/core/hf_hub/constants.js.map +1 -1
- package/dist/core/hf_hub/read.d.ts +2 -5
- package/dist/core/hf_hub/read.d.ts.map +1 -1
- package/dist/core/hf_hub/read.js.map +1 -1
- package/dist/core/hf_hub/stream.d.ts.map +1 -1
- package/dist/core/hf_hub/stream.js +2 -0
- package/dist/core/hf_hub/stream.js.map +1 -1
- package/dist/core/nextcloud/capacity.js.map +1 -1
- package/dist/core/nextcloud/checksum.js +4 -3
- package/dist/core/nextcloud/checksum.js.map +1 -1
- package/dist/core/nextcloud/constants.d.ts +2 -0
- package/dist/core/nextcloud/constants.d.ts.map +1 -1
- package/dist/core/nextcloud/constants.js +4 -0
- package/dist/core/nextcloud/constants.js.map +1 -1
- package/dist/core/nextcloud/copy.js.map +1 -1
- package/dist/core/nextcloud/dav.d.ts +9 -3
- package/dist/core/nextcloud/dav.d.ts.map +1 -1
- package/dist/core/nextcloud/dav.js +20 -2
- package/dist/core/nextcloud/dav.js.map +1 -1
- package/dist/core/nextcloud/read.d.ts +2 -6
- package/dist/core/nextcloud/read.d.ts.map +1 -1
- package/dist/core/nextcloud/read.js +1 -1
- package/dist/core/nextcloud/read.js.map +1 -1
- package/dist/core/nextcloud/search/query.js +2 -2
- package/dist/core/nextcloud/search/query.js.map +1 -1
- package/dist/core/nextcloud/search/response.d.ts +3 -2
- package/dist/core/nextcloud/search/response.d.ts.map +1 -1
- package/dist/core/nextcloud/search/response.js +5 -5
- package/dist/core/nextcloud/search/response.js.map +1 -1
- package/dist/core/nextcloud/search/types.d.ts +1 -1
- package/dist/core/nextcloud/search/types.d.ts.map +1 -1
- package/dist/core/nextcloud/set_attrs.js.map +1 -1
- package/dist/core/nextcloud/stat.d.ts.map +1 -1
- package/dist/core/nextcloud/stat.js +7 -9
- package/dist/core/nextcloud/stat.js.map +1 -1
- package/dist/core/nextcloud/stream.d.ts.map +1 -1
- package/dist/core/nextcloud/stream.js +2 -0
- package/dist/core/nextcloud/stream.js.map +1 -1
- package/dist/core/nextcloud/write.d.ts +7 -1
- package/dist/core/nextcloud/write.d.ts.map +1 -1
- package/dist/core/nextcloud/write.js +81 -8
- package/dist/core/nextcloud/write.js.map +1 -1
- package/dist/core/ssh/append.d.ts +1 -2
- package/dist/core/ssh/append.d.ts.map +1 -1
- package/dist/core/ssh/append.js +1 -4
- package/dist/core/ssh/append.js.map +1 -1
- package/dist/core/ssh/checksum.d.ts.map +1 -1
- package/dist/core/ssh/checksum.js +1 -0
- package/dist/core/ssh/checksum.js.map +1 -1
- package/dist/core/ssh/rm.d.ts.map +1 -1
- package/dist/core/ssh/rm.js +15 -6
- package/dist/core/ssh/rm.js.map +1 -1
- package/dist/core/ssh/rmdir.d.ts.map +1 -1
- package/dist/core/ssh/rmdir.js +2 -22
- package/dist/core/ssh/rmdir.js.map +1 -1
- package/dist/core/ssh/set_attrs.d.ts +2 -9
- package/dist/core/ssh/set_attrs.d.ts.map +1 -1
- package/dist/core/ssh/set_attrs.js +1 -1
- package/dist/core/ssh/set_attrs.js.map +1 -1
- package/dist/core/ssh/stat.d.ts.map +1 -1
- package/dist/core/ssh/stat.js +5 -4
- package/dist/core/ssh/stat.js.map +1 -1
- package/dist/core/ssh/stream.d.ts.map +1 -1
- package/dist/core/ssh/stream.js +10 -1
- package/dist/core/ssh/stream.js.map +1 -1
- package/dist/core/ssh/utils.d.ts +8 -2
- package/dist/core/ssh/utils.d.ts.map +1 -1
- package/dist/core/ssh/utils.js +24 -3
- package/dist/core/ssh/utils.js.map +1 -1
- package/dist/core/ssh/write.d.ts +1 -2
- package/dist/core/ssh/write.d.ts.map +1 -1
- package/dist/core/ssh/write.js +1 -4
- package/dist/core/ssh/write.js.map +1 -1
- package/dist/fuse/constants.d.ts +3 -2
- package/dist/fuse/constants.d.ts.map +1 -1
- package/dist/fuse/constants.js +6 -3
- package/dist/fuse/constants.js.map +1 -1
- package/dist/fuse/fs.d.ts +1 -1
- package/dist/fuse/fs.d.ts.map +1 -1
- package/dist/fuse/fs.js +6 -3
- package/dist/fuse/fs.js.map +1 -1
- package/dist/fuse/mount.d.ts +5 -0
- package/dist/fuse/mount.d.ts.map +1 -1
- package/dist/fuse/mount.js +47 -15
- package/dist/fuse/mount.js.map +1 -1
- package/dist/index.d.ts +130 -159
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +86 -135
- package/dist/index.js.map +1 -1
- package/dist/io/gateway.d.ts +6 -0
- package/dist/io/gateway.d.ts.map +1 -0
- package/dist/io/gateway.js +357 -0
- package/dist/io/gateway.js.map +1 -0
- package/dist/io/network.d.ts +35 -0
- package/dist/io/network.d.ts.map +1 -0
- package/dist/io/network.js +187 -0
- package/dist/io/network.js.map +1 -0
- package/dist/io/spool.js +3 -3
- package/dist/io/spool.js.map +1 -1
- package/dist/mount/constants.d.ts +9 -2
- package/dist/mount/constants.d.ts.map +1 -1
- package/dist/mount/constants.js +9 -2
- package/dist/mount/constants.js.map +1 -1
- package/dist/mount/errors.d.ts +2 -11
- package/dist/mount/errors.d.ts.map +1 -1
- package/dist/mount/errors.js +28 -42
- package/dist/mount/errors.js.map +1 -1
- package/dist/mount/nfs.d.ts +2 -2
- package/dist/mount/nfs.d.ts.map +1 -1
- package/dist/mount/nfs.js +8 -20
- package/dist/mount/nfs.js.map +1 -1
- package/dist/mount/sftp.d.ts +3 -3
- package/dist/mount/sftp.d.ts.map +1 -1
- package/dist/mount/sftp.js +26 -53
- package/dist/mount/sftp.js.map +1 -1
- package/dist/observe/disk_store.js +1 -1
- package/dist/observe/disk_store.js.map +1 -1
- package/dist/runtime/js/host/constants.d.ts +1 -1
- package/dist/runtime/js/host/constants.d.ts.map +1 -1
- package/dist/runtime/js/host/constants.js +9 -8
- package/dist/runtime/js/host/constants.js.map +1 -1
- package/dist/runtime/js/host/descriptors.d.ts +11 -71
- package/dist/runtime/js/host/descriptors.d.ts.map +1 -1
- package/dist/runtime/js/host/descriptors.js +16 -202
- package/dist/runtime/js/host/descriptors.js.map +1 -1
- package/dist/runtime/js/host/fs.d.ts.map +1 -1
- package/dist/runtime/js/host/fs.js +491 -135
- package/dist/runtime/js/host/fs.js.map +1 -1
- package/dist/runtime/js/host/list.d.ts +21 -0
- package/dist/runtime/js/host/list.d.ts.map +1 -0
- package/dist/runtime/js/host/list.js +107 -0
- package/dist/runtime/js/host/list.js.map +1 -0
- package/dist/runtime/js/host/stat.d.ts +10 -0
- package/dist/runtime/js/host/stat.d.ts.map +1 -0
- package/dist/runtime/js/host/stat.js +70 -0
- package/dist/runtime/js/host/stat.js.map +1 -0
- package/dist/runtime/python/local/runtime.d.ts +8 -7
- package/dist/runtime/python/local/runtime.d.ts.map +1 -1
- package/dist/runtime/python/local/runtime.js +51 -74
- package/dist/runtime/python/local/runtime.js.map +1 -1
- package/dist/runtime/sandbox/apple_container/constants.d.ts +2 -3
- package/dist/runtime/sandbox/apple_container/constants.d.ts.map +1 -1
- package/dist/runtime/sandbox/apple_container/constants.js +4 -11
- package/dist/runtime/sandbox/apple_container/constants.js.map +1 -1
- package/dist/runtime/sandbox/apple_container/runtime.d.ts +14 -10
- package/dist/runtime/sandbox/apple_container/runtime.d.ts.map +1 -1
- package/dist/runtime/sandbox/apple_container/runtime.js +38 -57
- package/dist/runtime/sandbox/apple_container/runtime.js.map +1 -1
- package/dist/runtime/sandbox/daytona/constants.d.ts +27 -0
- package/dist/runtime/sandbox/daytona/constants.d.ts.map +1 -0
- package/dist/runtime/sandbox/daytona/constants.js +47 -0
- package/dist/runtime/sandbox/daytona/constants.js.map +1 -0
- package/dist/runtime/sandbox/daytona/runtime.d.ts +6 -4
- package/dist/runtime/sandbox/daytona/runtime.d.ts.map +1 -1
- package/dist/runtime/sandbox/daytona/runtime.js +13 -9
- package/dist/runtime/sandbox/daytona/runtime.js.map +1 -1
- package/dist/runtime/sandbox/docker/constants.d.ts +6 -1
- package/dist/runtime/sandbox/docker/constants.d.ts.map +1 -1
- package/dist/runtime/sandbox/docker/constants.js +6 -1
- package/dist/runtime/sandbox/docker/constants.js.map +1 -1
- package/dist/runtime/sandbox/docker/runtime.d.ts +8 -6
- package/dist/runtime/sandbox/docker/runtime.d.ts.map +1 -1
- package/dist/runtime/sandbox/docker/runtime.js +22 -28
- package/dist/runtime/sandbox/docker/runtime.js.map +1 -1
- package/dist/runtime/sandbox/microsandbox/constants.d.ts +1 -3
- package/dist/runtime/sandbox/microsandbox/constants.d.ts.map +1 -1
- package/dist/runtime/sandbox/microsandbox/constants.js +1 -5
- package/dist/runtime/sandbox/microsandbox/constants.js.map +1 -1
- package/dist/runtime/sandbox/microsandbox/runtime.d.ts +9 -8
- package/dist/runtime/sandbox/microsandbox/runtime.d.ts.map +1 -1
- package/dist/runtime/sandbox/microsandbox/runtime.js +26 -56
- package/dist/runtime/sandbox/microsandbox/runtime.js.map +1 -1
- package/dist/runtime/sandbox/program.d.ts +165 -0
- package/dist/runtime/sandbox/program.d.ts.map +1 -0
- package/dist/runtime/sandbox/program.js +724 -0
- package/dist/runtime/sandbox/program.js.map +1 -0
- package/dist/runtime/sandbox/sandlock/constants.d.ts +1 -1
- package/dist/runtime/sandbox/sandlock/constants.d.ts.map +1 -1
- package/dist/runtime/sandbox/sandlock/constants.js +1 -1
- package/dist/runtime/sandbox/sandlock/constants.js.map +1 -1
- package/dist/runtime/sandbox/sandlock/runtime.d.ts +5 -6
- package/dist/runtime/sandbox/sandlock/runtime.d.ts.map +1 -1
- package/dist/runtime/sandbox/sandlock/runtime.js +27 -16
- package/dist/runtime/sandbox/sandlock/runtime.js.map +1 -1
- package/dist/runtime/sandbox/smolvm/constants.d.ts +2 -3
- package/dist/runtime/sandbox/smolvm/constants.d.ts.map +1 -1
- package/dist/runtime/sandbox/smolvm/constants.js +6 -13
- package/dist/runtime/sandbox/smolvm/constants.js.map +1 -1
- package/dist/runtime/sandbox/smolvm/runtime.d.ts +9 -8
- package/dist/runtime/sandbox/smolvm/runtime.d.ts.map +1 -1
- package/dist/runtime/sandbox/smolvm/runtime.js +24 -45
- package/dist/runtime/sandbox/smolvm/runtime.js.map +1 -1
- package/dist/runtime/sandbox/ssh/runtime.d.ts +23 -12
- package/dist/runtime/sandbox/ssh/runtime.d.ts.map +1 -1
- package/dist/runtime/sandbox/ssh/runtime.js +88 -30
- package/dist/runtime/sandbox/ssh/runtime.js.map +1 -1
- package/dist/secrets/config.d.ts +2 -2
- package/dist/secrets/config.d.ts.map +1 -1
- package/dist/secrets/onepassword.d.ts +5 -8
- package/dist/secrets/onepassword.d.ts.map +1 -1
- package/dist/secrets/onepassword.js.map +1 -1
- package/dist/shell/console/redis/constants.d.ts +1 -0
- package/dist/shell/console/redis/constants.d.ts.map +1 -1
- package/dist/shell/console/redis/constants.js +3 -0
- package/dist/shell/console/redis/constants.js.map +1 -1
- package/dist/shell/console/redis/store.d.ts +24 -9
- package/dist/shell/console/redis/store.d.ts.map +1 -1
- package/dist/shell/console/redis/store.js +48 -16
- package/dist/shell/console/redis/store.js.map +1 -1
- package/dist/shell/job_table/redis.d.ts +52 -0
- package/dist/shell/job_table/redis.d.ts.map +1 -0
- package/dist/shell/job_table/redis.js +156 -0
- package/dist/shell/job_table/redis.js.map +1 -0
- package/dist/utils/loader.d.ts.map +1 -1
- package/dist/utils/loader.js +1 -3
- package/dist/utils/loader.js.map +1 -1
- package/dist/vfs/aliyun/aliyun.d.ts +4 -5
- package/dist/vfs/aliyun/aliyun.d.ts.map +1 -1
- package/dist/vfs/aliyun/aliyun.js +2 -4
- package/dist/vfs/aliyun/aliyun.js.map +1 -1
- package/dist/vfs/aliyun/config.d.ts +40 -6
- package/dist/vfs/aliyun/config.d.ts.map +1 -1
- package/dist/vfs/aliyun/config.js +5 -6
- package/dist/vfs/aliyun/config.js.map +1 -1
- package/dist/vfs/backblaze/backblaze.d.ts +4 -5
- package/dist/vfs/backblaze/backblaze.d.ts.map +1 -1
- package/dist/vfs/backblaze/backblaze.js +2 -4
- package/dist/vfs/backblaze/backblaze.js.map +1 -1
- package/dist/vfs/backblaze/config.d.ts +40 -6
- package/dist/vfs/backblaze/config.d.ts.map +1 -1
- package/dist/vfs/backblaze/config.js +5 -6
- package/dist/vfs/backblaze/config.js.map +1 -1
- package/dist/vfs/ceph/ceph.d.ts +4 -5
- package/dist/vfs/ceph/ceph.d.ts.map +1 -1
- package/dist/vfs/ceph/ceph.js +2 -4
- package/dist/vfs/ceph/ceph.js.map +1 -1
- package/dist/vfs/ceph/config.d.ts +42 -5
- package/dist/vfs/ceph/config.d.ts.map +1 -1
- package/dist/vfs/ceph/config.js +7 -5
- package/dist/vfs/ceph/config.js.map +1 -1
- package/dist/vfs/databricks_volume/config.d.ts +2 -2
- package/dist/vfs/databricks_volume/config.d.ts.map +1 -1
- package/dist/vfs/databricks_volume/config.js +1 -1
- package/dist/vfs/databricks_volume/config.js.map +1 -1
- package/dist/vfs/databricks_volume/databricks_volume.d.ts +6 -9
- package/dist/vfs/databricks_volume/databricks_volume.d.ts.map +1 -1
- package/dist/vfs/databricks_volume/databricks_volume.js +4 -9
- package/dist/vfs/databricks_volume/databricks_volume.js.map +1 -1
- package/dist/vfs/digitalocean/config.d.ts +40 -6
- package/dist/vfs/digitalocean/config.d.ts.map +1 -1
- package/dist/vfs/digitalocean/config.js +5 -6
- package/dist/vfs/digitalocean/config.js.map +1 -1
- package/dist/vfs/digitalocean/digitalocean.d.ts +4 -5
- package/dist/vfs/digitalocean/digitalocean.d.ts.map +1 -1
- package/dist/vfs/digitalocean/digitalocean.js +2 -4
- package/dist/vfs/digitalocean/digitalocean.js.map +1 -1
- package/dist/vfs/discord/discord.d.ts +7 -10
- package/dist/vfs/discord/discord.d.ts.map +1 -1
- package/dist/vfs/discord/discord.js +7 -12
- package/dist/vfs/discord/discord.js.map +1 -1
- package/dist/vfs/disk/disk.d.ts +14 -14
- package/dist/vfs/disk/disk.d.ts.map +1 -1
- package/dist/vfs/disk/disk.js +87 -52
- package/dist/vfs/disk/disk.js.map +1 -1
- package/dist/vfs/dropbox/config.d.ts +7 -12
- package/dist/vfs/dropbox/config.d.ts.map +1 -1
- package/dist/vfs/dropbox/config.js +18 -15
- package/dist/vfs/dropbox/config.js.map +1 -1
- package/dist/vfs/email/email.d.ts +13 -11
- package/dist/vfs/email/email.d.ts.map +1 -1
- package/dist/vfs/email/email.js +31 -16
- package/dist/vfs/email/email.js.map +1 -1
- package/dist/vfs/email/index.d.ts +1 -2
- package/dist/vfs/email/index.d.ts.map +1 -1
- package/dist/vfs/email/index.js +1 -2
- package/dist/vfs/email/index.js.map +1 -1
- package/dist/vfs/gcs/config.d.ts +36 -28
- package/dist/vfs/gcs/config.d.ts.map +1 -1
- package/dist/vfs/gcs/config.js +15 -39
- package/dist/vfs/gcs/config.js.map +1 -1
- package/dist/vfs/gcs/gcs.d.ts +4 -5
- package/dist/vfs/gcs/gcs.d.ts.map +1 -1
- package/dist/vfs/gcs/gcs.js +2 -4
- package/dist/vfs/gcs/gcs.js.map +1 -1
- package/dist/vfs/gridfs/config.d.ts +6 -7
- package/dist/vfs/gridfs/config.d.ts.map +1 -1
- package/dist/vfs/gridfs/config.js +25 -11
- package/dist/vfs/gridfs/config.js.map +1 -1
- package/dist/vfs/gridfs/gridfs.d.ts +10 -18
- package/dist/vfs/gridfs/gridfs.d.ts.map +1 -1
- package/dist/vfs/gridfs/gridfs.js +23 -40
- package/dist/vfs/gridfs/gridfs.js.map +1 -1
- package/dist/vfs/hf_buckets/config.d.ts +14 -17
- package/dist/vfs/hf_buckets/config.d.ts.map +1 -1
- package/dist/vfs/hf_buckets/config.js +41 -28
- package/dist/vfs/hf_buckets/config.js.map +1 -1
- package/dist/vfs/hf_buckets/hf_buckets.d.ts +10 -15
- package/dist/vfs/hf_buckets/hf_buckets.d.ts.map +1 -1
- package/dist/vfs/hf_buckets/hf_buckets.js +14 -22
- package/dist/vfs/hf_buckets/hf_buckets.js.map +1 -1
- package/dist/vfs/hf_datasets/config.d.ts +1 -4
- package/dist/vfs/hf_datasets/config.d.ts.map +1 -1
- package/dist/vfs/hf_datasets/config.js +1 -3
- package/dist/vfs/hf_datasets/config.js.map +1 -1
- package/dist/vfs/hf_datasets/hf_datasets.d.ts +4 -7
- package/dist/vfs/hf_datasets/hf_datasets.d.ts.map +1 -1
- package/dist/vfs/hf_datasets/hf_datasets.js +4 -6
- package/dist/vfs/hf_datasets/hf_datasets.js.map +1 -1
- package/dist/vfs/hf_hub/base.d.ts +4 -8
- package/dist/vfs/hf_hub/base.d.ts.map +1 -1
- package/dist/vfs/hf_hub/base.js +7 -11
- package/dist/vfs/hf_hub/base.js.map +1 -1
- package/dist/vfs/hf_models/config.d.ts +1 -4
- package/dist/vfs/hf_models/config.d.ts.map +1 -1
- package/dist/vfs/hf_models/config.js +1 -3
- package/dist/vfs/hf_models/config.js.map +1 -1
- package/dist/vfs/hf_models/hf_models.d.ts +4 -7
- package/dist/vfs/hf_models/hf_models.d.ts.map +1 -1
- package/dist/vfs/hf_models/hf_models.js +4 -6
- package/dist/vfs/hf_models/hf_models.js.map +1 -1
- package/dist/vfs/hf_spaces/config.d.ts +1 -4
- package/dist/vfs/hf_spaces/config.d.ts.map +1 -1
- package/dist/vfs/hf_spaces/config.js +1 -3
- package/dist/vfs/hf_spaces/config.js.map +1 -1
- package/dist/vfs/hf_spaces/hf_spaces.d.ts +4 -7
- package/dist/vfs/hf_spaces/hf_spaces.d.ts.map +1 -1
- package/dist/vfs/hf_spaces/hf_spaces.js +4 -6
- package/dist/vfs/hf_spaces/hf_spaces.js.map +1 -1
- package/dist/vfs/jaeger/jaeger.d.ts +7 -9
- package/dist/vfs/jaeger/jaeger.d.ts.map +1 -1
- package/dist/vfs/jaeger/jaeger.js +7 -11
- package/dist/vfs/jaeger/jaeger.js.map +1 -1
- package/dist/vfs/lancedb/lancedb.d.ts +10 -11
- package/dist/vfs/lancedb/lancedb.d.ts.map +1 -1
- package/dist/vfs/lancedb/lancedb.js +4 -5
- package/dist/vfs/lancedb/lancedb.js.map +1 -1
- package/dist/vfs/lancedb/store.d.ts +2 -2
- package/dist/vfs/lancedb/store.d.ts.map +1 -1
- package/dist/vfs/lancedb/store.js +3 -0
- package/dist/vfs/lancedb/store.js.map +1 -1
- package/dist/vfs/minio/config.d.ts +42 -5
- package/dist/vfs/minio/config.d.ts.map +1 -1
- package/dist/vfs/minio/config.js +7 -5
- package/dist/vfs/minio/config.js.map +1 -1
- package/dist/vfs/minio/minio.d.ts +4 -5
- package/dist/vfs/minio/minio.d.ts.map +1 -1
- package/dist/vfs/minio/minio.js +2 -4
- package/dist/vfs/minio/minio.js.map +1 -1
- package/dist/vfs/mongodb/mongodb.d.ts +10 -11
- package/dist/vfs/mongodb/mongodb.d.ts.map +1 -1
- package/dist/vfs/mongodb/mongodb.js +6 -7
- package/dist/vfs/mongodb/mongodb.js.map +1 -1
- package/dist/vfs/mongodb/store.d.ts +2 -1
- package/dist/vfs/mongodb/store.d.ts.map +1 -1
- package/dist/vfs/mongodb/store.js +11 -3
- package/dist/vfs/mongodb/store.js.map +1 -1
- package/dist/vfs/nextcloud/config.d.ts +5 -8
- package/dist/vfs/nextcloud/config.d.ts.map +1 -1
- package/dist/vfs/nextcloud/config.js +19 -13
- package/dist/vfs/nextcloud/config.js.map +1 -1
- package/dist/vfs/nextcloud/nextcloud.d.ts +8 -14
- package/dist/vfs/nextcloud/nextcloud.d.ts.map +1 -1
- package/dist/vfs/nextcloud/nextcloud.js +18 -29
- package/dist/vfs/nextcloud/nextcloud.js.map +1 -1
- package/dist/vfs/notion/notion.d.ts +7 -10
- package/dist/vfs/notion/notion.d.ts.map +1 -1
- package/dist/vfs/notion/notion.js +7 -10
- package/dist/vfs/notion/notion.js.map +1 -1
- package/dist/vfs/oci/config.d.ts +41 -27
- package/dist/vfs/oci/config.d.ts.map +1 -1
- package/dist/vfs/oci/config.js +18 -45
- package/dist/vfs/oci/config.js.map +1 -1
- package/dist/vfs/oci/oci.d.ts +4 -5
- package/dist/vfs/oci/oci.d.ts.map +1 -1
- package/dist/vfs/oci/oci.js +2 -4
- package/dist/vfs/oci/oci.js.map +1 -1
- package/dist/vfs/postgres/postgres.d.ts +10 -11
- package/dist/vfs/postgres/postgres.d.ts.map +1 -1
- package/dist/vfs/postgres/postgres.js +5 -6
- package/dist/vfs/postgres/postgres.js.map +1 -1
- package/dist/vfs/postgres/store.d.ts +3 -3
- package/dist/vfs/postgres/store.d.ts.map +1 -1
- package/dist/vfs/postgres/store.js +1 -0
- package/dist/vfs/postgres/store.js.map +1 -1
- package/dist/vfs/qingstor/config.d.ts +40 -6
- package/dist/vfs/qingstor/config.d.ts.map +1 -1
- package/dist/vfs/qingstor/config.js +5 -6
- package/dist/vfs/qingstor/config.js.map +1 -1
- package/dist/vfs/qingstor/qingstor.d.ts +4 -5
- package/dist/vfs/qingstor/qingstor.d.ts.map +1 -1
- package/dist/vfs/qingstor/qingstor.js +2 -4
- package/dist/vfs/qingstor/qingstor.js.map +1 -1
- package/dist/vfs/r2/config.d.ts +39 -28
- package/dist/vfs/r2/config.d.ts.map +1 -1
- package/dist/vfs/r2/config.js +24 -48
- package/dist/vfs/r2/config.js.map +1 -1
- package/dist/vfs/r2/r2.d.ts +4 -5
- package/dist/vfs/r2/r2.d.ts.map +1 -1
- package/dist/vfs/r2/r2.js +2 -4
- package/dist/vfs/r2/r2.js.map +1 -1
- package/dist/vfs/redis/redis.d.ts +3 -0
- package/dist/vfs/redis/redis.d.ts.map +1 -1
- package/dist/vfs/redis/redis.js +1 -1
- package/dist/vfs/redis/redis.js.map +1 -1
- package/dist/vfs/redis/store.d.ts +2 -0
- package/dist/vfs/redis/store.d.ts.map +1 -1
- package/dist/vfs/redis/store.js +13 -2
- package/dist/vfs/redis/store.js.map +1 -1
- package/dist/vfs/registry.d.ts.map +1 -1
- package/dist/vfs/registry.js +111 -105
- package/dist/vfs/registry.js.map +1 -1
- package/dist/vfs/s3/config.d.ts +12 -23
- package/dist/vfs/s3/config.d.ts.map +1 -1
- package/dist/vfs/s3/config.js +16 -31
- package/dist/vfs/s3/config.js.map +1 -1
- package/dist/vfs/s3/s3.d.ts +6 -9
- package/dist/vfs/s3/s3.d.ts.map +1 -1
- package/dist/vfs/s3/s3.js +11 -14
- package/dist/vfs/s3/s3.js.map +1 -1
- package/dist/vfs/s3_alias.d.ts +69 -53
- package/dist/vfs/s3_alias.d.ts.map +1 -1
- package/dist/vfs/s3_alias.js +86 -82
- package/dist/vfs/s3_alias.js.map +1 -1
- package/dist/vfs/scaleway/config.d.ts +40 -6
- package/dist/vfs/scaleway/config.d.ts.map +1 -1
- package/dist/vfs/scaleway/config.js +5 -6
- package/dist/vfs/scaleway/config.js.map +1 -1
- package/dist/vfs/scaleway/scaleway.d.ts +4 -5
- package/dist/vfs/scaleway/scaleway.d.ts.map +1 -1
- package/dist/vfs/scaleway/scaleway.js +2 -4
- package/dist/vfs/scaleway/scaleway.js.map +1 -1
- package/dist/vfs/seaweedfs/config.d.ts +42 -5
- package/dist/vfs/seaweedfs/config.d.ts.map +1 -1
- package/dist/vfs/seaweedfs/config.js +7 -5
- package/dist/vfs/seaweedfs/config.js.map +1 -1
- package/dist/vfs/seaweedfs/seaweedfs.d.ts +4 -5
- package/dist/vfs/seaweedfs/seaweedfs.d.ts.map +1 -1
- package/dist/vfs/seaweedfs/seaweedfs.js +2 -4
- package/dist/vfs/seaweedfs/seaweedfs.js.map +1 -1
- package/dist/vfs/slack/slack.d.ts +7 -10
- package/dist/vfs/slack/slack.d.ts.map +1 -1
- package/dist/vfs/slack/slack.js +7 -12
- package/dist/vfs/slack/slack.js.map +1 -1
- package/dist/vfs/ssh/config.d.ts +5 -9
- package/dist/vfs/ssh/config.d.ts.map +1 -1
- package/dist/vfs/ssh/config.js +28 -18
- package/dist/vfs/ssh/config.js.map +1 -1
- package/dist/vfs/ssh/ssh.d.ts +8 -17
- package/dist/vfs/ssh/ssh.d.ts.map +1 -1
- package/dist/vfs/ssh/ssh.js +25 -43
- package/dist/vfs/ssh/ssh.js.map +1 -1
- package/dist/vfs/supabase/config.d.ts +40 -27
- package/dist/vfs/supabase/config.d.ts.map +1 -1
- package/dist/vfs/supabase/config.js +24 -48
- package/dist/vfs/supabase/config.js.map +1 -1
- package/dist/vfs/supabase/supabase.d.ts +4 -5
- package/dist/vfs/supabase/supabase.d.ts.map +1 -1
- package/dist/vfs/supabase/supabase.js +2 -4
- package/dist/vfs/supabase/supabase.js.map +1 -1
- package/dist/vfs/tencent/config.d.ts +40 -6
- package/dist/vfs/tencent/config.d.ts.map +1 -1
- package/dist/vfs/tencent/config.js +5 -6
- package/dist/vfs/tencent/config.js.map +1 -1
- package/dist/vfs/tencent/tencent.d.ts +4 -5
- package/dist/vfs/tencent/tencent.d.ts.map +1 -1
- package/dist/vfs/tencent/tencent.js +2 -4
- package/dist/vfs/tencent/tencent.js.map +1 -1
- package/dist/vfs/tidb_filesystem/config.d.ts +2 -0
- package/dist/vfs/tidb_filesystem/config.d.ts.map +1 -0
- package/dist/{mount/types.js → vfs/tidb_filesystem/config.js} +2 -2
- package/dist/vfs/tidb_filesystem/config.js.map +1 -0
- package/dist/vfs/tidb_filesystem/tidb_filesystem.d.ts +16 -0
- package/dist/vfs/tidb_filesystem/tidb_filesystem.d.ts.map +1 -0
- package/dist/vfs/tidb_filesystem/tidb_filesystem.js +39 -0
- package/dist/vfs/tidb_filesystem/tidb_filesystem.js.map +1 -0
- package/dist/vfs/wasabi/config.d.ts +35 -28
- package/dist/vfs/wasabi/config.d.ts.map +1 -1
- package/dist/vfs/wasabi/config.js +20 -45
- package/dist/vfs/wasabi/config.js.map +1 -1
- package/dist/vfs/wasabi/wasabi.d.ts +4 -5
- package/dist/vfs/wasabi/wasabi.d.ts.map +1 -1
- package/dist/vfs/wasabi/wasabi.js +2 -4
- package/dist/vfs/wasabi/wasabi.js.map +1 -1
- package/dist/workspace/{session → mount/namespace}/cas.lua +7 -2
- package/dist/workspace/mount/namespace/disk.d.ts +12 -7
- package/dist/workspace/mount/namespace/disk.d.ts.map +1 -1
- package/dist/workspace/mount/namespace/disk.js +37 -21
- package/dist/workspace/mount/namespace/disk.js.map +1 -1
- package/dist/workspace/mount/namespace/redis.d.ts +14 -9
- package/dist/workspace/mount/namespace/redis.d.ts.map +1 -1
- package/dist/workspace/mount/namespace/redis.js +29 -14
- package/dist/workspace/mount/namespace/redis.js.map +1 -1
- package/dist/workspace/nfs.d.ts.map +1 -1
- package/dist/workspace/nfs.js +3 -1
- package/dist/workspace/nfs.js.map +1 -1
- package/dist/workspace/record/disk.d.ts +12 -5
- package/dist/workspace/record/disk.d.ts.map +1 -1
- package/dist/workspace/record/disk.js +119 -72
- package/dist/workspace/record/disk.js.map +1 -1
- package/dist/workspace/store/disk.d.ts +12 -5
- package/dist/workspace/store/disk.d.ts.map +1 -1
- package/dist/workspace/store/disk.js +20 -4
- package/dist/workspace/store/disk.js.map +1 -1
- package/dist/workspace/store/redis.d.ts +13 -7
- package/dist/workspace/store/redis.d.ts.map +1 -1
- package/dist/workspace/store/redis.js +53 -26
- package/dist/workspace/store/redis.js.map +1 -1
- package/dist/workspace.d.ts +3 -1
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +22 -21
- package/dist/workspace.js.map +1 -1
- package/package.json +13 -17
- package/dist/compression_codecs.d.ts +0 -2
- package/dist/compression_codecs.d.ts.map +0 -1
- package/dist/compression_codecs.js +0 -42
- package/dist/compression_codecs.js.map +0 -1
- package/dist/core/disk/append.d.ts +0 -4
- package/dist/core/disk/append.d.ts.map +0 -1
- package/dist/core/disk/append.js +0 -30
- package/dist/core/disk/append.js.map +0 -1
- package/dist/mount/core.d.ts +0 -313
- package/dist/mount/core.d.ts.map +0 -1
- package/dist/mount/core.js +0 -915
- package/dist/mount/core.js.map +0 -1
- package/dist/mount/platform/macos.d.ts +0 -2
- package/dist/mount/platform/macos.d.ts.map +0 -1
- package/dist/mount/platform/macos.js +0 -23
- package/dist/mount/platform/macos.js.map +0 -1
- package/dist/mount/types.d.ts +0 -37
- package/dist/mount/types.d.ts.map +0 -1
- package/dist/mount/types.js.map +0 -1
- package/dist/observe/redis_store.d.ts +0 -27
- package/dist/observe/redis_store.d.ts.map +0 -1
- package/dist/observe/redis_store.js +0 -81
- package/dist/observe/redis_store.js.map +0 -1
- package/dist/runtime/sandbox/cli.d.ts +0 -56
- package/dist/runtime/sandbox/cli.d.ts.map +0 -1
- package/dist/runtime/sandbox/cli.js +0 -260
- package/dist/runtime/sandbox/cli.js.map +0 -1
- package/dist/runtime/sandbox/ssh/constants.d.ts +0 -12
- package/dist/runtime/sandbox/ssh/constants.d.ts.map +0 -1
- package/dist/runtime/sandbox/ssh/constants.js +0 -32
- package/dist/runtime/sandbox/ssh/constants.js.map +0 -1
- package/dist/vfs/aliyun/prompt.d.ts +0 -2
- package/dist/vfs/aliyun/prompt.d.ts.map +0 -1
- package/dist/vfs/aliyun/prompt.js +0 -19
- package/dist/vfs/aliyun/prompt.js.map +0 -1
- package/dist/vfs/backblaze/prompt.d.ts +0 -2
- package/dist/vfs/backblaze/prompt.d.ts.map +0 -1
- package/dist/vfs/backblaze/prompt.js +0 -19
- package/dist/vfs/backblaze/prompt.js.map +0 -1
- package/dist/vfs/ceph/prompt.d.ts +0 -2
- package/dist/vfs/ceph/prompt.d.ts.map +0 -1
- package/dist/vfs/ceph/prompt.js +0 -19
- package/dist/vfs/ceph/prompt.js.map +0 -1
- package/dist/vfs/digitalocean/prompt.d.ts +0 -2
- package/dist/vfs/digitalocean/prompt.d.ts.map +0 -1
- package/dist/vfs/digitalocean/prompt.js +0 -19
- package/dist/vfs/digitalocean/prompt.js.map +0 -1
- package/dist/vfs/disk/prompt.d.ts +0 -2
- package/dist/vfs/disk/prompt.d.ts.map +0 -1
- package/dist/vfs/disk/prompt.js +0 -17
- package/dist/vfs/disk/prompt.js.map +0 -1
- package/dist/vfs/email/prompt.d.ts +0 -3
- package/dist/vfs/email/prompt.d.ts.map +0 -1
- package/dist/vfs/email/prompt.js +0 -29
- package/dist/vfs/email/prompt.js.map +0 -1
- package/dist/vfs/gcs/prompt.d.ts +0 -2
- package/dist/vfs/gcs/prompt.d.ts.map +0 -1
- package/dist/vfs/gcs/prompt.js +0 -19
- package/dist/vfs/gcs/prompt.js.map +0 -1
- package/dist/vfs/gridfs/prompt.d.ts +0 -2
- package/dist/vfs/gridfs/prompt.d.ts.map +0 -1
- package/dist/vfs/gridfs/prompt.js +0 -19
- package/dist/vfs/gridfs/prompt.js.map +0 -1
- package/dist/vfs/hf_buckets/prompt.d.ts +0 -2
- package/dist/vfs/hf_buckets/prompt.d.ts.map +0 -1
- package/dist/vfs/hf_buckets/prompt.js +0 -18
- package/dist/vfs/hf_buckets/prompt.js.map +0 -1
- package/dist/vfs/hf_datasets/prompt.d.ts +0 -2
- package/dist/vfs/hf_datasets/prompt.d.ts.map +0 -1
- package/dist/vfs/hf_datasets/prompt.js +0 -18
- package/dist/vfs/hf_datasets/prompt.js.map +0 -1
- package/dist/vfs/hf_models/prompt.d.ts +0 -2
- package/dist/vfs/hf_models/prompt.d.ts.map +0 -1
- package/dist/vfs/hf_models/prompt.js +0 -18
- package/dist/vfs/hf_models/prompt.js.map +0 -1
- package/dist/vfs/hf_spaces/prompt.d.ts +0 -2
- package/dist/vfs/hf_spaces/prompt.d.ts.map +0 -1
- package/dist/vfs/hf_spaces/prompt.js +0 -18
- package/dist/vfs/hf_spaces/prompt.js.map +0 -1
- package/dist/vfs/jaeger/config.d.ts +0 -15
- package/dist/vfs/jaeger/config.d.ts.map +0 -1
- package/dist/vfs/jaeger/config.js +0 -28
- package/dist/vfs/jaeger/config.js.map +0 -1
- package/dist/vfs/minio/prompt.d.ts +0 -2
- package/dist/vfs/minio/prompt.d.ts.map +0 -1
- package/dist/vfs/minio/prompt.js +0 -19
- package/dist/vfs/minio/prompt.js.map +0 -1
- package/dist/vfs/nextcloud/prompt.d.ts +0 -2
- package/dist/vfs/nextcloud/prompt.d.ts.map +0 -1
- package/dist/vfs/nextcloud/prompt.js +0 -6
- package/dist/vfs/nextcloud/prompt.js.map +0 -1
- package/dist/vfs/oci/prompt.d.ts +0 -2
- package/dist/vfs/oci/prompt.d.ts.map +0 -1
- package/dist/vfs/oci/prompt.js +0 -19
- package/dist/vfs/oci/prompt.js.map +0 -1
- package/dist/vfs/qingstor/prompt.d.ts +0 -2
- package/dist/vfs/qingstor/prompt.d.ts.map +0 -1
- package/dist/vfs/qingstor/prompt.js +0 -19
- package/dist/vfs/qingstor/prompt.js.map +0 -1
- package/dist/vfs/r2/prompt.d.ts +0 -2
- package/dist/vfs/r2/prompt.d.ts.map +0 -1
- package/dist/vfs/r2/prompt.js +0 -19
- package/dist/vfs/r2/prompt.js.map +0 -1
- package/dist/vfs/scaleway/prompt.d.ts +0 -2
- package/dist/vfs/scaleway/prompt.d.ts.map +0 -1
- package/dist/vfs/scaleway/prompt.js +0 -19
- package/dist/vfs/scaleway/prompt.js.map +0 -1
- package/dist/vfs/seaweedfs/prompt.d.ts +0 -2
- package/dist/vfs/seaweedfs/prompt.d.ts.map +0 -1
- package/dist/vfs/seaweedfs/prompt.js +0 -19
- package/dist/vfs/seaweedfs/prompt.js.map +0 -1
- package/dist/vfs/ssh/prompt.d.ts +0 -2
- package/dist/vfs/ssh/prompt.d.ts.map +0 -1
- package/dist/vfs/ssh/prompt.js +0 -18
- package/dist/vfs/ssh/prompt.js.map +0 -1
- package/dist/vfs/supabase/prompt.d.ts +0 -2
- package/dist/vfs/supabase/prompt.d.ts.map +0 -1
- package/dist/vfs/supabase/prompt.js +0 -19
- package/dist/vfs/supabase/prompt.js.map +0 -1
- package/dist/vfs/tencent/prompt.d.ts +0 -2
- package/dist/vfs/tencent/prompt.d.ts.map +0 -1
- package/dist/vfs/tencent/prompt.js +0 -19
- package/dist/vfs/tencent/prompt.js.map +0 -1
- package/dist/vfs/wasabi/prompt.d.ts +0 -2
- package/dist/vfs/wasabi/prompt.d.ts.map +0 -1
- package/dist/vfs/wasabi/prompt.js +0 -19
- package/dist/vfs/wasabi/prompt.js.map +0 -1
- package/dist/workspace/session/disk.d.ts +0 -13
- package/dist/workspace/session/disk.d.ts.map +0 -1
- package/dist/workspace/session/disk.js +0 -29
- package/dist/workspace/session/disk.js.map +0 -1
- package/dist/workspace/session/redis.d.ts +0 -31
- package/dist/workspace/session/redis.d.ts.map +0 -1
- package/dist/workspace/session/redis.js +0 -87
- package/dist/workspace/session/redis.js.map +0 -1
package/dist/config.js
CHANGED
|
@@ -11,39 +11,46 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========
|
|
14
|
+
import { mcpCli } from '@struktoai/mirage-core/commands/cli/mcp/build';
|
|
15
|
+
import { NAME as MCP_CLI } from '@struktoai/mirage-core/commands/cli/mcp/constants';
|
|
16
|
+
import { CLI } from '@struktoai/mirage-core/commands/cli/types';
|
|
14
17
|
import { CommandSpec } from '@struktoai/mirage-core/commands/spec/types';
|
|
15
18
|
import { IOConfig } from '@struktoai/mirage-core/io/config';
|
|
19
|
+
import { narrowed, networkBound, networkLayer, networkRoutes, NetworkRule, runWithNetwork, } from '@struktoai/mirage-core/io/network';
|
|
16
20
|
import { parseCommandLimits } from '@struktoai/mirage-core/policy/builtin/output_cap';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { parseYaml } from "./utils/yaml.js";
|
|
21
|
-
import { CLI } from '@struktoai/mirage-core/commands/cli/types';
|
|
21
|
+
import { METHODS } from '@struktoai/mirage-core/policy/constants';
|
|
22
|
+
import { compileProgram, parseProgram, SessionProfile, } from '@struktoai/mirage-core/policy/profile';
|
|
23
|
+
import { validateDocument } from '@struktoai/mirage-core/rs/document';
|
|
22
24
|
import { Runtime } from '@struktoai/mirage-core/runtime/base';
|
|
23
|
-
import { ScriptSource } from '@struktoai/mirage-core/runtime/types';
|
|
24
25
|
import { buildRuntime, checkRuntimeOptions } from '@struktoai/mirage-core/runtime/table';
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
26
|
+
import { ScriptSource } from '@struktoai/mirage-core/runtime/types';
|
|
27
|
+
import { EnvVar, SecretSource, } from '@struktoai/mirage-core/secrets/config';
|
|
28
|
+
import { configHoldsPointer, resolveConfigSecrets, resolveSourcesFor, } from '@struktoai/mirage-core/secrets/sources';
|
|
29
|
+
import { KERNEL_BACKENDS, MountBackend, MountMode, parseMountMode, ReadPolicy, } from '@struktoai/mirage-core/types';
|
|
30
|
+
import { parseSystemTime } from '@struktoai/mirage-core/utils/clock';
|
|
31
|
+
import { snakeToCamel } from '@struktoai/mirage-core/utils/normalize';
|
|
32
|
+
import { isPlainObject } from '@struktoai/mirage-core/utils/records';
|
|
33
|
+
import { parseLimit } from '@struktoai/mirage-core/utils/size';
|
|
34
|
+
import { compareCodePoints } from '@struktoai/mirage-core/utils/sort';
|
|
35
|
+
import { parseConfigWithSchema } from '@struktoai/mirage-core/vfs/secrets';
|
|
28
36
|
import { coerceReadPolicy, resolveReadSpec, } from '@struktoai/mirage-core/workspace/mount/read_policy';
|
|
37
|
+
import { Mount } from '@struktoai/mirage-core/workspace/mount/spec';
|
|
29
38
|
import { coerceWritePolicy } from '@struktoai/mirage-core/workspace/mount/write_policy';
|
|
30
|
-
import { snakeToCamel } from '@struktoai/mirage-core/utils/normalize';
|
|
31
|
-
import { parseProgram, parseSessionProfile, } from '@struktoai/mirage-core/policy/profile';
|
|
32
39
|
import { RAMWorkspaceStateStore } from '@struktoai/mirage-core/workspace/store/ram';
|
|
33
40
|
import { S3WorkspaceStateStore } from '@struktoai/mirage-core/workspace/store/s3';
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
41
|
+
import { readFileSync } from 'node:fs';
|
|
42
|
+
import { basename, dirname, isAbsolute, join, resolve } from 'node:path';
|
|
36
43
|
// The config loader is a workspace entry point of its own (the daemon
|
|
37
44
|
// builds from here), so it arms the builtin secrets sources like the
|
|
38
45
|
// node Workspace module does.
|
|
39
|
-
import { configHoldsPointer, resolveConfigSecrets, resolveSourcesFor, } from '@struktoai/mirage-core/secrets/sources';
|
|
40
46
|
import "./secrets/constants.js";
|
|
47
|
+
import { releaseNetwork, watchNetwork } from "./io/network.js";
|
|
48
|
+
import { isModulePath, loadAttr, splitRef } from "./utils/loader.js";
|
|
49
|
+
import { parseYaml } from "./utils/yaml.js";
|
|
41
50
|
import { buildVfs } from "./vfs/registry.js";
|
|
42
|
-
import {
|
|
51
|
+
import { S3Config } from "./vfs/s3/config.js";
|
|
43
52
|
import { DiskWorkspaceStateStore } from "./workspace/store/disk.js";
|
|
44
53
|
import { RedisWorkspaceStateStore } from "./workspace/store/redis.js";
|
|
45
|
-
import { JobConsole } from '@struktoai/mirage-core/shell/console/index';
|
|
46
|
-
import { compareCodePoints } from '@struktoai/mirage-core/utils/sort';
|
|
47
54
|
function coerceMountMode(value, fallback) {
|
|
48
55
|
if (value === undefined)
|
|
49
56
|
return fallback;
|
|
@@ -121,147 +128,8 @@ function camelizeKeys(obj) {
|
|
|
121
128
|
out[snakeToCamel(k)] = v;
|
|
122
129
|
return out;
|
|
123
130
|
}
|
|
124
|
-
|
|
125
|
-
return v !== null && typeof v === 'object' && !Array.isArray(v);
|
|
126
|
-
}
|
|
127
|
-
// Python sets extra="forbid" on every workspace-config block, so a typo
|
|
128
|
-
// like `mount_point:` for `mountpoint:`, `consistancy:` or `limitt:` is
|
|
129
|
-
// a hard ValueError there. These tables mirror those models field for
|
|
130
|
-
// field so the same YAML is accepted (and rejected) by both languages.
|
|
131
|
-
//
|
|
132
|
-
// The spellings are Python's canonical snake_case ones on purpose: a
|
|
133
|
-
// camelCase alias that TS would accept for free is a key Python rejects,
|
|
134
|
-
// which is the same portability break pointing the other way.
|
|
135
|
-
//
|
|
136
|
-
// `mounts.*.config` is the one block with no table, because Python types
|
|
137
|
-
// it as a bare dict and validates it in the VFS's own model. Do not
|
|
138
|
-
// generalize that to every credential-carrying block: an s3 store group
|
|
139
|
-
// has a strict Python model (`S3StoreBlock`, extra="forbid"), so it is
|
|
140
|
-
// tabled here like the rest.
|
|
141
|
-
const TOP_LEVEL_KEYS = [
|
|
142
|
-
'mounts',
|
|
143
|
-
'io',
|
|
144
|
-
'command_limits',
|
|
145
|
-
'clis',
|
|
146
|
-
'runtimes',
|
|
147
|
-
'route_policy',
|
|
148
|
-
'profiles',
|
|
149
|
-
'profile',
|
|
150
|
-
'mode',
|
|
151
|
-
'read',
|
|
152
|
-
'write',
|
|
153
|
-
'default_session_id',
|
|
154
|
-
'workspace_id',
|
|
155
|
-
'cache',
|
|
156
|
-
'index',
|
|
157
|
-
'store',
|
|
158
|
-
'console',
|
|
159
|
-
'env',
|
|
160
|
-
'secrets',
|
|
161
|
-
];
|
|
162
|
-
const MOUNT_KEYS = [
|
|
163
|
-
'vfs',
|
|
164
|
-
'mode',
|
|
165
|
-
'config',
|
|
166
|
-
'command_limits',
|
|
167
|
-
'backend',
|
|
168
|
-
'mountpoint',
|
|
169
|
-
'read',
|
|
170
|
-
'ttl',
|
|
171
|
-
'write',
|
|
172
|
-
'index',
|
|
173
|
-
];
|
|
174
|
-
// A source instance is a type beside a config, the way a mount is. Its
|
|
175
|
-
// `config:` block has no table for the same reason `mounts.*.config`
|
|
176
|
-
// has none: each source owns its own model and validates there.
|
|
177
|
-
const SOURCE_KEYS = ['source', 'config'];
|
|
178
|
-
const CACHE_KEYS = {
|
|
179
|
-
ram: ['type', 'limit', 'max_drain_bytes'],
|
|
180
|
-
redis: ['type', 'limit', 'max_drain_bytes', 'url', 'key_prefix'],
|
|
181
|
-
};
|
|
182
|
-
const INDEX_KEYS = {
|
|
183
|
-
ram: ['type', 'ttl'],
|
|
184
|
-
redis: ['type', 'ttl', 'url', 'key_prefix'],
|
|
185
|
-
};
|
|
186
|
-
const CONSOLE_KEYS = {
|
|
187
|
-
ram: ['type'],
|
|
188
|
-
redis: ['type', 'url', 'key_prefix', 'ttl_seconds'],
|
|
189
|
-
};
|
|
190
|
-
const STORE_GROUPS = ['namespace', 'observer', 'workspace'];
|
|
191
|
-
const STORE_KEYS = ['type', 'url', 'key_prefix', 'root', ...STORE_GROUPS];
|
|
192
|
-
// An s3 group IS `S3Config` plus the discriminator, so its keys are that
|
|
193
|
-
// model's, spelled Python's way. Python declares it as
|
|
194
|
-
// `S3StoreBlock(S3Config)` with extra="forbid" — a strict model, unlike
|
|
195
|
-
// the untyped `mounts.*.config` — so a typo is a load error there and
|
|
196
|
-
// must be one here.
|
|
197
|
-
const STORE_GROUP_KEYS = {
|
|
198
|
-
ram: ['type'],
|
|
199
|
-
disk: ['type', 'root'],
|
|
200
|
-
redis: ['type', 'url', 'key_prefix'],
|
|
201
|
-
s3: [
|
|
202
|
-
'type',
|
|
203
|
-
'bucket',
|
|
204
|
-
'region',
|
|
205
|
-
'endpoint_url',
|
|
206
|
-
'aws_access_key_id',
|
|
207
|
-
'aws_secret_access_key',
|
|
208
|
-
'aws_session_token',
|
|
209
|
-
'aws_profile',
|
|
210
|
-
'path_style',
|
|
211
|
-
'timeout',
|
|
212
|
-
'proxy',
|
|
213
|
-
'key_prefix',
|
|
214
|
-
],
|
|
215
|
-
};
|
|
216
|
-
// The s3 store hosts only the sessions+meta plane, so it is valid as the
|
|
217
|
-
// `workspace` override and nowhere else — as the top-level default it is
|
|
218
|
-
// already refused above. Its store raises when asked to build another
|
|
219
|
-
// plane; both languages now refuse the config instead of the plane.
|
|
220
|
-
const S3_HOSTED_GROUP = 'workspace';
|
|
221
|
-
const PLAIN_STORE_GROUP_KEYS = Object.fromEntries(Object.entries(STORE_GROUP_KEYS).filter(([type]) => type !== 's3'));
|
|
131
|
+
const STORE_GROUPS = ['namespace', 'observer', 'workspace', 'jobs'];
|
|
222
132
|
const CLI_KEYS = ['cli', 'script', 'runtime', 'config'];
|
|
223
|
-
// A store group whose `type` names a backend carries that backend's own
|
|
224
|
-
// spellings: `aws_access_key_id` is `accessKeyId`, not `awsAccessKeyId`,
|
|
225
|
-
// so camelizing here would hide the key from the translation that does
|
|
226
|
-
// know it. Its *keys* are still checked — the backend's model declares
|
|
227
|
-
// them (see STORE_GROUP_KEYS above) — only the renaming is skipped.
|
|
228
|
-
const BACKEND_SPELLED_TYPES = new Set(['s3']);
|
|
229
|
-
function keepsBackendSpellings(block) {
|
|
230
|
-
return typeof block.type === 'string' && BACKEND_SPELLED_TYPES.has(block.type);
|
|
231
|
-
}
|
|
232
|
-
function rejectUnknownKeys(block, allowed, what) {
|
|
233
|
-
for (const key of Object.keys(block)) {
|
|
234
|
-
if (allowed.includes(key))
|
|
235
|
-
continue;
|
|
236
|
-
throw new Error(`unknown ${what} key \`${key}\` (allowed: ${allowed.join(', ')})`);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* The `type:` discriminator of a typed block. `fallback` is the type
|
|
241
|
-
* assumed when the key is absent; leave it out where Python models the
|
|
242
|
-
* block as a discriminated union, which makes `type` mandatory.
|
|
243
|
-
*/
|
|
244
|
-
function blockType(block, what, known, fallback) {
|
|
245
|
-
const type = block.type ?? fallback;
|
|
246
|
-
if (type === undefined) {
|
|
247
|
-
throw new Error(`config \`${what}\` needs a \`type\` (one of ${known.join(', ')})`);
|
|
248
|
-
}
|
|
249
|
-
if (typeof type !== 'string') {
|
|
250
|
-
throw new Error(`config \`${what}\` type must be a string (one of ${known.join(', ')})`);
|
|
251
|
-
}
|
|
252
|
-
if (!known.includes(type)) {
|
|
253
|
-
throw new Error(`unknown ${what} type \`${type}\` (expected one of ${known.join(', ')})`);
|
|
254
|
-
}
|
|
255
|
-
return type;
|
|
256
|
-
}
|
|
257
|
-
function validateTypedBlock(value, table, what, fallback) {
|
|
258
|
-
if (value === undefined || value === null)
|
|
259
|
-
return;
|
|
260
|
-
if (!isPlainObject(value))
|
|
261
|
-
throw new Error(`config \`${what}\` must be a mapping`);
|
|
262
|
-
const type = blockType(value, what, Object.keys(table), fallback);
|
|
263
|
-
rejectUnknownKeys(value, table[type] ?? [], `${what} (${type})`);
|
|
264
|
-
}
|
|
265
133
|
// Python's index block models refuse a ttl that is not a number
|
|
266
134
|
// (StrictFloat) and a non-string url or key_prefix at load. This stops at
|
|
267
135
|
// the first bad value, so it checks them in the models' field order.
|
|
@@ -278,54 +146,6 @@ function validateIndexValues(value, what) {
|
|
|
278
146
|
throw new Error(`config \`${what}.key_prefix\` must be a string`);
|
|
279
147
|
}
|
|
280
148
|
}
|
|
281
|
-
// Key names alone are not enough here: Python's Pydantic model rejects
|
|
282
|
-
// `url: 123` at load, so the TS loader must refuse the same file at the
|
|
283
|
-
// same boundary instead of deferring it to Redis client creation.
|
|
284
|
-
function validateConsoleValues(value) {
|
|
285
|
-
if (!isPlainObject(value))
|
|
286
|
-
return;
|
|
287
|
-
if (value.url !== undefined && typeof value.url !== 'string') {
|
|
288
|
-
throw new Error('config `console.url` must be a string');
|
|
289
|
-
}
|
|
290
|
-
if (value.key_prefix !== undefined && typeof value.key_prefix !== 'string') {
|
|
291
|
-
throw new Error('config `console.key_prefix` must be a string');
|
|
292
|
-
}
|
|
293
|
-
const ttl = value.ttl_seconds;
|
|
294
|
-
if (ttl !== undefined &&
|
|
295
|
-
ttl !== null &&
|
|
296
|
-
!(typeof ttl === 'number' && Number.isFinite(ttl) && ttl > 0)) {
|
|
297
|
-
throw new Error('config `console.ttl_seconds` must be a positive number or null');
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
function validateStoreBlock(value) {
|
|
301
|
-
if (value === undefined || value === null)
|
|
302
|
-
return;
|
|
303
|
-
if (!isPlainObject(value))
|
|
304
|
-
throw new Error('config `store` must be a mapping');
|
|
305
|
-
// The top level picks the default backend for every plane; s3 hosts
|
|
306
|
-
// only the sessions+meta group, so it is a `workspace` override and
|
|
307
|
-
// never the default. Mirrors Python's StoreBlock.
|
|
308
|
-
blockType(value, 'store', ['ram', 'disk', 'redis'], 'ram');
|
|
309
|
-
rejectUnknownKeys(value, STORE_KEYS, 'store');
|
|
310
|
-
for (const group of STORE_GROUPS) {
|
|
311
|
-
const block = value[group];
|
|
312
|
-
if (block === undefined || block === null)
|
|
313
|
-
continue;
|
|
314
|
-
if (!isPlainObject(block))
|
|
315
|
-
throw new Error(`config \`store.${group}\` must be a mapping`);
|
|
316
|
-
if (block.type === 's3' && group !== S3_HOSTED_GROUP) {
|
|
317
|
-
throw new Error(`config \`store.${group}\` cannot be s3: the s3 store hosts only the ` +
|
|
318
|
-
`sessions+meta group; keep the ${group} plane on ram or redis and pass ` +
|
|
319
|
-
`the s3 store as the '${S3_HOSTED_GROUP}' group override`);
|
|
320
|
-
}
|
|
321
|
-
const table = group === S3_HOSTED_GROUP ? STORE_GROUP_KEYS : PLAIN_STORE_GROUP_KEYS;
|
|
322
|
-
validateTypedBlock(block, table, `store.${group}`, 'ram');
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
/** A raw block's `config`, or an empty mapping when it is absent or not one. */
|
|
326
|
-
function asConfig(value) {
|
|
327
|
-
return isPlainObject(value) ? value : {};
|
|
328
|
-
}
|
|
329
149
|
/**
|
|
330
150
|
* Refuse a mount block whose read policy and bound disagree.
|
|
331
151
|
*
|
|
@@ -366,8 +186,20 @@ function validateReadBlock(prefix, block) {
|
|
|
366
186
|
* folds snake_case into camelCase and the distinction is gone.
|
|
367
187
|
*/
|
|
368
188
|
function validateConfigKeys(raw) {
|
|
369
|
-
|
|
189
|
+
validateDocument('config', raw, 'config');
|
|
370
190
|
parseCommandLimits(raw.command_limits);
|
|
191
|
+
if (raw.max_memory !== undefined && raw.max_memory !== null) {
|
|
192
|
+
parseLimit(raw.max_memory, 'max_memory');
|
|
193
|
+
}
|
|
194
|
+
if (raw.network !== undefined) {
|
|
195
|
+
const layer = networkLayer(raw.network);
|
|
196
|
+
new NetworkRule(layer === null ? [] : [layer], false, networkRoutes(raw.network));
|
|
197
|
+
}
|
|
198
|
+
if (raw.system_time !== undefined && raw.system_time !== null) {
|
|
199
|
+
if (typeof raw.system_time !== 'string')
|
|
200
|
+
throw new Error('system_time must be a string');
|
|
201
|
+
parseSystemTime(raw.system_time);
|
|
202
|
+
}
|
|
371
203
|
// At the sync entry point, as Python's WorkspaceConfig validator is, so the CLI
|
|
372
204
|
// refuses a bad value before it POSTs the document to the daemon.
|
|
373
205
|
if (raw.read !== undefined && raw.read !== null)
|
|
@@ -378,9 +210,9 @@ function validateConfigKeys(raw) {
|
|
|
378
210
|
for (const [prefix, block] of Object.entries(raw.mounts)) {
|
|
379
211
|
if (!isPlainObject(block))
|
|
380
212
|
throw new Error(`mount \`${prefix}\` must be a mapping`);
|
|
381
|
-
|
|
213
|
+
validateDocument('config', block, `mount \`${prefix}\``, { names: 'mount' });
|
|
382
214
|
// Before the read rules, as pydantic checks fields before them.
|
|
383
|
-
|
|
215
|
+
validateDocument('config', block.index, `mounts.${prefix}.index`, { names: 'index' });
|
|
384
216
|
validateIndexValues(block.index, `mounts.${prefix}.index`);
|
|
385
217
|
validateReadBlock(prefix, block);
|
|
386
218
|
if (block.write !== undefined && block.write !== null)
|
|
@@ -392,14 +224,15 @@ function validateConfigKeys(raw) {
|
|
|
392
224
|
for (const [name, block] of Object.entries(raw.clis)) {
|
|
393
225
|
if (!isPlainObject(block))
|
|
394
226
|
throw new Error(`cli \`${name}\` must be a mapping`);
|
|
395
|
-
|
|
227
|
+
validateDocument('config', block, `cli \`${name}\``, { names: 'cli' });
|
|
396
228
|
// A pointer may only fill a config that a model validates, because
|
|
397
229
|
// the model is what a snapshot redacts by. A script's config is
|
|
398
230
|
// opaque: nothing declares which key is a credential, so the
|
|
399
231
|
// snapshot captures it verbatim, and a pointer resolved into it
|
|
400
232
|
// would be written out as the value it fetched. Refused here, on
|
|
401
233
|
// the block, so every entry point that reads a config inherits the rule.
|
|
402
|
-
if (typeof block.script === 'string' &&
|
|
234
|
+
if (typeof block.script === 'string' &&
|
|
235
|
+
configHoldsPointer(isPlainObject(block.config) ? block.config : {})) {
|
|
403
236
|
throw new Error(`clis entry '${name}': a script's config is opaque and a pointer in it would be ` +
|
|
404
237
|
'written into every snapshot; read the credential from a managed env var instead');
|
|
405
238
|
}
|
|
@@ -425,15 +258,16 @@ function validateConfigKeys(raw) {
|
|
|
425
258
|
if (raw.io !== undefined) {
|
|
426
259
|
if (!isPlainObject(raw.io))
|
|
427
260
|
throw new Error('io must be a mapping');
|
|
428
|
-
|
|
261
|
+
validateDocument('config', raw.io, 'io', { names: 'io' });
|
|
429
262
|
new IOConfig(camelizeKeys(raw.io));
|
|
430
263
|
}
|
|
431
|
-
|
|
432
|
-
|
|
264
|
+
validateDocument('config', raw.cache, 'cache', { names: 'cache' });
|
|
265
|
+
if (isPlainObject(raw.cache) && raw.cache.limit !== undefined) {
|
|
266
|
+
parseLimit(raw.cache.limit, 'limit');
|
|
267
|
+
}
|
|
268
|
+
validateDocument('config', raw.index, 'index', { names: 'index' });
|
|
433
269
|
validateIndexValues(raw.index, 'index');
|
|
434
|
-
|
|
435
|
-
validateConsoleValues(raw.console);
|
|
436
|
-
validateStoreBlock(raw.store);
|
|
270
|
+
validateDocument('config', raw.store, 'store', { names: 'store' });
|
|
437
271
|
validateEnvBlock(raw.env);
|
|
438
272
|
validateSecretsBlock(raw.secrets);
|
|
439
273
|
}
|
|
@@ -453,8 +287,8 @@ function validateSecretsBlock(value) {
|
|
|
453
287
|
for (const [name, block] of Object.entries(value)) {
|
|
454
288
|
if (!isPlainObject(block))
|
|
455
289
|
throw new Error(`config \`secrets.${name}\` must be a mapping`);
|
|
456
|
-
|
|
457
|
-
const parsed =
|
|
290
|
+
validateDocument('config', block, `config \`secrets.${name}\``, { names: 'source' });
|
|
291
|
+
const parsed = SecretSource.safeParse(block);
|
|
458
292
|
if (!parsed.success) {
|
|
459
293
|
const detail = parsed.error.issues[0]?.message ?? parsed.error.message;
|
|
460
294
|
throw new Error(`config \`secrets.${name}\`: ${detail}`);
|
|
@@ -479,7 +313,7 @@ function validateEnvBlock(value) {
|
|
|
479
313
|
if (!isPlainObject(entry)) {
|
|
480
314
|
throw new Error(`config \`env.${name}\` must be a string or a mapping`);
|
|
481
315
|
}
|
|
482
|
-
const parsed =
|
|
316
|
+
const parsed = EnvVar.safeParse(entry);
|
|
483
317
|
if (!parsed.success) {
|
|
484
318
|
const detail = parsed.error.issues[0]?.message ?? parsed.error.message;
|
|
485
319
|
throw new Error(`config \`env.${name}\`: ${detail}`);
|
|
@@ -502,8 +336,6 @@ function normalizeConfigKeys(raw) {
|
|
|
502
336
|
out.cache = camelizeKeys(out.cache);
|
|
503
337
|
if (isPlainObject(out.index))
|
|
504
338
|
out.index = camelizeKeys(out.index);
|
|
505
|
-
if (isPlainObject(out.console))
|
|
506
|
-
out.console = camelizeKeys(out.console);
|
|
507
339
|
if (isPlainObject(out.mounts)) {
|
|
508
340
|
out.mounts = Object.fromEntries(Object.entries(out.mounts).map(([prefix, block]) => [
|
|
509
341
|
prefix,
|
|
@@ -518,7 +350,10 @@ function normalizeConfigKeys(raw) {
|
|
|
518
350
|
const block = store[group];
|
|
519
351
|
if (!isPlainObject(block))
|
|
520
352
|
continue;
|
|
521
|
-
|
|
353
|
+
// An s3 group carries its backend's own spellings (`aws_access_key_id`
|
|
354
|
+
// is `accessKeyId`), which a plain camelize would hide from the
|
|
355
|
+
// translation that knows them.
|
|
356
|
+
if (block.type === 's3')
|
|
522
357
|
continue;
|
|
523
358
|
store[group] = camelizeKeys(block);
|
|
524
359
|
}
|
|
@@ -558,7 +393,7 @@ function parseProfiles(raw) {
|
|
|
558
393
|
// has rebased the path onto the config file's directory, so reading
|
|
559
394
|
// it here would resolve against the process cwd. The workspace entry point
|
|
560
395
|
// (`toWorkspaceOptions`) loads it, the python loader's split.
|
|
561
|
-
out[name] =
|
|
396
|
+
out[name] = SessionProfile(block, `profile \`${name}\``);
|
|
562
397
|
}
|
|
563
398
|
return out;
|
|
564
399
|
}
|
|
@@ -569,29 +404,52 @@ function loadProgram(program) {
|
|
|
569
404
|
: program;
|
|
570
405
|
}
|
|
571
406
|
/**
|
|
572
|
-
* Load
|
|
407
|
+
* Load a profile's path-form policy programs into ScriptSources.
|
|
573
408
|
*
|
|
574
409
|
* By this entry point the path is absolute for a file config (the check entry point
|
|
575
410
|
* rebased it onto the config file's directory); an object config's
|
|
576
411
|
* relative path resolves against the process cwd, as in Python. Code
|
|
577
412
|
* that passes a loaded ScriptSource is left alone.
|
|
578
413
|
*/
|
|
579
|
-
function
|
|
580
|
-
const
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
414
|
+
export function loadProfilePolicy(profile) {
|
|
415
|
+
const policy = profile.policy;
|
|
416
|
+
return policy == null
|
|
417
|
+
? profile
|
|
418
|
+
: {
|
|
419
|
+
...profile,
|
|
420
|
+
policy: Object.fromEntries(Object.entries(policy).map(([method, programs]) => [method, programs.map(loadProgram)])),
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Load a server's policy file: a profile's `policy` block, a mapping of
|
|
425
|
+
* method to programs, plus `pre_workspace`, which a server asks before it
|
|
426
|
+
* builds a workspace. A relative `script` path is read next to the file,
|
|
427
|
+
* after `${VAR}` interpolation. Mirrors Python's `load_policy_file`.
|
|
428
|
+
*/
|
|
429
|
+
export function loadPolicyFile(path, env) {
|
|
430
|
+
const raw = interpolateEnv(parseYaml(readFileSync(path, 'utf8')), env ?? readProcessEnv());
|
|
431
|
+
const methods = [...Object.values(METHODS), 'pre_workspace'];
|
|
432
|
+
if (!isPlainObject(raw)) {
|
|
433
|
+
throw new Error(`${path}: a policy file is a mapping of method to programs`);
|
|
434
|
+
}
|
|
435
|
+
const unknown = Object.keys(raw).filter((key) => !methods.includes(key));
|
|
436
|
+
if (unknown.length > 0) {
|
|
437
|
+
throw new Error(`${path}: names ${unknown.sort(compareCodePoints).join(', ')}; a program answers at ` +
|
|
438
|
+
methods.join(', '));
|
|
439
|
+
}
|
|
440
|
+
const base = dirname(resolve(path));
|
|
441
|
+
const scripts = {};
|
|
442
|
+
for (const [method, programs] of Object.entries(raw)) {
|
|
443
|
+
if (!Array.isArray(programs))
|
|
444
|
+
throw new Error(`${path}: ${method} is a list of programs`);
|
|
445
|
+
scripts[snakeToCamel(method)] = programs.map((program, i) => {
|
|
446
|
+
if (isPlainObject(program))
|
|
447
|
+
absolutizeScriptKey(program, base);
|
|
448
|
+
const parsed = parseProgram(program, `${path}: ${method}[${String(i)}]`);
|
|
449
|
+
return compileProgram(loadProgram(parsed), basename(path));
|
|
450
|
+
});
|
|
593
451
|
}
|
|
594
|
-
return
|
|
452
|
+
return scripts;
|
|
595
453
|
}
|
|
596
454
|
const VAR_RE = /\$\{([A-Z_][A-Z0-9_]*)\}/g;
|
|
597
455
|
function walkInterpolate(v, env, missing) {
|
|
@@ -641,6 +499,8 @@ export function readProcessEnv() {
|
|
|
641
499
|
}
|
|
642
500
|
/**
|
|
643
501
|
* Interpolate `${VAR}` and check every key, leaving the spelling alone.
|
|
502
|
+
* `env` is where a name is read, the process's by default; null reads
|
|
503
|
+
* none and leaves every `${VAR}` as written.
|
|
644
504
|
*
|
|
645
505
|
* This is the shape that travels: the CLI prepares a config here and
|
|
646
506
|
* POSTs it, and the daemon runs the same check on what arrives, so the
|
|
@@ -651,8 +511,7 @@ export function readProcessEnv() {
|
|
|
651
511
|
*/
|
|
652
512
|
export function checkWorkspaceConfig(source, env) {
|
|
653
513
|
const raw = { ...source };
|
|
654
|
-
const
|
|
655
|
-
const interpolated = interpolateEnv(raw, useEnv);
|
|
514
|
+
const interpolated = env === null ? raw : interpolateEnv(raw, env ?? readProcessEnv());
|
|
656
515
|
const mounts = interpolated.mounts;
|
|
657
516
|
if (mounts === undefined ||
|
|
658
517
|
typeof mounts !== 'object' ||
|
|
@@ -822,32 +681,10 @@ function buildStoreGroup(block) {
|
|
|
822
681
|
// not survive a plain camelize.
|
|
823
682
|
const s3 = { key_prefix: 'mirage/', ...block };
|
|
824
683
|
delete s3.type;
|
|
825
|
-
return new S3WorkspaceStateStore(
|
|
684
|
+
return new S3WorkspaceStateStore(parseConfigWithSchema(S3Config, s3));
|
|
826
685
|
}
|
|
827
686
|
return new RAMWorkspaceStateStore();
|
|
828
687
|
}
|
|
829
|
-
// Build one job's console on its own Redis stream. The key carries a
|
|
830
|
-
// fresh nonce beside the job id, because job ids restart at 1 when the
|
|
831
|
-
// table empties and a reused stream would replay the previous job's
|
|
832
|
-
// chunks. The minted prefix is published as the store's keyPrefix
|
|
833
|
-
// (reachable as job.console.store), so an embedder can hand a reader
|
|
834
|
-
// in another process the console's address. Keys expire ttl_seconds
|
|
835
|
-
// after the last append (default one day) so finished jobs cannot
|
|
836
|
-
// accumulate in Redis forever. The workspace closes what this builds
|
|
837
|
-
// at teardown (JobTable.closeConsoles). Mirrors Python's
|
|
838
|
-
// _redis_console.
|
|
839
|
-
function buildConsoleFactory(block) {
|
|
840
|
-
if (block?.type !== 'redis')
|
|
841
|
-
return undefined;
|
|
842
|
-
const url = block.url ?? 'redis://localhost:6379/0';
|
|
843
|
-
const keyPrefix = block.keyPrefix ?? 'mirage:console:';
|
|
844
|
-
const ttlSeconds = block.ttlSeconds === undefined ? 86400 : block.ttlSeconds;
|
|
845
|
-
return (jobId) => new JobConsole(new RedisConsoleStore({
|
|
846
|
-
url,
|
|
847
|
-
keyPrefix: `${keyPrefix}${randomBytes(6).toString('hex')}:${jobId.toString()}:`,
|
|
848
|
-
...(ttlSeconds !== null ? { ttlSeconds } : {}),
|
|
849
|
-
}));
|
|
850
|
-
}
|
|
851
688
|
function buildStateStore(block) {
|
|
852
689
|
if (block === null || block === undefined)
|
|
853
690
|
return undefined;
|
|
@@ -855,11 +692,13 @@ function buildStateStore(block) {
|
|
|
855
692
|
...(block.namespace != null ? { namespace: buildStoreGroup(block.namespace) } : {}),
|
|
856
693
|
...(block.observer != null ? { observer: buildStoreGroup(block.observer) } : {}),
|
|
857
694
|
...(block.workspace != null ? { workspace: buildStoreGroup(block.workspace) } : {}),
|
|
695
|
+
...(block.jobs != null ? { jobs: buildStoreGroup(block.jobs) } : {}),
|
|
858
696
|
};
|
|
859
697
|
if (block.type === 'redis') {
|
|
860
698
|
return new RedisWorkspaceStateStore({
|
|
861
699
|
...(block.url !== undefined ? { url: block.url } : {}),
|
|
862
700
|
...(block.keyPrefix !== undefined ? { keyPrefix: block.keyPrefix } : {}),
|
|
701
|
+
...(block.root !== undefined ? { root: block.root } : {}),
|
|
863
702
|
...overrides,
|
|
864
703
|
});
|
|
865
704
|
}
|
|
@@ -871,6 +710,13 @@ function buildStateStore(block) {
|
|
|
871
710
|
}
|
|
872
711
|
return new RAMWorkspaceStateStore(overrides);
|
|
873
712
|
}
|
|
713
|
+
/**
|
|
714
|
+
* The mounts and the options `new Workspace` takes, minus the two the loader
|
|
715
|
+
* always resolves. The options are `WorkspaceOptions` itself: spelling the
|
|
716
|
+
* fields out instead is what once dropped `clis` and the deny rules on the
|
|
717
|
+
* way to the daemon, a config knob parsed and validated, then discarded by
|
|
718
|
+
* a list nobody remembered to extend.
|
|
719
|
+
*/
|
|
874
720
|
export async function configToWorkspaceArgs(cfg) {
|
|
875
721
|
const wsMode = coerceMountMode(cfg.mode, MountMode.WRITE);
|
|
876
722
|
const defaultRead = resolveReadSpec(cfg.read, undefined);
|
|
@@ -904,18 +750,37 @@ export async function configToWorkspaceArgs(cfg) {
|
|
|
904
750
|
}
|
|
905
751
|
const index = buildIndexConfig(cfg.index);
|
|
906
752
|
const stateStore = buildStateStore(cfg.store);
|
|
907
|
-
const
|
|
908
|
-
|
|
909
|
-
|
|
753
|
+
const clis = cfg.clis;
|
|
754
|
+
const mcp = clis !== undefined &&
|
|
755
|
+
clis !== null &&
|
|
756
|
+
Object.values(clis).some((block) => isPlainObject(block) && block.cli === MCP_CLI);
|
|
757
|
+
// An MCP entry is listed at load, under the config's network and any rule already bound.
|
|
758
|
+
const bound = networkBound();
|
|
759
|
+
const rule = mcp ? narrowed(bound, cfg.network ?? true) : bound;
|
|
760
|
+
if (rule !== null)
|
|
761
|
+
watchNetwork();
|
|
762
|
+
let cliEntries;
|
|
763
|
+
try {
|
|
764
|
+
cliEntries =
|
|
765
|
+
clis !== undefined && clis !== null
|
|
766
|
+
? await runWithNetwork(rule, () => buildCliEntries(clis, sources))
|
|
767
|
+
: undefined;
|
|
768
|
+
}
|
|
769
|
+
finally {
|
|
770
|
+
if (rule !== null && rule !== bound)
|
|
771
|
+
await releaseNetwork(rule);
|
|
772
|
+
}
|
|
910
773
|
const runtimeEntries = cfg.runtimes !== undefined && cfg.runtimes !== null
|
|
911
774
|
? await buildRuntimeEntries(cfg.runtimes)
|
|
912
775
|
: undefined;
|
|
913
|
-
const consoleFactory = buildConsoleFactory(cfg.console);
|
|
914
776
|
return {
|
|
915
777
|
mounts,
|
|
916
778
|
options: {
|
|
917
779
|
mode: wsMode,
|
|
918
780
|
commandLimits: parseCommandLimits(cfg.commandLimits),
|
|
781
|
+
...(cfg.maxMemory !== undefined ? { maxMemory: cfg.maxMemory } : {}),
|
|
782
|
+
...(cfg.network !== undefined ? { network: cfg.network } : {}),
|
|
783
|
+
...(cfg.systemTime !== undefined ? { systemTime: cfg.systemTime } : {}),
|
|
919
784
|
io: new IOConfig(cfg.io),
|
|
920
785
|
read: defaultRead,
|
|
921
786
|
write: defaultWrite,
|
|
@@ -928,13 +793,17 @@ export async function configToWorkspaceArgs(cfg) {
|
|
|
928
793
|
// would ever release. Mirrors the `owns_store` Python's loader
|
|
929
794
|
// sets beside the same store.
|
|
930
795
|
...(stateStore !== undefined ? { store: stateStore, ownsStore: true } : {}),
|
|
931
|
-
...(consoleFactory !== undefined ? { consoleFactory } : {}),
|
|
932
796
|
...(runtimeEntries !== undefined ? { runtimes: runtimeEntries } : {}),
|
|
933
797
|
...(cfg.routePolicy !== undefined && cfg.routePolicy !== null
|
|
934
798
|
? { routePolicy: loadProgram(parseProgram(cfg.routePolicy, 'route_policy')) }
|
|
935
799
|
: {}),
|
|
936
800
|
...(cfg.profiles !== undefined && cfg.profiles !== null
|
|
937
|
-
? {
|
|
801
|
+
? {
|
|
802
|
+
profiles: Object.fromEntries(Object.entries(parseProfiles(cfg.profiles)).map(([name, profile]) => [
|
|
803
|
+
name,
|
|
804
|
+
loadProfilePolicy(profile),
|
|
805
|
+
])),
|
|
806
|
+
}
|
|
938
807
|
: {}),
|
|
939
808
|
...(cfg.profile !== undefined && cfg.profile !== null
|
|
940
809
|
? { profile: cfg.profile }
|
|
@@ -1001,7 +870,8 @@ function looksLikeCliSpec(value) {
|
|
|
1001
870
|
return false;
|
|
1002
871
|
}
|
|
1003
872
|
const subcommands = node.subcommands;
|
|
1004
|
-
|
|
873
|
+
for (const item of subcommands)
|
|
874
|
+
pending.push(item);
|
|
1005
875
|
}
|
|
1006
876
|
return true;
|
|
1007
877
|
}
|
|
@@ -1024,7 +894,11 @@ function asCliSpec(value, name, ref) {
|
|
|
1024
894
|
return new CLI(value);
|
|
1025
895
|
throw new Error(`clis entry '${name}': ${ref} is not a CLI`);
|
|
1026
896
|
}
|
|
1027
|
-
|
|
897
|
+
/**
|
|
898
|
+
* Each `clis:` entry checked and resolved to its tree and its config, pointers
|
|
899
|
+
* read; an `mcp` entry's tree is listed from its server.
|
|
900
|
+
*/
|
|
901
|
+
export async function buildCliEntries(clis, sources) {
|
|
1028
902
|
const out = {};
|
|
1029
903
|
for (const [name, block] of Object.entries(clis)) {
|
|
1030
904
|
// The raw config arrives as unvalidated YAML: the CLIBlock type is
|
|
@@ -1058,20 +932,21 @@ async function buildCliEntries(clis, sources) {
|
|
|
1058
932
|
// is synchronous. A `vfs:` value reads the same way, resolved by
|
|
1059
933
|
// `buildVfs` rather than here, because a mount block reaches the
|
|
1060
934
|
// registry and a `clis` block does not.
|
|
935
|
+
// `cli: mcp` names no registered tree: the tree is its server's tool list.
|
|
1061
936
|
const entry = hasScript
|
|
1062
937
|
? new CLI({
|
|
1063
938
|
spec: new CommandSpec({ name }),
|
|
1064
939
|
script: loadScriptSource(block.script),
|
|
1065
940
|
runtime: block.runtime ?? null,
|
|
1066
941
|
})
|
|
1067
|
-
:
|
|
942
|
+
: block.cli === MCP_CLI
|
|
943
|
+
? null
|
|
944
|
+
: await resolveCliRef(block.cli, name);
|
|
1068
945
|
// A CLI credential reads a pointer the way a mount's does: the
|
|
1069
946
|
// account CLI's `config_model` is the same model a VFS
|
|
1070
947
|
// parses, so it must receive the credential, not the pointer.
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
await resolveConfigSecrets(block.config ?? {}, sources, `clis.${name}.config`),
|
|
1074
|
-
];
|
|
948
|
+
const config = await resolveConfigSecrets(block.config ?? {}, sources, `clis.${name}.config`);
|
|
949
|
+
out[name] = [entry ?? (await mcpCli(config)), config];
|
|
1075
950
|
}
|
|
1076
951
|
return out;
|
|
1077
952
|
}
|