Skip to content

Maintaining Static Hermes WASI support ​

Use this guide when you change the pinned WASI definitions, capability bundles, or Static Hermes native adapters. If you're developing a plugin, see the WASI guide for imports, permissions, resource ownership, and runtime limits.

Source files ​

ConcernSource
Capability names and interface expansiontools/wasi-capabilities/src/index.ts
WASI version, WIT files, hashes, source URLs, and generated WIT filestools/build/wasi-wit.lock.json
WIT download, SHA-256 verification, and versioned cachetools/build/src/wasi-wit.ts
Plugin-world imports and WIT file preparationtools/build/src/wit.ts
TypeScript declarations from the prepared worldtools/build/src/types.ts
TypeScript call analysis for used Pumpkin and WASI methodstools/build/src/wit-method-usage.ts
wasm-tools input and WIT parsersrc/wit/parser.ts
Dependency aliases and resolved WIT typessrc/wit/resolver.ts
Used methods, feature closure, event fields, and adapter planssrc/wit/analysis.ts
JavaScript facades and native adapter emissionsrc/wit/emitters.ts
Runtime shim and API enum generationsrc/wit/generation.ts
Hermes preparation stagessrc/hermes/prepare.ts
Hermes source pin and checkoutsrc/hermes/source.ts
Hermes patch seriessrc/hermes/patch.ts
Hermes build profiles, cache, and artifactssrc/hermes/build.ts
Component analysis, bindings, bytecode compilation, and linkingsrc/component/build.ts

Add or upgrade an interface ​

  1. Check that the target Pumpkin runtime provides the interface and supports its WIT/API version. The locked definitions and a generated adapter do not establish host support.
  2. Add or update the pinned files and hashes in tools/build/wasi-wit.lock.json. Put alternate source URLs in that lock too; for example, it records the wasi-http source for the WASI HTTP definitions.
  3. Add the interface to the appropriate bundle in tools/wasi-capabilities/src/index.ts, including its dependencies. The bundle builder deduplicates shared imports, so list only the interfaces each capability requires.
  4. Check feature-gated operations as well as their interfaces. Build analysis derives the required wit-bindgen features from the selected operations and passes them to code generation.
  5. Confirm that Static Hermes can convert each WIT parameter and result type. If it cannot, adapter planning reports an unsupported-operation error; add the conversion and any required resource ownership cleanup.
  6. Update adapter fixtures and coverage. The wit-api-coverage test checks planning and emission for every operation in the locked interfaces. The WASI WIT tests also cover imports, dependency resolution, resource handling, and feature selection.
  7. Test the imports and permissions against the target Pumpkin server. Generation checks show that Static Hermes can prepare an adapter, but they do not show that the server provides the import or implements the operation as expected.

Keep the pinned @pumpkin-plugins/pumpkin-api version aligned with the Pumpkin server plugin ABI, as described in Building. WASI has its own lock and host compatibility requirements.

pumpkin-plugins documentation