kernel

kernel
Static Members
main()
init()
init()
init()
name
version
build

proc

proc
Static Members
ProcessStatus
new Process()
getProcess(pid)
getProcessForWindow(window)
ArgV
spawn(path, argv)
sanitizeArgv(argv)
ProcessInfo
ps()
Capability

ipc

ipc
Static Members
MessageType
Message
makeReply(reply, message)
errorReply(error, message)
Cid
Channel
Handler

Process Sandbox is responsible for launching an untrusted process in WebWorker thread and jailing it in IFrame sandbox. This restricts what a Process can do to what is allowed to WebWorker thread (not much besides web access) and what is accessible by sending and receiving messages from the kernel (and indirectly other _Process_es).

new Sandbox(id: string, path: string)
Parameters
id (string)
path (string)
Instance Members
window
terminate()
postMessage(msg)

IFrame proxy code for WebWorker. This code works in an IFrame sandbox as an intermediary between kernel and process code working in WebWorker it creates.

sandbox.blob(origin: string, name: string, path: string): void
Parameters
origin (string) Origin of parent window.
name (string) Name of WebWorker inside (for tracking purposes).
path (string) Originating code path (for logging purposes).
Returns
void

vfs

vfs
Static Members
contentHandler(to, from, msg)
Path
Volume
mount(volume, handler, argv)
unmount(volume)
getMounts()
assign(source, dest)
unassign(source)
getAssigns()
resolvePath(full)
splitPath(full)
normalizePath(path)
resolveAssigns(path)

tunables

tunables
Static Members
VOLUME_NAME_REGEXP
MAX_ASSIGN_RESOLVE_ATTEMPTS

Creates application Window visible to the user. Handles interactions by emitting events.

new Window()

Extends EventEmitter

Instance Members
_content
_dragStartEvent
preventKeys
show(parent)
hide()
close()
setPosition(position)
setContent(data)
setStyle(data)
dragStart(evt)
dragEnd(evt)
onKeyPress(evt)
Rect

Type: {x: number, y: number, width: number, height: number}

Properties
x (number)
y (number)
width (number)
height (number)

lib

lib
Static Members
id(len)

Very simplistic EventEmitter.

new EventEmitter()
Instance Members
on(event, cb)
off(event, cb)
emit(event, data)
Callback

Type: function (({} | string)): void

fillReply

kernel/ipc.js

Copy attributes needed for a reply to a Message.

fillReply(reply: Message, message: Message): Message
Parameters
reply (Message) Reply Message to be filled.
message (Message) Message instance reply is a response to.
Returns
Message: Reply Message .

parseArgs

lib/args.js

parse argument options

Return an argument object argv populated with the array arguments from args. argv. contains all the arguments that didn't have an option associated with them. Numeric-looking arguments will be returned as numbers unless opts.string or opts.boolean is set for that argument name. Any arguments after '--' will not be parsed and will end up in argv..

parseArgs(args: Array<string>, opts: Opts): ArgV
Parameters
args (Array<string>) Arguments array.
opts (Opts) Parse options.
Returns
ArgV: argv object.
file(path: string, payload: {}?): Promise<File>
Parameters
path (string)
payload ({}?)
Returns
Promise<File>

notifyNewChannel

kernel/ipc.js

Helper function to notify a Process about new Channel creation.

notifyNewChannel(process: Process, channel: Cid, data: {}, message: Message): void
Parameters
process (Process) Process object instance.
channel (Cid) Channel ID.
data ({}) Channel data (process: Pid or path: Path ).
message (Message) OPEN Message it is a reply to.
Returns
void
process(name: string): Promise<Process>
Parameters
name (string)
Returns
Promise<Process>