Skip to content

obj+me.virmesh.avatar.scriptSandbox

avatar WASM script と v1 sandbox policy を表す object です。

draft

Description

avatar に添付できる任意の WASM script と、その実行制限を表します。 v1 では host API を定義せず、network access、filesystem access、world mutation は許可しません。 クライアントは script 実行を拒否できます。

Aliases

  • avatarScriptSandbox
  • me.virmesh.avatar.scriptSandbox

Fields

urlstringRequired

WASM binary を取得する absolute URL です。

hashstringRequired

WASM binary body の content hash です。v1 では sha256:<base64url> を使います。

permissionsstring[]Required

script が要求する permission token 一覧です。v1 では avatar.self など低権限の token に限定します。

sandbox.runtimestringRequired

v1 では wasm です。

sandbox.networkbooleanRequired

network access を許可するかです。v1 では false です。

sandbox.filesystembooleanRequired

filesystem access を許可するかです。v1 では false です。

sandbox.worldMutationbooleanRequired

world state mutation を許可するかです。v1 では false です。

sandbox.maxMemoryBytesintegerRequired

script に許可する最大 memory byte 数です。

sandbox.maxExecutionMillisintegerRequired

1 tick または 1 call あたりの最大実行時間です。

Examples

wasm script sandbox

{
  "url": "https://cdn.example.com/avatars/avatar-script.wasm",
  "hash": "sha256:base64url-script-hash",
  "permissions": [
    "avatar.self"
  ],
  "sandbox": {
    "runtime": "wasm",
    "network": false,
    "filesystem": false,
    "worldMutation": false,
    "maxMemoryBytes": 16777216,
    "maxExecutionMillis": 5
  }
}

Referenced by

KindReferenceField
Object fieldobj+me.virmesh.avatar.manifestscript