@ai-ecoverse/slicc-kernel 1.186.0 → 1.186.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/async-process.js +1 -1
- package/dist/cloudflare-sources.js +1 -1
- package/dist/cloudflare.js +194 -71
- package/dist/cloudflare.js.map +3 -3
- package/dist/driver-worker.js +1 -1
- package/dist/driver-worker.js.map +2 -2
- package/dist/driver.js +1 -1
- package/dist/driver.js.map +2 -2
- package/dist/kernel-worker.js +15 -7
- package/dist/kernel-worker.js.map +2 -2
- package/dist/node-driver-worker.js +1 -1
- package/dist/node-driver-worker.js.map +2 -2
- package/dist/node-process-worker.cjs +1 -1
- package/dist/node-process-worker.js +1 -1
- package/dist/node.js +15 -7
- package/dist/node.js.map +2 -2
- package/dist/process-worker.js +1 -1
- package/dist/types/cloudflare/computer-driver.d.ts +6 -0
- package/dist/types/cloudflare/computer.d.ts +3 -2
- package/dist/types/cloudflare.d.ts +1 -1
- package/dist/types/mount/protocol.d.ts +1 -0
- package/package.json +4 -4
package/dist/driver.js
CHANGED
package/dist/driver.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/mount/protocol.ts", "../src/bytes.ts", "../src/mount/driver.ts"],
|
|
4
|
-
"sourcesContent": ["export const DRIVER_PROTOCOL: readonly [number, number] = [1, 3];\n\nexport interface DriverCapabilities {\n readonly?: boolean;\n symlinks?: boolean;\n links?: boolean;\n fifos?: boolean;\n chmod?: boolean;\n owners?: boolean;\n linkTimes?: boolean;\n ranges?: boolean;\n sessions?: boolean;\n listingStats?: boolean;\n caseInsensitive?: boolean;\n normalization?: 'none' | 'nfc' | 'nfd-insensitive';\n maxIo?: number;\n maxFile?: number;\n attrTtl?: number;\n entryTtl?: number;\n}\n\nexport interface DriverAttr {\n kind: 'file' | 'directory' | 'symlink' | 'fifo';\n size: number;\n mtime: number;\n atime?: number;\n mode?: number;\n ino?: number;\n nlink?: number;\n etag?: string;\n uid?: number;\n gid?: number;\n}\n\nexport interface DriverOwner {\n uid?: number;\n gid?: number;\n mode?: number;\n}\n\nexport interface DriverEntry {\n name: string;\n kind: DriverAttr['kind'];\n attr?: DriverAttr;\n}\n\nexport interface DriverStatfs {\n bsize: number;\n blocks: number;\n bfree: number;\n}\n\nexport interface MountRequestInfo {\n source: string;\n options: Record<string, string>;\n}\n\nexport type DriverCall =\n | { op: 'getattr'; path: string }\n | { op: 'readdir'; path: string }\n | ({\n op: 'open';\n path: string;\n write: boolean;\n create: boolean;\n truncate: boolean;\n exclusive: boolean;\n ifMatch?: string;\n } & DriverOwner)\n | { op: 'read'; fh: number; offset: number; size: number }\n | { op: 'write'; fh: number; offset: number; bytes: Uint8Array }\n | { op: 'release'; fh: number }\n | ({ op: 'mkdir'; path: string } & DriverOwner)\n | { op: 'rmdir'; path: string }\n | { op: 'unlink'; path: string }\n | { op: 'rename'; from: string; to: string }\n | { op: 'link'; from: string; to: string }\n | ({ op: 'symlink'; target: string; path: string } & DriverOwner)\n | ({ op: 'mkfifo'; path: string } & DriverOwner)\n | { op: 'readlink'; path: string }\n | {\n op: 'setattr';\n path: string;\n mode?: number;\n mtime?: number;\n atime?: number;\n size?: number;\n uid?: number;\n gid?: number;\n }\n | { op: 'statfs' };\n\nexport type DriverRequest = DriverCall & { id: number };\n\nexport interface DriverReply {\n id: number;\n result?: unknown;\n errno?: string;\n message?: string;\n}\n\nexport interface KernelDriverHello {\n protocol: readonly [number, number];\n mount: MountRequestInfo;\n}\n\nexport interface DriverHello {\n protocol: readonly [number, number];\n capabilities?: DriverCapabilities;\n error?: string;\n errno?: string;\n}\n\nexport type KernelToDriver = { hello: KernelDriverHello } | DriverRequest;\n\nexport type DriverToKernel = { hello: DriverHello } | DriverReply | { invalidate: string[] | true };\n\nexport function driverVersionError(theirs: unknown): string | undefined {\n const major = Array.isArray(theirs) ? theirs[0] : undefined;\n if (major === DRIVER_PROTOCOL[0]) return undefined;\n const named = typeof major === 'number' ? `${major}.x` : 'without a version';\n return `slicc-kernel driver protocol ${named} is not supported: this side speaks ${DRIVER_PROTOCOL.join('.')}`;\n}\n", "export function fresh(bytes: Uint8Array, start = 0, end = bytes.length): Uint8Array {\n return new Uint8Array(bytes.subarray(start, end));\n}\n", "import {\n DRIVER_PROTOCOL,\n type DriverAttr,\n type DriverCapabilities,\n type DriverEntry,\n type DriverOwner,\n type DriverRequest,\n type DriverStatfs,\n driverVersionError,\n type KernelDriverHello,\n type MountRequestInfo,\n} from './protocol.ts';\n\nexport type {\n DriverAttr,\n DriverCapabilities,\n DriverEntry,\n DriverOwner,\n DriverStatfs,\n MountRequestInfo,\n} from './protocol.ts';\n\nimport { fresh } from '../bytes.ts';\n\nexport interface OpenFlags {\n write: boolean;\n create: boolean;\n truncate: boolean;\n exclusive: boolean;\n ifMatch?: string;\n owner?: DriverOwner;\n}\n\nexport interface FilesystemHandlers {\n mount?(\n info: MountRequestInfo\n ): Promise<DriverCapabilities | undefined> | DriverCapabilities | undefined;\n getattr(path: string): Promise<DriverAttr>;\n readdir(path: string): Promise<DriverEntry[]>;\n open(path: string, flags: OpenFlags): Promise<number>;\n read(fh: number, offset: number, size: number): Promise<Uint8Array>;\n write(fh: number, offset: number, bytes: Uint8Array): Promise<void>;\n release(fh: number): Promise<void>;\n mkdir(path: string, owner?: DriverOwner): Promise<void>;\n rmdir(path: string): Promise<void>;\n unlink(path: string): Promise<void>;\n rename(from: string, to: string): Promise<void>;\n link?(from: string, to: string): Promise<void>;\n symlink?(target: string, path: string, owner?: DriverOwner): Promise<void>;\n mkfifo?(path: string, owner?: DriverOwner): Promise<void>;\n readlink?(path: string): Promise<string>;\n setattr?(path: string, attr: DriverSetAttr): Promise<void>;\n statfs?(): Promise<DriverStatfs>;\n}\n\nexport interface DriverSetAttr {\n mode?: number;\n mtime?: number;\n atime?: number;\n size?: number;\n uid?: number;\n gid?: number;\n}\n\nfunction ownerOf(req: DriverOwner): DriverOwner | undefined {\n const owner = {\n ...(req.uid !== undefined ? { uid: req.uid } : {}),\n ...(req.gid !== undefined ? { gid: req.gid } : {}),\n ...(req.mode !== undefined ? { mode: req.mode } : {}),\n };\n return Object.keys(owner).length > 0 ? owner : undefined;\n}\n\nfunction withOwner<T extends object>(base: T, owner: DriverOwner | undefined): T {\n return owner ? { ...base, owner } : base;\n}\n\nexport interface DriverPort {\n postMessage(message: unknown, transfer?: Transferable[]): void;\n addEventListener(type: 'message', handler: (event: MessageEvent) => void): void;\n start?(): void;\n}\n\nexport interface ServedFilesystem {\n invalidate(paths: string[] | true): void;\n}\n\nexport function fsError(code: string, message = code): Error & { code: string } {\n return Object.assign(new Error(message), { code });\n}\n\nconst SET_ATTRS = ['mode', 'mtime', 'atime', 'size', 'uid', 'gid'] as const;\n\nfunction setAttrOf(req: DriverSetAttr): DriverSetAttr {\n const attr: DriverSetAttr = {};\n for (const key of SET_ATTRS) if (req[key] !== undefined) attr[key] = req[key];\n return attr;\n}\n\nasync function dispatch(h: FilesystemHandlers, req: DriverRequest): Promise<unknown> {\n switch (req.op) {\n case 'getattr':\n return h.getattr(req.path);\n case 'readdir':\n return h.readdir(req.path);\n case 'open':\n return h.open(\n req.path,\n withOwner(\n {\n write: req.write,\n create: req.create,\n truncate: req.truncate,\n exclusive: req.exclusive,\n ...(req.ifMatch !== undefined ? { ifMatch: req.ifMatch } : {}),\n },\n ownerOf(req)\n )\n );\n case 'read':\n return h.read(req.fh, req.offset, req.size);\n case 'write':\n return h.write(req.fh, req.offset, req.bytes);\n case 'release':\n return h.release(req.fh);\n case 'mkdir':\n return ownerOf(req) ? h.mkdir(req.path, ownerOf(req)) : h.mkdir(req.path);\n case 'rmdir':\n return h.rmdir(req.path);\n case 'unlink':\n return h.unlink(req.path);\n case 'rename':\n return h.rename(req.from, req.to);\n case 'link':\n if (!h.link) throw fsError('EPERM', 'this file system has no hard links');\n return h.link(req.from, req.to);\n case 'mkfifo':\n if (!h.mkfifo) throw fsError('EPERM', 'this file system has no FIFOs');\n return ownerOf(req) ? h.mkfifo(req.path, ownerOf(req)) : h.mkfifo(req.path);\n case 'symlink':\n if (!h.symlink) throw fsError('EPERM', 'this file system has no symlinks');\n return ownerOf(req)\n ? h.symlink(req.target, req.path, ownerOf(req))\n : h.symlink(req.target, req.path);\n case 'readlink':\n if (!h.readlink) throw fsError('EINVAL', `${req.path} is not a symlink`);\n return h.readlink(req.path);\n case 'setattr':\n return h.setattr?.(req.path, setAttrOf(req));\n case 'statfs':\n return h.statfs?.() ?? null;\n default:\n throw fsError('ENOSYS', `unknown driver op ${(req as { op: string }).op}`);\n }\n}\n\nexport function serveFilesystem(\n port: DriverPort,\n handlers: FilesystemHandlers,\n capabilities: DriverCapabilities = {},\n options: { owned?: boolean } = {}\n): ServedFilesystem {\n let open = false;\n const reply = (message: object, transfer: Transferable[] = []) =>\n port.postMessage(message, transfer);\n async function hello(message: KernelDriverHello): Promise<void> {\n const refused = driverVersionError(message.protocol);\n if (refused) {\n reply({ hello: { protocol: DRIVER_PROTOCOL, error: refused, errno: 'EPROTO' } });\n return;\n }\n try {\n const refined = await handlers.mount?.(message.mount);\n open = true;\n reply({\n hello: { protocol: DRIVER_PROTOCOL, capabilities: { ...capabilities, ...refined } },\n });\n } catch (err) {\n const code = (err as { code?: unknown })?.code;\n reply({\n hello: {\n protocol: DRIVER_PROTOCOL,\n error: err instanceof Error ? err.message : String(err),\n errno: typeof code === 'string' ? code : 'EIO',\n },\n });\n }\n }\n port.addEventListener('message', (event) => {\n const data = event.data as { hello?: KernelDriverHello } & DriverRequest;\n if (data.hello) {\n void hello(data.hello);\n return;\n }\n if (!open) return;\n dispatch(handlers, data).then(\n (result) => {\n if (result instanceof Uint8Array) {\n const whole = result.byteOffset === 0 && result.byteLength === result.buffer.byteLength;\n const bytes = options.owned && whole ? result : fresh(result);\n reply({ id: data.id, result: bytes }, [bytes.buffer]);\n } else reply({ id: data.id, result: result ?? null });\n },\n (err: unknown) => {\n const code = (err as { code?: unknown })?.code;\n reply({\n id: data.id,\n errno: typeof code === 'string' ? code : 'EIO',\n message: err instanceof Error ? err.message : String(err),\n });\n }\n );\n });\n port.start?.();\n return { invalidate: (paths) => reply({ invalidate: paths }) };\n}\n"],
|
|
5
|
-
"mappings": ";AAAO,IAAM,kBAA6C,CAAC,GAAG,CAAC;
|
|
4
|
+
"sourcesContent": ["export const DRIVER_PROTOCOL: readonly [number, number] = [1, 4];\n\nexport interface DriverCapabilities {\n readonly?: boolean;\n symlinks?: boolean;\n links?: boolean;\n fifos?: boolean;\n chmod?: boolean;\n owners?: boolean;\n linkTimes?: boolean;\n ranges?: boolean;\n sessions?: boolean;\n listingStats?: boolean;\n caseInsensitive?: boolean;\n normalization?: 'none' | 'nfc' | 'nfd-insensitive';\n maxIo?: number;\n maxFile?: number;\n attrTtl?: number;\n entryTtl?: number;\n}\n\nexport interface DriverAttr {\n kind: 'file' | 'directory' | 'symlink' | 'fifo';\n size: number;\n mtime: number;\n atime?: number;\n mode?: number;\n ino?: number;\n nlink?: number;\n etag?: string;\n uid?: number;\n gid?: number;\n readonly?: boolean;\n}\n\nexport interface DriverOwner {\n uid?: number;\n gid?: number;\n mode?: number;\n}\n\nexport interface DriverEntry {\n name: string;\n kind: DriverAttr['kind'];\n attr?: DriverAttr;\n}\n\nexport interface DriverStatfs {\n bsize: number;\n blocks: number;\n bfree: number;\n}\n\nexport interface MountRequestInfo {\n source: string;\n options: Record<string, string>;\n}\n\nexport type DriverCall =\n | { op: 'getattr'; path: string }\n | { op: 'readdir'; path: string }\n | ({\n op: 'open';\n path: string;\n write: boolean;\n create: boolean;\n truncate: boolean;\n exclusive: boolean;\n ifMatch?: string;\n } & DriverOwner)\n | { op: 'read'; fh: number; offset: number; size: number }\n | { op: 'write'; fh: number; offset: number; bytes: Uint8Array }\n | { op: 'release'; fh: number }\n | ({ op: 'mkdir'; path: string } & DriverOwner)\n | { op: 'rmdir'; path: string }\n | { op: 'unlink'; path: string }\n | { op: 'rename'; from: string; to: string }\n | { op: 'link'; from: string; to: string }\n | ({ op: 'symlink'; target: string; path: string } & DriverOwner)\n | ({ op: 'mkfifo'; path: string } & DriverOwner)\n | { op: 'readlink'; path: string }\n | {\n op: 'setattr';\n path: string;\n mode?: number;\n mtime?: number;\n atime?: number;\n size?: number;\n uid?: number;\n gid?: number;\n }\n | { op: 'statfs' };\n\nexport type DriverRequest = DriverCall & { id: number };\n\nexport interface DriverReply {\n id: number;\n result?: unknown;\n errno?: string;\n message?: string;\n}\n\nexport interface KernelDriverHello {\n protocol: readonly [number, number];\n mount: MountRequestInfo;\n}\n\nexport interface DriverHello {\n protocol: readonly [number, number];\n capabilities?: DriverCapabilities;\n error?: string;\n errno?: string;\n}\n\nexport type KernelToDriver = { hello: KernelDriverHello } | DriverRequest;\n\nexport type DriverToKernel = { hello: DriverHello } | DriverReply | { invalidate: string[] | true };\n\nexport function driverVersionError(theirs: unknown): string | undefined {\n const major = Array.isArray(theirs) ? theirs[0] : undefined;\n if (major === DRIVER_PROTOCOL[0]) return undefined;\n const named = typeof major === 'number' ? `${major}.x` : 'without a version';\n return `slicc-kernel driver protocol ${named} is not supported: this side speaks ${DRIVER_PROTOCOL.join('.')}`;\n}\n", "export function fresh(bytes: Uint8Array, start = 0, end = bytes.length): Uint8Array {\n return new Uint8Array(bytes.subarray(start, end));\n}\n", "import {\n DRIVER_PROTOCOL,\n type DriverAttr,\n type DriverCapabilities,\n type DriverEntry,\n type DriverOwner,\n type DriverRequest,\n type DriverStatfs,\n driverVersionError,\n type KernelDriverHello,\n type MountRequestInfo,\n} from './protocol.ts';\n\nexport type {\n DriverAttr,\n DriverCapabilities,\n DriverEntry,\n DriverOwner,\n DriverStatfs,\n MountRequestInfo,\n} from './protocol.ts';\n\nimport { fresh } from '../bytes.ts';\n\nexport interface OpenFlags {\n write: boolean;\n create: boolean;\n truncate: boolean;\n exclusive: boolean;\n ifMatch?: string;\n owner?: DriverOwner;\n}\n\nexport interface FilesystemHandlers {\n mount?(\n info: MountRequestInfo\n ): Promise<DriverCapabilities | undefined> | DriverCapabilities | undefined;\n getattr(path: string): Promise<DriverAttr>;\n readdir(path: string): Promise<DriverEntry[]>;\n open(path: string, flags: OpenFlags): Promise<number>;\n read(fh: number, offset: number, size: number): Promise<Uint8Array>;\n write(fh: number, offset: number, bytes: Uint8Array): Promise<void>;\n release(fh: number): Promise<void>;\n mkdir(path: string, owner?: DriverOwner): Promise<void>;\n rmdir(path: string): Promise<void>;\n unlink(path: string): Promise<void>;\n rename(from: string, to: string): Promise<void>;\n link?(from: string, to: string): Promise<void>;\n symlink?(target: string, path: string, owner?: DriverOwner): Promise<void>;\n mkfifo?(path: string, owner?: DriverOwner): Promise<void>;\n readlink?(path: string): Promise<string>;\n setattr?(path: string, attr: DriverSetAttr): Promise<void>;\n statfs?(): Promise<DriverStatfs>;\n}\n\nexport interface DriverSetAttr {\n mode?: number;\n mtime?: number;\n atime?: number;\n size?: number;\n uid?: number;\n gid?: number;\n}\n\nfunction ownerOf(req: DriverOwner): DriverOwner | undefined {\n const owner = {\n ...(req.uid !== undefined ? { uid: req.uid } : {}),\n ...(req.gid !== undefined ? { gid: req.gid } : {}),\n ...(req.mode !== undefined ? { mode: req.mode } : {}),\n };\n return Object.keys(owner).length > 0 ? owner : undefined;\n}\n\nfunction withOwner<T extends object>(base: T, owner: DriverOwner | undefined): T {\n return owner ? { ...base, owner } : base;\n}\n\nexport interface DriverPort {\n postMessage(message: unknown, transfer?: Transferable[]): void;\n addEventListener(type: 'message', handler: (event: MessageEvent) => void): void;\n start?(): void;\n}\n\nexport interface ServedFilesystem {\n invalidate(paths: string[] | true): void;\n}\n\nexport function fsError(code: string, message = code): Error & { code: string } {\n return Object.assign(new Error(message), { code });\n}\n\nconst SET_ATTRS = ['mode', 'mtime', 'atime', 'size', 'uid', 'gid'] as const;\n\nfunction setAttrOf(req: DriverSetAttr): DriverSetAttr {\n const attr: DriverSetAttr = {};\n for (const key of SET_ATTRS) if (req[key] !== undefined) attr[key] = req[key];\n return attr;\n}\n\nasync function dispatch(h: FilesystemHandlers, req: DriverRequest): Promise<unknown> {\n switch (req.op) {\n case 'getattr':\n return h.getattr(req.path);\n case 'readdir':\n return h.readdir(req.path);\n case 'open':\n return h.open(\n req.path,\n withOwner(\n {\n write: req.write,\n create: req.create,\n truncate: req.truncate,\n exclusive: req.exclusive,\n ...(req.ifMatch !== undefined ? { ifMatch: req.ifMatch } : {}),\n },\n ownerOf(req)\n )\n );\n case 'read':\n return h.read(req.fh, req.offset, req.size);\n case 'write':\n return h.write(req.fh, req.offset, req.bytes);\n case 'release':\n return h.release(req.fh);\n case 'mkdir':\n return ownerOf(req) ? h.mkdir(req.path, ownerOf(req)) : h.mkdir(req.path);\n case 'rmdir':\n return h.rmdir(req.path);\n case 'unlink':\n return h.unlink(req.path);\n case 'rename':\n return h.rename(req.from, req.to);\n case 'link':\n if (!h.link) throw fsError('EPERM', 'this file system has no hard links');\n return h.link(req.from, req.to);\n case 'mkfifo':\n if (!h.mkfifo) throw fsError('EPERM', 'this file system has no FIFOs');\n return ownerOf(req) ? h.mkfifo(req.path, ownerOf(req)) : h.mkfifo(req.path);\n case 'symlink':\n if (!h.symlink) throw fsError('EPERM', 'this file system has no symlinks');\n return ownerOf(req)\n ? h.symlink(req.target, req.path, ownerOf(req))\n : h.symlink(req.target, req.path);\n case 'readlink':\n if (!h.readlink) throw fsError('EINVAL', `${req.path} is not a symlink`);\n return h.readlink(req.path);\n case 'setattr':\n return h.setattr?.(req.path, setAttrOf(req));\n case 'statfs':\n return h.statfs?.() ?? null;\n default:\n throw fsError('ENOSYS', `unknown driver op ${(req as { op: string }).op}`);\n }\n}\n\nexport function serveFilesystem(\n port: DriverPort,\n handlers: FilesystemHandlers,\n capabilities: DriverCapabilities = {},\n options: { owned?: boolean } = {}\n): ServedFilesystem {\n let open = false;\n const reply = (message: object, transfer: Transferable[] = []) =>\n port.postMessage(message, transfer);\n async function hello(message: KernelDriverHello): Promise<void> {\n const refused = driverVersionError(message.protocol);\n if (refused) {\n reply({ hello: { protocol: DRIVER_PROTOCOL, error: refused, errno: 'EPROTO' } });\n return;\n }\n try {\n const refined = await handlers.mount?.(message.mount);\n open = true;\n reply({\n hello: { protocol: DRIVER_PROTOCOL, capabilities: { ...capabilities, ...refined } },\n });\n } catch (err) {\n const code = (err as { code?: unknown })?.code;\n reply({\n hello: {\n protocol: DRIVER_PROTOCOL,\n error: err instanceof Error ? err.message : String(err),\n errno: typeof code === 'string' ? code : 'EIO',\n },\n });\n }\n }\n port.addEventListener('message', (event) => {\n const data = event.data as { hello?: KernelDriverHello } & DriverRequest;\n if (data.hello) {\n void hello(data.hello);\n return;\n }\n if (!open) return;\n dispatch(handlers, data).then(\n (result) => {\n if (result instanceof Uint8Array) {\n const whole = result.byteOffset === 0 && result.byteLength === result.buffer.byteLength;\n const bytes = options.owned && whole ? result : fresh(result);\n reply({ id: data.id, result: bytes }, [bytes.buffer]);\n } else reply({ id: data.id, result: result ?? null });\n },\n (err: unknown) => {\n const code = (err as { code?: unknown })?.code;\n reply({\n id: data.id,\n errno: typeof code === 'string' ? code : 'EIO',\n message: err instanceof Error ? err.message : String(err),\n });\n }\n );\n });\n port.start?.();\n return { invalidate: (paths) => reply({ invalidate: paths }) };\n}\n"],
|
|
5
|
+
"mappings": ";AAAO,IAAM,kBAA6C,CAAC,GAAG,CAAC;AAsHxD,SAAS,mBAAmB,QAAqC;AACtE,QAAM,QAAQ,MAAM,QAAQ,MAAM,IAAI,OAAO,CAAC,IAAI;AAClD,MAAI,UAAU,gBAAgB,CAAC,EAAG,QAAO;AACzC,QAAM,QAAQ,OAAO,UAAU,WAAW,GAAG,KAAK,OAAO;AACzD,SAAO,gCAAgC,KAAK,uCAAuC,gBAAgB,KAAK,GAAG,CAAC;AAC9G;;;AC3HO,SAAS,MAAM,OAAmB,QAAQ,GAAG,MAAM,MAAM,QAAoB;AAClF,SAAO,IAAI,WAAW,MAAM,SAAS,OAAO,GAAG,CAAC;AAClD;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AM,MAAM;AAC5D,gBAAM,EAAE,IAAI,KAAK,IAAI,QAAQ,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC;AAAA,QACtD,MAAO,OAAM,EAAE,IAAI,KAAK,IAAI,QAAQ,UAAU,KAAK,CAAC;AAAA,MACtD;AAAA,MACA,CAAC,QAAiB;AAChB,cAAM,OAAQ,KAA4B;AAC1C,cAAM;AAAA,UACJ,IAAI,KAAK;AAAA,UACT,OAAO,OAAO,SAAS,WAAW,OAAO;AAAA,UACzC,SAAS,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AAAA,QAC1D,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF,CAAC;AACD,OAAK,QAAQ;AACb,SAAO,EAAE,YAAY,CAAC,UAAU,MAAM,EAAE,YAAY,MAAM,CAAC,EAAE;AAC/D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/kernel-worker.js
CHANGED
|
@@ -9071,7 +9071,7 @@ function satisfies(version, range2) {
|
|
|
9071
9071
|
}
|
|
9072
9072
|
|
|
9073
9073
|
// src/version.ts
|
|
9074
|
-
var KERNEL_VERSION = true ? "1.186.
|
|
9074
|
+
var KERNEL_VERSION = true ? "1.186.1" : "0.0.0-dev";
|
|
9075
9075
|
var OS_RELEASE = "6.0.0-slicc";
|
|
9076
9076
|
function procVersion() {
|
|
9077
9077
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|
|
@@ -15093,7 +15093,7 @@ async function copyByBytes(fs, from, to, options) {
|
|
|
15093
15093
|
}
|
|
15094
15094
|
|
|
15095
15095
|
// src/mount/protocol.ts
|
|
15096
|
-
var DRIVER_PROTOCOL = [1,
|
|
15096
|
+
var DRIVER_PROTOCOL = [1, 4];
|
|
15097
15097
|
function driverVersionError(theirs) {
|
|
15098
15098
|
const major = Array.isArray(theirs) ? theirs[0] : void 0;
|
|
15099
15099
|
if (major === DRIVER_PROTOCOL[0]) return void 0;
|
|
@@ -15523,7 +15523,7 @@ function statOf2(attr2, path, mount) {
|
|
|
15523
15523
|
ino: attr2.ino ?? inodeOf(path),
|
|
15524
15524
|
...!inodeless(mount, attr2) && attr2.nlink !== void 0 ? { nlink: attr2.nlink } : {},
|
|
15525
15525
|
dev: mount.dev,
|
|
15526
|
-
...readonly(mount) ? { readonly: true } : {},
|
|
15526
|
+
...readonly(mount) || attr2.readonly === true ? { readonly: true } : {},
|
|
15527
15527
|
...mount.maxFile > 0 ? { maxFile: mount.maxFile } : {},
|
|
15528
15528
|
...mount.caps.ranges ? { ranged: true } : {},
|
|
15529
15529
|
...mount.caps.links ? { linkable: true } : {},
|
|
@@ -16513,6 +16513,9 @@ var MountFs = class _MountFs {
|
|
|
16513
16513
|
this.writable(a.mount, normalizePath(to));
|
|
16514
16514
|
if (a.mount.caps.links) await this.lstat(from);
|
|
16515
16515
|
if (!a.mount.caps.links) {
|
|
16516
|
+
if ((await this.lstat(parentOf9(to)).catch(() => void 0))?.readonly) {
|
|
16517
|
+
throw errnoError("EROFS", to);
|
|
16518
|
+
}
|
|
16516
16519
|
throw errnoError("EPERM", `${from}: this file system has no hard links`);
|
|
16517
16520
|
}
|
|
16518
16521
|
await this.table.commitUnder(from);
|
|
@@ -16942,10 +16945,7 @@ async function run(entry, path, req) {
|
|
|
16942
16945
|
await fs.rm(path, { file: true });
|
|
16943
16946
|
return done2;
|
|
16944
16947
|
case "rmdir":
|
|
16945
|
-
|
|
16946
|
-
if ((await fs.readdir(path)).length > 0) throw syncError("ENOTEMPTY", path);
|
|
16947
|
-
await fs.rm(path, { recursive: true });
|
|
16948
|
-
return done2;
|
|
16948
|
+
return rmdir(fs, path);
|
|
16949
16949
|
case "symlink":
|
|
16950
16950
|
await fs.symlink(req.arg2 ?? "", path, ownerFor2(entry));
|
|
16951
16951
|
return done2;
|
|
@@ -17228,6 +17228,14 @@ async function copyOp(entry, path, req) {
|
|
|
17228
17228
|
entry.fresh?.(to);
|
|
17229
17229
|
return done2;
|
|
17230
17230
|
}
|
|
17231
|
+
async function rmdir(fs, path) {
|
|
17232
|
+
const st = await fs.lstat(path);
|
|
17233
|
+
if (!st.isDirectory) throw syncError("ENOTDIR", path);
|
|
17234
|
+
if (st.readonly) throw syncError("EROFS", path);
|
|
17235
|
+
if ((await fs.readdir(path)).length > 0) throw syncError("ENOTEMPTY", path);
|
|
17236
|
+
await fs.rm(path, { recursive: true });
|
|
17237
|
+
return done2;
|
|
17238
|
+
}
|
|
17231
17239
|
async function createExclusive(fs, path, owner) {
|
|
17232
17240
|
if (fs.createExclusive) return fs.createExclusive(path, owner);
|
|
17233
17241
|
if (await fs.lstat(path).then(
|