@metamask/ocap-kernel
Version:
OCap kernel core components
53 lines • 1.84 kB
text/typescript
import type { SwingSetCapData, VatSyscallObject, VatSyscallResult } from "@agoric/swingset-liveslots";
import { Logger } from "@metamask/logger";
import type { KernelQueue } from "./KernelQueue.mjs";
import type { KernelStore } from "./store/index.mjs";
import type { VatId } from "./types.mjs";
type VatSyscallProps = {
vatId: VatId;
kernelQueue: KernelQueue;
kernelStore: KernelStore;
logger?: Logger;
};
/**
* A VatSyscall is a class that handles syscalls from a vat.
*
* This class is responsible for handling syscalls from a vat, including
* sending messages, resolving promises, and dropping imports.
*/
export declare class VatSyscall {
#private;
/** The ID of the vat */
readonly vatId: VatId;
/** The illegal syscall that was received */
illegalSyscall: {
vatId: VatId;
info: SwingSetCapData;
} | undefined;
/** The error when delivery failed */
deliveryError: string | undefined;
/** The termination request that was received from the vat with syscall.exit() */
vatRequestedTermination: {
reject: boolean;
info: SwingSetCapData;
} | undefined;
/**
* Construct a new VatSyscall instance.
*
* @param props - The properties for the VatSyscall.
* @param props.vatId - The ID of the vat.
* @param props.kernelQueue - The kernel's run queue.
* @param props.kernelStore - The kernel's store.
* @param props.logger - The logger for the VatSyscall.
*/
constructor({ vatId, kernelQueue, kernelStore, logger }: VatSyscallProps);
/**
* Handle a syscall from the vat.
*
* @param vso - The syscall that was received.
* @returns The result of the syscall.
*/
handleSyscall(vso: VatSyscallObject): VatSyscallResult;
}
export {};
//# sourceMappingURL=VatSyscall.d.mts.map