Crates.io | nucleide |
lib.rs | nucleide |
version | 0.1.0 |
source | src |
created_at | 2022-06-19 23:33:03.01621 |
updated_at | 2023-06-13 03:32:57.597617 |
description | A crate to manipulate custom sections of a WebAssembly module to view/edit application metadata. |
homepage | https://github.com/ardaku/nucleide/blob/stable/CHANGELOG.md |
repository | https://github.com/ardaku/nucleide/ |
max_upload_size | |
id | 609151 |
size | 61,879 |
A crate to manipulate custom sections of a WebAssembly module to view/edit application metadata.
Nucleide specifies WASM metadata that is read by the Nucleic Desktop Environment. It includes the WebAssembly 2.0 and the Daku 1.0.0-beta.0 specifications.
Daku programs are a WebAssembly module that must have the daku
custom section,
are compressed with ZStd, and should use the .daku
file extension; thus the
Nucleide specification, as an extension of Daku, shall follow.
App data that can be displayed by a software manager, and where it comes from:
name
section => Module Name Subsectionproducers
section => Language Fieldproducers
section => Processed-By Fieldproducers
section => SDK Fielddaku
section => Portals Headerdaku
section => Translations Subsectiondaku
section => Description Translations Subsectiondaku
section => App Icon Themes Subsectiondaku
section => Description Assets Subsectiondaku
section => Tags Subsectiondaku
section => Categories Subsectiondaku
section => Organization Name SubsectionNucleide custom sections reuse WebAssembly types:
Byte
Simply an 8-bit integer.
Integer
A Unsigned LEB128 variable-length encoded litte-endian integer, with a maximum value of 2³²-1 (can be anywhere from 1-5 bytes).
Vector[T]
A sequence of the following:
size: Integer
data: [T; size]
Name
Containing valid UTF-8 (no null termination); wrapper around:
Vector[Byte]
NameMap
A Vector
, with each element containing a sequence of the following:
index: Integer
- Must be sorted in sequencename: Name
IndirectNameMap
A Vector
, with each element containing a sequence of the following:
index: Integer
- Must be sorted in sequencename_map: NameMap
name
)From the wasm spec, debug info. It is expected that apps are built with this
module generated for easier debugging, but stripped away and put into a separate
.name
file for distribution.
subsection: u8
: Each subsection is optional, and must be placed in this
order:
size: u32
: Number of bytesname: Name
: Name of the appname_map: NameMap
: Names of each functionindirect_name_map: IndirectNameMap
: Names of each variable in each functionindirect_name_map: IndirectNameMap
: Names of each label in each functionname_map: NameMap
: Names of each typename_map: NameMap
: Names of each tablename_map: NameMap
: Names of each memoryname_map: NameMap
: Names of each globalname_map: NameMap
: Names of each elementname_map: NameMap
: Names of each dataproducers
)From WebAssembly's tool conventions, information on how the .daku
WebAssembly file was generated.
A Vector
, with each element containing a sequence of the following:
name: Name
- One of:
"language"
"processed-by"
"sdk"
tool_version_pairs: Vector<(String, String)>
daku
)portals: Vector<Integer>
: List of Portal IDsFollowing the Daku portals list, is the nucleide extension:
subsection: u8
: Each subsection is optional, and must be placed in this
order:
size: u32
: Number of byteslocalized_names: NameMap
Integer representation of a 4-letter (2-letter lowercase language, 2-letter uppercase region) locale ASCII description:
locale: b"enUS"
locale[0] | locale[1] << 7 | locale[2] << 14 | locale[3] << 21
localized_mdfiles: NameMap
: Markdown file for each descriptionInteger representation of a 4-letter (2-letter lowercase language, 2-letter uppercase region) locale ASCII description:
locale: b"enUS"
locale[0] | locale[1] << 7 | locale[2] << 14 | locale[3] << 21
A Vector
, with each element containing a sequence of the following:
name: Name
: Theme name, "default"
or "reduced"
; reduced theme should be
binary (on/off) RGBA. default is full 0-255 range for each.data: Vector<u8>
: Concatenated list of QOI (future: or RVG) files.
Best resolution out of the files will be chosen. None can have the same
resolution.A Vector
, with each element containing a sequence of the following:
locale: Integer
: Set to 0 for non-localized assets.path: Name
: Markdown pathdata: Vector<u8>
: QOI (future: or RVG) file.A Vector
(limit 8), with each element containing:
tag: Name
: Name of the tag (all lowercase ASCII english words separated by
spaces; no -
or _
, other punctuation)A Vector
(limit 2), with each element containing:
tag: Byte
: App Category, one of:
organization: Name
: Name of organization that developed the software