ModManifest mods.mod-manifest@1

Generated at from openvibe-contracts v0.33.0 and openvibe-sdk v0.5.0.

Version
1.0.0
Owner
contracts
Visibility
public
Status
active
Compatibility
backward
Decision
ADR-013
Schema
https://openvibe.network/contracts/mods/mod-manifest.v1.json

A mod as the platform knows it (ADR-013): who publishes it, which runtime runs it, which capabilities it asks for and the resources it may use. Requested capabilities are only a request: the install's approved subset is the grant, and trust tiers are install metadata that never change a grant check. The runtime-specific payload (a data pack, a script bundle) is not part of the manifest.

Fields

FieldTypeRequiredDescriptionConstraints
idstringyesStable mod id; its principal subject is mod:<id>.
  • pattern ^mod_[0-9A-HJKMNP-TV-Z]{26}$
namestringyes
  • minLength 1
  • maxLength 80
versionstringyesSemantic version of this release.
  • pattern ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9A-Za-z.-]+)?$
descriptionstring
  • maxLength 1000
publisheridentity.subject-refyesWho publishes the mod (a user or an app subject).
targetstringyesWhere the mod runs: <service>.<surface>, e.g. games.browser, games.source, live.overlay.
  • pattern ^[a-z][a-z0-9-]{1,39}\.[a-z][a-z0-9-]{1,39}$
runtimestringyesRuntime adapter and its major version, e.g. games-content@1 (declarative data pack) or source-quickjs@1.
  • pattern ^[a-z][a-z0-9-]{1,39}@[1-9][0-9]{0,3}$
permissionsobjectyes
  • no other fields
permissions.capabilitiesarray of stringyesCapability ids the mod asks for (3+ segments). The target runtime binds only those it implements, and only once granted.
  • maxItems 64
  • unique items
  • items: pattern ^[a-z][a-z0-9_]*(\.[a-z0-9_]+){2,}$
permissions.eventsarray of stringEvent types the mod wants delivered to it.
  • maxItems 64
  • unique items
  • items: pattern ^[a-z][a-z0-9_]*(\.[a-z0-9_]+){2,}$
permissions.modulesarray of stringUser-module namespaces the mod wants to read or write (a trailing .* names a family).
  • maxItems 32
  • unique items
  • items: pattern ^[a-z][a-z0-9_]*(\.[a-z0-9_]+)*(\.\*)?$
permissions.mediaNamespacesarray of stringMedia namespaces the mod wants to read or write.
  • maxItems 32
  • unique items
  • items: pattern ^[a-z][a-z0-9_-]*(\.[a-z0-9_-]+)*$
resourcesobjectyesThe budget the mod asks for. Runtimes meter it; the sandbox that enforces it lives in OpenVibe.Host (Stage C).
  • no other fields
resources.cpuMsnumberyesCPU milliseconds per tick (game runtimes) or per request.
  • minimum 0
  • maximum 1000
resources.memoryMbintegeryes
  • minimum 0
  • maximum 4096
resources.storageMbintegeryes
  • minimum 0
  • maximum 102400
resources.outboundHostsarray of stringHosts the mod may reach over the network. Empty or absent = none.
  • maxItems 32
  • unique items
  • items: pattern ^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$
assetsmedia.media-refAssets the mod ships, as Media object references.
  • maxItems 256
compatibilityobjectyes
  • no other fields
compatibility.runtimestringyesSemver range of the runtime this release works with, e.g. ">=1.0.0 <2.0.0".
  • minLength 1
  • maxLength 100
compatibility.contractsstringSemver range of openvibe-contracts releases it was built against.
  • minLength 1
  • maxLength 100
homepagestring
  • pattern ^https://[^\s]{1,2000}$

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: town-square
{
  "id": "mod_01JABCDEFGHJKMNPQRSTVWXYZ0",
  "name": "Town Square",
  "version": "1.0.0",
  "description": "A public workbench and a greeting.",
  "publisher": {
    "type": "user",
    "id": "usr_01JABCDEFGHJKMNPQRSTVWXYZ0"
  },
  "target": "games.browser",
  "runtime": "games-content@1",
  "permissions": {
    "capabilities": [
      "games.world.announce",
      "games.prop.place"
    ]
  },
  "resources": {
    "cpuMs": 1,
    "memoryMb": 0,
    "storageMb": 0
  },
  "compatibility": {
    "runtime": ">=1.0.0 <2.0.0"
  }
}
Rejected: no-permissions
{
  "id": "mod_01JABCDEFGHJKMNPQRSTVWXYZ0",
  "name": "X",
  "version": "1.0.0",
  "publisher": {
    "type": "user",
    "id": "usr_01JABCDEFGHJKMNPQRSTVWXYZ0"
  },
  "target": "games.browser",
  "runtime": "games-content@1",
  "resources": {
    "cpuMs": 1,
    "memoryMb": 0,
    "storageMb": 0
  },
  "compatibility": {
    "runtime": ">=1.0.0"
  }
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('mods.mod-manifest@1', value);   // { valid, errors: [{ path, message }] }