Expand description
@opys/core — manifest data model, shorthand, Val/Valset, glob,
interpolation. Reference implementation of the frozen opys.json wire
format. Mirrors the TS package one-to-one.
Depends on opys-mojang-rules for the rule format/evaluator.
Structs§
- Artifact
- Artifact
Wire - Conditional
Val - Discovery
- Extract
Dump - Extract
Pick - Extract
Scan - Integrity
Probes - Launch
- Launch
Wire - Manifest
- Manifest
Wire - OsConstraint
- Constraint on OS as it appears in rule JSON. Every field is optional and independent — present must match, absent is ignored.
- OsOptions
- Platform context passed to rule evaluation. Free-form strings — these are live OS detection values, not constrained by the wire schema.
- Pointer
Descriptor - Pointer
Descriptor Wire - Size
Probes - Val
Enums§
- Decode
Error - Extract
Rule - A single extract rule, discriminated structurally on the wire (which
field is present:
file→ Pick,matches→ Scan, otherwise Dump). - Extract
Wire - Wire form: one rule or many. Decoding flattens both into
Vec<ExtractRule>; encoding emits the bare object when the list has exactly one entry. - Hash
Algo - Hash
Entry - HashRef
- Where a discovered hash sits, keyed by algorithm. The string is a location (header name or URL), not the hash itself.
- Integrity
- One entry, multiple entries, or omitted (= skip verification).
- OsArch
- OsName
- RawRuleset
- Wire form of a ruleset: a single entry or an array.
- RawSingle
- Wire form of a single rule entry: either a shorthand string or an expanded rule object.
- Rule
- A rule is
{ action }plus an optionalosorfeaturesconstraint. - Rule
Action - Rule
Error - Shorthand
Error - Source
- Source
Wire - Wire shape — discriminated by which field is present, NOT by a
kindtag. - ValDef
Functions§
- allow_
os_ ruleset - artifact_
applies - Free-fn alias for
Artifact::applies— kept until callers migrate. - decode_
artifact - decode_
extract - decode_
launch - decode_
manifest - decode_
pointer_ descriptor - decode_
source - deduplicate_
artifacts - Deduplicate by normalized path — later entries win.
- empty_
ruleset - encode_
artifact - encode_
extract - encode_
launch - encode_
manifest - encode_
pointer_ descriptor - encode_
short_ rule - encode_
short_ ruleset - encode_
source - encode_
val - encode_
val_ defs - encode_
valset - filter_
manifest - glob_
base - Longest non-glob prefix, truncated to the last
/. - glob_
to_ regex - Compile a glob to an anchored
Regex. Pattern source is^…$. - interpolate
- Substitute resolved vars into
template. Missing names stay as${name}. - parse_
manifest - parse_
pointer_ descriptor - parse_
short_ rule - parse_
short_ ruleset - parse_
val - parse_
val_ defs - parse_
valset - resolve_
val_ defs - For each key: flat → use as-is; arms → last matching arm wins.
- resolve_
valset - resolve_
vars - Resolve every
${ref}invars. Circular references throw. - resolved_
args - resolved_
envs - satisfies_
features - satisfies_
os - satisfies_
rule - satisfies_
ruleset
Type Aliases§
- Feature
Constraint - Feature constraint:
{ feature_name: required_value }. A feature is “satisfied” iff its presence in the active set matches the required bool. - Ruleset
- ValDefs
- Valset
- VarMap