spec 12 §1 manifest format with strict TOML subset, [package] entry, [capabilities] by parameter name, [metadata]; aji run --manifest with operator precedence of --grant; spec 05 §10.2 and capabilities.md updated.
2.5 KiB
Capability Registry
Normative registry of capability kinds for AIR format 0 (spec 05 §10). A kind names the authority object a cap<K> refers to. An unregistered kind is E0004.
| Kind | Authorizes effects | Scope at instantiation | Narrowing forms |
|---|---|---|---|
clock.read |
clock.read |
none | — |
fs.read |
fs.read |
absolute path prefix | prefix |
fs.write |
fs.write |
absolute path prefix | prefix |
io.read |
io.read |
none | — |
io.write |
io.write |
none | — |
mem.alloc |
mem.alloc |
byte budget of live allocations; mandatory in the deterministic profile |
budget |
mem.map |
mem.map |
none | — |
net.connect |
net.connect |
none | — |
net.listen |
net.listen |
none | — |
net.read |
net.read |
none | — |
net.write |
net.write |
none | — |
process.env |
process.env |
none | — |
process.spawn |
process.spawn |
none | — |
random.read |
random.read |
none | — |
Narrowing forms marked with an RFC are registered when that RFC is accepted; until then every cap.narrow form is E3202.
Built-in enums
| Enum | Variants |
|---|---|
cap_error |
invalid_restriction, not_subset, unsupported_restriction |
alloc_error |
budget_exceeded, out_of_memory |
io_error |
not_found, permission_denied, already_exists, invalid_input, no_space, broken_pipe, connection_refused, connection_reset, address_in_use, address_unavailable, timed_out, other |
Variant sets of published built-in enums are frozen (spec 07 §8.7).
Narrowing forms
| Kind | Form | Argument | ok |
err (cap_error) |
|---|---|---|---|---|
fs.read, fs.write |
prefix |
path: slice<u8>, absolute, no empty/./.. components |
same kind scoped to path |
invalid_restriction if malformed; not_subset if not inside the current scope |
mem.alloc |
budget |
n: usize |
child authority with limit n, charges propagate to every ancestor; nothing reserved |
not_subset if n exceeds the parent's limit |
Instantiation
aji run --grant <parameter>=<kind>[:<scope>] binds one @main capability parameter. With aji run --manifest aji.toml, the manifest's [capabilities] entries (parameter = "kind[:scope]") are the grants, each replaced by a --grant for the same parameter (spec 12 §1). Every parameter needs exactly one grant of its kind and every grant must name a parameter (spec 05 §10.2). Scopes: path prefixes are absolute and contain no . or .. components; byte budgets are decimal integers.