playerthree/policy

Policy sandbox: loads agent-written policies (js source run in QuickJS-in-WASM, or a core wasm module) into an isolated worker thread per instance. See docs/POLICY_ABI.md.

Variables

loadPolicy

const loadPolicy: LoadPolicy;

Defined in: packages/playerthree/src/policy/index.ts:34

Loads one policy instance in its own sandbox worker: checks the runtime is allowed and matchData is JSON within MATCH_DATA_MAX_BYTES, then compiles (js: QuickJS source; wasm: module bytes, ABI-checked). Never throws for a bad artifact: the result carries a closed error code.


MAX_TABLE_ENTRIES

const MAX_TABLE_ENTRIES: 65536 = 65536;

Defined in: packages/playerthree/src/policy/index.ts:21

Total table entries a wasm policy may declare (tables are allocated on the worker's V8 heap).


WASM_DETAIL_SECTION

const WASM_DETAIL_SECTION: "playerthree.detail" = 'playerthree.detail';

Defined in: packages/playerthree/src/policy/index.ts:19

Custom section a wasm policy declares its observation detail in (UTF-8 JSON, POLICY_ABI.md).

Functions

checkWasmAbi()

function checkWasmAbi(info, limits): PolicyError | null;

Defined in: packages/playerthree/src/policy/index.ts:107

Enforces the policy ABI: imports, memory bounds and export signatures.

Parameters

ParameterType
infoWasmInfo
limitsPolicyLimits

Returns

PolicyError | null

References

LoadOptions

Re-exports LoadOptions


LoadPolicy

Re-exports LoadPolicy


LoadResult

Re-exports LoadResult


PolicyCallOutcome

Re-exports PolicyCallOutcome


PolicyCallResult

Re-exports PolicyCallResult


PolicyDetail

Re-exports PolicyDetail


PolicyInstance

Re-exports PolicyInstance